diff options
author | unknown <mhansson/martin@linux-st28.site> | 2007-06-18 16:35:01 +0300 |
---|---|---|
committer | unknown <mhansson/martin@linux-st28.site> | 2007-06-18 16:35:01 +0300 |
commit | 3d31e3d641ed8a4420546449e5e25dcafe51f22f (patch) | |
tree | 4d65c5f245153c9a76e6e4e0a6fd69b70a0d05c8 /mysql-test/t/errors.test | |
parent | 14cb59d8bb0531cec3955fb3718455e7742d5db8 (diff) | |
download | mariadb-git-3d31e3d641ed8a4420546449e5e25dcafe51f22f.tar.gz |
Bug#28677: SELECT on missing column gives extra error
The method select_insert::send_error does two things, it rolls back a statement
being executed and outputs an error message. But when a
nonexistent column is referenced, an error message has been published already and
there is no need to publish another.
Fixed by moving all functionality beyond publishing an error message into
select_insert::abort() and calling only that function.
mysql-test/r/errors.result:
Bug#28677: test result
mysql-test/t/errors.test:
Bug#28677: test case
sql/sql_class.h:
Bug#28677: overriding abort()
sql/sql_insert.cc:
Bug#28677:
- moved everything beyond producing an error message out of select_insert::send_error
and into new override select_insert::abort()
- made corresponding move of code from select_create::send_error to select_create::abort
sql/sql_select.cc:
Bug#28677: No need to pusblish an error here
Diffstat (limited to 'mysql-test/t/errors.test')
-rw-r--r-- | mysql-test/t/errors.test | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/mysql-test/t/errors.test b/mysql-test/t/errors.test index 4fbdcba635f..89579ec1739 100644 --- a/mysql-test/t/errors.test +++ b/mysql-test/t/errors.test @@ -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 |