List:Commits« Previous MessageNext Message »
From:kpettersson Date:November 8 2006 2:58pm
Subject:bk commit into 5.0 tree (Kristofer.Pettersson:1.2274) BUG#22043
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of Kristofer Pettersson. When Kristofer Pettersson does a push these
changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2006-11-08 14:57:46+01:00, Kristofer.Pettersson@naruto. +6 -0
  Bug#22043 - MySQL don't add "USE <DATABASE>" before "DROP PROCEDURE IF EXISTS"
  
  - CREATE PROCEDURE stores database name based on query context instead
    of 'current database' as set by 'USE' according to manual.
    The bugreporter interpret the filtering statements as a bug for 
    DROP PROCEDURE based on this behavior.
  - Removed the code which changes db context.
  - Added code to check that a valid db was supplied.

  mysql-test/r/rpl_binlog.result@stripped, 2006-11-08 14:57:43+01:00,
Kristofer.Pettersson@naruto. +10 -0
    - Added test case

  mysql-test/r/rpl_binlog.result@stripped, 2006-11-08 14:57:43+01:00,
Kristofer.Pettersson@naruto. +0 -0

  mysql-test/r/sp-error.result@stripped, 2006-11-08 14:57:42+01:00,
Kristofer.Pettersson@naruto. +1 -1
    - Introduced a new error code and changed test case accordingly.

  mysql-test/t/rpl_binlog.test@stripped, 2006-11-08 14:57:43+01:00,
Kristofer.Pettersson@naruto. +5 -0
    - Added test case

  mysql-test/t/rpl_binlog.test@stripped, 2006-11-08 14:57:43+01:00,
Kristofer.Pettersson@naruto. +0 -0

  mysql-test/t/sp-error.test@stripped, 2006-11-08 14:57:42+01:00,
Kristofer.Pettersson@naruto. +1 -1
    - Introduced a new error code and changed test case accordingly.

  sql/sp.cc@stripped, 2006-11-08 14:57:42+01:00, Kristofer.Pettersson@naruto. +0 -9
    - Removed code for changing current db context.

  sql/sql_parse.cc@stripped, 2006-11-08 14:57:43+01:00, Kristofer.Pettersson@naruto. +12 -0
    - Added code to check if a valid db was supplied.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	Kristofer.Pettersson
# Host:	naruto.
# Root:	C:/cpp/bug22043/my50-bug22043

--- 1.574/sql/sql_parse.cc	2006-11-08 14:58:06 +01:00
+++ 1.575/sql/sql_parse.cc	2006-11-08 14:58:06 +01:00
@@ -4222,6 +4222,18 @@
     DBUG_ASSERT(lex->sphead != 0);
     DBUG_ASSERT(lex->sphead->m_db.str); /* Must be initialized in the parser */
 
+    /* 
+      Verify db name and existance
+    */
+    if (check_db_name(lex->sphead->m_db.str)
+        || check_db_dir_existence(lex->sphead->m_db.str))
+    {
+      my_error(ER_WRONG_DB_NAME, MYF(0), lex->sphead->m_db.str);
+      delete lex->sphead;
+      lex->sphead= 0;
+      goto error;
+    }
+
     if (check_access(thd, CREATE_PROC_ACL, lex->sphead->m_db.str, 0, 0, 0,
                      is_schema_db(lex->sphead->m_db.str)))
     {
--- New file ---
+++ mysql-test/r/rpl_binlog.result	06/11/08 14:57:43
drop database if exists test;
create database test;
use mysql;
create procedure test.test() begin end;
show binlog events in 'master-bin.000001' from 4;
Log_name	Pos	Event_type	Server_id	End_log_pos	Info
master-bin.000001	4	Format_desc	1	98	Server ver: 5.0.26-debug-log, Binlog ver: 4
master-bin.000001	98	Query	1	189	drop database if exists test
master-bin.000001	189	Query	1	272	create database test
master-bin.000001	272	Query	1	401	use `mysql`; CREATE DEFINER=`root`@`localhost` procedure
test.test() begin end

--- New file ---
+++ mysql-test/t/rpl_binlog.test	06/11/08 14:57:43
drop database if exists test;
create database test;
use mysql;
create procedure test.test() begin end;
show binlog events in 'master-bin.000001' from 4;


--- 1.108/mysql-test/r/sp-error.result	2006-11-08 14:58:06 +01:00
+++ 1.109/mysql-test/r/sp-error.result	2006-11-08 14:58:06 +01:00
@@ -432,7 +432,7 @@
 drop procedure bug3279|
 drop table t3|
 create procedure nodb.bug3339() begin end|
-ERROR 42000: Unknown database 'nodb'
+ERROR 42000: Incorrect database name 'nodb'
 create procedure bug2653_1(a int, out b int)
 set b = aa|
 create procedure bug2653_2(a int, out b int)

--- 1.108/mysql-test/t/sp-error.test	2006-11-08 14:58:06 +01:00
+++ 1.109/mysql-test/t/sp-error.test	2006-11-08 14:58:06 +01:00
@@ -595,7 +595,7 @@
 #
 # BUG#3339
 #
---error 1049
+--error 1102
 create procedure nodb.bug3339() begin end|
 
 #

--- 1.117/sql/sp.cc	2006-11-08 14:58:06 +01:00
+++ 1.118/sql/sp.cc	2006-11-08 14:58:06 +01:00
@@ -513,17 +513,10 @@
   char definer[USER_HOST_BUFF_SIZE];
   char old_db_buf[NAME_BYTE_LEN+1];
   LEX_STRING old_db= { old_db_buf, sizeof(old_db_buf) };
-  bool dbchanged;
   DBUG_ENTER("db_create_routine");
   DBUG_PRINT("enter", ("type: %d name: %.*s",type,sp->m_name.length,
                        sp->m_name.str));
 
-  if ((ret= sp_use_new_db(thd, sp->m_db, &old_db, 0, &dbchanged)))
-  {
-    ret= SP_NO_DB_ERROR;
-    goto done;
-  }
-
   if (!(table= open_proc_table_for_update(thd)))
     ret= SP_OPEN_TABLE_FAILED;
   else
@@ -648,8 +641,6 @@
 
 done:
   close_thread_tables(thd);
-  if (dbchanged)
-    (void) mysql_change_db(thd, old_db.str, 1);
   DBUG_RETURN(ret);
 }
 


Thread
bk commit into 5.0 tree (Kristofer.Pettersson:1.2274) BUG#22043kpettersson8 Nov