diff options
author | Monty <monty@mariadb.org> | 2015-08-18 00:42:08 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2015-08-18 11:18:57 +0300 |
commit | 6b20342651bb5207b6c125d2d11b664a1bebcc41 (patch) | |
tree | 2f2e6ca60f3e45239224909eed19b907614f5054 /mysql-test/r/ctype_eucjpms.result | |
parent | 92fd65832727162a003647b4c48344dc9567ce84 (diff) | |
download | mariadb-git-6b20342651bb5207b6c125d2d11b664a1bebcc41.tar.gz |
Ensure that fields declared with NOT NULL doesn't have DEFAULT values if not specified and if not timestamp or auto_increment
In original code, sometimes one got an automatic DEFAULT value in some cases, in other cases not.
For example:
create table t1 (a int primary key) - No default
create table t2 (a int, primary key(a)) - DEFAULT 0
create table t1 SELECT .... - Default for all fields, even if they where defined as NOT NULL
ALTER TABLE ... MODIFY could sometimes add an unexpected DEFAULT value.
The patch is quite big because we had some many test cases that used
CREATE ... SELECT or CREATE ... (...PRIMARY KEY(xxx)) which doesn't have an automatic DEFAULT anymore.
Other things:
- Removed warnings from InnoDB when waiting from semaphore (got this when testing things with --big)
Diffstat (limited to 'mysql-test/r/ctype_eucjpms.result')
-rw-r--r-- | mysql-test/r/ctype_eucjpms.result | 42 |
1 files changed, 36 insertions, 6 deletions
diff --git a/mysql-test/r/ctype_eucjpms.result b/mysql-test/r/ctype_eucjpms.result index df1f79fc218..f791ef67671 100644 --- a/mysql-test/r/ctype_eucjpms.result +++ b/mysql-test/r/ctype_eucjpms.result @@ -9881,9 +9881,21 @@ CREATE TABLE t1 AS SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d; ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b); INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5)); +Warnings: +Warning 1364 Field 'c' doesn't have a default value +Warning 1364 Field 'd' doesn't have a default value INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10)); +Warnings: +Warning 1364 Field 'c' doesn't have a default value +Warning 1364 Field 'd' doesn't have a default value INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11)); +Warnings: +Warning 1364 Field 'c' doesn't have a default value +Warning 1364 Field 'd' doesn't have a default value INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12)); +Warnings: +Warning 1364 Field 'c' doesn't have a default value +Warning 1364 Field 'd' doesn't have a default value SELECT hex(concat(repeat(0xF1F2, 10), '%')); hex(concat(repeat(0xF1F2, 10), '%')) F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225 @@ -9976,9 +9988,21 @@ CREATE TABLE t1 AS SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d; ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b); INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5)); +Warnings: +Warning 1364 Field 'c' doesn't have a default value +Warning 1364 Field 'd' doesn't have a default value INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10)); +Warnings: +Warning 1364 Field 'c' doesn't have a default value +Warning 1364 Field 'd' doesn't have a default value INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11)); +Warnings: +Warning 1364 Field 'c' doesn't have a default value +Warning 1364 Field 'd' doesn't have a default value INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12)); +Warnings: +Warning 1364 Field 'c' doesn't have a default value +Warning 1364 Field 'd' doesn't have a default value SELECT hex(concat(repeat(0xF1F2, 10), '%')); hex(concat(repeat(0xF1F2, 10), '%')) F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225 @@ -10018,21 +10042,27 @@ DROP TABLE t1; CREATE TABLE t1 AS SELECT 'XXXXXX' AS code, ' ' AS a LIMIT 0; INSERT INTO t1 (code) SELECT concat('8E', head) FROM head WHERE (head BETWEEN 'A1' AND 'DF') ORDER BY head; +Warnings: +Warning 1364 Field 'a' doesn't have a default value INSERT INTO t1 (code) SELECT concat(head, tail) FROM head, tail WHERE (head BETWEEN '80' AND 'FF') AND (head NOT BETWEEN '8E' AND '8F') AND (tail BETWEEN '20' AND 'FF') ORDER BY head, tail; +Warnings: +Warning 1364 Field 'a' doesn't have a default value INSERT INTO t1 (code) SELECT concat('8F', head, tail) FROM head, tail WHERE (head BETWEEN '80' AND 'FF') AND (tail BETWEEN '20' AND 'FF') ORDER BY head, tail; +Warnings: +Warning 1364 Field 'a' doesn't have a default value DROP TEMPORARY TABLE head, tail; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `code` varchar(6) CHARACTER SET eucjpms NOT NULL DEFAULT '', - `a` varchar(1) CHARACTER SET eucjpms NOT NULL DEFAULT '' + `code` varchar(6) CHARACTER SET eucjpms NOT NULL, + `a` varchar(1) CHARACTER SET eucjpms NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 UPDATE t1 SET a=unhex(code) ORDER BY code; Warnings: @@ -32963,7 +32993,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` varchar(1) CHARACTER SET eucjpms NOT NULL DEFAULT '' + `a` varchar(1) CHARACTER SET eucjpms NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1; SHOW CREATE TABLE t2; @@ -32983,7 +33013,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` varchar(5) CHARACTER SET eucjpms NOT NULL DEFAULT '' + `a` varchar(5) CHARACTER SET eucjpms NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1; SHOW CREATE TABLE t2; @@ -33396,7 +33426,7 @@ CREATE TABLE t1 AS SELECT 'a' AS a; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` varchar(1) CHARACTER SET eucjpms COLLATE eucjpms_bin NOT NULL DEFAULT '' + `a` varchar(1) CHARACTER SET eucjpms COLLATE eucjpms_bin NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1; SHOW CREATE TABLE t2; @@ -33416,7 +33446,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` varchar(5) CHARACTER SET eucjpms COLLATE eucjpms_bin NOT NULL DEFAULT '' + `a` varchar(5) CHARACTER SET eucjpms COLLATE eucjpms_bin NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1; SHOW CREATE TABLE t2; |