summaryrefslogtreecommitdiff
path: root/sql/sql_load.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2020-04-12 18:09:09 +0200
committerSergei Golubchik <serg@mariadb.org>2020-04-12 22:10:57 +0200
commitfcd84da5f112b84bec05db5ea59660e59cd2204b (patch)
tree1792d45f64e45621bb02aa8f0dc6a14b13db77f2 /sql/sql_load.cc
parent8c0b988073c6537f53bcda0afbba0f4ce20fae34 (diff)
downloadmariadb-git-fcd84da5f112b84bec05db5ea59660e59cd2204b.tar.gz
MDEV-22218 InnoDB: Failing assertion: node->pcur->rel_pos == BTR_PCUR_ON upon LOAD DATA with NO_BACKSLASH_ESCAPES in SQL_MODE and unique blob in table
`inited == NONE` at the initialization time does not always mean that it'll be `NONE` later, at the execution time. Use a more complex caller-specific logic to decide whether to create a cloned lookup handler. Besides LOAD (as in the original bug report) make sure that all prepare_for_insert() invocations are covered by tests. Add tests for CREATE ... SELECT, multi-UPDATE, and multi-DELETE. Don't enable write cache with long uniques.
Diffstat (limited to 'sql/sql_load.cc')
-rw-r--r--sql/sql_load.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 3d1f0bf0958..3ce37170b48 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -651,12 +651,14 @@ int mysql_load(THD *thd, const sql_exchange *ex, TABLE_LIST *table_list,
thd->abort_on_warning= !ignore && thd->is_strict_mode();
+ bool create_lookup_handler= handle_duplicates != DUP_ERROR;
if ((table_list->table->file->ha_table_flags() & HA_DUPLICATE_POS))
{
+ create_lookup_handler= true;
if ((error= table_list->table->file->ha_rnd_init_with_error(0)))
goto err;
}
- table->file->prepare_for_insert();
+ table->file->prepare_for_insert(create_lookup_handler);
thd_progress_init(thd, 2);
if (table_list->table->validate_default_values_of_unset_fields(thd))
{