| 1 |
# |
| 2 |
# UNSIGNED column attribute |
| 3 |
# |
| 4 |
|
| 5 |
let $extra_type_opts = UNSIGNED; |
| 6 |
|
| 7 |
--source have_engine.inc |
| 8 |
|
| 9 |
--echo # |
| 10 |
--echo # Fixed point columns (NUMERIC, DECIMAL) |
| 11 |
--echo # |
| 12 |
|
| 13 |
--source type_fixed.inc |
| 14 |
let $create_definition = |
| 15 |
a DECIMAL $col_opts, |
| 16 |
b NUMERIC $col_opts |
| 17 |
; |
| 18 |
--source create_table.inc |
| 19 |
if ($mysql_errname) |
| 20 |
{ |
| 21 |
--let $functionality = Fixed point types or UNSIGNED columns |
| 22 |
--source unexpected_result.inc |
| 23 |
} |
| 24 |
if (!$mysql_errname) |
| 25 |
{ |
| 26 |
--replace_column 3 # 4 # 5 # 6 # |
| 27 |
SHOW COLUMNS IN t1; |
| 28 |
|
| 29 |
INSERT INTO t1 (a,b) VALUES (1.0,-1.0); |
| 30 |
INSERT INTO t1 (a,b) VALUES (-100,100); |
| 31 |
--sorted_result |
| 32 |
SELECT a,b FROM t1; |
| 33 |
DROP TABLE t1; |
| 34 |
} |
| 35 |
|
| 36 |
--echo # |
| 37 |
--echo # Floating point columns (FLOAT, DOUBLE) |
| 38 |
--echo # |
| 39 |
|
| 40 |
--source type_float.inc |
| 41 |
let $create_definition = |
| 42 |
a DOUBLE $col_opts, |
| 43 |
b FLOAT $col_opts |
| 44 |
; |
| 45 |
--source create_table.inc |
| 46 |
if ($mysql_errname) |
| 47 |
{ |
| 48 |
--let $functionality = Floating point types or UNSIGNED columns |
| 49 |
--source unexpected_result.inc |
| 50 |
} |
| 51 |
if (!$mysql_errname) |
| 52 |
{ |
| 53 |
--replace_column 3 # 4 # 5 # 6 # |
| 54 |
SHOW COLUMNS IN t1; |
| 55 |
|
| 56 |
INSERT INTO t1 (a,b) VALUES (1.0,-1.0); |
| 57 |
INSERT INTO t1 (a,b) VALUES (-100,100); |
| 58 |
--sorted_result |
| 59 |
SELECT a,b FROM t1; |
| 60 |
DROP TABLE t1; |
| 61 |
} |
| 62 |
|
| 63 |
--echo # |
| 64 |
--echo # INT columns |
| 65 |
--echo # |
| 66 |
|
| 67 |
--source type_int.inc |
| 68 |
let $create_definition = |
| 69 |
t TINYINT $col_opts, |
| 70 |
s SMALLINT $col_opts, |
| 71 |
m MEDIUMINT $col_opts, |
| 72 |
i INT $col_opts, |
| 73 |
b BIGINT $col_opts |
| 74 |
; |
| 75 |
--source create_table.inc |
| 76 |
if ($mysql_errname) |
| 77 |
{ |
| 78 |
--let $functionality = INT types or UNSIGNED columns |
| 79 |
--source unexpected_result.inc |
| 80 |
} |
| 81 |
if (!$mysql_errname) |
| 82 |
{ |
| 83 |
--replace_column 3 # 4 # 5 # 6 # |
| 84 |
SHOW COLUMNS IN t1; |
| 85 |
|
| 86 |
INSERT INTO t1 (t,s,m,i,b) VALUES (255,65535,16777215,4294967295,18446744073709551615); |
| 87 |
INSERT INTO t1 (t,s,m,i,b) VALUES (-1,-1,-1,-1,-1); |
| 88 |
--sorted_result |
| 89 |
SELECT t,s,m,i,b FROM t1; |
| 90 |
DROP TABLE t1; |
| 91 |
|
| 92 |
} |
| 93 |
|
| 94 |
--source cleanup_engine.inc |
| 95 |
|