2000-12-28 02:56:38 +01:00
|
|
|
|
#
|
|
|
|
|
# Test some error conditions
|
|
|
|
|
#
|
2017-06-15 20:16:18 +02:00
|
|
|
|
--source include/have_sequence.inc
|
2000-12-28 02:56:38 +01:00
|
|
|
|
|
2003-01-06 00:48:59 +01:00
|
|
|
|
--disable_warnings
|
2000-12-28 02:56:38 +01:00
|
|
|
|
drop table if exists t1;
|
2003-01-06 00:48:59 +01:00
|
|
|
|
--enable_warnings
|
|
|
|
|
--error 1146
|
|
|
|
|
insert into t1 values(1);
|
|
|
|
|
--error 1146
|
|
|
|
|
delete from t1;
|
|
|
|
|
--error 1146
|
|
|
|
|
update t1 set a=1;
|
2000-12-28 02:56:38 +01:00
|
|
|
|
create table t1 (a int);
|
2003-01-06 00:48:59 +01:00
|
|
|
|
--error 1054
|
|
|
|
|
select count(test.t1.b) from t1;
|
Implementation of WL#2486 -
"Process NATURAL and USING joins according to SQL:2003".
* Some of the main problems fixed by the patch:
- in "select *" queries the * expanded correctly according to
ANSI for arbitrary natural/using joins
- natural/using joins are correctly transformed into JOIN ... ON
for any number/nesting of the joins.
- column references are correctly resolved against natural joins
of any nesting and combined with arbitrary other joins.
* This patch also contains a fix for name resolution of items
inside the ON condition of JOIN ... ON - in this case items must
be resolved only against the JOIN operands. To support such
'local' name resolution, the patch introduces a stack of
name resolution contexts used at parse time.
NOTICE:
- This patch is not complete in the sense that
- there are 2 test cases that still do not pass -
one in join.test, one in select.test. Both are marked
with a comment "TODO: WL#2486".
- it does not include a new test specific for the task
mysql-test/include/ps_query.inc:
Adjusted according to standard NATURAL/USING join semantics.,
mysql-test/r/bdb.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/derived.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/errors.result:
The column as a whole cannot be resolved, so different error message.
mysql-test/r/fulltext.result:
Adjusted according to standard JOIN ... ON semantics =>
the ON condition can refer only to the join operands.
mysql-test/r/fulltext_order_by.result:
More detailed error message.
mysql-test/r/innodb.result:
Adjusted according to standard NATURAL/USING join semantics.
This test doesn't pass completetly yet!
mysql-test/r/insert_select.result:
More detailed error message.
mysql-test/r/join.result:
Adjusted according to standard NATURAL/USING join semantics.
NOTICE: there is one test case that still fails, and it is
commeted out and marked with WL#2486 in the test file.
mysql-test/r/join_crash.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/join_nested.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/join_outer.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/multi_update.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/null_key.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/order_by.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/ps_2myisam.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/ps_3innodb.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/ps_4heap.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/ps_5merge.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/ps_6bdb.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/ps_7ndb.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/select.result:
Adjusted according to standard NATURAL/USING join semantics.
NOTICE: there is one failing test case which is commented with
WL#2486 in the test file.
mysql-test/r/subselect.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/type_ranges.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/union.result:
More detailed error message.
mysql-test/t/bdb.test:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/errors.test:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/fulltext.test:
Adjusted according to standard JOIN ... ON semantics =>
the ON condition can refer only to the join operands.
mysql-test/t/fulltext_order_by.test:
More detailed error message.
mysql-test/t/innodb.test:
Adjusted according to standard NATURAL/USING join semantics.
This test doesn't pass completetly yet!
mysql-test/t/insert_select.test:
More detailed error message.
mysql-test/t/join.test:
Adjusted according to standard NATURAL/USING join semantics.
NOTICE: there is one test case that still fails, and it is
commeted out and marked with WL#2486 in the test file.
mysql-test/t/join_crash.test:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/join_nested.test:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/join_outer.test:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/null_key.test:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/order_by.test:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/select.test:
Adjusted according to standard NATURAL/USING join semantics.
NOTICE: there is one test case that still fails, and it is
commeted out and marked with WL#2486 in the test file.
mysql-test/t/subselect.test:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/type_ranges.test:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/union.test:
More detailed error message.
sql/item.cc:
- extra parameter to find_field_in_tables
- find_field_in_real_table renamed to find_field_in_table
- fixed comments/typos
sql/item.h:
- added [first | last]_name_resolution_table to class
Name_resolution_context
- commented old code
- standardized formatting
sql/mysql_priv.h:
- refactored the find_field_in_XXX procedures,
- added a new procedure for natural join table references,
- renamed the find_field_in_XXX procedures to clearer names
sql/sp.cc:
- pass the top-most list of the FROM clause to setup_tables
- extra parameter to find_field_in_tables
sql/sql_acl.cc:
- renamed find_field_in_table => find_field_in_table_ref
- extra parameter to find_field_in_table_ref
- commented old code
sql/sql_base.cc:
This file contains the core of the implementation of the processing
of NATURAL/USING joins (WL#2486).
- added many comments to old code
- refactored the group of find_field_in_XXX procedures, and added a
new procedure for natural joins. There is one find_field_in_XXX procedure
per each type of table reference (stored table, merge view, or natural
join); one meta-procedure that selects the correct one depeneding on the
table reference; and one procedure that goes over a list of table
referenes.
- NATURAL/USING joins are processed through the procedures:
mark_common_columns, store_natural_using_join_columns,
store_top_level_join_columns, setup_natural_join_row_types.
The entry point to processing NATURAL/USING joins is the
procedure 'setup_natural_join_row_types'.
- Replaced the specialized Field_iterator_XXX iterators with one
generic iterator over the fields of a table reference.
- Simplified 'insert_fields' and 'setup_conds' due to encapsulation of
the processing of natural joins in a separate set of procedures.
sql/sql_class.h:
- Commented old code.
sql/sql_delete.cc:
- Pass the FROM clause to setup_tables.
sql/sql_help.cc:
- pass the end name resolution table to find_field_in_tables
- adjust the list of tables for name resolution
sql/sql_insert.cc:
- Changed the code that saves and restores the current context to
support the list of tables for name resolution -
context->first_name_resolution_table, and
table_list->next_name_resolution_table.
Needed to support an ugly trick to resolve inserted columns only in
the first table.
- Added Name_resolution_context::[first | last]_name_resolution_table.
- Commented old code
sql/sql_lex.cc:
- set select_lex.parent_lex correctly
- set correct state of the current name resolution context
sql/sql_lex.h:
- Added a stack of name resolution contexts to support local
contexts for JOIN ... ON conditions.
- Commented old code.
sql/sql_load.cc:
- Pass the FROM clause to setup_tables.
sql/sql_olap.cc:
- Pass the FROM clause to setup_tables.
sql/sql_parse.cc:
- correctly set SELECT_LEX::parent_lex
- set the first table of the current name resoltion context
- added support for NATURAL/USING joins
- commented old code
sql/sql_select.cc:
- Pass the FROM clause to setup_tables.
- Pass the end table to find_field_in_tables
- Improved comments
sql/sql_show.cc:
- Set SELECT_LEX::parent_lex.
sql/sql_update.cc:
- Pass the FROM clause to setup_tables.
sql/sql_yacc.yy:
- Added support for a stack of name resolution contexts needed to
implement name resolution for JOIN ... ON. A context is pushed
for each new JOIN ... ON, and popped afterwards.
- Added support for NATURAL/USING joins.
sql/table.cc:
- Added new class Natural_join_column to hide the heterogeneous
representation of column references for stored tables and for
views.
- Added a new list TABLE_LIST::next_name_resolution_table to
support name resolution with NATURAL/USING joins. Also added
other members to TABLE_LIST to support NATURAL/USING joins.
- Added a generic iterator over the fields of table references
of various types - class Field_iterator_table_ref
sql/table.h:
- Added new class Natural_join_column to hide the heterogeneous
representation of column references for stored tables and for
views.
- Added a new list TABLE_LIST::next_name_resolution_table to
support name resolution with NATURAL/USING joins. Also added
other members to TABLE_LIST to support NATURAL/USING joins.
- Added a generic iterator over the fields of table references
of various types - class Field_iterator_table_ref
tests/mysql_client_test.c:
Adjusted according to standard NATURAL JOIN syntax.
2005-08-12 16:57:19 +02:00
|
|
|
|
--error 1054
|
2003-01-06 00:48:59 +01:00
|
|
|
|
select count(not_existing_database.t1) from t1;
|
Implementation of WL#2486 -
"Process NATURAL and USING joins according to SQL:2003".
* Some of the main problems fixed by the patch:
- in "select *" queries the * expanded correctly according to
ANSI for arbitrary natural/using joins
- natural/using joins are correctly transformed into JOIN ... ON
for any number/nesting of the joins.
- column references are correctly resolved against natural joins
of any nesting and combined with arbitrary other joins.
* This patch also contains a fix for name resolution of items
inside the ON condition of JOIN ... ON - in this case items must
be resolved only against the JOIN operands. To support such
'local' name resolution, the patch introduces a stack of
name resolution contexts used at parse time.
NOTICE:
- This patch is not complete in the sense that
- there are 2 test cases that still do not pass -
one in join.test, one in select.test. Both are marked
with a comment "TODO: WL#2486".
- it does not include a new test specific for the task
mysql-test/include/ps_query.inc:
Adjusted according to standard NATURAL/USING join semantics.,
mysql-test/r/bdb.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/derived.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/errors.result:
The column as a whole cannot be resolved, so different error message.
mysql-test/r/fulltext.result:
Adjusted according to standard JOIN ... ON semantics =>
the ON condition can refer only to the join operands.
mysql-test/r/fulltext_order_by.result:
More detailed error message.
mysql-test/r/innodb.result:
Adjusted according to standard NATURAL/USING join semantics.
This test doesn't pass completetly yet!
mysql-test/r/insert_select.result:
More detailed error message.
mysql-test/r/join.result:
Adjusted according to standard NATURAL/USING join semantics.
NOTICE: there is one test case that still fails, and it is
commeted out and marked with WL#2486 in the test file.
mysql-test/r/join_crash.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/join_nested.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/join_outer.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/multi_update.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/null_key.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/order_by.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/ps_2myisam.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/ps_3innodb.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/ps_4heap.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/ps_5merge.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/ps_6bdb.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/ps_7ndb.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/select.result:
Adjusted according to standard NATURAL/USING join semantics.
NOTICE: there is one failing test case which is commented with
WL#2486 in the test file.
mysql-test/r/subselect.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/type_ranges.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/union.result:
More detailed error message.
mysql-test/t/bdb.test:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/errors.test:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/fulltext.test:
Adjusted according to standard JOIN ... ON semantics =>
the ON condition can refer only to the join operands.
mysql-test/t/fulltext_order_by.test:
More detailed error message.
mysql-test/t/innodb.test:
Adjusted according to standard NATURAL/USING join semantics.
This test doesn't pass completetly yet!
mysql-test/t/insert_select.test:
More detailed error message.
mysql-test/t/join.test:
Adjusted according to standard NATURAL/USING join semantics.
NOTICE: there is one test case that still fails, and it is
commeted out and marked with WL#2486 in the test file.
mysql-test/t/join_crash.test:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/join_nested.test:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/join_outer.test:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/null_key.test:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/order_by.test:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/select.test:
Adjusted according to standard NATURAL/USING join semantics.
NOTICE: there is one test case that still fails, and it is
commeted out and marked with WL#2486 in the test file.
mysql-test/t/subselect.test:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/type_ranges.test:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/union.test:
More detailed error message.
sql/item.cc:
- extra parameter to find_field_in_tables
- find_field_in_real_table renamed to find_field_in_table
- fixed comments/typos
sql/item.h:
- added [first | last]_name_resolution_table to class
Name_resolution_context
- commented old code
- standardized formatting
sql/mysql_priv.h:
- refactored the find_field_in_XXX procedures,
- added a new procedure for natural join table references,
- renamed the find_field_in_XXX procedures to clearer names
sql/sp.cc:
- pass the top-most list of the FROM clause to setup_tables
- extra parameter to find_field_in_tables
sql/sql_acl.cc:
- renamed find_field_in_table => find_field_in_table_ref
- extra parameter to find_field_in_table_ref
- commented old code
sql/sql_base.cc:
This file contains the core of the implementation of the processing
of NATURAL/USING joins (WL#2486).
- added many comments to old code
- refactored the group of find_field_in_XXX procedures, and added a
new procedure for natural joins. There is one find_field_in_XXX procedure
per each type of table reference (stored table, merge view, or natural
join); one meta-procedure that selects the correct one depeneding on the
table reference; and one procedure that goes over a list of table
referenes.
- NATURAL/USING joins are processed through the procedures:
mark_common_columns, store_natural_using_join_columns,
store_top_level_join_columns, setup_natural_join_row_types.
The entry point to processing NATURAL/USING joins is the
procedure 'setup_natural_join_row_types'.
- Replaced the specialized Field_iterator_XXX iterators with one
generic iterator over the fields of a table reference.
- Simplified 'insert_fields' and 'setup_conds' due to encapsulation of
the processing of natural joins in a separate set of procedures.
sql/sql_class.h:
- Commented old code.
sql/sql_delete.cc:
- Pass the FROM clause to setup_tables.
sql/sql_help.cc:
- pass the end name resolution table to find_field_in_tables
- adjust the list of tables for name resolution
sql/sql_insert.cc:
- Changed the code that saves and restores the current context to
support the list of tables for name resolution -
context->first_name_resolution_table, and
table_list->next_name_resolution_table.
Needed to support an ugly trick to resolve inserted columns only in
the first table.
- Added Name_resolution_context::[first | last]_name_resolution_table.
- Commented old code
sql/sql_lex.cc:
- set select_lex.parent_lex correctly
- set correct state of the current name resolution context
sql/sql_lex.h:
- Added a stack of name resolution contexts to support local
contexts for JOIN ... ON conditions.
- Commented old code.
sql/sql_load.cc:
- Pass the FROM clause to setup_tables.
sql/sql_olap.cc:
- Pass the FROM clause to setup_tables.
sql/sql_parse.cc:
- correctly set SELECT_LEX::parent_lex
- set the first table of the current name resoltion context
- added support for NATURAL/USING joins
- commented old code
sql/sql_select.cc:
- Pass the FROM clause to setup_tables.
- Pass the end table to find_field_in_tables
- Improved comments
sql/sql_show.cc:
- Set SELECT_LEX::parent_lex.
sql/sql_update.cc:
- Pass the FROM clause to setup_tables.
sql/sql_yacc.yy:
- Added support for a stack of name resolution contexts needed to
implement name resolution for JOIN ... ON. A context is pushed
for each new JOIN ... ON, and popped afterwards.
- Added support for NATURAL/USING joins.
sql/table.cc:
- Added new class Natural_join_column to hide the heterogeneous
representation of column references for stored tables and for
views.
- Added a new list TABLE_LIST::next_name_resolution_table to
support name resolution with NATURAL/USING joins. Also added
other members to TABLE_LIST to support NATURAL/USING joins.
- Added a generic iterator over the fields of table references
of various types - class Field_iterator_table_ref
sql/table.h:
- Added new class Natural_join_column to hide the heterogeneous
representation of column references for stored tables and for
views.
- Added a new list TABLE_LIST::next_name_resolution_table to
support name resolution with NATURAL/USING joins. Also added
other members to TABLE_LIST to support NATURAL/USING joins.
- Added a generic iterator over the fields of table references
of various types - class Field_iterator_table_ref
tests/mysql_client_test.c:
Adjusted according to standard NATURAL JOIN syntax.
2005-08-12 16:57:19 +02:00
|
|
|
|
--error 1054
|
2003-01-06 00:48:59 +01:00
|
|
|
|
select count(not_existing_database.t1.a) from t1;
|
2001-06-05 02:38:10 +02:00
|
|
|
|
--error 1044,1146
|
|
|
|
|
select count(not_existing_database.t1.a) from not_existing_database.t1;
|
2003-01-06 00:48:59 +01:00
|
|
|
|
--error 1054
|
|
|
|
|
select 1 from t1 order by 2;
|
|
|
|
|
--error 1054
|
|
|
|
|
select 1 from t1 group by 2;
|
|
|
|
|
--error 1054
|
|
|
|
|
select 1 from t1 order by t1.b;
|
|
|
|
|
--error 1054
|
|
|
|
|
select count(*),b from t1;
|
2000-12-28 02:56:38 +01:00
|
|
|
|
drop table t1;
|
2005-07-28 02:22:47 +02:00
|
|
|
|
|
|
|
|
|
# End of 4.1 tests
|
2005-08-06 02:22:53 +02:00
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Bug #6080: Error message for a field with a display width that is too long
|
|
|
|
|
#
|
2005-08-08 20:42:09 +02:00
|
|
|
|
--error 1439
|
2005-08-06 02:22:53 +02:00
|
|
|
|
create table t1 (a int(256));
|
|
|
|
|
set sql_mode='traditional';
|
|
|
|
|
--error 1074
|
|
|
|
|
create table t1 (a varchar(66000));
|
2007-04-04 12:38:19 +02:00
|
|
|
|
set sql_mode=default;
|
2005-08-06 02:22:53 +02:00
|
|
|
|
|
2007-04-03 17:00:57 +02:00
|
|
|
|
#
|
|
|
|
|
# Bug #27513: mysql 5.0.x + NULL pointer DoS
|
|
|
|
|
#
|
|
|
|
|
CREATE TABLE t1 (a INT);
|
|
|
|
|
SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0)));
|
|
|
|
|
INSERT INTO t1 VALUES(1);
|
|
|
|
|
SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0)));
|
|
|
|
|
INSERT INTO t1 VALUES(2),(3);
|
|
|
|
|
SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0)));
|
|
|
|
|
DROP TABLE t1;
|
|
|
|
|
|
2007-06-18 15:35:01 +02:00
|
|
|
|
#
|
|
|
|
|
# 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;
|
2005-08-06 02:22:53 +02:00
|
|
|
|
# End of 5.0 tests
|
2009-10-15 14:23:43 +02:00
|
|
|
|
|
2009-11-21 00:06:30 +01:00
|
|
|
|
flush status;
|
|
|
|
|
--disable_warnings
|
|
|
|
|
drop table if exists t1, t2;
|
|
|
|
|
--enable_warnings
|
|
|
|
|
create table t1 (a int unique);
|
|
|
|
|
create table t2 (a int);
|
|
|
|
|
drop function if exists f1;
|
|
|
|
|
drop function if exists f2;
|
|
|
|
|
|
|
|
|
|
delimiter |;
|
|
|
|
|
|
|
|
|
|
create function f1() returns int
|
|
|
|
|
begin
|
|
|
|
|
insert into t1 (a) values (1);
|
|
|
|
|
insert into t1 (a) values (1);
|
|
|
|
|
return 1;
|
|
|
|
|
end|
|
|
|
|
|
create function f2() returns int
|
|
|
|
|
begin
|
|
|
|
|
insert into t2 (a) values (1);
|
|
|
|
|
return 2;
|
|
|
|
|
end|
|
|
|
|
|
delimiter ;|
|
|
|
|
|
|
|
|
|
|
flush status;
|
|
|
|
|
--error 1062
|
|
|
|
|
select f1(), f2();
|
|
|
|
|
show status like 'Com_insert';
|
|
|
|
|
select * from t1;
|
|
|
|
|
select * from t2;
|
|
|
|
|
drop table t1;
|
|
|
|
|
drop table t2;
|
|
|
|
|
drop function f1;
|
|
|
|
|
drop function f2;
|
2009-12-22 10:35:56 +01:00
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# testing the value encoding in the error messages
|
2009-10-15 14:23:43 +02:00
|
|
|
|
#
|
2009-12-22 10:35:56 +01:00
|
|
|
|
# should be TR\xC3\x9CE, TR<54>E, TR<54>E
|
2009-10-15 14:23:43 +02:00
|
|
|
|
#
|
|
|
|
|
SET NAMES utf8;
|
|
|
|
|
--error ER_WRONG_VALUE_FOR_VAR
|
|
|
|
|
SET sql_quote_show_create= _binary x'5452C39C45';
|
|
|
|
|
--error ER_WRONG_VALUE_FOR_VAR
|
|
|
|
|
SET sql_quote_show_create= _utf8 x'5452C39C45';
|
|
|
|
|
--error ER_WRONG_VALUE_FOR_VAR
|
|
|
|
|
SET sql_quote_show_create=_latin1 x'5452DC45';
|
|
|
|
|
--error ER_WRONG_VALUE_FOR_VAR
|
|
|
|
|
SET sql_quote_show_create='TRÜE';
|
|
|
|
|
--error ER_WRONG_VALUE_FOR_VAR
|
|
|
|
|
SET sql_quote_show_create=TRÜE;
|
|
|
|
|
|
|
|
|
|
SET NAMES latin1;
|
|
|
|
|
--error ER_WRONG_VALUE_FOR_VAR
|
|
|
|
|
SET sql_quote_show_create= _binary x'5452C39C45';
|
|
|
|
|
--error ER_WRONG_VALUE_FOR_VAR
|
|
|
|
|
SET sql_quote_show_create= _utf8 x'5452C39C45';
|
|
|
|
|
--error ER_WRONG_VALUE_FOR_VAR
|
|
|
|
|
SET sql_quote_show_create=_latin1 x'5452DC45';
|
|
|
|
|
--error ER_WRONG_VALUE_FOR_VAR
|
2009-12-22 10:35:56 +01:00
|
|
|
|
SET sql_quote_show_create='TR<54>E';
|
2009-10-15 14:23:43 +02:00
|
|
|
|
--error ER_WRONG_VALUE_FOR_VAR
|
2009-12-22 10:35:56 +01:00
|
|
|
|
SET sql_quote_show_create=TR<54>E;
|
2009-10-15 14:23:43 +02:00
|
|
|
|
|
|
|
|
|
SET NAMES binary;
|
|
|
|
|
--error ER_WRONG_VALUE_FOR_VAR
|
|
|
|
|
SET sql_quote_show_create= _binary x'5452C39C45';
|
|
|
|
|
--error ER_WRONG_VALUE_FOR_VAR
|
|
|
|
|
SET sql_quote_show_create= _utf8 x'5452C39C45';
|
|
|
|
|
--error ER_WRONG_VALUE_FOR_VAR
|
|
|
|
|
SET sql_quote_show_create=_latin1 x'5452DC45';
|
2009-12-22 10:35:56 +01:00
|
|
|
|
|
2010-05-27 18:01:43 +02:00
|
|
|
|
--echo #
|
|
|
|
|
--echo # Bug#52430 Incorrect key in the error message for duplicate key error involving BINARY type
|
|
|
|
|
--echo #
|
|
|
|
|
CREATE TABLE t1(c1 BINARY(10), c2 BINARY(10), c3 BINARY(10),
|
|
|
|
|
PRIMARY KEY(c1,c2,c3));
|
|
|
|
|
INSERT INTO t1 (c1,c2,c3) VALUES('abc','abc','abc');
|
|
|
|
|
--error ER_DUP_ENTRY
|
|
|
|
|
INSERT INTO t1 (c1,c2,c3) VALUES('abc','abc','abc');
|
|
|
|
|
DROP TABLE t1;
|
|
|
|
|
|
|
|
|
|
CREATE TABLE t1 (f1 VARBINARY(19) PRIMARY KEY);
|
|
|
|
|
INSERT INTO t1 VALUES ('abc\0\0');
|
|
|
|
|
--error ER_DUP_ENTRY
|
|
|
|
|
INSERT INTO t1 VALUES ('abc\0\0');
|
|
|
|
|
DROP TABLE t1;
|
2010-11-04 09:36:04 +01:00
|
|
|
|
|
|
|
|
|
--echo #
|
|
|
|
|
--echo # Bug#57882: Item_func_conv_charset::val_str(String*):
|
|
|
|
|
--echo # Assertion `fixed == 1' failed
|
|
|
|
|
--echo #
|
|
|
|
|
|
|
|
|
|
--error ER_DATA_OUT_OF_RANGE
|
|
|
|
|
SELECT (CONVERT('0' USING latin1) IN (CHAR(COT('v') USING utf8),''));
|
|
|
|
|
|
|
|
|
|
SET NAMES utf8 COLLATE utf8_latvian_ci ;
|
|
|
|
|
--error ER_DATA_OUT_OF_RANGE
|
2010-11-04 13:36:36 +01:00
|
|
|
|
SELECT UPDATEXML(-73 * -2465717823867977728,@@global.auto_increment_increment,null);
|
2010-11-04 09:36:04 +01:00
|
|
|
|
|
|
|
|
|
--echo #
|
|
|
|
|
--echo # End Bug#57882
|
|
|
|
|
--echo #
|
2012-03-12 09:24:59 +01:00
|
|
|
|
|
2012-03-12 08:56:56 +01:00
|
|
|
|
#
|
|
|
|
|
# Bug #13031606 VALUES() IN A SELECT STATEMENT CRASHES SERVER
|
|
|
|
|
#
|
|
|
|
|
CREATE TABLE t1 (a INT);
|
|
|
|
|
CREATE TABLE t2(a INT PRIMARY KEY, b INT);
|
|
|
|
|
--error ER_BAD_FIELD_ERROR
|
2017-10-28 20:54:18 +02:00
|
|
|
|
SELECT '' AS b FROM t1 GROUP BY VALUE(b);
|
2012-03-12 08:56:56 +01:00
|
|
|
|
--error ER_BAD_FIELD_ERROR
|
2017-10-28 20:54:18 +02:00
|
|
|
|
REPLACE t2(b) SELECT '' AS b FROM t1 GROUP BY VALUE(b);
|
2012-03-12 08:56:56 +01:00
|
|
|
|
--error ER_BAD_FIELD_ERROR
|
2017-10-28 20:54:18 +02:00
|
|
|
|
UPDATE t2 SET a=(SELECT '' AS b FROM t1 GROUP BY VALUE(b));
|
2012-03-12 08:56:56 +01:00
|
|
|
|
--error ER_BAD_FIELD_ERROR
|
|
|
|
|
INSERT INTO t2 VALUES (1,0) ON DUPLICATE KEY UPDATE
|
2017-10-28 20:54:18 +02:00
|
|
|
|
b=(SELECT '' AS b FROM t1 GROUP BY VALUE(b));
|
2012-03-12 08:56:56 +01:00
|
|
|
|
INSERT INTO t2(a,b) VALUES (1,0) ON DUPLICATE KEY UPDATE
|
2017-10-28 20:54:18 +02:00
|
|
|
|
b=(SELECT VALUE(a)+2 FROM t1);
|
2012-03-12 08:56:56 +01:00
|
|
|
|
DROP TABLE t1, t2;
|
2012-08-29 10:35:42 +02:00
|
|
|
|
|
|
|
|
|
--echo #
|
|
|
|
|
--echo # MDEV-492: incorrect error check before sending OK in mysql_update
|
|
|
|
|
--echo #
|
|
|
|
|
CREATE TABLE t1 (a CHAR(3), b BLOB);
|
|
|
|
|
--error ER_DYN_COL_DATA
|
|
|
|
|
UPDATE t1 SET a = 'new'
|
|
|
|
|
WHERE COLUMN_CREATE( 1, 'v', 1, 'w' ) IS NULL;
|
|
|
|
|
drop table t1;
|
2017-06-15 20:16:18 +02:00
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# errors caused by max_session_mem_used
|
|
|
|
|
#
|
2020-03-16 16:53:10 +01:00
|
|
|
|
set @max_session_mem_used_save= @@max_session_mem_used;
|
|
|
|
|
|
2017-08-05 18:26:10 +02:00
|
|
|
|
--disable_result_log
|
|
|
|
|
set max_session_mem_used = 50000;
|
|
|
|
|
--error 0,ER_OPTION_PREVENTS_STATEMENT
|
|
|
|
|
select * from seq_1_to_1000;
|
2017-06-15 20:16:18 +02:00
|
|
|
|
set max_session_mem_used = 8192;
|
2017-08-05 18:26:10 +02:00
|
|
|
|
--error 0,ER_OPTION_PREVENTS_STATEMENT
|
2017-06-15 20:16:18 +02:00
|
|
|
|
select * from seq_1_to_1000;
|
2017-08-05 18:26:10 +02:00
|
|
|
|
--enable_result_log
|
|
|
|
|
# We may not be able to execute any more queries with this connection
|
|
|
|
|
# because of too little memory#
|
2017-11-03 06:27:53 +01:00
|
|
|
|
|
2020-03-16 16:53:10 +01:00
|
|
|
|
set max_session_mem_used = @max_session_mem_used_save;
|
|
|
|
|
|
|
|
|
|
--echo #
|
|
|
|
|
--echo # MDEV-20604: Duplicate key value is silently truncated to 64
|
|
|
|
|
--echo # characters in print_keydup_error
|
|
|
|
|
--echo #
|
|
|
|
|
|
|
|
|
|
create table t1 (a varchar(100), UNIQUE KEY akey (a));
|
|
|
|
|
|
|
|
|
|
insert into t1 values ("1234567890123456789012345678901234567890123456789012345678901234567890_end");
|
|
|
|
|
--echo # The value in the error message should show truncation with "..."
|
|
|
|
|
--error ER_DUP_ENTRY
|
|
|
|
|
insert into t1 values ("1234567890123456789012345678901234567890123456789012345678901234567890_end");
|
|
|
|
|
|
|
|
|
|
drop table t1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--echo # End of 10.2 tests
|
2017-11-03 06:27:53 +01:00
|
|
|
|
|
|
|
|
|
--echo #
|
|
|
|
|
--echo # MDEV-14269 errors.test fails with valgrind (Conditional jump or move depends on uninitialised value)
|
|
|
|
|
--echo #
|
|
|
|
|
|
|
|
|
|
SET NAMES utf8;
|
|
|
|
|
--error ER_DATA_OUT_OF_RANGE
|
|
|
|
|
SELECT UPDATEXML(-73 * -2465717823867977728,@@global.auto_increment_increment,null);
|
|
|
|
|
--error ER_DATA_OUT_OF_RANGE
|
|
|
|
|
SELECT UPDATEXML(-73 * -2465717823867977728,@@global.long_query_time,null);
|
2020-04-15 08:56:03 +02:00
|
|
|
|
|
|
|
|
|
-- echo # End of 10.3 tests
|
2020-08-28 16:05:38 +02:00
|
|
|
|
|
|
|
|
|
--echo #
|
|
|
|
|
--echo # MDEV-23518: Syntax error in ond SP results in misleading
|
|
|
|
|
--echo # message on SHOW CREATE PROCEDURE
|
|
|
|
|
--echo #
|
|
|
|
|
|
|
|
|
|
DELIMITER $$;
|
|
|
|
|
|
|
|
|
|
CREATE PROCEDURE P1 ()
|
|
|
|
|
BEGIN NOT ATOMIC
|
|
|
|
|
IF (SELECT 2) THEN
|
|
|
|
|
SELECT 4;
|
|
|
|
|
END IF ;
|
|
|
|
|
END;
|
|
|
|
|
$$
|
|
|
|
|
|
|
|
|
|
DELIMITER ;$$
|
|
|
|
|
|
|
|
|
|
select name,db,body from mysql.proc where name = "P1";
|
|
|
|
|
update mysql.proc set body_utf8="BEGIN NOT ATOMIC
|
|
|
|
|
IF (SELECT 2) OR foo = 3 THEN
|
|
|
|
|
SELECT 4;
|
|
|
|
|
END IF ;
|
|
|
|
|
END", body="BEGIN NOT ATOMIC
|
|
|
|
|
IF (SELECT 2) OR foo = 3 THEN
|
|
|
|
|
SELECT 4;
|
|
|
|
|
END IF ;
|
|
|
|
|
END"where name = "P1";
|
|
|
|
|
|
|
|
|
|
--error ER_SP_PROC_TABLE_CORRUPT
|
|
|
|
|
show create procedure P1;
|
|
|
|
|
show warnings;
|
|
|
|
|
|
|
|
|
|
drop procedure P1;
|
|
|
|
|
|
|
|
|
|
-- echo # End of 10.4 tests
|