1. 09 Sep, 2006 2 commits
  2. 07 Sep, 2006 2 commits
    • unknown's avatar
      Merge rurik.mysql.com:/home/igor/mysql-5.0-opt · 21be389b
      unknown authored
      into  rurik.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug21698
      
      
      sql/sql_select.cc:
        Auto merged
      21be389b
    • unknown's avatar
      Fixed bug #21698: erroneously a field could be replaced by an · 87166702
      unknown authored
      equal constant under any circumstances.
      In fact this substitution can be allowed if the field is
      not of a type string or if the field reference serves as 
      an argument of a comparison predicate.  
      
      
      mysql-test/r/func_str.result:
        Added test cases for bug #21698.
      mysql-test/r/heap_hash.result:
        Adjusted results after the fix for bug #21198.
      mysql-test/t/func_str.test:
        Added test cases for bug #21698.
      sql/item.cc:
        Fixed bug #21198.
        Added a method to check whether a field reference can be 
        substituted for a constant equal to the field.
        This substitution is allowed if the field is not of a type string
        or if the field reference serves as an argument of a comparison
        predicate.
      sql/item.h:
        Fixed bug #21698.
        Added a new virtual transformation method for a item 'compile'
        with two callback function parameters.
        Added a new virtual method 'subst_argument_checker' to be used
        as an amnalyzer method.
        This method is supposed to set its in/out argument to NULL for
        the nodes where substitution of a string field for a constant
        is not valid.
      sql/item_cmpfunc.cc:
        Fixed bug #21698.
        Added an implementation of the compile method for class Item_cond.
        First it processes the Item_cond node with a callback function and if
        the latter returns TRUE it proceeds with a transformation performed by
        another callback function.
      sql/item_cmpfunc.h:
        Fixed bug #21698.
        Added the implementations of 'subst_argument_checker'
        for the Item_func and Item_cond classes.
        This method is supposed to set its in/out argument to NULL for
        the nodes where substitution of a string field for a constant
        is not valid.
        Added the declaration of an implementation of the compile method for 
        class Item_cond.
        First it processes the Item_cond node with a callback function and if
        the latter returns TRUE it proceeds with a transformation performed by
        another callback function.
      sql/item_func.cc:
        Fixed bug #21698.
        Added an implementation of the compile method for class Item_func.
        First it processes the Item_func node with a callback function and if
        the latter returns TRUE it proceeds with a transformation performed by
        another callback function.
      sql/item_func.h:
        Fixed bug #21698.
        Added the declaration of the implementation of the compile method for
        class Item_func.
        First it processes the Item_func node with a callback function and if
        the latter returns TRUE it proceeds with a transformation performed by
        another callback function.
      sql/sql_select.cc:
        Fixed bug #21698.
        Limited the conditions at which a field can be substituted 
        a for an equal constant in a formula. 
        This substitution is allowed if the field is not of a type string
        or if the field reference serves as an argument of a comparison
        predicate.
      87166702
  3. 06 Sep, 2006 1 commit
    • unknown's avatar
      Fixed bug #5500: EXPLAIN returned a wrong select_type for queries using views. · 22c3e7b4
      unknown authored
      Select_type in the EXPLAIN output for the query SELECT * FROM t1 was
      'SIMPLE', while for the query SELECT * FROM v1, where the view v1
      was defined as SELECT * FROM t1, the EXPLAIN output contained 'PRIMARY'
      for the select_type column.
       
      
      
      mysql-test/r/group_by.result:
        Adjusted results after the fix for bug #5500.
      mysql-test/r/information_schema.result:
        Adjusted results after the fix for bug #5500.
      mysql-test/r/olap.result:
        Adjusted results after the fix for bug #5500.
      mysql-test/r/range.result:
        Adjusted results after the fix for bug #5500.
      mysql-test/r/view.result:
        Added a test case for bug #5500.
        Adjusted other results.
      mysql-test/r/view_grant.result:
        Adjusted results after the fix for bug #5500.
      mysql-test/t/view.test:
        Added a test case for bug #5500.
      22c3e7b4
  4. 05 Sep, 2006 2 commits
    • unknown's avatar
      Merge bug #16792 4.1->5.0 · 3a8cdfc3
      unknown authored
      3a8cdfc3
    • unknown's avatar
      Merge macbook.gmz:/Users/kgeorge/mysql/work/B16792-4.1-opt · 2aeec864
      unknown authored
      into  macbook.gmz:/Users/kgeorge/mysql/work/B16792-5.0-opt
      
      
      mysql-test/r/func_gconcat.result:
        Auto merged
      mysql-test/r/subselect.result:
        Auto merged
      sql/opt_sum.cc:
        Auto merged
      mysql-test/r/func_group.result:
        merge 4.1->5.0 for bug #16792
      mysql-test/t/func_group.test:
        merge 4.1->5.0 for bug #16792
      sql/sql_select.cc:
        merge 4.1->5.0 for bug #16792
      2aeec864
  5. 04 Sep, 2006 5 commits
    • unknown's avatar
      Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · 09df2612
      unknown authored
      into  rakia.(none):/home/kgeorge/mysql/autopush/B21392-5.0-opt
      
      
      sql/sql_yacc.yy:
        Auto merged
      09df2612
    • unknown's avatar
      Merge macbook.gmz:/Users/kgeorge/mysql/work/B21392-4.1-opt · 18ed9144
      unknown authored
      into  macbook.gmz:/Users/kgeorge/mysql/work/B21392-5.0-opt
      
      
      mysql-test/t/delete.test:
        Auto merged
      sql/mysql_priv.h:
        Auto merged
      sql/sql_yacc.yy:
        Auto merged
      mysql-test/r/delete.result:
        merge 4.1->5.0
      sql/sql_parse.cc:
        merge 4.1->5.0
      18ed9144
    • unknown's avatar
      Bug #21392: multi-table delete with alias table name fails with · 1431966d
      unknown authored
                  1003: Incorrect table name
      in multi-table DELETE the set of tables to delete from actually 
      references then tables in the other list, e.g:
      DELETE alias_of_t1 FROM t1 alias_of_t1 WHERE ....
      is a valid statement.
      So we must turn off table name syntactical validity check for alias_of_t1 
      because it's not a table name (even if it looks like one).
      In order to do that we add a special flag (TL_OPTION_ALIAS) to 
      disable the name checking for the aliases in multi-table DELETE.
      
      
      mysql-test/r/delete.result:
        Bug #21392: multi-table delete with alias table name fails with
                    1003: Incorrect table name
         - test case
      mysql-test/t/delete.test:
        Bug #21392: multi-table delete with alias table name fails with
                    1003: Incorrect table name
         - test case
      sql/mysql_priv.h:
        Bug #21392: multi-table delete with alias table name fails with
                    1003: Incorrect table name
         - add a special flag to disable the name checking for the aliases
           in multi-table DELETE
      sql/sql_parse.cc:
        Bug #21392: multi-table delete with alias table name fails with
                    1003: Incorrect table name
         - add a special flag to disable the name checking for the aliases
           in multi-table DELETE
      sql/sql_yacc.yy:
        Bug #21392: multi-table delete with alias table name fails with
                    1003: Incorrect table name
         - add a special flag to disable the name checking for the aliases
           in multi-table DELETE
      1431966d
    • unknown's avatar
      Merge rurik.mysql.com:/home/igor/mysql-5.0-opt · 12279f7c
      unknown authored
      into  rurik.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug16081
      
      
      12279f7c
    • unknown's avatar
      Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · a0e95927
      unknown authored
      into  rakia.(none):/home/kgeorge/mysql/autopush/B14654-5.0-opt
      
      
      mysql-test/r/subselect.result:
        Auto merged
      mysql-test/t/subselect.test:
        Auto merged
      sql/sql_yacc.yy:
        Auto merged
      a0e95927
  6. 01 Sep, 2006 3 commits
    • unknown's avatar
      Fixed bug #16081: row equalities were not taken into · a53f3d0f
      unknown authored
      account by the optimizer.
      Now all row equalities are converted into conjunctions of
      equalities between row elements. They are taken into account
      by the optimizer together with the original regular equality
      predicates.
      
      
      mysql-test/r/join_outer.result:
        Adjusted results after fix for bug #16081.
      mysql-test/r/row.result:
        Added a test cases for bug #16081.
      mysql-test/t/row.test:
        Added a test cases for bug #16081.
      sql/sql_list.h:
        Corrected the copy constructor for the class base_list.
        The previous implementation resulted in creation of an
        inconsistent base_list if the source list was empty.
      a53f3d0f
    • unknown's avatar
      Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · efa8e330
      unknown authored
      into  mysql.com:/home/psergey/mysql-5.0-bug21477-look-64bit
      
      
      efa8e330
    • unknown's avatar
      BUG#21477 "memory overruns for certain kinds of subqueries": · dd6dc7ad
      unknown authored
      make st_select_lex::setup_ref_array() take into account that 
      Item_sum-descendant objects located within descendant SELECTs
      may be added into ref_pointer_array.
      
      
      sql/item_sum.cc:
        BUG#21477 "memory overruns for certain kinds of subqueries":
        Make SELECT_LEX::n_sum_items contain # of Item_sum-derived objects
        that exist within this SELECT.
      sql/sql_lex.h:
        BUG#21477 "memory overruns for certain kinds of subqueries":
        Add SELECT_LEX::n_sum_items and SELECT_LEXT::n_child_sum_items.
      sql/sql_yacc.yy:
        BUG#21477 "memory overruns for certain kinds of subqueries":
        Make SELECT_LEX::n_sum_items contain # of Item_sum-derived objects
        that exist within this SELECT.
      dd6dc7ad
  7. 31 Aug, 2006 3 commits
    • unknown's avatar
      Merge rurik.mysql.com:/home/igor/mysql-5.0-opt · a1d03bd6
      unknown authored
      into  rurik.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug16249
      
      
      a1d03bd6
    • unknown's avatar
      Bug#14654 : Cannot select from the same table twice within a UNION statement · c9bba13a
      unknown authored
       Made the parser to support parenthesis around UNION branches.
       This is done by amending the rules of the parser so it generates the correct
       structure.
       Currently it supports arbitrary subquery/join/parenthesis operations in the 
       EXISTS clause. 
       In the IN/scalar subquery case it will allow adding nested parenthesis only 
       if there is an UNION clause after the parenthesis. Otherwise it will just  
       treat the multiple nested parenthesis as a scalar expression.
       It adds extra lex level for ((SELECT ...) UNION ...) to accommodate for the
       UNION clause.
      
      
      mysql-test/r/subselect.result:
        Bug#14654 : Cannot select from the same table twice within a UNION statement
         - test cases
      mysql-test/t/subselect.test:
        Bug#14654 : Cannot select from the same table twice within a UNION statement
         - test cases
      sql/sql_yacc.yy:
        Bug#14654 : Cannot select from the same table twice within a UNION statement
         - shuffle around the rules for the parenthesis in subselect
      c9bba13a
    • unknown's avatar
      Fixed bug #16249: different results for a range with an without index · c4c36e17
      unknown authored
      when a range condition use an invalid DATETIME constant.
      Now we do not use invalid DATETIME constants to form end keys for
      range intervals: range analysis just ignores predicates with such
      constants.  
      
      
      mysql-test/r/query_cache.result:
        Adjusted result warnings when adding a fix for bug #16249.
      mysql-test/r/range.result:
        Added a test case for bug #16249.
      mysql-test/t/range.test:
        Added a test case for bug #16249.
      c4c36e17
  8. 26 Aug, 2006 3 commits
  9. 25 Aug, 2006 3 commits
    • unknown's avatar
      Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · 7e9ed378
      unknown authored
      into  mysql.com:/home/psergey/mysql-5.0-bug16255-merge
      
      
      7e9ed378
    • unknown's avatar
      Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · 75865af6
      unknown authored
      into  rurik.mysql.com:/home/igor/mysql-5.0-opt
      
      
      75865af6
    • unknown's avatar
      Fixed bug #21390: wrong estimate of rows after elimination of · f121994d
      unknown authored
      const tables. This resulted in choosing extremely inefficient
      execution plans in same cases when distribution of data in
      joined were skewed (see the customer test case for the bug).
      
      
      
      mysql-test/r/select.result:
        Added a test case for bug #21390: wrong estimate of rows
        after elimination of const tables.
        Includded a test case that checks the code added by the patch
        that handles outer joins with no matches after substitution of
        a const table in an efficient way.
      mysql-test/t/select.test:
        Added a test case for bug #21390: wrong estimate of rows
        after elimination of const tables.
        Included a test case that checks the code added by the patch
        that handles outer joins with no matches after substitution of
        a const table in an efficient way.
      sql/sql_select.cc:
        Fixed bug #21390: wrong estimate of rows after elimination of
        const tables. This resulted in choosing extremely inefficient
        execution plans in same cases when distribution of data in
        joined were skewed (see the customer test case for the bug).
        Also added the code to handle outer joins with no matches after
        substitution of a const table in an efficient way. 
        Corrected calculation of the null rejecting key conditions.
      f121994d
  10. 24 Aug, 2006 5 commits
    • unknown's avatar
      opt_range.cc: · da2e23f1
      unknown authored
        Corrected fix for bug#18165
      
      
      sql/opt_range.cc:
        Corrected fix for bug#18165
      da2e23f1
    • unknown's avatar
      opt_range.cc: · 84a65393
      unknown authored
        Corrected fix for bug#18165
      
      
      sql/opt_range.cc:
        Corrected fix for bug#18165
      84a65393
    • unknown's avatar
      BUG#16255: Merge to 5.0 · 251409bb
      unknown authored
      251409bb
    • unknown's avatar
      BUG#16255: Post-review fixes: adjust the testcase. · f895a16c
      unknown authored
      
      mysql-test/r/subselect.result:
        BUG#16255: A proper testcase
      mysql-test/t/subselect.test:
        BUG#16255: A proper testcase
      f895a16c
    • unknown's avatar
      Bug #16255: Subquery in WHERE (the cset by Georgi Kodinov) · c74c8195
      unknown authored
       Must not use Item_direct_ref in HAVING because it points to
       the new value (witch is not yet calculated for the first row).
      
      
      mysql-test/r/subselect.result:
        Bug #16255: Subquery in where
         - test case
      mysql-test/t/subselect.test:
        Bug #16255: Subquery in where
         - test case
      sql/item_subselect.cc:
        Bug #16255: Subquery in where
         Must not use Item_direct_ref in HAVING because it points to
         the new value (witch is not yet calculated for the first row).
      c74c8195
  11. 23 Aug, 2006 1 commit
    • unknown's avatar
      view.result, view.test: · d0394c70
      unknown authored
        Corrected test case for the bug#21261
      sql_parse.cc:
        Corrected fix for bug#21261
      
      
      mysql-test/t/view.test:
        Corrected test case for the bug#21261
      mysql-test/r/view.result:
        Corrected test case for the bug#21261
      sql/sql_parse.cc:
        Corrected fix for bug#21261
      d0394c70
  12. 22 Aug, 2006 10 commits
    • unknown's avatar
      Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · e8bb0c92
      unknown authored
      into  moonbone.local:/work/21475-fix-5.0-opt-mysql
      
      
      e8bb0c92
    • unknown's avatar
      item_cmpfunc.cc, item.cc: · d8c9de79
      unknown authored
        Additional fix for bug #21475
      item_func.h, item_func.cc:
        Additional fix for bug#16861
      
      
      sql/item_func.h:
        Additional fix for bug#16861
      sql/item_func.cc:
        Additional fix for bug#16861
      sql/item_cmpfunc.cc:
        Additional fix for bug #21475
      sql/item.cc:
        Additional fix for bug #21475
      d8c9de79
    • unknown's avatar
      Merge salvation.intern.azundris.com:/home/tnurnberg/work/mysql-5.0-maint-20411 · f40b6c27
      unknown authored
      into  salvation.intern.azundris.com:/home/tnurnberg/work/mysql-5.0-maint-20987
      
      
      f40b6c27
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maint · e0a6e183
      unknown authored
      into  salvation.intern.azundris.com:/home/tnurnberg/work/mysql-5.0-maint-20987
      
      
      e0a6e183
    • unknown's avatar
      Merge zippy.cornsilk.net:/home/cmiller/work/mysql/merge/mysql-5.0-maint · 7d70273e
      unknown authored
      into  zippy.cornsilk.net:/home/cmiller/work/mysql/merge/mysql-5.0
      
      
      7d70273e
    • unknown's avatar
      Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · bbda4dd3
      unknown authored
      into  rurik.mysql.com:/home/igor/mysql-5.0-opt
      
      
      bbda4dd3
    • unknown's avatar
      Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · 3a23139a
      unknown authored
      into  sunlight.local:/local_work/16861-bug-5.0-mysql
      
      
      sql/sql_select.cc:
        Auto merged
      3a23139a
    • unknown's avatar
      Fixed bug#16861: User defined variable can have a wrong value if a tmp table was · c623e54f
      unknown authored
      used.
      
      Sorting by RAND() uses a temporary table in order to get a correct results.
      User defined variable was set during filling the temporary table and later
      on it is substituted for its value from the temporary table. Due to this
      it contains the last value stored in the temporary table.
      
      Now if the result_field is set for the Item_func_set_user_var object it 
      updates variable from the result_field value when being sent to a client.
      
      The Item_func_set_user_var::check() now accepts a use_result_field
      parameter. Depending on its value the result_field or the args[0] is used
      to get current value.
      
      
      mysql-test/r/user_var.result:
        Added a test case for bug#16861: User defined variable can have a wrong value if a tmp table was used.
      mysql-test/t/user_var.test:
        Added a test case for bug#16861: User defined variable can have a wrong value if a tmp table was used.
      sql/item_func.cc:
        Fixed bug#16861: User defined variable can have a wrong value if a tmp table was used.
        Now if the result_field is set for the Item_func_set_user_var object it 
        updates variable from the result_field value when being sent to a client.
        
        The Item_func_set_user_var::check() now accepts a use_result_field
        parameter. Depending on its value the result_field or the args[0] is used
        to get current value.
      sql/item_func.h:
        Fixed bug#16861: User defined variable can have a wrong value if a tmp table was used.
        Added a new SUSERVAR_FUNC function type.
        Updated the Item_func_set_user_var::check() function declaration.
        Added the Item_func_set_user_var::send() member function.
      sql/set_var.cc:
        Fixed bug#16861: User defined variable can have a wrong value if a tmp table was used.
        Modified to use updated Item_func_set_user_var::check() function.
      sql/sql_class.cc:
        Fixed bug#16861: User defined variable can have a wrong value if a tmp table was used.
        Modified to use updated Item_func_set_user_var::check() function.
      sql/sql_select.cc:
        Fixed bug#16861: User defined variable can have a wrong value if a tmp table was used.
        Now an Item_func_set_user_var object isn't substituted for an Item_field object after filling a temporary table.
      c623e54f
    • unknown's avatar
      Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · 8776a1e1
      unknown authored
      into  moonbone.local:/work/21475-bug-5.0-opt-mysql
      
      
      8776a1e1
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maint · cdd9147e
      unknown authored
      into  salvation.intern.azundris.com:/home/tnurnberg/work/mysql-5.0-maint-20411
      
      
      sql/sql_acl.cc:
        Auto merged
      cdd9147e