Commit b908c222 authored by unknown's avatar unknown

Merge mysql.com:/home/ram/work/b32676/b32676.5.0

into  mysql.com:/home/ram/work/b32676/b32676.5.1


sql/sql_insert.cc:
  Auto merged
mysql-test/r/delayed.result:
  manual merge.
mysql-test/t/delayed.test:
  manual merge.
parents f0ac4a74 50375525
...@@ -250,6 +250,11 @@ SELECT HEX(a) FROM t1; ...@@ -250,6 +250,11 @@ SELECT HEX(a) FROM t1;
HEX(a) HEX(a)
1 1
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (a INT);
INSERT DELAYED INTO t1 SET b= b();
ERROR 42S22: Unknown column 'b' in 'field list'
DROP TABLE t1;
End of 5.0 tests
DROP TABLE IF EXISTS t1,t2; DROP TABLE IF EXISTS t1,t2;
SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO'; SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO';
CREATE TABLE `t1` ( CREATE TABLE `t1` (
...@@ -279,3 +284,4 @@ ERROR 22007: Incorrect date value: '0000-00-00' for column 'f1' at row 1 ...@@ -279,3 +284,4 @@ ERROR 22007: Incorrect date value: '0000-00-00' for column 'f1' at row 1
INSERT DELAYED INTO t2 VALUES (0,'2007-00-00'); INSERT DELAYED INTO t2 VALUES (0,'2007-00-00');
ERROR 22007: Incorrect date value: '2007-00-00' for column 'f1' at row 1 ERROR 22007: Incorrect date value: '2007-00-00' for column 'f1' at row 1
DROP TABLE t1,t2; DROP TABLE t1,t2;
End of 5.1 tests
...@@ -243,6 +243,16 @@ FLUSH TABLE t1; ...@@ -243,6 +243,16 @@ FLUSH TABLE t1;
SELECT HEX(a) FROM t1; SELECT HEX(a) FROM t1;
DROP TABLE t1; DROP TABLE t1;
#
# Bug #32676: insert delayed crash with wrong column and function specified
#
CREATE TABLE t1 (a INT);
--error ER_BAD_FIELD_ERROR
INSERT DELAYED INTO t1 SET b= b();
DROP TABLE t1;
--echo End of 5.0 tests
# #
# Bug#27358 INSERT DELAYED does not honour SQL_MODE of the client # Bug#27358 INSERT DELAYED does not honour SQL_MODE of the client
# #
...@@ -275,3 +285,4 @@ INSERT DELAYED INTO t2 VALUES (0,'0000-00-00'); ...@@ -275,3 +285,4 @@ INSERT DELAYED INTO t2 VALUES (0,'0000-00-00');
INSERT DELAYED INTO t2 VALUES (0,'2007-00-00'); INSERT DELAYED INTO t2 VALUES (0,'2007-00-00');
DROP TABLE t1,t2; DROP TABLE t1,t2;
--echo End of 5.1 tests
...@@ -574,7 +574,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, ...@@ -574,7 +574,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
bool log_on= ((thd->options & OPTION_BIN_LOG) || bool log_on= ((thd->options & OPTION_BIN_LOG) ||
(!(thd->security_ctx->master_access & SUPER_ACL))); (!(thd->security_ctx->master_access & SUPER_ACL)));
#endif #endif
thr_lock_type lock_type = table_list->lock_type; thr_lock_type lock_type;
Item *unused_conds= 0; Item *unused_conds= 0;
DBUG_ENTER("mysql_insert"); DBUG_ENTER("mysql_insert");
...@@ -609,6 +609,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, ...@@ -609,6 +609,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
if (open_and_lock_tables(thd, table_list)) if (open_and_lock_tables(thd, table_list))
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
} }
lock_type= table_list->lock_type;
thd->proc_info="init"; thd->proc_info="init";
thd->used_tables=0; thd->used_tables=0;
...@@ -626,7 +627,6 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, ...@@ -626,7 +627,6 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
/* mysql_prepare_insert set table_list->table if it was not set */ /* mysql_prepare_insert set table_list->table if it was not set */
table= table_list->table; table= table_list->table;
lock_type= table_list->lock_type;
context= &thd->lex->select_lex.context; context= &thd->lex->select_lex.context;
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment