List:Commits« Previous MessageNext Message »
From:Georgi Kodinov Date:February 12 2009 9:55am
Subject:bzr push into mysql-5.1-bugteam branch (joro:2799 to 2800)
View as plain text  
 2800 Georgi Kodinov	2009-02-12 [merge]
      merged bug 33813 to 5.1-bugteam
      modified:
        mysql-test/r/windows.result
        mysql-test/t/windows.test
        sql/sql_yacc.yy

 2799 Chad MILLER	2009-02-11 [merge]
      Merge from bug tree.
      modified:
        sql/mysqld.cc

=== modified file 'mysql-test/r/windows.result'
--- a/mysql-test/r/windows.result	2008-10-26 17:05:24 +0000
+++ b/mysql-test/r/windows.result	2009-02-12 09:52:01 +0000
@@ -19,6 +19,24 @@ id	select_type	table	type	possible_keys	
 1	PRIMARY	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible WHERE noticed after reading const tables
 2	SUBQUERY	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
 DROP TABLE t1;
+CREATE DATABASE `TESTDB`;
+USE `TESTDB`;
+CREATE FUNCTION test_fn() RETURNS INTEGER
+BEGIN
+DECLARE rId bigint;
+RETURN rId;
+END
+//
+CREATE FUNCTION test_fn2() RETURNS INTEGER
+BEGIN
+DECLARE rId bigint;
+RETURN rId;
+END
+//
+DROP FUNCTION `TESTDB`.`test_fn`;
+DROP FUNCTION `testdb`.`test_fn2`;
+USE test;
+DROP DATABASE `TESTDB`;
 End of 5.0 tests.
 drop procedure if exists proc_1;
 create procedure proc_1() install plugin my_plug soname '\\root\\some_plugin.dll';

=== modified file 'mysql-test/t/windows.test'
--- a/mysql-test/t/windows.test	2008-10-17 08:49:23 +0000
+++ b/mysql-test/t/windows.test	2009-02-12 09:52:01 +0000
@@ -35,6 +35,37 @@ CREATE TABLE t1 (a int, b int); INSERT I
 EXPLAIN SELECT * FROM t1 WHERE b =  (SELECT max(2));
 DROP TABLE t1;
 
+#
+# Bug #33813: Schema names are case-sensitive in DROP FUNCTION
+#
+
+CREATE DATABASE `TESTDB`;
+
+USE `TESTDB`;
+DELIMITER //;
+
+CREATE FUNCTION test_fn() RETURNS INTEGER
+BEGIN
+DECLARE rId bigint;
+RETURN rId;
+END
+//
+
+CREATE FUNCTION test_fn2() RETURNS INTEGER
+BEGIN
+DECLARE rId bigint;
+RETURN rId;
+END
+//
+
+DELIMITER ;//
+
+DROP FUNCTION `TESTDB`.`test_fn`;
+DROP FUNCTION `testdb`.`test_fn2`;
+
+USE test;
+DROP DATABASE `TESTDB`;
+
 --echo End of 5.0 tests.
 
 --disable_warnings

=== modified file 'sql/sql_yacc.yy'
--- a/sql/sql_yacc.yy	2009-01-15 18:11:25 +0000
+++ b/sql/sql_yacc.yy	2009-02-12 09:52:01 +0000
@@ -9256,44 +9256,17 @@ drop:
             lex->drop_if_exists=$3;
             lex->name= $4;
           }
-        | DROP FUNCTION_SYM if_exists ident '.' ident
+        | DROP FUNCTION_SYM if_exists sp_name
           {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            sp_name *spname;
-            if (lex->sphead)
-            {
-              my_error(ER_SP_NO_DROP_SP, MYF(0), "FUNCTION");
-              MYSQL_YYABORT;
-            }
-            lex->sql_command = SQLCOM_DROP_FUNCTION;
-            lex->drop_if_exists= $3;
-            spname= new sp_name($4, $6, true);
-            if (spname == NULL)
-              MYSQL_YYABORT;
-            spname->init_qname(thd);
-            lex->spname= spname;
-          }
-        | DROP FUNCTION_SYM if_exists ident
-          {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            LEX_STRING db= {0, 0};
-            sp_name *spname;
+            LEX *lex=Lex;
             if (lex->sphead)
             {
               my_error(ER_SP_NO_DROP_SP, MYF(0), "FUNCTION");
               MYSQL_YYABORT;
             }
-            if (thd->db && lex->copy_db_to(&db.str, &db.length))
-              MYSQL_YYABORT;
             lex->sql_command = SQLCOM_DROP_FUNCTION;
             lex->drop_if_exists= $3;
-            spname= new sp_name(db, $4, false);
-            if (spname == NULL)
-              MYSQL_YYABORT;
-            spname->init_qname(thd);
-            lex->spname= spname;
+            lex->spname= $4;
           }
         | DROP PROCEDURE if_exists sp_name
           {

Thread
bzr push into mysql-5.1-bugteam branch (joro:2799 to 2800) Georgi Kodinov12 Feb