#
# WL7943 Implement INFORMATION_SCHEMA.FILES
#
SET default_storage_engine=InnoDB;
CREATE TABLE t1 (a serial, b text, c text);
==I_S.FILES==	==I_S.FILES==
FILE_ID	0
TABLESPACE_NAME	innodb_system
FILE_NAME	MYSQLD_DATADIR/ibdata1
FILE_TYPE	TABLESPACE
STATUS	NORMAL
ENGINE	InnoDB
EXTENT_SIZE	2097152
MAXIMUM_SIZE	NULL
AUTOEXTEND_SIZE	67108864
==I_S.FILES==	==I_S.FILES==
FILE_ID	1
TABLESPACE_NAME	innodb_undo001
FILE_NAME	MYSQLD_DATADIR//undo001
FILE_TYPE	UNDO LOG
STATUS	NORMAL
ENGINE	InnoDB
EXTENT_SIZE	2097152
MAXIMUM_SIZE	NULL
==I_S.FILES==	==I_S.FILES==
FILE_ID	2
TABLESPACE_NAME	innodb_undo002
FILE_NAME	MYSQLD_DATADIR//undo002
FILE_TYPE	UNDO LOG
STATUS	NORMAL
ENGINE	InnoDB
EXTENT_SIZE	2097152
MAXIMUM_SIZE	NULL
==I_S.FILES==	==I_S.FILES==
TABLESPACE_NAME	innodb_temporary
FILE_NAME	MYSQLD_DATADIR/ibtmp1
FILE_TYPE	TEMPORARY
STATUS	NORMAL
ENGINE	InnoDB
EXTENT_SIZE	2097152
INITIAL_SIZE	12582912
MAXIMUM_SIZE	NULL
AUTOEXTEND_SIZE	67108864
==I_S.FILES==	==I_S.FILES==
TABLESPACE_NAME	innodb_file_per_table_##
FILE_NAME	MYSQLD_DATADIR/test/t1.ibd
FILE_TYPE	TABLESPACE
STATUS	NORMAL
ENGINE	InnoDB
DATA_FREE	0
FREE_EXTENTS	0
TOTAL_EXTENTS	0
EXTENT_SIZE	2097152
INITIAL_SIZE	131072
MAXIMUM_SIZE	NULL
AUTOEXTEND_SIZE	2097152
#
# Populate t1 with about 3MB of data
#
CREATE PROCEDURE populate_t1()
BEGIN
DECLARE i INT DEFAULT 1;
while (i <= 6000) DO
INSERT INTO t1 (b,c) VALUES (repeat('b', 250), repeat('c', 250));
SET i = i + 1;
END WHILE;
END |
BEGIN;
CALL populate_t1();
FLUSH TABLE t1;
==I_S.FILES==	==I_S.FILES==
TABLESPACE_NAME	innodb_file_per_table_##
FILE_NAME	MYSQLD_DATADIR/test/t1.ibd
FILE_TYPE	TABLESPACE
STATUS	NORMAL
ENGINE	InnoDB
DATA_FREE	8388608
FREE_EXTENTS	3
TOTAL_EXTENTS	10
EXTENT_SIZE	2097152
INITIAL_SIZE	131072
MAXIMUM_SIZE	NULL
AUTOEXTEND_SIZE	2097152
#
# Populate t1 with another 3MB of data
#
CALL populate_t1();
FLUSH TABLE t1;
==I_S.FILES==	==I_S.FILES==
TABLESPACE_NAME	innodb_file_per_table_##
FILE_NAME	MYSQLD_DATADIR/test/t1.ibd
FILE_TYPE	TABLESPACE
STATUS	NORMAL
ENGINE	InnoDB
DATA_FREE	8388608
FREE_EXTENTS	2
TOTAL_EXTENTS	11
EXTENT_SIZE	2097152
INITIAL_SIZE	131072
MAXIMUM_SIZE	NULL
AUTOEXTEND_SIZE	2097152
#
# Delete the half of the records.
#
DELETE FROM t1 WHERE a % 2 = 1;
FLUSH TABLE t1;
==I_S.FILES==	==I_S.FILES==
TABLESPACE_NAME	innodb_file_per_table_##
FILE_NAME	MYSQLD_DATADIR/test/t1.ibd
FILE_TYPE	TABLESPACE
STATUS	NORMAL
ENGINE	InnoDB
DATA_FREE	8388608
FREE_EXTENTS	2
TOTAL_EXTENTS	11
EXTENT_SIZE	2097152
INITIAL_SIZE	131072
MAXIMUM_SIZE	NULL
AUTOEXTEND_SIZE	2097152
#
# Cleanup
#
DROP TABLE t1;
DROP PROCEDURE populate_t1;
