1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-10075: Provide index of error causing error in array INSERT

use existing Warning_info::m_current_row_for_warning instead
of a newly introduced counter.

But use m_current_row_for_warning to count rows also in the parser
and during prepare.
This commit is contained in:
Sergei Golubchik
2021-09-15 15:54:49 +02:00
parent 0ff8976e12
commit d552e092c9
13 changed files with 43 additions and 82 deletions

View File

@ -908,7 +908,6 @@ THD::THD(my_thread_id id, bool is_wsrep_applier)
org_charset= 0;
/* Restore THR_THD */
set_current_thd(old_THR_THD);
current_insert_index= 0;
}
@ -1056,8 +1055,6 @@ Sql_condition* THD::raise_condition(uint sql_errno,
{
Diagnostics_area *da= get_stmt_da();
Sql_condition *cond= NULL;
ulonglong saved_error_index;
DBUG_ENTER("THD::raise_condition");
DBUG_ASSERT(level < Sql_condition::WARN_LEVEL_END);
@ -1152,10 +1149,7 @@ Sql_condition* THD::raise_condition(uint sql_errno,
if (likely(!(is_fatal_error && (sql_errno == EE_OUTOFMEMORY ||
sql_errno == ER_OUTOFMEMORY))))
{
saved_error_index= this->current_insert_index;
this->current_insert_index= this->correct_error_index(sql_errno);
cond= da->push_warning(this, sql_errno, sqlstate, level, ucid, msg);
this->current_insert_index= saved_error_index;
}
DBUG_RETURN(cond);
}