summaryrefslogtreecommitdiff
path: root/sql/sql_insert.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2017-01-10 18:28:24 +0200
committerMonty <monty@mariadb.org>2017-01-11 09:19:45 +0200
commit5f0c31f928338e8a6ffde098b7ffd3d1a8b02903 (patch)
treeac246928fcfa0b9fe0c63a5511a3c74fef167f3c /sql/sql_insert.cc
parent177c191ff4b9c0033665a292fdb5907095ddb823 (diff)
downloadmariadb-git-5f0c31f928338e8a6ffde098b7ffd3d1a8b02903.tar.gz
MDEV-11597 Assertion when doing select from virtual column with impossible value
- Changed error handlers interface so that they can change error level in the handler - Give warnings and errors when calculating virtual columns - On insert/update error is fatal in strict mode. - SELECT and DELETE will only give a warning if a virtual field generates an error - Added VCOL_UPDATE_FOR_DELETE and VCOL_UPDATE_INDEX_FOR_REPLACE to be able to easily detect in update_virtual_fields() if we should use an error handler to mask errors or not.
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r--sql/sql_insert.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index cea42667c48..b9c1dcebee9 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -3174,6 +3174,7 @@ bool Delayed_insert::handle_inserts(void)
while ((row=rows.get()))
{
+ int tmp_error;
stacked_inserts--;
mysql_mutex_unlock(&mutex);
memcpy(table->record[0],row->record,table->s->reclength);
@@ -3250,16 +3251,18 @@ bool Delayed_insert::handle_inserts(void)
table->file->extra(HA_EXTRA_INSERT_WITH_UPDATE);
thd.clear_error(); // reset error for binlog
+ tmp_error= 0;
if (table->vfield)
{
/*
- Virtual fields where not calculated by caller as the temporary TABLE object used
- had vcol_set empty. Better to calculate them here to make the caller faster.
+ Virtual fields where not calculated by caller as the temporary
+ TABLE object used had vcol_set empty. Better to calculate them
+ here to make the caller faster.
*/
- table->update_virtual_fields(VCOL_UPDATE_FOR_WRITE);
+ tmp_error= table->update_virtual_fields(VCOL_UPDATE_FOR_WRITE);
}
- if (write_record(&thd, table, &info))
+ if (tmp_error || write_record(&thd, table, &info))
{
info.error_count++; // Ignore errors
thread_safe_increment(delayed_insert_errors,&LOCK_delayed_status);