summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorRucha Deodhar <rucha.deodhar@mariadb.com>2020-08-04 13:21:54 +0530
committerRucha Deodhar <rucha.deodhar@mariadb.com>2020-08-04 14:45:23 +0530
commit28b3e0b2c5feec80f81403ff90b58f15a5d49e48 (patch)
tree8760924b2cc2bd8bc2583a0f0dfb7b12f82e4765 /sql/handler.cc
parente6cb263ef3ecc59510b62f7c7dd5dfcd78a613c7 (diff)
downloadmariadb-git-bb-10.1-MDEV-23209.tar.gz
MDEV-23209: Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())'bb-10.1-MDEV-23209
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.
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 76a187f4312..e5f65626d40 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -3065,6 +3065,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):