mirror of
				https://github.com/MariaDB/server.git
				synced 2025-11-03 14:33:32 +03:00 
			
		
		
		
	Documented behaviour was broken by the patch for bug 33699 that actually is not a bug. This fix reverts patch for bug 33699 and reverts the UPDATE of NOT NULL field with NULL query to old behavior. mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test: Bug #39265: fix for the bug 33699 should be reverted mysql-test/include/ps_modify.inc: Bug #39265: fix for the bug 33699 should be reverted mysql-test/r/auto_increment.result: Bug #39265: fix for the bug 33699 should be reverted mysql-test/r/csv_not_null.result: Bug #39265: fix for the bug 33699 should be reverted mysql-test/r/null.result: Bug #39265: fix for the bug 33699 should be reverted mysql-test/r/ps_2myisam.result: Bug #39265: fix for the bug 33699 should be reverted mysql-test/r/ps_3innodb.result: Bug #39265: fix for the bug 33699 should be reverted mysql-test/r/ps_4heap.result: Bug #39265: fix for the bug 33699 should be reverted mysql-test/r/ps_5merge.result: Bug #39265: fix for the bug 33699 should be reverted mysql-test/r/warnings.result: Bug #39265: fix for the bug 33699 should be reverted mysql-test/suite/ndb/r/ps_7ndb.result: Bug #39265: fix for the bug 33699 should be reverted mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result: Bug #39265: fix for the bug 33699 should be reverted mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result: Bug #39265: fix for the bug 33699 should be reverted mysql-test/suite/rpl/t/rpl_err_ignoredtable.test: Bug #39265: fix for the bug 33699 should be reverted mysql-test/t/auto_increment.test: Bug #39265: fix for the bug 33699 should be reverted mysql-test/t/csv_not_null.test: Bug #39265: fix for the bug 33699 should be reverted mysql-test/t/null.test: Bug #39265: fix for the bug 33699 should be reverted mysql-test/t/warnings.test: Bug #39265: fix for the bug 33699 should be reverted sql/sql_update.cc: Bug #39265: fix for the bug 33699 should be reverted
		
			
				
	
	
		
			55 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			55 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
# ===== csv_not_null.1 =====
 | 
						|
DROP TABLE IF EXISTS t1, t2;
 | 
						|
# === Will fail -- no NOT NULL ===
 | 
						|
CREATE TABLE t1 (a int) ENGINE = CSV;
 | 
						|
ERROR 42000: The storage engine for the table doesn't support nullable columns
 | 
						|
# === Good CREATE ===
 | 
						|
CREATE TABLE t1 (a int NOT NULL) ENGINE = CSV;
 | 
						|
# === Will fail -- ALL columns need NOT NULL ==
 | 
						|
CREATE TABLE t2 (a int NOT NULL, b char(20)) ENGINE = CSV;
 | 
						|
ERROR 42000: The storage engine for the table doesn't support nullable columns
 | 
						|
DROP TABLE t1;
 | 
						|
# ===== csv_not_null.2 =====
 | 
						|
DROP TABLE IF EXISTS t1;
 | 
						|
CREATE TABLE t1 (a int NOT NULL, b blob NOT NULL, c CHAR(20) NOT NULL, 
 | 
						|
d VARCHAR(20) NOT NULL, e enum('foo','bar') NOT NULL,f DATE NOT NULL) 
 | 
						|
ENGINE = CSV;
 | 
						|
# === should result in default for each datatype ===
 | 
						|
INSERT INTO t1 VALUES();
 | 
						|
SELECT * FROM t1;
 | 
						|
a	b	c	d	e	f
 | 
						|
0				foo	0000-00-00
 | 
						|
SELECT * FROM t1;
 | 
						|
a	b	c	d	e	f
 | 
						|
0				foo	0000-00-00
 | 
						|
INSERT INTO t1 VALUES(0,'abc','def','ghi','bar','1999-12-31');
 | 
						|
SELECT * FROM t1;
 | 
						|
a	b	c	d	e	f
 | 
						|
0				foo	0000-00-00
 | 
						|
0	abc	def	ghi	bar	1999-12-31
 | 
						|
# === insert failures ===
 | 
						|
INSERT INTO t1 VALUES(NULL,'ab','a','b','foo','2007-01-01');
 | 
						|
ERROR 23000: Column 'a' cannot be null
 | 
						|
INSERT INTO t1 VALUES(default(a),default(b), default(c), default(d),
 | 
						|
default(e), default(f));
 | 
						|
ERROR HY000: Field 'a' doesn't have a default value
 | 
						|
DROP TABLE t1;
 | 
						|
# ===== csv_not_null.3 =====
 | 
						|
DROP TABLE IF EXISTS t1;
 | 
						|
CREATE TABLE t1 (a int NOT NULL, b char(10) NOT NULL) ENGINE = CSV;
 | 
						|
INSERT INTO t1 VALUES();
 | 
						|
SELECT * FROM t1;
 | 
						|
a	b
 | 
						|
0	
 | 
						|
UPDATE t1 set b = 'new_value' where a = 0;
 | 
						|
SELECT * FROM t1;
 | 
						|
a	b
 | 
						|
0	new_value
 | 
						|
UPDATE t1 set b = NULL where b = 'new_value';
 | 
						|
Warnings:
 | 
						|
Warning	1048	Column 'b' cannot be null
 | 
						|
SELECT * FROM t1;
 | 
						|
a	b
 | 
						|
0	
 | 
						|
DROP TABLE t1;
 |