Debian Codegraph @

mysql-test/suite/ndb/t/ndb_database.test

raw
1 -- source include/have_multi_ndb.inc
2
3 #
4 # Check that all tables in a database are dropped when database is dropped
5 #
6
7 create database mysqltest;
8 create table mysqltest.t1 (a int primary key, b int) engine=ndb;
9 use mysqltest;
10 show tables;
11
12 drop database mysqltest;
13 create database mysqltest;
14 use mysqltest;
15 show tables;
16
17 drop database mysqltest;
18
19 # End of 4.1 tests
20
21 #
22 # bug#52225 - special characters in database name
23 #
24 create database `mysqltest.db`;
25 create table `mysqltest.db`.t1 (a int primary key, b int) engine=ndb;
26 alter table `mysqltest.db`.t1 algorithm=copy, add column c int;
27 alter table `mysqltest.db`.t1 algorithm=inplace, add column d int column_format dynamic;
28 drop table `mysqltest.db`.t1;
29 drop database `mysqltest.db`;
30 #
31 # bug# 54788 DROP DATABASE can remove hidden blob tables without removing parent tables
32 #
33 # Dropping a database on a server where Ndb tables with Blobs were
34 # 'shadowed' by a local table can result in Blob part tables being
35 # deleted, but the main table not being deleted.
36 #
37
38 --connection server1
39 # Create database with occluding table t1
40 create database newdb;
41 create table newdb.t1 (a int primary key) engine=innodb;
42
43 # Supress errors provoked by the "shadow table"
44 --disable_query_log
45 call mtr.add_suppression("Local table 'newdb.t1' .* shadows");
46 call mtr.add_suppression("Failed to update table definition");
47 call mtr.add_suppression("Distribution of CREATE TABLE");
48 --enable_query_log
49
50 --connection server2
51 # Create NDB table with blobs, lots of blobs to increase the probability that
52 # Ndb-list-objects returns a blob part table before the main table.
53 # NOTE! The create table works on this mysqld but fails on first mysqld which
54 # has a "shadow table"
55 --replace_regex /Node [0-9]+:/Node <nodeid>/
56 create table newdb.t1 (a int primary key,
57 b1 blob,
58 b2 blob,
59 b3 blob,
60 b4 blob,
61 b5 blob,
62 b6 blob,
63 b7 blob,
64 b8 blob,
65 b9 blob,
66 b10 blob,
67 b11 blob,
68 b12 blob,
69 b13 blob,
70 b14 blob,
71 b15 blob,
72 b16 blob,
73 b17 blob,
74 b18 blob,
75 b19 blob,
76 b20 blob,
77 b21 blob,
78 b22 blob,
79 b23 blob,
80 b24 blob,
81 b25 blob,
82 b26 blob,
83 b27 blob,
84 b28 blob,
85 b29 blob) engine = ndb;
86
87 --connection server1
88 drop database newdb;
89
90 --connection server2
91 # Now check that the table is gone
92 create database newdb;
93 use newdb;
94 show tables;
95
96 # Check that we can reuse the table name etc.
97 create table newdb.t1(a int primary key) engine=ndb;
98 show tables;
99 drop table t1;
100 drop database newdb;