diff options
author | Rucha Deodhar <rucha.deodhar@mariadb.com> | 2020-08-04 13:21:54 +0530 |
---|---|---|
committer | Rucha Deodhar <rucha.deodhar@mariadb.com> | 2020-12-15 13:00:24 +0530 |
commit | 74223c33d1aeffac28b155c59646dc3df58e33fb (patch) | |
tree | ec20859ad942e65093230c4ba6763edf0aed3010 | |
parent | 5f4d351d7fe3dcae9f5d76d8027d54fa8392e66a (diff) | |
download | mariadb-git-74223c33d1aeffac28b155c59646dc3df58e33fb.tar.gz |
MDEV-23209: Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())'
failed in Diagnostics_area::set_ok_status on INSERT
Analysis: Error is not returned when strict mode is enabled and value is
truncated because double is outside range.
Fix: Return HA_ERR_AUTOINC_ERANGE if the error was reported when double is
outside range.
-rw-r--r-- | sql/handler.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/handler.cc b/sql/handler.cc index d2408767530..c38c604347a 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -3118,6 +3118,13 @@ int handler::update_auto_increment() (table->auto_increment_field_not_null && thd->variables.sql_mode & MODE_NO_AUTO_VALUE_ON_ZERO)) { + + /* + There could be an error reported because value was truncated + when strict mode is enabled. + */ + if (thd->is_error()) + DBUG_RETURN(HA_ERR_AUTOINC_ERANGE); /* Update next_insert_id if we had already generated a value in this statement (case of INSERT VALUES(null),(3763),(null): |