Commit 74223c33 authored by Rucha Deodhar's avatar Rucha Deodhar

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.
parent 5f4d351d
......@@ -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):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment