List:Commits« Previous MessageNext Message »
From:Tatiana A. Nurnberg Date:May 29 2009 5:25pm
Subject:bzr commit into mysql-6.0-bugteam branch (azundris:3325)
View as plain text  
#At file:///misc/mysql/forest/39200k/60-39200k/ based on revid:azundris@stripped

 3325 Tatiana A. Nurnberg	2009-05-29 [merge]
      auto-merge

    modified:
      .bzr-mysql/default.conf
      client/mysql.cc
      client/mysql_upgrade.c
      mysql-test/lib/My/SafeProcess/safe_process_win.cc
      mysql-test/r/debug_sync.result
      mysql-test/r/locktrans_innodb.result
      mysql-test/r/locktrans_myisam.result
      mysql-test/r/mysql.result
      mysql-test/r/signal.result
      mysql-test/r/signal_demo3.result
      mysql-test/r/signal_utf32.result
      mysql-test/r/sp-error.result
      mysql-test/suite/backup/r/backup_db_grants.result
      mysql-test/suite/rpl/r/rpl_locktrans_falcon.result
      mysql-test/suite/rpl/r/rpl_locktrans_innodb.result
      mysql-test/suite/rpl/r/rpl_locktrans_myisam.result
      mysql-test/t/mysql.test
      mysql-test/t/sp-error.test
      scripts/mysqld_safe.sh
      sql/item_func.cc
      sql/share/errmsg.txt
      sql/sql_derived.cc
      sql/sql_lex.cc
      sql/sql_lex.h
      sql/table.cc
      storage/ibmdb2i/db2i_conversion.cc
      storage/ibmdb2i/db2i_misc.h
      storage/myisam/ha_myisam.cc
      storage/myisam/myisamchk.c
      storage/myisammrg/ha_myisammrg.cc
=== modified file '.bzr-mysql/default.conf'
--- a/.bzr-mysql/default.conf	2009-05-25 10:10:18 +0000
+++ b/.bzr-mysql/default.conf	2009-05-25 21:02:34 +0000
@@ -1,5 +1,5 @@
 [MYSQL]
-tree_location = "bzr+ssh://bk-internal.mysql.com/bzrroot/server/mysql-6.0"
+tree_location = "bzr+ssh://bk-internal.mysql.com/bzrroot/server/mysql-6.0-bugteam"
 post_commit_to = "commits@stripped"
 post_push_to = "commits@stripped"
 tree_name = "mysql-6.0-bugteam"

=== modified file 'client/mysql.cc'
--- a/client/mysql.cc	2009-05-25 10:10:18 +0000
+++ b/client/mysql.cc	2009-05-29 10:17:28 +0000
@@ -2015,7 +2015,7 @@ static COMMANDS *find_command(char *name
     */
     if (strstr(name, "\\g") || (strstr(name, delimiter) &&
                                 !(strlen(name) >= 9 &&
-                                  !my_strnncoll(charset_info,
+                                  !my_strnncoll(&my_charset_latin1,
                                                 (uchar*) name, 9,
                                                 (const uchar*) "delimiter",
                                                 9))))
@@ -2036,7 +2036,7 @@ static COMMANDS *find_command(char *name
   {
     if (commands[i].func &&
 	((name &&
-	  !my_strnncoll(charset_info,(uchar*)name,len,
+	  !my_strnncoll(&my_charset_latin1, (uchar*)name, len,
 				     (uchar*)commands[i].name,len) &&
 	  !commands[i].name[len] &&
 	  (!end || (end && commands[i].takes_params))) ||

=== modified file 'client/mysql_upgrade.c'
--- a/client/mysql_upgrade.c	2009-05-14 02:01:04 +0000
+++ b/client/mysql_upgrade.c	2009-05-28 04:16:36 +0000
@@ -39,6 +39,7 @@ static uint my_end_arg= 0;
 static char *opt_user= (char*)"root";
 
 static DYNAMIC_STRING ds_args;
+static DYNAMIC_STRING conn_args;
 
 static char *opt_password= 0;
 static my_bool tty_password= 0;
@@ -135,6 +136,7 @@ static void free_used_memory(void)
   free_defaults(defaults_argv);
 
   dynstr_free(&ds_args);
+  dynstr_free(&conn_args);
 }
 
 
@@ -204,7 +206,7 @@ static void add_one_option(DYNAMIC_STRIN
     }
   }
   dynstr_append_os_quoted(ds, "--", opt->name, eq, arg, NullS);
-  dynstr_append(&ds_args, " ");
+  dynstr_append(ds, " ");
 }
 
 
@@ -256,6 +258,15 @@ get_one_option(int optid, const struct m
   case 'f': /* --force     */
     add_option= FALSE;
     break;
+
+  case 'h': /* --host */
+  case 'W': /* --pipe */
+  case 'P': /* --port */
+  case 'S': /* --socket */
+  case OPT_MYSQL_PROTOCOL: /* --protocol */
+  case OPT_SHARED_MEMORY_BASE_NAME: /* --shared-memory-base-name */
+    add_one_option(&conn_args, opt, argument);
+    break;
   }
 
   if (add_option)
@@ -604,13 +615,27 @@ static void create_mysql_upgrade_info_fi
 
 
 /*
+  Print connection-related arguments.
+*/
+
+static void print_conn_args(const char *tool_name)
+{
+  if (conn_args.str[0])
+    verbose("Running '%s' with connection arguments: %s", tool_name,
+          conn_args.str);
+  else
+    verbose("Running '%s with default connection arguments", tool_name);
+}  
+
+
+/*
   Check and upgrade(if neccessary) all tables
   in the server using "mysqlcheck --check-upgrade .."
 */
 
 static int run_mysqlcheck_upgrade(void)
 {
-  verbose("Running 'mysqlcheck'...");
+  print_conn_args("mysqlcheck");
   return run_tool(mysqlcheck_path,
                   NULL, /* Send output from mysqlcheck directly to screen */
                   "--no-defaults",
@@ -624,7 +649,7 @@ static int run_mysqlcheck_upgrade(void)
 
 static int run_mysqlcheck_fixnames(void)
 {
-  verbose("Running 'mysqlcheck'...");
+  print_conn_args("mysqlcheck");
   return run_tool(mysqlcheck_path,
                   NULL, /* Send output from mysqlcheck directly to screen */
                   "--no-defaults",
@@ -753,7 +778,8 @@ int main(int argc, char **argv)
     strncpy(self_name, argv[0], FN_REFLEN);
   }
 
-  if (init_dynamic_string(&ds_args, "", 512, 256))
+  if (init_dynamic_string(&ds_args, "", 512, 256) ||
+      init_dynamic_string(&conn_args, "", 512, 256))
     die("Out of memory");
 
   load_defaults("my", load_default_groups, &argc, &argv);

=== modified file 'mysql-test/lib/My/SafeProcess/safe_process_win.cc'
--- a/mysql-test/lib/My/SafeProcess/safe_process_win.cc	2009-02-09 18:24:48 +0000
+++ b/mysql-test/lib/My/SafeProcess/safe_process_win.cc	2009-05-14 19:56:53 +0000
@@ -259,22 +259,37 @@ int main(int argc, const char** argv )
     the JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE flag, making sure it will be
     terminated when the last handle to it is closed(which is owned by
     this process).
+
+    If breakaway from job fails on some reason, fallback is to create a
+    new process group. Process groups also allow to kill process and its 
+    descedants, subject to some restrictions (processes have to run within
+    the same console,and must not ignore CTRL_BREAK)
   */
-  if (CreateProcess(NULL, (LPSTR)child_args,
+  DWORD create_flags[]= {CREATE_BREAKAWAY_FROM_JOB, CREATE_NEW_PROCESS_GROUP, 0};
+  BOOL process_created= FALSE;
+  BOOL jobobject_assigned= FALSE;
+
+  for (int i=0; i < sizeof(create_flags)/sizeof(create_flags[0]); i++)
+  { 
+    process_created= CreateProcess(NULL, (LPSTR)child_args,
                     NULL,
                     NULL,
                     TRUE, /* inherit handles */
-                    CREATE_SUSPENDED | CREATE_BREAKAWAY_FROM_JOB,
+                    CREATE_SUSPENDED | create_flags[i],
                     NULL,
                     NULL,
                     &si,
-                    &process_info) == 0)
-    die("CreateProcess failed");
+                    &process_info);
+    if (process_created)
+    {
+     jobobject_assigned= AssignProcessToJobObject(job_handle, process_info.hProcess);
+     break;
+    }
+  }
 
-  if (AssignProcessToJobObject(job_handle, process_info.hProcess) == 0)
+  if (!process_created)
   {
-    TerminateProcess(process_info.hProcess, 200);
-    die("AssignProcessToJobObject failed");
+    die("CreateProcess failed");
   }
   ResumeThread(process_info.hThread);
   CloseHandle(process_info.hThread);
@@ -312,6 +327,13 @@ int main(int argc, const char** argv )
     message("TerminateJobObject failed");
   CloseHandle(job_handle);
   message("Job terminated and closed");
+
+  if (!jobobject_assigned)
+  {
+    GenerateConsoleCtrlEvent(CTRL_BREAK_EVENT, process_info.dwProcessId);
+    TerminateProcess(process_info.hProcess, 202);
+  }
+
   if (wait_res != WAIT_OBJECT_0 + CHILD)
   {
     /* The child has not yet returned, wait for it */

=== modified file 'mysql-test/r/debug_sync.result'
--- a/mysql-test/r/debug_sync.result	2009-03-18 21:09:40 +0000
+++ b/mysql-test/r/debug_sync.result	2009-05-29 11:05:25 +0000
@@ -146,7 +146,7 @@ Variable_name	Value
 debug_sync	ON - current signal: 'something'
 SET DEBUG_SYNC= 'now WAIT_FOR nothing TIMEOUT 0';
 Warnings:
-Warning	1734	debug sync point wait timed out
+Warning	1735	debug sync point wait timed out
 SET DEBUG_SYNC= 'now SIGNAL nothing';
 SHOW VARIABLES LIKE 'DEBUG_SYNC';
 Variable_name	Value

=== modified file 'mysql-test/r/locktrans_innodb.result'
--- a/mysql-test/r/locktrans_innodb.result	2009-04-03 17:58:04 +0000
+++ b/mysql-test/r/locktrans_innodb.result	2009-05-29 11:05:25 +0000
@@ -95,12 +95,12 @@ ERROR 42000: You have an error in your S
 # Implicit lock method conversion due to mix in statement.
 LOCK TABLE t1 READ, t2 IN EXCLUSIVE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't2'
+Warning	1631	Converted to non-transactional lock on 't2'
 UNLOCK TABLES;
 # Lock t1 share (converted to read), t2 write.
 LOCK TABLE t1 IN SHARE MODE, t2 WRITE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't1'
+Warning	1631	Converted to non-transactional lock on 't1'
 # Show t1 is read locked, t2 write locked.
 INSERT INTO t1 SELECT * FROM t2;
 ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
@@ -111,8 +111,8 @@ INSERT INTO t2 SELECT * FROM t1;
 # Lock t1 exclusive (converted to write), t2 share (converted to read).
 LOCK TABLE t1 IN EXCLUSIVE MODE, t2 IN SHARE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't1'
-Warning	1630	Converted to non-transactional lock on 't2'
+Warning	1631	Converted to non-transactional lock on 't1'
+Warning	1631	Converted to non-transactional lock on 't2'
 # Show t1 is write locked, t2 read locked.
 INSERT INTO t1 SELECT * FROM t2;
 INSERT INTO t2 SELECT * FROM t1;
@@ -136,8 +136,8 @@ ERROR HY000: Cannot convert to non-trans
 ## Error is reported on first table only. Show both errors:
 SHOW WARNINGS;
 Level	Code	Message
-Error	1631	Cannot convert to non-transactional lock in strict mode on 't1'
-Error	1631	Cannot convert to non-transactional lock in strict mode on 't2'
+Error	1632	Cannot convert to non-transactional lock in strict mode on 't1'
+Error	1632	Cannot convert to non-transactional lock in strict mode on 't2'
 UNLOCK TABLES;
 SET @@SQL_MODE= @wl3561_save_sql_mode;
 #
@@ -157,7 +157,7 @@ CREATE TABLE t4 (c4 INT) ENGINE= MyISAM;
 # Request a transactional lock, which is converted to non-transactional.
 LOCK TABLE t4 IN SHARE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't4'
+Warning	1631	Converted to non-transactional lock on 't4'
 # Try a conflict with the existing non-transactional lock.
 INSERT INTO t4 VALUES(444);
 ERROR HY000: Table 't4' was locked with a READ lock and can't be updated
@@ -174,8 +174,8 @@ CREATE VIEW v1 AS SELECT * FROM t3, t4 W
 # Request a share lock on the view, which is converted to read locks.
 LOCK TABLE v1 IN SHARE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't3'
-Warning	1630	Converted to non-transactional lock on 't4'
+Warning	1631	Converted to non-transactional lock on 't3'
+Warning	1631	Converted to non-transactional lock on 't4'
 # Show that read locks on the base tables prohibit writing ...
 INSERT INTO t3 SELECT * FROM t4;
 ERROR HY000: Table 't3' was locked with a READ lock and can't be updated
@@ -191,7 +191,7 @@ COUNT(*)
 ## Report conversion on view due to existing non-transactional locks.
 LOCK TABLE v1 IN EXCLUSIVE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 'v1'
+Warning	1631	Converted to non-transactional lock on 'v1'
 INSERT INTO t3 VALUES(333);
 INSERT INTO t4 VALUES(444);
 INSERT INTO t1 VALUES(111);
@@ -200,8 +200,8 @@ UNLOCK TABLES;
 ## Now report conversion on base table again.
 LOCK TABLE v1 IN EXCLUSIVE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't3'
-Warning	1630	Converted to non-transactional lock on 't4'
+Warning	1631	Converted to non-transactional lock on 't3'
+Warning	1631	Converted to non-transactional lock on 't4'
 INSERT INTO t3 VALUES(333);
 INSERT INTO t4 VALUES(444);
 INSERT INTO t1 VALUES(111);

=== modified file 'mysql-test/r/locktrans_myisam.result'
--- a/mysql-test/r/locktrans_myisam.result	2009-03-27 22:06:26 +0000
+++ b/mysql-test/r/locktrans_myisam.result	2009-05-29 11:05:25 +0000
@@ -21,8 +21,8 @@ UNLOCK TABLES;
 # Valid syntax for transactional locks.
 LOCK TABLE t1 IN SHARE MODE, t2 IN EXCLUSIVE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't1'
-Warning	1630	Converted to non-transactional lock on 't2'
+Warning	1631	Converted to non-transactional lock on 't1'
+Warning	1631	Converted to non-transactional lock on 't2'
 UNLOCK TABLES;
 #
 # Valid syntax for aliases with and without 'AS'.
@@ -30,19 +30,19 @@ LOCK TABLE t1 AS a1 READ, t2 a2 WRITE;
 UNLOCK TABLES;
 LOCK TABLE t1 AS a1 IN SHARE MODE, t2 a2 IN EXCLUSIVE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 'a1'
-Warning	1630	Converted to non-transactional lock on 'a2'
+Warning	1631	Converted to non-transactional lock on 'a1'
+Warning	1631	Converted to non-transactional lock on 'a2'
 UNLOCK TABLES;
 #
 # Transactional locks taken on a view.
 CREATE VIEW v1 AS SELECT * FROM t1, t2 WHERE t1.c1 = t2.c2;
 LOCK TABLE v1 IN SHARE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't1'
-Warning	1630	Converted to non-transactional lock on 't2'
+Warning	1631	Converted to non-transactional lock on 't1'
+Warning	1631	Converted to non-transactional lock on 't2'
 LOCK TABLE v1 IN EXCLUSIVE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 'v1'
+Warning	1631	Converted to non-transactional lock on 'v1'
 UNLOCK TABLES;
 DROP VIEW v1;
 #
@@ -95,12 +95,12 @@ ERROR 42000: You have an error in your S
 # Implicit lock method conversion due to mix in statement.
 LOCK TABLE t1 READ, t2 IN EXCLUSIVE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't2'
+Warning	1631	Converted to non-transactional lock on 't2'
 UNLOCK TABLES;
 # Lock t1 share (converted to read), t2 write.
 LOCK TABLE t1 IN SHARE MODE, t2 WRITE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't1'
+Warning	1631	Converted to non-transactional lock on 't1'
 # Show t1 is read locked, t2 write locked.
 INSERT INTO t1 SELECT * FROM t2;
 ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
@@ -111,8 +111,8 @@ INSERT INTO t2 SELECT * FROM t1;
 # Lock t1 exclusive (converted to write), t2 share (converted to read).
 LOCK TABLE t1 IN EXCLUSIVE MODE, t2 IN SHARE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't1'
-Warning	1630	Converted to non-transactional lock on 't2'
+Warning	1631	Converted to non-transactional lock on 't1'
+Warning	1631	Converted to non-transactional lock on 't2'
 # Show t1 is write locked, t2 read locked.
 INSERT INTO t1 SELECT * FROM t2;
 INSERT INTO t2 SELECT * FROM t1;
@@ -136,8 +136,8 @@ ERROR HY000: Cannot convert to non-trans
 ## Error is reported on first table only. Show both errors:
 SHOW WARNINGS;
 Level	Code	Message
-Error	1631	Cannot convert to non-transactional lock in strict mode on 't1'
-Error	1631	Cannot convert to non-transactional lock in strict mode on 't2'
+Error	1632	Cannot convert to non-transactional lock in strict mode on 't1'
+Error	1632	Cannot convert to non-transactional lock in strict mode on 't2'
 UNLOCK TABLES;
 SET @@SQL_MODE= @wl3561_save_sql_mode;
 #
@@ -157,7 +157,7 @@ CREATE TABLE t4 (c4 INT) ENGINE= MyISAM;
 # Request a transactional lock, which is converted to non-transactional.
 LOCK TABLE t4 IN SHARE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't4'
+Warning	1631	Converted to non-transactional lock on 't4'
 # Try a conflict with the existing non-transactional lock.
 INSERT INTO t4 VALUES(444);
 ERROR HY000: Table 't4' was locked with a READ lock and can't be updated
@@ -174,8 +174,8 @@ CREATE VIEW v1 AS SELECT * FROM t3, t4 W
 # Request a share lock on the view, which is converted to read locks.
 LOCK TABLE v1 IN SHARE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't3'
-Warning	1630	Converted to non-transactional lock on 't4'
+Warning	1631	Converted to non-transactional lock on 't3'
+Warning	1631	Converted to non-transactional lock on 't4'
 # Show that read locks on the base tables prohibit writing ...
 INSERT INTO t3 SELECT * FROM t4;
 ERROR HY000: Table 't3' was locked with a READ lock and can't be updated
@@ -191,7 +191,7 @@ COUNT(*)
 ## Report conversion on view due to existing non-transactional locks.
 LOCK TABLE v1 IN EXCLUSIVE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 'v1'
+Warning	1631	Converted to non-transactional lock on 'v1'
 INSERT INTO t3 VALUES(333);
 INSERT INTO t4 VALUES(444);
 INSERT INTO t1 VALUES(111);
@@ -200,8 +200,8 @@ UNLOCK TABLES;
 ## Now report conversion on base table again.
 LOCK TABLE v1 IN EXCLUSIVE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't3'
-Warning	1630	Converted to non-transactional lock on 't4'
+Warning	1631	Converted to non-transactional lock on 't3'
+Warning	1631	Converted to non-transactional lock on 't4'
 INSERT INTO t3 VALUES(333);
 INSERT INTO t4 VALUES(444);
 INSERT INTO t1 VALUES(111);

=== modified file 'mysql-test/r/mysql.result'
--- a/mysql-test/r/mysql.result	2009-05-15 13:45:06 +0000
+++ b/mysql-test/r/mysql.result	2009-05-29 10:17:28 +0000
@@ -198,6 +198,7 @@ COUNT (*)
 1
 COUNT (*)
 1
+ERROR 2005 (HY000) at line 1: Unknown MySQL server host 'invalid_hostname' (errno)
 End of 5.0 tests
 WARNING: --server-arg option not supported in this configuration.
 *************************** 1. row ***************************

=== modified file 'mysql-test/r/signal.result'
--- a/mysql-test/r/signal.result	2009-03-13 09:43:12 +0000
+++ b/mysql-test/r/signal.result	2009-05-29 11:05:25 +0000
@@ -580,7 +580,7 @@ SIGNAL foo;
 ERROR 42000: Undefined CONDITION: foo
 SIGNAL SQLSTATE '01000';
 Warnings:
-Warning	1771	Unhandled user-defined warning condition
+Warning	1772	Unhandled user-defined warning condition
 SIGNAL SQLSTATE '02000';
 ERROR 02000: Unhandled user-defined not found condition
 SIGNAL SQLSTATE '23000';
@@ -694,7 +694,7 @@ SIGNAL warn;
 end $$
 call test_signal() $$
 Warnings:
-Warning	1771	Unhandled user-defined warning condition
+Warning	1772	Unhandled user-defined warning condition
 drop procedure test_signal $$
 create procedure test_signal()
 begin
@@ -704,7 +704,7 @@ SIGNAL warn;
 end $$
 call test_signal() $$
 Warnings:
-Warning	1771	Unhandled user-defined warning condition
+Warning	1772	Unhandled user-defined warning condition
 drop procedure test_signal $$
 create procedure test_signal()
 begin
@@ -853,7 +853,7 @@ SIGNAL warn SET MESSAGE_TEXT = "Somethin
 end $$
 call test_signal() $$
 Warnings:
-Warning	1771	Something bad happened
+Warning	1772	Something bad happened
 drop procedure test_signal $$
 create procedure test_signal()
 begin
@@ -878,7 +878,7 @@ SIGNAL something SET MESSAGE_TEXT = _utf
 end $$
 call test_signal() $$
 Warnings:
-Warning	1771	This is a UTF8 text
+Warning	1772	This is a UTF8 text
 drop procedure test_signal $$
 create procedure test_signal()
 begin
@@ -887,7 +887,7 @@ SIGNAL something SET MESSAGE_TEXT = "";
 end $$
 call test_signal() $$
 Warnings:
-Warning	1771	
+Warning	1772	
 drop procedure test_signal $$
 create procedure test_signal()
 begin
@@ -896,10 +896,10 @@ SIGNAL warn SET MESSAGE_TEXT = "á a";
 end $$
 call test_signal() $$
 Warnings:
-Warning	1771	á a
+Warning	1772	á a
 show warnings $$
 Level	Code	Message
-Warning	1771	á a
+Warning	1772	á a
 drop procedure test_signal $$
 #
 # Test SET complex expressions
@@ -1162,17 +1162,17 @@ MYSQL_ERRNO = 10000;
 end $$
 call test_signal() $$
 Warnings:
-Warning	1776	Data truncated for condition item 'CLASS_ORIGIN'
-Warning	1776	Data truncated for condition item 'SUBCLASS_ORIGIN'
-Warning	1776	Data truncated for condition item 'CONSTRAINT_CATALOG'
-Warning	1776	Data truncated for condition item 'CONSTRAINT_SCHEMA'
-Warning	1776	Data truncated for condition item 'CONSTRAINT_NAME'
-Warning	1776	Data truncated for condition item 'CATALOG_NAME'
-Warning	1776	Data truncated for condition item 'SCHEMA_NAME'
-Warning	1776	Data truncated for condition item 'TABLE_NAME'
-Warning	1776	Data truncated for condition item 'COLUMN_NAME'
-Warning	1776	Data truncated for condition item 'CURSOR_NAME'
-Warning	1776	Data truncated for condition item 'MESSAGE_TEXT'
+Warning	1777	Data truncated for condition item 'CLASS_ORIGIN'
+Warning	1777	Data truncated for condition item 'SUBCLASS_ORIGIN'
+Warning	1777	Data truncated for condition item 'CONSTRAINT_CATALOG'
+Warning	1777	Data truncated for condition item 'CONSTRAINT_SCHEMA'
+Warning	1777	Data truncated for condition item 'CONSTRAINT_NAME'
+Warning	1777	Data truncated for condition item 'CATALOG_NAME'
+Warning	1777	Data truncated for condition item 'SCHEMA_NAME'
+Warning	1777	Data truncated for condition item 'TABLE_NAME'
+Warning	1777	Data truncated for condition item 'COLUMN_NAME'
+Warning	1777	Data truncated for condition item 'CURSOR_NAME'
+Warning	1777	Data truncated for condition item 'MESSAGE_TEXT'
 Warning	10000	11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112222222222222222222288888888
 drop procedure test_signal $$
 create procedure test_signal()

=== modified file 'mysql-test/r/signal_demo3.result'
--- a/mysql-test/r/signal_demo3.result	2009-03-13 09:43:12 +0000
+++ b/mysql-test/r/signal_demo3.result	2009-05-29 11:05:25 +0000
@@ -78,15 +78,15 @@ ERROR 45000: Oops in proc_1
 show warnings;
 Level	Code	Message
 Error	1051	Unknown table 'oops_it_is_not_here'
-Error	1773	Oops in proc_9
-Error	1773	Oops in proc_8
-Error	1773	Oops in proc_7
-Error	1773	Oops in proc_6
-Error	1773	Oops in proc_5
-Error	1773	Oops in proc_4
-Error	1773	Oops in proc_3
-Error	1773	Oops in proc_2
-Error	1773	Oops in proc_1
+Error	1774	Oops in proc_9
+Error	1774	Oops in proc_8
+Error	1774	Oops in proc_7
+Error	1774	Oops in proc_6
+Error	1774	Oops in proc_5
+Error	1774	Oops in proc_4
+Error	1774	Oops in proc_3
+Error	1774	Oops in proc_2
+Error	1774	Oops in proc_1
 SET @@session.max_error_count = 5;
 SELECT @@session.max_error_count;
 @@session.max_error_count
@@ -95,11 +95,11 @@ call proc_1();
 ERROR 45000: Oops in proc_1
 show warnings;
 Level	Code	Message
-Error	1773	Oops in proc_5
-Error	1773	Oops in proc_4
-Error	1773	Oops in proc_3
-Error	1773	Oops in proc_2
-Error	1773	Oops in proc_1
+Error	1774	Oops in proc_5
+Error	1774	Oops in proc_4
+Error	1774	Oops in proc_3
+Error	1774	Oops in proc_2
+Error	1774	Oops in proc_1
 SET @@session.max_error_count = 7;
 SELECT @@session.max_error_count;
 @@session.max_error_count
@@ -108,13 +108,13 @@ call proc_1();
 ERROR 45000: Oops in proc_1
 show warnings;
 Level	Code	Message
-Error	1773	Oops in proc_7
-Error	1773	Oops in proc_6
-Error	1773	Oops in proc_5
-Error	1773	Oops in proc_4
-Error	1773	Oops in proc_3
-Error	1773	Oops in proc_2
-Error	1773	Oops in proc_1
+Error	1774	Oops in proc_7
+Error	1774	Oops in proc_6
+Error	1774	Oops in proc_5
+Error	1774	Oops in proc_4
+Error	1774	Oops in proc_3
+Error	1774	Oops in proc_2
+Error	1774	Oops in proc_1
 SET @@session.max_error_count = 9;
 SELECT @@session.max_error_count;
 @@session.max_error_count
@@ -123,15 +123,15 @@ call proc_1();
 ERROR 45000: Oops in proc_1
 show warnings;
 Level	Code	Message
-Error	1773	Oops in proc_9
-Error	1773	Oops in proc_8
-Error	1773	Oops in proc_7
-Error	1773	Oops in proc_6
-Error	1773	Oops in proc_5
-Error	1773	Oops in proc_4
-Error	1773	Oops in proc_3
-Error	1773	Oops in proc_2
-Error	1773	Oops in proc_1
+Error	1774	Oops in proc_9
+Error	1774	Oops in proc_8
+Error	1774	Oops in proc_7
+Error	1774	Oops in proc_6
+Error	1774	Oops in proc_5
+Error	1774	Oops in proc_4
+Error	1774	Oops in proc_3
+Error	1774	Oops in proc_2
+Error	1774	Oops in proc_1
 drop database demo;
 SET @@global.max_error_count = @start_global_value;
 SELECT @@global.max_error_count;

=== modified file 'mysql-test/r/signal_utf32.result'
--- a/mysql-test/r/signal_utf32.result	2009-03-13 09:43:12 +0000
+++ b/mysql-test/r/signal_utf32.result	2009-05-29 11:05:25 +0000
@@ -7,7 +7,7 @@ _utf32 'a';
 end $$
 call test_signal() $$
 Warnings:
-Warning	1771	a
+Warning	1772	a
 drop procedure test_signal $$
 create procedure test_signal()
 begin
@@ -17,7 +17,7 @@ _utf32 X'00000048000000450000004C0000004
 end $$
 call test_signal() $$
 Warnings:
-Warning	1771	HELLO
+Warning	1772	HELLO
 drop procedure test_signal $$
 create procedure test_signal()
 begin

=== modified file 'mysql-test/r/sp-error.result'
--- a/mysql-test/r/sp-error.result	2009-02-19 14:10:58 +0000
+++ b/mysql-test/r/sp-error.result	2009-05-29 08:09:00 +0000
@@ -1680,3 +1680,13 @@ declare continue handler for sqlstate '0
 end$$
 ERROR 42000: Bad SQLSTATE: '00000'
 LOAD DATA INFILE '../../tmp/proc.txt' INTO TABLE mysql.proc;
+CREATE TABLE t1 (a INT, b INT);
+INSERT INTO t1 VALUES (1,1), (2,2);
+SELECT MAX (a) FROM t1 WHERE b = 999999;
+ERROR 42000: FUNCTION test.MAX does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
+SELECT AVG (a) FROM t1 WHERE b = 999999;
+AVG (a)
+NULL
+SELECT non_existent (a) FROM t1 WHERE b = 999999;
+ERROR 42000: FUNCTION test.non_existent does not exist
+DROP TABLE t1;

=== modified file 'mysql-test/suite/backup/r/backup_db_grants.result'
--- a/mysql-test/suite/backup/r/backup_db_grants.result	2009-03-18 21:09:40 +0000
+++ b/mysql-test/suite/backup/r/backup_db_grants.result	2009-05-29 11:05:25 +0000
@@ -70,24 +70,24 @@ RESTORE FROM 'bup_db_grants.bak' OVERWRI
 backup_id
 #
 Warnings:
-#	1745	The grant 'ALTER ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
-#	1745	The grant 'ALTER ROUTINE ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
-#	1745	The grant 'CREATE ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
-#	1745	The grant 'CREATE ROUTINE ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
-#	1745	The grant 'CREATE TEMPORARY TABLES ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
-#	1745	The grant 'CREATE VIEW ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
-#	1745	The grant 'DELETE ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
-#	1745	The grant 'DROP ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
-#	1745	The grant 'EVENT ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
-#	1745	The grant 'EXECUTE ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
-#	1745	The grant 'INDEX ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
-#	1745	The grant 'INSERT ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
-#	1745	The grant 'LOCK TABLES ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
-#	1745	The grant 'REFERENCES ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
-#	1745	The grant 'SELECT ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
-#	1745	The grant 'SHOW VIEW ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
-#	1745	The grant 'TRIGGER ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
-#	1745	The grant 'UPDATE ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'ALTER ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'ALTER ROUTINE ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'CREATE ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'CREATE ROUTINE ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'CREATE TEMPORARY TABLES ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'CREATE VIEW ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'DELETE ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'DROP ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'EVENT ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'EXECUTE ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'INDEX ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'INSERT ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'LOCK TABLES ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'REFERENCES ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'SELECT ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'SHOW VIEW ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'TRIGGER ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'UPDATE ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
 SHOW TABLES FROM bup_db_grants;
 Tables_in_bup_db_grants
 s1
@@ -121,27 +121,27 @@ RESTORE FROM 'bup_db_grants.bak' OVERWRI
 backup_id
 #
 Warnings:
-#	1745	The grant 'INSERT ON bup_db_grants.*' for the user 'bup_user2'@'%' was skipped because the user does not exist.
-#	1745	The grant 'INSERT(b) ON bup_db_grants.s1' for the user 'bup_user2'@'%' was skipped because the user does not exist.
-#	1745	The grant 'SELECT(b) ON bup_db_grants.s1' for the user 'bup_user2'@'%' was skipped because the user does not exist.
-#	1745	The grant 'ALTER ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
-#	1745	The grant 'ALTER ROUTINE ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
-#	1745	The grant 'CREATE ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
-#	1745	The grant 'CREATE ROUTINE ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
-#	1745	The grant 'CREATE TEMPORARY TABLES ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
-#	1745	The grant 'CREATE VIEW ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
-#	1745	The grant 'DELETE ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
-#	1745	The grant 'DROP ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
-#	1745	The grant 'EVENT ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
-#	1745	The grant 'EXECUTE ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
-#	1745	The grant 'INDEX ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
-#	1745	The grant 'INSERT ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
-#	1745	The grant 'LOCK TABLES ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
-#	1745	The grant 'REFERENCES ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
-#	1745	The grant 'SELECT ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
-#	1745	The grant 'SHOW VIEW ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
-#	1745	The grant 'TRIGGER ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
-#	1745	The grant 'UPDATE ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'INSERT ON bup_db_grants.*' for the user 'bup_user2'@'%' was skipped because the user does not exist.
+#	1746	The grant 'INSERT(b) ON bup_db_grants.s1' for the user 'bup_user2'@'%' was skipped because the user does not exist.
+#	1746	The grant 'SELECT(b) ON bup_db_grants.s1' for the user 'bup_user2'@'%' was skipped because the user does not exist.
+#	1746	The grant 'ALTER ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'ALTER ROUTINE ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'CREATE ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'CREATE ROUTINE ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'CREATE TEMPORARY TABLES ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'CREATE VIEW ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'DELETE ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'DROP ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'EVENT ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'EXECUTE ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'INDEX ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'INSERT ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'LOCK TABLES ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'REFERENCES ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'SELECT ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'SHOW VIEW ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'TRIGGER ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
+#	1746	The grant 'UPDATE ON bup_db_grants.*' for the user 'no_user'@'%' was skipped because the user does not exist.
 SHOW TABLES FROM bup_db_grants;
 Tables_in_bup_db_grants
 s1

=== modified file 'mysql-test/suite/rpl/r/rpl_locktrans_falcon.result'
--- a/mysql-test/suite/rpl/r/rpl_locktrans_falcon.result	2009-03-27 22:06:26 +0000
+++ b/mysql-test/suite/rpl/r/rpl_locktrans_falcon.result	2009-05-29 11:05:25 +0000
@@ -27,8 +27,8 @@ UNLOCK TABLES;
 # Valid syntax for transactional locks.
 LOCK TABLE t1 IN SHARE MODE, t2 IN EXCLUSIVE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't1'
-Warning	1630	Converted to non-transactional lock on 't2'
+Warning	1631	Converted to non-transactional lock on 't1'
+Warning	1631	Converted to non-transactional lock on 't2'
 UNLOCK TABLES;
 #
 # Valid syntax for aliases with and without 'AS'.
@@ -36,19 +36,19 @@ LOCK TABLE t1 AS a1 READ, t2 a2 WRITE;
 UNLOCK TABLES;
 LOCK TABLE t1 AS a1 IN SHARE MODE, t2 a2 IN EXCLUSIVE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 'a1'
-Warning	1630	Converted to non-transactional lock on 'a2'
+Warning	1631	Converted to non-transactional lock on 'a1'
+Warning	1631	Converted to non-transactional lock on 'a2'
 UNLOCK TABLES;
 #
 # Transactional locks taken on a view.
 CREATE VIEW v1 AS SELECT * FROM t1, t2 WHERE t1.c1 = t2.c2;
 LOCK TABLE v1 IN SHARE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't1'
-Warning	1630	Converted to non-transactional lock on 't2'
+Warning	1631	Converted to non-transactional lock on 't1'
+Warning	1631	Converted to non-transactional lock on 't2'
 LOCK TABLE v1 IN EXCLUSIVE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 'v1'
+Warning	1631	Converted to non-transactional lock on 'v1'
 UNLOCK TABLES;
 DROP VIEW v1;
 #
@@ -101,12 +101,12 @@ ERROR 42000: You have an error in your S
 # Implicit lock method conversion due to mix in statement.
 LOCK TABLE t1 READ, t2 IN EXCLUSIVE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't2'
+Warning	1631	Converted to non-transactional lock on 't2'
 UNLOCK TABLES;
 # Lock t1 share (converted to read), t2 write.
 LOCK TABLE t1 IN SHARE MODE, t2 WRITE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't1'
+Warning	1631	Converted to non-transactional lock on 't1'
 # Show t1 is read locked, t2 write locked.
 INSERT INTO t1 SELECT * FROM t2;
 ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
@@ -117,8 +117,8 @@ INSERT INTO t2 SELECT * FROM t1;
 # Lock t1 exclusive (converted to write), t2 share (converted to read).
 LOCK TABLE t1 IN EXCLUSIVE MODE, t2 IN SHARE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't1'
-Warning	1630	Converted to non-transactional lock on 't2'
+Warning	1631	Converted to non-transactional lock on 't1'
+Warning	1631	Converted to non-transactional lock on 't2'
 # Show t1 is write locked, t2 read locked.
 INSERT INTO t1 SELECT * FROM t2;
 INSERT INTO t2 SELECT * FROM t1;
@@ -142,8 +142,8 @@ ERROR HY000: Cannot convert to non-trans
 ## Error is reported on first table only. Show both errors:
 SHOW WARNINGS;
 Level	Code	Message
-Error	1631	Cannot convert to non-transactional lock in strict mode on 't1'
-Error	1631	Cannot convert to non-transactional lock in strict mode on 't2'
+Error	1632	Cannot convert to non-transactional lock in strict mode on 't1'
+Error	1632	Cannot convert to non-transactional lock in strict mode on 't2'
 UNLOCK TABLES;
 SET @@SQL_MODE= @wl3561_save_sql_mode;
 #
@@ -163,7 +163,7 @@ CREATE TABLE t4 (c4 INT) ENGINE= MyISAM;
 # Request a transactional lock, which is converted to non-transactional.
 LOCK TABLE t4 IN SHARE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't4'
+Warning	1631	Converted to non-transactional lock on 't4'
 # Try a conflict with the existing non-transactional lock.
 INSERT INTO t4 VALUES(444);
 ERROR HY000: Table 't4' was locked with a READ lock and can't be updated
@@ -180,8 +180,8 @@ CREATE VIEW v1 AS SELECT * FROM t3, t4 W
 # Request a share lock on the view, which is converted to read locks.
 LOCK TABLE v1 IN SHARE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't3'
-Warning	1630	Converted to non-transactional lock on 't4'
+Warning	1631	Converted to non-transactional lock on 't3'
+Warning	1631	Converted to non-transactional lock on 't4'
 # Show that read locks on the base tables prohibit writing ...
 INSERT INTO t3 SELECT * FROM t4;
 ERROR HY000: Table 't3' was locked with a READ lock and can't be updated
@@ -197,7 +197,7 @@ COUNT(*)
 ## Report conversion on view due to existing non-transactional locks.
 LOCK TABLE v1 IN EXCLUSIVE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 'v1'
+Warning	1631	Converted to non-transactional lock on 'v1'
 INSERT INTO t3 VALUES(333);
 INSERT INTO t4 VALUES(444);
 INSERT INTO t1 VALUES(111);
@@ -206,8 +206,8 @@ UNLOCK TABLES;
 ## Now report conversion on base table again.
 LOCK TABLE v1 IN EXCLUSIVE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't3'
-Warning	1630	Converted to non-transactional lock on 't4'
+Warning	1631	Converted to non-transactional lock on 't3'
+Warning	1631	Converted to non-transactional lock on 't4'
 INSERT INTO t3 VALUES(333);
 INSERT INTO t4 VALUES(444);
 INSERT INTO t1 VALUES(111);

=== modified file 'mysql-test/suite/rpl/r/rpl_locktrans_innodb.result'
--- a/mysql-test/suite/rpl/r/rpl_locktrans_innodb.result	2009-04-03 17:58:04 +0000
+++ b/mysql-test/suite/rpl/r/rpl_locktrans_innodb.result	2009-05-29 11:05:25 +0000
@@ -101,12 +101,12 @@ ERROR 42000: You have an error in your S
 # Implicit lock method conversion due to mix in statement.
 LOCK TABLE t1 READ, t2 IN EXCLUSIVE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't2'
+Warning	1631	Converted to non-transactional lock on 't2'
 UNLOCK TABLES;
 # Lock t1 share (converted to read), t2 write.
 LOCK TABLE t1 IN SHARE MODE, t2 WRITE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't1'
+Warning	1631	Converted to non-transactional lock on 't1'
 # Show t1 is read locked, t2 write locked.
 INSERT INTO t1 SELECT * FROM t2;
 ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
@@ -117,8 +117,8 @@ INSERT INTO t2 SELECT * FROM t1;
 # Lock t1 exclusive (converted to write), t2 share (converted to read).
 LOCK TABLE t1 IN EXCLUSIVE MODE, t2 IN SHARE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't1'
-Warning	1630	Converted to non-transactional lock on 't2'
+Warning	1631	Converted to non-transactional lock on 't1'
+Warning	1631	Converted to non-transactional lock on 't2'
 # Show t1 is write locked, t2 read locked.
 INSERT INTO t1 SELECT * FROM t2;
 INSERT INTO t2 SELECT * FROM t1;
@@ -142,8 +142,8 @@ ERROR HY000: Cannot convert to non-trans
 ## Error is reported on first table only. Show both errors:
 SHOW WARNINGS;
 Level	Code	Message
-Error	1631	Cannot convert to non-transactional lock in strict mode on 't1'
-Error	1631	Cannot convert to non-transactional lock in strict mode on 't2'
+Error	1632	Cannot convert to non-transactional lock in strict mode on 't1'
+Error	1632	Cannot convert to non-transactional lock in strict mode on 't2'
 UNLOCK TABLES;
 SET @@SQL_MODE= @wl3561_save_sql_mode;
 #
@@ -163,7 +163,7 @@ CREATE TABLE t4 (c4 INT) ENGINE= MyISAM;
 # Request a transactional lock, which is converted to non-transactional.
 LOCK TABLE t4 IN SHARE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't4'
+Warning	1631	Converted to non-transactional lock on 't4'
 # Try a conflict with the existing non-transactional lock.
 INSERT INTO t4 VALUES(444);
 ERROR HY000: Table 't4' was locked with a READ lock and can't be updated
@@ -180,8 +180,8 @@ CREATE VIEW v1 AS SELECT * FROM t3, t4 W
 # Request a share lock on the view, which is converted to read locks.
 LOCK TABLE v1 IN SHARE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't3'
-Warning	1630	Converted to non-transactional lock on 't4'
+Warning	1631	Converted to non-transactional lock on 't3'
+Warning	1631	Converted to non-transactional lock on 't4'
 # Show that read locks on the base tables prohibit writing ...
 INSERT INTO t3 SELECT * FROM t4;
 ERROR HY000: Table 't3' was locked with a READ lock and can't be updated
@@ -197,7 +197,7 @@ COUNT(*)
 ## Report conversion on view due to existing non-transactional locks.
 LOCK TABLE v1 IN EXCLUSIVE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 'v1'
+Warning	1631	Converted to non-transactional lock on 'v1'
 INSERT INTO t3 VALUES(333);
 INSERT INTO t4 VALUES(444);
 INSERT INTO t1 VALUES(111);
@@ -206,8 +206,8 @@ UNLOCK TABLES;
 ## Now report conversion on base table again.
 LOCK TABLE v1 IN EXCLUSIVE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't3'
-Warning	1630	Converted to non-transactional lock on 't4'
+Warning	1631	Converted to non-transactional lock on 't3'
+Warning	1631	Converted to non-transactional lock on 't4'
 INSERT INTO t3 VALUES(333);
 INSERT INTO t4 VALUES(444);
 INSERT INTO t1 VALUES(111);

=== modified file 'mysql-test/suite/rpl/r/rpl_locktrans_myisam.result'
--- a/mysql-test/suite/rpl/r/rpl_locktrans_myisam.result	2009-03-27 22:06:26 +0000
+++ b/mysql-test/suite/rpl/r/rpl_locktrans_myisam.result	2009-05-29 11:05:25 +0000
@@ -68,8 +68,8 @@ UNLOCK TABLES;
 # Valid syntax for transactional locks.
 LOCK TABLE t1 IN SHARE MODE, t2 IN EXCLUSIVE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't1'
-Warning	1630	Converted to non-transactional lock on 't2'
+Warning	1631	Converted to non-transactional lock on 't1'
+Warning	1631	Converted to non-transactional lock on 't2'
 UNLOCK TABLES;
 #
 # Valid syntax for aliases with and without 'AS'.
@@ -77,19 +77,19 @@ LOCK TABLE t1 AS a1 READ, t2 a2 WRITE;
 UNLOCK TABLES;
 LOCK TABLE t1 AS a1 IN SHARE MODE, t2 a2 IN EXCLUSIVE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 'a1'
-Warning	1630	Converted to non-transactional lock on 'a2'
+Warning	1631	Converted to non-transactional lock on 'a1'
+Warning	1631	Converted to non-transactional lock on 'a2'
 UNLOCK TABLES;
 #
 # Transactional locks taken on a view.
 CREATE VIEW v1 AS SELECT * FROM t1, t2 WHERE t1.c1 = t2.c2;
 LOCK TABLE v1 IN SHARE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't1'
-Warning	1630	Converted to non-transactional lock on 't2'
+Warning	1631	Converted to non-transactional lock on 't1'
+Warning	1631	Converted to non-transactional lock on 't2'
 LOCK TABLE v1 IN EXCLUSIVE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 'v1'
+Warning	1631	Converted to non-transactional lock on 'v1'
 UNLOCK TABLES;
 DROP VIEW v1;
 #
@@ -142,12 +142,12 @@ ERROR 42000: You have an error in your S
 # Implicit lock method conversion due to mix in statement.
 LOCK TABLE t1 READ, t2 IN EXCLUSIVE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't2'
+Warning	1631	Converted to non-transactional lock on 't2'
 UNLOCK TABLES;
 # Lock t1 share (converted to read), t2 write.
 LOCK TABLE t1 IN SHARE MODE, t2 WRITE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't1'
+Warning	1631	Converted to non-transactional lock on 't1'
 # Show t1 is read locked, t2 write locked.
 INSERT INTO t1 SELECT * FROM t2;
 ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
@@ -158,8 +158,8 @@ INSERT INTO t2 SELECT * FROM t1;
 # Lock t1 exclusive (converted to write), t2 share (converted to read).
 LOCK TABLE t1 IN EXCLUSIVE MODE, t2 IN SHARE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't1'
-Warning	1630	Converted to non-transactional lock on 't2'
+Warning	1631	Converted to non-transactional lock on 't1'
+Warning	1631	Converted to non-transactional lock on 't2'
 # Show t1 is write locked, t2 read locked.
 INSERT INTO t1 SELECT * FROM t2;
 INSERT INTO t2 SELECT * FROM t1;
@@ -183,8 +183,8 @@ ERROR HY000: Cannot convert to non-trans
 ## Error is reported on first table only. Show both errors:
 SHOW WARNINGS;
 Level	Code	Message
-Error	1631	Cannot convert to non-transactional lock in strict mode on 't1'
-Error	1631	Cannot convert to non-transactional lock in strict mode on 't2'
+Error	1632	Cannot convert to non-transactional lock in strict mode on 't1'
+Error	1632	Cannot convert to non-transactional lock in strict mode on 't2'
 UNLOCK TABLES;
 SET @@SQL_MODE= @wl3561_save_sql_mode;
 #
@@ -204,7 +204,7 @@ CREATE TABLE t4 (c4 INT) ENGINE= MyISAM;
 # Request a transactional lock, which is converted to non-transactional.
 LOCK TABLE t4 IN SHARE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't4'
+Warning	1631	Converted to non-transactional lock on 't4'
 # Try a conflict with the existing non-transactional lock.
 INSERT INTO t4 VALUES(444);
 ERROR HY000: Table 't4' was locked with a READ lock and can't be updated
@@ -221,8 +221,8 @@ CREATE VIEW v1 AS SELECT * FROM t3, t4 W
 # Request a share lock on the view, which is converted to read locks.
 LOCK TABLE v1 IN SHARE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't3'
-Warning	1630	Converted to non-transactional lock on 't4'
+Warning	1631	Converted to non-transactional lock on 't3'
+Warning	1631	Converted to non-transactional lock on 't4'
 # Show that read locks on the base tables prohibit writing ...
 INSERT INTO t3 SELECT * FROM t4;
 ERROR HY000: Table 't3' was locked with a READ lock and can't be updated
@@ -238,7 +238,7 @@ COUNT(*)
 ## Report conversion on view due to existing non-transactional locks.
 LOCK TABLE v1 IN EXCLUSIVE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 'v1'
+Warning	1631	Converted to non-transactional lock on 'v1'
 INSERT INTO t3 VALUES(333);
 INSERT INTO t4 VALUES(444);
 INSERT INTO t1 VALUES(111);
@@ -247,8 +247,8 @@ UNLOCK TABLES;
 ## Now report conversion on base table again.
 LOCK TABLE v1 IN EXCLUSIVE MODE;
 Warnings:
-Warning	1630	Converted to non-transactional lock on 't3'
-Warning	1630	Converted to non-transactional lock on 't4'
+Warning	1631	Converted to non-transactional lock on 't3'
+Warning	1631	Converted to non-transactional lock on 't4'
 INSERT INTO t3 VALUES(333);
 INSERT INTO t4 VALUES(444);
 INSERT INTO t1 VALUES(111);

=== modified file 'mysql-test/t/mysql.test'
--- a/mysql-test/t/mysql.test	2009-05-15 17:44:55 +0000
+++ b/mysql-test/t/mysql.test	2009-05-29 10:17:28 +0000
@@ -349,6 +349,14 @@ remove_file $MYSQLTEST_VARDIR/tmp/bug310
 --exec $MYSQL --ignore-spaces -e "SELECT COUNT (*)"
 --exec $MYSQL -b -i -e "SELECT COUNT (*)"
 
+#
+# Bug#37268 'binary' character set makes CLI-internal commands case sensitive
+#
+--replace_regex /\([0-9]*\)/(errno)/
+--error 1
+--exec $MYSQL --default-character-set=binary test -e "CONNECT test invalid_hostname" 2>&1
+--exec $MYSQL --default-character-set=binary test -e "DELIMITER //" 2>&1
+
 --echo End of 5.0 tests
 
 #

=== modified file 'mysql-test/t/sp-error.test'
--- a/mysql-test/t/sp-error.test	2008-12-24 10:48:24 +0000
+++ b/mysql-test/t/sp-error.test	2009-05-29 08:09:00 +0000
@@ -2504,3 +2504,16 @@ delimiter ;$$
 #
 LOAD DATA INFILE '../../tmp/proc.txt' INTO TABLE mysql.proc;
 remove_file $MYSQLTEST_VARDIR/tmp/proc.txt;
+
+#
+# Bug #38159: Function parsing problem generates misleading error message
+#
+
+CREATE TABLE t1 (a INT, b INT);
+INSERT INTO t1 VALUES (1,1), (2,2);
+--error ER_FUNC_INEXISTENT_NAME_COLLISION
+SELECT MAX (a) FROM t1 WHERE b = 999999;
+SELECT AVG (a) FROM t1 WHERE b = 999999;
+--error ER_SP_DOES_NOT_EXIST
+SELECT non_existent (a) FROM t1 WHERE b = 999999;
+DROP TABLE t1;

=== modified file 'scripts/mysqld_safe.sh'
--- a/scripts/mysqld_safe.sh	2009-05-25 10:10:18 +0000
+++ b/scripts/mysqld_safe.sh	2009-05-25 17:15:56 +0000
@@ -67,7 +67,7 @@ my_which ()
   ret=0
   for file
   do
-    for dir in "$PATH"
+    for dir in $PATH
     do
       if [ -f "$dir/$file" ]
       then

=== modified file 'sql/item_func.cc'
--- a/sql/item_func.cc	2009-05-25 10:10:18 +0000
+++ b/sql/item_func.cc	2009-05-29 08:09:00 +0000
@@ -5922,6 +5922,14 @@ Item_func_sp::func_name() const
 }
 
 
+void my_missing_function_error(const LEX_STRING &token, const char *func_name)
+{
+  if (token.length && is_lex_native_function (&token))
+    my_error(ER_FUNC_INEXISTENT_NAME_COLLISION, MYF(0), func_name);
+  else
+    my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "FUNCTION", func_name);
+}
+
 
 /**
   @brief Initialize the result field by creating a temporary dummy table
@@ -5954,7 +5962,7 @@ Item_func_sp::init_result_field(THD *thd
   if (!(m_sp= sp_find_routine(thd, TYPE_ENUM_FUNCTION, m_name,
                                &thd->sp_func_cache, TRUE)))
   {
-    my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "FUNCTION", m_name->m_qname.str);
+    my_missing_function_error (m_name->m_name, m_name->m_qname.str);
     context->process_error(thd);
     DBUG_RETURN(TRUE);
   }

=== modified file 'sql/share/errmsg.txt'
--- a/sql/share/errmsg.txt	2009-05-20 08:27:39 +0000
+++ b/sql/share/errmsg.txt	2009-05-29 08:09:00 +0000
@@ -6172,6 +6172,9 @@ ER_TOO_LONG_FIELD_COMMENT
   eng "Comment for field '%-.64s' is too long (max = %lu)"
   por "Comentário para o campo '%-.64s' é longo demais (max = %lu)"
 
+ER_FUNC_INEXISTENT_NAME_COLLISION 42000 
+  eng "FUNCTION %s does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual"
+
 ER_WARN_AUTO_CONVERT_LOCK
         eng "Converted to non-transactional lock on '%-.64s'"
         ger "Umgewandelt zu nicht-transaktionalen Sperren auf '%-.64s'"

=== modified file 'sql/sql_derived.cc'
--- a/sql/sql_derived.cc	2009-03-17 20:07:27 +0000
+++ b/sql/sql_derived.cc	2009-05-29 08:09:00 +0000
@@ -180,6 +180,7 @@ exit:
     {
       if (thd->is_error() &&
           (thd->stmt_da->sql_errno() == ER_BAD_FIELD_ERROR ||
+          thd->stmt_da->sql_errno() == ER_FUNC_INEXISTENT_NAME_COLLISION ||
           thd->stmt_da->sql_errno() == ER_SP_DOES_NOT_EXIST))
       {
         thd->clear_error();

=== modified file 'sql/sql_lex.cc'
--- a/sql/sql_lex.cc	2009-05-25 10:10:18 +0000
+++ b/sql/sql_lex.cc	2009-05-29 08:09:00 +0000
@@ -445,6 +445,16 @@ bool is_keyword(const char *name, uint l
   return get_hash_symbol(name,len,0)!=0;
 }
 
+/**
+  Check if name is a sql function
+
+    @param name      checked name
+
+    @return is this a native function or not
+    @retval 0         name is a function
+    @retval 1         name isn't a function
+*/
+
 bool is_lex_native_function(const LEX_STRING *name)
 {
   DBUG_ASSERT(name != NULL);

=== modified file 'sql/sql_lex.h'
--- a/sql/sql_lex.h	2009-05-15 13:45:06 +0000
+++ b/sql/sql_lex.h	2009-05-29 08:09:00 +0000
@@ -2113,4 +2113,6 @@ extern bool is_lex_native_function(const
   @} (End of group Semantic_Analysis)
 */
 
+void my_missing_function_error(const LEX_STRING &token, const char *name);
+
 #endif /* MYSQL_SERVER */

=== modified file 'sql/table.cc'
--- a/sql/table.cc	2009-05-07 20:48:24 +0000
+++ b/sql/table.cc	2009-05-29 08:09:00 +0000
@@ -839,7 +839,7 @@ static int open_binary_frm(THD *thd, TAB
   strpos=disk_buff+6;
 
   if (!(rec_per_key= (ulong*) alloc_root(&share->mem_root,
-					 sizeof(ulong*)*key_parts)))
+                                         sizeof(ulong)*key_parts)))
     goto err;
 
   for (i=0 ; i < keys ; i++, keyinfo++)
@@ -3473,6 +3473,7 @@ void TABLE_LIST::hide_view_error(THD *th
 
   if (thd->stmt_da->sql_errno() == ER_BAD_FIELD_ERROR ||
       thd->stmt_da->sql_errno() == ER_SP_DOES_NOT_EXIST ||
+      thd->stmt_da->sql_errno() == ER_FUNC_INEXISTENT_NAME_COLLISION ||
       thd->stmt_da->sql_errno() == ER_PROCACCESS_DENIED_ERROR ||
       thd->stmt_da->sql_errno() == ER_COLUMNACCESS_DENIED_ERROR ||
       thd->stmt_da->sql_errno() == ER_TABLEACCESS_DENIED_ERROR ||

=== modified file 'storage/ibmdb2i/db2i_conversion.cc'
--- a/storage/ibmdb2i/db2i_conversion.cc	2009-05-05 09:33:52 +0000
+++ b/storage/ibmdb2i/db2i_conversion.cc	2009-05-29 09:31:00 +0000
@@ -1085,7 +1085,7 @@ int32 ha_ibmdb2i::convertMySQLtoDB2(Fiel
                   if (bytesToStore)
                     memcpy(db2Buf, dataToStore, bytesToStore);
                   if (bytesToPad)
-                    wmemset((wchar_t*)(db2Buf + bytesToStore), 0x0020, bytesToPad/2);
+                    memset16((db2Buf + bytesToStore), 0x0020, bytesToPad/2);
                 }
                 else
                 {
@@ -1108,7 +1108,7 @@ int32 ha_ibmdb2i::convertMySQLtoDB2(Fiel
                     bytesToStore = db2BytesToStore;
                   }
                   if (db2BytesToStore < maxDb2BytesToStore) // If need to pad
-                    wmemset((wchar_t*)(db2Buf + db2BytesToStore), 0x0020, (maxDb2BytesToStore - db2BytesToStore)/2);
+                    memset16((db2Buf + db2BytesToStore), 0x0020, (maxDb2BytesToStore - db2BytesToStore)/2);
                 }
 
                 if (db2FieldType == QMY_VARGRAPHIC)

=== modified file 'storage/ibmdb2i/db2i_misc.h'
--- a/storage/ibmdb2i/db2i_misc.h	2009-04-10 07:48:07 +0000
+++ b/storage/ibmdb2i/db2i_misc.h	2009-05-29 09:31:00 +0000
@@ -109,5 +109,21 @@ bool isOrdinaryIdentifier(const char* s)
   }
   return true;
 }
+
+/**
+  Fill memory with a 16-bit word.
   
+  @param p  Pointer to space to fill.
+  @param v  Value to fill
+  @param l  Length of space (in 16-bit words)
+*/
+void memset16(void* p, uint16 v, size_t l)
+{
+  uint16* p2=(uint16*)p;
+  while (l--)
+  {
+    *(p2++) = v;
+  }
+}
+
 #endif

=== modified file 'storage/myisam/ha_myisam.cc'
--- a/storage/myisam/ha_myisam.cc	2009-05-15 13:45:06 +0000
+++ b/storage/myisam/ha_myisam.cc	2009-05-27 10:46:16 +0000
@@ -1730,7 +1730,7 @@ int ha_myisam::info(uint flag)
     if (share->key_parts)
       memcpy((char*) table->key_info[0].rec_per_key,
 	     (char*) misam_info.rec_per_key,
-	     sizeof(table->key_info[0].rec_per_key[0])*share->key_parts);
+             sizeof(table->key_info[0].rec_per_key[0])*share->key_parts);
     if (share->tmp_table == NO_TMP_TABLE)
       pthread_mutex_unlock(&share->LOCK_ha_data);
 

=== modified file 'storage/myisam/myisamchk.c'
--- a/storage/myisam/myisamchk.c	2009-04-09 08:09:25 +0000
+++ b/storage/myisam/myisamchk.c	2009-05-27 09:10:21 +0000
@@ -33,6 +33,12 @@ SET_STACK_SIZE(9000)			/* Minimum stack
 #define my_raid_delete(A,B,C) my_delete(A,B)
 #endif
 
+#if SIZEOF_VOIDP > 4
+#define GET_SIZE_T GET_ULL
+#else
+#define GET_SIZE_T GET_ULONG
+#endif
+
 static uint decode_bits;
 static char **default_argv;
 static const char *load_default_groups[]= { "myisamchk", 0 };
@@ -284,8 +290,8 @@ static struct my_option my_long_options[
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   { "key_buffer_size", OPT_KEY_BUFFER_SIZE, "",
     (uchar**) &check_param.use_buffers, (uchar**) &check_param.use_buffers, 0,
-    GET_ULONG, REQUIRED_ARG, (long) USE_BUFFER_INIT, (long) MALLOC_OVERHEAD,
-    (long) ~0L, (long) MALLOC_OVERHEAD, (long) IO_SIZE, 0},
+    GET_SIZE_T, REQUIRED_ARG, USE_BUFFER_INIT, MALLOC_OVERHEAD,
+    SIZE_T_MAX, MALLOC_OVERHEAD,  IO_SIZE, 0},
   { "key_cache_block_size", OPT_KEY_CACHE_BLOCK_SIZE,  "",
     (uchar**) &opt_key_cache_block_size,
     (uchar**) &opt_key_cache_block_size, 0,

=== modified file 'storage/myisammrg/ha_myisammrg.cc'
--- a/storage/myisammrg/ha_myisammrg.cc	2009-05-15 13:45:06 +0000
+++ b/storage/myisammrg/ha_myisammrg.cc	2009-05-27 10:46:16 +0000
@@ -1127,11 +1127,11 @@ int ha_myisammrg::info(uint flag)
         with such a number, it'll be an error later anyway.
       */
       bzero((char*) table->key_info[0].rec_per_key,
-            sizeof(table->key_info[0].rec_per_key) * table->s->key_parts);
+            sizeof(table->key_info[0].rec_per_key[0]) * table->s->key_parts);
 #endif
       memcpy((char*) table->key_info[0].rec_per_key,
 	     (char*) mrg_info.rec_per_key,
-             sizeof(table->key_info[0].rec_per_key) *
+             sizeof(table->key_info[0].rec_per_key[0]) *
              min(file->keys, table->s->key_parts));
     }
   }

Attachment: [text/bzr-bundle] bzr/azundris@mysql.com-20090529152513-6aenn2gffiqpfhex.bundle
Thread
bzr commit into mysql-6.0-bugteam branch (azundris:3325) Tatiana A. Nurnberg29 May 2009