List:Internals« Previous MessageNext Message »
From:msvensson Date:September 14 2005 8:10am
Subject:bk commit into 5.0 tree (msvensson:1.1948)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of msvensson. When msvensson 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
  1.1948 05/09/14 08:10:18 msvensson@neptunus.(none) +6 -0
  Merge bk-internal.mysql.com:/home/bk/mysql-5.0
  into  neptunus.(none):/home/msvensson/mysql/bug10713_new/my50-bug10713_new

  sql/table.h
    1.113 05/09/14 08:10:13 msvensson@neptunus.(none) +0 -0
    Auto merged

  sql/sql_show.cc
    1.278 05/09/14 08:10:13 msvensson@neptunus.(none) +0 -0
    Auto merged

  sql/item.cc
    1.178 05/09/14 08:10:12 msvensson@neptunus.(none) +0 -0
    Auto merged

  mysql-test/t/mysqldump.test
    1.63 05/09/14 08:10:12 msvensson@neptunus.(none) +0 -0
    Auto merged

  mysql-test/r/view.result
    1.112 05/09/14 08:10:12 msvensson@neptunus.(none) +0 -0
    Auto merged

  mysql-test/r/mysqldump.result
    1.69 05/09/14 08:10:12 msvensson@neptunus.(none) +0 -0
    Auto merged

# 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:	msvensson
# Host:	neptunus.(none)
# Root:	/home/msvensson/mysql/bug10713_new/my50-bug10713_new/RESYNC

--- 1.177/sql/item.cc	2005-09-13 09:40:56 +02:00
+++ 1.178/sql/item.cc	2005-09-14 08:10:12 +02:00
@@ -818,6 +818,8 @@
   DBUG_ASSERT(fixed);
   Item *it= this_item();
   String *ret= it->val_str(sp);
+
+  null_value= it->null_value;
   /*
     This way we mark returned value of val_str as const,
     so that various functions (e.g. CONCAT) won't try to
@@ -833,9 +835,12 @@
     This is intended behaviour of Item_func_concat. Comments to
     Item_param class contain some more details on the topic.
   */
+
+  if (!ret)
+    return NULL;
+
   str_value_ptr.set(ret->ptr(), ret->length(),
                     ret->charset());
-  null_value= it->null_value;
   return &str_value_ptr;
 }
 
@@ -2345,7 +2350,7 @@
 
   switch (state) {
   case INT_VALUE:
-    return field->store(value.integer);
+    return field->store(value.integer, unsigned_flag);
   case REAL_VALUE:
     return field->store(value.real);
   case DECIMAL_VALUE:
@@ -3899,7 +3904,7 @@
     if (null_value)
       return set_field_to_null_with_conversions(field, no_conversions);
     field->set_notnull();
-    error=field->store(nr);
+    error=field->store(nr, unsigned_flag);
   }
   return error;
 }
@@ -3915,12 +3920,10 @@
   return field->store(result->ptr(),result->length(),collation.collation);
 }
 
+
 int Item_uint::save_in_field(Field *field, bool no_conversions)
 {
-  /*
-    TODO: To be fixed when wen have a
-    field->store(longlong, unsigned_flag) method 
-  */
+  /* Item_int::save_in_field handles both signed and unsigned. */
   return Item_int::save_in_field(field, no_conversions);
 }
 
@@ -3931,7 +3934,7 @@
   if (null_value)
     return set_field_to_null(field);
   field->set_notnull();
-  return field->store(nr);
+  return field->store(nr, unsigned_flag);
 }
 
 
@@ -4138,7 +4141,7 @@
   else
   {
     longlong nr=val_int();
-    error=field->store(nr);
+    error=field->store(nr, TRUE);    // Assume hex numbers are unsigned
   }
   return error;
 }

--- 1.277/sql/sql_show.cc	2005-09-13 12:43:39 +02:00
+++ 1.278/sql/sql_show.cc	2005-09-14 08:10:13 +02:00
@@ -2271,7 +2271,7 @@
     }
     tmp_buff= file->table_type();
     table->field[4]->store(tmp_buff, strlen(tmp_buff), cs);
-    table->field[5]->store((longlong) share->frm_version);
+    table->field[5]->store((longlong) share->frm_version, TRUE);
     enum row_type row_type = file->get_row_type();
     switch (row_type) {
     case ROW_TYPE_NOT_USED:
@@ -2300,7 +2300,7 @@
     table->field[6]->store(tmp_buff, strlen(tmp_buff), cs);
     if (!tables->schema_table)
     {
-      table->field[7]->store((longlong) file->records);
+      table->field[7]->store((longlong) file->records, TRUE);
       table->field[7]->set_notnull();
     }
     table->field[8]->store((longlong) file->mean_rec_length);
@@ -2313,7 +2313,7 @@
     table->field[12]->store((longlong) file->delete_length);
     if (show_table->found_next_number_field)
     {
-      table->field[13]->store((longlong) file->auto_increment_value);
+      table->field[13]->store((longlong) file->auto_increment_value, TRUE);
       table->field[13]->set_notnull();
     }
     if (file->create_time)
@@ -2341,7 +2341,7 @@
     table->field[17]->store(tmp_buff, strlen(tmp_buff), cs);
     if (file->table_flags() & (ulong) HA_HAS_CHECKSUM)
     {
-      table->field[18]->store((longlong) file->checksum());
+      table->field[18]->store((longlong) file->checksum(), TRUE);
       table->field[18]->set_notnull();
     }
 
@@ -2492,7 +2492,7 @@
     table->field[2]->store(file_name, file_name_length, cs);
     table->field[3]->store(field->field_name, strlen(field->field_name),
                            cs);
-    table->field[4]->store((longlong) count);
+    table->field[4]->store((longlong) count, TRUE);
     field->sql_type(type);
     table->field[14]->store(type.ptr(), type.length(), cs);		
     tmp_buff= strchr(type.ptr(), '(');
@@ -2536,7 +2536,7 @@
     {
       longlong c_octet_len= is_blob ? (longlong) field->max_length() :
         (longlong) field->max_length()/field->charset()->mbmaxlen;
-      table->field[8]->store(c_octet_len);
+      table->field[8]->store(c_octet_len, TRUE);
       table->field[8]->set_notnull();
       table->field[9]->store((longlong) field->max_length());
       table->field[9]->set_notnull();
@@ -2584,7 +2584,7 @@
     }
     if (decimals >= 0)
     {
-      table->field[11]->store((longlong) decimals);
+      table->field[11]->store((longlong) decimals, TRUE);
       table->field[11]->set_notnull();
     }
 
@@ -2640,7 +2640,7 @@
       table->field[1]->store(tmp_cs->name, strlen(tmp_cs->name), scs);
       comment= tmp_cs->comment ? tmp_cs->comment : "";
       table->field[2]->store(comment, strlen(comment), scs);
-      table->field[3]->store((longlong) tmp_cs->mbmaxlen);
+      table->field[3]->store((longlong) tmp_cs->mbmaxlen, TRUE);
       if (schema_table_store_record(thd, table))
         return 1;
     }
@@ -2675,12 +2675,12 @@
 	restore_record(table, s->default_values);
 	table->field[0]->store(tmp_cl->name, strlen(tmp_cl->name), scs);
         table->field[1]->store(tmp_cl->csname , strlen(tmp_cl->csname), scs);
-        table->field[2]->store((longlong) tmp_cl->number);
+        table->field[2]->store((longlong) tmp_cl->number, TRUE);
         tmp_buff= (tmp_cl->state & MY_CS_PRIMARY) ? "Yes" : "";
 	table->field[3]->store(tmp_buff, strlen(tmp_buff), scs);
         tmp_buff= (tmp_cl->state & MY_CS_COMPILED)? "Yes" : "";
 	table->field[4]->store(tmp_buff, strlen(tmp_buff), scs);
-        table->field[5]->store((longlong) tmp_cl->strxfrm_multiply);
+        table->field[5]->store((longlong) tmp_cl->strxfrm_multiply, TRUE);
         if (schema_table_store_record(thd, table))
           return 1;
       }
@@ -2881,10 +2881,10 @@
         table->field[1]->store(base_name, strlen(base_name), cs);
         table->field[2]->store(file_name, strlen(file_name), cs);
         table->field[3]->store((longlong) ((key_info->flags & 
-                                            HA_NOSAME) ? 0 :1));
+                                            HA_NOSAME) ? 0 : 1), TRUE);
         table->field[4]->store(base_name, strlen(base_name), cs);
         table->field[5]->store(key_info->name, strlen(key_info->name), cs);
-        table->field[6]->store((longlong) (j+1));
+        table->field[6]->store((longlong) (j+1), TRUE);
         str=(key_part->field ? key_part->field->field_name :
              "?unknown field?");
         table->field[7]->store(str, strlen(str), cs);
@@ -2900,7 +2900,7 @@
         {
           ha_rows records=(show_table->file->records /
                            key->rec_per_key[j]);
-          table->field[9]->store((longlong) records);
+          table->field[9]->store((longlong) records, TRUE);
           table->field[9]->set_notnull();
         }
         if (!(key_info->flags & HA_FULLTEXT) && 
@@ -3139,7 +3139,7 @@
   table->field[4]->store(db, strlen(db), cs);
   table->field[5]->store(tname, strlen(tname), cs);
   table->field[6]->store(con_type, con_len, cs);
-  table->field[7]->store((longlong) idx);
+  table->field[7]->store((longlong) idx, TRUE);
 }
 
 
@@ -3211,7 +3211,7 @@
                                f_key_info->forein_id->length,
                                f_info->str, f_info->length,
                                (longlong) f_idx);
-        table->field[8]->store((longlong) f_idx);
+        table->field[8]->store((longlong) f_idx, TRUE);
         table->field[8]->set_notnull();
         table->field[9]->store(f_key_info->referenced_db->str,
                                f_key_info->referenced_db->length,
@@ -3249,8 +3249,8 @@
     restore_record(table, s->default_values);
     table->field[0]->store(open_list->db, strlen(open_list->db), cs);
     table->field[1]->store(open_list->table, strlen(open_list->table), cs);
-    table->field[2]->store((longlong) open_list->in_use);
-    table->field[3]->store((longlong)  open_list->locked);
+    table->field[2]->store((longlong) open_list->in_use, TRUE);
+    table->field[3]->store((longlong) open_list->locked, TRUE);
     if (schema_table_store_record(thd, table))
       DBUG_RETURN(1);
   }

--- 1.112/sql/table.h	2005-09-13 03:02:12 +02:00
+++ 1.113/sql/table.h	2005-09-14 08:10:13 +02:00
@@ -577,6 +577,7 @@
   /* TRUE if this merged view contain auto_increment field */
   bool          contain_auto_increment;
   bool          multitable_view;        /* TRUE iff this is multitable view */
+  bool          compact_view_format;    /* Use compact format for SHOW CREATE VIEW */
   /* view where processed */
   bool          where_processed;
   /* FRMTYPE_ERROR if any type is acceptable */

--- 1.111/mysql-test/r/view.result	2005-09-13 20:22:50 +02:00
+++ 1.112/mysql-test/r/view.result	2005-09-14 08:10:12 +02:00
@@ -32,10 +32,10 @@
 11
 show create table v1;
 View	Create View
-v1	CREATE ALGORITHM=UNDEFINED VIEW `test`.`v1` AS select (`test`.`t1`.`b` + 1) AS `c`
from `test`.`t1`
+v1	CREATE ALGORITHM=UNDEFINED VIEW `v1` AS select (`t1`.`b` + 1) AS `c` from `t1`
 show create view v1;
 View	Create View
-v1	CREATE ALGORITHM=UNDEFINED VIEW `test`.`v1` AS select (`test`.`t1`.`b` + 1) AS `c`
from `test`.`t1`
+v1	CREATE ALGORITHM=UNDEFINED VIEW `v1` AS select (`t1`.`b` + 1) AS `c` from `t1`
 show create view t1;
 ERROR HY000: 'test.t1' is not VIEW
 drop table t1;
@@ -55,7 +55,7 @@
 create algorithm=temptable view v2 (c) as select b+1 from t1;
 show create view v2;
 View	Create View
-v2	CREATE ALGORITHM=TEMPTABLE VIEW `test`.`v2` AS select (`test`.`t1`.`b` + 1) AS `c`
from `test`.`t1`
+v2	CREATE ALGORITHM=TEMPTABLE VIEW `v2` AS select (`t1`.`b` + 1) AS `c` from `t1`
 select c from v2;
 c
 3
@@ -550,7 +550,7 @@
 create view v1 as select "a*b" from t1;
 show create view v1;
 View	Create View
-v1	CREATE VIEW "test"."v1" AS select "test"."t1"."a*b" AS "a*b" from "test"."t1"
+v1	CREATE VIEW "v1" AS select "t1"."a*b" AS "a*b" from "t1"
 drop view v1;
 drop table t1;
 set sql_mode=default;
@@ -657,7 +657,7 @@
 CREATE VIEW v1 (f1,f2,f3,f4) AS SELECT connection_id(), pi(), current_user(), version();
 SHOW CREATE VIEW v1;
 View	Create View
-v1	CREATE ALGORITHM=UNDEFINED VIEW `test`.`v1` AS select sql_no_cache connection_id() AS
`f1`,pi() AS `f2`,current_user() AS `f3`,version() AS `f4`
+v1	CREATE ALGORITHM=UNDEFINED VIEW `v1` AS select sql_no_cache connection_id() AS
`f1`,pi() AS `f2`,current_user() AS `f3`,version() AS `f4`
 drop view v1;
 create table t1 (s1 int);
 create table t2 (s2 int);
@@ -691,13 +691,13 @@
 create view v2 as select a from t2 where a in (select a from v1);
 show create view v2;
 View	Create View
-v2	CREATE ALGORITHM=UNDEFINED VIEW `test`.`v2` AS select `test`.`t2`.`a` AS `a` from
`test`.`t2` where `a` in (select `v1`.`a` AS `a` from `test`.`v1`)
+v2	CREATE ALGORITHM=UNDEFINED VIEW `v2` AS select `t2`.`a` AS `a` from `t2` where `a` in
(select `v1`.`a` AS `a` from `v1`)
 drop view v2, v1;
 drop table t1, t2;
 CREATE VIEW `v 1` AS select 5 AS `5`;
 show create view `v 1`;
 View	Create View
-v 1	CREATE ALGORITHM=UNDEFINED VIEW `test`.`v 1` AS select 5 AS `5`
+v 1	CREATE ALGORITHM=UNDEFINED VIEW `v 1` AS select 5 AS `5`
 drop view `v 1`;
 create database mysqltest;
 create table mysqltest.t1 (a int, b int);
@@ -765,14 +765,14 @@
 1	1
 show create view v3;
 View	Create View
-v3	CREATE ALGORITHM=UNDEFINED VIEW `test`.`v3` AS select `v1`.`col1` AS `a`,`v2`.`col1`
AS `b` from (`test`.`v1` join `test`.`v2`) where (`v1`.`col1` = `v2`.`col1`)
+v3	CREATE ALGORITHM=UNDEFINED VIEW `v3` AS select `v1`.`col1` AS `a`,`v2`.`col1` AS `b`
from (`v1` join `v2`) where (`v1`.`col1` = `v2`.`col1`)
 drop view v3, v2, v1;
 drop table t2, t1;
 create function `f``1` () returns int return 5;
 create view v1 as select test.`f``1` ();
 show create view v1;
 View	Create View
-v1	CREATE ALGORITHM=UNDEFINED VIEW `test`.`v1` AS select sql_no_cache `test`.`f``1`() AS
`test.``f````1`` ()`
+v1	CREATE ALGORITHM=UNDEFINED VIEW `v1` AS select sql_no_cache `test`.`f``1`() AS
`test.``f````1`` ()`
 select * from v1;
 test.`f``1` ()
 5
@@ -789,10 +789,10 @@
 create view v2 as select col1 collate latin1_german1_ci from t2;
 show create view v2;
 View	Create View
-v2	CREATE ALGORITHM=UNDEFINED VIEW `test`.`v2` AS select (`test`.`t2`.`col1` collate
latin1_german1_ci) AS `col1 collate latin1_german1_ci` from `test`.`t2`
+v2	CREATE ALGORITHM=UNDEFINED VIEW `v2` AS select (`t2`.`col1` collate latin1_german1_ci)
AS `col1 collate latin1_german1_ci` from `t2`
 show create view v2;
 View	Create View
-v2	CREATE ALGORITHM=UNDEFINED VIEW `test`.`v2` AS select (`test`.`t2`.`col1` collate
latin1_german1_ci) AS `col1 collate latin1_german1_ci` from `test`.`t2`
+v2	CREATE ALGORITHM=UNDEFINED VIEW `v2` AS select (`t2`.`col1` collate latin1_german1_ci)
AS `col1 collate latin1_german1_ci` from `t2`
 drop view v2;
 drop table t2;
 create table t1 (a int);
@@ -819,7 +819,7 @@
 create view v1 as select 99999999999999999999999999999999999999999999999999999 as col1;
 show create view v1;
 View	Create View
-v1	CREATE ALGORITHM=UNDEFINED VIEW `test`.`v1` AS select
99999999999999999999999999999999999999999999999999999 AS `col1`
+v1	CREATE ALGORITHM=UNDEFINED VIEW `v1` AS select
99999999999999999999999999999999999999999999999999999 AS `col1`
 drop view v1;
 create table tü (cü char);
 create view vü as select cü from tü;
@@ -840,7 +840,7 @@
 create view v1 as select cast(1 as char(3));
 show create view v1;
 View	Create View
-v1	CREATE ALGORITHM=UNDEFINED VIEW `test`.`v1` AS select cast(1 as char(3) charset
latin1) AS `cast(1 as char(3))`
+v1	CREATE ALGORITHM=UNDEFINED VIEW `v1` AS select cast(1 as char(3) charset latin1) AS
`cast(1 as char(3))`
 select * from v1;
 cast(1 as char(3))
 1
@@ -1157,19 +1157,19 @@
 create view v1 as select * from t1;
 show create view v1;
 View	Create View
-v1	CREATE ALGORITHM=UNDEFINED VIEW `test`.`v1` AS select `test`.`t1`.`a` AS `a` from
`test`.`t1`
+v1	CREATE ALGORITHM=UNDEFINED VIEW `v1` AS select `t1`.`a` AS `a` from `t1`
 alter algorithm=undefined view v1 as select * from t1 with check option;
 show create view v1;
 View	Create View
-v1	CREATE ALGORITHM=UNDEFINED VIEW `test`.`v1` AS select `test`.`t1`.`a` AS `a` from
`test`.`t1` WITH CASCADED CHECK OPTION
+v1	CREATE ALGORITHM=UNDEFINED VIEW `v1` AS select `t1`.`a` AS `a` from `t1` WITH CASCADED
CHECK OPTION
 alter algorithm=merge view v1 as select * from t1 with cascaded check option;
 show create view v1;
 View	Create View
-v1	CREATE ALGORITHM=MERGE VIEW `test`.`v1` AS select `test`.`t1`.`a` AS `a` from
`test`.`t1` WITH CASCADED CHECK OPTION
+v1	CREATE ALGORITHM=MERGE VIEW `v1` AS select `t1`.`a` AS `a` from `t1` WITH CASCADED
CHECK OPTION
 alter algorithm=temptable view v1 as select * from t1;
 show create view v1;
 View	Create View
-v1	CREATE ALGORITHM=TEMPTABLE VIEW `test`.`v1` AS select `test`.`t1`.`a` AS `a` from
`test`.`t1`
+v1	CREATE ALGORITHM=TEMPTABLE VIEW `v1` AS select `t1`.`a` AS `a` from `t1`
 drop view v1;
 drop table t1;
 create table t1 (s1 int);
@@ -1841,24 +1841,24 @@
 create view v1 as select a,b,t1.a < now() from t1,t2 where t1.a < now();
 SHOW CREATE VIEW v1;
 View	Create View
-v1	CREATE ALGORITHM=UNDEFINED VIEW `test`.`v1` AS select sql_no_cache `test`.`t1`.`a` AS
`a`,`test`.`t2`.`b` AS `b`,(`test`.`t1`.`a` < now()) AS `t1.a < now()` from
(`test`.`t1` join `test`.`t2`) where (`test`.`t1`.`a` < now())
+v1	CREATE ALGORITHM=UNDEFINED VIEW `v1` AS select sql_no_cache `t1`.`a` AS `a`,`t2`.`b`
AS `b`,(`t1`.`a` < now()) AS `t1.a < now()` from (`t1` join `t2`) where (`t1`.`a`
< now())
 drop view v1;
 drop table t1, t2;
 CREATE TABLE t1 ( a varchar(50) );
 CREATE VIEW v1 AS SELECT * FROM t1 WHERE a = CURRENT_USER();
 SHOW CREATE VIEW v1;
 View	Create View
-v1	CREATE ALGORITHM=UNDEFINED VIEW `test`.`v1` AS select sql_no_cache `test`.`t1`.`a` AS
`a` from `test`.`t1` where (`test`.`t1`.`a` = current_user())
+v1	CREATE ALGORITHM=UNDEFINED VIEW `v1` AS select sql_no_cache `t1`.`a` AS `a` from `t1`
where (`t1`.`a` = current_user())
 DROP VIEW v1;
 CREATE VIEW v1 AS SELECT * FROM t1 WHERE a = VERSION();
 SHOW CREATE VIEW v1;
 View	Create View
-v1	CREATE ALGORITHM=UNDEFINED VIEW `test`.`v1` AS select `test`.`t1`.`a` AS `a` from
`test`.`t1` where (`test`.`t1`.`a` = version())
+v1	CREATE ALGORITHM=UNDEFINED VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where
(`t1`.`a` = version())
 DROP VIEW v1;
 CREATE VIEW v1 AS SELECT * FROM t1 WHERE a = DATABASE();
 SHOW CREATE VIEW v1;
 View	Create View
-v1	CREATE ALGORITHM=UNDEFINED VIEW `test`.`v1` AS select sql_no_cache `test`.`t1`.`a` AS
`a` from `test`.`t1` where (`test`.`t1`.`a` = database())
+v1	CREATE ALGORITHM=UNDEFINED VIEW `v1` AS select sql_no_cache `t1`.`a` AS `a` from `t1`
where (`t1`.`a` = database())
 DROP VIEW v1;
 DROP TABLE t1;
 CREATE TABLE t1 (col1 time);
@@ -1949,7 +1949,7 @@
 create view v1 as select var_samp(s1) from t1;
 show create view v1;
 View	Create View
-v1	CREATE ALGORITHM=UNDEFINED VIEW `test`.`v1` AS select var_samp(`test`.`t1`.`s1`) AS
`var_samp(s1)` from `test`.`t1`
+v1	CREATE ALGORITHM=UNDEFINED VIEW `v1` AS select var_samp(`t1`.`s1`) AS `var_samp(s1)`
from `t1`
 drop view v1;
 drop table t1;
 set sql_mode='strict_all_tables';

--- 1.68/mysql-test/r/mysqldump.result	2005-09-13 12:43:39 +02:00
+++ 1.69/mysql-test/r/mysqldump.result	2005-09-14 08:10:12 +02:00
@@ -1990,28 +1990,28 @@
 DROP TRIGGER testref;
 DROP TABLE test1;
 DROP TABLE test2;
-CREATE TABLE t1 (id int);
-INSERT INTO t1 VALUES(1);
-INSERT INTO t1 VALUES(2);
-INSERT INTO t1 VALUES(3);
-INSERT INTO t1 VALUES(4);
-INSERT INTO t1 VALUES(5);
+DROP TABLE IF EXISTS t1;
 DROP FUNCTION IF EXISTS bug9056_func1;
-CREATE FUNCTION `bug9056_func1`(a INT, b INT) RETURNS int(11)
-RETURN a+b //
+DROP FUNCTION IF EXISTS bug9056_func2;
+DROP PROCEDURE IF EXISTS bug9056_proc1;
+DROP PROCEDURE IF EXISTS bug9056_proc2;
+CREATE TABLE t1 (id int);
+INSERT INTO t1 VALUES(1), (2), (3), (4), (5);
+CREATE FUNCTION `bug9056_func1`(a INT, b INT) RETURNS int(11) RETURN a+b //
 CREATE PROCEDURE `bug9056_proc1`(IN a INT, IN b INT, OUT c INT)
 BEGIN SELECT a+b INTO c; end  //
-DROP FUNCTION IF EXISTS bug9056_func2 //
 create function bug9056_func2(f1 char binary) returns char binary
 begin
 set f1= concat( 'hello', f1 );
 return f1;
 end //
-DROP PROCEDURE IF EXISTS bug9056_proc2 //
 CREATE PROCEDURE bug9056_proc2(OUT a INT) 
 BEGIN 
 select sum(id) from t1 into a; 
 END //
+set sql_mode='ansi';
+create procedure `a'b` () select 1;
+set sql_mode='';
 
 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
 /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
@@ -2036,32 +2036,38 @@
 INSERT INTO `t1` VALUES (1),(2),(3),(4),(5);
 UNLOCK TABLES;
 /*!40000 ALTER TABLE `t1` ENABLE KEYS */;
-
-/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;
 DELIMITER //
+/*!50003 DROP FUNCTION IF EXISTS `bug9056_func1` */ //
 /*!50003 SET SESSION SQL_MODE=""*/ //
-/*!50003 DROP FUNCTION IF EXISTS bug9056_func1 */ //
 /*!50003 CREATE FUNCTION `bug9056_func1`(a INT, b INT) RETURNS int(11)
 RETURN a+b */ //
+/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/ //
+/*!50003 DROP FUNCTION IF EXISTS `bug9056_func2` */ //
 /*!50003 SET SESSION SQL_MODE=""*/ //
-/*!50003 DROP FUNCTION IF EXISTS bug9056_func2 */ //
 /*!50003 CREATE FUNCTION `bug9056_func2`(f1 char binary) RETURNS char(1)
 begin
 set f1= concat( 'hello', f1 );
 return f1;
 end */ //
+/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/ //
+/*!50003 DROP PROCEDURE IF EXISTS `a'b` */ //
+/*!50003 SET SESSION
SQL_MODE="REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI"*/ //
+/*!50003 CREATE PROCEDURE "a'b"()
+select 1 */ //
+/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/ //
+/*!50003 DROP PROCEDURE IF EXISTS `bug9056_proc1` */ //
 /*!50003 SET SESSION SQL_MODE=""*/ //
-/*!50003 DROP PROCEDURE IF EXISTS bug9056_proc1 */ //
 /*!50003 CREATE PROCEDURE `bug9056_proc1`(IN a INT, IN b INT, OUT c INT)
 BEGIN SELECT a+b INTO c; end */ //
+/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/ //
+/*!50003 DROP PROCEDURE IF EXISTS `bug9056_proc2` */ //
 /*!50003 SET SESSION SQL_MODE=""*/ //
-/*!50003 DROP PROCEDURE IF EXISTS bug9056_proc2 */ //
 /*!50003 CREATE PROCEDURE `bug9056_proc2`(OUT a INT)
 BEGIN 
 select sum(id) from t1 into a; 
 END */ //
+/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/ //
 DELIMITER ;
-/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;
 
 /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
 /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
@@ -2071,8 +2077,8 @@
 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
 /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
 
-DROP PROCEDURE IF EXISTS bug9056_func1;
-DROP PROCEDURE IF EXISTS bug9056_func2;
-DROP PROCEDURE IF EXISTS bug9056_proc1;
-DROP PROCEDURE IF EXISTS bug9056_proc2;
+DROP FUNCTION bug9056_func1;
+DROP FUNCTION bug9056_func2;
+DROP PROCEDURE bug9056_proc1;
+DROP PROCEDURE bug9056_proc2;
 drop table t1;

--- 1.62/mysql-test/t/mysqldump.test	2005-09-13 14:46:36 +02:00
+++ 1.63/mysql-test/t/mysqldump.test	2005-09-14 08:10:12 +02:00
@@ -829,7 +829,7 @@
 --exec echo "[mysqltest1]" > $MYSQL_TEST_DIR/var/tmp/tmp.cnf
 --exec echo "port=1234" >> $MYSQL_TEST_DIR/var/tmp/tmp.cnf
 --exec $MYSQL_MY_PRINT_DEFAULTS -c $MYSQL_TEST_DIR/var/tmp/tmp.cnf mysqltest1
---exec $MYSQL_MY_PRINT_DEFAULTS -e $MYSQL_TEST_DIR/var/tmp/tmp.cnf mysqltest1
+--exec $MYSQL_MY_PRINT_DEFAULTS -e $MYSQL_TEST_DIR/var/tmp/tmp.cnf mysqltest1 mysqltest1
 --exec rm $MYSQL_TEST_DIR/var/tmp/tmp.cnf
 
 #
@@ -870,34 +870,32 @@
 DROP TABLE test1;
 DROP TABLE test2;
 
-CREATE TABLE t1 (id int);
-INSERT INTO t1 VALUES(1);
-INSERT INTO t1 VALUES(2);
-INSERT INTO t1 VALUES(3);
-INSERT INTO t1 VALUES(4);
-INSERT INTO t1 VALUES(5);
+#
+# BUG#9056 - mysqldump does not dump routines
+#
+
 --disable_warnings
+DROP TABLE IF EXISTS t1;
 DROP FUNCTION IF EXISTS bug9056_func1;
-DELIMITER //;
+DROP FUNCTION IF EXISTS bug9056_func2;
+DROP PROCEDURE IF EXISTS bug9056_proc1;
+DROP PROCEDURE IF EXISTS bug9056_proc2;
 --enable_warnings
-CREATE FUNCTION `bug9056_func1`(a INT, b INT) RETURNS int(11)
-RETURN a+b //
+
+CREATE TABLE t1 (id int);
+INSERT INTO t1 VALUES(1), (2), (3), (4), (5);
+
+DELIMITER //;
+CREATE FUNCTION `bug9056_func1`(a INT, b INT) RETURNS int(11) RETURN a+b //
 CREATE PROCEDURE `bug9056_proc1`(IN a INT, IN b INT, OUT c INT)
 BEGIN SELECT a+b INTO c; end  //
 
---disable_warnings
-DROP FUNCTION IF EXISTS bug9056_func2 //
---enable_warnings
-
 create function bug9056_func2(f1 char binary) returns char binary
 begin
   set f1= concat( 'hello', f1 );
   return f1;
 end //
 
---disable_warnings
-DROP PROCEDURE IF EXISTS bug9056_proc2 //
---enable_warnings
 CREATE PROCEDURE bug9056_proc2(OUT a INT) 
 BEGIN 
   select sum(id) from t1 into a; 
@@ -905,14 +903,17 @@
 
 DELIMITER ;//
 
+set sql_mode='ansi';
+create procedure `a'b` () select 1; # to fix syntax highlighting :')
+set sql_mode='';
+
 # Dump the DB and ROUTINES 
 --exec $MYSQL_DUMP --skip-comments --routines --databases test
 
 # ok, now blow it all away
---disable_warnings
-DROP PROCEDURE IF EXISTS bug9056_func1;
-DROP PROCEDURE IF EXISTS bug9056_func2;
-DROP PROCEDURE IF EXISTS bug9056_proc1;
-DROP PROCEDURE IF EXISTS bug9056_proc2;
+DROP FUNCTION bug9056_func1;
+DROP FUNCTION bug9056_func2;
+DROP PROCEDURE bug9056_proc1;
+DROP PROCEDURE bug9056_proc2;
 drop table t1;
---enable-warnings
+
Thread
bk commit into 5.0 tree (msvensson:1.1948)msvensson14 Sep