1. 02 Feb, 2007 1 commit
    • unknown's avatar
      Merge mysql.com:/home/gluh/MySQL/Merge/5.0-opt · ed0e4a96
      unknown authored
      into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt
      
      
      mysql-test/r/distinct.result:
        Auto merged
      mysql-test/r/join_nested.result:
        Auto merged
      mysql-test/r/null_key.result:
        Auto merged
      mysql-test/r/select.result:
        Auto merged
      mysql-test/r/subselect.result:
        Auto merged
      mysql-test/r/subselect3.result:
        Auto merged
      mysql-test/r/trigger.result:
        Auto merged
      mysql-test/t/select.test:
        Auto merged
      mysql-test/t/subselect.test:
        Auto merged
      mysql-test/t/trigger.test:
        Auto merged
      sql/filesort.cc:
        Auto merged
      sql/item.cc:
        Auto merged
      sql/item.h:
        Auto merged
      sql/item_cmpfunc.cc:
        Auto merged
      sql/item_cmpfunc.h:
        Auto merged
      sql/item_func.cc:
        Auto merged
      sql/item_subselect.cc:
        Auto merged
      sql/item_timefunc.cc:
        Auto merged
      sql/mysql_priv.h:
        Auto merged
      sql/opt_sum.cc:
        Auto merged
      sql/sql_base.cc:
        Auto merged
      sql/sql_parse.cc:
        Auto merged
      sql/sql_select.cc:
        Auto merged
      sql/sql_show.cc:
        Auto merged
      sql/sql_yacc.yy:
        Auto merged
      sql/table.cc:
        Auto merged
      mysql-test/r/func_time.result:
        manual merge
      mysql-test/r/information_schema.result:
        manual merge
      mysql-test/t/func_time.test:
        manual merge
      mysql-test/t/information_schema.test:
        manual merge
      sql/opt_range.cc:
        manual merge
      sql/sql_delete.cc:
        manual merge
      sql/sql_lex.h:
        manual merge
      ed0e4a96
  2. 01 Feb, 2007 7 commits
    • unknown's avatar
      Bug#23299 Some queries against INFORMATION_SCHEMA with subqueries fail · a3083046
      unknown authored
      additional call of file->extra() method with HA_EXTRA_NO_CACHE parameter
      
      
      mysql-test/r/information_schema.result:
        test result
      mysql-test/t/information_schema.test:
        test case
      sql/sql_show.cc:
        additional call of file->extra() method with HA_EXTRA_NO_CACHE parameter
      a3083046
    • unknown's avatar
      Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · 1ff126e9
      unknown authored
      into  rakia.gmz:/home/kgeorge/mysql/autopush/B23556-5.0-opt
      
      
      1ff126e9
    • unknown's avatar
      trigger.result: · 0c523325
      unknown authored
        merge of the 5.0-opt tree
      
      
      mysql-test/r/trigger.result:
        merge of the 5.0-opt tree
      0c523325
    • unknown's avatar
      Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · 020e82c6
      unknown authored
      into  rakia.gmz:/home/kgeorge/mysql/autopush/B23556-5.0-opt
      
      
      mysql-test/t/trigger.test:
        Auto merged
      sql/sql_delete.cc:
        Auto merged
      020e82c6
    • unknown's avatar
      Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.1-opt · 4ebef052
      unknown authored
      into  rakia.gmz:/home/kgeorge/mysql/autopush/B23556-5.1-opt
      
      
      mysql-test/r/grant.result:
        Auto merged
      mysql-test/t/grant.test:
        Auto merged
      sql/sql_parse.cc:
        Auto merged
      4ebef052
    • unknown's avatar
      Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · 6bddf2a0
      unknown authored
      into  rakia.gmz:/home/kgeorge/mysql/autopush/B25551-5.0-opt
      
      
      sql/sql_select.cc:
        Auto merged
      6bddf2a0
    • unknown's avatar
      Fixed bug #25407. · c15b2e41
      unknown authored
      The bug could cause choosing a sub-optimal execution plan for 
      a single-table query if a unique index with many null keys were 
      defined for the table. 
      It happened because the code of the check_quick_keys function 
      made an assumption that any key may occur in an unique index 
      only once. Yet this is not true for keys with nulls that may 
      have multiple occurrences in the index.
      
      
      mysql-test/r/null_key.result:
        Fixed bug #25407
        Adjusted result after the fix.
      mysql-test/r/select.result:
        Added a test case for bug #25407.
      mysql-test/t/select.test:
        Added a test case for bug #25407.
      c15b2e41
  3. 31 Jan, 2007 8 commits
    • unknown's avatar
      Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · c118eeae
      unknown authored
      into  olga.mysql.com:/home/igor/mysql-5.0-opt
      
      
      c118eeae
    • unknown's avatar
      Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · 0375a7a8
      unknown authored
      into  mysql.com:/home/hf/work/25973/my50-25973
      
      
      0375a7a8
    • unknown's avatar
      merging · 036314d9
      unknown authored
      
      mysql-test/t/ps_1general.test:
        replace_result fixed
      036314d9
    • unknown's avatar
      Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · 41f862e1
      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
      41f862e1
    • unknown's avatar
      BUG#25575: ERROR 1052 (Column in from clause is ambiguous) with sub-join · fbc16a85
      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).
      fbc16a85
    • unknown's avatar
      Merge mysql.com:/home/hf/work/25973/my50-25973 · e788274b
      unknown authored
      into  mysql.com:/home/hf/work/25973/my51-25973
      
      
      mysql-test/t/ps_1general.test:
        merging
      e788274b
    • unknown's avatar
      bug #25973 (ps_1general.test fails in embedded server) · e8040084
      unknown authored
      
      mysql-test/t/ps_1general.test:
        replace_result fixed
      e8040084
    • unknown's avatar
      Bug #25551: inconsistent behaviour in grouping NULL, depending on index type · d01ec5e7
      unknown authored
       The optimizer takes away columns from GROUP BY/DISTINCT if they constitute
       all the parts of an unique index.
       However if some of the columns can contain NULLs this cannot be done 
      (because an UNIQUE index can have multiple rows with NULL values).
       Fixed by not using UNIQUE indexes with nullable columns to remove
       grouping columns from GROUP BY/DISTINCT.
      
      
      mysql-test/r/distinct.result:
        Bug #25551: inconsistent behaviour in grouping NULL, depending on index type
         - test case
      mysql-test/t/distinct.test:
        Bug #25551: inconsistent behaviour in grouping NULL, depending on index type
         - test case
      sql/sql_select.cc:
        Bug #25551: inconsistent behaviour in grouping NULL, depending on index type
         - UNIQUE NULL indices don't guarantee GROUP BY/DISTINCT.
      d01ec5e7
  4. 30 Jan, 2007 5 commits
    • unknown's avatar
      Merge olga.mysql.com:/home/igor/dev-opt/mysql-4.1-opt-bug24987 · 309f2a60
      unknown authored
      into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug24987
      
      
      sql/opt_sum.cc:
        Auto merged
      sql/sql_select.cc:
        Manual merge
      309f2a60
    • unknown's avatar
      Fixed bug #24987. · 1944b4ca
      unknown authored
      Made the function opt_sum_query to return HA_ERR_KEY_NOT_FOUND when
      no matches were found (instead of -1 it returned prior this patch).
      This changes allow us to avoid possible conflicts with return values
      from user-defined handler methods which also may return -1. 
      No particular test cases are provided with this fix.
      
      
      sql/opt_sum.cc:
        Fixed bug #24987.
        Made the function opt_sum_query to return HA_ERR_KEY_NOT_FOUND when
        no matches were found (instead of -1 it returned prior this patch).
        This changes allow us to avoid possible conflicts with return values
        from user-defined handler methods which also may return -1.
      sql/sql_select.cc:
        Fixed bug #24987.
        Made the function opt_sum_query to return HA_ERR_KEY_NOT_FOUND when
        no matches were found (instead of -1 it returned prior this patch).
        This changes allow us to avoid possible conflicts with return values
        from user-defined handler methods which also may return -1.
      1944b4ca
    • unknown's avatar
      Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · 21d915c0
      unknown authored
      into  rakia.gmz:/home/kgeorge/mysql/autopush/B25643-5.0-opt
      
      
      21d915c0
    • unknown's avatar
      This is an empty changeset to trigger a rerun of pushbuild. · 32b5759e
      unknown authored
      
      sql/table.h:
        Only touched a comment.
      32b5759e
    • unknown's avatar
      Bug #25643: SEC_TO_TIME function problem · 3cb3a9a1
      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()
      3cb3a9a1
  5. 29 Jan, 2007 4 commits
    • unknown's avatar
      Merge mhansson@bk-internal:/home/bk/mysql-5.1-opt · a693c171
      unknown authored
      into  linux-st28.site:/home/martin/mysql/src/5.1o-bug20604-tp
      
      
      mysql-test/t/key.test:
        Auto merged
      a693c171
    • unknown's avatar
      BUG#20604: FORCE INDEX uses keys disabled by ALTER TABLE · 190efb06
      unknown authored
       
      The function that checks whether we can use keys for aggregates,
      find_key_for_maxmin(), assumes that keys disabled by ALTER TABLE
      ... DISABLE KEYS are not in the set table->keys_in_use_for_query.
      I.E., if a key is in this set, the optimizer assumes it is free to 
      use it.
        
      The bug is that keys disabled with ALTER TABLE ... DISABLE KEYS still
      appear in table->keys_in_use_for_query When the TABLE object has been 
      initialized with setup_tables(). Before setup_tables is called, however, 
      keys that are disabled in the aforementioned way are not included in
      TABLE::keys_in_use_for_query. 
        
      The provided patch changes the code that updates keys_is_use_for_query so 
      that it assumes that keys_is_use_for_query already takes into account all 
      disabled keys, and generally all keys that should be used by the query.
      
      
      mysql-test/r/key.result:
        Test for BUG#20604.
        The important part of the test is the explain output that 
        tests what indexes are used.
      mysql-test/t/key.test:
        The minimal test case that reveals the bug. The optimizer for 
        aggregates relies on keys disabled with ALTER TABLE ... DISABLE KEYS
        not being in the set TABLE::keys_in_use_for_query. 
        When the execution engine tries to use a disabled index, MyISAM 
        returns an error.
      sql/sql_base.cc:
        Exclude the keys disabled by ALTER TABLE ... DISABLE_KEYS 
        from TABLE::keys_in_use_for_query, and in general, don't 
        introduce any new keys. We may not know why keys have been 
        removed at previous stages.
      sql/sql_select.cc:
        The intersection operation between table->s->keys_in_use and 
        table->keys_in_use_for_query is no longer necessary. 
        We can trust that the latter is a subset of the former.
      sql/table.h:
        Added comments to TABLE_SHARE::keys_in_use and 
        TABLE::keys_in_use_for_query.
      190efb06
    • unknown's avatar
      bug #25895 (compiling the embedded server fails on some 64-bit platforms) · de63c6d4
      unknown authored
      it can't be compile everywhere if we just cast pointer to pthread_t
      So now we use correct pthread_self() value as the pthread_t and
      pointer where we need to identify the thread exactly.
      
      
      libmysqld/lib_sql.cc:
        pthread_self() can be used here as we use pointer to thread
        when we need to identify the thread exactly
      sql/item_func.cc:
        now we use pthread_t value for thread identification in 'standalone'
        server only, in the embedded server we can use the pointer to THD
        structure
      de63c6d4
    • unknown's avatar
      bug #25890 (mysqltest_embedded crashes on start) · a00d38e9
      unknown authored
      binlog_filter and rpl_filter are initialized in server's 'main' function
      which doesn't work in the embedded server. So this code moved to
      function working in both cases.
      
      
      sql/mysqld.cc:
        rpl_filter/binlog_filter initializations moved to
        init_common_variables() function.
        That will be called by both 'standalone' and 'embedded' servers
      a00d38e9
  6. 27 Jan, 2007 1 commit
    • unknown's avatar
      Fixed bug #24420. · 14959243
      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.
      14959243
  7. 26 Jan, 2007 7 commits
    • unknown's avatar
      Merge olga.mysql.com:/home/igor/mysql-5.0-opt · 4f118f1d
      unknown authored
      into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug24653
      
      
      sql/item.h:
        Auto merged
      4f118f1d
    • unknown's avatar
      Merge mysql.com:/home/gluh/MySQL/Merge/5.0 · 6db6be5a
      unknown authored
      into  mysql.com:/home/gluh/MySQL/Merge/5.1
      
      
      sql/item.h:
        Auto merged
      sql/sql_table.cc:
        Auto merged
      sql/sql_update.cc:
        Auto merged
      6db6be5a
    • unknown's avatar
      Merge mysql.com:/home/gluh/MySQL/Merge/5.1-opt · 33b73c20
      unknown authored
      into  mysql.com:/home/gluh/MySQL/Merge/5.1
      
      
      mysql-test/r/view.result:
        Auto merged
      mysql-test/t/innodb.test:
        Auto merged
      mysql-test/t/view.test:
        Auto merged
      sql/item.h:
        Auto merged
      sql/mysqld.cc:
        Auto merged
      sql/sql_class.cc:
        Auto merged
      sql/sql_insert.cc:
        Auto merged
      sql/sql_table.cc:
        Auto merged
      sql/sql_update.cc:
        Auto merged
      33b73c20
    • unknown's avatar
      Merge mysql.com:/home/gluh/MySQL/Merge/5.0-opt · 92a7c1ed
      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
      92a7c1ed
    • unknown's avatar
      Post merge fix · 917adbae
      unknown authored
      917adbae
    • unknown's avatar
      Merge olga.mysql.com:/home/igor/dev-opt/mysql-4.1-opt-bug24653 · 483a41bb
      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
      483a41bb
    • unknown's avatar
      Fixed bug #24653. · da561a80
      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.
      da561a80
  8. 25 Jan, 2007 7 commits