diff options
author | Eugene Kosov <claprix@yandex.ru> | 2018-02-02 15:01:53 +0300 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2018-02-24 00:50:55 +0100 |
commit | edeeaac45180373ac268cc8d0feb220b82d0519f (patch) | |
tree | acafcc60b51fed7db42fbe1a5dab709bb76d1d1b /sql/sql_update.cc | |
parent | 75afaa7e0052e4b8152e04d018a441d54a945bb3 (diff) | |
download | mariadb-git-edeeaac45180373ac268cc8d0feb220b82d0519f.tar.gz |
MDEV-14829 Assertion `0' failed in Protocol::end_statement upon concurrent UPDATE
vers_insert_history_row(): do not insert rows with zero or negative lifetime.
mysql_update(): properly handle error from vers_insert_history_row()
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r-- | sql/sql_update.cc | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc index b5bae06e1fb..38638d3aa1d 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -948,25 +948,22 @@ update_begin: } else if (!error) { - updated++; - if (has_vers_fields && table->versioned()) { if (table->versioned(VERS_TIMESTAMP)) { store_record(table, record[2]); - if ((error = vers_insert_history_row(table))) - { - restore_record(table, record[2]); - break; - } + error= vers_insert_history_row(table); restore_record(table, record[2]); } - updated_sys_ver++; + if (!error) + updated_sys_ver++; } + if (!error) + updated++; } - else if (!ignore || - table->file->is_fatal_error(error, HA_CHECK_ALL)) + + if (error && (!ignore || table->file->is_fatal_error(error, HA_CHECK_ALL))) { /* If (ignore && error is ignorable) we don't have to |