1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +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:
Monty
2015-08-18 00:42:08 +03:00
parent 92fd658327
commit 6b20342651
184 changed files with 6776 additions and 6305 deletions

View File

@ -448,7 +448,7 @@ CREATE TABLE t1 AS SELECT REGEXP_REPLACE('abc','b','x')+0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`REGEXP_REPLACE('abc','b','x')+0` double NOT NULL DEFAULT '0'
`REGEXP_REPLACE('abc','b','x')+0` double NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
SELECT REGEXP_REPLACE(NULL,'b','c');
@ -736,7 +736,7 @@ CREATE TABLE t1 AS SELECT REGEXP_SUBSTR('abc','b');
#
# Checking REGEXP_SUBSTR
#
CREATE TABLE t1 AS SELECT REGEXP_SUBSTR('abc','b');
CREATE TABLE t1 AS SELECT REGEXP_SUBSTR('abc','b');
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@ -748,7 +748,7 @@ CREATE TABLE t1 AS SELECT REGEXP_SUBSTR('abc','b')+0;
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select regexp_substr('abc','b') AS `REGEXP_SUBSTR('abc','b')`
CREATE TABLE t1 AS SELECT REGEXP_SUBSTR('abc','b')+0;
CREATE TABLE t1 AS SELECT REGEXP_SUBSTR('abc','b')+0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (