| 1 |
show variables like 'test_sql_discovery%'; |
| 2 |
Variable_name Value |
| 3 |
test_sql_discovery_statement |
| 4 |
test_sql_discovery_write_frm ON |
| 5 |
set sql_quote_show_create=0; |
| 6 |
create table t1 (a int) engine=test_sql_discovery; |
| 7 |
ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by the engine") |
| 8 |
select * from t1; |
| 9 |
ERROR 42S02: Table 'test.t1' doesn't exist |
| 10 |
set @@test_sql_discovery_statement='t1:foobar bwa-ha-ha'; |
| 11 |
select * from t0; |
| 12 |
ERROR 42S02: Table 'test.t0' doesn't exist |
| 13 |
select * from t1; |
| 14 |
ERROR HY000: Engine TEST_SQL_DISCOVERY failed to discover table `test`.`t1` with 'foobar bwa-ha-ha' |
| 15 |
show warnings; |
| 16 |
Level Code Message |
| 17 |
Error 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'foobar bwa-ha-ha' at line 1 |
| 18 |
Error 1939 Engine TEST_SQL_DISCOVERY failed to discover table `test`.`t1` with 'foobar bwa-ha-ha' |
| 19 |
set @@test_sql_discovery_statement='t1:select 1'; |
| 20 |
select * from t1; |
| 21 |
ERROR HY000: Engine TEST_SQL_DISCOVERY failed to discover table `test`.`t1` with 'select 1' |
| 22 |
show warnings; |
| 23 |
Level Code Message |
| 24 |
Error 1939 Engine TEST_SQL_DISCOVERY failed to discover table `test`.`t1` with 'select 1' |
| 25 |
set @@test_sql_discovery_statement='t1:create table t1 (a int primary key) partition by hash(id) partitions 2'; |
| 26 |
select * from t1; |
| 27 |
ERROR HY000: Engine TEST_SQL_DISCOVERY failed to discover table `test`.`t1` with 'create table t1 (a int primary key) partition by hash(id) partitions 2' |
| 28 |
show warnings; |
| 29 |
Level Code Message |
| 30 |
Error 1290 The MariaDB server is running with the --skip-partition option so it cannot execute this statement |
| 31 |
Error 1939 Engine TEST_SQL_DISCOVERY failed to discover table `test`.`t1` with 'create table t1 (a int primary key) partition by hash(id) partitions 2' |
| 32 |
set @@test_sql_discovery_statement='t1:create table t1 (a int) union=(t3,t4)'; |
| 33 |
select * from t1; |
| 34 |
ERROR HY000: Engine TEST_SQL_DISCOVERY failed to discover table `test`.`t1` with 'create table t1 (a int) union=(t3,t4)' |
| 35 |
show warnings; |
| 36 |
Level Code Message |
| 37 |
Error 1939 Engine TEST_SQL_DISCOVERY failed to discover table `test`.`t1` with 'create table t1 (a int) union=(t3,t4)' |
| 38 |
set @@test_sql_discovery_statement='t1:create table t1 like t2'; |
| 39 |
select * from t1; |
| 40 |
ERROR HY000: Engine TEST_SQL_DISCOVERY failed to discover table `test`.`t1` with 'create table t1 like t2' |
| 41 |
show warnings; |
| 42 |
Level Code Message |
| 43 |
Error 1939 Engine TEST_SQL_DISCOVERY failed to discover table `test`.`t1` with 'create table t1 like t2' |
| 44 |
set @@test_sql_discovery_statement='t1:create table t1 select * from t2'; |
| 45 |
select * from t1; |
| 46 |
ERROR HY000: Engine TEST_SQL_DISCOVERY failed to discover table `test`.`t1` with 'create table t1 select * from t2' |
| 47 |
show warnings; |
| 48 |
Level Code Message |
| 49 |
Error 1939 Engine TEST_SQL_DISCOVERY failed to discover table `test`.`t1` with 'create table t1 select * from t2' |
| 50 |
set @@test_sql_discovery_statement='t1:create table t1 (a int) index directory="/tmp"'; |
| 51 |
select * from t1; |
| 52 |
ERROR HY000: Engine TEST_SQL_DISCOVERY failed to discover table `test`.`t1` with 'create table t1 (a int) index directory="/tmp"' |
| 53 |
show warnings; |
| 54 |
Level Code Message |
| 55 |
Error 1939 Engine TEST_SQL_DISCOVERY failed to discover table `test`.`t1` with 'create table t1 (a int) index directory="/tmp"' |
| 56 |
set @@test_sql_discovery_statement='t1:create table t1 (a int) data directory="/tmp"'; |
| 57 |
select * from t1; |
| 58 |
ERROR HY000: Engine TEST_SQL_DISCOVERY failed to discover table `test`.`t1` with 'create table t1 (a int) data directory="/tmp"' |
| 59 |
show warnings; |
| 60 |
Level Code Message |
| 61 |
Error 1939 Engine TEST_SQL_DISCOVERY failed to discover table `test`.`t1` with 'create table t1 (a int) data directory="/tmp"' |
| 62 |
set @@test_sql_discovery_statement='t1:create table t1 (a int) engine=myisam'; |
| 63 |
select * from t1; |
| 64 |
ERROR HY000: Engine TEST_SQL_DISCOVERY failed to discover table `test`.`t1` with 'create table t1 (a int) engine=myisam' |
| 65 |
show warnings; |
| 66 |
Level Code Message |
| 67 |
Error 1939 Engine TEST_SQL_DISCOVERY failed to discover table `test`.`t1` with 'create table t1 (a int) engine=myisam' |
| 68 |
set @@test_sql_discovery_statement='t1:create temporary table t1 (a int)'; |
| 69 |
select * from t1; |
| 70 |
ERROR HY000: Engine TEST_SQL_DISCOVERY failed to discover table `test`.`t1` with 'create temporary table t1 (a int)' |
| 71 |
show warnings; |
| 72 |
Level Code Message |
| 73 |
Error 1939 Engine TEST_SQL_DISCOVERY failed to discover table `test`.`t1` with 'create temporary table t1 (a int)' |
| 74 |
set @@test_sql_discovery_statement='t1:create table if not exists t1 (a int)'; |
| 75 |
select * from t1; |
| 76 |
ERROR HY000: Engine TEST_SQL_DISCOVERY failed to discover table `test`.`t1` with 'create table if not exists t1 (a int)' |
| 77 |
show warnings; |
| 78 |
Level Code Message |
| 79 |
Error 1939 Engine TEST_SQL_DISCOVERY failed to discover table `test`.`t1` with 'create table if not exists t1 (a int)' |
| 80 |
set @@test_sql_discovery_statement='t1:create table t1 (a uint)'; |
| 81 |
select * from t1; |
| 82 |
ERROR HY000: Engine TEST_SQL_DISCOVERY failed to discover table `test`.`t1` with 'create table t1 (a uint)' |
| 83 |
show warnings; |
| 84 |
Level Code Message |
| 85 |
Error 4161 Unknown data type: 'uint' |
| 86 |
Error 1939 Engine TEST_SQL_DISCOVERY failed to discover table `test`.`t1` with 'create table t1 (a uint)' |
| 87 |
set @@test_sql_discovery_statement='t1:create table t1 (a int)'; |
| 88 |
select * from t1; |
| 89 |
a |
| 90 |
show create table t1; |
| 91 |
Table Create Table |
| 92 |
t1 CREATE TABLE t1 ( |
| 93 |
a int(11) DEFAULT NULL |
| 94 |
) ENGINE=TEST_SQL_DISCOVERY DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci |
| 95 |
drop table t1; |
| 96 |
set @@test_sql_discovery_statement='t1:create table t2 (a int)'; |
| 97 |
select * from t1; |
| 98 |
a |
| 99 |
select * from t2; |
| 100 |
ERROR 42S02: Table 'test.t2' doesn't exist |
| 101 |
drop table t1; |
| 102 |
set @@test_sql_discovery_statement='t1:create table t1 (a int) engine=test_sql_discovery'; |
| 103 |
select * from t1; |
| 104 |
a |
| 105 |
drop table t1; |
| 106 |
set @@test_sql_discovery_statement='t1: |
| 107 |
create table t1 ( |
| 108 |
a int not null default 5 primary key, |
| 109 |
b timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
| 110 |
c tinyblob, |
| 111 |
d decimal(5,2), |
| 112 |
e varchar(30) character set ascii, |
| 113 |
f geometry not null, |
| 114 |
index (d,b), |
| 115 |
unique index (c(10)), |
| 116 |
fulltext (e), |
| 117 |
spatial (f) |
| 118 |
) comment="abc" default character set utf8 max_rows=100 min_rows=10 checksum=1'; |
| 119 |
show status like 'handler_discover'; |
| 120 |
Variable_name Value |
| 121 |
Handler_discover 15 |
| 122 |
show create table t1; |
| 123 |
Table Create Table |
| 124 |
t1 CREATE TABLE t1 ( |
| 125 |
a int(11) NOT NULL DEFAULT 5, |
| 126 |
b timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), |
| 127 |
c tinyblob DEFAULT NULL, |
| 128 |
d decimal(5,2) DEFAULT NULL, |
| 129 |
e varchar(30) CHARACTER SET ascii COLLATE ascii_general_ci DEFAULT NULL, |
| 130 |
f geometry NOT NULL, |
| 131 |
PRIMARY KEY (a), |
| 132 |
UNIQUE KEY c (c(10)), |
| 133 |
KEY d (d,b), |
| 134 |
SPATIAL KEY f (f), |
| 135 |
FULLTEXT KEY e (e) |
| 136 |
) ENGINE=TEST_SQL_DISCOVERY DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_uca1400_ai_ci MIN_ROWS=10 MAX_ROWS=100 CHECKSUM=1 COMMENT='abc' |
| 137 |
show status like 'handler_discover'; |
| 138 |
Variable_name Value |
| 139 |
Handler_discover 16 |
| 140 |
---- |
| 141 |
t1.frm |
| 142 |
---- |
| 143 |
show open tables from test; |
| 144 |
Database Table In_use Name_locked |
| 145 |
test t1 0 0 |
| 146 |
select * from t1; |
| 147 |
a b c d e f |
| 148 |
show status like 'handler_discover'; |
| 149 |
Variable_name Value |
| 150 |
Handler_discover 16 |
| 151 |
flush tables; |
| 152 |
select * from t1; |
| 153 |
a b c d e f |
| 154 |
show status like 'handler_discover'; |
| 155 |
Variable_name Value |
| 156 |
Handler_discover 16 |
| 157 |
drop table t1; |
| 158 |
set @@test_sql_discovery_write_frm=0; |
| 159 |
set @@test_sql_discovery_statement='t1:create table t1 (a int)'; |
| 160 |
show status like 'handler_discover'; |
| 161 |
Variable_name Value |
| 162 |
Handler_discover 16 |
| 163 |
show create table t1; |
| 164 |
Table Create Table |
| 165 |
t1 CREATE TABLE t1 ( |
| 166 |
a int(11) DEFAULT NULL |
| 167 |
) ENGINE=TEST_SQL_DISCOVERY DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci |
| 168 |
show status like 'handler_discover'; |
| 169 |
Variable_name Value |
| 170 |
Handler_discover 17 |
| 171 |
---- |
| 172 |
---- |
| 173 |
show open tables from test; |
| 174 |
Database Table In_use Name_locked |
| 175 |
test t1 0 0 |
| 176 |
select * from t1; |
| 177 |
a |
| 178 |
show status like 'handler_discover'; |
| 179 |
Variable_name Value |
| 180 |
Handler_discover 17 |
| 181 |
flush tables; |
| 182 |
select * from t1; |
| 183 |
a |
| 184 |
show status like 'handler_discover'; |
| 185 |
Variable_name Value |
| 186 |
Handler_discover 18 |
| 187 |
drop table t1; |
| 188 |
show status like 'handler_discover'; |
| 189 |
Variable_name Value |
| 190 |
Handler_discover 18 |