mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-22654: Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())'
failed in Diagnostics_area::set_ok_status on FUNCTION replace When there is REPLACE in the statement, sp_drop_routine_internal() returns 0 (SP_OK) on success which is then assigned to ret. So ret becomes false and the error state is lost. The expression inside DBUG_ASSERT() evaluates to false and thus the assertion failure.
This commit is contained in:
@ -52,3 +52,20 @@ body
|
|||||||
DROP FUNCTION IF EXISTS f1;
|
DROP FUNCTION IF EXISTS f1;
|
||||||
Warnings:
|
Warnings:
|
||||||
Note 1305 FUNCTION test.f1 does not exist
|
Note 1305 FUNCTION test.f1 does not exist
|
||||||
|
#
|
||||||
|
# 10.1 Test
|
||||||
|
#
|
||||||
|
# MDEV-22654: Assertion `!is_set() || (m_status == DA_OK_BULK &&
|
||||||
|
# is_bulk_op())' failed in Diagnostics_area::set_ok_status on FUNCTION replace
|
||||||
|
#
|
||||||
|
SET GLOBAL log_bin_trust_function_creators=0;
|
||||||
|
CREATE FUNCTION f(c INT) RETURNS NUMERIC NO SQL RETURN 0;
|
||||||
|
CREATE OR REPLACE FUNCTION f(c INT) RETURNS INT RETURN 0;
|
||||||
|
ERROR HY000: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
|
||||||
|
CREATE OR REPLACE FUNCTION sp1_thisisaveryverylongnamelongnameverylongname_thisisaveryverylongname234872934(a INT) RETURNS INT RETURN 0;
|
||||||
|
ERROR 42000: Identifier name 'sp1_thisisaveryverylongnamelongnameverylongname_thisisaveryverylongname234872934' is too long
|
||||||
|
DROP FUNCTION IF EXISTS f;
|
||||||
|
Warnings:
|
||||||
|
Note 1305 FUNCTION test.f does not exist
|
||||||
|
SET GLOBAL log_bin_trust_function_creators=1;
|
||||||
|
# End of 10.1 Test
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
source include/have_log_bin.inc;
|
||||||
|
|
||||||
SET timestamp=UNIX_TIMESTAMP('2014-09-30 08:00:00');
|
SET timestamp=UNIX_TIMESTAMP('2014-09-30 08:00:00');
|
||||||
|
|
||||||
CREATE FUNCTION f1(str char(20))
|
CREATE FUNCTION f1(str char(20))
|
||||||
@ -39,3 +41,25 @@ DROP FUNCTION IF EXISTS f1;
|
|||||||
SELECT body FROM mysql.proc WHERE name like 'f1';
|
SELECT body FROM mysql.proc WHERE name like 'f1';
|
||||||
DROP FUNCTION IF EXISTS f1;
|
DROP FUNCTION IF EXISTS f1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # 10.1 Test
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-22654: Assertion `!is_set() || (m_status == DA_OK_BULK &&
|
||||||
|
--echo # is_bulk_op())' failed in Diagnostics_area::set_ok_status on FUNCTION replace
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
SET GLOBAL log_bin_trust_function_creators=0;
|
||||||
|
|
||||||
|
CREATE FUNCTION f(c INT) RETURNS NUMERIC NO SQL RETURN 0;
|
||||||
|
|
||||||
|
--error ER_BINLOG_UNSAFE_ROUTINE
|
||||||
|
CREATE OR REPLACE FUNCTION f(c INT) RETURNS INT RETURN 0;
|
||||||
|
|
||||||
|
--error ER_TOO_LONG_IDENT
|
||||||
|
CREATE OR REPLACE FUNCTION sp1_thisisaveryverylongnamelongnameverylongname_thisisaveryverylongname234872934(a INT) RETURNS INT RETURN 0;
|
||||||
|
|
||||||
|
DROP FUNCTION IF EXISTS f;
|
||||||
|
|
||||||
|
SET GLOBAL log_bin_trust_function_creators=1;
|
||||||
|
|
||||||
|
--echo # End of 10.1 Test
|
||||||
|
@ -1080,7 +1080,7 @@ sp_create_routine(THD *thd, stored_procedure_type type, sp_head *sp)
|
|||||||
{
|
{
|
||||||
if (lex->create_info.or_replace())
|
if (lex->create_info.or_replace())
|
||||||
{
|
{
|
||||||
if ((ret= sp_drop_routine_internal(thd, type, lex->spname, table)))
|
if (sp_drop_routine_internal(thd, type, lex->spname, table))
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
else if (lex->create_info.if_not_exists())
|
else if (lex->create_info.if_not_exists())
|
||||||
|
Reference in New Issue
Block a user