Commit 0578f745 authored by unknown's avatar unknown

Merge linux-st28.site:/home/martin/mysql/src/bug28677/my50-bug28677

into  linux-st28.site:/home/martin/mysql/src/bug28677/my51-bug28677


sql/sql_class.h:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_insert.cc:
  C
  c
parents 023f3dd0 3d31e3d6
...@@ -41,3 +41,17 @@ SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0))); ...@@ -41,3 +41,17 @@ SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0)));
a a
1 1
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1( a INT );
SELECT b FROM t1;
ERROR 42S22: Unknown column 'b' in 'field list'
SHOW ERRORS;
Level Code Message
Error 1054 Unknown column 'b' in 'field list'
CREATE TABLE t2 SELECT b FROM t1;
ERROR 42S22: Unknown column 'b' in 'field list'
SHOW ERRORS;
Level Code Message
Error 1054 Unknown column 'b' in 'field list'
INSERT INTO t1 SELECT b FROM t1;
ERROR 42S22: Unknown column 'b' in 'field list'
DROP TABLE t1;
...@@ -53,4 +53,17 @@ INSERT INTO t1 VALUES(2),(3); ...@@ -53,4 +53,17 @@ INSERT INTO t1 VALUES(2),(3);
SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0))); SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0)));
DROP TABLE t1; DROP TABLE t1;
#
# Bug #28677: SELECT on missing column gives extra error
#
CREATE TABLE t1( a INT );
--error ER_BAD_FIELD_ERROR
SELECT b FROM t1;
SHOW ERRORS;
--error ER_BAD_FIELD_ERROR
CREATE TABLE t2 SELECT b FROM t1;
SHOW ERRORS;
--error ER_BAD_FIELD_ERROR
INSERT INTO t1 SELECT b FROM t1;
DROP TABLE t1;
# End of 5.0 tests # End of 5.0 tests
...@@ -1972,6 +1972,7 @@ class select_insert :public select_result_interceptor { ...@@ -1972,6 +1972,7 @@ class select_insert :public select_result_interceptor {
virtual bool can_rollback_data() { return 0; } virtual bool can_rollback_data() { return 0; }
void send_error(uint errcode,const char *err); void send_error(uint errcode,const char *err);
bool send_eof(); bool send_eof();
void abort();
/* not implemented: select_insert is never re-used in prepared statements */ /* not implemented: select_insert is never re-used in prepared statements */
void cleanup(); void cleanup();
}; };
......
...@@ -261,11 +261,8 @@ bool handle_select(THD *thd, LEX *lex, select_result *result, ...@@ -261,11 +261,8 @@ bool handle_select(THD *thd, LEX *lex, select_result *result,
thd->net.report_error)); thd->net.report_error));
res|= thd->net.report_error; res|= thd->net.report_error;
if (unlikely(res)) if (unlikely(res))
{
/* If we had a another error reported earlier then this will be ignored */
result->send_error(ER_UNKNOWN_ERROR, ER(ER_UNKNOWN_ERROR));
result->abort(); result->abort();
}
DBUG_RETURN(res); DBUG_RETURN(res);
} }
......
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