mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
Merge adventure.(none):/home/thek/Development/cpp/bug27358/my50-bug27358
into adventure.(none):/home/thek/Development/cpp/bug27358/my51-bug27358
This commit is contained in:
commit
1f5f2b7649
3 changed files with 68 additions and 0 deletions
|
@ -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;
|
||||
|
|
|
@ -251,4 +251,35 @@ CREATE TABLE t2(c1 INT) ENGINE=MERGE UNION=(t1);
|
|||
--error 1031
|
||||
INSERT DELAYED INTO t2 VALUES(1);
|
||||
DROP TABLE t1, t2;
|
||||
#
|
||||
# Bug#27358 INSERT DELAYED does not honour SQL_MODE of the client
|
||||
#
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1,t2;
|
||||
--enable_warnings
|
||||
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");
|
||||
sleep 1;
|
||||
SELECT * FROM t1;
|
||||
SET SQL_MODE='PIPES_AS_CONCAT';
|
||||
INSERT DELAYED INTO t1 VALUES(0,'a' || 'b');
|
||||
sleep 1;
|
||||
SELECT * FROM t1;
|
||||
SET SQL_MODE='ERROR_FOR_DIVISION_BY_ZERO,STRICT_ALL_TABLES';
|
||||
--error 1365
|
||||
INSERT DELAYED INTO t1 VALUES(mod(1,0),"test3");
|
||||
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';
|
||||
--error ER_TRUNCATED_WRONG_VALUE
|
||||
INSERT DELAYED INTO t2 VALUES (0,'0000-00-00');
|
||||
--error ER_TRUNCATED_WRONG_VALUE
|
||||
INSERT DELAYED INTO t2 VALUES (0,'2007-00-00');
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
|
|
|
@ -1639,6 +1639,8 @@ public:
|
|||
char *record;
|
||||
enum_duplicates dup;
|
||||
time_t start_time;
|
||||
ulong sql_mode;
|
||||
bool auto_increment_field_not_null;
|
||||
bool query_start_used, ignore, log_query;
|
||||
bool stmt_depends_on_first_successful_insert_id_in_prev_stmt;
|
||||
ulonglong first_successful_insert_id_in_prev_stmt;
|
||||
|
@ -2141,6 +2143,9 @@ int write_delayed(THD *thd, TABLE *table, enum_duplicates duplic,
|
|||
/* Copy session variables. */
|
||||
row->auto_increment_increment= thd->variables.auto_increment_increment;
|
||||
row->auto_increment_offset= thd->variables.auto_increment_offset;
|
||||
row->sql_mode= thd->variables.sql_mode;
|
||||
row->auto_increment_field_not_null= table->auto_increment_field_not_null;
|
||||
|
||||
/* Copy the next forced auto increment value, if any. */
|
||||
if ((forced_auto_inc= thd->auto_inc_intervals_forced.get_next()))
|
||||
{
|
||||
|
@ -2555,10 +2560,13 @@ bool Delayed_insert::handle_inserts(void)
|
|||
thd.stmt_depends_on_first_successful_insert_id_in_prev_stmt=
|
||||
row->stmt_depends_on_first_successful_insert_id_in_prev_stmt;
|
||||
table->timestamp_field_type= row->timestamp_field_type;
|
||||
table->auto_increment_field_not_null= row->auto_increment_field_not_null;
|
||||
|
||||
/* Copy the session variables. */
|
||||
thd.variables.auto_increment_increment= row->auto_increment_increment;
|
||||
thd.variables.auto_increment_offset= row->auto_increment_offset;
|
||||
thd.variables.sql_mode= row->sql_mode;
|
||||
|
||||
/* Copy a forced insert_id, if any. */
|
||||
if (row->forced_insert_id)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue