set storage_engine=ndb;
CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
INITIAL_SIZE 4M
UNDO_BUFFER_SIZE = 1M;
set storage_engine=myisam;
CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'
USE LOGFILE GROUP lg1
INITIAL_SIZE 4M
ENGINE NDB;
CREATE TABLE t1
(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
TABLESPACE ts1 STORAGE DISK
ENGINE=NDB;
SHOW CREATE TABLE t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `pk1` int(11) NOT NULL,
  `b` int(11) NOT NULL,
  `c` int(11) NOT NULL,
  PRIMARY KEY (`pk1`)
) /*!50100 TABLESPACE `ts1` STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (0, 0, 0);
SELECT * FROM t1;
pk1	b	c
0	0	0
INSERT INTO t1 VALUES 
(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5);
SELECT COUNT(*) FROM t1;
COUNT(*)
6
SELECT * FROM INFORMATION_SCHEMA.TABLESPACES WHERE ENGINE='NDBCLUSTER';
TABLESPACE_NAME	ENGINE	TABLESPACE_TYPE	LOGFILE_GROUP_NAME	EXTENT_SIZE	AUTOEXTEND_SIZE	MAXIMUM_SIZE	NODEGROUP_ID	TABLESPACE_COMMENT
ts1	NDBCLUSTER	NULL	lg1	1048576	NULL	NULL	NULL	#
drop table t1;
CREATE TABLESPACE ts2
ADD DATAFILE 'ts2_datafile.dat'
USE LOGFILE GROUP lg1
INITIAL_SIZE 4M
ENGINE NDB;
SELECT * FROM INFORMATION_SCHEMA.TABLESPACES WHERE ENGINE='NDBCLUSTER';
TABLESPACE_NAME	ENGINE	TABLESPACE_TYPE	LOGFILE_GROUP_NAME	EXTENT_SIZE	AUTOEXTEND_SIZE	MAXIMUM_SIZE	NODEGROUP_ID	TABLESPACE_COMMENT
ts1	NDBCLUSTER	NULL	lg1	1048576	NULL	NULL	NULL	#
ts2	NDBCLUSTER	NULL	lg1	1048576	NULL	NULL	NULL	#
ALTER TABLESPACE ts1 
DROP DATAFILE 'datafile.dat' 
ENGINE = NDB;
SELECT * FROM INFORMATION_SCHEMA.TABLESPACES WHERE ENGINE='NDBCLUSTER';
TABLESPACE_NAME	ENGINE	TABLESPACE_TYPE	LOGFILE_GROUP_NAME	EXTENT_SIZE	AUTOEXTEND_SIZE	MAXIMUM_SIZE	NODEGROUP_ID	TABLESPACE_COMMENT
ts1	NDBCLUSTER	NULL	lg1	1048576	NULL	NULL	NULL	#
ts2	NDBCLUSTER	NULL	lg1	1048576	NULL	NULL	NULL	#
ALTER TABLESPACE ts2
DROP DATAFILE 'ts2_datafile.dat' 
ENGINE = NDB;
SELECT * FROM INFORMATION_SCHEMA.TABLESPACES WHERE ENGINE='NDBCLUSTER';
TABLESPACE_NAME	ENGINE	TABLESPACE_TYPE	LOGFILE_GROUP_NAME	EXTENT_SIZE	AUTOEXTEND_SIZE	MAXIMUM_SIZE	NODEGROUP_ID	TABLESPACE_COMMENT
ts1	NDBCLUSTER	NULL	lg1	1048576	NULL	NULL	NULL	#
ts2	NDBCLUSTER	NULL	lg1	1048576	NULL	NULL	NULL	#
DROP TABLESPACE ts1 
ENGINE = NDB;
SELECT * FROM INFORMATION_SCHEMA.TABLESPACES WHERE ENGINE='NDBCLUSTER';
TABLESPACE_NAME	ENGINE	TABLESPACE_TYPE	LOGFILE_GROUP_NAME	EXTENT_SIZE	AUTOEXTEND_SIZE	MAXIMUM_SIZE	NODEGROUP_ID	TABLESPACE_COMMENT
ts2	NDBCLUSTER	NULL	lg1	1048576	NULL	NULL	NULL	#
DROP TABLESPACE ts2
ENGINE = NDB;
SELECT * FROM INFORMATION_SCHEMA.TABLESPACES WHERE ENGINE='NDBCLUSTER';
TABLESPACE_NAME	ENGINE	TABLESPACE_TYPE	LOGFILE_GROUP_NAME	EXTENT_SIZE	AUTOEXTEND_SIZE	MAXIMUM_SIZE	NODEGROUP_ID	TABLESPACE_COMMENT
DROP LOGFILE GROUP lg1 
ENGINE =NDB;
