[core] fix long sql stmts may be skipped, introduced in 2e88c67c9de5452c7e442d8e7fd35ca0172ad569 in 2009

This commit is contained in:
Anthony Minessale 2020-06-23 05:49:50 +00:00 committed by Andrey Volk
parent 79586ea218
commit 55922ac6d0

View File

@ -790,12 +790,8 @@ static switch_status_t switch_cache_db_execute_sql_chunked(switch_cache_db_handl
p--;
}
if (p <= s)
break;
status = switch_cache_db_execute_sql_real(dbh, s, err);
if (status != SWITCH_STATUS_SUCCESS || (err && *err)) {
if (p <= s || status != SWITCH_STATUS_SUCCESS || (err && *err)) {
break;
}