Commit 26371209 authored by mhansson/martin@linux-st28.site's avatar mhansson/martin@linux-st28.site

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

into  linux-st28.site:/home/martin/mysql/src/bug28677/my51-bug28677
parents 9e8299f6 cc2d534a
......@@ -41,3 +41,17 @@ SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0)));
a
1
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);
SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0)));
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
......@@ -1972,6 +1972,7 @@ class select_insert :public select_result_interceptor {
virtual bool can_rollback_data() { return 0; }
void send_error(uint errcode,const char *err);
bool send_eof();
void abort();
/* not implemented: select_insert is never re-used in prepared statements */
void cleanup();
};
......
......@@ -261,11 +261,8 @@ bool handle_select(THD *thd, LEX *lex, select_result *result,
thd->net.report_error));
res|= thd->net.report_error;
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();
}
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