1
Simple CREATE / DROP test
2
Testing simple CREATE SCHEMA
3
CREATE SCHEMA my_test_schema;
4
Check transaction_log_entries
5
SELECT COUNT(*) FROM DATA_DICTIONARY.TRANSACTION_LOG_ENTRIES;
9
Check transaction_log_transactions
10
SELECT COUNT(*) FROM DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS;
13
Check transaction log contents
14
SELECT PRINT_TRANSACTION_MESSAGE('transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS));
15
PRINT_TRANSACTION_MESSAGE('transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS))
26
create_schema_statement {
28
name: "my_test_schema"
29
collation: "utf8_general_ci"
47
Testing simple DROP SCHEMA
48
DROP SCHEMA my_test_schema;
49
Check transaction_log_entries
50
SELECT COUNT(*) FROM DATA_DICTIONARY.TRANSACTION_LOG_ENTRIES;
54
Check transaction_log_transactions
55
SELECT COUNT(*) FROM DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS;
58
Check transaction log contents
59
SELECT PRINT_TRANSACTION_MESSAGE('transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS));
60
PRINT_TRANSACTION_MESSAGE('transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS))
71
drop_schema_statement {
72
schema_name: "my_test_schema"
81
SET GLOBAL transaction_log_truncate_debug= true;
83
Testing DROP SCHEMA on non-empty schema
84
CREATE SCHEMA my_test_schema;
85
CREATE TABLE my_test_schema.t1 (a int not null, primary key(a));
86
CREATE TABLE my_test_schema.t2 LIKE my_test_schema.t1;
87
CREATE TABLE my_test_schema.t3 LIKE my_test_schema.t2;
88
We truncate the log to simplify test validation
89
we are mainly concerned that we see 4 new entries
90
once we have issued the DROP SCHEMA statement
91
SET GLOBAL transaction_log_truncate_debug= true;
93
DROP SCHEMA my_test_schema;
94
The implied DROP TABLE statements for t1->t3
95
do not come in any deterministic order t1 may or may not be first
96
,therefore we have to satisfy ourselves that we have 4 items in the log
97
after issuing the DROP SCHEMA
98
We do check the first entry (OFFSET=0) as this should be the first of 3 DROP TABLE messages
99
SELECT PRINT_TRANSACTION_MESSAGE('transaction.log',0);
100
PRINT_TRANSACTION_MESSAGE('transaction.log',0)
101
transaction_context {
111
drop_table_statement {
113
schema_name: "my_test_schema"
114
table_name: TABLE_NAME
116
if_exists_clause: true
122
Check transaction_log_entries
123
SELECT COUNT(*) FROM DATA_DICTIONARY.TRANSACTION_LOG_ENTRIES;
127
Check transaction_log_transactions
128
SELECT COUNT(*) FROM DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS;
131
Check transaction log contents
132
SELECT PRINT_TRANSACTION_MESSAGE('transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS));
133
PRINT_TRANSACTION_MESSAGE('transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS))
134
transaction_context {
144
drop_schema_statement {
145
schema_name: "my_test_schema"
154
SET GLOBAL transaction_log_truncate_debug= true;
156
Testing simple CREATE SCHEMA
157
CREATE SCHEMA my_test_schema;
159
CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b CHAR(50), PRIMARY KEY(a));
160
ALTER SCHEMA my_test_schema COLLATE utf8_turkish_ci;
161
SHOW CREATE TABLE t1;
163
t1 CREATE TABLE `t1` (
164
`a` INT NOT NULL AUTO_INCREMENT,
165
`b` VARCHAR(50) COLLATE utf8_general_ci DEFAULT NULL,
167
) ENGINE=InnoDB COLLATE = utf8_general_ci
168
Check transaction_log_entries
169
SELECT COUNT(*) FROM DATA_DICTIONARY.TRANSACTION_LOG_ENTRIES;
173
Check transaction_log_transactions
174
SELECT COUNT(*) FROM DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS;
177
Check transaction log contents
178
SELECT PRINT_TRANSACTION_MESSAGE('transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS));
179
PRINT_TRANSACTION_MESSAGE('transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS))
180
transaction_context {
190
alter_schema_statement {
192
name: "my_test_schema"
193
collation: "utf8_general_ci"
204
name: "my_test_schema"
205
collation: "utf8_turkish_ci"
223
CREATE TABLE t2 LIKE t1;
224
Check transaction_log_entries
225
SELECT COUNT(*) FROM DATA_DICTIONARY.TRANSACTION_LOG_ENTRIES;
229
Check transaction_log_transactions
230
SELECT COUNT(*) FROM DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS;
233
Check transaction log contents
234
SELECT PRINT_TRANSACTION_MESSAGE('transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS));
235
PRINT_TRANSACTION_MESSAGE('transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS))
236
transaction_context {
246
create_table_statement {
259
is_autoincrement: true
271
collation: "utf8_general_ci"
288
schema: "my_test_schema"
290
has_user_set_auto_increment_value: false
291
collation: "utf8_general_ci"
308
DROP SCHEMA my_test_schema;
309
SET GLOBAL transaction_log_truncate_debug= true;