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-04 18:18:45 +0530 |
commit | 43abfb40a090bcb5a676abd6d980664f72ed6b6d (patch) | |
tree | 18790ea55afaa1e0076a7ad5cd2ca3c9745ea259 | |
parent | c16672ae510476339472d4b9bd4c3015dc4596c7 (diff) | |
download | mariadb-git-bb-10.2-rucha.tar.gz |
MDEV-23209: Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())'bb-10.2-rucha
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): |