List:Commits« Previous MessageNext Message »
From:Marc Alff Date:August 26 2010 9:21pm
Subject:bzr commit into mysql-5.5-bugfixing branch (marc.alff:3193)
View as plain text  
#At file:///home/malff/BZR_TREE/mysql-5.5-bugfixing-52312/ based on revid:marc.alff@stripped

 3193 Marc Alff	2010-08-26 [merge]
      local merge

    added:
      mysql-test/r/mysql_not_windows.result
      mysql-test/suite/perfschema/r/bad_option_3.result
      mysql-test/suite/perfschema/r/bad_option_4.result
      mysql-test/suite/perfschema/r/bad_option_5.result
      mysql-test/suite/perfschema/r/short_option_1.result
      mysql-test/suite/perfschema/r/short_option_2.result
      mysql-test/suite/perfschema/t/bad_option_3.test
      mysql-test/suite/perfschema/t/bad_option_4.test
      mysql-test/suite/perfschema/t/bad_option_5.test
      mysql-test/suite/perfschema/t/short_option_1-master.opt
      mysql-test/suite/perfschema/t/short_option_1.test
      mysql-test/suite/perfschema/t/short_option_2-master.opt
      mysql-test/suite/perfschema/t/short_option_2.test
      mysql-test/t/mysql_not_windows.test
    modified:
      mysql-test/mysql-test-run.pl
      mysql-test/r/ctype_utf32.result
      mysql-test/r/mysql.result
      mysql-test/suite/ndb/r/ndb_binlog_ddl_multi.result
      mysql-test/suite/ndb/r/ndb_binlog_ignore_db.result
      mysql-test/suite/ndb/r/ndb_binlog_log_bin.result
      mysql-test/suite/ndb/r/ndb_binlog_multi.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result
      mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result
      mysql-test/t/ctype_utf32.test
      mysql-test/t/mysql.test
      mysys/my_getopt.c
      sql/set_var.cc
      storage/myisam/mi_key.c
      storage/perfschema/pfs.cc
      storage/perfschema/pfs_stat.h
=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl	2010-08-23 08:48:27 +0000
+++ b/mysql-test/mysql-test-run.pl	2010-08-25 13:55:22 +0000
@@ -2155,9 +2155,8 @@ sub environment_setup {
   # mysqlhotcopy
   # ----------------------------------------------------
   my $mysqlhotcopy=
-    mtr_pl_maybe_exists("$bindir/scripts/mysqlhotcopy");
-  # Since mysqltest interprets the real path as "false" in an if,
-  # use 1 ("true") to indicate "not exists" so it can be tested for
+    mtr_pl_maybe_exists("$bindir/scripts/mysqlhotcopy") ||
+    mtr_pl_maybe_exists("$path_client_bindir/mysqlhotcopy");
   if ($mysqlhotcopy)
   {
     $ENV{'MYSQLHOTCOPY'}= $mysqlhotcopy;

=== modified file 'mysql-test/r/ctype_utf32.result'
--- a/mysql-test/r/ctype_utf32.result	2010-08-20 11:14:11 +0000
+++ b/mysql-test/r/ctype_utf32.result	2010-08-26 12:36:33 +0000
@@ -1114,5 +1114,18 @@ format(123,2,'no_NO')
 123,00
 DROP TABLE t1;
 #
+# Bug#42511 mysqld: ctype-ucs2.c:2044: my_strnncollsp_utf32: Assertion (tlen % 4) == 0' faied
+#
+CREATE TABLE t1 (
+b char(250) CHARACTER SET utf32,
+key (b)
+) ENGINE=MYISAM;
+INSERT INTO t1 VALUES ('d'),('f');
+SELECT * FROM t1 WHERE b BETWEEN 'a' AND 'z';
+b
+d
+f
+DROP TABLE t1;
+#
 # End of 5.5 tests
 #

=== modified file 'mysql-test/r/mysql.result'
--- a/mysql-test/r/mysql.result	2010-08-19 11:35:47 +0000
+++ b/mysql-test/r/mysql.result	2010-08-25 08:17:15 +0000
@@ -432,8 +432,5 @@ Bug #47147: mysql client option --skip-c
 
 *************************** 1. row ***************************
 1
-Bug #54466 client 5.5 built from source lacks "pager" support
-a
-1
 
 End of tests

=== added file 'mysql-test/r/mysql_not_windows.result'
--- a/mysql-test/r/mysql_not_windows.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/mysql_not_windows.result	2010-08-25 08:17:15 +0000
@@ -0,0 +1,5 @@
+Bug #54466 client 5.5 built from source lacks "pager" support
+a
+1
+
+End of tests

=== modified file 'mysql-test/suite/ndb/r/ndb_binlog_ddl_multi.result'
--- a/mysql-test/suite/ndb/r/ndb_binlog_ddl_multi.result	2007-12-19 16:16:22 +0000
+++ b/mysql-test/suite/ndb/r/ndb_binlog_ddl_multi.result	2010-08-25 14:13:20 +0000
@@ -193,4 +193,4 @@ mysqld-bin.000001	#	Table_map	2	#	table_
 mysqld-bin.000001	#	Write_rows	2	#	table_id: #
 mysqld-bin.000001	#	Write_rows	2	#	table_id: # flags: STMT_END_F
 mysqld-bin.000001	#	Query	2	#	COMMIT
-mysqld-bin.000001	#	Query	2	#	use `test`; drop table t2
+mysqld-bin.000001	#	Query	2	#	use `test`; DROP TABLE `t2` /* generated by server */

=== modified file 'mysql-test/suite/ndb/r/ndb_binlog_ignore_db.result'
--- a/mysql-test/suite/ndb/r/ndb_binlog_ignore_db.result	2007-12-19 16:16:22 +0000
+++ b/mysql-test/suite/ndb/r/ndb_binlog_ignore_db.result	2010-08-25 14:13:20 +0000
@@ -7,5 +7,5 @@ create table t1 (a int primary key, b in
 insert into t1 values (1, 1);
 show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-mysqld-bin.000001	#	Query	1	#	use `test`; drop table if exists t1
+mysqld-bin.000001	#	Query	1	#	use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */
 drop database mysqltest;

=== modified file 'mysql-test/suite/ndb/r/ndb_binlog_log_bin.result'
--- a/mysql-test/suite/ndb/r/ndb_binlog_log_bin.result	2007-12-19 16:16:22 +0000
+++ b/mysql-test/suite/ndb/r/ndb_binlog_log_bin.result	2010-08-25 14:13:20 +0000
@@ -47,8 +47,8 @@ mysqld-bin.000001	#	Table_map	1	#	table_
 mysqld-bin.000001	#	Write_rows	1	#	table_id: #
 mysqld-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
 mysqld-bin.000001	#	Query	1	#	COMMIT
-mysqld-bin.000001	#	Query	1	#	use `mysqltest`; drop table t1
-mysqld-bin.000001	#	Query	1	#	use `mysqltest`; drop table t2
+mysqld-bin.000001	#	Query	1	#	use `mysqltest`; DROP TABLE `t1` /* generated by server */
+mysqld-bin.000001	#	Query	1	#	use `mysqltest`; DROP TABLE `t2` /* generated by server */
 mysqld-bin.000001	#	Query	1	#	use `mysqltest`; create table t1 (d int key, e int) engine=ndb
 mysqld-bin.000001	#	Query	1	#	use `mysqltest`; create table t2 (d int key, e int) engine=ndb
 mysqld-bin.000001	#	Query	1	#	BEGIN

=== modified file 'mysql-test/suite/ndb/r/ndb_binlog_multi.result'
--- a/mysql-test/suite/ndb/r/ndb_binlog_multi.result	2007-12-19 16:16:22 +0000
+++ b/mysql-test/suite/ndb/r/ndb_binlog_multi.result	2010-08-25 14:13:20 +0000
@@ -37,7 +37,7 @@ mysqld-bin.000001	#	Table_map	1	#	table_
 mysqld-bin.000001	#	Write_rows	1	#	table_id: #
 mysqld-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
 mysqld-bin.000001	#	Query	1	#	COMMIT
-mysqld-bin.000001	#	Query	1	#	use `test`; DROP TABLE t2
+mysqld-bin.000001	#	Query	1	#	use `test`; DROP TABLE `t2` /* generated by server */
 SELECT inserts,updates,deletes,schemaops FROM 
 mysql.ndb_binlog_index WHERE epoch=<the_epoch>;
 inserts	updates	deletes	schemaops
@@ -73,7 +73,7 @@ mysqld-bin.000001	#	Table_map	2	#	table_
 mysqld-bin.000001	#	Write_rows	2	#	table_id: #
 mysqld-bin.000001	#	Write_rows	2	#	table_id: # flags: STMT_END_F
 mysqld-bin.000001	#	Query	2	#	COMMIT
-mysqld-bin.000001	#	Query	2	#	use `test`; drop table t1
+mysqld-bin.000001	#	Query	2	#	use `test`; DROP TABLE `t1` /* generated by server */
 SELECT inserts,updates,deletes,schemaops FROM
 mysql.ndb_binlog_index WHERE epoch > <the_epoch> AND epoch <= <the_epoch2>;
 inserts	updates	deletes	schemaops

=== added file 'mysql-test/suite/perfschema/r/bad_option_3.result'
--- a/mysql-test/suite/perfschema/r/bad_option_3.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/bad_option_3.result	2010-08-26 00:59:28 +0000
@@ -0,0 +1,2 @@
+Found: unknown option '-x'
+Found: Aborting

=== added file 'mysql-test/suite/perfschema/r/bad_option_4.result'
--- a/mysql-test/suite/perfschema/r/bad_option_4.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/bad_option_4.result	2010-08-26 00:59:28 +0000
@@ -0,0 +1,2 @@
+Found: Can't change dir to.*bad_option_h_param
+Found: Aborting

=== added file 'mysql-test/suite/perfschema/r/bad_option_5.result'
--- a/mysql-test/suite/perfschema/r/bad_option_5.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/bad_option_5.result	2010-08-26 00:59:28 +0000
@@ -0,0 +1,2 @@
+Found: unknown option '-X'
+Found: Aborting

=== added file 'mysql-test/suite/perfschema/r/short_option_1.result'
--- a/mysql-test/suite/perfschema/r/short_option_1.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/short_option_1.result	2010-08-26 00:59:28 +0000
@@ -0,0 +1,27 @@
+select 'Ok, the server started' as result;
+result
+Ok, the server started
+select @@SQL_MODE;
+@@SQL_MODE
+REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI
+show variables like 'sql_mode';
+Variable_name	Value
+sql_mode	REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI
+select @@character_set_server;
+@@character_set_server
+utf8
+show variables like 'character_set_system';
+Variable_name	Value
+character_set_system	utf8
+show variables like 'log';
+Variable_name	Value
+log	ON
+show variables like 'general_log';
+Variable_name	Value
+general_log	ON
+show variables like 'new';
+Variable_name	Value
+new	ON
+show variables like 'log_warnings';
+Variable_name	Value
+log_warnings	3

=== added file 'mysql-test/suite/perfschema/r/short_option_2.result'
--- a/mysql-test/suite/perfschema/r/short_option_2.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/short_option_2.result	2010-08-26 00:59:28 +0000
@@ -0,0 +1,9 @@
+select 'Ok, the server started' as result;
+result
+Ok, the server started
+select @@SQL_MODE;
+@@SQL_MODE
+REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI
+select @@log_warnings;
+@@log_warnings
+5

=== added file 'mysql-test/suite/perfschema/t/bad_option_3.test'
--- a/mysql-test/suite/perfschema/t/bad_option_3.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/bad_option_3.test	2010-08-26 00:59:28 +0000
@@ -0,0 +1,49 @@
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
+
+# Tests for PERFORMANCE_SCHEMA
+# Check error handling for invalid server start options
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+let $outfile= $MYSQLTEST_VARDIR/tmp/bad_option_3.txt;
+--error 0,1
+--remove_file $outfile
+--error 2
+--exec $MYSQLD_BOOTSTRAP_CMD --loose-console -a -x > $outfile 2>&1
+
+perl;
+    use strict;
+    use warnings;
+    my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/bad_option_3.txt";
+    open(FILE, "<", $fname) or die;
+    my @lines= <FILE>;
+    # those must be in the file for the test to pass
+    my @patterns=
+      ("unknown option '-x'",
+       "Aborting");
+    foreach my $one_line (@lines)
+    {
+      foreach my $one_pattern (@patterns)
+      {
+        # print pattern, not line, to get a stable output
+        print "Found: $one_pattern\n" if ($one_line =~ /$one_pattern/);
+      }
+    }
+    close FILE;
+EOF
+--remove_file $outfile
+

=== added file 'mysql-test/suite/perfschema/t/bad_option_4.test'
--- a/mysql-test/suite/perfschema/t/bad_option_4.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/bad_option_4.test	2010-08-26 00:59:28 +0000
@@ -0,0 +1,49 @@
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
+
+# Tests for PERFORMANCE_SCHEMA
+# Check error handling for invalid server start options
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+let $outfile= $MYSQLTEST_VARDIR/tmp/bad_option_4.txt;
+--error 0,1
+--remove_file $outfile
+--error 1
+--exec $MYSQLD_BOOTSTRAP_CMD --loose-console -a -h bad_option_h_param > $outfile 2>&1
+
+perl;
+    use strict;
+    use warnings;
+    my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/bad_option_4.txt";
+    open(FILE, "<", $fname) or die;
+    my @lines= <FILE>;
+    # those must be in the file for the test to pass
+    my @patterns=
+      ("Can't change dir to.*bad_option_h_param",
+       "Aborting");
+    foreach my $one_line (@lines)
+    {
+      foreach my $one_pattern (@patterns)
+      {
+        # print pattern, not line, to get a stable output
+        print "Found: $one_pattern\n" if ($one_line =~ /$one_pattern/);
+      }
+    }
+    close FILE;
+EOF
+--remove_file $outfile
+

=== added file 'mysql-test/suite/perfschema/t/bad_option_5.test'
--- a/mysql-test/suite/perfschema/t/bad_option_5.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/bad_option_5.test	2010-08-26 00:59:28 +0000
@@ -0,0 +1,52 @@
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
+
+# Tests for PERFORMANCE_SCHEMA
+# Check error handling for invalid server start options
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+let $outfile= $MYSQLTEST_VARDIR/tmp/bad_option_5.txt;
+--error 0,1
+--remove_file $outfile
+--error 2
+--exec $MYSQLD_BOOTSTRAP_CMD --loose-console -aXbroken > $outfile 2>&1
+
+# -aXbroken should be parsed as -a -Xbroken, or --ansi -Xbroken,
+# therefore the -X option is what the server should complain about
+
+perl;
+    use strict;
+    use warnings;
+    my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/bad_option_5.txt";
+    open(FILE, "<", $fname) or die;
+    my @lines= <FILE>;
+    # those must be in the file for the test to pass
+    my @patterns=
+      ("unknown option '-X'",
+       "Aborting");
+    foreach my $one_line (@lines)
+    {
+      foreach my $one_pattern (@patterns)
+      {
+        # print pattern, not line, to get a stable output
+        print "Found: $one_pattern\n" if ($one_line =~ /$one_pattern/);
+      }
+    }
+    close FILE;
+EOF
+--remove_file $outfile
+

=== added file 'mysql-test/suite/perfschema/t/short_option_1-master.opt'
--- a/mysql-test/suite/perfschema/t/short_option_1-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/short_option_1-master.opt	2010-08-26 00:59:28 +0000
@@ -0,0 +1 @@
+-a -n -Cutf8 --collation=utf8_bin -l -T12 -W3

=== added file 'mysql-test/suite/perfschema/t/short_option_1.test'
--- a/mysql-test/suite/perfschema/t/short_option_1.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/short_option_1.test	2010-08-26 00:59:28 +0000
@@ -0,0 +1,35 @@
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
+
+# Tests for PERFORMANCE_SCHEMA
+# Check server start for short server start options
+
+select 'Ok, the server started' as result;
+
+# See the associated -master.opt file.
+
+select @@SQL_MODE;
+show variables like 'sql_mode';
+
+select @@character_set_server;
+show variables like 'character_set_system';
+
+show variables like 'log';
+show variables like 'general_log';
+
+show variables like 'new';
+
+show variables like 'log_warnings';
+

=== added file 'mysql-test/suite/perfschema/t/short_option_2-master.opt'
--- a/mysql-test/suite/perfschema/t/short_option_2-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/short_option_2-master.opt	2010-08-26 00:59:28 +0000
@@ -0,0 +1 @@
+-aW5

=== added file 'mysql-test/suite/perfschema/t/short_option_2.test'
--- a/mysql-test/suite/perfschema/t/short_option_2.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/short_option_2.test	2010-08-26 00:59:28 +0000
@@ -0,0 +1,29 @@
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
+
+# Tests for PERFORMANCE_SCHEMA
+# Check server start for short server start options
+
+select 'Ok, the server started' as result;
+
+# See the associated -master.opt file.
+# -aW5 should be parsed as -a -W5, which are two separate short options
+# stuffed inside a single argv[i] argument.
+
+# Should contain ANSI, since we started the server with -a (stands for --ansi)
+select @@SQL_MODE;
+
+# Should be 5, since we started the server with -W5
+select @@log_warnings;

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result	2010-05-26 14:34:25 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result	2010-08-25 14:13:20 +0000
@@ -25,7 +25,7 @@ master-bin.000001	#	Table_map	#	#	table_
 master-bin.000001	#	Write_rows	#	#	table_id: #
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
 master-bin.000001	#	Query	#	#	COMMIT
-master-bin.000001	#	Query	#	#	use `test`; drop table t1
+master-bin.000001	#	Query	#	#	use `test`; DROP TABLE `t1` /* generated by server */
 master-bin.000001	#	Query	#	#	use `test`; create table t1 (word char(20) not null)ENGINE=NDB
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
@@ -204,7 +204,7 @@ master-bin.000001	#	Table_map	#	#	table_
 master-bin.000001	#	Write_rows	#	#	table_id: #
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
 master-bin.000001	#	Query	#	#	COMMIT
-master-bin.000001	#	Query	#	#	use `test`; drop table t1
+master-bin.000001	#	Query	#	#	use `test`; DROP TABLE `t1` /* generated by server */
 master-bin.000001	#	Query	#	#	use `test`; create table t1 (word char(20) not null)ENGINE=NDB
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
@@ -240,7 +240,7 @@ slave-bin.000001	#	Table_map	#	#	table_i
 slave-bin.000001	#	Write_rows	#	#	table_id: #
 slave-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
 slave-bin.000001	#	Query	#	#	COMMIT
-slave-bin.000001	#	Query	#	#	use `test`; drop table t1
+slave-bin.000001	#	Query	#	#	use `test`; DROP TABLE `t1` /* generated by server */
 slave-bin.000001	#	Query	#	#	use `test`; create table t1 (word char(20) not null)ENGINE=NDB
 slave-bin.000001	#	Query	#	#	BEGIN
 slave-bin.000001	#	Table_map	#	#	table_id: # (test.t1)

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result	2010-05-26 14:34:25 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result	2010-08-25 14:13:20 +0000
@@ -37,7 +37,7 @@ master-bin.000001	#	Write_rows	#	#	table
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
 master-bin.000001	#	Query	#	#	COMMIT
 master-bin.000001	#	Query	#	#	use `test`; TRUNCATE TABLE t1
-master-bin.000001	#	Query	#	#	use `test`; DROP TABLE t1
+master-bin.000001	#	Query	#	#	use `test`; DROP TABLE `t1` /* generated by server */
 **** On Master ****
 CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
 INSERT INTO t1 VALUES (1,1), (2,2);
@@ -72,7 +72,7 @@ master-bin.000001	#	Write_rows	#	#	table
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
 master-bin.000001	#	Query	#	#	COMMIT
 master-bin.000001	#	Query	#	#	use `test`; TRUNCATE TABLE t1
-master-bin.000001	#	Query	#	#	use `test`; DROP TABLE t1
+master-bin.000001	#	Query	#	#	use `test`; DROP TABLE `t1` /* generated by server */
 master-bin.000001	#	Query	#	#	use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
@@ -86,4 +86,4 @@ master-bin.000001	#	Table_map	#	#	table_
 master-bin.000001	#	Write_rows	#	#	table_id: #
 master-bin.000001	#	Delete_rows	#	#	table_id: # flags: STMT_END_F
 master-bin.000001	#	Query	#	#	COMMIT
-master-bin.000001	#	Query	#	#	use `test`; DROP TABLE t1
+master-bin.000001	#	Query	#	#	use `test`; DROP TABLE `t1` /* generated by server */

=== modified file 'mysql-test/t/ctype_utf32.test'
--- a/mysql-test/t/ctype_utf32.test	2010-08-20 11:14:11 +0000
+++ b/mysql-test/t/ctype_utf32.test	2010-08-26 12:36:33 +0000
@@ -819,5 +819,16 @@ SELECT * FROM t1;
 DROP TABLE t1;
 
 --echo #
+--echo # Bug#42511 mysqld: ctype-ucs2.c:2044: my_strnncollsp_utf32: Assertion (tlen % 4) == 0' faied
+--echo #
+CREATE TABLE t1 (
+ b char(250) CHARACTER SET utf32,
+ key (b)
+) ENGINE=MYISAM;
+INSERT INTO t1 VALUES ('d'),('f');
+SELECT * FROM t1 WHERE b BETWEEN 'a' AND 'z';
+DROP TABLE t1;
+
+--echo #
 --echo # End of 5.5 tests
 --echo #

=== modified file 'mysql-test/t/mysql.test'
--- a/mysql-test/t/mysql.test	2010-08-19 11:35:47 +0000
+++ b/mysql-test/t/mysql.test	2010-08-25 08:17:15 +0000
@@ -425,11 +425,5 @@ drop table t1;
 --echo
 --exec $MYSQL --skip-column-names --vertical test -e "select 1 as a"
 
-#
-# Bug #54466 client 5.5 built from source lacks "pager" support
-# 
---echo Bug #54466 client 5.5 built from source lacks "pager" support
---exec $MYSQL --pager test -e "select 1 as a"
-
 --echo
 --echo End of tests

=== added file 'mysql-test/t/mysql_not_windows.test'
--- a/mysql-test/t/mysql_not_windows.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/mysql_not_windows.test	2010-08-25 08:17:15 +0000
@@ -0,0 +1,15 @@
+-- source include/not_windows.inc
+# This test should work in embedded server after we fix mysqltest
+-- source include/not_embedded.inc
+#
+# Testing the MySQL command line client(mysql)
+#
+
+#
+# Bug #54466 client 5.5 built from source lacks "pager" support
+# 
+--echo Bug #54466 client 5.5 built from source lacks "pager" support
+--exec $MYSQL --pager test -e "select 1 as a"
+
+--echo
+--echo End of tests

=== modified file 'mysys/my_getopt.c'
--- a/mysys/my_getopt.c	2010-08-05 12:34:19 +0000
+++ b/mysys/my_getopt.c	2010-08-26 14:34:18 +0000
@@ -98,6 +98,49 @@ void my_getopt_register_get_addr(my_geto
   matches with one of the options in struct 'my_option'.
   Check that option was given an argument if it requires one
   Call the optional 'get_one_option()' function once for each option.
+
+  Note that handle_options() can be invoked multiple times to
+  parse a command line in several steps.
+  In this case, use the global flag @c my_getopt_skip_unknown to indicate
+  that options unknown in the current step should be preserved in the
+  command line for later parsing in subsequent steps.
+
+  For 'long' options (--a_long_option), @c my_getopt_skip_unknown is
+  fully supported. Command line parameters such as:
+  - "--a_long_option"
+  - "--a_long_option=value"
+  - "--a_long_option value"
+  will be preserved as is when the option is not known.
+
+  For 'short' options (-S), support for @c my_getopt_skip_unknown
+  comes with some limitation, because several short options
+  can also be specified together in the same command line argument,
+  as in "-XYZ".
+
+  The first use case supported is: all short options are declared.
+  handle_options() will be able to interpret "-XYZ" as one of:
+  - an unknown X option
+  - "-X -Y -Z", three short options with no arguments
+  - "-X -YZ", where Y is a short option with argument Z
+  - "-XYZ", where X is a short option with argument YZ
+  based on the full short options specifications.
+
+  The second use case supported is: no short option is declared.
+  handle_options() will reject "-XYZ" as unknown, to be parsed later.
+
+  The use case that is explicitly not supported is to provide
+  only a partial list of short options to handle_options().
+  This function can not be expected to extract some option Y
+  in the middle of the string "-XYZ" in these conditions,
+  without knowing if X will be declared an option later.
+
+  Note that this limitation only impacts parsing of several
+  short options from the same command line argument,
+  as in "mysqld -anW5".
+  When each short option is properly separated out in the command line
+  argument, for example in "mysqld -a -n -w5", the code would actually
+  work even with partial options specs given at each stage.
+
   @param [in, out] argc      command line options (count)
   @param [in, out] argv      command line options (values)
   @param [in] longopts       descriptor of all valid options
@@ -464,14 +507,40 @@ int handle_options(int *argc, char ***ar
 	  }
 	  if (!opt_found)
 	  {
-	    if (my_getopt_print_errors)
-              my_getopt_error_reporter(ERROR_LEVEL,
-                                       "%s: unknown option '-%c'", 
-                                       my_progname, *optend);
-	    return EXIT_UNKNOWN_OPTION;
+            if (my_getopt_skip_unknown)
+            {
+              /*
+                We are currently parsing a single argv[] argument
+                of the form "-XYZ".
+                One or the argument found (say Y) is not an option.
+                Hack the string "-XYZ" to make a "-YZ" substring in it,
+                and push that to the output as an unrecognized parameter.
+              */
+              DBUG_ASSERT(optend > *pos);
+              DBUG_ASSERT(optend >= cur_arg);
+              DBUG_ASSERT(optend <= *pos + strlen(*pos));
+              DBUG_ASSERT(*optend);
+              optend--;
+              optend[0]= '-'; /* replace 'X' or '-' by '-' */
+              (*argv)[argvpos++]= optend;
+              /*
+                Do not continue to parse at the current "-XYZ" argument,
+                skip to the next argv[] argument instead.
+              */
+              optend= (char*) " ";
+            }
+            else
+            {
+              if (my_getopt_print_errors)
+                my_getopt_error_reporter(ERROR_LEVEL,
+                                         "%s: unknown option '-%c'",
+                                         my_progname, *optend);
+              return EXIT_UNKNOWN_OPTION;
+            }
 	  }
 	}
-	(*argc)--; /* option handled (short), decrease argument count */
+        if (opt_found)
+          (*argc)--; /* option handled (short), decrease argument count */
 	continue;
       }
       if ((error= setval(optp, value, argument, set_maximum_value)))
@@ -479,7 +548,7 @@ int handle_options(int *argc, char ***ar
       if (get_one_option && get_one_option(optp->id, optp, argument))
         return EXIT_UNSPECIFIED_ERROR;
 
-      (*argc)--; /* option handled (short or long), decrease argument count */
+      (*argc)--; /* option handled (long), decrease argument count */
     }
     else /* non-option found */
       (*argv)[argvpos++]= cur_arg;

=== modified file 'sql/set_var.cc'
--- a/sql/set_var.cc	2010-07-27 10:25:53 +0000
+++ b/sql/set_var.cc	2010-08-26 00:59:28 +0000
@@ -153,6 +153,17 @@ sys_var::sys_var(sys_var_chain *chain, c
   guard(lock), offset(off), on_check(on_check_func), on_update(on_update_func),
   is_os_charset(FALSE)
 {
+  /*
+    There is a limitation in handle_options() related to short options:
+    - either all short options should be declared when parsing in multiple stages,
+    - or none should be declared.
+    Because a lot of short options are used in the normal parsing phase
+    for mysqld, we enforce here that no short option is present
+    in the first (PARSE_EARLY) stage.
+    See handle_options() for details.
+  */
+  DBUG_ASSERT(parse_flag == PARSE_NORMAL || getopt_id <= 0 || getopt_id >= 255);
+
   name.str= name_arg;
   name.length= strlen(name_arg);
   DBUG_ASSERT(name.length <= NAME_CHAR_LEN);

=== modified file 'storage/myisam/mi_key.c'
--- a/storage/myisam/mi_key.c	2010-07-23 20:17:55 +0000
+++ b/storage/myisam/mi_key.c	2010-08-26 12:36:33 +0000
@@ -253,18 +253,17 @@ uint _mi_pack_key(register MI_INFO *info
     pos=old;
     if (keyseg->flag & HA_SPACE_PACK)
     {
-      uchar *end=pos+length;
       if (type == HA_KEYTYPE_NUM)
       {
-	while (pos < end && pos[0] == ' ')
-	  pos++;
+        uchar *end= pos + length;
+        while (pos < end && pos[0] == ' ')
+          pos++;
+        length= (uint) (end - pos);
       }
       else if (type != HA_KEYTYPE_BINARY)
       {
-	while (end > pos && end[-1] == ' ')
-	  end--;
+        length= cs->cset->lengthsp(cs, (char*) pos, length);
       }
-      length=(uint) (end-pos);
       FIX_LENGTH(cs, pos, length, char_length);
       store_key_length_inc(key,char_length);
       memcpy((uchar*) key,pos,(size_t) char_length);

=== modified file 'storage/perfschema/pfs.cc'
--- a/storage/perfschema/pfs.cc	2010-08-19 22:24:07 +0000
+++ b/storage/perfschema/pfs.cc	2010-08-26 15:45:25 +0000
@@ -1625,18 +1625,26 @@ static void end_mutex_wait_v1(PSI_mutex_
   if (flag_events_waits_history_long)
     insert_events_waits_history_long(wait);
 
-  if (rc == 0 && wait->m_timer_state == TIMER_STATE_TIMED)
+  if (rc == 0)
   {
     /* Thread safe: we are protected by the instrumented mutex */
-    PFS_single_stat_chain *stat;
     PFS_mutex *mutex= pfs_locker->m_target.m_mutex;
+    PFS_single_stat_chain *stat= find_per_thread_mutex_class_wait_stat(wait->m_thread, mutex->m_class);
     mutex->m_owner= wait->m_thread;
     mutex->m_last_locked= wait->m_timer_end;
 
-    ulonglong wait_time= wait->m_timer_end - wait->m_timer_start;
-    aggregate_single_stat_chain(&mutex->m_wait_stat, wait_time);
-    stat= find_per_thread_mutex_class_wait_stat(wait->m_thread, mutex->m_class);
-    aggregate_single_stat_chain(stat, wait_time);
+    /* If timed then aggregate stats, else increment the value counts only */
+    if (wait->m_timer_state == TIMER_STATE_TIMED)
+    {
+      ulonglong wait_time= wait->m_timer_end - wait->m_timer_start;
+      aggregate_single_stat_chain(&mutex->m_wait_stat, wait_time);
+      aggregate_single_stat_chain(stat, wait_time);
+    }
+    else
+    {
+      increment_single_stat_chain(&mutex->m_wait_stat);
+      increment_single_stat_chain(stat);
+    }
   }
   wait->m_thread->m_wait_locker_count--;
 }
@@ -1682,20 +1690,26 @@ static void end_rwlock_rdwait_v1(PSI_rwl
       The statistics generated are not safe, which is why they are
       just statistics, not facts.
     */
-    PFS_single_stat_chain *stat;
     PFS_rwlock *rwlock= pfs_locker->m_target.m_rwlock;
+    PFS_single_stat_chain *stat= find_per_thread_rwlock_class_wait_stat(wait->m_thread, rwlock->m_class);
+
     if (rwlock->m_readers == 0)
       rwlock->m_last_read= wait->m_timer_end;
     rwlock->m_writer= NULL;
     rwlock->m_readers++;
 
+    /* If timed then aggregate stats, else increment the value counts only */
     if (wait->m_timer_state == TIMER_STATE_TIMED)
     {
       ulonglong wait_time= wait->m_timer_end - wait->m_timer_start;
       aggregate_single_stat_chain(&rwlock->m_wait_stat, wait_time);
-      stat= find_per_thread_rwlock_class_wait_stat(wait->m_thread, rwlock->m_class);
       aggregate_single_stat_chain(stat, wait_time);
     }
+    else
+    {
+      increment_single_stat_chain(&rwlock->m_wait_stat);
+      increment_single_stat_chain(stat);
+    }
   }
   wait->m_thread->m_wait_locker_count--;
 }
@@ -1735,21 +1749,26 @@ static void end_rwlock_wrwait_v1(PSI_rwl
   if (rc == 0)
   {
     /* Thread safe : we are protected by the instrumented rwlock */
-    PFS_single_stat_chain *stat;
     PFS_rwlock *rwlock= pfs_locker->m_target.m_rwlock;
+    PFS_single_stat_chain *stat= find_per_thread_rwlock_class_wait_stat(wait->m_thread, rwlock->m_class);
     rwlock->m_writer= wait->m_thread;
     rwlock->m_last_written= wait->m_timer_end;
     /* Reset the readers stats, they could be off */
     rwlock->m_readers= 0;
     rwlock->m_last_read= 0;
 
+    /* If timed then aggregate stats, else increment the value counts only */
     if (wait->m_timer_state == TIMER_STATE_TIMED)
     {
       ulonglong wait_time= wait->m_timer_end - wait->m_timer_start;
       aggregate_single_stat_chain(&rwlock->m_wait_stat, wait_time);
-      stat= find_per_thread_rwlock_class_wait_stat(wait->m_thread, rwlock->m_class);
       aggregate_single_stat_chain(stat, wait_time);
     }
+    else
+    {
+      increment_single_stat_chain(&rwlock->m_wait_stat);
+      increment_single_stat_chain(stat);
+    }
   }
   wait->m_thread->m_wait_locker_count--;
 }
@@ -1803,16 +1822,21 @@ static void end_cond_wait_v1(PSI_cond_lo
       in condition B.
       This is accepted, the data will be slightly inaccurate.
     */
-    PFS_single_stat_chain *stat;
     PFS_cond *cond= pfs_locker->m_target.m_cond;
+    PFS_single_stat_chain *stat= find_per_thread_cond_class_wait_stat(wait->m_thread, cond->m_class);
 
+    /* If timed then aggregate stats, else increment the value counts only */
     if (wait->m_timer_state == TIMER_STATE_TIMED)
     {
       ulonglong wait_time= wait->m_timer_end - wait->m_timer_start;
       aggregate_single_stat_chain(&cond->m_wait_stat, wait_time);
-      stat= find_per_thread_cond_class_wait_stat(wait->m_thread, cond->m_class);
       aggregate_single_stat_chain(stat, wait_time);
     }
+    else
+    {
+      increment_single_stat_chain(&cond->m_wait_stat);
+      increment_single_stat_chain(stat);
+    }
   }
   wait->m_thread->m_wait_locker_count--;
 }
@@ -1855,12 +1879,18 @@ static void end_table_wait_v1(PSI_table_
   if (flag_events_waits_history_long)
     insert_events_waits_history_long(wait);
 
+  PFS_table *table= pfs_locker->m_target.m_table;
+
+  /* If timed then aggregate stats, else increment the value counts only */
   if (wait->m_timer_state == TIMER_STATE_TIMED)
   {
-    PFS_table *table= pfs_locker->m_target.m_table;
     ulonglong wait_time= wait->m_timer_end - wait->m_timer_start;
     aggregate_single_stat_chain(&table->m_wait_stat, wait_time);
   }
+  else
+  {
+    increment_single_stat_chain(&table->m_wait_stat);
+  }
 
   /*
     There is currently no per table and per thread aggregation.
@@ -1962,14 +1992,21 @@ static void end_file_wait_v1(PSI_file_lo
   if (flag_events_waits_history_long)
     insert_events_waits_history_long(wait);
 
-  PFS_single_stat_chain *stat;
   PFS_file *file= pfs_locker->m_target.m_file;
+  PFS_single_stat_chain *stat= find_per_thread_file_class_wait_stat(wait->m_thread, file->m_class);
 
-  ulonglong wait_time= wait->m_timer_end - wait->m_timer_start;
-  aggregate_single_stat_chain(&file->m_wait_stat, wait_time);
-  stat= find_per_thread_file_class_wait_stat(wait->m_thread,
-                                             file->m_class);
-  aggregate_single_stat_chain(stat, wait_time);
+  /* If timed then aggregate stats, else increment the value counts only */
+  if (wait->m_timer_state == TIMER_STATE_TIMED)
+  {
+    ulonglong wait_time= wait->m_timer_end - wait->m_timer_start;
+    aggregate_single_stat_chain(&file->m_wait_stat, wait_time);
+    aggregate_single_stat_chain(stat, wait_time);
+  }
+  else
+  {
+    increment_single_stat_chain(&file->m_wait_stat);
+    increment_single_stat_chain(stat);
+  }
 
   PFS_file_class *klass= file->m_class;
 

=== modified file 'storage/perfschema/pfs_stat.h'
--- a/storage/perfschema/pfs_stat.h	2010-07-15 23:44:45 +0000
+++ b/storage/perfschema/pfs_stat.h	2010-08-26 15:45:25 +0000
@@ -83,6 +83,22 @@ inline void aggregate_single_stat_chain(
   while (stat);
 }
 
+/**
+  Increment the value counts in a statistic chain.
+  Used for instruments that are 'ENABLED' but not 'TIMED'.
+  @param stat                         the aggregated statistic chain
+*/
+inline void increment_single_stat_chain(PFS_single_stat_chain *stat)
+{
+  do
+  {
+    if (*stat->m_control_flag)
+      stat->m_count++;
+    stat= stat->m_parent;
+  }
+  while (stat);
+}
+
 /** Statistics for COND usage. */
 struct PFS_cond_stat
 {


Attachment: [text/bzr-bundle] bzr/marc.alff@oracle.com-20100826212123-rukguhq3ktsedk4v.bundle
Thread
bzr commit into mysql-5.5-bugfixing branch (marc.alff:3193) Marc Alff26 Aug