1. 31 Jan, 2007 2 commits
    • unknown's avatar
      Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · 756d67c0
      unknown authored
      into  rakia.gmz:/home/kgeorge/mysql/autopush/B25575-5.0-opt
      
      
      sql/mysql_priv.h:
        Auto merged
      sql/sql_lex.h:
        Auto merged
      sql/sql_parse.cc:
        Auto merged
      sql/sql_yacc.yy:
        Auto merged
      sql/table.cc:
        Auto merged
      756d67c0
    • unknown's avatar
      BUG#25575: ERROR 1052 (Column in from clause is ambiguous) with sub-join · c2ff0cc4
      unknown authored
       Two problems here:
      
       Problem 1:
      
       While constructing the join columns list the optimizer does as follows:
        1. Sets the join_using_fields/natural_join members of the right JOIN 
         operand.
        2. Makes a "table reference" (TABLE_LIST) to parent the two tables.
        3. Assigns the join_using_fields/is_natural_join of the wrapper table
         using join_using_fields/natural_join of the rightmost table
        4. Sets join_using_fields to NULL for the right JOIN operand.
        5. Passes the parent table up to the same procedure on the upper 
         level.
      
       Step 1 overrides the the join_using_fields that are set for a nested 
       join wrapping table in step 4.
       Fixed by making a designated variable SELECT_LEX::prev_join_using to 
       pass the data from step 1 to step 4 without destroying the wrapping 
       table data.
      
       Problem 2:
      
       The optimizer checks for ambiguous columns while transforming 
       NATURAL JOIN/JOIN USING to JOIN ON. While doing that there was no
       distinction between columns that are used in the generated join
       condition (where ambiguity can be checked) and the other columns
       (where ambiguity can be checked only when resolving references
       coming from outside the JOIN construct itself).
       Fixed by allowing the non-USING columns to be present in multiple 
       copies in both sides of the join and moving the ambiguity check 
       to the place where unqualified references to the join columns are
       resolved (find_field_in_natural_join()).
      
      
      mysql-test/r/join_nested.result:
        BUG#25575: ERROR 1052 (Column in from clause is ambiguous) with sub-join
         - test case
      mysql-test/t/join_nested.test:
        BUG#25575: ERROR 1052 (Column in from clause is ambiguous) with sub-join
         - test case
      sql/mysql_priv.h:
        BUG#25575: ERROR 1052 (Column in from clause is ambiguous) with sub-join
         - use SELECT_LEX to store the ref to JOIN USING list needed by the 
           parser
      sql/sql_base.cc:
        BUG#25575: ERROR 1052 (Column in from clause is ambiguous) with sub-join
         - proper check for duplicate cols
         - more detailed debug output
      sql/sql_lex.h:
        BUG#25575: ERROR 1052 (Column in from clause is ambiguous) with sub-join
         - use SELECT_LEX to store the ref to JOIN USING list needed by the 
           parser
      sql/sql_parse.cc:
        BUG#25575: ERROR 1052 (Column in from clause is ambiguous) with sub-join
         - proper check for duplicate cols in JOIN USING
      sql/sql_yacc.yy:
        BUG#25575: ERROR 1052 (Column in from clause is ambiguous) with sub-join
         - use SELECT_LEX to store the ref to JOIN USING list needed by the 
           parser
      sql/table.cc:
        BUG#25575: ERROR 1052 (Column in from clause is ambiguous) with sub-join
         - return null if no table ref (as in nested join columns).
      c2ff0cc4
  2. 30 Jan, 2007 2 commits
    • unknown's avatar
      Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · cb0943e7
      unknown authored
      into  rakia.gmz:/home/kgeorge/mysql/autopush/B25643-5.0-opt
      
      cb0943e7
    • unknown's avatar
      Bug #25643: SEC_TO_TIME function problem · 59bdd12f
      unknown authored
       Checking for NULL before calling the val_xxx()
       methods only checks for such arguments that are 
       known to be NULLs at compile time. 
       The arguments that may or may not contain
       NULLs (e.g. function calls and possibly others)
       are not checked at all.
       Fixed by first calling the val_xxx() method and
       then checking for null in SEC_TO_TIME().
       In addition QUARTER() was not returning 0 (as all the 
       val_int() functions do when processing a NULL value).
      
      
      mysql-test/r/func_time.result:
        Bug #25643: SEC_TO_TIME function problem
         - test case
      mysql-test/t/func_time.test:
        Bug #25643: SEC_TO_TIME function problem
         - test case
      sql/item_timefunc.cc:
        Bug #25643: SEC_TO_TIME function problem
         - null handling fixed for QUARTER() and SEC_TO_TIME()
      59bdd12f
  3. 27 Jan, 2007 1 commit
    • unknown's avatar
      Fixed bug #24420. · 30161731
      unknown authored
      Objects of the classes Item_func_is_not_null_test and Item_func_trig_cond
      must be transparent for the method Item::split_sum_func2 as these classes
      are pure helpers. It means that the method Item::split_sum_func2 should
      look at those objects as at pure wrappers.
      
      
      mysql-test/r/subselect3.result:
        Added a test case for bug #24420.
      mysql-test/t/subselect3.test:
        Added a test case for bug #24420.
      30161731
  4. 26 Jan, 2007 5 commits
    • unknown's avatar
      Merge olga.mysql.com:/home/igor/mysql-5.0-opt · 0e5890e1
      unknown authored
      into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug24653
      
      
      sql/item.h:
        Auto merged
      0e5890e1
    • unknown's avatar
      Merge mysql.com:/home/gluh/MySQL/Merge/5.0-opt · 8b12f20a
      unknown authored
      into  mysql.com:/home/gluh/MySQL/Merge/5.0
      
      
      sql/item.h:
        Auto merged
      sql/sql_table.cc:
        Auto merged
      sql/sql_update.cc:
        Auto merged
      8b12f20a
    • unknown's avatar
      Post merge fix · 9c70d40a
      unknown authored
      9c70d40a
    • unknown's avatar
      Merge olga.mysql.com:/home/igor/dev-opt/mysql-4.1-opt-bug24653 · a0d5ced4
      unknown authored
      into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug24653
      
      
      sql/item.cc:
        Auto merged
      sql/item.h:
        Auto merged
      sql/item_cmpfunc.cc:
        Auto merged
      sql/item_func.cc:
        Auto merged
      sql/sql_select.cc:
        Auto merged
      mysql-test/r/subselect.result:
        Manual merge
      mysql-test/t/subselect.test:
        Manual merge
      sql/filesort.cc:
        Manual merge
      sql/item_cmpfunc.h:
        Manual merge
      sql/item_subselect.cc:
        Manual merge
      a0d5ced4
    • unknown's avatar
      Fixed bug #24653. · 78c3a85d
      unknown authored
      The bug report has demonstrated the following two problems.
      1. If an ORDER/GROUP BY list includes a constant expression being 
      optimized away and, at the same time, containing single-row
      subselects that return more that one row, no error is reported.
      Strictly speaking the standard allows to ignore error in this case.
      Yet, now a corresponding fatal error is reported in this case.
      2. If a query requires sorting by expressions containing single-row
      subselects that, however, return more than one row, then the execution
      of the query may cause a server crash. 
      To fix this some code has been added that blocks execution of a subselect
      item in case of a fatal error in the method Item_subselect::exec.
      
      
      mysql-test/r/subselect.result:
        Added a test cases for bug #24653.
      mysql-test/t/subselect.test:
        Added a test cases for bug #24653.
      sql/filesort.cc:
        Fixed bug #24653.
        Added a check for fatal error after reading the next row from the table
        in the function find_all_keys.
      sql/item.cc:
        Fixed bug #24653.
        Down-ported calculation of the attribute with_subselect of for Item objects.
      sql/item.h:
        Fixed bug #24653.
        Down-ported calculation of the attribute with_subselect of for Item objects.
      sql/item_cmpfunc.cc:
        Fixed bug #24653.
        Down-ported calculation of the attribute with_subselect of for Item objects.
      sql/item_cmpfunc.h:
        Fixed bug #24653.
        Down-ported calculation of the attribute with_subselect of for Item objects.
      sql/item_func.cc:
        Fixed bug #24653.
        Down-ported calculation of the attribute with_subselect of for Item objects.
      sql/item_subselect.cc:
        Fixed bug #24653.
        Added a check for fatal error in the method Item_subselect::exec
        to block evaluation of subselects in erroneous situations.
        Down-ported calculation of the attribute with_subselect of for Item objects.
      sql/sql_select.cc:
        Fixed bug #24653.
        Added a check to verify that any constant expression used
        in ORDER BY and/or GROUP BY lists which is optimized away
        does not contain subselects returning more than one row.
        If it does a fatal error is reported.
      78c3a85d
  5. 25 Jan, 2007 1 commit
  6. 24 Jan, 2007 22 commits
  7. 23 Jan, 2007 7 commits