summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <thek@kpdesk.mysql.com>2006-12-01 12:50:57 +0100
committerunknown <thek@kpdesk.mysql.com>2006-12-01 12:50:57 +0100
commit2f0b1d658090e284acaec088eca9f7a6b5a4118b (patch)
tree29bb4100622df30ed4d77f0bd4f727c662c48c7d /mysql-test
parent9a87702b033bc9bab337e716a52532c4e4599057 (diff)
downloadmariadb-git-2f0b1d658090e284acaec088eca9f7a6b5a4118b.tar.gz
Bug#22043 MySQL don't add "USE <DATABASE>" before "DROP PROCEDURE IF EXISTS"
- Refactoring of duplicate code - Modified bad test cases - Changed expected error when operating on information_schema. mysql-test/r/information_schema.result: - updated result file with new error code. mysql-test/r/rpl_sp.result: - Modified test case mysql-test/t/information_schema.test: - Changed error code for operations on information_schema mysql-test/t/rpl_sp.test: - Modified test case sql/sql_parse.cc: - Cleaned up code: * replace tab with space * simplified if/switch statements * refactored duplicated code
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/information_schema.result2
-rw-r--r--mysql-test/r/rpl_sp.result21
-rw-r--r--mysql-test/t/information_schema.test2
-rw-r--r--mysql-test/t/rpl_sp.test3
4 files changed, 13 insertions, 15 deletions
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index 3fffce73aa9..4de6e3c823d 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -1027,7 +1027,7 @@ CREATE PROCEDURE p1 ()
BEGIN
SELECT 'foo' FROM DUAL;
END |
-ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+ERROR 42000: Unknown database 'information_schema'
select ROUTINE_NAME from routines;
ROUTINE_NAME
grant all on information_schema.* to 'user1'@'localhost';
diff --git a/mysql-test/r/rpl_sp.result b/mysql-test/r/rpl_sp.result
index d6f9880de17..5c35cd8097f 100644
--- a/mysql-test/r/rpl_sp.result
+++ b/mysql-test/r/rpl_sp.result
@@ -465,6 +465,7 @@ RETURN 0
DROP PROCEDURE p1;
DROP FUNCTION f1;
drop table t1;
+reset master;
drop database if exists mysqltest;
drop database if exists mysqltest2;
create database mysqltest;
@@ -473,19 +474,15 @@ use mysqltest2;
create table t ( t integer );
create procedure mysqltest.test() begin end;
insert into t values ( 1 );
-show binlog events in 'master-bin.000001' from 8186;
+show binlog events in 'master-bin.000001' from 98;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 8186 Query 1 8317 use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION f1() RETURNS INT RETURN 0
-master-bin.000001 8317 Query 1 8397 use `test`; DROP PROCEDURE p1
-master-bin.000001 8397 Query 1 8476 use `test`; DROP FUNCTION f1
-master-bin.000001 8476 Query 1 8552 use `test`; drop table t1
-master-bin.000001 8552 Query 1 8653 drop database if exists mysqltest
-master-bin.000001 8653 Query 1 8756 drop database if exists mysqltest2
-master-bin.000001 8756 Query 1 8849 create database mysqltest
-master-bin.000001 8849 Query 1 8944 create database mysqltest2
-master-bin.000001 8944 Query 1 9041 use `mysqltest2`; create table t ( t integer )
-master-bin.000001 9041 Query 1 9180 use `mysqltest2`; CREATE DEFINER=`root`@`localhost` procedure mysqltest.test() begin end
-master-bin.000001 9180 Query 1 9275 use `mysqltest2`; insert into t values ( 1 )
+master-bin.000001 98 Query 1 199 drop database if exists mysqltest
+master-bin.000001 199 Query 1 302 drop database if exists mysqltest2
+master-bin.000001 302 Query 1 395 create database mysqltest
+master-bin.000001 395 Query 1 490 create database mysqltest2
+master-bin.000001 490 Query 1 587 use `mysqltest2`; create table t ( t integer )
+master-bin.000001 587 Query 1 726 use `mysqltest2`; CREATE DEFINER=`root`@`localhost` procedure mysqltest.test() begin end
+master-bin.000001 726 Query 1 821 use `mysqltest2`; insert into t values ( 1 )
create procedure `\\`.test() begin end;
ERROR 42000: Incorrect database name '\\'
drop database mysqltest;
diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test
index 27007bbe16a..18e5faf7178 100644
--- a/mysql-test/t/information_schema.test
+++ b/mysql-test/t/information_schema.test
@@ -715,7 +715,7 @@ create temporary table schemata(f1 char(10));
# Bug #10708 SP's can use INFORMATION_SCHEMA as ROUTINE_SCHEMA
#
delimiter |;
---error 1044
+--error ER_BAD_DB_ERROR
CREATE PROCEDURE p1 ()
BEGIN
SELECT 'foo' FROM DUAL;
diff --git a/mysql-test/t/rpl_sp.test b/mysql-test/t/rpl_sp.test
index b7a9036908c..5dc4ba5a4db 100644
--- a/mysql-test/t/rpl_sp.test
+++ b/mysql-test/t/rpl_sp.test
@@ -524,6 +524,7 @@ sync_slave_with_master;
# Bug22043: MySQL don't add "USE <DATABASE>" before "DROP PROCEDURE IF EXISTS"
#
connection master;
+reset master;
--disable_warnings
drop database if exists mysqltest;
drop database if exists mysqltest2;
@@ -534,7 +535,7 @@ use mysqltest2;
create table t ( t integer );
create procedure mysqltest.test() begin end;
insert into t values ( 1 );
-show binlog events in 'master-bin.000001' from 8186;
+show binlog events in 'master-bin.000001' from 98;
--error ER_WRONG_DB_NAME
create procedure `\\`.test() begin end;
# Clean up