1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-16903 Assertion `!auto_increment_field_not_null' failed in TABLE::init after unsuccessful attempt to add CHECK constraint on temporary table

if the CHECK constraint failed in copy_data_between_tables(),
the loop was aborted prematurely and to->auto_increment_field_not_null
wasn't reset.
This commit is contained in:
Sergei Golubchik
2018-12-14 14:28:30 +01:00
parent a79183b01e
commit 7b2e2288e9
4 changed files with 34 additions and 15 deletions

View File

@ -1140,8 +1140,7 @@ TABLE *THD::open_temporary_table(TMP_TABLE_SHARE *share,
@return Success false
Failure true
*/
bool THD::find_and_use_tmp_table(const TABLE_LIST *tl,
TABLE **out_table)
bool THD::find_and_use_tmp_table(const TABLE_LIST *tl, TABLE **out_table)
{
DBUG_ENTER("THD::find_and_use_tmp_table");
@ -1151,11 +1150,9 @@ bool THD::find_and_use_tmp_table(const TABLE_LIST *tl,
key_length= create_tmp_table_def_key(key, tl->get_db_name(),
tl->get_table_name());
result=
use_temporary_table(find_temporary_table(key, key_length,
TMP_TABLE_NOT_IN_USE),
out_table);
result= use_temporary_table(find_temporary_table(key, key_length,
TMP_TABLE_NOT_IN_USE),
out_table);
DBUG_RETURN(result);
}