mariadb/mysql-test/include
unknown 7517d7e112 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 17:57:19 +03:00
..
big_test.inc Moved some old test and added a new test to only be run with mysql-test-run --big 2005-04-07 19:24:14 +03:00
check_var_limit.inc Add detection of in_addr_t 2003-08-28 06:08:17 +03:00
ctype_common.inc Privileges columns were removed from output to be able 2004-12-10 17:58:13 +04:00
ctype_filesort.inc bug#7284: strnxfrm returns different results for equal strings 2005-01-13 18:12:04 +04:00
ctype_innodb_like.inc ctype_innodb_like.inc: 2005-07-06 17:16:22 +05:00
endspace.inc Move common trailing space checks into an include file. 2004-12-01 19:25:05 +04:00
federated.inc This is the same patch as 1.1937, with small variable declaration changes, memory 2005-07-15 17:33:47 -07:00
federated_cleanup.inc This is the same patch as 1.1937, with small variable declaration changes, memory 2005-07-15 17:33:47 -07:00
have_archive.inc Added tests for archive. Cleaned up a merge mistake and added some information on how well archive compresses. 2004-05-25 13:27:01 -07:00
have_bdb.inc changes to make things work in the max version 2001-10-04 15:42:25 -06:00
have_big5.inc "like" did not work in some cases with character set big5 2003-12-24 16:59:48 +04:00
have_blackhole.inc Additional storage engine called "blackhole". Customer request, and for that matter a Zawodny request. With this you can alter table to a type of table that would never store data. Its a /dev/null for a database. 2005-03-22 16:10:39 -08:00
have_compress.inc added compress/uncompress function 2003-04-09 20:50:30 -04:00
have_cp932.inc Added cp932 character set 2005-05-05 10:36:17 -07:00
have_cp1250_ch.inc Bug#8840 Empty string comparison and character set 'cp1250' 2005-03-03 14:15:37 +04:00
have_crypt.inc Fixes for Netware 2003-01-28 08:38:28 +02:00
have_csv.inc This is the addition of the CSV engine "aka tina". Its an example engine that works as a plain text file. 2004-08-12 20:57:18 -07:00
have_debug.inc Robustness feature. 2004-06-20 19:11:02 +02:00
have_eucjpms.inc Skip cp932 and eucjpms tests when the character sets are not compiled. 2005-02-01 14:37:51 +04:00
have_exampledb.inc Adding test cases for the example storage engine (so that you can test to see if it was built correctly). 2004-08-13 17:14:36 -07:00
have_federated_db.inc -Added quote_data and needs_quotes (moved from federated handler. 2005-01-20 18:36:40 -08:00
have_gbk.inc ctype-gbk.c: 2005-07-22 21:06:02 +05:00
have_geometry.inc WL#1163 (Make spatial code separable for other parts) 2004-05-27 20:31:30 +05:00
have_innodb.inc changes to make things work in the max version 2001-10-04 15:42:25 -06:00
have_multi_ndb.inc Fix for Bug #8753 Invalid schema object version after dropping index 2005-03-07 10:21:38 +01:00
have_ndb.inc Merge 2005-02-07 18:05:11 +01:00
have_openssl.inc changes to make things work in the max version 2001-10-04 15:42:25 -06:00
have_openssl_1.inc Openssl test 2003-03-11 13:41:53 +04:00
have_outfile.inc Bug#8191 - SELECT INTO OUTFILE insists on FROM clause 2005-05-08 22:56:58 +01:00
have_query_cache.inc A lot of fixes for prepared statements (PS): 2004-10-26 19:30:01 +03:00
have_sjis.inc #3290: Can't convert sjis&ujis half-width katakana correctly 2004-03-25 14:29:56 +04:00
have_tis620.inc Bug 1552: 2003-12-25 20:11:01 +04:00
have_ucs2.inc Character set sets now check if required non-dynamic charsets were really compiled 2003-05-23 15:10:05 +05:00
have_ujis.inc Character set sets now check if required non-dynamic charsets were really compiled 2003-05-23 15:10:05 +05:00
master-slave.inc Do not give an error when the user does START SLAVE on an already 2003-03-03 23:12:17 +01:00
ndb_default_cluster.inc added check in ndb tests that require "default" cluster running 2005-01-26 14:38:13 +01:00
not_embedded.inc After merge fixes 2003-05-21 21:39:58 +03:00
not_openssl.inc BUG#10589: des_encrypt functionality always return NULL 2005-06-17 18:07:46 +02:00
ps_conv.inc The BIT patch by ramil causes that the old data type BIT is no 2004-12-17 14:27:39 +01:00
ps_create.inc bug#10466: Datatype "timestamp" displays "YYYYMMDDHHMMSS" irrespective of display sizes. 2005-06-20 12:09:00 +02:00
ps_modify.inc Patch two (the final one) for Bug#7306 "the server side preparedStatement 2005-06-07 14:11:36 +04:00
ps_modify1.inc Small bug fix 2004-12-13 21:00:43 +01:00
ps_query.inc Implementation of WL#2486 - 2005-08-12 17:57:19 +03:00
ps_renew.inc Results of WL#1856 "Conversion of client_test.c tests cases to mysqltest 2004-09-25 19:08:02 +04:00
rpl_stmt_seq.inc Fix of 5.0 tree 2005-06-17 14:03:27 +02:00
show_msg.inc Improvement of the auxiliary routines include/show_msg*.inc 2005-06-15 19:16:17 +02:00
show_msg80.inc Post review fixes 2005-06-16 12:46:09 +02:00
system_db_struct.inc Add all SQL_MODE settings to proc table. (Bug #8902) 2005-03-08 17:40:43 -08:00
test_outfile.inc Bug#8191 - SELECT INTO OUTFILE insists on FROM clause 2005-05-08 22:56:58 +01:00
testdb_only.inc WL#1420 convert NIST test for mysql 2005-01-26 10:19:28 +01:00
varchar.inc A fix (bug #10176: problem with varchar keys). 2005-04-26 19:46:52 +05:00