← Back
Editing: fieldtypes_all.test
## generated ## Test resultset types ## Preamble --source ../include/xplugin_preamble.inc ## Test starts here --write_file $MYSQL_TMP_DIR/select_field_integer.tmp -->sql create schema xtest; use xtest; # # INTEGER TYPES # CREATE TABLE t_tinyint (c1 TINYINT, c2 TINYINT UNSIGNED); INSERT INTO t_tinyint VALUES (-128, 0); INSERT INTO t_tinyint VALUES (-1, 1); INSERT INTO t_tinyint VALUES (0, 127); INSERT INTO t_tinyint VALUES (1, 200); INSERT INTO t_tinyint VALUES (127, 255); CREATE TABLE t_smallint (c1 SMALLINT, c2 SMALLINT UNSIGNED); INSERT INTO t_smallint VALUES (-32768, 0); INSERT INTO t_smallint VALUES (-1, 1); INSERT INTO t_smallint VALUES (0, 32767); INSERT INTO t_smallint VALUES (1, 65534); INSERT INTO t_smallint VALUES (32767, 65535); CREATE TABLE t_mediumint (c1 MEDIUMINT, c2 MEDIUMINT UNSIGNED); INSERT INTO t_mediumint VALUES (-8388608, 0); INSERT INTO t_mediumint VALUES (-1, 1); INSERT INTO t_mediumint VALUES (0, 8388607); INSERT INTO t_mediumint VALUES (1, 16777214); INSERT INTO t_mediumint VALUES (8388607, 16777215); CREATE TABLE t_int (c1 INT, c2 INT UNSIGNED); INSERT INTO t_int VALUES (-2147483648, 0); INSERT INTO t_int VALUES (-1, 1); INSERT INTO t_int VALUES (0, 2147483647); INSERT INTO t_int VALUES (1, 4294967294); INSERT INTO t_int VALUES (2147483647, 4294967295); CREATE TABLE t_integer (c1 INTEGER, c2 INTEGER UNSIGNED); INSERT INTO t_integer VALUES (-2147483648, 0); INSERT INTO t_integer VALUES (-1, 1); INSERT INTO t_integer VALUES (0, 2147483647); INSERT INTO t_integer VALUES (1, 4294967294); INSERT INTO t_integer VALUES (2147483647, 4294967295); CREATE TABLE t_bigint (c1 BIGINT, c2 BIGINT UNSIGNED); INSERT INTO t_bigint VALUES (-9223372036854775808, 0); INSERT INTO t_bigint VALUES (-1, 1); INSERT INTO t_bigint VALUES (0, 9223372036854775807); INSERT INTO t_bigint VALUES (1, 18446744073709551614); INSERT INTO t_bigint VALUES (9223372036854775807, 18446744073709551615); SELECT * FROM t_tinyint; SELECT * FROM t_smallint; SELECT * FROM t_mediumint; SELECT * FROM t_int; SELECT * FROM t_bigint; # # FIXED POINT TYPES # CREATE TABLE t_decimal1 (c1 DECIMAL(2,1), c2 DECIMAL(2,1) UNSIGNED); INSERT INTO t_decimal1 VALUES (-1.1, 0.0); INSERT INTO t_decimal1 VALUES (-9.9, 9.8); INSERT INTO t_decimal1 VALUES (9.9, 9.9); CREATE TABLE t_decimal2 (c1 DECIMAL(64,30), c2 DECIMAL(64,30) UNSIGNED); INSERT INTO t_decimal2 VALUES (-1234567890123456789012345678901234.567890123456789012345678901234, 1234567890123456789012345678901234.567890123456789012345678901234); INSERT INTO t_decimal2 VALUES (9234567890123456789012345678901234.567890123456789012345678901234, 9234567890123456789012345678901234.567890123456789012345678901234); INSERT INTO t_decimal2 VALUES (0, 0); CREATE TABLE t_numeric1 (c1 NUMERIC(2,1), c2 NUMERIC(2,1) UNSIGNED); INSERT INTO t_numeric1 VALUES (-1.1, 0.0); INSERT INTO t_numeric1 VALUES (-9.9, 9.8); INSERT INTO t_numeric1 VALUES (9.9, 9.9); CREATE TABLE t_numeric2 (c1 NUMERIC(64,30), c2 NUMERIC(64,30) UNSIGNED); INSERT INTO t_numeric2 VALUES (-1234567890123456789012345678901234.567890123456789012345678901234, 1234567890123456789012345678901234.567890123456789012345678901234); INSERT INTO t_numeric2 VALUES (9234567890123456789012345678901234.567890123456789012345678901234, 9234567890123456789012345678901234.567890123456789012345678901234); INSERT INTO t_numeric2 VALUES (0, 0); SELECT * FROM t_decimal1; SELECT * FROM t_decimal2; SELECT * FROM t_numeric1; SELECT * FROM t_numeric2; # # FLOATING POINT TYPES # CREATE TABLE t_real (c1 REAL, c2 REAL UNSIGNED); INSERT INTO t_real VALUES (-1220.001, 0); INSERT INTO t_real VALUES (-1.01, 1.201); INSERT INTO t_real VALUES (1235.67, 11235.67); CREATE TABLE t_float (c1 FLOAT, c2 FLOAT UNSIGNED); INSERT INTO t_float VALUES (-1220223.00221, 0.0001); INSERT INTO t_float VALUES (-1.02323, 1.2333); INSERT INTO t_float VALUES (123522.67, 112352.67); CREATE TABLE t_double (c1 DOUBLE, c2 DOUBLE UNSIGNED); INSERT INTO t_double VALUES (-122022323.0230221, 2320.0012301); INSERT INTO t_double VALUES (-1.232023231, 1231231231.23331231); INSERT INTO t_double VALUES (1235212322.6123123, 11235212312322.671); SELECT * FROM t_real; SELECT * FROM t_float; SELECT * FROM t_double; # # DATE # CREATE TABLE t_date (c1 DATE, c2 TIME, c3 TIMESTAMP, c4 DATETIME, c5 YEAR); INSERT INTO t_date VALUES ('2015-07-23', '16:34:12', '2015-07-23 16:34:12', '2015-07-23 16:34:12', '2015'); INSERT INTO t_date VALUES ('0-1-1', '-1:0:0.12', '2000-1-1 0:0:2', '0-1-1', '1999'); SELECT * FROM t_date; # # BINARY # CREATE TABLE t_lob (c1 TINYBLOB, c2 BLOB, c3 MEDIUMBLOB, c4 LONGBLOB, c5 TINYTEXT, c6 TEXT, c7 MEDIUMTEXT, c8 LONGTEXT, c9 TINYTEXT BINARY, c10 TEXT BINARY, c11 MEDIUMTEXT BINARY, c12 LONGTEXT BINARY); INSERT INTO t_lob VALUES ('','','','','','','','','','','',''); INSERT INTO t_lob VALUES ('tinyblob-text readable','blob-text readable','mediumblob-text readable', 'longblob-text readable','tinytext','text','mediumtext','longtext', 'tinytext-binary\nnext line','text-binary\nnext line', 'mediumtext-binary\nnext line','longtext-binary \nnext line'); SELECT * FROM t_lob; # # OTHER # CREATE TABLE t_bit (c1 BIT(1), c2 BIT(64)); INSERT INTO t_bit VALUES (b'0', b'0'); INSERT INTO t_bit VALUES (b'1', b'1'); INSERT INTO t_bit VALUES (b'1', b'1111111111111111111111111111111111111111111111111111111111111111'); CREATE TABLE t_enum (c1 ENUM('v1','v2','v3'), c2 ENUM('')); INSERT INTO t_enum VALUES ('v1', ''); INSERT INTO t_enum VALUES ('v2', ''); CREATE TABLE t_set (c1 SET('v1','v2','v3'), c2 SET('')); INSERT INTO t_set VALUES ('v1,v1,v2', ''); INSERT INTO t_set VALUES ('', ''); SELECT * FROM t_bit; SELECT * FROM t_enum; SELECT * FROM t_set; drop schema if exists xtest; -->endsql EOF --exec $MYSQLXTEST -uroot --password='' --file=$MYSQL_TMP_DIR/select_field_integer.tmp 2>&1 --remove_file $MYSQL_TMP_DIR/select_field_integer.tmp ## Postamble uninstall plugin mysqlx;
Save File
Cancel