1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Bug#27358 INSERT DELAYED does not honour SQL_MODE of the client

SQL_MODE was ignored when a client issued INSERT DELAYED.

Some system settings weren't copied as intended when a record was saved for
a delayed insert.
This commit is contained in:
thek@adventure.(none)
2007-08-23 10:22:20 +02:00
parent 3c6eb0002d
commit b1b2108275
5 changed files with 68 additions and 73 deletions

View File

@ -255,3 +255,32 @@ CREATE TABLE t2(c1 INT) ENGINE=MERGE UNION=(t1);
INSERT DELAYED INTO t2 VALUES(1);
ERROR HY000: Table storage engine for 't2' doesn't have this option
DROP TABLE t1, t2;
DROP TABLE IF EXISTS t1,t2;
SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO';
CREATE TABLE `t1` (
`id` int(11) PRIMARY KEY auto_increment,
`f1` varchar(10) NOT NULL UNIQUE
);
INSERT DELAYED INTO t1 VALUES(0,"test1");
SELECT * FROM t1;
id f1
0 test1
SET SQL_MODE='PIPES_AS_CONCAT';
INSERT DELAYED INTO t1 VALUES(0,'a' || 'b');
SELECT * FROM t1;
id f1
0 test1
1 ab
SET SQL_MODE='ERROR_FOR_DIVISION_BY_ZERO,STRICT_ALL_TABLES';
INSERT DELAYED INTO t1 VALUES(mod(1,0),"test3");
ERROR 22012: Division by 0
CREATE TABLE t2 (
`id` int(11) PRIMARY KEY auto_increment,
`f1` date
);
SET SQL_MODE='NO_ZERO_DATE,STRICT_ALL_TABLES,NO_ZERO_IN_DATE';
INSERT DELAYED INTO t2 VALUES (0,'0000-00-00');
ERROR 22007: Incorrect date value: '0000-00-00' for column 'f1' at row 1
INSERT DELAYED INTO t2 VALUES (0,'2007-00-00');
ERROR 22007: Incorrect date value: '2007-00-00' for column 'f1' at row 1
DROP TABLE t1,t2;