Commit 64b74337 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-25109 Server crashes in sp_name::sp_name upon invalid data in mysql.proc

don't try to lowercase a db name if it's zero-length.
(empty_lex_str is not writable, even db.str[0]=0 will fail)
parent 2e279962
...@@ -148,3 +148,19 @@ drop table t1; ...@@ -148,3 +148,19 @@ drop table t1;
# #
# End of 10.2 tests # End of 10.2 tests
# #
#
# MDEV-25109 Server crashes in sp_name::sp_name upon invalid data in mysql.proc
#
call mtr.add_suppression("Stored routine ''.'': invalid value in column");
insert ignore into mysql.proc () values ();
Warnings:
Warning 1364 Field 'param_list' doesn't have a default value
Warning 1364 Field 'returns' doesn't have a default value
Warning 1364 Field 'body' doesn't have a default value
Warning 1364 Field 'comment' doesn't have a default value
show function status;
ERROR 42000: Incorrect routine name ''
delete from mysql.proc where name = '';
#
# End of 10.3 tests
#
...@@ -126,3 +126,16 @@ drop table t1; ...@@ -126,3 +126,16 @@ drop table t1;
--echo # --echo #
--echo # End of 10.2 tests --echo # End of 10.2 tests
--echo # --echo #
--echo #
--echo # MDEV-25109 Server crashes in sp_name::sp_name upon invalid data in mysql.proc
--echo #
call mtr.add_suppression("Stored routine ''.'': invalid value in column");
insert ignore into mysql.proc () values ();
--error ER_SP_WRONG_NAME
show function status;
delete from mysql.proc where name = '';
--echo #
--echo # End of 10.3 tests
--echo #
...@@ -111,7 +111,7 @@ class sp_name : public Sql_alloc, ...@@ -111,7 +111,7 @@ class sp_name : public Sql_alloc,
bool use_explicit_name) bool use_explicit_name)
: Database_qualified_name(db, name), m_explicit_name(use_explicit_name) : Database_qualified_name(db, name), m_explicit_name(use_explicit_name)
{ {
if (lower_case_table_names && m_db.str) if (lower_case_table_names && m_db.length)
m_db.length= my_casedn_str(files_charset_info, (char*) m_db.str); m_db.length= my_casedn_str(files_charset_info, (char*) m_db.str);
} }
......
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