summaryrefslogtreecommitdiff
path: root/sql/sql_update.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_update.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_update.cc')
-rw-r--r--sql/sql_update.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 2ca03620b17..f3ceb50c8c5 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -969,7 +969,8 @@ update_begin:
can_compare_record= records_are_comparable(table);
explain->tracker.on_scan_init();
- table->file->prepare_for_insert();
+ table->file->prepare_for_insert(1);
+ DBUG_ASSERT(table->file->inited != handler::NONE);
THD_STAGE_INFO(thd, stage_updating);
while (!(error=info.read_record()) && !thd->killed)
@@ -2028,7 +2029,7 @@ int multi_update::prepare(List<Item> &not_used_values,
{
table->read_set= &table->def_read_set;
bitmap_union(table->read_set, &table->tmp_set);
- table->file->prepare_for_insert();
+ table->file->prepare_for_insert(1);
}
}
if (unlikely(error))