1. 12 Aug, 2005 1 commit
    • unknown's avatar
      Implementation of WL#2486 - · 7517d7e1
      unknown authored
      "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.
      7517d7e1
  2. 02 Aug, 2005 9 commits
  3. 01 Aug, 2005 6 commits
  4. 31 Jul, 2005 13 commits
    • unknown's avatar
      After merge fixes · a560a9f3
      unknown authored
      Review of new pushed code
      
      
      client/mysqlbinlog.cc:
        After merge fixes
      sql/set_var.cc:
        After merge fixes
      sql/sql_select.cc:
        Removed not needed test (field->maybe_null() also tests field->table->maybe_null)
      a560a9f3
    • unknown's avatar
      Fix for bug#12021 · 35fd6415
      unknown authored
      35fd6415
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0 · 4dbc076e
      unknown authored
      into  mishka.local:/home/my/mysql-5.0
      
      
      sql/sql_select.cc:
        Auto merged
      4dbc076e
    • unknown's avatar
      Merge aschwenke@bk-internal.mysql.com:/home/bk/mysql-5.0 · 2fa55b0a
      unknown authored
      into  alpha.xl.local:/home/schwenke/Work/MySQL/BK-internal-tree/mysql-5.0
      
      
      sql/sql_select.cc:
        Auto merged
      2fa55b0a
    • unknown's avatar
      Merge rurik.mysql.com:/home/igor/mysql-4.1 · b86a3bc3
      unknown authored
      into rurik.mysql.com:/home/igor/dev/mysql-4.1-0
      
      
      b86a3bc3
    • unknown's avatar
      Merge rurik.mysql.com:/home/igor/dev/mysql-4.1-0 · 9cd0ecc8
      unknown authored
      into rurik.mysql.com:/home/igor/dev/mysql-5.0-0
      
      
      mysql-test/r/null_key.result:
        Auto merged
      mysql-test/t/null_key.test:
        Auto merged
      9cd0ecc8
    • unknown's avatar
      null_key.result, null_key.test: · 846277d8
      unknown authored
        Modified test case for bug #12144.
      
      
      mysql-test/t/null_key.test:
        Modified test case for bug #12144.
      mysql-test/r/null_key.result:
        Modified test case for bug #12144.
      846277d8
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0 · e43a6096
      unknown authored
      into  mishka.local:/home/my/mysql-5.0
      
      
      mysql-test/t/sp.test:
        Auto merged
      sql/set_var.cc:
        Auto merged
      sql/sql_view.cc:
        Auto merged
      client/client_priv.h:
        Simple merge
      client/mysqldump.c:
        Simple merge
      mysql-test/r/variables.result:
        Simple merge
      mysql-test/t/variables.test:
        Simple merge
      sql/sql_trigger.cc:
        Simple merge
      e43a6096
    • unknown's avatar
      Fixes during review of new pushed code · 6b3478ec
      unknown authored
      Change bool in C code to my_bool
      Added to mysqltest --enable_parsning and --disable_parsing to avoid to have to comment parts of tests
      Added comparison of LEX_STRING's and use this to compare file types for view and trigger files.
      
      
      client/client_priv.h:
        Added OPT_TRIGGERS (to get rid of compiler warning)
      client/mysql.cc:
        Added cast to get rid of compiler warning
      client/mysqldump.c:
        Added OPT_TRIGGERS (to get rid of compiler warning)
        Abort if we can't write to outfile (even if --ignore-errors is given)
      client/mysqltest.c:
        Added --enable_parsning and --disable_parsing to avoid to have to comment parts of tests
      include/my_sys.h:
        Make my_progname const
      include/my_time.h:
        Avoid using 'bool' in C programs
      mysql-test/lib/init_db.sql:
        Align with mysql_create_system_tables
        (Ideally this file should be auto-generated from the above script)
      mysql-test/r/mysqltest.result:
        Test for --enable_parsing
      mysql-test/r/variables.result:
        Update results after fix for overflow checking of max_heap_table_size
      mysql-test/t/information_schema.test:
        USe --enable/disable parsing instead of comments
      mysql-test/t/mysqltest.test:
        Test for --enable_parsing
      mysql-test/t/sp.test:
        USe --enable/disable parsing instead of comments
      mysql-test/t/variables.test:
        Portability fix for 64 bit systems
      mysql-test/t/view.test:
        USe --enable/disable parsing instead of comments
      mysys/my_init.c:
        May my_progname const
      mysys/my_static.c:
        May my_progname const
      mysys/thr_lock.c:
        Remove not needed casts
      sql-common/my_time.c:
        Change bool -> my_bool as bool is not portable in C programs
      sql/field.cc:
        Test number_to_datetime() for -1 instead of < 0 (Safety fix)
        New prototype for TIME_to_timestamp()
      sql/item.h:
        Don't have prototypes for both uint32 and ulong as these 'may' be the same thing
      sql/item_timefunc.cc:
        New prototype for TIME_to_timestamp()
      sql/log.cc:
        Remove compiler warnings
      sql/mysql_priv.h:
        New prototype for TIME_to_timestamp()
        Added function for comparing LEX_STRING
      sql/set_var.cc:
        Added overflow checking when setting ulong variable
      sql/sql_base.cc:
        Added function is_equal()
        Changed strncmp -> is_equal() as strncmp() to not match "V" (instead of "VIEW")
      sql/sql_class.cc:
        Added comment
      sql/sql_select.cc:
        Portability fixes
        After review fixes
      sql/sql_trigger.cc:
        Use 'tables_alias_charset' for comparing database name
        Use 'is_equal()' to compare file type. (Old code didn't do the comparison correctly)
      sql/sql_view.cc:
        Use 'is_equal()' to compare file type. (Old code didn't do the comparison correctly)
      sql/time.cc:
        New prototype for TIME_to_timestamp() to allow easyer mapping to C function
      sql/tztime.cc:
        bool -> my_bool (to allow calling C code from C++ code)
      sql/tztime.h:
        bool -> my_bool (to allow calling C code from C++ code)
      6b3478ec
    • unknown's avatar
      Merge · 6c40ce76
      unknown authored
      
      VC++Files/client/mysqlclient_ia64.dsp:
        Auto merged
      include/config-win.h:
        Auto merged
      sql/item_sum.cc:
        SCCS merged
      6c40ce76
    • unknown's avatar
      Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-4.1 · 83304cd0
      unknown authored
      into rurik.mysql.com:/home/igor/mysql-4.1
      
      
      83304cd0
    • unknown's avatar
      Fixed bug #12095: a join query with GROUP_CONCAT over a single row table. · 2f47bc19
      unknown authored
      If GROUP_CONCAT is calculated we always put its argument into a temp
      table, even when the argument is a constant item.
      
      
      
      2f47bc19
    • unknown's avatar
      Merge rurik.mysql.com:/home/igor/mysql-5.0 · 629d59a8
      unknown authored
      into rurik.mysql.com:/home/igor/dev/mysql-5.0-0
      
      
      629d59a8
  5. 30 Jul, 2005 3 commits
  6. 29 Jul, 2005 8 commits
    • unknown's avatar
      Merge grichter@bk-internal.mysql.com:/home/bk/mysql-5.0 · 8867beec
      unknown authored
      into lmy002.wdf.sap.corp:/home/georg/work/mysql/prod/mysql-5.0
      
      
      8867beec
    • unknown's avatar
      Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0 · 7dafc733
      unknown authored
      into  sanja.is.com.ua:/home/bell/mysql/bk/work-trigger-5.0
      
      
      mysql-test/r/information_schema.result:
        Auto merged
      mysql-test/t/mysqldump.test:
        Auto merged
      sql/mysqld.cc:
        Auto merged
      sql/set_var.cc:
        Auto merged
      sql/sql_show.cc:
        Auto merged
      mysql-test/r/mysqldump.result:
        merge
      sql/sql_trigger.cc:
        merge
      7dafc733
    • unknown's avatar
      Added sql_mode saving to mysql_dump (BUG#5891, part 2) · 675c4bb4
      unknown authored
      
      client/client_priv.h:
        add OPT_ for --trigger parameter
      client/mysqldump.c:
        fixed short simbol for trigger
        fixed lines break for more compiler compatibility
        added sql_mode output
        added comments
        made protection of trigger and view restoring commands from execution by old versions of mysql
      mysql-test/r/mysqldump.result:
        changed test, to test sql_mode
      mysql-test/r/sp.result:
        now sql_mode preserved in SP
      mysql-test/t/mysqldump.test:
        changed test, to test sql_mode
      mysql-test/t/sp.test:
        now sql_mode preserved in SP
      sql/set_var.cc:
        fixed comment
      675c4bb4
    • unknown's avatar
      Merge mysql.com:/home/jimw/my/mysql-5.0-10351 · c7908e78
      unknown authored
      into  mysql.com:/home/jimw/my/mysql-5.0-clean
      
      
      mysql-test/t/select_safe.test:
        Auto merged
      mysql-test/t/variables.test:
        Auto merged
      sql/mysqld.cc:
        Auto merged
      c7908e78
    • unknown's avatar
      Merge grichter@bk-internal.mysql.com:/home/bk/mysql-5.0 · 243e9f32
      unknown authored
      into lmy002.wdf.sap.corp:/home/georg/work/mysql/prod/mysql-5.0
      
      
      sql/sql_prepare.cc:
        Auto merged
      243e9f32
    • unknown's avatar
      fixed two bugs that break Windows build · b66ffdcb
      unknown authored
      
      libmysql/libmysql.def:
        "get_defaults_files" has been renamed to "get_defaults_options"
        but was not removed here
      sql/sql_select.cc:
        pulled variable out of for() scope to satisfy dumb MSVC6 compiler
      b66ffdcb
    • unknown's avatar
      fix for bug#12665 · 52dfa3b8
      unknown authored
      macro floatget was missing in config-win.h
      
      
      52dfa3b8
    • unknown's avatar
      - fixed a typo in C++Files/client/mysqlclient_ia64.dsp: ctype-cp963.c -> ctype-cp932.c · 8cec8458
      unknown authored
        (thanks to JoergB for spotting it)
      
      
      VC++Files/client/mysqlclient_ia64.dsp:
        - fixed a typo: ctype-cp963.c -> ctype-cp932.c (thanks to JoergB for spotting it)
      8cec8458