| 1 |
SET SQL_MODE="TRADITIONAL,ANSI"; |
| 2 |
DROP TABLE IF EXISTS t5; |
| 3 |
CREATE TABLE t5(c1 DECIMAL(5,4) UNSIGNED NOT NULL); |
| 4 |
Warnings: |
| 5 |
Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. |
| 6 |
INSERT INTO t5 (c1) VALUES(NULL); |
| 7 |
ERROR 23000: Column 'c1' cannot be null |
| 8 |
INSERT INTO t5 (c1) VALUES(0); |
| 9 |
INSERT INTO t5 (c1) VALUES(-1); |
| 10 |
ERROR 22003: Out of range value for column 'c1' at row 1 |
| 11 |
INSERT INTO t5 (c1) VALUES('x'); |
| 12 |
ERROR HY000: Incorrect decimal value: 'x' for column 'c1' at row 1 |
| 13 |
INSERT INTO t5 (c1) VALUES(999999); |
| 14 |
ERROR 22003: Out of range value for column 'c1' at row 1 |
| 15 |
SELECT COUNT(c1) AS total_rows FROM t5; |
| 16 |
total_rows |
| 17 |
1 |
| 18 |
SELECT COUNT(c1) AS null_rows FROM t5 WHERE c1 IS NULL; |
| 19 |
null_rows |
| 20 |
0 |
| 21 |
SELECT COUNT(c1) AS not_null_rows FROM t5 WHERE c1 IS NOT NULL; |
| 22 |
not_null_rows |
| 23 |
1 |
| 24 |
DROP TABLE t5; |
| 25 |
CREATE TABLE t5(c1 DEC(5,4) UNSIGNED NOT NULL); |
| 26 |
Warnings: |
| 27 |
Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. |
| 28 |
INSERT INTO t5 (c1) VALUES(NULL); |
| 29 |
ERROR 23000: Column 'c1' cannot be null |
| 30 |
INSERT INTO t5 (c1) VALUES(0); |
| 31 |
INSERT INTO t5 (c1) VALUES(-1); |
| 32 |
ERROR 22003: Out of range value for column 'c1' at row 1 |
| 33 |
INSERT INTO t5 (c1) VALUES('x'); |
| 34 |
ERROR HY000: Incorrect decimal value: 'x' for column 'c1' at row 1 |
| 35 |
INSERT INTO t5 (c1) VALUES(999999); |
| 36 |
ERROR 22003: Out of range value for column 'c1' at row 1 |
| 37 |
SELECT COUNT(c1) AS total_rows FROM t5; |
| 38 |
total_rows |
| 39 |
1 |
| 40 |
SELECT COUNT(c1) AS null_rows FROM t5 WHERE c1 IS NULL; |
| 41 |
null_rows |
| 42 |
0 |
| 43 |
SELECT COUNT(c1) AS not_null_rows FROM t5 WHERE c1 IS NOT NULL; |
| 44 |
not_null_rows |
| 45 |
1 |
| 46 |
DROP TABLE t5; |
| 47 |
CREATE TABLE t5(c1 FIXED(5,4) UNSIGNED NOT NULL); |
| 48 |
Warnings: |
| 49 |
Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. |
| 50 |
INSERT INTO t5 (c1) VALUES(NULL); |
| 51 |
ERROR 23000: Column 'c1' cannot be null |
| 52 |
INSERT INTO t5 (c1) VALUES(0); |
| 53 |
INSERT INTO t5 (c1) VALUES(-1); |
| 54 |
ERROR 22003: Out of range value for column 'c1' at row 1 |
| 55 |
INSERT INTO t5 (c1) VALUES('x'); |
| 56 |
ERROR HY000: Incorrect decimal value: 'x' for column 'c1' at row 1 |
| 57 |
INSERT INTO t5 (c1) VALUES(999999); |
| 58 |
ERROR 22003: Out of range value for column 'c1' at row 1 |
| 59 |
SELECT COUNT(c1) AS total_rows FROM t5; |
| 60 |
total_rows |
| 61 |
1 |
| 62 |
SELECT COUNT(c1) AS null_rows FROM t5 WHERE c1 IS NULL; |
| 63 |
null_rows |
| 64 |
0 |
| 65 |
SELECT COUNT(c1) AS not_null_rows FROM t5 WHERE c1 IS NOT NULL; |
| 66 |
not_null_rows |
| 67 |
1 |
| 68 |
DROP TABLE t5; |
| 69 |
CREATE TABLE t5(c1 NUMERIC(5,4) UNSIGNED NOT NULL); |
| 70 |
Warnings: |
| 71 |
Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. |
| 72 |
INSERT INTO t5 (c1) VALUES(NULL); |
| 73 |
ERROR 23000: Column 'c1' cannot be null |
| 74 |
INSERT INTO t5 (c1) VALUES(0); |
| 75 |
INSERT INTO t5 (c1) VALUES(-1); |
| 76 |
ERROR 22003: Out of range value for column 'c1' at row 1 |
| 77 |
INSERT INTO t5 (c1) VALUES('x'); |
| 78 |
ERROR HY000: Incorrect decimal value: 'x' for column 'c1' at row 1 |
| 79 |
INSERT INTO t5 (c1) VALUES(999999); |
| 80 |
ERROR 22003: Out of range value for column 'c1' at row 1 |
| 81 |
SELECT COUNT(c1) AS total_rows FROM t5; |
| 82 |
total_rows |
| 83 |
1 |
| 84 |
SELECT COUNT(c1) AS null_rows FROM t5 WHERE c1 IS NULL; |
| 85 |
null_rows |
| 86 |
0 |
| 87 |
SELECT COUNT(c1) AS not_null_rows FROM t5 WHERE c1 IS NOT NULL; |
| 88 |
not_null_rows |
| 89 |
1 |
| 90 |
DROP TABLE t5; |