1. 29 Oct, 2010 7 commits
    • Georgi Kodinov's avatar
      merge · 263a7054
      Georgi Kodinov authored
      263a7054
    • Georgi Kodinov's avatar
      merge to 5.1-security · bb592e9c
      Georgi Kodinov authored
      bb592e9c
    • Georgi Kodinov's avatar
      merge to 5.1-security · e223f2bc
      Georgi Kodinov authored
      e223f2bc
    • Georgi Kodinov's avatar
      merge to 5.0-security · 92223604
      Georgi Kodinov authored
      92223604
    • Sergey Glukhov's avatar
      Bug#57688 Assertion `!table || (!table->write_set || bitmap_is_set(table->write_set, field · 5b318c5a
      Sergey Glukhov authored
      Lines below which were added in the patch for Bug#56814 cause this crash:
      
      +      if (table->table)
      +        table->table->maybe_null= FALSE;
      
      Consider following test case:
      --
      CREATE TABLE t1(f1 INT NOT NULL);
      INSERT INTO t1 VALUES (16777214),(0);
      
      SELECT COUNT(*) FROM t1 LEFT JOIN t1 t2
      ON 1 WHERE t2.f1 > 1 GROUP BY t2.f1;
      
      DROP TABLE t1;
      --
      
      We set TABLE::maybe_null to FALSE for t2 table
      and in create_tmp_field() we create appropriate tmp table field
      using create_tmp_field_from_item() function instead of
      create_tmp_field_from_field. As a result we have
      LONGLONG field. As we have GROUP BY clause we calculate
      group buffer length, see calc_group_buffer().
      Item from group list which is used for calculation
      refer to the field from real tables and have LONG type.
      So group buffer length become insufficient for storing of
      LONGLONG value. It leads to overwriting of wrong memory
      area in do_field_int() function which is called from
      end_update().
      After some investigation I found out that
      create_tmp_field_from_item() is used only for OLAP
      grouping and can not be used for common grouping
      as it could be an incompatibility between tmp
      table fields and group buffer length.
      We can not remove create_tmp_field_from_item() call from
      create_tmp_field as OLAP needs it and we can not use this
      function for common grouping. So we should remove setting
      TABLE::maybe_null to FALSE from simplify_joins().
      In this case we'll get wrong behaviour of
      list_contains_unique_index() back. To fix it we
      could use Field::real_maybe_null() check instead of
      Field::maybe_null() and add addition check of
      TABLE_LIST::outer_join.
      
      
      mysql-test/r/group_by.result:
        test case
      mysql-test/r/join_outer.result:
        test case
      mysql-test/t/group_by.test:
        test case
      mysql-test/t/join_outer.test:
        test case
      sql/sql_select.cc:
        --remove wrong code
        --use Field::real_maybe_null() check instead of
          Field::maybe_null() and add addition check of
          TABLE_LIST::outer_join
      5b318c5a
    • Vasil Dimov's avatar
      Merge mysql-5.1-innodb -> mysql-5.1-bugteam · 17d12386
      Vasil Dimov authored
      17d12386
    • Sergey Glukhov's avatar
      Bug#57194 group_concat cause crash and/or invalid memory reads with type errors · 54e7559f
      Sergey Glukhov authored
      The problem is caused by bug49487 fix and became visible
      after after bug56679 fix.
      Items are cleaned up and set to unfixed state after filling derived table.
      So we can not rely on item::fixed state in Item_func_group_concat::print
      and we can not use 'args' array as items there may be cleaned up.
      The fix is always to use orig_args array of items as it
      always should contain the correct data.
      
      
      mysql-test/r/func_gconcat.result:
        test case
      mysql-test/t/func_gconcat.test:
        test case
      sql/item_sum.cc:
        The fix is always to use orig_args array of items.
      54e7559f
  2. 28 Oct, 2010 2 commits
    • Calvin Sun's avatar
      Bug#52062: Compiler warning in os0file.c on windows 64-bit · da1e3612
      Calvin Sun authored
      On Windows, the parameter for number of bytes passed into WriteFile()
      and ReadFile() is DWORD. Casting is needed to silence the warning on
      64-bit Windows.
      
      Also, adding several asserts to ensure the variable for number of bytes
      is no more than 32 bits, even on 64-bit Windows.
      
      This is for InnoDB Plugin.
      
      rb://415
      Approved by: Inaam
      da1e3612
    • Calvin Sun's avatar
      Bug#52062: Compiler warning in os0file.c on windows 64-bit · e0e2446d
      Calvin Sun authored
      On Windows, the parameter for number of bytes passed into WriteFile()
      and ReadFile() is DWORD. Casting is needed to silence the warning on
      64-bit Windows.
      
      Also, adding several asserts to ensure the variable for number of bytes
      is no more than 32 bits, even on 64-bit Windows.
      
      This is for built-in InnoDB.
      
      rb://415
      Approved by: Inaam
      e0e2446d
  3. 27 Oct, 2010 3 commits
  4. 26 Oct, 2010 1 commit
  5. 25 Oct, 2010 3 commits
  6. 23 Oct, 2010 1 commit
    • unknown's avatar
      Bug#27606 GRANT statement should be replicated with DEFINER information · 650f0081
      unknown authored
      "Grantor" columns' data is lost when replicating mysql.tables_priv.
      Slave SQL thread used its default user ''@'' as the grantor of GRANT|REVOKE
      statements executing on it.
      
      In this patch, current user is put in query log event for all GRANT and REVOKE
      statement, SQL thread uses the user in query log event as grantor.
      
      
      mysql-test/suite/rpl/r/rpl_do_grant.result:
        Add test for this bug.
      mysql-test/suite/rpl/t/rpl_do_grant.test:
        Add test for this bug.
      sql/log_event.cc:
        Refactoring THD::current_user_used and related functions.
        current_user_used is used to judge if current user should be
        binlogged in query log event. So it is better to call it m_binlog_invoker.
        The related functions are renamed too.
      sql/sql_class.cc:
        Refactoring THD::current_user_used and related functions.
        current_user_used is used to judge if current user should be
        binlogged in query log event. So it is better to call it m_binlog_invoker.
        The related functions are renamed too.
      sql/sql_class.h:
        Refactoring THD::current_user_used and related functions.
        current_user_used is used to judge if current user should be
        binlogged in query log event. So it is better to call it m_binlog_invoker.
        The related functions are renamed too.
      sql/sql_parse.cc:
        Call binlog_invoker() for GRANT and REVOKE statements.
      650f0081
  7. 21 Oct, 2010 4 commits
    • Bjorn Munch's avatar
      Follow-up to Bug #55582 which allows checking strings in if · 09694be3
      Bjorn Munch authored
        Simplified cases where a select was used to compare variable against ''
      09694be3
    • unknown's avatar
      Bug#55478 Row events wrongly apply on the temporary table of the same name · ff9140b5
      unknown authored
      Rows events were applied wrongly on the temporary table with the same name.
      But rows events are generated only for base tables. As temporary
      table's data never be binlogged on row mode. Normally, base table of the
      same name cannot be updated if a temporary table has the same name.
      But there are two cases which can generate rows events on 
      the base table of same name.
            
      Case1: 'CREATE TABLE ... SELECT' statement.
      In mixed format, it will generate rows events if it is unsafe.
            
      Case2: Drop a transactional temporary table in a transaction
             (happens only on 5.5+).
      BEGIN;
      DROP TEMPORARY TABLE t1;       # t1 is a InnoDB table
      INSERT INTO t1 VALUES(rand()); # t1 is a MyISAM table
      COMMIT;
      'DROP TEMPORARY TABLE' will be put in the transaction cache and
      binlogged after the rows events generated by the 'INSERT' statement.
            
      After this patch, slave opens only base table when applying a rows event.
      ff9140b5
    • Jimmy Yang's avatar
      Fix Bug #57616 Sig 11 in dict_load_table() when failed to load · cd3f17bd
      Jimmy Yang authored
      index or foreign key
      
      Approved by Sunny Bains
      cd3f17bd
    • Jimmy Yang's avatar
      Fix bug #57616 Sig 11 in dict_load_table() when failed to load index · 1918a8cf
      Jimmy Yang authored
      or foreign key
      
      Fix approved by Sunny Bains
      1918a8cf
  8. 20 Oct, 2010 6 commits
  9. 19 Oct, 2010 13 commits
    • Davi Arnaut's avatar
      Bug#45288: pb2 returns a lot of compilation warnings · 267bd161
      Davi Arnaut authored
      Tag or remove unused arguments and variables.
      
      regex/main.c:
        Use the real prototype.
      sql/ha_ndbcluster.cc:
        Make conditions less ambiguous.
      267bd161
    • Davi Arnaut's avatar
      Bug#45288: pb2 returns a lot of compilation warnings · 378fd294
      Davi Arnaut authored
      Ensure that fdatasync is properly declared as on Mac OS X, the
      function is available but there is no prototype. Also, port a
      fix for a warning from the InnoDB plugin over to the builtin. 
      
      configure.in:
        Check that fdatasync is declared.
      mysys/my_sync.c:
        Use fdatasync only if it is declared.
      storage/innobase/include/ut0dbg.h:
        Port over from the plugin a fix for a warning.
      378fd294
    • Vasil Dimov's avatar
      Fix Bug#53916 storage/innodb_plugin does not compile on NetBSD/sparc64 · f107eddc
      Vasil Dimov authored
      Just check for all the functions that we are going to use, not a subset
      of them.
      
      Reviewed by:	Davi (via IRC)
      f107eddc
    • Davi Arnaut's avatar
      Bug#45288: pb2 returns a lot of compilation warnings on linux · c64ef835
      Davi Arnaut authored
      Tag unused arguments.
            
      Approved by: Marko (via IRC)
      c64ef835
    • Davi Arnaut's avatar
      Bug#45288: pb2 returns a lot of compilation warnings on linux · 8464f12e
      Davi Arnaut authored
      Tag unused arguments.
      
      Approved by: Marko (via IRC)
      8464f12e
    • Davi Arnaut's avatar
      Bug#45288: pb2 returns a lot of compilation warnings on linux · 28f9f07e
      Davi Arnaut authored
      Fix assorted compiler warnings on Mac OS X.
      
      BUILD/SETUP.sh:
        Remove -Wctor-dtor-privacy flag to workaround a GCC bug that
        causes it to not properly detect that implicitly generated
        constructors are always public.
      cmd-line-utils/readline/terminal.c:
        tgetnum and tgetflag might not take a const string argument.
      mysys/my_gethostbyname.c:
        Tag unused arguments.
      mysys/my_sync.c:
        Tag unused arguments.
      28f9f07e
    • Bjorn Munch's avatar
      Bug #56654 pb2 log is very hard to read · 3398089e
      Bjorn Munch authored
      Added some more info in a number of fail cases
      (re-commit for administrative reasons)
      3398089e
    • Bjorn Munch's avatar
      Bug #52828 Tests that use perl fail when perl is not in path · cc983551
      Bjorn Munch authored
      main.mysqltest skipped on Windows because a perl intentionally does exit(1)
      Use exit(2), as exit(1) on Windows is indistinguishable from failing to
      execute perl.
      cc983551
    • Bjorn Munch's avatar
    • Magne Mahre's avatar
      Bug #46941 crash with lower_case_table_names=2 and foreign key · 1dd39c09
      Magne Mahre authored
                 data dictionary confusion
      
      On file systems with case insensitive file names, and
      lower_case_table_names set to '2', the server could crash
      due to a table definition cache inconsistency.  This is 
      the default setting on MacOSX, but may also be set and
      used on MS Windows.
      
      The bug is caused by using two different strategies for
      creating the hash key for the table definition cache, resulting
      in failure to look up an entry which is present in the cache,
      or failure to delete an existing entry.  One strategy was to
      use the real table name (with case preserved), and the other
      to use a normalized table name (i.e a lower case version).
      
      This is manifested in two cases.  One is  during 'DROP DATABASE', 
      where all known files are removed.  The removal from
      the table definition cache is done via a generated list of
      TABLE_LIST with keys (wrongly) created using the case preserved 
      name.  The other is during CREATE TABLE, where the cache lookup
      is also (wrongly) based on the case preserved name.
         
      The fix was to use only the normalized table name when
      creating hash keys.
      
      
      sql/sql_db.cc:
        Normalize table name (i.e lower case it)
      sql/sql_table.cc:
        table_name contains the normalized name
        alias contains the real table name
      1dd39c09
    • Jon Olav Hauglid's avatar
      Bug #57274 SET GLOBAL debug crashes on Solaris in embedded server mode · 487019ec
      Jon Olav Hauglid authored
                 (variables_debug fails)
      
      The problem was that "SET GLOBAL debug" could cause a crash on Solaris.
      The crash happened if the server failed to open the trace file given in 
      the "SET GLOBAL debug" statement. This caused an error message to be
      printed to stderr containing the process name. However, printing to
      stderr crashed the server since the pointer to the process name had
      not been initialized.
      
      This patch fixes the problem by initializing the process name 
      properly when doing "SET GLOBAL debug".
      
      No test case added as this bug was repeatable with existing test
      coverage in variables_debug.test.
      487019ec
    • Tor Didriksen's avatar
      74cc3528
    • Marko Mäkelä's avatar
      Bug #56680 wrong InnoDB results from a case-insensitive covering index · 62d1cdbe
      Marko Mäkelä authored
      row_search_for_mysql(): When a secondary index record might not be
      visible in the current transaction's read view and we consult the
      clustered index and optionally some undo log records, return the
      relevant columns of the clustered index record to MySQL instead of the
      secondary index record.
      
      ibuf_insert_to_index_page_low(): New function, refactored from
      ibuf_insert_to_index_page().
      
      ibuf_insert_to_index_page(): When we are inserting a record in place
      of a delete-marked record and some fields of the record differ, update
      that record just like row_ins_sec_index_entry_by_modify() would do.
      
      btr_cur_update_alloc_zip(): Make the function public.
      
      mysql_row_templ_t: Add clust_rec_field_no.
      
      row_sel_store_mysql_rec(), row_sel_push_cache_row_for_mysql(): Add the
      flag rec_clust, for returning data at clust_rec_field_no instead of
      rec_field_no. Resurrect the debug assertion that the record not be
      marked for deletion. (Bug #55626)
      
      [UNIV_DEBUG || UNIV_IBUF_DEBUG] ibuf_debug, buf_page_get_gen(),
      buf_flush_page_try():
      Implement innodb_change_buffering_debug=1 for evicting pages from the
      buffer pool, so that change buffering will be attempted more
      frequently.
      62d1cdbe