MDEV-30277: Assertion failure in Diagnostics_area::set_error_status

/ Reprepare_observer::report_error

Analysis:
Error is not reported when we hit invalid default parameter error
Fix:
Return appropriate value on error.
This commit is contained in:
Rucha Deodhar 2025-09-17 18:10:22 +05:30
parent 6aa7498313
commit f0bef17b82
3 changed files with 32 additions and 0 deletions

View File

@ -6047,3 +6047,15 @@ a b c
1 1970-01-01 09:00:01 6
DROP TABLE t;
# End of 10.6 tests
# Beginning of 10.11 test
#
# MDEV-30277: Assertion failure in Diagnostics_area::set_error_status
# / Reprepare_observer::report_error
#
CREATE TABLE t (a INT);
PREPARE stmt FROM " DELETE FROM t LIMIT ?";
ALTER TABLE t FORCE;
EXECUTE stmt USING DEFAULT;
ERROR HY000: Default/ignore value is not supported for such parameter usage
DROP TABLE t;
# End of 10.11 test

View File

@ -5498,3 +5498,20 @@ SELECT * FROM t;
DROP TABLE t;
--echo # End of 10.6 tests
--echo # Beginning of 10.11 test
--echo #
--echo # MDEV-30277: Assertion failure in Diagnostics_area::set_error_status
--echo # / Reprepare_observer::report_error
--echo #
CREATE TABLE t (a INT);
PREPARE stmt FROM " DELETE FROM t LIMIT ?";
ALTER TABLE t FORCE;
--error ER_INVALID_DEFAULT_PARAM
EXECUTE stmt USING DEFAULT;
DROP TABLE t;
--echo # End of 10.11 test

View File

@ -4894,6 +4894,9 @@ mysql_execute_command(THD *thd, bool is_called_from_prepared_stmt)
DBUG_ASSERT(select_lex->limit_params.offset_limit == 0);
unit->set_limit(select_lex);
if (thd->is_error())
goto error;
MYSQL_DELETE_START(thd->query());
Protocol *save_protocol= NULL;