summaryrefslogtreecommitdiff
path: root/sql/sql_insert.cc
diff options
context:
space:
mode:
authorAleksey Midenkov <midenok@gmail.com>2019-12-02 11:48:37 +0300
committerAleksey Midenkov <midenok@gmail.com>2019-12-02 11:48:37 +0300
commit498a96a4789e58549ce87b5843e804e055ab327f (patch)
tree36da2d9f9c8180fbad55e0413c70f8c0702b68f0 /sql/sql_insert.cc
parent57cab7cd5114d3ef47203118cddd3ad0a22f2861 (diff)
downloadmariadb-git-498a96a4789e58549ce87b5843e804e055ab327f.tar.gz
MDEV-20441 ER_CRASHED_ON_USAGE upon update on versioned Aria table
Turn read cache off for update and multi-update for versioned table. no_cache is reinited on each TABLE open because it is applicable for specific algorithms. As a side fix vers_insert_history_row() honors vers_write setting. Aria with row_format=fixed uses IO_CACHE of type READ_CACHE for sequential read in update loop. When history row is inserted inside this loop the cache misses it and fails with error. TODO: Currently maria_extra() does not support SEQ_READ_APPEND. Probably it might be possible to use this type of cache.
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r--sql/sql_insert.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 334b6b2d667..e747b645e9d 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -1646,6 +1646,8 @@ static int last_uniq_key(TABLE *table,uint keynr)
int vers_insert_history_row(TABLE *table)
{
DBUG_ASSERT(table->versioned(VERS_TIMESTAMP));
+ if (!table->vers_write)
+ return 0;
restore_record(table,record[1]);
// Set Sys_end to now()