1. 02 May, 2011 1 commit
  2. 29 Apr, 2011 5 commits
    • Nirbhay Choubey's avatar
      Bug#11757855 - 49967: built-in libedit doesn't read · 8843aea7
      Nirbhay Choubey authored
                            .editrc on linux.
      
      MySQL client when build with libedit support ignores
      .editrc at startup.
      
      The reason for this regression was the incluison of a
      safety check, issetugid(), which is not available on
      some linux platforms.
      
      Fixed by adding an equivalent check for platforms which
      have get[e][u|g]id() set of functions.
      
      
      cmd-line-utils/libedit/el.c:
        Bug#11757855 - 49967: built-in libedit doesn't read
                              .editrc on linux.
        
        Added function calls to check user/group IDs on linux
        systems which does not have issetugid() function.
      configure.in:
        Bug#11757855 - 49967: built-in libedit doesn't read
                              .editrc on linux.
        
        Added check for getuid, geteuid, getgid, getegid
        functions.
      8843aea7
    • Bjorn Munch's avatar
      merge from 5.1-mtr · 1e7b79a5
      Bjorn Munch authored
      1e7b79a5
    • Vasil Dimov's avatar
      Sync 5.1 .inc file with 5.5 due to a missing changeset · 6f7d0f18
      Vasil Dimov authored
      Add extra codes to wait_until_disconnected.inc that are present in 5.5,
      but not in 5.1. The missing codes cause innodb_bug59641 to fail in 5.1 on
      Windows PB2 runs. The addition of those codes in 5.5 was done in
      luis.soares@sun.com-20090930233215-aup3kxy4j6ltvjfp
      6f7d0f18
    • Bjorn Munch's avatar
      merge from 5.1 main · 0e1819a4
      Bjorn Munch authored
      0e1819a4
    • Mattias Jonsson's avatar
      removed dead obsolete code · 54c1da00
      Mattias Jonsson authored
      54c1da00
  3. 27 Apr, 2011 3 commits
    • Mattias Jonsson's avatar
      Post push fix for bug#11766249 bug#59316 · 401941c2
      Mattias Jonsson authored
      Partitions can have different ref_length (position data length).
      Removed DBUG_ASSERT which crashed debug builds when using
      MAX_ROWS on some partitions.
      401941c2
    • Nirbhay Choubey's avatar
      BUG#12329909 - BUILDING MYSQL WITH DEBUG SUPPORT · a1f7ceb2
      Nirbhay Choubey authored
                     FAILS WITH LIBEDIT
      
      Fixed by checking the return value of the write()
      function calls and handling the open files and fd
      appropriately.
      
      
      cmd-line-utils/libedit/vi.c:
        BUG#12329909 - BUILDING MYSQL WITH DEBUG SUPPORT
                       FAILS WITH LIBEDIT
        
        Added a check on the return value of the write()
        function calls.
      a1f7ceb2
    • Sergey Glukhov's avatar
      Bug#11889186 60503: CRASH IN MAKE_DATE_TIME WITH DATE_FORMAT / STR_TO_DATE COMBINATION · a60c39a2
      Sergey Glukhov authored
      calc_daynr() function returns negative result
      if malformed date with zero year and month is used.
      Attempt to calculate week day on negative value
      leads to crash. The fix is return NULL for
      'W', 'a', 'w' specifiers if zero year and month is used.
      Additional fix for calc_daynr():
      --added assertion that result can not be negative
      --return 0 if zero year and month is used
      
      
      mysql-test/r/func_time.result:
        test case
      mysql-test/t/func_time.test:
        test case
      sql-common/my_time.c:
        --added assertion that result can not be negative
        --return 0 if zero year and month is used
      sql/item_timefunc.cc:
        eturn NULL for 'W', 'a', 'w' specifiers
        if zero year and month is used.
      a60c39a2
  4. 26 Apr, 2011 3 commits
  5. 25 Apr, 2011 1 commit
  6. 23 Apr, 2011 1 commit
  7. 22 Apr, 2011 1 commit
    • Sergey Glukhov's avatar
      Bug#11756928 48916: SERVER INCORRECTLY PROCESSING HAVING CLAUSES WITH AN ORDER BY CLAUSE · a5e8d902
      Sergey Glukhov authored
      Before sorting HAVING condition is split into two parts,
      first part is a table related condition and the rest of is
      HAVING part. Extraction of HAVING part does not take into account
      the fact that some of conditions might be non-const but
      have 'used_tables' == 0 (independent subqueries)
      and because of that these conditions are cut off by
      make_cond_for_table() function.
      The fix is to use (table_map) 0 instead of used_tables in
      third argument for make_cond_for_table() function.
      It allows to extract elements which belong to sorted
      table and in addition elements which are independend
      subqueries.
      
      
      mysql-test/r/having.result:
        test case
      mysql-test/t/having.test:
        test case
      sql/sql_select.cc:
        The fix is to use (table_map) 0 instead of used_tables in
        third argument for make_cond_for_table() function.
        It allows to extract elements which belong to sorted
        table and in addition elements which are independend
        subqueries.
      a5e8d902
  8. 21 Apr, 2011 1 commit
  9. 20 Apr, 2011 6 commits
  10. 18 Apr, 2011 4 commits
  11. 16 Apr, 2011 1 commit
  12. 15 Apr, 2011 3 commits
  13. 14 Apr, 2011 4 commits
    • Tor Didriksen's avatar
      Bug#11765713 58705: OPTIMIZER LET ENGINE DEPEND ON UNINITIALIZED VALUES CREATED BY OPT_SUM_QU · dd3d9477
      Tor Didriksen authored
      Valgrind warnings were caused by comparing index values to an un-initialized field.
      
      
      mysql-test/r/subselect.result:
        New test cases.
      mysql-test/t/subselect.test:
        New test cases.
      sql/opt_sum.cc:
        Add thd to opt_sum_query enabling it to test for errors.
        If we have a non-nullable index, we cannot use it to match null values,
        since set_null() will be ignored, and we might compare uninitialized data.
      sql/sql_select.cc:
        Add thd to opt_sum_query, enabling it to test for errors.
      sql/sql_select.h:
        Add thd to opt_sum_query, enabling it to test for errors.
      dd3d9477
    • Bjorn Munch's avatar
      Bug #12351213 MTR --VS-CONFIG DOES NOT WORK LIKE MTR_VS_CONFIG · e675ed06
      Bjorn Munch authored
      Fix for --vs-config applied
      Find.pm incorrectly tested an unitialized local variable instead
        of the global, corrected.
      Find.pm is also wrong in 5.5: uses a non-existent global variable. Fix when
        merging up.
      e675ed06
    • Serge Kozlov's avatar
      WL#5867, postfix for binlog_bug23533 · 7634e724
      Serge Kozlov authored
      7634e724
    • Sergey Glukhov's avatar
      Bug#11756242 48137: PROCEDURE ANALYSE() LEAKS MEMORY WHEN RETURNING NULL · 3abe56f3
      Sergey Glukhov authored
      There are two problems with ANALYSE():
      
      1. Memory leak 
         it happens because do_select() can overwrite
         JOIN::procedure field(with zero value in our case) and
         JOIN destructor don't free the memory allocated for
         JOIN::procedure. The fix is to save original JOIN::procedure
         before do_select() call and restore it after do_select
         execution.
      
      2. Wrong result
         If ANALYSE() procedure is used for the statement with LIMIT clause
         it could retrun empty result set. It happens because of missing 
         analyse::end_of_records() call. First end_send() function call
         returns NESTED_LOOP_QUERY_LIMIT and second call of end_send() with
         end_of_records flag enabled does not happen. The fix is to return
         NESTED_LOOP_OK from end_send() if procedure is active.
      
      
      mysql-test/r/analyse.result:
        test case
      mysql-test/t/analyse.test:
        test case
      sql/sql_select.cc:
        --save original JOIN::procedure before do_select() call and
          restore it after do_select execution.
        --return NESTED_LOOP_OK from end_send() if procedure is active
      3abe56f3
  14. 13 Apr, 2011 1 commit
  15. 12 Apr, 2011 3 commits
    • Sven Sandberg's avatar
      da267719
    • Sergey Glukhov's avatar
      Bug#11766270 59343: YEAR(4): INCORRECT RESULT AND VALGRIND WARNINGS WITH MIN/MAX, UNION · 7fa7a0ca
      Sergey Glukhov authored
      When we create temporary result table for UNION
      incorrect max_length for YEAR field is used and
      it leads to incorrect field value and incorrect
      result string length as YEAR field value calculation
      depends on field length.
      The fix is to use underlying item max_length for
      Item_sum_hybrid::max_length intialization.
      
      
      mysql-test/r/func_group.result:
        test case
      mysql-test/t/func_group.test:
        test case
      sql/field.cc:
        added assert
      sql/item_sum.cc:
        init Item_sum_hybrid::max_length with 
        use underlying item max_length for
        INT result type.
      7fa7a0ca
    • Sergey Glukhov's avatar
      Bug#11766212 59270: NOT IN (YEAR( ... ), ... ) PRODUCES MANY VALGRIND WARNINGS · 33c2a5e7
      Sergey Glukhov authored
      Valgrind warning happens due to early null values check
      in Item_func_in::fix_length_and_dec(before item evaluation).
      As result null value items with uninitialized values are
      placed into array and it leads to valgrind warnings during
      value array sorting.
      The fix is to check null value after item evaluation, item
      is evaluated in in_array::set() method.
      
      
      mysql-test/r/func_in.result:
        test case
      mysql-test/t/func_in.test:
        test case
      sql/item_cmpfunc.cc:
        The fix is to check null value after item evaluation.
      33c2a5e7
  16. 11 Apr, 2011 2 commits
    • Sven Sandberg's avatar
      e108b3f6
    • Marko Mäkelä's avatar
      Bug #11760042 - 52409: Assertion failure: long semaphore wait · 12fbe05c
      Marko Mäkelä authored
      In ha_innobase::create(), we check some things while holding an
      exclusive lock on the data dictionary. Defer the locking and the
      creation of transactions until after the checks have passed. The
      THDVAR could hang due to a mutex wait (see Bug #11750569 - 41163:
      deadlock in mysqld: LOCK_global_system_variables and LOCK_open), and
      we want to avoid waiting while holding InnoDB mutexes.
      
      innobase_index_name_is_reserved(): Replace the parameter trx_t with
      THD, so that the test can be performed before starting an InnoDB
      transaction. We only needed trx->mysql_thd.
      
      ha_innobase::create(): Create transaction and lock the data dictionary
      only after passing the basic tests.
      
      create_table_def(): Move the IS_MAGIC_TABLE_AND_USER_DENIED_ACCESS
      check to ha_innobase::create(). Assign to srv_lower_case_table_names
      while holding dict_sys->mutex.
      
      ha_innobase::delete_table(), ha_innobase::rename_table(),
      innobase_rename_table(): Assign srv_lower_case_table_names as late as
      possible. Here, the variable is not necessarily protected by
      dict_sys->mutex.
      
      ha_innobase::add_index(): Invoke innobase_index_name_is_reserved() and
      innobase_check_index_keys() before allocating anything.
      
      rb:618 approved by Jimmy Yang
      12fbe05c