1SET SQL_MODE="TRADITIONAL,ANSI";
2DROP TABLE IF EXISTS t3;
3CREATE TABLE t3(c1 CHAR(100) NOT NULL);
4INSERT INTO t3 (c1) VALUES(NULL);
5ERROR 23000: Column 'c1' cannot be null
6INSERT INTO t3 (c1) VALUES('x');
7INSERT INTO t3 (c1) VALUES('');
8INSERT INTO t3 (c1) VALUES('123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.x');
9ERROR 22001: Data too long for column 'c1' at row 1
10SELECT COUNT(c1) AS total_rows FROM t3;
11total_rows
122
13SELECT COUNT(c1) AS null_rows FROM t3 WHERE c1 IS NULL;
14null_rows
150
16SELECT COUNT(c1) AS not_null_rows FROM t3 WHERE c1 IS NOT NULL;
17not_null_rows
182
19DROP TABLE t3;
20CREATE TABLE t3(c1 VARCHAR(100) NOT NULL);
21INSERT INTO t3 (c1) VALUES(NULL);
22ERROR 23000: Column 'c1' cannot be null
23INSERT INTO t3 (c1) VALUES('x');
24INSERT INTO t3 (c1) VALUES('');
25INSERT INTO t3 (c1) VALUES('123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.x');
26ERROR 22001: Data too long for column 'c1' at row 1
27SELECT COUNT(c1) AS total_rows FROM t3;
28total_rows
292
30SELECT COUNT(c1) AS null_rows FROM t3 WHERE c1 IS NULL;
31null_rows
320
33SELECT COUNT(c1) AS not_null_rows FROM t3 WHERE c1 IS NOT NULL;
34not_null_rows
352
36DROP TABLE t3;
37CREATE TABLE t3(c1 BINARY(100) NOT NULL);
38INSERT INTO t3 (c1) VALUES(NULL);
39ERROR 23000: Column 'c1' cannot be null
40INSERT INTO t3 (c1) VALUES('x');
41INSERT INTO t3 (c1) VALUES('');
42INSERT INTO t3 (c1) VALUES('123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.x');
43ERROR 22001: Data too long for column 'c1' at row 1
44SELECT COUNT(c1) AS total_rows FROM t3;
45total_rows
462
47SELECT COUNT(c1) AS null_rows FROM t3 WHERE c1 IS NULL;
48null_rows
490
50SELECT COUNT(c1) AS not_null_rows FROM t3 WHERE c1 IS NOT NULL;
51not_null_rows
522
53DROP TABLE t3;
54CREATE TABLE t3(c1 VARBINARY(100) NOT NULL);
55INSERT INTO t3 (c1) VALUES(NULL);
56ERROR 23000: Column 'c1' cannot be null
57INSERT INTO t3 (c1) VALUES('x');
58INSERT INTO t3 (c1) VALUES('');
59INSERT INTO t3 (c1) VALUES('123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.x');
60ERROR 22001: Data too long for column 'c1' at row 1
61SELECT COUNT(c1) AS total_rows FROM t3;
62total_rows
632
64SELECT COUNT(c1) AS null_rows FROM t3 WHERE c1 IS NULL;
65null_rows
660
67SELECT COUNT(c1) AS not_null_rows FROM t3 WHERE c1 IS NOT NULL;
68not_null_rows
692
70DROP TABLE t3;
71