List:Commits« Previous MessageNext Message »
From:vasil.dimov Date:November 8 2010 2:37pm
Subject:bzr push into mysql-next-mr branch (vasil.dimov:3369 to 3370)
View as plain text  
 3370 Vasil Dimov	2010-11-08 [merge]
      Merge mysql-trunk-bugfixing -> mysql-next-mr-bugfixing

    added:
      mysql-test/std_data/bug57108.cnf
      mysql-test/suite/bugs/r/bug57108.result
      mysql-test/suite/bugs/t/bug57108-master.opt
      mysql-test/suite/bugs/t/bug57108.test
      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
      include/my_sys.h
      libmysqld/lib_sql.cc
      mysql-test/mysql-test-run.pl
      mysql-test/r/log_tables.result
      mysql-test/r/mysqld--help-notwin.result
      mysql-test/r/mysqld--help-win.result
      mysql-test/t/log_tables.test
      mysys/default.c
      mysys/stacktrace.c
      sql/mysqld.cc
      sql/mysqld.h
      sql/sql_partition.cc
      sql/sql_plugin.cc
      sql/sql_rename.cc
      storage/ndb/src/mgmsrv/InitConfigFileParser.cpp
 3369 Tor Didriksen	2010-11-08
      WL#1326 Precise GIS functions
        Post-merge fix broken build.
     @ sql/gcalc_slicescan.cc
        suggest a space before ';' or explicit braces around empty body in 'for' statement

    modified:
      sql/gcalc_slicescan.cc
=== modified file 'CMakeLists.txt'
--- a/CMakeLists.txt	revid:tor.didriksen@stripped
+++ b/CMakeLists.txt	revid:vasil.dimov@stripped
@@ -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	revid:tor.didriksen@stripped
+++ b/config/ac-macros/maintainer.m4	revid:vasil.dimov@stripped
@@ -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 'include/my_sys.h'
--- a/include/my_sys.h	revid:tor.didriksen@stripped
+++ b/include/my_sys.h	revid:vasil.dimov@stripped
@@ -256,7 +256,7 @@ extern my_bool  my_disable_locking, my_d
 extern char	wild_many,wild_one,wild_prefix;
 extern const char *charsets_dir;
 /* from default.c */
-extern char *my_defaults_extra_file;
+extern const char *my_defaults_extra_file;
 extern const char *my_defaults_group_suffix;
 extern const char *my_defaults_file;
 

=== modified file 'libmysqld/lib_sql.cc'
--- a/libmysqld/lib_sql.cc	revid:tor.didriksen@stripped
+++ b/libmysqld/lib_sql.cc	revid:vasil.dimov@stripped
@@ -506,7 +506,8 @@ int init_embedded_server(int argc, char 
 
   orig_argc= *argcp;
   orig_argv= *argvp;
-  load_defaults("my", (const char **)groups, argcp, argvp);
+  if (load_defaults("my", (const char **)groups, argcp, argvp))
+    return 1;
   defaults_argc= *argcp;
   defaults_argv= *argvp;
   remaining_argc= argc;

=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl	revid:tor.didriksen@stripped
+++ b/mysql-test/mysql-test-run.pl	revid:vasil.dimov@stripped
@@ -4465,7 +4465,13 @@ sub mysqld_arguments ($$$) {
   my $mysqld=            shift;
   my $extra_opts=        shift;
 
-  mtr_add_arg($args, "--defaults-file=%s",  $path_config_file);
+  my @defaults = grep(/^--defaults-file=/, @$extra_opts);
+  if (@defaults > 0) {
+    mtr_add_arg($args, pop(@defaults))
+  }
+  else {
+    mtr_add_arg($args, "--defaults-file=%s",  $path_config_file);
+  }
 
   # When mysqld is run by a root user(euid is 0), it will fail
   # to start unless we specify what user to run as, see BUG#30630
@@ -4501,6 +4507,9 @@ sub mysqld_arguments ($$$) {
   my $found_skip_core= 0;
   foreach my $arg ( @$extra_opts )
   {
+    # Skip --defaults-file option since it's handled above.
+    next if $arg =~ /^--defaults-file/;
+
     # Allow --skip-core-file to be set in <testname>-[master|slave].opt file
     if ($arg eq "--skip-core-file")
     {
@@ -5330,8 +5339,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/log_tables.result'
--- a/mysql-test/r/log_tables.result	revid:tor.didriksen@stripped
+++ b/mysql-test/r/log_tables.result	revid:vasil.dimov@stripped
@@ -896,6 +896,16 @@ TIMESTAMP	1	1	SELECT SQL_NO_CACHE 'Bug#3
 TIMESTAMP	1	1	SELECT SQL_NO_CACHE 'Bug#31700 - PK',  f1,f2,f3,SLEEP(1.1) FROM t1 WHERE f1=2
 DROP TABLE t1;
 TRUNCATE TABLE mysql.slow_log;
+use mysql;
+drop table if exists renamed_general_log;
+drop table if exists renamed_slow_log;
+RENAME TABLE general_log TO renamed_general_log;
+ERROR HY000: Cannot rename 'general_log'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to 'general_log'
+RENAME TABLE slow_log TO renamed_slow_log;
+ERROR HY000: Cannot rename 'slow_log'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to 'slow_log'
+use test;
+flush tables with read lock;
+unlock tables;
 SET @@session.long_query_time= @old_long_query_time;
 SET @@global.log_output=       @old_log_output;
 SET @@global.slow_query_log=   @old_slow_query_log;

=== modified file 'mysql-test/r/mysqld--help-notwin.result'
--- a/mysql-test/r/mysqld--help-notwin.result	revid:tor.didriksen@stripped
+++ b/mysql-test/r/mysqld--help-notwin.result	revid:vasil.dimov@stripped
@@ -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	revid:tor.didriksen@stripped
+++ b/mysql-test/r/mysqld--help-win.result	revid:vasil.dimov@stripped
@@ -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/std_data/bug57108.cnf'
--- a/mysql-test/std_data/bug57108.cnf	1970-01-01 00:00:00 +0000
+++ b/mysql-test/std_data/bug57108.cnf	revid:vasil.dimov@stripped
@@ -0,0 +1,95 @@
+[mysqld]
+open-files-limit=1024
+character-set-server=latin1
+connect-timeout=4711
+log-bin-trust-function-creators=1
+key_buffer_size=1M
+sort_buffer=256K
+max_heap_table_size=1M
+loose-innodb_data_file_path=ibdata1:10M:autoextend
+loose-innodb_buffer_pool_size=8M
+loose-innodb_write_io_threads=2
+loose-innodb_read_io_threads=2
+loose-innodb_log_buffer_size=1M
+loose-innodb_log_file_size=5M
+loose-innodb_additional_mem_pool_size=1M
+loose-innodb_log_files_in_group=2
+slave-net-timeout=120
+log-bin=mysqld-bin
+loose-enable-performance-schema
+loose-performance-schema-max-mutex-instances=10000
+loose-performance-schema-max-rwlock-instances=10000
+loose-performance-schema-max-table-instances=500
+loose-performance-schema-max-table-handles=1000
+binlog-direct-non-transactional-updates
+
+[mysql]
+default-character-set=latin1
+
+[mysqlshow]
+default-character-set=latin1
+
+[mysqlimport]
+default-character-set=latin1
+
+[mysqlcheck]
+default-character-set=latin1
+
+[mysql_upgrade]
+default-character-set=latin1
+tmpdir=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/tmp
+
+[mysqld.1]
+#!run-master-sh
+log-bin=master-bin
+loose-enable-performance-schema
+basedir=/home/bzr/bugs/b57108-5.5-bugteam
+tmpdir=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/tmp/mysqld.1
+character-sets-dir=/home/bzr/bugs/b57108-5.5-bugteam/sql/share/charsets
+lc-messages-dir=/home/bzr/bugs/b57108-5.5-bugteam/sql/share/
+datadir=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/mysqld.1/data
+pid-file=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/run/mysqld.1.pid
+#host=localhost
+port=13000
+socket=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/tmp/mysqld.1.sock
+#log-error=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/log/mysqld.1.err
+general_log=1
+general_log_file=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/mysqld.1/mysqld.log
+slow_query_log=1
+slow_query_log_file=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/mysqld.1/mysqld-slow.log
+#user=root
+#password=
+server-id=1
+secure-file-priv=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var
+ssl-ca=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/std_data/cacert.pem
+ssl-cert=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/std_data/server-cert.pem
+ssl-key=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/std_data/server-key.pem
+
+[mysqlbinlog]
+disable-force-if-open
+character-sets-dir=/home/bzr/bugs/b57108-5.5-bugteam/sql/share/charsets
+
+[ENV]
+MASTER_MYPORT=13000
+MASTER_MYSOCK=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/tmp/mysqld.1.sock
+
+[client]
+password=
+user=root
+port=13000
+host=localhost
+socket=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/tmp/mysqld.1.sock
+
+[mysqltest]
+ssl-ca=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/std_data/cacert.pem
+ssl-cert=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/std_data/client-cert.pem
+ssl-key=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/std_data/client-key.pem
+skip-ssl=1
+
+[client.1]
+password=
+user=root
+port=13000
+host=localhost
+socket=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/tmp/mysqld.1.sock
+

=== added file 'mysql-test/suite/bugs/r/bug57108.result'
--- a/mysql-test/suite/bugs/r/bug57108.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/bugs/r/bug57108.result	revid:vasil.dimov@stripped
@@ -0,0 +1,5 @@
+INSTALL PLUGIN example SONAME 'ha_example.so';
+SELECT @@global.connect_timeout AS connect_timeout, @@global.local_infile AS local_infile;
+connect_timeout	4711
+local_infile	1
+UNINSTALL PLUGIN example;

=== added file 'mysql-test/suite/bugs/t/bug57108-master.opt'
--- a/mysql-test/suite/bugs/t/bug57108-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/bugs/t/bug57108-master.opt	revid:vasil.dimov@stripped
@@ -0,0 +1,2 @@
+--defaults-file=std_data/bug57108.cnf
+$EXAMPLE_PLUGIN_OPT

=== added file 'mysql-test/suite/bugs/t/bug57108.test'
--- a/mysql-test/suite/bugs/t/bug57108.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/bugs/t/bug57108.test	revid:vasil.dimov@stripped
@@ -0,0 +1,12 @@
+--source include/not_windows_embedded.inc
+--source include/have_example_plugin.inc
+
+# Test that we can install a plugin despite the fact that we have
+# switched directory after starting the server and am using a relative
+# --defaults-file.
+--replace_regex /\.dll/.so/
+eval INSTALL PLUGIN example SONAME $HA_EXAMPLE_SO;
+
+--query_vertical SELECT @@global.connect_timeout AS connect_timeout, @@global.local_infile AS local_infile
+
+UNINSTALL PLUGIN example;

=== 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	revid:vasil.dimov@stripped
@@ -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	revid:vasil.dimov@stripped
@@ -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	revid:vasil.dimov@stripped
@@ -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	revid:vasil.dimov@stripped
@@ -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	revid:vasil.dimov@stripped
@@ -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	revid:vasil.dimov@stripped
@@ -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	revid:vasil.dimov@stripped
@@ -0,0 +1 @@
+--source suite/sys_vars/inc/autocommit_func2.inc

=== modified file 'mysql-test/t/log_tables.test'
--- a/mysql-test/t/log_tables.test	revid:tor.didriksen@stripped
+++ b/mysql-test/t/log_tables.test	revid:vasil.dimov@stripped
@@ -1034,6 +1034,25 @@ DROP TABLE t1;
 
 TRUNCATE TABLE mysql.slow_log;
 
+#
+# Bug #47924 main.log_tables times out sporadically
+#
+
+use mysql;
+# Should result in error
+--disable_warnings
+drop table if exists renamed_general_log;
+drop table if exists renamed_slow_log;
+--enable_warnings
+--error ER_CANT_RENAME_LOG_TABLE
+RENAME TABLE general_log TO renamed_general_log;
+--error ER_CANT_RENAME_LOG_TABLE
+RENAME TABLE slow_log TO renamed_slow_log;
+
+use test;
+flush tables with read lock;
+unlock tables;
+
 SET @@session.long_query_time= @old_long_query_time;
 
 SET @@global.log_output=       @old_log_output;

=== modified file 'mysys/default.c'
--- a/mysys/default.c	revid:tor.didriksen@stripped
+++ b/mysys/default.c	revid:vasil.dimov@stripped
@@ -66,7 +66,9 @@
 const char *args_separator= "----args-separator----";
 const char *my_defaults_file=0;
 const char *my_defaults_group_suffix=0;
-char *my_defaults_extra_file=0;
+const char *my_defaults_extra_file=0;
+
+static my_bool defaults_already_read= FALSE;
 
 /* Which directories are searched for options (and in which order) */
 
@@ -140,6 +142,36 @@ static char *remove_end_comment(char *pt
 
 
 /*
+  Expand a file name so that the current working directory is added if
+  the name is relative.
+
+  RETURNS
+   0   All OK
+   2   Out of memory or path to long
+   3   Not able to get working directory
+ */
+
+static int
+fn_expand(const char *filename, const char **filename_var)
+{
+  char dir[FN_REFLEN], buf[FN_REFLEN];
+  const int flags= MY_UNPACK_FILENAME | MY_SAFE_PATH | MY_RELATIVE_PATH;
+  const char *result_path= NULL;
+  DBUG_ENTER("fn_expand");
+  DBUG_PRINT("enter", ("filename: %s, buf: 0x%lx", filename, (unsigned long) buf));
+  if (my_getwd(dir, sizeof(dir), MYF(0)))
+    DBUG_RETURN(3);
+  DBUG_PRINT("debug", ("dir: %s", dir));
+  if (fn_format(buf, filename, dir, NULL, flags) == NULL ||
+      (result_path= my_strdup(buf, MYF(0))) == NULL)
+    DBUG_RETURN(2);
+  DBUG_PRINT("return", ("result: %s", result_path));
+  DBUG_ASSERT(result_path != NULL);
+  *filename_var= result_path;
+  DBUG_RETURN(0);
+}
+
+/*
   Process config files in default directories.
 
   SYNOPSIS
@@ -167,6 +199,7 @@ static char *remove_end_comment(char *pt
     0  ok
     1  given cinf_file doesn't exist
     2  out of memory
+    3  Can't get current working directory
 
     The global variable 'my_defaults_group_suffix' is updated with value for
     --defaults_group_suffix
@@ -189,11 +222,21 @@ int my_search_option_files(const char *c
   if (! my_defaults_group_suffix)
     my_defaults_group_suffix= getenv(STRINGIFY_ARG(DEFAULT_GROUP_SUFFIX_ENV));
 
-  if (forced_extra_defaults)
-    my_defaults_extra_file= (char *) forced_extra_defaults;
-  
-  if (forced_default_file)
-    my_defaults_file= forced_default_file;
+  if (forced_extra_defaults && !defaults_already_read)
+  {
+    int error= fn_expand(forced_extra_defaults, &my_defaults_extra_file);
+    if (error)
+      DBUG_RETURN(error);
+  }
+
+  if (forced_default_file && !defaults_already_read)
+  {
+    int error= fn_expand(forced_default_file, &my_defaults_file);
+    if (error)
+      DBUG_RETURN(error);
+  }
+
+  defaults_already_read= TRUE;
 
   /*
     We can only handle 'defaults-group-suffix' if we are called from
@@ -236,15 +279,15 @@ int my_search_option_files(const char *c
     group->type_names[group->count]= 0;
   }
   
-  if (forced_default_file)
+  if (my_defaults_file)
   {
     if ((error= search_default_file_with_ext(func, func_ctx, "", "",
-                                             forced_default_file, 0)) < 0)
+                                             my_defaults_file, 0)) < 0)
       goto err;
     if (error > 0)
     {
       fprintf(stderr, "Could not open required defaults file: %s\n",
-              forced_default_file);
+              my_defaults_file);
       goto err;
     }
   }

=== modified file 'mysys/stacktrace.c'
--- a/mysys/stacktrace.c	revid:tor.didriksen@stripped
+++ b/mysys/stacktrace.c	revid:vasil.dimov@stripped
@@ -315,6 +315,9 @@ end:
 /* Produce a core for the thread */
 void my_write_core(int sig)
 {
+#ifdef HAVE_gcov
+  extern void __gcov_flush(void);
+#endif
   signal(sig, SIG_DFL);
 #ifdef HAVE_gcov
   /*
@@ -322,7 +325,6 @@ void my_write_core(int sig)
     information from this process, causing gcov output to be incomplete.
     So we force the writing of coverage information here before terminating.
   */
-  extern void __gcov_flush(void);
   __gcov_flush();
 #endif
   pthread_kill(pthread_self(), sig);

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	revid:tor.didriksen@stripped
+++ b/sql/mysqld.cc	revid:vasil.dimov@stripped
@@ -5830,6 +5830,15 @@ 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},
   {"binlog-do-db", OPT_BINLOG_DO_DB,
    "Tells the master it should log updates for the specified database, "
    "and exclude all others not explicitly mentioned.",
@@ -7240,6 +7249,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	revid:tor.didriksen@stripped
+++ b/sql/mysqld.h	revid:vasil.dimov@stripped
@@ -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	revid:tor.didriksen@stripped
+++ b/sql/sql_partition.cc	revid:vasil.dimov@stripped
@@ -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;

=== modified file 'sql/sql_plugin.cc'
--- a/sql/sql_plugin.cc	revid:tor.didriksen@stripped
+++ b/sql/sql_plugin.cc	revid:vasil.dimov@stripped
@@ -1733,7 +1733,11 @@ bool mysql_install_plugin(THD *thd, cons
   mysql_mutex_lock(&LOCK_plugin);
   mysql_rwlock_wrlock(&LOCK_system_variables_hash);
 
-  my_load_defaults(MYSQL_CONFIG_NAME, load_default_groups, &argc, &argv, NULL);
+  if (my_load_defaults(MYSQL_CONFIG_NAME, load_default_groups, &argc, &argv, NULL))
+  {
+    report_error(REPORT_TO_USER, ER_PLUGIN_IS_NOT_LOADED, name->str);
+    goto err;
+  }
   error= plugin_add(thd->mem_root, name, dl, &argc, argv, REPORT_TO_USER);
   if (argv)
     free_defaults(argv);

=== modified file 'sql/sql_rename.cc'
--- a/sql/sql_rename.cc	revid:tor.didriksen@stripped
+++ b/sql/sql_rename.cc	revid:vasil.dimov@stripped
@@ -108,7 +108,7 @@ bool mysql_rename_tables(THD *thd, TABLE
             */
             my_error(ER_CANT_RENAME_LOG_TABLE, MYF(0), ren_table->table_name,
                      ren_table->table_name);
-            DBUG_RETURN(1);
+            goto err;
           }
         }
         else
@@ -121,7 +121,7 @@ bool mysql_rename_tables(THD *thd, TABLE
             */
             my_error(ER_CANT_RENAME_LOG_TABLE, MYF(0), ren_table->table_name,
                      ren_table->table_name);
-            DBUG_RETURN(1);
+            goto err;
           }
           else
           {
@@ -139,7 +139,7 @@ bool mysql_rename_tables(THD *thd, TABLE
       else
         my_error(ER_CANT_RENAME_LOG_TABLE, MYF(0), rename_log_table[1],
                  rename_log_table[1]);
-      DBUG_RETURN(1);
+      goto err;
     }
   }
 

=== modified file 'storage/ndb/src/mgmsrv/InitConfigFileParser.cpp'
--- a/storage/ndb/src/mgmsrv/InitConfigFileParser.cpp	revid:tor.didriksen@stripped
+++ b/storage/ndb/src/mgmsrv/InitConfigFileParser.cpp	revid:vasil.dimov@stripped
@@ -702,7 +702,7 @@ load_defaults(Vector<struct my_option>& 
   BaseString group_suffix;
 
   const char *save_file = my_defaults_file;
-  char *save_extra_file = my_defaults_extra_file;
+  const char *save_extra_file = my_defaults_extra_file;
   const char *save_group_suffix = my_defaults_group_suffix;
 
   if (my_defaults_file)

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-next-mr branch (vasil.dimov:3369 to 3370) vasil.dimov8 Nov