diff options
author | Sergei Golubchik <serg@mariadb.org> | 2021-01-04 15:39:36 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2021-01-12 10:25:03 +0100 |
commit | d463677f7e4226e15ec3814860164cf4c7229e5f (patch) | |
tree | 5b2895a21961fd797f69892655be96ac56508b8d | |
parent | f7ff8f5dd9e99aa480bc7d56dff1a2a642f12b77 (diff) | |
download | mariadb-git-d463677f7e4226e15ec3814860164cf4c7229e5f.tar.gz |
failing to parse an SP should not abort information_schema.routines
-rw-r--r-- | mysql-test/main/sp-ucs2.result | 7 | ||||
-rw-r--r-- | mysql-test/main/sp-ucs2.test | 3 | ||||
-rw-r--r-- | sql/sql_show.cc | 3 |
3 files changed, 8 insertions, 5 deletions
diff --git a/mysql-test/main/sp-ucs2.result b/mysql-test/main/sp-ucs2.result index 0f5624314d7..389fa946ad5 100644 --- a/mysql-test/main/sp-ucs2.result +++ b/mysql-test/main/sp-ucs2.result @@ -142,7 +142,10 @@ DROP FUNCTION bug48766; call mtr.add_suppression('invalid value in column mysql.proc.'); set collation_connection=ucs2_general_ci; insert into mysql.proc (db, name, type, specific_name, language, sql_data_access, is_deterministic, security_type, param_list, returns, body, definer, created, modified, sql_mode, comment, character_set_client, collation_connection, db_collation, body_utf8 ) values ( 'a', 'a', 'function', 'bug14233_1', 'sql', 'reads_sql_data', 'no', 'definer', '', 'int(10)', 'select * from mysql.user', 'root@localhost', now(), '0000-00-00 00:00:00', '', '', '', '', '', 'select * from mysql.user' ); -select * from information_schema.routines where routine_name='a'; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 +select routine_name from information_schema.routines where routine_name='a'; +routine_name +a +Warnings: +Warning 1601 Creation context of stored routine `a`.`a` is invalid set collation_connection=default; delete from mysql.proc where name='a'; diff --git a/mysql-test/main/sp-ucs2.test b/mysql-test/main/sp-ucs2.test index 004d62f4cc5..3276da3e257 100644 --- a/mysql-test/main/sp-ucs2.test +++ b/mysql-test/main/sp-ucs2.test @@ -179,7 +179,6 @@ DROP FUNCTION bug48766; call mtr.add_suppression('invalid value in column mysql.proc.'); set collation_connection=ucs2_general_ci; insert into mysql.proc (db, name, type, specific_name, language, sql_data_access, is_deterministic, security_type, param_list, returns, body, definer, created, modified, sql_mode, comment, character_set_client, collation_connection, db_collation, body_utf8 ) values ( 'a', 'a', 'function', 'bug14233_1', 'sql', 'reads_sql_data', 'no', 'definer', '', 'int(10)', 'select * from mysql.user', 'root@localhost', now(), '0000-00-00 00:00:00', '', '', '', '', '', 'select * from mysql.user' ); ---error ER_PARSE_ERROR -select * from information_schema.routines where routine_name='a'; +select routine_name from information_schema.routines where routine_name='a'; set collation_connection=default; delete from mysql.proc where name='a'; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index aef07fa4425..f25a8861bc1 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -5059,7 +5059,8 @@ public: Sql_condition::enum_warning_level *level, const char* msg, Sql_condition ** cond_hdl) { - if (sql_errno == ER_TRG_NO_DEFINER || sql_errno == ER_TRG_NO_CREATION_CTX) + if (sql_errno == ER_TRG_NO_DEFINER || sql_errno == ER_TRG_NO_CREATION_CTX + || sql_errno == ER_PARSE_ERROR) return true; if (*level != Sql_condition::WARN_LEVEL_ERROR) |