1. 12 Sep, 2006 1 commit
    • unknown's avatar
      Fix for BUG#21774: Column count doesn't match value count at row x · 900e66f8
      unknown authored
      The cause of the bug was an incomplete fix for bug 18080.
      The problem was that setup_tables() unconditionally reset the
      name resolution context to its 'tables' argument, which pointed
      to the first table of an SQL statement.
      
      The bug fix limits resetting of the name resolution context in
      setup_tables() only in the cases when the context was not set
      by earlier parser/optimizer phases.
      
      
      mysql-test/r/insert_select.result:
        Test for BUG#21774.
      mysql-test/t/insert_select.test:
        Test for BUG#21774.
      sql/sql_base.cc:
        Do not reset the name resolution contect unconditionally.
        Instead set the context to 'tables' only if it was not
        set before calling setup_tables().
      sql/sql_insert.cc:
        Added asserts to make sure that in the case of INSERT ... VALUES ...
        statements it is not necessary to reset the name resolution context
        to the first table, because there is only one table in the list of
        tables anyway. The actual code is not removed in order not to
        confuse it with the actual bug fix.
      sql/sql_parse.cc:
        Removed unnecessary reset of the name resolution context.
        The context is anyway unconditionally reset in mysql_insert()
        and mysql_prepare_insert().
      900e66f8
  2. 28 Aug, 2006 1 commit
  3. 26 Aug, 2006 3 commits
  4. 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
  5. 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
  6. 23 Aug, 2006 3 commits
    • 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
    • unknown's avatar
      Merge lamia.home:/home/timka/mysql/src/4.1-bug-21456 · e3181c59
      unknown authored
      into  lamia.home:/home/timka/mysql/src/5.0-bug-21456
      
      
      mysql-test/r/distinct.result:
        Merge the fix for BUG#21456
      mysql-test/t/distinct.test:
        Merge the fix for BUG#21456
      sql/sql_select.cc:
        Merge the fix for BUG#21456
      e3181c59
    • unknown's avatar
      Bug #21456: SELECT DISTINCT(x) produces incorrect results when using order by · 2baf2fdf
      unknown authored
      GROUP BY/DISTINCT pruning optimization must be done before ORDER BY 
      optimization because ORDER BY may be removed when GROUP BY/DISTINCT
      sorts as a side effect, e.g. in 
        SELECT DISTINCT <non-key-col>,<pk> FROM t1
        ORDER BY <non-key-col> DISTINCT
      must be removed before ORDER BY as if done the other way around
      it will remove both.
      
      
      mysql-test/r/distinct.result:
        Test for BUG#21456.
      mysql-test/t/distinct.test:
        Test for BUG#21456.
      sql/sql_select.cc:
        Bug #21456: SELECT DISTINCT(x) produces incorrect results when using order by
        
        GROUP BY/DISTINCT pruning optimization must be done before ORDER BY 
        optimization because ORDER BY may be removed when GROUP BY/DISTINCT
        sorts as a side effect.
      2baf2fdf
  7. 22 Aug, 2006 15 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
    • unknown's avatar
      Bug#20411: "GRANT ... REQUIRE ISSUER nnn AND SUBJECT mmm" fails to require both · 97e0f59b
      unknown authored
      when X.509 subject was required for a connect, we tested whether it was the right
      one, but did not refuse the connexion if not. fixed.
      
      (corrected CS now --replace_results socket-path)
      
      
      mysql-test/r/openssl_1.result:
        Bug#20411: "GRANT ... REQUIRE ISSUER nnn AND SUBJECT mmm" fails to require both
        
        test not only whether we can connect with a correct X.509 subject when one is
        required, but also assure that we can't without one.
      mysql-test/t/openssl_1.test:
        Bug#20411: "GRANT ... REQUIRE ISSUER nnn AND SUBJECT mmm" fails to require both
        
        test not only whether we can connect with a correct X.509 subject when one is
        required, but also assure that we can't without one.
      sql/sql_acl.cc:
        Bug#20411: "GRANT ... REQUIRE ISSUER nnn AND SUBJECT mmm" fails to require both
        
        actually refuse connexion if X.509 is required, but does not match. kudos to Al Smith.
      97e0f59b
    • unknown's avatar
      Merge salvation.intern.azundris.com:/home/tnurnberg/work/mysql-4.1-maint-20987 · 4f630bf3
      unknown authored
      into  salvation.intern.azundris.com:/home/tnurnberg/work/mysql-5.0-maint-20987
      
      
      sql/item_timefunc.cc:
        Auto merged
      mysql-test/r/func_time.result:
        manual merge
      mysql-test/t/func_time.test:
        manual merge
      4f630bf3
    • unknown's avatar
      Fixed bug 16201: a memory corruption causing crashes due to a too small · 38558705
      unknown authored
      buffer for a MY_BITMAP temporary buffer allocated on stack in the
      function get_best_covering_ror_intersect().
      Now the buffer of a proper size is allocated by a request from this
      function in mem_root.
      
      We succeeded to demonstrate the bug only on Windows with a very large
      database. That's why no test case is provided for in the patch.
      
      
      sql/opt_range.cc:
        Fixed bug 16201: a memory corruption causing crashes due to a too small 
        buffer for a MY_BITMAP temporary buffer allocated on stack in the
        function get_best_covering_ror_intersect().
        Now the buffer of a proper size is allocated by a request from this
        function in mem_root.
      38558705
    • unknown's avatar
      adb31669
    • unknown's avatar
      Bug#21757: mysql_client_test fails in testcase when reading master.log file · ad0f34e3
      unknown authored
      
      tests/mysql_client_test.c:
        Replace fopen with my_fopen and specify O_BINARY. Replace fclose with my_fclose.
      ad0f34e3
  8. 21 Aug, 2006 5 commits
    • unknown's avatar
      Fix compile errors in VC++ 7.0 · 686ca813
      unknown authored
      686ca813
    • unknown's avatar
      Merge bk-internal:/home/bk/mysql-5.0-maint · 7a8f8733
      unknown authored
      into  shellback.(none):/home/msvensson/mysql/mysql-5.0-maint
      
      
      tests/mysql_client_test.c:
        Auto merged
      7a8f8733
    • unknown's avatar
      Print lines from log file to see what's in them · d36b0cdf
      unknown authored
      d36b0cdf
    • unknown's avatar
      Fix by Georgi Kodinov: · d2fa8e3a
      unknown authored
      Bug #18744 Test 'join_outer' fails if "classic" configuration in 5.0
       - moved an InnoDB dependent test to the appropriate file
      
      
      mysql-test/r/innodb_mysql.result:
        Bug #18744 Test 'join_outer' fails if "classic" configuration in 5.0
         - moved an InnoDB dependent test to the appropriate file
      mysql-test/r/join_outer.result:
        Bug #18744 Test 'join_outer' fails if "classic" configuration in 5.0
         - moved an InnoDB dependent test to the appropriate file
      mysql-test/t/innodb_mysql.test:
        Bug #18744 Test 'join_outer' fails if "classic" configuration in 5.0
         - moved an InnoDB dependent test to the appropriate file
      mysql-test/t/join_outer.test:
        Bug #18744 Test 'join_outer' fails if "classic" configuration in 5.0
         - moved an InnoDB dependent test to the appropriate file
      d2fa8e3a
    • unknown's avatar
      Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.0 · 808ee3fe
      unknown authored
      into  hasky.mysql.fi:/home/jani/mysql-5.0_bug21537
      
      
      808ee3fe
  9. 20 Aug, 2006 1 commit
    • unknown's avatar
      Fixed bug#21475: Wrongly applied constant propagation leads to a false comparison. · 7a11df8c
      unknown authored
      A date can be represented as an int (like 20060101) and as a string (like
      "2006.01.01"). When a DATE/TIME field is compared in one SELECT against both
      representations the constant propagation mechanism leads to comparison
      of DATE as a string and DATE as an int. In this example it compares 2006 and
      20060101 integers. Obviously it fails comparison although they represents the
      same date.
      
      
      Now the Item_bool_func2::fix_length_and_dec() function sets the comparison
      context for items being compared. I.e. if items compared as strings the
      comparison context is STRING.
      The constant propagation mechanism now doesn't mix items used in different
      comparison contexts. The context check is done in the
      Item_field::equal_fields_propagator() and in the change_cond_ref_to_const() 
      functions.
      
      Also the better fix for bug 21159 is introduced.
      
      
      mysql-test/t/type_datetime.test:
        Added a test case for bug#21475: Wrongly applied constant propagation leads to a false comparison.
      mysql-test/r/type_datetime.result:
        Added a test case for bug#21475: Wrongly applied constant propagation leads to a false comparison.
      sql/sql_select.cc:
        Fixed bug#21475: Wrongly applied constant propagation leads to a false comparison.
        The constant propagation mechanism now doesn't mix items used in different
        comparison contexts. The check is done in the change_cond_ref_to_const() function.
      sql/item_cmpfunc.cc:
        Fixed bug#21475: Wrongly applied constant propagation leads to a false comparison.
        Now the Item_bool_func2::fix_length_and_dec() function sets the comparison
        context for items being compared.
      sql/item.h:
        Fixed bug#21475: Wrongly applied constant propagation leads to a false comparison.
        To the Item class a new field called cmp_context is added.
        It represents the comparison context of an item.
      sql/item.cc:
        Fixed bug#21475: Wrongly applied constant propagation leads to a false comparison.
        The constant propagation mechanism now doesn't mix items used in different
        comparison contexts. The context check is done in the
        Item_field::equal_fields_propagator() function.
      7a11df8c
  10. 18 Aug, 2006 2 commits
    • unknown's avatar
      Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-5.0 · 70b73788
      unknown authored
      into  mysql.com:/home/cps/mysql/trees/mysql-5.0-virgin
      
      
      sql/examples/ha_tina.cc:
        Auto merged
      70b73788
    • unknown's avatar
      innodb r702 · 3468780e
      unknown authored
      innodb r719
      
      
      innobase/btr/btr0btr.c:
        innodb r702
      innobase/buf/buf0buf.c:
        innodb r702
      innobase/dict/dict0dict.c:
        innodb r702
      innobase/fil/fil0fil.c:
        innodb r702
      innobase/fsp/fsp0fsp.c:
        innodb r702
      innobase/include/btr0cur.ic:
        innodb r719
      innobase/include/buf0buf.ic:
        innodb r702
      innobase/log/log0log.c:
        innodb r702
      innobase/log/log0recv.c:
        innodb r702
      innobase/os/os0file.c:
        innodb r702
      innobase/row/row0mysql.c:
        innodb r702
      innobase/row/row0sel.c:
        innodb r702
      innobase/srv/srv0start.c:
        innodb r702
      innobase/ut/ut0dbg.c:
        innodb r702
      sql/ha_innodb.cc:
        innodb r702
      3468780e
  11. 17 Aug, 2006 1 commit
    • unknown's avatar
      Merge zippy.cornsilk.net:/home/cmiller/work/mysql/merge/tmp_merge · 5c8c2ab4
      unknown authored
      into  zippy.cornsilk.net:/home/cmiller/work/mysql/merge/mysql-5.0
      
      
      BitKeeper/deleted/.del-mysql_client.result:
        Auto merged
      BitKeeper/deleted/.del-mysql_client.test:
        Auto merged
      client/mysql.cc:
        Auto merged
      mysql-test/r/func_time.result:
        Auto merged
      mysql-test/r/grant.result:
        Auto merged
      mysql-test/t/func_time.test:
        Auto merged
      mysql-test/t/grant.test:
        Auto merged
      sql/item_timefunc.cc:
        Auto merged
      sql/mysqld.cc:
        Auto merged
      sql/slave.cc:
        Auto merged
      sql/sql_acl.cc:
        Auto merged
      5c8c2ab4