3382 Marc Alff 2011-08-18 [merge]
Merge mysql-trunk --> mysql-trunk-wl4896
added:
mysql-test/r/multi_plugin_load.result
mysql-test/r/multi_plugin_load_add.result
mysql-test/r/multi_plugin_load_add2.result
mysql-test/t/multi_plugin_load-master.opt
mysql-test/t/multi_plugin_load.test
mysql-test/t/multi_plugin_load_add-master.opt
mysql-test/t/multi_plugin_load_add.test
mysql-test/t/multi_plugin_load_add2-master.opt
mysql-test/t/multi_plugin_load_add2.test
modified:
mysql-test/include/plugin.defs
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_class.cc
sql/sql_derived.cc
sql/sql_plugin.cc
sql/sql_plugin.h
sql/sql_show.cc
storage/innobase/buf/buf0flu.c
3381 Marc Alff 2011-08-18
Commented too optimistic assert
modified:
storage/perfschema/pfs.cc
=== modified file 'mysql-test/include/plugin.defs'
--- a/mysql-test/include/plugin.defs 2011-07-19 14:17:58 +0000
+++ b/mysql-test/include/plugin.defs 2011-08-18 09:39:24 +0000
@@ -9,6 +9,7 @@
# PLUGVAR_DIR: name of directory where plugin was found
# PLUGVAR_OPT: mysqld option --plugin_dir=....
# PLUGVAR_LOAD: option --plugin_load=.... if the 4th element is present
+# PLUGVAR_LOAD_ADD: option --plugin_load_add=.... if the 4th element is present
#
# If a listed plugin is not found, the corresponding variables will be
# set to empty, they will not be unset.
=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl 2011-08-16 19:33:03 +0000
+++ b/mysql-test/mysql-test-run.pl 2011-08-18 08:31:08 +0000
@@ -2194,18 +2194,22 @@ sub read_plugin_defs($)
if ($plug_names) {
my $lib_name= basename($plugin);
my $load_var= "--plugin_load=";
+ my $load_add_var= "--plugin_load_add=";
my $semi= '';
foreach my $plug_name (split (',', $plug_names)) {
$load_var .= $semi . "$plug_name=$lib_name";
+ $load_add_var .= $semi . "$plug_name=$lib_name";
$semi= ';';
}
$ENV{$plug_var.'_LOAD'}= $load_var;
+ $ENV{$plug_var.'_LOAD_ADD'}= $load_add_var;
}
} else {
$ENV{$plug_var}= "";
$ENV{$plug_var.'_DIR'}= "";
$ENV{$plug_var.'_OPT'}= "";
$ENV{$plug_var.'_LOAD'}= "" if $plug_names;
+ $ENV{$plug_var.'_LOAD_ADD'}= "" if $plug_names;
}
}
close PLUGDEF;
=== added file 'mysql-test/r/multi_plugin_load.result'
--- a/mysql-test/r/multi_plugin_load.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/multi_plugin_load.result 2011-08-18 08:31:08 +0000
@@ -0,0 +1,10 @@
+#
+# Bug #11766001: ALLOW MULTIPLE --PLUGIN-LOAD OPTIONS
+#
+# test multiple consecutive --plugin-load options
+# success : only qa_auth_server should be present
+SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS
+WHERE PLUGIN_NAME IN ('test_plugin_server', 'qa_auth_server')
+ORDER BY 1;
+PLUGIN_NAME PLUGIN_STATUS
+qa_auth_server ACTIVE
=== added file 'mysql-test/r/multi_plugin_load_add.result'
--- a/mysql-test/r/multi_plugin_load_add.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/multi_plugin_load_add.result 2011-08-18 09:39:24 +0000
@@ -0,0 +1,14 @@
+#
+# Bug #11766001: ALLOW MULTIPLE --PLUGIN-LOAD OPTIONS
+#
+# test multiple consecutive --plugin-load-add options
+# success : both test_plugin_server and qa_auth_server
+# should be present
+SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS
+WHERE PLUGIN_NAME IN ('test_plugin_server', 'qa_auth_server')
+ORDER BY 1;
+PLUGIN_NAME PLUGIN_STATUS
+qa_auth_server ACTIVE
+test_plugin_server ACTIVE
+SELECT * FROM mysql.plugin ORDER BY name;
+name dl
=== added file 'mysql-test/r/multi_plugin_load_add2.result'
--- a/mysql-test/r/multi_plugin_load_add2.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/multi_plugin_load_add2.result 2011-08-18 09:39:24 +0000
@@ -0,0 +1,14 @@
+#
+# Bug #11766001: ALLOW MULTIPLE --PLUGIN-LOAD OPTIONS
+#
+# test multiple consecutive --plugin-load-add options
+# success : both test_plugin_server and qa_auth_server
+# should be present
+SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS
+WHERE PLUGIN_NAME IN ('test_plugin_server', 'qa_auth_server')
+ORDER BY 1;
+PLUGIN_NAME PLUGIN_STATUS
+qa_auth_server ACTIVE
+test_plugin_server ACTIVE
+SELECT * FROM mysql.plugin ORDER BY name;
+name dl
=== modified file 'mysql-test/r/mysqld--help-notwin.result'
--- a/mysql-test/r/mysqld--help-notwin.result 2011-08-17 20:55:55 +0000
+++ b/mysql-test/r/mysqld--help-notwin.result 2011-08-18 16:39:16 +0000
@@ -513,6 +513,13 @@ The following options may be given as th
where each plugin is identified as name=library, where
name is the plugin name and library is the plugin library
in plugin_dir.
+ --plugin-load-add=name
+ Optional semicolon-separated list of plugins to load,
+ where each plugin is identified as name=library, where
+ name is the plugin name and library is the plugin library
+ in plugin_dir. This option adds to the list speficied by
+ --plugin-load in an incremental way. Multiple
+ --plugin-load-add are supported.
-P, --port=# Port number to use for connection or 0 to default to,
my.cnf, $MYSQL_TCP_PORT, /etc/services, built-in default
(3306), whatever comes first
@@ -965,7 +972,6 @@ performance-schema-max-thread-instances
performance-schema-setup-actors-size 100
performance-schema-setup-objects-size 100
performance-schema-users-size 100
-plugin-load (No default value)
port 3306
port-open-timeout 0
preload-buffer-size 32768
=== modified file 'mysql-test/r/mysqld--help-win.result'
--- a/mysql-test/r/mysqld--help-win.result 2011-08-17 20:55:55 +0000
+++ b/mysql-test/r/mysqld--help-win.result 2011-08-18 16:39:16 +0000
@@ -192,11 +192,11 @@ The following options may be given as th
-?, --help Display this help and exit.
--ignore-builtin-innodb
Disable initialization of builtin InnoDB plugin
- --init-connect=name Command(s) that are executed for each new connection
--ignore-db-dir=name
Specifies a directory to add to the ignore list when
collecting database names from the datadir. Put a blank
argument to reset the list accumulated so far.
+ --init-connect=name Command(s) that are executed for each new connection
--init-file=name Read SQL commands from this file at startup
--init-slave=name Command(s) that are executed by a slave server each time
the SQL thread starts
@@ -513,6 +513,13 @@ The following options may be given as th
where each plugin is identified as name=library, where
name is the plugin name and library is the plugin library
in plugin_dir.
+ --plugin-load-add=name
+ Optional semicolon-separated list of plugins to load,
+ where each plugin is identified as name=library, where
+ name is the plugin name and library is the plugin library
+ in plugin_dir. This option adds to the list speficied by
+ --plugin-load in an incremental way. Multiple
+ --plugin-load-add are supported.
-P, --port=# Port number to use for connection or 0 to default to,
my.cnf, $MYSQL_TCP_PORT, /etc/services, built-in default
(3306), whatever comes first
@@ -969,7 +976,6 @@ performance-schema-max-thread-instances
performance-schema-setup-actors-size 100
performance-schema-setup-objects-size 100
performance-schema-users-size 100
-plugin-load (No default value)
port 3306
port-open-timeout 0
preload-buffer-size 32768
=== added file 'mysql-test/t/multi_plugin_load-master.opt'
--- a/mysql-test/t/multi_plugin_load-master.opt 1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/multi_plugin_load-master.opt 2011-08-18 08:31:08 +0000
@@ -0,0 +1,4 @@
+$PLUGIN_AUTH_OPT
+$PLUGIN_AUTH_LOAD
+$PLUGIN_AUTH_INTERFACE_LOAD_ADD
+$PLUGIN_AUTH_SERVER_LOAD
=== added file 'mysql-test/t/multi_plugin_load.test'
--- a/mysql-test/t/multi_plugin_load.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/multi_plugin_load.test 2011-08-18 08:31:08 +0000
@@ -0,0 +1,11 @@
+--source include/not_embedded.inc
+
+--echo #
+--echo # Bug #11766001: ALLOW MULTIPLE --PLUGIN-LOAD OPTIONS
+--echo #
+
+--echo # test multiple consecutive --plugin-load options
+--echo # success : only qa_auth_server should be present
+SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS
+ WHERE PLUGIN_NAME IN ('test_plugin_server', 'qa_auth_server')
+ ORDER BY 1;
=== added file 'mysql-test/t/multi_plugin_load_add-master.opt'
--- a/mysql-test/t/multi_plugin_load_add-master.opt 1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/multi_plugin_load_add-master.opt 2011-08-18 08:31:08 +0000
@@ -0,0 +1,3 @@
+$PLUGIN_AUTH_OPT
+$PLUGIN_AUTH_LOAD_ADD
+$PLUGIN_AUTH_SERVER_LOAD_ADD
=== added file 'mysql-test/t/multi_plugin_load_add.test'
--- a/mysql-test/t/multi_plugin_load_add.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/multi_plugin_load_add.test 2011-08-18 09:39:24 +0000
@@ -0,0 +1,13 @@
+--source include/not_embedded.inc
+
+--echo #
+--echo # Bug #11766001: ALLOW MULTIPLE --PLUGIN-LOAD OPTIONS
+--echo #
+
+--echo # test multiple consecutive --plugin-load-add options
+--echo # success : both test_plugin_server and qa_auth_server
+--echo # should be present
+SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS
+ WHERE PLUGIN_NAME IN ('test_plugin_server', 'qa_auth_server')
+ ORDER BY 1;
+SELECT * FROM mysql.plugin ORDER BY name;
=== added file 'mysql-test/t/multi_plugin_load_add2-master.opt'
--- a/mysql-test/t/multi_plugin_load_add2-master.opt 1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/multi_plugin_load_add2-master.opt 2011-08-18 08:31:08 +0000
@@ -0,0 +1,5 @@
+$PLUGIN_AUTH_OPT
+$PLUGIN_AUTH_LOAD
+$PLUGIN_AUTH_SERVER_LOAD_ADD
+$PLUGIN_AUTH_LOAD
+$PLUGIN_AUTH_SERVER_LOAD_ADD
=== added file 'mysql-test/t/multi_plugin_load_add2.test'
--- a/mysql-test/t/multi_plugin_load_add2.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/multi_plugin_load_add2.test 2011-08-18 09:39:24 +0000
@@ -0,0 +1,13 @@
+--source include/not_embedded.inc
+
+--echo #
+--echo # Bug #11766001: ALLOW MULTIPLE --PLUGIN-LOAD OPTIONS
+--echo #
+
+--echo # test multiple consecutive --plugin-load-add options
+--echo # success : both test_plugin_server and qa_auth_server
+--echo # should be present
+SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS
+ WHERE PLUGIN_NAME IN ('test_plugin_server', 'qa_auth_server')
+ ORDER BY 1;
+SELECT * FROM mysql.plugin ORDER BY name;
=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc 2011-08-17 20:55:55 +0000
+++ b/sql/mysqld.cc 2011-08-18 16:39:16 +0000
@@ -1532,6 +1532,7 @@ void clean_up(bool print_message)
my_free(const_cast<char*>(relay_log_basename));
my_free(const_cast<char*>(relay_log_index));
#endif
+ free_list(opt_plugin_load_list_ptr);
/*
The following lines may never be executed as the main thread may have
@@ -6464,11 +6465,19 @@ struct my_option my_long_options[]=
&opt_verbose, &opt_verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
- {"plugin-load", 0,
+ {"plugin-load", OPT_PLUGIN_LOAD,
"Optional semicolon-separated list of plugins to load, where each plugin is "
"identified as name=library, where name is the plugin name and library "
"is the plugin library in plugin_dir.",
- &opt_plugin_load, &opt_plugin_load, 0,
+ 0, 0, 0,
+ GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"plugin-load-add", OPT_PLUGIN_LOAD_ADD,
+ "Optional semicolon-separated list of plugins to load, where each plugin is "
+ "identified as name=library, where name is the plugin name and library "
+ "is the plugin library in plugin_dir. This option adds to the list "
+ "speficied by --plugin-load in an incremental way. "
+ "Multiple --plugin-load-add are supported.",
+ 0, 0, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"table_cache", 0, "Deprecated; use --table-open-cache instead.",
&table_cache_size, &table_cache_size, 0, GET_ULONG,
@@ -7721,6 +7730,13 @@ mysqld_get_one_option(int optid,
}
break;
+
+ case OPT_PLUGIN_LOAD:
+ free_list(opt_plugin_load_list_ptr);
+ /* fall through */
+ case OPT_PLUGIN_LOAD_ADD:
+ opt_plugin_load_list_ptr->push_back(new i_string(argument));
+ break;
}
return 0;
}
=== modified file 'sql/mysqld.h'
--- a/sql/mysqld.h 2011-08-17 20:55:55 +0000
+++ b/sql/mysqld.h 2011-08-18 16:39:16 +0000
@@ -543,7 +543,9 @@ enum options_mysqld
OPT_WANT_CORE,
OPT_ENGINE_CONDITION_PUSHDOWN,
OPT_LOG_ERROR,
- OPT_MAX_LONG_DATA_SIZE
+ OPT_MAX_LONG_DATA_SIZE,
+ OPT_PLUGIN_LOAD,
+ OPT_PLUGIN_LOAD_ADD
};
=== modified file 'sql/sql_class.cc'
--- a/sql/sql_class.cc 2011-08-17 20:55:55 +0000
+++ b/sql/sql_class.cc 2011-08-18 16:39:16 +0000
@@ -666,7 +666,7 @@ char *thd_security_context(THD *thd, cha
{
String str(buffer, length, &my_charset_latin1);
const Security_context *sctx= &thd->main_security_ctx;
- char header[256];
+ char header[64];
int len;
/*
The pointers thd->query and thd->proc_info might change since they are
=== modified file 'sql/sql_derived.cc'
--- a/sql/sql_derived.cc 2011-07-27 11:10:28 +0000
+++ b/sql/sql_derived.cc 2011-08-18 11:25:59 +0000
@@ -377,12 +377,11 @@ bool mysql_derived_create(THD *thd, LEX
bool mysql_derived_materialize(THD *thd, LEX *lex, TABLE_LIST *derived)
{
- TABLE *table= derived->table;
SELECT_LEX_UNIT *unit= derived->get_unit();
bool res= FALSE;
DBUG_ENTER("mysql_derived_materialize");
- DBUG_ASSERT(unit && table && table->created);
+ DBUG_ASSERT(unit && derived->table && derived->table->created);
if (derived->materialized)
DBUG_RETURN(FALSE);
=== modified file 'sql/sql_plugin.cc'
--- a/sql/sql_plugin.cc 2011-08-03 11:23:01 +0000
+++ b/sql/sql_plugin.cc 2011-08-18 08:31:08 +0000
@@ -49,8 +49,8 @@ static TYPELIB global_plugin_typelib=
{ array_elements(global_plugin_typelib_names)-1,
"", global_plugin_typelib_names, NULL };
-
-char *opt_plugin_load= NULL;
+static I_List<i_string> opt_plugin_load_list;
+I_List<i_string> *opt_plugin_load_list_ptr= &opt_plugin_load_list;
char *opt_plugin_dir_ptr;
char opt_plugin_dir[FN_REFLEN];
/*
@@ -1335,8 +1335,11 @@ int plugin_init(int *argc, char **argv,
/* Register all dynamic plugins */
if (!(flags & PLUGIN_INIT_SKIP_DYNAMIC_LOADING))
{
- if (opt_plugin_load)
- plugin_load_list(&tmp_root, argc, argv, opt_plugin_load);
+ I_List_iterator<i_string> iter(opt_plugin_load_list);
+ i_string *item;
+ while (NULL != (item= iter++))
+ plugin_load_list(&tmp_root, argc, argv, item->ptr);
+
if (!(flags & PLUGIN_INIT_SKIP_PLUGIN_TABLE))
plugin_load(&tmp_root, argc, argv);
}
=== modified file 'sql/sql_plugin.h'
--- a/sql/sql_plugin.h 2011-07-19 15:11:15 +0000
+++ b/sql/sql_plugin.h 2011-08-18 08:31:08 +0000
@@ -40,6 +40,7 @@ enum enum_plugin_load_option { PLUGIN_OF
extern const char *global_plugin_typelib_names[];
#include <my_sys.h>
+#include "sql_list.h"
#ifdef DBUG_OFF
#define plugin_ref_to_int(A) A
@@ -131,7 +132,7 @@ typedef struct st_plugin_int **plugin_re
typedef int (*plugin_type_init)(struct st_plugin_int *);
-extern char *opt_plugin_load;
+extern I_List<i_string> *opt_plugin_load_list_ptr;
extern char *opt_plugin_dir_ptr;
extern char opt_plugin_dir[FN_REFLEN];
extern const LEX_STRING plugin_type_names[];
=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc 2011-08-17 14:33:45 +0000
+++ b/sql/sql_show.cc 2011-08-18 08:14:24 +0000
@@ -552,7 +552,8 @@ ignore_db_dirs_process_additions()
if (len > 1)
len--;
- ptr= opt_ignore_db_dirs= (char *) my_malloc(len, MYF(0));
+ /* +1 the terminating zero */
+ ptr= opt_ignore_db_dirs= (char *) my_malloc(len + 1, MYF(0));
if (!ptr)
return true;
@@ -576,6 +577,10 @@ ignore_db_dirs_process_additions()
set_dynamic(&ignore_db_dirs_array, (uchar *) &dir, i);
}
+ /* make sure the string is terminated */
+ DBUG_ASSERT(ptr - opt_ignore_db_dirs <= (ptrdiff_t) len);
+ *ptr= 0;
+
/*
It's OK to empty the array here as the allocated elements are
referenced through the hash now.
=== modified file 'storage/innobase/buf/buf0flu.c'
--- a/storage/innobase/buf/buf0flu.c 2011-08-10 06:26:39 +0000
+++ b/storage/innobase/buf/buf0flu.c 2011-08-18 10:26:53 +0000
@@ -1090,8 +1090,10 @@ buf_flush_write_to_dblwr_and_datafile(
/* Check that the page as written to the doublewrite
buffer has sane LSN values. */
- buf_flush_doublewrite_check_page_lsn(
- ((buf_block_t*) bpage)->frame);
+ if (!bpage->zip.data) {
+ buf_flush_doublewrite_check_page_lsn(
+ ((buf_block_t*) bpage)->frame);
+ }
}
retry:
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-trunk branch (marc.alff:3381 to 3382) | Marc Alff | 22 Aug |