Debian Codegraph @

mysql-test/suite/ndb_ddl/create_table_fail.test

raw
1 -- source include/have_ndb.inc
2 -- source include/have_debug.inc
3
4
5 --echo #
6 --echo # Test failure to create NDB_SHARE during CREATE TABLE
7 --echo # - should fail the create table
8 set @save_debug = @@session.debug;
9 SET SESSION debug="+d,ndb_share_create_fail1";
10 --error ER_CANT_CREATE_TABLE
11 CREATE TABLE t1(
12 id INT PRIMARY KEY,
13 val INT
14 )
15 ENGINE=ndbcluster;
16 SHOW WARNINGS;
17 SET SESSION debug=@save_debug;
18
19 --echo # - check that table can be created, this also checks
20 --echo # that the above failed create properly removed the
21 --echo # table from NDB as well.
22 CREATE TABLE t1(
23 id INT PRIMARY KEY,
24 val INT
25 )
26 ENGINE=ndbcluster;
27
28 --echo # - cleanup and remove the table
29 DROP TABLE t1;
30
31
32 --echo #
33 --echo # Test failure to open the NDB table during create.
34 --echo # NOTE! This is very unlikely and should only
35 --echo # happen at cluster failure.
36 SET SESSION debug="+d,ndb_create_open_fail";
37 --error ER_CANT_CREATE_TABLE
38 CREATE TABLE t1(a int primary key) engine = NDB;
39 SHOW WARNINGS;
40 SET SESSION debug=@save_debug;
41
42 --echo # Check that table does not exist
43 --error ER_NO_SUCH_TABLE
44 SELECT * FROM t1;