Debian Codegraph @

mysql-test/suite/ndbcluster/tablespace_basic.test

raw
1 --source include/have_ndb.inc
2
3 # Create logfile group
4 CREATE LOGFILE GROUP lg1
5 ADD UNDOFILE 'lg1_undofile.dat'
6 INITIAL_SIZE 1M
7 UNDO_BUFFER_SIZE = 1M
8 ENGINE=NDB;
9
10 # Create tablespace using the logfile group
11 CREATE TABLESPACE ts1
12 ADD DATAFILE 'ts1_datafile.dat'
13 USE LOGFILE GROUP lg1
14 INITIAL_SIZE 2M
15 ENGINE NDB;
16
17 # Create table in the tablespace
18 CREATE TABLE t1 (
19 a int PRIMARY KEY,
20 b varchar(255)
21 ) ENGINE = NDB
22 TABLESPACE ts1
23 STORAGE DISK;
24
25 INSERT INTO t1 VALUES (1, "MySQL Server with NDB");
26 SELECT * FROM t1 WHERE a = 1;
27 UPDATE t1 SET b = CONCAT(b, " test") WHERE a = 1;
28 SELECT * FROM t1 WHERE a = 1;
29 REPLACE t1 (a, b) VALUES (1, "Another layer");
30 SELECT * FROM t1 WHERE a = 12 ORDER BY a;
31 DELETE FROM t1 WHERE a = 11;
32 SELECT COUNT(*) FROM t1;
33 SELECT b FROM t1 WHERE b LIKE "MySQL%";
34 DELETE FROM t1 ORDER BY b DESC;
35
36 DROP TABLE t1;
37
38 --echo # Need to implement rename in handlerton::alter_tablespace
39 --error ER_CHECK_NOT_IMPLEMENTED
40 ALTER TABLESPACE ts1 RENAME TO ts2;
41
42 # NOTE! There is a problem with dropping the tablespace
43 # here, it seems like NDB does not allow dropping a
44 # tablespace with datafiles(thus the ALTER ... DROP)
45 # and trying to workaround by dropping the datafile first does not
46 # work either since MySQL Server refuses to drop tablesapce without
47 # datafiles
48 ALTER TABLESPACE ts1
49 DROP DATAFILE 'ts1_datafile.dat';
50
51 DROP TABLESPACE ts1;
52
53 DROP LOGFILE GROUP lg1
54 ENGINE=NDB;
55