summaryrefslogtreecommitdiff
path: root/mysql-test/t/plugin.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/plugin.test')
-rw-r--r--mysql-test/t/plugin.test32
1 files changed, 29 insertions, 3 deletions
diff --git a/mysql-test/t/plugin.test b/mysql-test/t/plugin.test
index 4412383f837..602b2e3c5c9 100644
--- a/mysql-test/t/plugin.test
+++ b/mysql-test/t/plugin.test
@@ -16,12 +16,13 @@ INSTALL SONAME 'ha_example';
--replace_regex /\.dll/.so/
--query_vertical select * from information_schema.plugins where plugin_library like 'ha_example%'
-CREATE TABLE t1(a int) ENGINE=EXAMPLE;
+CREATE TABLE t1 (a int) ENGINE=EXAMPLE;
+CREATE TABLE t2 (a int) ENGINE=EXAMPLE;
+FLUSH TABLES;
# Let's do some advanced ops with the example engine :)
SELECT * FROM t1;
-
# a couple of tests for variables
set global example_ulong_var=500;
set global example_enum_var= e1;
@@ -29,12 +30,26 @@ show status like 'example%';
show variables like 'example%';
UNINSTALL SONAME 'ha_example';
+
+# the engine is NOT uninstalled yet,
+# because the table `t1` is open, sitting in the table defintion cache
+
--replace_column 5 #
--replace_regex /\.dll/.so/
--query_vertical select * from information_schema.plugins where plugin_library like 'ha_example%'
-
DROP TABLE t1;
+# now the engine IS unloaded
+# and the table `t2` belongs to an unknown engine
+
+--replace_column 5 #
+--replace_regex /\.dll/.so/
+--query_vertical select * from information_schema.plugins where plugin_library like 'ha_example%'
+--error ER_UNKNOWN_STORAGE_ENGINE
+SELECT * FROM t2;
+DROP TABLE t2;
+
+
--error 1305
UNINSTALL PLUGIN EXAMPLE;
@@ -129,6 +144,7 @@ CREATE TABLE t1 (a int) ENGINE=example ULL=1e2;
CREATE TABLE t1 (a int) ENGINE=example ULL=0x1234;
SHOW CREATE TABLE t1;
+SET example_varopt_default=33; # does not affect varopt of t1
select create_options from information_schema.tables where table_schema='test' and table_name='t1';
@@ -137,6 +153,16 @@ SHOW CREATE TABLE t1;
DROP TABLE t1;
+create table t1 (a int) engine=example; # varopt is 10
+show create table t1;
+drop table t1;
+
+create table t1 (a int) engine=example varopt=15;
+show create table t1;
+alter table t1 varopt=default;
+show create table t1;
+drop table t1;
+
SET @@SQL_MODE=@OLD_SQL_MODE;
#