List:Commits« Previous MessageNext Message »
From:Guilhem Bichot Date:November 5 2010 2:10pm
Subject:bzr push into mysql-trunk-bugfixing branch (guilhem:3326 to 3327)
View as plain text  
 3327 Guilhem Bichot	2010-11-05 [merge]
      merge from 5.5-bugteam

    added:
      mysql-test/suite/sys_vars/inc/autocommit_func2.inc
      mysql-test/suite/sys_vars/r/autocommit_func2.result
      mysql-test/suite/sys_vars/r/autocommit_func3.result
      mysql-test/suite/sys_vars/t/autocommit_func2-master.opt
      mysql-test/suite/sys_vars/t/autocommit_func2.test
      mysql-test/suite/sys_vars/t/autocommit_func3-master.opt
      mysql-test/suite/sys_vars/t/autocommit_func3.test
    modified:
      CMakeLists.txt
      config/ac-macros/maintainer.m4
      mysql-test/mysql-test-run.pl
      mysql-test/r/mysqld--help-notwin.result
      mysql-test/r/mysqld--help-win.result
      sql/mysqld.cc
      sql/mysqld.h
      sql/sql_partition.cc
 3326 Luis Soares	2010-11-05 [merge]
      Automerged mysql-5.5-bugteam into mysql-trunk-bugfixing.

    modified:
      mysql-test/r/keywords.result
      mysql-test/t/keywords.test
      sql/sql_yacc.yy
=== modified file 'CMakeLists.txt'
--- a/CMakeLists.txt	2010-10-21 12:14:56 +0000
+++ b/CMakeLists.txt	2010-11-05 14:10:13 +0000
@@ -115,18 +115,27 @@ ENDIF()
 # Control aspects of the development environment which are
 # specific to MySQL maintainers and developers.
 #
+INCLUDE (CheckCCompilerFlag)
 OPTION(MYSQL_MAINTAINER_MODE "MySQL maintainer-specific development environment" OFF)
 # Whether the maintainer mode should be enabled.
 IF(MYSQL_MAINTAINER_MODE)
   IF(CMAKE_COMPILER_IS_GNUCC)
+    CHECK_C_COMPILER_FLAG("-Wdeclaration-after-statement" HAVE_DECLARATION_AFTER_STATEMENT)
+    IF(HAVE_DECLARATION_AFTER_STATEMENT)
+      SET(MY_MAINTAINER_DECLARATION_AFTER_STATEMENT "-Wdeclaration-after-statement")
+    ENDIF()
     SET(MY_MAINTAINER_C_WARNINGS
-        "-Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing -Werror"
-        CACHE STRING "C warning options used in maintainer builds.")
+        "-Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing -Werror")
   ENDIF()
   IF(CMAKE_COMPILER_IS_GNUCXX)
     SET(MY_MAINTAINER_CXX_WARNINGS "${MY_MAINTAINER_C_WARNINGS} -Wno-unused-parameter"
         CACHE STRING "C++ warning options used in maintainer builds.")
   ENDIF()
+  IF(CMAKE_COMPILER_IS_GNUCC)
+    SET(MY_MAINTAINER_C_WARNINGS
+        "${MY_MAINTAINER_C_WARNINGS} ${MY_MAINTAINER_DECLARATION_AFTER_STATEMENT}"
+        CACHE STRING "C warning options used in maintainer builds.")
+  ENDIF()
   # Do not make warnings in checks into errors.
   IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_COMPILER_IS_GNUCXX)
     SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Wno-error")

=== modified file 'config/ac-macros/maintainer.m4'
--- a/config/ac-macros/maintainer.m4	2010-10-18 16:27:10 +0000
+++ b/config/ac-macros/maintainer.m4	2010-11-05 13:17:47 +0000
@@ -19,6 +19,7 @@ AC_DEFUN([MY_MAINTAINER_MODE_WARNINGS], 
   AS_IF([test "$GCC" = "yes"], [
     C_WARNINGS="-Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing -Werror"
     CXX_WARNINGS="${C_WARNINGS} -Wno-unused-parameter"
+    C_WARNINGS="${C_WARNINGS} -Wdeclaration-after-statement"
   ])
 
   # Test whether the warning options work.

=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl	2010-10-26 10:11:56 +0000
+++ b/mysql-test/mysql-test-run.pl	2010-11-05 14:10:13 +0000
@@ -5323,8 +5323,7 @@ sub gdb_arguments {
 	       "break mysql_parse\n" .
 	       "commands 1\n" .
 	       "disable 1\n" .
-	       "end\n" .
-	       "run");
+	       "end\n");
   }
 
   if ( $opt_manual_gdb )

=== modified file 'mysql-test/r/mysqld--help-notwin.result'
--- a/mysql-test/r/mysqld--help-notwin.result	2010-10-01 08:46:59 +0000
+++ b/mysql-test/r/mysqld--help-notwin.result	2010-11-05 14:10:13 +0000
@@ -19,6 +19,7 @@ The following options may be given as th
  --auto-increment-offset[=#] 
  Offset added to Auto-increment columns. Used when
  auto-increment-increment != 1
+ --autocommit        Set default value for autocommit (0 or 1)
  --automatic-sp-privileges 
  Creating and dropping stored procedures alters ACLs
  (Defaults to on; use --skip-automatic-sp-privileges to disable.)

=== modified file 'mysql-test/r/mysqld--help-win.result'
--- a/mysql-test/r/mysqld--help-win.result	2010-10-05 14:35:03 +0000
+++ b/mysql-test/r/mysqld--help-win.result	2010-11-05 14:10:13 +0000
@@ -19,6 +19,7 @@ The following options may be given as th
  --auto-increment-offset[=#] 
  Offset added to Auto-increment columns. Used when
  auto-increment-increment != 1
+ --autocommit        Set default value for autocommit (0 or 1)
  --automatic-sp-privileges 
  Creating and dropping stored procedures alters ACLs
  (Defaults to on; use --skip-automatic-sp-privileges to disable.)

=== added file 'mysql-test/suite/sys_vars/inc/autocommit_func2.inc'
--- a/mysql-test/suite/sys_vars/inc/autocommit_func2.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/sys_vars/inc/autocommit_func2.inc	2010-11-05 13:16:27 +0000
@@ -0,0 +1,29 @@
+--source include/have_innodb.inc
+
+CREATE TABLE t1
+(
+id INT NOT NULL auto_increment,
+PRIMARY KEY (id),
+name varchar(30)
+) ENGINE = INNODB;
+
+SELECT @@global.autocommit;
+SELECT @@autocommit;
+INSERT into t1(name) values('Record_1');
+INSERT into t1(name) values('Record_2');
+SELECT * from t1;
+ROLLBACK;
+SELECT * from t1;
+
+set @@global.autocommit = 1-@@global.autocommit;
+set @@autocommit = 1-@@autocommit;
+SELECT @@global.autocommit;
+SELECT @@autocommit;
+INSERT into t1(name) values('Record_1');
+INSERT into t1(name) values('Record_2');
+SELECT * from t1;
+ROLLBACK;
+SELECT * from t1;
+
+DROP TABLE t1;
+set @@global.autocommit = 1-@@global.autocommit;

=== added file 'mysql-test/suite/sys_vars/r/autocommit_func2.result'
--- a/mysql-test/suite/sys_vars/r/autocommit_func2.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/sys_vars/r/autocommit_func2.result	2010-11-05 13:16:27 +0000
@@ -0,0 +1,46 @@
+CREATE TABLE t1
+(
+id INT NOT NULL auto_increment,
+PRIMARY KEY (id),
+name varchar(30)
+) ENGINE = INNODB;
+SELECT @@global.autocommit;
+@@global.autocommit
+1
+SELECT @@autocommit;
+@@autocommit
+1
+INSERT into t1(name) values('Record_1');
+INSERT into t1(name) values('Record_2');
+SELECT * from t1;
+id	name
+1	Record_1
+2	Record_2
+ROLLBACK;
+SELECT * from t1;
+id	name
+1	Record_1
+2	Record_2
+set @@global.autocommit = 1-@@global.autocommit;
+set @@autocommit = 1-@@autocommit;
+SELECT @@global.autocommit;
+@@global.autocommit
+0
+SELECT @@autocommit;
+@@autocommit
+0
+INSERT into t1(name) values('Record_1');
+INSERT into t1(name) values('Record_2');
+SELECT * from t1;
+id	name
+1	Record_1
+2	Record_2
+3	Record_1
+4	Record_2
+ROLLBACK;
+SELECT * from t1;
+id	name
+1	Record_1
+2	Record_2
+DROP TABLE t1;
+set @@global.autocommit = 1-@@global.autocommit;

=== added file 'mysql-test/suite/sys_vars/r/autocommit_func3.result'
--- a/mysql-test/suite/sys_vars/r/autocommit_func3.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/sys_vars/r/autocommit_func3.result	2010-11-05 13:16:27 +0000
@@ -0,0 +1,42 @@
+CREATE TABLE t1
+(
+id INT NOT NULL auto_increment,
+PRIMARY KEY (id),
+name varchar(30)
+) ENGINE = INNODB;
+SELECT @@global.autocommit;
+@@global.autocommit
+0
+SELECT @@autocommit;
+@@autocommit
+0
+INSERT into t1(name) values('Record_1');
+INSERT into t1(name) values('Record_2');
+SELECT * from t1;
+id	name
+1	Record_1
+2	Record_2
+ROLLBACK;
+SELECT * from t1;
+id	name
+set @@global.autocommit = 1-@@global.autocommit;
+set @@autocommit = 1-@@autocommit;
+SELECT @@global.autocommit;
+@@global.autocommit
+1
+SELECT @@autocommit;
+@@autocommit
+1
+INSERT into t1(name) values('Record_1');
+INSERT into t1(name) values('Record_2');
+SELECT * from t1;
+id	name
+3	Record_1
+4	Record_2
+ROLLBACK;
+SELECT * from t1;
+id	name
+3	Record_1
+4	Record_2
+DROP TABLE t1;
+set @@global.autocommit = 1-@@global.autocommit;

=== added file 'mysql-test/suite/sys_vars/t/autocommit_func2-master.opt'
--- a/mysql-test/suite/sys_vars/t/autocommit_func2-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/sys_vars/t/autocommit_func2-master.opt	2010-11-05 13:16:27 +0000
@@ -0,0 +1 @@
+--autocommit=1

=== added file 'mysql-test/suite/sys_vars/t/autocommit_func2.test'
--- a/mysql-test/suite/sys_vars/t/autocommit_func2.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/sys_vars/t/autocommit_func2.test	2010-11-05 13:16:27 +0000
@@ -0,0 +1 @@
+--source suite/sys_vars/inc/autocommit_func2.inc

=== added file 'mysql-test/suite/sys_vars/t/autocommit_func3-master.opt'
--- a/mysql-test/suite/sys_vars/t/autocommit_func3-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/sys_vars/t/autocommit_func3-master.opt	2010-11-05 13:16:27 +0000
@@ -0,0 +1 @@
+--autocommit=0

=== added file 'mysql-test/suite/sys_vars/t/autocommit_func3.test'
--- a/mysql-test/suite/sys_vars/t/autocommit_func3.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/sys_vars/t/autocommit_func3.test	2010-11-05 13:16:27 +0000
@@ -0,0 +1 @@
+--source suite/sys_vars/inc/autocommit_func2.inc

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2010-11-04 05:34:22 +0000
+++ b/sql/mysqld.cc	2010-11-05 14:10:13 +0000
@@ -5823,6 +5823,12 @@ struct my_option my_long_options[]=
   {"ansi", 'a', "Use ANSI SQL syntax instead of MySQL syntax. This mode "
    "will also set transaction isolation level 'serializable'.", 0, 0, 0,
    GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+  /*
+    Because Sys_var_bit does not support command-line options, we need to
+    explicitely add one for --autocommit
+  */
+  {"autocommit", OPT_AUTOCOMMIT, "Set default value for autocommit (0 or 1)",
+   NULL, NULL, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, NULL},
   {"bind-address", OPT_BIND_ADDRESS, "IP address to bind to.",
    &my_bind_addr_str, &my_bind_addr_str, 0, GET_STR,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -7263,6 +7269,13 @@ mysqld_get_one_option(int optid,
     if (argument == NULL) /* no argument */
       log_error_file_ptr= const_cast<char*>("");
     break;
+  case OPT_AUTOCOMMIT:
+    const ulonglong turn_bit_on= (argument && (atoi(argument) == 0)) ?
+      OPTION_NOT_AUTOCOMMIT : OPTION_AUTOCOMMIT;
+    global_system_variables.option_bits=
+      (global_system_variables.option_bits &
+       ~(OPTION_NOT_AUTOCOMMIT | OPTION_AUTOCOMMIT)) | turn_bit_on;
+    break;
   }
   return 0;
 }

=== modified file 'sql/mysqld.h'
--- a/sql/mysqld.h	2010-09-01 13:05:01 +0000
+++ b/sql/mysqld.h	2010-11-05 14:10:13 +0000
@@ -395,7 +395,8 @@ enum options_mysqld
   OPT_UPDATE_LOG,
   OPT_WANT_CORE,
   OPT_ENGINE_CONDITION_PUSHDOWN,
-  OPT_LOG_ERROR
+  OPT_LOG_ERROR,
+  OPT_AUTOCOMMIT
 };
 
 

=== modified file 'sql/sql_partition.cc'
--- a/sql/sql_partition.cc	2010-10-27 07:48:44 +0000
+++ b/sql/sql_partition.cc	2010-11-05 14:10:13 +0000
@@ -2004,7 +2004,7 @@ static int add_part_field_list(File fptr
     String field_string("", 0, system_charset_info);
     THD *thd= current_thd;
     ulonglong save_options= thd->variables.option_bits;
-    thd->variables.option_bits= 0;
+    thd->variables.option_bits&= ~OPTION_QUOTE_SHOW_CREATE;
     append_identifier(thd, &field_string, field_str,
                       strlen(field_str));
     thd->variables.option_bits= save_options;
@@ -2023,8 +2023,7 @@ static int add_name_string(File fptr, co
   String name_string("", 0, system_charset_info);
   THD *thd= current_thd;
   ulonglong save_options= thd->variables.option_bits;
-
-  thd->variables.option_bits= 0;
+  thd->variables.option_bits&= ~OPTION_QUOTE_SHOW_CREATE;
   append_identifier(thd, &name_string, name,
                     strlen(name));
   thd->variables.option_bits= save_options;

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk-bugfixing branch (guilhem:3326 to 3327) Guilhem Bichot5 Nov