MySQL int expressions.
This commit is contained in:
parent
163ecf4c42
commit
fcce8d4262
19 changed files with 654 additions and 168 deletions
|
|
@ -11,37 +11,37 @@ CREATE TABLE `all_types` (
|
|||
`boolean` BOOLEAN NOT NULL,
|
||||
`boolean_ptr` BOOLEAN,
|
||||
|
||||
`tiny_int` TINYINT NOT NULL,
|
||||
`utiny_int` TINYINT unsigned NOT NULL,
|
||||
`tiny_int` TINYINT NOT NULL,
|
||||
`u_tiny_int` TINYINT unsigned NOT NULL,
|
||||
|
||||
`small_int` SMALLINT NOT NULL,
|
||||
`usmall_int` SMALLINT unsigned NOT NULL,
|
||||
`small_int` SMALLINT NOT NULL,
|
||||
`u_small_int` SMALLINT unsigned NOT NULL,
|
||||
|
||||
`medium_int` MEDIUMINT NOT NULL,
|
||||
`umedium_int` MEDIUMINT unsigned NOT NULL,
|
||||
`medium_int` MEDIUMINT NOT NULL,
|
||||
`u_medium_int` MEDIUMINT unsigned NOT NULL,
|
||||
|
||||
`integer` INT NOT NULL,
|
||||
`uinteger` INT unsigned NOT NULL,
|
||||
`integer` INT NOT NULL,
|
||||
`u_integer` INT unsigned NOT NULL,
|
||||
|
||||
`big_int` bigint(20) NOT NULL,
|
||||
`ubig_int` bigint(20) unsigned NOT NULL,
|
||||
`big_int` bigint(20) NOT NULL,
|
||||
`u_big_int` bigint(20) unsigned NOT NULL,
|
||||
|
||||
-- ptr
|
||||
|
||||
`tiny_int_ptr` TINYINT,
|
||||
`utiny_int_ptr` TINYINT unsigned,
|
||||
`u_tiny_int_ptr` TINYINT unsigned,
|
||||
|
||||
`small_int_ptr` SMALLINT,
|
||||
`usmall_int_ptr` SMALLINT unsigned,
|
||||
`u_small_int_ptr` SMALLINT unsigned,
|
||||
|
||||
`medium_int_ptr` MEDIUMINT,
|
||||
`umedium_int_ptr` MEDIUMINT unsigned,
|
||||
`u_medium_int_ptr` MEDIUMINT unsigned,
|
||||
|
||||
`int_ptr` INT,
|
||||
`uint_ptr` INT unsigned,
|
||||
`integer_ptr` INT,
|
||||
`u_integer_ptr` INT unsigned,
|
||||
|
||||
`big_int_ptr` bigint(20),
|
||||
`ubig_int_ptr` bigint(20) unsigned,
|
||||
`u_big_int_ptr` bigint(20) unsigned,
|
||||
|
||||
|
||||
-- floats
|
||||
|
|
@ -114,12 +114,12 @@ CREATE TABLE `all_types` (
|
|||
|
||||
INSERT INTO `all_types` VALUES
|
||||
(false, true,
|
||||
-3,3,-14,14,-150,150,-1600,1600,-17000,17000,
|
||||
-3,3,-14,14,-150,150,-1600,1600,-17000,17000,
|
||||
-3,3,14,14,-150,150,-1600,1600,5000,50000,
|
||||
-3,3,14,14,-150,150,-1600,1600,50000,50000,
|
||||
1.11,1.11,2.22,2.22,3.33,3.33,4.44,4.44,5.55,5.55,
|
||||
_binary '\0',_binary '\0','2008-07-04','2008-07-04','2011-12-18 13:17:17','2011-12-18 13:17:17','2007-12-31 23:00:01','2007-12-31 23:00:01',2004,2004,'char','char','varchar','varchar',_binary 'binary\0\0\0\0\0\0\0\0\0\0\0\0\0\0',_binary 'binary\0\0\0\0\0\0\0\0\0\0\0\0\0\0',_binary 'varbinary',_binary 'varbinary',_binary 'blob',_binary 'blob','text','text','value1','value1','s1','s2','{\"key1\": \"value1\", \"key2\": \"value2\"}','{\"key1\": \"value1\", \"key2\": \"value2\"}'),
|
||||
(false, NULL,
|
||||
-3,3,-14,14,-150,150,-1600,1600,-17000,17000,
|
||||
-3,3,14,14,-150,150,-1600,1600,5000,50000,
|
||||
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
|
||||
1.11,NULL,2.22,NULL,3.33,NULL,4.44,NULL,5.55,NULL,
|
||||
_binary '\0',NULL,'2008-07-04',NULL,'2011-12-18 13:17:17',NULL,'2007-12-31 23:00:01',NULL,2004,NULL,'char',NULL,'varchar',NULL,_binary 'binary\0\0\0\0\0\0\0\0\0\0\0\0\0\0',NULL,_binary 'varbinary',NULL,_binary 'blob',NULL,'text',NULL,'value1',NULL,'s1',NULL,'{\"key1\": \"value1\", \"key2\": \"value2\"}',NULL);
|
||||
|
|
|
|||
|
|
@ -8,12 +8,12 @@ DROP TABLE IF EXISTS test_sample.all_types;
|
|||
CREATE TABLE test_sample.ALL_TYPES
|
||||
(
|
||||
-- numeric
|
||||
smallint_ptr smallint,
|
||||
smallint smallint NOT NULL,
|
||||
small_int_ptr smallint,
|
||||
small_int smallint NOT NULL,
|
||||
integer_ptr integer,
|
||||
integer integer NOT NULL,
|
||||
bigint_ptr bigint,
|
||||
bigint bigint NOT NULL,
|
||||
big_int_ptr bigint,
|
||||
big_int bigint NOT NULL,
|
||||
decimal_ptr decimal(10, 2),
|
||||
decimal decimal(10, 2) NOT NULL,
|
||||
numeric_ptr numeric(20, 3),
|
||||
|
|
@ -97,7 +97,7 @@ CREATE TABLE test_sample.ALL_TYPES
|
|||
);
|
||||
|
||||
INSERT INTO test_sample.ALL_types(
|
||||
smallint_ptr, "smallint", integer_ptr, "integer", bigint_ptr, "bigint", decimal_ptr, "decimal", numeric_ptr, "numeric", real_ptr, "real", double_precision_ptr, double_precision, smallserial, serial, bigserial,
|
||||
small_int_ptr, "small_int", integer_ptr, "integer", big_int_ptr, "big_int", decimal_ptr, "decimal", numeric_ptr, "numeric", real_ptr, "real", double_precision_ptr, double_precision, smallserial, serial, bigserial,
|
||||
-- money_ptr, money,
|
||||
character_varying_ptr, character_varying, character_ptr, "character", text_ptr, text,
|
||||
bytea_ptr, bytea,
|
||||
|
|
@ -110,7 +110,7 @@ INSERT INTO test_sample.ALL_types(
|
|||
xml_ptr, xml,
|
||||
json_ptr, json, jsonb_ptr, jsonb,
|
||||
integer_array_ptr, integer_array, text_array_ptr, text_array, jsonb_array, text_multi_dim_array_ptr, text_multi_dim_array)
|
||||
VALUES (1, 1, 300, 300, 50000, 5000, 1.11, 1.11, 2.22, 2.22, 5.55, 5.55, 11111111.22, 11111111.22, DEFAULT, DEFAULT, DEFAULT,
|
||||
VALUES (14, 14, 300, 300, 50000, 5000, 1.11, 1.11, 2.22, 2.22, 5.55, 5.55, 11111111.22, 11111111.22, DEFAULT, DEFAULT, DEFAULT,
|
||||
-- 100000, 100000,
|
||||
'ABBA', 'ABBA', 'JOHN', 'JOHN', 'Some text', 'Some text',
|
||||
'bytea', 'bytea',
|
||||
|
|
@ -124,7 +124,7 @@ VALUES (1, 1, 300, 300, 50000, 5000, 1.11, 1.11, 2.22, 2.22, 5.55, 5.55, 1111111
|
|||
'{"a": 1, "b": 3}', '{"a": 1, "b": 3}', '{"a": 1, "b": 3}', '{"a": 1, "b": 3}',
|
||||
'{1, 2, 3}', '{1, 2, 3}', '{"breakfast", "consulting"}', '{"breakfast", "consulting"}', ARRAY['{"a": 1, "b": 2}'::jsonb, '{"a":3, "b": 4}'::jsonb], '{{"meeting", "lunch"}, {"training", "presentation"}}', '{{"meeting", "lunch"}, {"training", "presentation"}}')
|
||||
,
|
||||
(NULL, 1, NULL, 300, NULL, 5000, NULL, 1.11, NULL, 2.22, NULL, 5.55, NULL, 11111111.22, DEFAULT, DEFAULT, DEFAULT,
|
||||
(NULL, 14, NULL, 300, NULL, 5000, NULL, 1.11, NULL, 2.22, NULL, 5.55, NULL, 11111111.22, DEFAULT, DEFAULT, DEFAULT,
|
||||
-- NULL, 100000,
|
||||
NULL, 'ABBA', NULL, 'JOHN', NULL, 'Some text',
|
||||
NULL, 'bytea',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue