mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
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)
This commit is contained in:
@ -54,14 +54,14 @@ info: Records: 0 Duplicates: 0 Warnings: 0
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`e` int(11) NOT NULL DEFAULT '0',
|
||||
`e` int(11) NOT NULL,
|
||||
`c` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`e`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`z` int(11) NOT NULL DEFAULT '0',
|
||||
`z` int(11) NOT NULL,
|
||||
`c` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`z`),
|
||||
CONSTRAINT `fk1` FOREIGN KEY (`z`) REFERENCES `t1` (`e`)
|
||||
@ -69,7 +69,7 @@ t2 CREATE TABLE `t2` (
|
||||
SHOW CREATE TABLE t3;
|
||||
Table Create Table
|
||||
t3 CREATE TABLE `t3` (
|
||||
`f` int(11) NOT NULL DEFAULT '0',
|
||||
`f` int(11) NOT NULL,
|
||||
`g` int(11) DEFAULT NULL,
|
||||
`d` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`f`),
|
||||
|
Reference in New Issue
Block a user