diff options
author | Eugene Kosov <claprix@yandex.ru> | 2018-05-17 09:33:04 +0300 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2018-05-22 13:11:14 +0200 |
commit | aa5683d12e653a743f89b3ace87c62b97bd96dd2 (patch) | |
tree | 17bfefedaef2d05c22af9ad603d2770ce0ed96a2 /sql/sql_delete.cc | |
parent | 4ec8598c1dcb63499bce998142b8e5b8b09b2d30 (diff) | |
download | mariadb-git-aa5683d12e653a743f89b3ace87c62b97bd96dd2.tar.gz |
MDEV-15380 Index for versioned table gets corrupt after partitioning and DELETE
In a test case Update occurs between Search and Delete/Update. This corrupts rowid
which Search saves for Delete/Update. Patch prevents this by using of
HA_EXTRA_REMEMBER_POS and HA_EXTRA_RESTORE_POS in a partition code.
This situation possibly occurs only with system versioning table and partition.
MyISAM and Aria engines are affected.
fix by midenok
Closes #705
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r-- | sql/sql_delete.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 3686f866e23..b6ca2e956cb 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -254,7 +254,12 @@ int TABLE::delete_row() store_record(this, record[1]); vers_update_end(); - return file->ha_update_row(record[1], record[0]); + int res; + if ((res= file->extra(HA_EXTRA_REMEMBER_POS))) + return res; + if ((res= file->ha_update_row(record[1], record[0]))) + return res; + return file->extra(HA_EXTRA_RESTORE_POS); } |