#At file:///home/gluh/MySQL/mysql-6.0-bugteam/ based on revid:sergey.glukhov@stripped
2816 Sergey Glukhov 2008-12-17 [merge]
5.1-bugteam->6.0-bugteam merge
modified:
mysql-test/r/warnings_engine_disabled.result
mysql-test/suite/funcs_1/r/is_columns_is.result
mysql-test/suite/funcs_1/r/is_engines.result
mysql-test/suite/funcs_1/r/storedproc.result
mysql-test/t/warnings_engine_disabled.test
sql/sql_plugin.cc
sql/sql_plugin.h
sql/sql_show.cc
per-file messages:
mysql-test/r/warnings_engine_disabled.result
5.1-bugteam->6.0-bugteam merge
mysql-test/suite/funcs_1/r/is_columns_is.result
5.1-bugteam->6.0-bugteam merge
mysql-test/suite/funcs_1/r/is_engines.result
5.1-bugteam->6.0-bugteam merge
mysql-test/suite/funcs_1/r/storedproc.result
result fix
mysql-test/t/warnings_engine_disabled.test
5.1-bugteam->6.0-bugteam merge
sql/sql_plugin.cc
5.1-bugteam->6.0-bugteam merge
sql/sql_plugin.h
5.1-bugteam->6.0-bugteam merge
sql/sql_show.cc
5.1-bugteam->6.0-bugteam merge
=== modified file 'mysql-test/r/warnings_engine_disabled.result'
--- a/mysql-test/r/warnings_engine_disabled.result 2006-12-15 14:05:50 +0000
+++ b/mysql-test/r/warnings_engine_disabled.result 2008-12-17 16:03:50 +0000
@@ -1,7 +1,15 @@
create table t1 (id int) engine=NDB;
Warnings:
+Warning 1286 Unknown storage engine 'NDB'
Warning 1266 Using storage engine MyISAM for table 't1'
alter table t1 engine=NDB;
Warnings:
-Warning 1266 Using storage engine MyISAM for table 't1'
+Warning 1286 Unknown storage engine 'NDB'
drop table t1;
+SELECT ENGINE, SUPPORT FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='ndbcluster';
+ENGINE SUPPORT
+ndbcluster NO
+SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE
+PLUGIN_NAME='ndbcluster';
+PLUGIN_NAME PLUGIN_STATUS
+ndbcluster DISABLED
=== modified file 'mysql-test/suite/funcs_1/r/is_columns_is.result'
--- a/mysql-test/suite/funcs_1/r/is_columns_is.result 2008-11-13 12:53:16 +0000
+++ b/mysql-test/suite/funcs_1/r/is_columns_is.result 2008-12-17 16:03:50 +0000
@@ -45,10 +45,10 @@ NULL information_schema COLUMN_PRIVILEGE
NULL information_schema COLUMN_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 256 NULL NULL utf8 utf8_general_ci varchar(64) select Default Default
NULL information_schema ENGINES COMMENT 3 NO varchar 80 320 NULL NULL utf8 utf8_general_ci varchar(80) select Default Default
NULL information_schema ENGINES ENGINE 1 NO varchar 64 256 NULL NULL utf8 utf8_general_ci varchar(64) select Default Default
-NULL information_schema ENGINES SAVEPOINTS 6 NO varchar 3 12 NULL NULL utf8 utf8_general_ci varchar(3) select Default Default
+NULL information_schema ENGINES SAVEPOINTS 6 NULL YES varchar 3 12 NULL NULL utf8 utf8_general_ci varchar(3) select Default Default
NULL information_schema ENGINES SUPPORT 2 NO varchar 8 32 NULL NULL utf8 utf8_general_ci varchar(8) select Default Default
-NULL information_schema ENGINES TRANSACTIONS 4 NO varchar 3 12 NULL NULL utf8 utf8_general_ci varchar(3) select Default Default
-NULL information_schema ENGINES XA 5 NO varchar 3 12 NULL NULL utf8 utf8_general_ci varchar(3) select Default Default
+NULL information_schema ENGINES TRANSACTIONS 4 NULL YES varchar 3 12 NULL NULL utf8 utf8_general_ci varchar(3) select Default Default
+NULL information_schema ENGINES XA 5 NULL YES varchar 3 12 NULL NULL utf8 utf8_general_ci varchar(3) select Default Default
NULL information_schema EVENTS CHARACTER_SET_CLIENT 22 NO varchar 32 128 NULL NULL utf8 utf8_general_ci varchar(32) select Default Default
NULL information_schema EVENTS COLLATION_CONNECTION 23 NO varchar 32 128 NULL NULL utf8 utf8_general_ci varchar(32) select Default Default
NULL information_schema EVENTS CREATED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select Default Default
=== modified file 'mysql-test/suite/funcs_1/r/is_engines.result'
--- a/mysql-test/suite/funcs_1/r/is_engines.result 2008-03-07 19:18:14 +0000
+++ b/mysql-test/suite/funcs_1/r/is_engines.result 2008-12-17 15:45:34 +0000
@@ -31,27 +31,27 @@ Field Type Null Key Default Extra
ENGINE varchar(64) NO
SUPPORT varchar(8) NO
COMMENT varchar(80) NO
-TRANSACTIONS varchar(3) NO
-XA varchar(3) NO
-SAVEPOINTS varchar(3) NO
+TRANSACTIONS varchar(3) YES NULL
+XA varchar(3) YES NULL
+SAVEPOINTS varchar(3) YES NULL
SHOW CREATE TABLE information_schema.ENGINES;
Table Create Table
ENGINES CREATE TEMPORARY TABLE `ENGINES` (
`ENGINE` varchar(64) NOT NULL DEFAULT '',
`SUPPORT` varchar(8) NOT NULL DEFAULT '',
`COMMENT` varchar(80) NOT NULL DEFAULT '',
- `TRANSACTIONS` varchar(3) NOT NULL DEFAULT '',
- `XA` varchar(3) NOT NULL DEFAULT '',
- `SAVEPOINTS` varchar(3) NOT NULL DEFAULT ''
+ `TRANSACTIONS` varchar(3) DEFAULT NULL,
+ `XA` varchar(3) DEFAULT NULL,
+ `SAVEPOINTS` varchar(3) DEFAULT NULL
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW COLUMNS FROM information_schema.ENGINES;
Field Type Null Key Default Extra
ENGINE varchar(64) NO
SUPPORT varchar(8) NO
COMMENT varchar(80) NO
-TRANSACTIONS varchar(3) NO
-XA varchar(3) NO
-SAVEPOINTS varchar(3) NO
+TRANSACTIONS varchar(3) YES NULL
+XA varchar(3) YES NULL
+SAVEPOINTS varchar(3) YES NULL
########################################################################
# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
# DDL on INFORMATION_SCHEMA tables are not supported
=== modified file 'mysql-test/suite/funcs_1/r/storedproc.result'
--- a/mysql-test/suite/funcs_1/r/storedproc.result 2008-12-10 17:00:09 +0000
+++ b/mysql-test/suite/funcs_1/r/storedproc.result 2008-12-17 16:03:50 +0000
@@ -182,15 +182,9 @@ db_storedproc func_1 FUNCTION root@local
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 1.7976931348623157493578e+308;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(1.7976931348623157493578e+308, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(1.7976931348623157493578e+308);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+100;
=== modified file 'mysql-test/t/warnings_engine_disabled.test'
--- a/mysql-test/t/warnings_engine_disabled.test 2006-12-15 14:05:50 +0000
+++ b/mysql-test/t/warnings_engine_disabled.test 2008-12-17 15:45:34 +0000
@@ -4,7 +4,7 @@
#
disable_query_log;
--require r/true.require
-select support = 'Disabled' as `TRUE` from information_schema.engines where engine = 'ndbcluster';
+select support = 'NO' as `TRUE` from information_schema.engines where engine = 'ndbcluster';
enable_query_log;
@@ -16,4 +16,9 @@ create table t1 (id int) engine=NDB;
alter table t1 engine=NDB;
drop table t1;
-
+#
+# Bug#29263 disabled storage engines omitted in SHOW ENGINES
+#
+SELECT ENGINE, SUPPORT FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='ndbcluster';
+SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE
+PLUGIN_NAME='ndbcluster';
=== modified file 'sql/sql_plugin.cc'
--- a/sql/sql_plugin.cc 2008-11-06 18:39:27 +0000
+++ b/sql/sql_plugin.cc 2008-12-17 16:03:50 +0000
@@ -755,21 +755,22 @@ static bool plugin_add(MEM_ROOT *tmp_roo
tmp.name.length= name_len;
tmp.ref_count= 0;
tmp.state= PLUGIN_IS_UNINITIALIZED;
- if (!test_plugin_options(tmp_root, &tmp, argc, argv, true))
+ if (test_plugin_options(tmp_root, &tmp, argc, argv, true))
+ tmp.state= PLUGIN_IS_DISABLED;
+
+ if ((tmp_plugin_ptr= plugin_insert_or_reuse(&tmp)))
{
- if ((tmp_plugin_ptr= plugin_insert_or_reuse(&tmp)))
+ plugin_array_version++;
+ if (!my_hash_insert(&plugin_hash[plugin->type], (uchar*)tmp_plugin_ptr))
{
- plugin_array_version++;
- if (!my_hash_insert(&plugin_hash[plugin->type], (uchar*)tmp_plugin_ptr))
- {
- init_alloc_root(&tmp_plugin_ptr->mem_root, 4096, 4096);
- DBUG_RETURN(FALSE);
- }
- tmp_plugin_ptr->state= PLUGIN_IS_FREED;
+ init_alloc_root(&tmp_plugin_ptr->mem_root, 4096, 4096);
+ DBUG_RETURN(FALSE);
}
- mysql_del_sys_var_chain(tmp.system_vars);
- goto err;
+ tmp_plugin_ptr->state= PLUGIN_IS_FREED;
}
+ mysql_del_sys_var_chain(tmp.system_vars);
+ goto err;
+
/* plugin was disabled */
plugin_dl_del(dl);
DBUG_RETURN(FALSE);
@@ -1149,11 +1150,12 @@ int plugin_init(int *argc, char **argv,
tmp.plugin= plugin;
tmp.name.str= (char *)plugin->name;
tmp.name.length= strlen(plugin->name);
-
+ tmp.state= 0;
free_root(&tmp_root, MYF(MY_MARK_BLOCKS_FREE));
if (test_plugin_options(&tmp_root, &tmp, argc, argv, def_enabled))
- continue;
-
+ tmp.state= PLUGIN_IS_DISABLED;
+ else
+ tmp.state= PLUGIN_IS_UNINITIALIZED;
if (register_builtin(plugin, &tmp, &plugin_ptr))
goto err_unlock;
@@ -1163,7 +1165,8 @@ int plugin_init(int *argc, char **argv,
my_strcasecmp(&my_charset_latin1, plugin->name, "CSV"))
continue;
- if (plugin_initialize(plugin_ptr))
+ if (plugin_ptr->state == PLUGIN_IS_UNINITIALIZED &&
+ plugin_initialize(plugin_ptr))
goto err_unlock;
/*
@@ -1250,8 +1253,6 @@ static bool register_builtin(struct st_m
struct st_plugin_int **ptr)
{
DBUG_ENTER("register_builtin");
-
- tmp->state= PLUGIN_IS_UNINITIALIZED;
tmp->ref_count= 0;
tmp->plugin_dl= 0;
@@ -1300,7 +1301,7 @@ bool plugin_register_builtin(THD *thd, s
if (test_plugin_options(thd->mem_root, &tmp, &dummy_argc, NULL, true))
goto end;
-
+ tmp.state= PLUGIN_IS_UNINITIALIZED;
if ((result= register_builtin(plugin, &tmp, &ptr)))
mysql_del_sys_var_chain(tmp.system_vars);
@@ -1555,7 +1556,8 @@ void plugin_shutdown(void)
We loop through all plugins and call deinit() if they have one.
*/
for (i= 0; i < count; i++)
- if (!(plugins[i]->state & (PLUGIN_IS_UNINITIALIZED | PLUGIN_IS_FREED)))
+ if (!(plugins[i]->state & (PLUGIN_IS_UNINITIALIZED | PLUGIN_IS_FREED |
+ PLUGIN_IS_DISABLED)))
{
sql_print_information("Plugin '%s' will be forced to shutdown",
plugins[i]->name.str);
=== modified file 'sql/sql_plugin.h'
--- a/sql/sql_plugin.h 2008-09-23 14:33:18 +0000
+++ b/sql/sql_plugin.h 2008-12-17 16:03:50 +0000
@@ -62,6 +62,7 @@ typedef struct st_mysql_show_var SHOW_VA
#define PLUGIN_IS_UNINITIALIZED 4
#define PLUGIN_IS_READY 8
#define PLUGIN_IS_DYING 16
+#define PLUGIN_IS_DISABLED 32
/* A handle for the dynamic library containing a plugin or plugins. */
=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc 2008-12-10 15:59:12 +0000
+++ b/sql/sql_show.cc 2008-12-17 16:03:50 +0000
@@ -125,6 +125,9 @@ static my_bool show_plugins(THD *thd, pl
case PLUGIN_IS_READY:
table->field[2]->store(STRING_WITH_LEN("ACTIVE"), cs);
break;
+ case PLUGIN_IS_DISABLED:
+ table->field[2]->store(STRING_WITH_LEN("DISABLED"), cs);
+ break;
default:
DBUG_ASSERT(0);
}
@@ -4110,6 +4113,25 @@ static my_bool iter_schema_engines(THD *
handlerton *default_type= ha_default_handlerton(thd);
DBUG_ENTER("iter_schema_engines");
+
+ /* Disabled plugins */
+ if (plugin_state(plugin) != PLUGIN_IS_READY)
+ {
+
+ struct st_mysql_plugin *plug= plugin_decl(plugin);
+ if (!(wild && wild[0] &&
+ wild_case_compare(scs, plug->name,wild)))
+ {
+ restore_record(table, s->default_values);
+ table->field[0]->store(plug->name, strlen(plug->name), scs);
+ table->field[1]->store(C_STRING_WITH_LEN("NO"), scs);
+ table->field[2]->store(plug->descr, strlen(plug->descr), scs);
+ if (schema_table_store_record(thd, table))
+ DBUG_RETURN(1);
+ }
+ DBUG_RETURN(0);
+ }
+
if (!(hton->flags & HTON_HIDDEN))
{
LEX_STRING *name= plugin_name(plugin);
@@ -4130,10 +4152,13 @@ static my_bool iter_schema_engines(THD *
strlen(plugin_decl(plugin)->descr), scs);
tmp= &yesno[test(hton->commit)];
table->field[3]->store(tmp->str, tmp->length, scs);
+ table->field[3]->set_notnull();
tmp= &yesno[test(hton->prepare)];
table->field[4]->store(tmp->str, tmp->length, scs);
+ table->field[4]->set_notnull();
tmp= &yesno[test(hton->savepoint_set)];
table->field[5]->store(tmp->str, tmp->length, scs);
+ table->field[5]->set_notnull();
if (schema_table_store_record(thd, table))
DBUG_RETURN(1);
@@ -4144,8 +4169,12 @@ static my_bool iter_schema_engines(THD *
int fill_schema_engines(THD *thd, TABLE_LIST *tables, COND *cond)
{
- return plugin_foreach(thd, iter_schema_engines,
- MYSQL_STORAGE_ENGINE_PLUGIN, tables->table);
+ DBUG_ENTER("fill_schema_engines");
+ if (plugin_foreach_with_mask(thd, iter_schema_engines,
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ ~PLUGIN_IS_FREED, tables->table))
+ DBUG_RETURN(1);
+ DBUG_RETURN(0);
}
@@ -6569,9 +6598,9 @@ ST_FIELD_INFO engines_fields_info[]=
{"ENGINE", 64, MYSQL_TYPE_STRING, 0, 0, "Engine", SKIP_OPEN_TABLE},
{"SUPPORT", 8, MYSQL_TYPE_STRING, 0, 0, "Support", SKIP_OPEN_TABLE},
{"COMMENT", 80, MYSQL_TYPE_STRING, 0, 0, "Comment", SKIP_OPEN_TABLE},
- {"TRANSACTIONS", 3, MYSQL_TYPE_STRING, 0, 0, "Transactions", SKIP_OPEN_TABLE},
- {"XA", 3, MYSQL_TYPE_STRING, 0, 0, "XA", SKIP_OPEN_TABLE},
- {"SAVEPOINTS", 3 ,MYSQL_TYPE_STRING, 0, 0, "Savepoints", SKIP_OPEN_TABLE},
+ {"TRANSACTIONS", 3, MYSQL_TYPE_STRING, 0, 1, "Transactions", SKIP_OPEN_TABLE},
+ {"XA", 3, MYSQL_TYPE_STRING, 0, 1, "XA", SKIP_OPEN_TABLE},
+ {"SAVEPOINTS", 3 ,MYSQL_TYPE_STRING, 0, 1, "Savepoints", SKIP_OPEN_TABLE},
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
| Thread |
|---|
| • bzr commit into mysql-6.0-bugteam branch (Sergey.Glukhov:2816) | Sergey Glukhov | 17 Dec |