mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +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:
@@ -5502,29 +5502,6 @@ public:
|
||||
{
|
||||
lex= backup_lex;
|
||||
}
|
||||
|
||||
/*
|
||||
Stores the the processed record during INSERT/REPLACE. Used for assigning
|
||||
value of error_index in case of warning or error.
|
||||
*/
|
||||
ulonglong current_insert_index;
|
||||
|
||||
/*
|
||||
Error may take place in prepare phase and it might not be because of
|
||||
rows/values we are inserting into the table, it could be because of say
|
||||
something like wrong field name. In such case we want to return 0
|
||||
for error index.
|
||||
*/
|
||||
ulonglong correct_error_index(uint error_no)
|
||||
{
|
||||
if (error_no == ER_FIELD_SPECIFIED_TWICE ||
|
||||
error_no == ER_BAD_FIELD_ERROR ||
|
||||
error_no == ER_VIEW_NO_INSERT_FIELD_LIST ||
|
||||
error_no == ER_VIEW_MULTIUPDATE)
|
||||
return 0;
|
||||
|
||||
return current_insert_index;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user