SET @@storage_engine = 'Falcon';
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
CREATE TABLE t1 (
a_int       INT                 NOT NULL AUTO_INCREMENT PRIMARY KEY, 
a_tinyint   TINYINT,
a_bigint    BIGINT,
a_float     FLOAT,
a_double    DOUBLE,
a_decimal   DECIMAL(10,2),
a_date      DATE,
a_time      TIME,
a_datetime  DATETIME,
a_timestamp TIMESTAMP           NOT NULL DEFAULT 0,
a_year      YEAR,
a_char      CHAR(10),
a_varchar   VARCHAR(255),
a_binary    BINARY(8),
a_varbinary VARBINARY(255),
a_enum      ENUM('enumValueOne', 'enumValueTwo', 'enumValueThree')
);
SHOW CREATE TABLE t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a_int` int(11) NOT NULL AUTO_INCREMENT,
  `a_tinyint` tinyint(4) DEFAULT NULL,
  `a_bigint` bigint(20) DEFAULT NULL,
  `a_float` float DEFAULT NULL,
  `a_double` double DEFAULT NULL,
  `a_decimal` decimal(10,2) DEFAULT NULL,
  `a_date` date DEFAULT NULL,
  `a_time` time DEFAULT NULL,
  `a_datetime` datetime DEFAULT NULL,
  `a_timestamp` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `a_year` year(4) DEFAULT NULL,
  `a_char` char(10) DEFAULT NULL,
  `a_varchar` varchar(255) DEFAULT NULL,
  `a_binary` binary(8) DEFAULT NULL,
  `a_varbinary` varbinary(255) DEFAULT NULL,
  `a_enum` enum('enumValueOne','enumValueTwo','enumValueThree') DEFAULT NULL,
  PRIMARY KEY (`a_int`)
) ENGINE=Falcon DEFAULT CHARSET=latin1
CREATE TABLE t2 (
a_int       INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
a_bit       BIT(8));
SHOW CREATE TABLE t2;
Table	Create Table
t2	CREATE TABLE `t2` (
  `a_int` int(11) NOT NULL AUTO_INCREMENT,
  `a_bit` bit(8) DEFAULT NULL,
  PRIMARY KEY (`a_int`)
) ENGINE=Falcon DEFAULT CHARSET=latin1
INSERT INTO t1 (
a_tinyint, a_bigint, 
a_float, a_double, a_decimal, a_date,
a_time, a_datetime, a_timestamp, a_year,
a_char, a_varchar, a_binary, a_varbinary,
a_enum) 
VALUES 
(
127, 9223372036854775807,
999.99, 999.123456789, 111.99, '2008-07-09', 
'11:30:00', '2008-07-09 11:30:00', '2008-07-09 11:30:00', '2008',
'aTestChar', 'aTestVarChar', 'aTestBin', 'aTestVarBinary', 
'enumValueOne'
    ),
(
126, 9223372036854775806,
998.88, 999.234567891, 112.00, '2008-07-10', 
'12:30:10', '2008-07-10 12:30:10', '2008-07-10 12:30:10', '2009',
'bTestChar', 'bTestVarChar', 'bTestBin', 'bTestVarBinary', 
'enumValueTwo'
    ),
(
125, 9223372036854775805,
997.77, 999.345678912, 112.01, '2008-07-11', 
'13:30:20', '2008-07-11 13:30:20', '2008-07-11 13:30:20', '2010',
'cTestChar', 'cTestVarChar', 'cTestBin', 'cTestVarBinary', 
'enumValueThree'
    ),
(
124, 9223372036854775804,
996.66, 999.456789123, 112.02, '2008-07-12', 
'14:30:30', '2008-07-12 14:30:30', '2008-07-12 14:30:30', '2011',
'dTestChar', 'dTestVarChar', 'dTestBin', 'dTestVarBinary', 
'enumValueOne'
    ),
(
123, 9223372036854775803,
995.55, 999.567891234, 112.03, '2008-07-13', 
'15:30:40', '2008-07-13 15:30:40', '2008-07-13 15:30:40', '2012',
'eTestChar', 'eTestVarChar', 'eTestBin', 'eTestVarBinary', 
'enumValueTwo'
    );
INSERT INTO t2 (a_bit) VALUES (b'0'), (b'1'), (b'10'), (b'11'), (b'100');
SELECT * FROM t1;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
3	125	9223372036854775805	997.77	999.345678912	112.01	2008-07-11	13:30:20	2008-07-11 13:30:20	2008-07-11 13:30:20	2010	cTestChar	cTestVarChar	cTestBin	cTestVarBinary	enumValueThree
4	124	9223372036854775804	996.66	999.456789123	112.02	2008-07-12	14:30:30	2008-07-12 14:30:30	2008-07-12 14:30:30	2011	dTestChar	dTestVarChar	dTestBin	dTestVarBinary	enumValueOne
5	123	9223372036854775803	995.55	999.567891234	112.03	2008-07-13	15:30:40	2008-07-13 15:30:40	2008-07-13 15:30:40	2012	eTestChar	eTestVarChar	eTestBin	eTestVarBinary	enumValueTwo
SELECT a_int, BIN(a_bit+0) FROM t2;
a_int	BIN(a_bit+0)
1	0
2	1
3	10
4	11
5	100
#-------- Test: BIT --------#
ALTER TABLE t2 ADD INDEX index_bit (a_bit);
SHOW INDEXES FROM t2;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t2	0	PRIMARY	1	a_int	NULL	2	NULL	NULL		BTREE		
t2	1	index_bit	1	a_bit	NULL	2	NULL	NULL	YES	BTREE		
INSERT INTO t2 SET a_bit = b'11111';
UPDATE t2 SET a_bit = b'101010' where a_int > b'101';
SELECT a_int, BIN(a_bit+0) FROM t2;
a_int	BIN(a_bit+0)
1	0
2	1
3	10
4	11
5	100
6	101010
SELECT a_int, BIN(a_bit+0) FROM t2 WHERE a_bit > b'1' LIMIT 1;
a_int	BIN(a_bit+0)
3	10
ALTER TABLE t2 DROP INDEX index_bit;
SHOW INDEXES FROM t2;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t2	0	PRIMARY	1	a_int	NULL	3	NULL	NULL		BTREE		
SELECT a_int, BIN(a_bit+0) FROM t2;
a_int	BIN(a_bit+0)
1	0
2	1
3	10
4	11
5	100
6	101010
#-------- Test: TINYINT --------#
ALTER TABLE t1 ADD INDEX index_tinyint (a_tinyint);
SHOW INDEXES FROM t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t1	0	PRIMARY	1	a_int	NULL	2	NULL	NULL		BTREE		
t1	1	index_tinyint	1	a_tinyint	NULL	2	NULL	NULL	YES	BTREE		
INSERT INTO t1 SET a_tinyint = 99;
UPDATE t1 SET a_tinyint = 88 where a_tinyint = 99;
SELECT * FROM t1 ORDER BY a_tinyint;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
6	88	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
5	123	9223372036854775803	995.55	999.567891234	112.03	2008-07-13	15:30:40	2008-07-13 15:30:40	2008-07-13 15:30:40	2012	eTestChar	eTestVarChar	eTestBin	eTestVarBinary	enumValueTwo
4	124	9223372036854775804	996.66	999.456789123	112.02	2008-07-12	14:30:30	2008-07-12 14:30:30	2008-07-12 14:30:30	2011	dTestChar	dTestVarChar	dTestBin	dTestVarBinary	enumValueOne
3	125	9223372036854775805	997.77	999.345678912	112.01	2008-07-11	13:30:20	2008-07-11 13:30:20	2008-07-11 13:30:20	2010	cTestChar	cTestVarChar	cTestBin	cTestVarBinary	enumValueThree
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
SELECT * FROM t1 WHERE a_tinyint > 1 LIMIT 1;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
ALTER TABLE t1 DROP INDEX index_tinyint;
SHOW INDEXES FROM t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t1	0	PRIMARY	1	a_int	NULL	3	NULL	NULL		BTREE		
SELECT * FROM t1;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
3	125	9223372036854775805	997.77	999.345678912	112.01	2008-07-11	13:30:20	2008-07-11 13:30:20	2008-07-11 13:30:20	2010	cTestChar	cTestVarChar	cTestBin	cTestVarBinary	enumValueThree
4	124	9223372036854775804	996.66	999.456789123	112.02	2008-07-12	14:30:30	2008-07-12 14:30:30	2008-07-12 14:30:30	2011	dTestChar	dTestVarChar	dTestBin	dTestVarBinary	enumValueOne
5	123	9223372036854775803	995.55	999.567891234	112.03	2008-07-13	15:30:40	2008-07-13 15:30:40	2008-07-13 15:30:40	2012	eTestChar	eTestVarChar	eTestBin	eTestVarBinary	enumValueTwo
6	88	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
#-------- Test: BIGINT --------#
ALTER TABLE t1 ADD INDEX index_bigint (a_bigint);
SHOW INDEXES FROM t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t1	0	PRIMARY	1	a_int	NULL	3	NULL	NULL		BTREE		
t1	1	index_bigint	1	a_bigint	NULL	3	NULL	NULL	YES	BTREE		
INSERT INTO t1 SET a_bigint = 9223372036854775804;
UPDATE t1 SET a_bigint = 911111111111111111 where a_bigint = 9223372036854775804;
SELECT * FROM t1 ORDER BY a_bigint;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
6	88	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
4	124	911111111111111111	996.66	999.456789123	112.02	2008-07-12	14:30:30	2008-07-12 14:30:30	2008-07-12 14:30:30	2011	dTestChar	dTestVarChar	dTestBin	dTestVarBinary	enumValueOne
7	NULL	911111111111111111	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
5	123	9223372036854775803	995.55	999.567891234	112.03	2008-07-13	15:30:40	2008-07-13 15:30:40	2008-07-13 15:30:40	2012	eTestChar	eTestVarChar	eTestBin	eTestVarBinary	enumValueTwo
3	125	9223372036854775805	997.77	999.345678912	112.01	2008-07-11	13:30:20	2008-07-11 13:30:20	2008-07-11 13:30:20	2010	cTestChar	cTestVarChar	cTestBin	cTestVarBinary	enumValueThree
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
SELECT * FROM t1 WHERE a_bigint > 1 LIMIT 1;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
ALTER TABLE t1 DROP INDEX index_bigint;
SHOW INDEXES FROM t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t1	0	PRIMARY	1	a_int	NULL	3	NULL	NULL		BTREE		
SELECT * FROM t1;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
3	125	9223372036854775805	997.77	999.345678912	112.01	2008-07-11	13:30:20	2008-07-11 13:30:20	2008-07-11 13:30:20	2010	cTestChar	cTestVarChar	cTestBin	cTestVarBinary	enumValueThree
4	124	911111111111111111	996.66	999.456789123	112.02	2008-07-12	14:30:30	2008-07-12 14:30:30	2008-07-12 14:30:30	2011	dTestChar	dTestVarChar	dTestBin	dTestVarBinary	enumValueOne
5	123	9223372036854775803	995.55	999.567891234	112.03	2008-07-13	15:30:40	2008-07-13 15:30:40	2008-07-13 15:30:40	2012	eTestChar	eTestVarChar	eTestBin	eTestVarBinary	enumValueTwo
6	88	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
7	NULL	911111111111111111	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
#-------- Test: FLOAT --------#
ALTER TABLE t1 ADD INDEX index_float (a_float);
SHOW INDEXES FROM t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t1	0	PRIMARY	1	a_int	NULL	3	NULL	NULL		BTREE		
t1	1	index_float	1	a_float	NULL	3	NULL	NULL	YES	BTREE		
INSERT INTO t1 SET a_float = 994.44;
UPDATE t1 SET a_float = 993.33 where a_float > 994 AND a_float < 994.5;
SELECT * FROM t1 ORDER BY a_float;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
6	88	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
7	NULL	911111111111111111	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
8	NULL	NULL	993.33	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
5	123	9223372036854775803	995.55	999.567891234	112.03	2008-07-13	15:30:40	2008-07-13 15:30:40	2008-07-13 15:30:40	2012	eTestChar	eTestVarChar	eTestBin	eTestVarBinary	enumValueTwo
4	124	911111111111111111	996.66	999.456789123	112.02	2008-07-12	14:30:30	2008-07-12 14:30:30	2008-07-12 14:30:30	2011	dTestChar	dTestVarChar	dTestBin	dTestVarBinary	enumValueOne
3	125	9223372036854775805	997.77	999.345678912	112.01	2008-07-11	13:30:20	2008-07-11 13:30:20	2008-07-11 13:30:20	2010	cTestChar	cTestVarChar	cTestBin	cTestVarBinary	enumValueThree
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
SELECT * FROM t1 WHERE a_float > 1 LIMIT 1;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
ALTER TABLE t1 DROP INDEX index_float;
SHOW INDEXES FROM t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t1	0	PRIMARY	1	a_int	NULL	4	NULL	NULL		BTREE		
SELECT * FROM t1;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
3	125	9223372036854775805	997.77	999.345678912	112.01	2008-07-11	13:30:20	2008-07-11 13:30:20	2008-07-11 13:30:20	2010	cTestChar	cTestVarChar	cTestBin	cTestVarBinary	enumValueThree
4	124	911111111111111111	996.66	999.456789123	112.02	2008-07-12	14:30:30	2008-07-12 14:30:30	2008-07-12 14:30:30	2011	dTestChar	dTestVarChar	dTestBin	dTestVarBinary	enumValueOne
5	123	9223372036854775803	995.55	999.567891234	112.03	2008-07-13	15:30:40	2008-07-13 15:30:40	2008-07-13 15:30:40	2012	eTestChar	eTestVarChar	eTestBin	eTestVarBinary	enumValueTwo
6	88	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
7	NULL	911111111111111111	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
8	NULL	NULL	993.33	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
#-------- Test: DOUBLE --------#
ALTER TABLE t1 ADD INDEX index_double (a_double);
SHOW INDEXES FROM t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t1	0	PRIMARY	1	a_int	NULL	4	NULL	NULL		BTREE		
t1	1	index_double	1	a_double	NULL	4	NULL	NULL	YES	BTREE		
INSERT INTO t1 SET a_double = 999.678912345;
UPDATE t1 SET a_double = 999.998877665 where a_double = 999.678912345;
SELECT * FROM t1 ORDER BY a_double;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
6	88	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
7	NULL	911111111111111111	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
8	NULL	NULL	993.33	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
3	125	9223372036854775805	997.77	999.345678912	112.01	2008-07-11	13:30:20	2008-07-11 13:30:20	2008-07-11 13:30:20	2010	cTestChar	cTestVarChar	cTestBin	cTestVarBinary	enumValueThree
4	124	911111111111111111	996.66	999.456789123	112.02	2008-07-12	14:30:30	2008-07-12 14:30:30	2008-07-12 14:30:30	2011	dTestChar	dTestVarChar	dTestBin	dTestVarBinary	enumValueOne
5	123	9223372036854775803	995.55	999.567891234	112.03	2008-07-13	15:30:40	2008-07-13 15:30:40	2008-07-13 15:30:40	2012	eTestChar	eTestVarChar	eTestBin	eTestVarBinary	enumValueTwo
9	NULL	NULL	NULL	999.998877665	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
SELECT * FROM t1 WHERE a_double > 1 LIMIT 1;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
ALTER TABLE t1 DROP INDEX index_double;
SHOW INDEXES FROM t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t1	0	PRIMARY	1	a_int	NULL	4	NULL	NULL		BTREE		
SELECT * FROM t1;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
3	125	9223372036854775805	997.77	999.345678912	112.01	2008-07-11	13:30:20	2008-07-11 13:30:20	2008-07-11 13:30:20	2010	cTestChar	cTestVarChar	cTestBin	cTestVarBinary	enumValueThree
4	124	911111111111111111	996.66	999.456789123	112.02	2008-07-12	14:30:30	2008-07-12 14:30:30	2008-07-12 14:30:30	2011	dTestChar	dTestVarChar	dTestBin	dTestVarBinary	enumValueOne
5	123	9223372036854775803	995.55	999.567891234	112.03	2008-07-13	15:30:40	2008-07-13 15:30:40	2008-07-13 15:30:40	2012	eTestChar	eTestVarChar	eTestBin	eTestVarBinary	enumValueTwo
6	88	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
7	NULL	911111111111111111	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
8	NULL	NULL	993.33	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
9	NULL	NULL	NULL	999.998877665	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
#-------- Test: DECIMAL --------#
ALTER TABLE t1 ADD INDEX index_decimal (a_decimal);
SHOW INDEXES FROM t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t1	0	PRIMARY	1	a_int	NULL	4	NULL	NULL		BTREE		
t1	1	index_decimal	1	a_decimal	NULL	4	NULL	NULL	YES	BTREE		
INSERT INTO t1 SET a_decimal = 112.04;
UPDATE t1 SET a_decimal = 112.05 where a_decimal = 112.04;
SELECT * FROM t1 ORDER BY a_decimal;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
6	88	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
9	NULL	NULL	NULL	999.998877665	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
8	NULL	NULL	993.33	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
7	NULL	911111111111111111	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
3	125	9223372036854775805	997.77	999.345678912	112.01	2008-07-11	13:30:20	2008-07-11 13:30:20	2008-07-11 13:30:20	2010	cTestChar	cTestVarChar	cTestBin	cTestVarBinary	enumValueThree
4	124	911111111111111111	996.66	999.456789123	112.02	2008-07-12	14:30:30	2008-07-12 14:30:30	2008-07-12 14:30:30	2011	dTestChar	dTestVarChar	dTestBin	dTestVarBinary	enumValueOne
5	123	9223372036854775803	995.55	999.567891234	112.03	2008-07-13	15:30:40	2008-07-13 15:30:40	2008-07-13 15:30:40	2012	eTestChar	eTestVarChar	eTestBin	eTestVarBinary	enumValueTwo
10	NULL	NULL	NULL	NULL	112.05	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
SELECT * FROM t1 WHERE a_decimal > 1 LIMIT 1;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
ALTER TABLE t1 DROP INDEX index_decimal;
SHOW INDEXES FROM t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t1	0	PRIMARY	1	a_int	NULL	5	NULL	NULL		BTREE		
SELECT * FROM t1;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
3	125	9223372036854775805	997.77	999.345678912	112.01	2008-07-11	13:30:20	2008-07-11 13:30:20	2008-07-11 13:30:20	2010	cTestChar	cTestVarChar	cTestBin	cTestVarBinary	enumValueThree
4	124	911111111111111111	996.66	999.456789123	112.02	2008-07-12	14:30:30	2008-07-12 14:30:30	2008-07-12 14:30:30	2011	dTestChar	dTestVarChar	dTestBin	dTestVarBinary	enumValueOne
5	123	9223372036854775803	995.55	999.567891234	112.03	2008-07-13	15:30:40	2008-07-13 15:30:40	2008-07-13 15:30:40	2012	eTestChar	eTestVarChar	eTestBin	eTestVarBinary	enumValueTwo
6	88	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
7	NULL	911111111111111111	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
8	NULL	NULL	993.33	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
9	NULL	NULL	NULL	999.998877665	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
10	NULL	NULL	NULL	NULL	112.05	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
#-------- Test: DATE --------#
ALTER TABLE t1 ADD INDEX index_date (a_date);
SHOW INDEXES FROM t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t1	0	PRIMARY	1	a_int	NULL	5	NULL	NULL		BTREE		
t1	1	index_date	1	a_date	NULL	5	NULL	NULL	YES	BTREE		
INSERT INTO t1 SET a_date = '2008-07-14';
UPDATE t1 SET a_date = '2008-08-14' where a_date = '2008-07-14';
SELECT * FROM t1 ORDER BY a_date;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
6	88	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
10	NULL	NULL	NULL	NULL	112.05	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
9	NULL	NULL	NULL	999.998877665	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
8	NULL	NULL	993.33	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
7	NULL	911111111111111111	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
3	125	9223372036854775805	997.77	999.345678912	112.01	2008-07-11	13:30:20	2008-07-11 13:30:20	2008-07-11 13:30:20	2010	cTestChar	cTestVarChar	cTestBin	cTestVarBinary	enumValueThree
4	124	911111111111111111	996.66	999.456789123	112.02	2008-07-12	14:30:30	2008-07-12 14:30:30	2008-07-12 14:30:30	2011	dTestChar	dTestVarChar	dTestBin	dTestVarBinary	enumValueOne
5	123	9223372036854775803	995.55	999.567891234	112.03	2008-07-13	15:30:40	2008-07-13 15:30:40	2008-07-13 15:30:40	2012	eTestChar	eTestVarChar	eTestBin	eTestVarBinary	enumValueTwo
11	NULL	NULL	NULL	NULL	NULL	2008-08-14	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
SELECT * FROM t1 WHERE a_date > '2008-01-01' LIMIT 1;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
ALTER TABLE t1 DROP INDEX index_date;
SHOW INDEXES FROM t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t1	0	PRIMARY	1	a_int	NULL	5	NULL	NULL		BTREE		
SELECT * FROM t1;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
3	125	9223372036854775805	997.77	999.345678912	112.01	2008-07-11	13:30:20	2008-07-11 13:30:20	2008-07-11 13:30:20	2010	cTestChar	cTestVarChar	cTestBin	cTestVarBinary	enumValueThree
4	124	911111111111111111	996.66	999.456789123	112.02	2008-07-12	14:30:30	2008-07-12 14:30:30	2008-07-12 14:30:30	2011	dTestChar	dTestVarChar	dTestBin	dTestVarBinary	enumValueOne
5	123	9223372036854775803	995.55	999.567891234	112.03	2008-07-13	15:30:40	2008-07-13 15:30:40	2008-07-13 15:30:40	2012	eTestChar	eTestVarChar	eTestBin	eTestVarBinary	enumValueTwo
6	88	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
7	NULL	911111111111111111	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
8	NULL	NULL	993.33	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
9	NULL	NULL	NULL	999.998877665	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
10	NULL	NULL	NULL	NULL	112.05	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
11	NULL	NULL	NULL	NULL	NULL	2008-08-14	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
#-------- Test: TIME --------#
ALTER TABLE t1 ADD INDEX index_time (a_time);
SHOW INDEXES FROM t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t1	0	PRIMARY	1	a_int	NULL	5	NULL	NULL		BTREE		
t1	1	index_time	1	a_time	NULL	5	NULL	NULL	YES	BTREE		
INSERT INTO t1 SET a_time = '16:30:50';
UPDATE t1 SET a_time = '17:31:00' where a_time = '16:30:50';
SELECT * FROM t1 ORDER BY a_time;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
7	NULL	911111111111111111	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
11	NULL	NULL	NULL	NULL	NULL	2008-08-14	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
10	NULL	NULL	NULL	NULL	112.05	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
9	NULL	NULL	NULL	999.998877665	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
8	NULL	NULL	993.33	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
6	88	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
3	125	9223372036854775805	997.77	999.345678912	112.01	2008-07-11	13:30:20	2008-07-11 13:30:20	2008-07-11 13:30:20	2010	cTestChar	cTestVarChar	cTestBin	cTestVarBinary	enumValueThree
4	124	911111111111111111	996.66	999.456789123	112.02	2008-07-12	14:30:30	2008-07-12 14:30:30	2008-07-12 14:30:30	2011	dTestChar	dTestVarChar	dTestBin	dTestVarBinary	enumValueOne
5	123	9223372036854775803	995.55	999.567891234	112.03	2008-07-13	15:30:40	2008-07-13 15:30:40	2008-07-13 15:30:40	2012	eTestChar	eTestVarChar	eTestBin	eTestVarBinary	enumValueTwo
12	NULL	NULL	NULL	NULL	NULL	NULL	17:31:00	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
SELECT * FROM t1 WHERE a_time > '11:00:00' LIMIT 1;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
ALTER TABLE t1 DROP INDEX index_time;
SHOW INDEXES FROM t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t1	0	PRIMARY	1	a_int	NULL	6	NULL	NULL		BTREE		
SELECT * FROM t1;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
3	125	9223372036854775805	997.77	999.345678912	112.01	2008-07-11	13:30:20	2008-07-11 13:30:20	2008-07-11 13:30:20	2010	cTestChar	cTestVarChar	cTestBin	cTestVarBinary	enumValueThree
4	124	911111111111111111	996.66	999.456789123	112.02	2008-07-12	14:30:30	2008-07-12 14:30:30	2008-07-12 14:30:30	2011	dTestChar	dTestVarChar	dTestBin	dTestVarBinary	enumValueOne
5	123	9223372036854775803	995.55	999.567891234	112.03	2008-07-13	15:30:40	2008-07-13 15:30:40	2008-07-13 15:30:40	2012	eTestChar	eTestVarChar	eTestBin	eTestVarBinary	enumValueTwo
6	88	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
7	NULL	911111111111111111	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
8	NULL	NULL	993.33	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
9	NULL	NULL	NULL	999.998877665	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
10	NULL	NULL	NULL	NULL	112.05	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
11	NULL	NULL	NULL	NULL	NULL	2008-08-14	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
12	NULL	NULL	NULL	NULL	NULL	NULL	17:31:00	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
#-------- Test: DATETIME --------#
ALTER TABLE t1 ADD INDEX index_datetime (a_datetime);
SHOW INDEXES FROM t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t1	0	PRIMARY	1	a_int	NULL	6	NULL	NULL		BTREE		
t1	1	index_datetime	1	a_datetime	NULL	6	NULL	NULL	YES	BTREE		
INSERT INTO t1 SET a_datetime = '2008-07-14 16:30:50';
UPDATE t1 SET a_datetime = '2008-08-14 17:31:00' where a_datetime = '2008-07-14 16:30:50';
SELECT * FROM t1 ORDER BY a_datetime;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
7	NULL	911111111111111111	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
12	NULL	NULL	NULL	NULL	NULL	NULL	17:31:00	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
11	NULL	NULL	NULL	NULL	NULL	2008-08-14	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
10	NULL	NULL	NULL	NULL	112.05	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
9	NULL	NULL	NULL	999.998877665	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
6	88	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
8	NULL	NULL	993.33	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
3	125	9223372036854775805	997.77	999.345678912	112.01	2008-07-11	13:30:20	2008-07-11 13:30:20	2008-07-11 13:30:20	2010	cTestChar	cTestVarChar	cTestBin	cTestVarBinary	enumValueThree
4	124	911111111111111111	996.66	999.456789123	112.02	2008-07-12	14:30:30	2008-07-12 14:30:30	2008-07-12 14:30:30	2011	dTestChar	dTestVarChar	dTestBin	dTestVarBinary	enumValueOne
5	123	9223372036854775803	995.55	999.567891234	112.03	2008-07-13	15:30:40	2008-07-13 15:30:40	2008-07-13 15:30:40	2012	eTestChar	eTestVarChar	eTestBin	eTestVarBinary	enumValueTwo
13	NULL	NULL	NULL	NULL	NULL	NULL	NULL	2008-08-14 17:31:00	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
SELECT * FROM t1 WHERE a_datetime > '2008-07-10 00:00:00' LIMIT 1;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
ALTER TABLE t1 DROP INDEX index_datetime;
SHOW INDEXES FROM t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t1	0	PRIMARY	1	a_int	NULL	6	NULL	NULL		BTREE		
SELECT * FROM t1;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
3	125	9223372036854775805	997.77	999.345678912	112.01	2008-07-11	13:30:20	2008-07-11 13:30:20	2008-07-11 13:30:20	2010	cTestChar	cTestVarChar	cTestBin	cTestVarBinary	enumValueThree
4	124	911111111111111111	996.66	999.456789123	112.02	2008-07-12	14:30:30	2008-07-12 14:30:30	2008-07-12 14:30:30	2011	dTestChar	dTestVarChar	dTestBin	dTestVarBinary	enumValueOne
5	123	9223372036854775803	995.55	999.567891234	112.03	2008-07-13	15:30:40	2008-07-13 15:30:40	2008-07-13 15:30:40	2012	eTestChar	eTestVarChar	eTestBin	eTestVarBinary	enumValueTwo
6	88	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
7	NULL	911111111111111111	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
8	NULL	NULL	993.33	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
9	NULL	NULL	NULL	999.998877665	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
10	NULL	NULL	NULL	NULL	112.05	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
11	NULL	NULL	NULL	NULL	NULL	2008-08-14	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
12	NULL	NULL	NULL	NULL	NULL	NULL	17:31:00	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
13	NULL	NULL	NULL	NULL	NULL	NULL	NULL	2008-08-14 17:31:00	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
#-------- Test: TIMESTAMP --------#
ALTER TABLE t1 ADD INDEX index_timestamp (a_timestamp);
SHOW INDEXES FROM t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t1	0	PRIMARY	1	a_int	NULL	6	NULL	NULL		BTREE		
t1	1	index_timestamp	1	a_timestamp	NULL	6	NULL	NULL		BTREE		
INSERT INTO t1 SET a_timestamp = '2008-07-14 16:30:50';
UPDATE t1 SET a_timestamp = '2008-08-14 19:20:21' where a_timestamp = '2008-07-14 16:30:50';
SELECT * FROM t1 ORDER BY a_timestamp;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
8	NULL	NULL	993.33	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
13	NULL	NULL	NULL	NULL	NULL	NULL	NULL	2008-08-14 17:31:00	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
12	NULL	NULL	NULL	NULL	NULL	NULL	17:31:00	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
11	NULL	NULL	NULL	NULL	NULL	2008-08-14	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
10	NULL	NULL	NULL	NULL	112.05	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
6	88	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
7	NULL	911111111111111111	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
9	NULL	NULL	NULL	999.998877665	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
3	125	9223372036854775805	997.77	999.345678912	112.01	2008-07-11	13:30:20	2008-07-11 13:30:20	2008-07-11 13:30:20	2010	cTestChar	cTestVarChar	cTestBin	cTestVarBinary	enumValueThree
4	124	911111111111111111	996.66	999.456789123	112.02	2008-07-12	14:30:30	2008-07-12 14:30:30	2008-07-12 14:30:30	2011	dTestChar	dTestVarChar	dTestBin	dTestVarBinary	enumValueOne
5	123	9223372036854775803	995.55	999.567891234	112.03	2008-07-13	15:30:40	2008-07-13 15:30:40	2008-07-13 15:30:40	2012	eTestChar	eTestVarChar	eTestBin	eTestVarBinary	enumValueTwo
14	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	2008-08-14 19:20:21	NULL	NULL	NULL	NULL	NULL	NULL
SELECT * FROM t1 WHERE a_timestamp > '2008-07-10 00:00:00' LIMIT 1;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
ALTER TABLE t1 DROP INDEX index_timestamp;
SHOW INDEXES FROM t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t1	0	PRIMARY	1	a_int	NULL	7	NULL	NULL		BTREE		
SELECT * FROM t1;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
3	125	9223372036854775805	997.77	999.345678912	112.01	2008-07-11	13:30:20	2008-07-11 13:30:20	2008-07-11 13:30:20	2010	cTestChar	cTestVarChar	cTestBin	cTestVarBinary	enumValueThree
4	124	911111111111111111	996.66	999.456789123	112.02	2008-07-12	14:30:30	2008-07-12 14:30:30	2008-07-12 14:30:30	2011	dTestChar	dTestVarChar	dTestBin	dTestVarBinary	enumValueOne
5	123	9223372036854775803	995.55	999.567891234	112.03	2008-07-13	15:30:40	2008-07-13 15:30:40	2008-07-13 15:30:40	2012	eTestChar	eTestVarChar	eTestBin	eTestVarBinary	enumValueTwo
6	88	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
7	NULL	911111111111111111	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
8	NULL	NULL	993.33	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
9	NULL	NULL	NULL	999.998877665	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
10	NULL	NULL	NULL	NULL	112.05	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
11	NULL	NULL	NULL	NULL	NULL	2008-08-14	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
12	NULL	NULL	NULL	NULL	NULL	NULL	17:31:00	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
13	NULL	NULL	NULL	NULL	NULL	NULL	NULL	2008-08-14 17:31:00	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
14	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	2008-08-14 19:20:21	NULL	NULL	NULL	NULL	NULL	NULL
#-------- Test: YEAR --------#
ALTER TABLE t1 ADD INDEX index_year (a_year);
SHOW INDEXES FROM t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t1	0	PRIMARY	1	a_int	NULL	7	NULL	NULL		BTREE		
t1	1	index_year	1	a_year	NULL	7	NULL	NULL	YES	BTREE		
INSERT INTO t1 SET a_year = '2013';
UPDATE t1 SET a_year = '2020' where a_year LIKE '2013';
SELECT * FROM t1 ORDER BY a_year;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
8	NULL	NULL	993.33	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
14	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	2008-08-14 19:20:21	NULL	NULL	NULL	NULL	NULL	NULL
13	NULL	NULL	NULL	NULL	NULL	NULL	NULL	2008-08-14 17:31:00	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
12	NULL	NULL	NULL	NULL	NULL	NULL	17:31:00	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
11	NULL	NULL	NULL	NULL	NULL	2008-08-14	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
6	88	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
7	NULL	911111111111111111	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
10	NULL	NULL	NULL	NULL	112.05	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
9	NULL	NULL	NULL	999.998877665	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
3	125	9223372036854775805	997.77	999.345678912	112.01	2008-07-11	13:30:20	2008-07-11 13:30:20	2008-07-11 13:30:20	2010	cTestChar	cTestVarChar	cTestBin	cTestVarBinary	enumValueThree
4	124	911111111111111111	996.66	999.456789123	112.02	2008-07-12	14:30:30	2008-07-12 14:30:30	2008-07-12 14:30:30	2011	dTestChar	dTestVarChar	dTestBin	dTestVarBinary	enumValueOne
5	123	9223372036854775803	995.55	999.567891234	112.03	2008-07-13	15:30:40	2008-07-13 15:30:40	2008-07-13 15:30:40	2012	eTestChar	eTestVarChar	eTestBin	eTestVarBinary	enumValueTwo
15	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	2020	NULL	NULL	NULL	NULL	NULL
SELECT * FROM t1 WHERE a_year > '1999' LIMIT 1;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
ALTER TABLE t1 DROP INDEX index_year;
SHOW INDEXES FROM t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t1	0	PRIMARY	1	a_int	NULL	7	NULL	NULL		BTREE		
SELECT * FROM t1;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
3	125	9223372036854775805	997.77	999.345678912	112.01	2008-07-11	13:30:20	2008-07-11 13:30:20	2008-07-11 13:30:20	2010	cTestChar	cTestVarChar	cTestBin	cTestVarBinary	enumValueThree
4	124	911111111111111111	996.66	999.456789123	112.02	2008-07-12	14:30:30	2008-07-12 14:30:30	2008-07-12 14:30:30	2011	dTestChar	dTestVarChar	dTestBin	dTestVarBinary	enumValueOne
5	123	9223372036854775803	995.55	999.567891234	112.03	2008-07-13	15:30:40	2008-07-13 15:30:40	2008-07-13 15:30:40	2012	eTestChar	eTestVarChar	eTestBin	eTestVarBinary	enumValueTwo
6	88	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
7	NULL	911111111111111111	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
8	NULL	NULL	993.33	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
9	NULL	NULL	NULL	999.998877665	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
10	NULL	NULL	NULL	NULL	112.05	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
11	NULL	NULL	NULL	NULL	NULL	2008-08-14	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
12	NULL	NULL	NULL	NULL	NULL	NULL	17:31:00	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
13	NULL	NULL	NULL	NULL	NULL	NULL	NULL	2008-08-14 17:31:00	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
14	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	2008-08-14 19:20:21	NULL	NULL	NULL	NULL	NULL	NULL
15	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	2020	NULL	NULL	NULL	NULL	NULL
#-------- Test: CHAR --------#
ALTER TABLE t1 ADD INDEX index_char (a_char);
SHOW INDEXES FROM t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t1	0	PRIMARY	1	a_int	NULL	7	NULL	NULL		BTREE		
t1	1	index_char	1	a_char	NULL	7	NULL	NULL	YES	BTREE		
INSERT INTO t1 SET a_char = 'fTestChar';
UPDATE t1 SET a_char = 'gTestChar' where a_char = 'fTestChar';
SELECT * FROM t1 ORDER BY a_char;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
9	NULL	NULL	NULL	999.998877665	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
11	NULL	NULL	NULL	NULL	NULL	2008-08-14	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
8	NULL	NULL	993.33	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
7	NULL	911111111111111111	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
6	88	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
12	NULL	NULL	NULL	NULL	NULL	NULL	17:31:00	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
13	NULL	NULL	NULL	NULL	NULL	NULL	NULL	2008-08-14 17:31:00	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
14	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	2008-08-14 19:20:21	NULL	NULL	NULL	NULL	NULL	NULL
15	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	2020	NULL	NULL	NULL	NULL	NULL
10	NULL	NULL	NULL	NULL	112.05	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
3	125	9223372036854775805	997.77	999.345678912	112.01	2008-07-11	13:30:20	2008-07-11 13:30:20	2008-07-11 13:30:20	2010	cTestChar	cTestVarChar	cTestBin	cTestVarBinary	enumValueThree
4	124	911111111111111111	996.66	999.456789123	112.02	2008-07-12	14:30:30	2008-07-12 14:30:30	2008-07-12 14:30:30	2011	dTestChar	dTestVarChar	dTestBin	dTestVarBinary	enumValueOne
5	123	9223372036854775803	995.55	999.567891234	112.03	2008-07-13	15:30:40	2008-07-13 15:30:40	2008-07-13 15:30:40	2012	eTestChar	eTestVarChar	eTestBin	eTestVarBinary	enumValueTwo
16	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	gTestChar	NULL	NULL	NULL	NULL
SELECT * FROM t1 WHERE a_char > 'afalcon' LIMIT 1;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
ALTER TABLE t1 DROP INDEX index_char;
SHOW INDEXES FROM t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t1	0	PRIMARY	1	a_int	NULL	8	NULL	NULL		BTREE		
SELECT * FROM t1;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
3	125	9223372036854775805	997.77	999.345678912	112.01	2008-07-11	13:30:20	2008-07-11 13:30:20	2008-07-11 13:30:20	2010	cTestChar	cTestVarChar	cTestBin	cTestVarBinary	enumValueThree
4	124	911111111111111111	996.66	999.456789123	112.02	2008-07-12	14:30:30	2008-07-12 14:30:30	2008-07-12 14:30:30	2011	dTestChar	dTestVarChar	dTestBin	dTestVarBinary	enumValueOne
5	123	9223372036854775803	995.55	999.567891234	112.03	2008-07-13	15:30:40	2008-07-13 15:30:40	2008-07-13 15:30:40	2012	eTestChar	eTestVarChar	eTestBin	eTestVarBinary	enumValueTwo
6	88	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
7	NULL	911111111111111111	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
8	NULL	NULL	993.33	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
9	NULL	NULL	NULL	999.998877665	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
10	NULL	NULL	NULL	NULL	112.05	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
11	NULL	NULL	NULL	NULL	NULL	2008-08-14	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
12	NULL	NULL	NULL	NULL	NULL	NULL	17:31:00	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
13	NULL	NULL	NULL	NULL	NULL	NULL	NULL	2008-08-14 17:31:00	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
14	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	2008-08-14 19:20:21	NULL	NULL	NULL	NULL	NULL	NULL
15	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	2020	NULL	NULL	NULL	NULL	NULL
16	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	gTestChar	NULL	NULL	NULL	NULL
#-------- Test: VARCHAR --------#
ALTER TABLE t1 ADD INDEX index_varchar (a_varchar);
SHOW INDEXES FROM t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t1	0	PRIMARY	1	a_int	NULL	8	NULL	NULL		BTREE		
t1	1	index_varchar	1	a_varchar	NULL	8	NULL	NULL	YES	BTREE		
INSERT INTO t1 SET a_varchar = 'fTestVarChar';
UPDATE t1 SET a_varchar = 'gTestVarChar' where a_varchar = 'fTestVarChar';
SELECT * FROM t1 ORDER BY a_varchar;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
9	NULL	NULL	NULL	999.998877665	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
10	NULL	NULL	NULL	NULL	112.05	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
12	NULL	NULL	NULL	NULL	NULL	NULL	17:31:00	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
8	NULL	NULL	993.33	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
7	NULL	911111111111111111	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
6	88	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
13	NULL	NULL	NULL	NULL	NULL	NULL	NULL	2008-08-14 17:31:00	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
14	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	2008-08-14 19:20:21	NULL	NULL	NULL	NULL	NULL	NULL
15	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	2020	NULL	NULL	NULL	NULL	NULL
16	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	gTestChar	NULL	NULL	NULL	NULL
11	NULL	NULL	NULL	NULL	NULL	2008-08-14	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
3	125	9223372036854775805	997.77	999.345678912	112.01	2008-07-11	13:30:20	2008-07-11 13:30:20	2008-07-11 13:30:20	2010	cTestChar	cTestVarChar	cTestBin	cTestVarBinary	enumValueThree
4	124	911111111111111111	996.66	999.456789123	112.02	2008-07-12	14:30:30	2008-07-12 14:30:30	2008-07-12 14:30:30	2011	dTestChar	dTestVarChar	dTestBin	dTestVarBinary	enumValueOne
5	123	9223372036854775803	995.55	999.567891234	112.03	2008-07-13	15:30:40	2008-07-13 15:30:40	2008-07-13 15:30:40	2012	eTestChar	eTestVarChar	eTestBin	eTestVarBinary	enumValueTwo
17	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	gTestVarChar	NULL	NULL	NULL
SELECT * FROM t1 WHERE a_varchar > 'afalcon' LIMIT 1;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
ALTER TABLE t1 DROP INDEX index_varchar;
SHOW INDEXES FROM t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t1	0	PRIMARY	1	a_int	NULL	8	NULL	NULL		BTREE		
SELECT * FROM t1;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
3	125	9223372036854775805	997.77	999.345678912	112.01	2008-07-11	13:30:20	2008-07-11 13:30:20	2008-07-11 13:30:20	2010	cTestChar	cTestVarChar	cTestBin	cTestVarBinary	enumValueThree
4	124	911111111111111111	996.66	999.456789123	112.02	2008-07-12	14:30:30	2008-07-12 14:30:30	2008-07-12 14:30:30	2011	dTestChar	dTestVarChar	dTestBin	dTestVarBinary	enumValueOne
5	123	9223372036854775803	995.55	999.567891234	112.03	2008-07-13	15:30:40	2008-07-13 15:30:40	2008-07-13 15:30:40	2012	eTestChar	eTestVarChar	eTestBin	eTestVarBinary	enumValueTwo
6	88	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
7	NULL	911111111111111111	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
8	NULL	NULL	993.33	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
9	NULL	NULL	NULL	999.998877665	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
10	NULL	NULL	NULL	NULL	112.05	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
11	NULL	NULL	NULL	NULL	NULL	2008-08-14	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
12	NULL	NULL	NULL	NULL	NULL	NULL	17:31:00	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
13	NULL	NULL	NULL	NULL	NULL	NULL	NULL	2008-08-14 17:31:00	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
14	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	2008-08-14 19:20:21	NULL	NULL	NULL	NULL	NULL	NULL
15	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	2020	NULL	NULL	NULL	NULL	NULL
16	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	gTestChar	NULL	NULL	NULL	NULL
17	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	gTestVarChar	NULL	NULL	NULL
#-------- Test: BINARY --------#
ALTER TABLE t1 ADD INDEX index_binary (a_binary);
SHOW INDEXES FROM t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t1	0	PRIMARY	1	a_int	NULL	8	NULL	NULL		BTREE		
t1	1	index_binary	1	a_binary	NULL	8	NULL	NULL	YES	BTREE		
INSERT INTO t1 SET a_binary = 'fTestBin';
UPDATE t1 SET a_binary = 'gTestBin' where a_binary = 'fTestBin';
SELECT * FROM t1 ORDER BY a_binary;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
10	NULL	NULL	NULL	NULL	112.05	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
11	NULL	NULL	NULL	NULL	NULL	2008-08-14	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
13	NULL	NULL	NULL	NULL	NULL	NULL	NULL	2008-08-14 17:31:00	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
9	NULL	NULL	NULL	999.998877665	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
8	NULL	NULL	993.33	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
7	NULL	911111111111111111	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
6	88	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
14	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	2008-08-14 19:20:21	NULL	NULL	NULL	NULL	NULL	NULL
15	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	2020	NULL	NULL	NULL	NULL	NULL
16	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	gTestChar	NULL	NULL	NULL	NULL
17	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	gTestVarChar	NULL	NULL	NULL
12	NULL	NULL	NULL	NULL	NULL	NULL	17:31:00	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
3	125	9223372036854775805	997.77	999.345678912	112.01	2008-07-11	13:30:20	2008-07-11 13:30:20	2008-07-11 13:30:20	2010	cTestChar	cTestVarChar	cTestBin	cTestVarBinary	enumValueThree
4	124	911111111111111111	996.66	999.456789123	112.02	2008-07-12	14:30:30	2008-07-12 14:30:30	2008-07-12 14:30:30	2011	dTestChar	dTestVarChar	dTestBin	dTestVarBinary	enumValueOne
5	123	9223372036854775803	995.55	999.567891234	112.03	2008-07-13	15:30:40	2008-07-13 15:30:40	2008-07-13 15:30:40	2012	eTestChar	eTestVarChar	eTestBin	eTestVarBinary	enumValueTwo
18	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	gTestBin	NULL	NULL
SELECT * FROM t1 WHERE a_binary > 'afalcon' LIMIT 1;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
ALTER TABLE t1 DROP INDEX index_binary;
SHOW INDEXES FROM t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t1	0	PRIMARY	1	a_int	NULL	9	NULL	NULL		BTREE		
SELECT * FROM t1;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
3	125	9223372036854775805	997.77	999.345678912	112.01	2008-07-11	13:30:20	2008-07-11 13:30:20	2008-07-11 13:30:20	2010	cTestChar	cTestVarChar	cTestBin	cTestVarBinary	enumValueThree
4	124	911111111111111111	996.66	999.456789123	112.02	2008-07-12	14:30:30	2008-07-12 14:30:30	2008-07-12 14:30:30	2011	dTestChar	dTestVarChar	dTestBin	dTestVarBinary	enumValueOne
5	123	9223372036854775803	995.55	999.567891234	112.03	2008-07-13	15:30:40	2008-07-13 15:30:40	2008-07-13 15:30:40	2012	eTestChar	eTestVarChar	eTestBin	eTestVarBinary	enumValueTwo
6	88	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
7	NULL	911111111111111111	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
8	NULL	NULL	993.33	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
9	NULL	NULL	NULL	999.998877665	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
10	NULL	NULL	NULL	NULL	112.05	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
11	NULL	NULL	NULL	NULL	NULL	2008-08-14	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
12	NULL	NULL	NULL	NULL	NULL	NULL	17:31:00	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
13	NULL	NULL	NULL	NULL	NULL	NULL	NULL	2008-08-14 17:31:00	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
14	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	2008-08-14 19:20:21	NULL	NULL	NULL	NULL	NULL	NULL
15	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	2020	NULL	NULL	NULL	NULL	NULL
16	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	gTestChar	NULL	NULL	NULL	NULL
17	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	gTestVarChar	NULL	NULL	NULL
18	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	gTestBin	NULL	NULL
#-------- Test: VARBINARY --------#
ALTER TABLE t1 ADD INDEX index_varbinary (a_varbinary);
SHOW INDEXES FROM t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t1	0	PRIMARY	1	a_int	NULL	9	NULL	NULL		BTREE		
t1	1	index_varbinary	1	a_varbinary	NULL	9	NULL	NULL	YES	BTREE		
INSERT INTO t1 SET a_varbinary = 'fTestVarBinary';
UPDATE t1 SET a_varbinary = 'gTestVarBinary' where a_varbinary = 'fTestVarBinary';
SELECT * FROM t1 ORDER BY a_varbinary;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
10	NULL	NULL	NULL	NULL	112.05	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
12	NULL	NULL	NULL	NULL	NULL	NULL	17:31:00	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
11	NULL	NULL	NULL	NULL	NULL	2008-08-14	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
14	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	2008-08-14 19:20:21	NULL	NULL	NULL	NULL	NULL	NULL
9	NULL	NULL	NULL	999.998877665	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
8	NULL	NULL	993.33	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
7	NULL	911111111111111111	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
6	88	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
15	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	2020	NULL	NULL	NULL	NULL	NULL
16	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	gTestChar	NULL	NULL	NULL	NULL
17	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	gTestVarChar	NULL	NULL	NULL
18	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	gTestBin	NULL	NULL
13	NULL	NULL	NULL	NULL	NULL	NULL	NULL	2008-08-14 17:31:00	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
3	125	9223372036854775805	997.77	999.345678912	112.01	2008-07-11	13:30:20	2008-07-11 13:30:20	2008-07-11 13:30:20	2010	cTestChar	cTestVarChar	cTestBin	cTestVarBinary	enumValueThree
4	124	911111111111111111	996.66	999.456789123	112.02	2008-07-12	14:30:30	2008-07-12 14:30:30	2008-07-12 14:30:30	2011	dTestChar	dTestVarChar	dTestBin	dTestVarBinary	enumValueOne
5	123	9223372036854775803	995.55	999.567891234	112.03	2008-07-13	15:30:40	2008-07-13 15:30:40	2008-07-13 15:30:40	2012	eTestChar	eTestVarChar	eTestBin	eTestVarBinary	enumValueTwo
19	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	gTestVarBinary	NULL
SELECT * FROM t1 WHERE a_varbinary > 'afalcon' LIMIT 1;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
ALTER TABLE t1 DROP INDEX index_varbinary;
SHOW INDEXES FROM t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t1	0	PRIMARY	1	a_int	NULL	9	NULL	NULL		BTREE		
SELECT * FROM t1;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
3	125	9223372036854775805	997.77	999.345678912	112.01	2008-07-11	13:30:20	2008-07-11 13:30:20	2008-07-11 13:30:20	2010	cTestChar	cTestVarChar	cTestBin	cTestVarBinary	enumValueThree
4	124	911111111111111111	996.66	999.456789123	112.02	2008-07-12	14:30:30	2008-07-12 14:30:30	2008-07-12 14:30:30	2011	dTestChar	dTestVarChar	dTestBin	dTestVarBinary	enumValueOne
5	123	9223372036854775803	995.55	999.567891234	112.03	2008-07-13	15:30:40	2008-07-13 15:30:40	2008-07-13 15:30:40	2012	eTestChar	eTestVarChar	eTestBin	eTestVarBinary	enumValueTwo
6	88	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
7	NULL	911111111111111111	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
8	NULL	NULL	993.33	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
9	NULL	NULL	NULL	999.998877665	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
10	NULL	NULL	NULL	NULL	112.05	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
11	NULL	NULL	NULL	NULL	NULL	2008-08-14	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
12	NULL	NULL	NULL	NULL	NULL	NULL	17:31:00	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
13	NULL	NULL	NULL	NULL	NULL	NULL	NULL	2008-08-14 17:31:00	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
14	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	2008-08-14 19:20:21	NULL	NULL	NULL	NULL	NULL	NULL
15	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	2020	NULL	NULL	NULL	NULL	NULL
16	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	gTestChar	NULL	NULL	NULL	NULL
17	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	gTestVarChar	NULL	NULL	NULL
18	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	gTestBin	NULL	NULL
19	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	gTestVarBinary	NULL
#-------- Test: ENUM --------#
ALTER TABLE t1 ADD INDEX index_enum (a_binary);
SHOW INDEXES FROM t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t1	0	PRIMARY	1	a_int	NULL	9	NULL	NULL		BTREE		
t1	1	index_enum	1	a_binary	NULL	9	NULL	NULL	YES	BTREE		
INSERT INTO t1 SET a_enum = 'enumValueThree';
UPDATE t1 SET a_enum = 'enumValueOne' where a_enum = 'enumValueThree';
SELECT * FROM t1 ORDER BY a_enum;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
11	NULL	NULL	NULL	NULL	NULL	2008-08-14	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
13	NULL	NULL	NULL	NULL	NULL	NULL	NULL	2008-08-14 17:31:00	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
12	NULL	NULL	NULL	NULL	NULL	NULL	17:31:00	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
15	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	2020	NULL	NULL	NULL	NULL	NULL
10	NULL	NULL	NULL	NULL	112.05	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
9	NULL	NULL	NULL	999.998877665	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
8	NULL	NULL	993.33	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
7	NULL	911111111111111111	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
6	88	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
16	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	gTestChar	NULL	NULL	NULL	NULL
17	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	gTestVarChar	NULL	NULL	NULL
18	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	gTestBin	NULL	NULL
19	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	gTestVarBinary	NULL
14	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	2008-08-14 19:20:21	NULL	NULL	NULL	NULL	NULL	NULL
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
4	124	911111111111111111	996.66	999.456789123	112.02	2008-07-12	14:30:30	2008-07-12 14:30:30	2008-07-12 14:30:30	2011	dTestChar	dTestVarChar	dTestBin	dTestVarBinary	enumValueOne
3	125	9223372036854775805	997.77	999.345678912	112.01	2008-07-11	13:30:20	2008-07-11 13:30:20	2008-07-11 13:30:20	2010	cTestChar	cTestVarChar	cTestBin	cTestVarBinary	enumValueOne
20	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	enumValueOne
5	123	9223372036854775803	995.55	999.567891234	112.03	2008-07-13	15:30:40	2008-07-13 15:30:40	2008-07-13 15:30:40	2012	eTestChar	eTestVarChar	eTestBin	eTestVarBinary	enumValueTwo
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
SELECT * FROM t1 WHERE a_enum > 'afalcon' LIMIT 1;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
ALTER TABLE t1 DROP INDEX index_enum;
SHOW INDEXES FROM t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t1	0	PRIMARY	1	a_int	NULL	10	NULL	NULL		BTREE		
SELECT * FROM t1;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
3	125	9223372036854775805	997.77	999.345678912	112.01	2008-07-11	13:30:20	2008-07-11 13:30:20	2008-07-11 13:30:20	2010	cTestChar	cTestVarChar	cTestBin	cTestVarBinary	enumValueOne
4	124	911111111111111111	996.66	999.456789123	112.02	2008-07-12	14:30:30	2008-07-12 14:30:30	2008-07-12 14:30:30	2011	dTestChar	dTestVarChar	dTestBin	dTestVarBinary	enumValueOne
5	123	9223372036854775803	995.55	999.567891234	112.03	2008-07-13	15:30:40	2008-07-13 15:30:40	2008-07-13 15:30:40	2012	eTestChar	eTestVarChar	eTestBin	eTestVarBinary	enumValueTwo
6	88	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
7	NULL	911111111111111111	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
8	NULL	NULL	993.33	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
9	NULL	NULL	NULL	999.998877665	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
10	NULL	NULL	NULL	NULL	112.05	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
11	NULL	NULL	NULL	NULL	NULL	2008-08-14	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
12	NULL	NULL	NULL	NULL	NULL	NULL	17:31:00	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
13	NULL	NULL	NULL	NULL	NULL	NULL	NULL	2008-08-14 17:31:00	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
14	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	2008-08-14 19:20:21	NULL	NULL	NULL	NULL	NULL	NULL
15	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	2020	NULL	NULL	NULL	NULL	NULL
16	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	gTestChar	NULL	NULL	NULL	NULL
17	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	gTestVarChar	NULL	NULL	NULL
18	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	gTestBin	NULL	NULL
19	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	gTestVarBinary	NULL
20	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	enumValueOne
#-------- Test: Alternative CREATE INDEX --------#
CREATE INDEX index_int on t1 (a_int);
CREATE INDEX index_bit on t2 (a_bit);
CREATE INDEX index_tinyint on t1 (a_tinyint);
CREATE INDEX index_bigint on t1 (a_bigint);
CREATE INDEX index_float on t1 (a_float);
CREATE INDEX index_double on t1 (a_double);
CREATE INDEX index_decimal on t1 (a_decimal);
CREATE INDEX index_date on t1 (a_date);
CREATE INDEX index_datetime on t1 (a_datetime);
CREATE INDEX index_timestamp on t1 (a_timestamp);
CREATE INDEX index_year on t1 (a_year);
CREATE INDEX index_char on t1 (a_char);
CREATE INDEX index_varchar on t1 (a_varchar);
CREATE INDEX index_binary on t1 (a_binary);
CREATE INDEX index_varbinary on t1 (a_varbinary);
CREATE INDEX index_enum on t1 (a_enum);
SHOW INDEXES FROM t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t1	0	PRIMARY	1	a_int	NULL	10	NULL	NULL		BTREE		
t1	1	index_int	1	a_int	NULL	10	NULL	NULL		BTREE		
t1	1	index_tinyint	1	a_tinyint	NULL	10	NULL	NULL	YES	BTREE		
t1	1	index_bigint	1	a_bigint	NULL	10	NULL	NULL	YES	BTREE		
t1	1	index_float	1	a_float	NULL	10	NULL	NULL	YES	BTREE		
t1	1	index_double	1	a_double	NULL	10	NULL	NULL	YES	BTREE		
t1	1	index_decimal	1	a_decimal	NULL	10	NULL	NULL	YES	BTREE		
t1	1	index_date	1	a_date	NULL	10	NULL	NULL	YES	BTREE		
t1	1	index_datetime	1	a_datetime	NULL	10	NULL	NULL	YES	BTREE		
t1	1	index_timestamp	1	a_timestamp	NULL	10	NULL	NULL		BTREE		
t1	1	index_year	1	a_year	NULL	10	NULL	NULL	YES	BTREE		
t1	1	index_char	1	a_char	NULL	10	NULL	NULL	YES	BTREE		
t1	1	index_varchar	1	a_varchar	NULL	10	NULL	NULL	YES	BTREE		
t1	1	index_binary	1	a_binary	NULL	10	NULL	NULL	YES	BTREE		
t1	1	index_varbinary	1	a_varbinary	NULL	10	NULL	NULL	YES	BTREE		
t1	1	index_enum	1	a_enum	NULL	10	NULL	NULL	YES	BTREE		
SELECT * FROM t1 ORDER BY a_int;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
3	125	9223372036854775805	997.77	999.345678912	112.01	2008-07-11	13:30:20	2008-07-11 13:30:20	2008-07-11 13:30:20	2010	cTestChar	cTestVarChar	cTestBin	cTestVarBinary	enumValueOne
4	124	911111111111111111	996.66	999.456789123	112.02	2008-07-12	14:30:30	2008-07-12 14:30:30	2008-07-12 14:30:30	2011	dTestChar	dTestVarChar	dTestBin	dTestVarBinary	enumValueOne
5	123	9223372036854775803	995.55	999.567891234	112.03	2008-07-13	15:30:40	2008-07-13 15:30:40	2008-07-13 15:30:40	2012	eTestChar	eTestVarChar	eTestBin	eTestVarBinary	enumValueTwo
6	88	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
7	NULL	911111111111111111	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
8	NULL	NULL	993.33	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
9	NULL	NULL	NULL	999.998877665	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
10	NULL	NULL	NULL	NULL	112.05	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
11	NULL	NULL	NULL	NULL	NULL	2008-08-14	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
12	NULL	NULL	NULL	NULL	NULL	NULL	17:31:00	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
13	NULL	NULL	NULL	NULL	NULL	NULL	NULL	2008-08-14 17:31:00	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
14	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	2008-08-14 19:20:21	NULL	NULL	NULL	NULL	NULL	NULL
15	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	2020	NULL	NULL	NULL	NULL	NULL
16	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	gTestChar	NULL	NULL	NULL	NULL
17	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	gTestVarChar	NULL	NULL	NULL
18	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	gTestBin	NULL	NULL
19	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	gTestVarBinary	NULL
20	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	enumValueOne
SHOW INDEXES FROM t2;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t2	0	PRIMARY	1	a_int	NULL	3	NULL	NULL		BTREE		
t2	1	index_bit	1	a_bit	NULL	3	NULL	NULL	YES	BTREE		
SELECT a_int, BIN(a_bit+0) FROM t2 ORDER BY a_int;
a_int	BIN(a_bit+0)
1	0
2	1
3	10
4	11
5	100
6	101010
#-------- Test: Alternative DROP INDEX --------#
DROP INDEX index_int on t1;
DROP INDEX index_bit on t2;
DROP INDEX index_tinyint on t1;
DROP INDEX index_bigint on t1;
DROP INDEX index_float on t1;
DROP INDEX index_double on t1;
DROP INDEX index_decimal on t1;
DROP INDEX index_date on t1;
DROP INDEX index_datetime on t1;
DROP INDEX index_timestamp on t1;
DROP INDEX index_year on t1;
DROP INDEX index_char on t1;
DROP INDEX index_varchar on t1;
DROP INDEX index_binary on t1;
DROP INDEX index_varbinary on t1;
DROP INDEX index_enum on t1;
SHOW INDEXES FROM t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t1	0	PRIMARY	1	a_int	NULL	10	NULL	NULL		BTREE		
SELECT * FROM t1 ORDER BY a_int;
a_int	a_tinyint	a_bigint	a_float	a_double	a_decimal	a_date	a_time	a_datetime	a_timestamp	a_year	a_char	a_varchar	a_binary	a_varbinary	a_enum
1	127	9223372036854775807	999.99	999.123456789	111.99	2008-07-09	11:30:00	2008-07-09 11:30:00	2008-07-09 11:30:00	2008	aTestChar	aTestVarChar	aTestBin	aTestVarBinary	enumValueOne
2	126	9223372036854775806	998.88	999.234567891	112.00	2008-07-10	12:30:10	2008-07-10 12:30:10	2008-07-10 12:30:10	2009	bTestChar	bTestVarChar	bTestBin	bTestVarBinary	enumValueTwo
3	125	9223372036854775805	997.77	999.345678912	112.01	2008-07-11	13:30:20	2008-07-11 13:30:20	2008-07-11 13:30:20	2010	cTestChar	cTestVarChar	cTestBin	cTestVarBinary	enumValueOne
4	124	911111111111111111	996.66	999.456789123	112.02	2008-07-12	14:30:30	2008-07-12 14:30:30	2008-07-12 14:30:30	2011	dTestChar	dTestVarChar	dTestBin	dTestVarBinary	enumValueOne
5	123	9223372036854775803	995.55	999.567891234	112.03	2008-07-13	15:30:40	2008-07-13 15:30:40	2008-07-13 15:30:40	2012	eTestChar	eTestVarChar	eTestBin	eTestVarBinary	enumValueTwo
6	88	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
7	NULL	911111111111111111	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
8	NULL	NULL	993.33	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
9	NULL	NULL	NULL	999.998877665	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
10	NULL	NULL	NULL	NULL	112.05	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
11	NULL	NULL	NULL	NULL	NULL	2008-08-14	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
12	NULL	NULL	NULL	NULL	NULL	NULL	17:31:00	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
13	NULL	NULL	NULL	NULL	NULL	NULL	NULL	2008-08-14 17:31:00	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	NULL
14	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	2008-08-14 19:20:21	NULL	NULL	NULL	NULL	NULL	NULL
15	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	2020	NULL	NULL	NULL	NULL	NULL
16	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	gTestChar	NULL	NULL	NULL	NULL
17	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	gTestVarChar	NULL	NULL	NULL
18	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	gTestBin	NULL	NULL
19	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	gTestVarBinary	NULL
20	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	0000-00-00 00:00:00	NULL	NULL	NULL	NULL	NULL	enumValueOne
SHOW INDEXES FROM t2;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
t2	0	PRIMARY	1	a_int	NULL	3	NULL	NULL		BTREE		
SELECT a_int, BIN(a_bit+0) FROM t2 ORDER BY a_int;
a_int	BIN(a_bit+0)
1	0
2	1
3	10
4	11
5	100
6	101010
DROP TABLE t1;
DROP TABLE t2;
