mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Fixes bug #14569. When no db is selected as current and we do create procedure db.sp()...
we changing current db temporarily and restore it when sp is created. however thd->db in this case becomes empty string rather than NULL and so all checks of thd->db == NULL will be false. So if after this we'll issue create procedure sp2()... without specifying db it will succeed and create sp with db=NULL, which causes mysqldto crash on show procedure status statement. This patch fixes the problem. mysql-test/r/sp-error.result: Result for bug #14569. mysql-test/t/sp-error.test: Test for bug #14569. sql/sql_db.cc: Fixes bug #14569. When no db is selected as current and we do create procedure db.sp()... we changing current db temporarily and restore it when sp is created. however thd->db in this case becomes empty string rather than NULL and so all checks of thd->db == NULL will be false. This patch fixes this issue. sql/sql_parse.cc: Fixes bug #14569. Reverted from initial patch to check thd->db for null values only.
This commit is contained in:
@ -1337,6 +1337,22 @@ DROP PROCEDURE bug13037_p1;
|
||||
DROP PROCEDURE bug13037_p2;
|
||||
DROP PROCEDURE bug13037_p3;
|
||||
|
||||
#
|
||||
# Bug#14569 "editing a stored procedure kills mysqld-nt"
|
||||
#
|
||||
create database mysqltest1;
|
||||
create database mysqltest2;
|
||||
use mysqltest1;
|
||||
drop database mysqltest1;
|
||||
create procedure mysqltest2.p1() select version();
|
||||
--error ER_NO_DB_ERROR
|
||||
create procedure p2() select version();
|
||||
use mysqltest2;
|
||||
--replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
|
||||
show procedure status;
|
||||
drop database mysqltest2;
|
||||
use test;
|
||||
|
||||
|
||||
# BUG#NNNN: New bug synopsis
|
||||
#
|
||||
|
Reference in New Issue
Block a user