1. 20 Aug, 2010 3 commits
    • Georgi Kodinov's avatar
      merge · 352f2ada
      Georgi Kodinov authored
      352f2ada
    • Georgi Kodinov's avatar
      merge · 414e95e8
      Georgi Kodinov authored
      414e95e8
    • Georgi Kodinov's avatar
      Bug #55826: create table .. select crashes with when · 3b36a677
      Georgi Kodinov authored
        KILL_BAD_DATA is returned
      
      Two problems discovered with the LEAST()/GREATEST() 
      functions:
      1. The check for a null value should happen even 
      after the second call to val_str() in the args. This is
      important because two subsequent calls to the same
      Item::val_str() may yield different results.
      Fixed by checking for NULL value before dereferencing
      the string result.
      
      2. While looping over the arguments and evaluating them 
      the loop should stop if there was an error evaluating so far
      or the statement was killed. Fixed by checking for error
      and bailing out.
      3b36a677
  2. 16 Aug, 2010 3 commits
    • Sunny Bains's avatar
      Merge from -c3476 mysql-5.1-security. · 97aa1215
      Sunny Bains authored
           ------------------------------------------------------------
           revno: 3476
           committer: Sunny Bains <Sunny.Bains@Oracle.Com>
           branch nick: 5.1-security
           timestamp: Thu 2010-08-05 19:18:17 +1000
           message:
             Fix bug# 55543 - InnoDB Plugin: Signal 6: Assertion failure in file fil/fil0fil.c line 4306
      
               The bug is due to a double delete of a BLOB, once via:
      
                     rollback -> btr_cur_pessimistic_delete()
      
               and the second time via purge.
      
               The bug is in row_upd_clust_rec_by_insert(). There we relinquish ownership
               of the non-updated BLOB columns in btr_cur_mark_extern_inherited_fields()
               before building the row entry that will be inserted and whose contents will
               be logged in the UNDO log. However, we don't set the BLOB column later to
               INHERITED so that a possible rollback will not free the original row's
               non-updated BLOB entries. This is because the condition that checks for
               that is in :
      
           		    	if (node->upd_ext) {}.
      
               node->upd_ext is non-NULL only if a BLOB column was updated and that column
               is part of some key ordering (see row_upd_replace()). This results in the
               non-update BLOB columns being deleted during a rollback and subsequently by
               purge again.
      
               rb://413
      97aa1215
    • Sunny Bains's avatar
      Fix Bug #55277 - Failing assertion: auto_inc > 0 · 787f0c54
      Sunny Bains authored
      Handle overflow when reading value from SELECT MAX(C) FROM T;
      
      Call ha_innobase::info() after initializing the autoinc value
      in ha_innobase::open().
      
      Fix for both the builtin and plugin.
      
      rb://402
      
      Merge from mysql-5.1-security.
      787f0c54
    • Sunny Bains's avatar
      62aa8943
  3. 15 Aug, 2010 1 commit
  4. 13 Aug, 2010 5 commits
    • Vasil Dimov's avatar
      Manually merge a changeset from mysql-5.1-security: · bfca4bb9
      Vasil Dimov authored
        ------------------------------------------------------------
        revno: 3475
        revision-id: jimmy.yang@oracle.com-20100804103744-vbpeghipkz6pyc9z
        parent: jimmy.yang@oracle.com-20100804101133-c38qqbm0fkwn9jhc
        committer: Jimmy Yang <jimmy.yang@oracle.com>
        branch nick: mysql-5.1-security
        timestamp: Wed 2010-08-04 03:37:44 -0700
        message:
          Fix bug #54678, InnoDB, TRUNCATE, ALTER, I_S SELECT, crash or deadlock
          
          rb://399 approved by Sunny Bains
        modified:
          storage/innodb_plugin/ChangeLog 2425@16c675df-0fcb-4bc9-8058-dcc011a37293:branches%2Fzip%2FChangeLog
          storage/innodb_plugin/include/dict0dict.h 2@16c675df-0fcb-4bc9-8058-dcc011a37293:trunk%2Finclude%2Fdict0dict.h
          storage/innodb_plugin/include/dict0dict.ic 2@16c675df-0fcb-4bc9-8058-dcc011a37293:trunk%2Finclude%2Fdict0dict.ic
          storage/innodb_plugin/row/row0mysql.c 2@16c675df-0fcb-4bc9-8058-dcc011a37293:trunk%2Frow%2Frow0mysql.c
      bfca4bb9
    • Vasil Dimov's avatar
      Merge mysql-5.1-security -> mysql-5.5-security up to · 865210f9
      Vasil Dimov authored
      sunny.bains@oracle.com-20100805092434-tvxxzjgqgslo14en
      
      This is a null merge of InnoDB changes which will be ported into a
      separate commits.
      865210f9
    • Vasil Dimov's avatar
      Merge mysql-5.1-security -> mysql-5.5-security up to c3473 · 6a4ec43b
      Vasil Dimov authored
      (this is a null merge)
      6a4ec43b
    • Georgi Kodinov's avatar
      merge · 2ecc81cb
      Georgi Kodinov authored
      2ecc81cb
    • Georgi Kodinov's avatar
      Bug #55615 and bug #55564 · a5575096
      Georgi Kodinov authored
      An user assignment variable expression that's 
      evaluated in a logical expression context 
      (Item::val_bool()) can be pre-calculated in a 
      temporary table for GROUP BY.
      However when the expression value is used after the
      temp table creation it was re-evaluated instead of
      being read from the temp table due to a missing 
      val_bool_result() method.
      Fixed by implementing the method.
      a5575096
  5. 06 Aug, 2010 1 commit
    • Gleb Shchepa's avatar
      Bug #55424: convert_tz crashes when fed invalid data · ed736379
      Gleb Shchepa authored
      The CONVERT_TZ function crashes the server when the
      timezone argument is an empty SET field value.
      
      1) The CONVERT_TZ may find a timezone string in the
         tz_names hash.
      2) A string representation of the empty SET is a
         String of zero length with the NULL pointer.
      3) If the key argument length is zero, hash functions
         do comparison using the length of the record being
         compared against.
      
      I.e. a zero-length String buffer is an invalid
      argument for hash search functions, and if String
      points to NULL buffer, hashcmp() fails with SEGV
      accessing that memory.
      
      The my_tz_find function has been modified to
      treat empty Strings as invalid timezone values
      to skip unnecessary hash search.
      ed736379
  6. 05 Aug, 2010 2 commits
    • Sunny Bains's avatar
      Fix Bug #55277 - Failing assertion: auto_inc > 0 · 6c0f9301
      Sunny Bains authored
      Handle overflow when reading value from SELECT MAX(C) FROM T;
      
      Call ha_innobase::info() after initializing the autoinc value
      in ha_innobase::open().
      
      Fix for both the builtin and plugin.
      
      rb://402
      6c0f9301
    • Sunny Bains's avatar
      Fix bug# 55543 - InnoDB Plugin: Signal 6: Assertion failure in file fil/fil0fil.c line 4306 · e19a4942
      Sunny Bains authored
      The bug is due to a double delete of a BLOB, once via:
      
          rollback -> btr_cur_pessimistic_delete()
      
      and the second time via purge.
      
      The bug is in row_upd_clust_rec_by_insert(). There we relinquish ownership
      of the non-updated BLOB columns in btr_cur_mark_extern_inherited_fields()
      before building the row entry that will be inserted and whose contents will
      be logged in the UNDO log. However, we don't set the BLOB column later to
      INHERITED so that a possible rollback will not free the original row's
      non-updated BLOB entries. This is because the condition that checks for
      that is in :
      
      	if (node->upd_ext) {}.
      
      node->upd_ext is non-NULL only if a BLOB column was updated and that column
      is part of some key ordering (see row_upd_replace()). This results in the
      non-update BLOB columns being deleted during a rollback and subsequently by
      purge again.
      
      rb://413
      e19a4942
  7. 04 Aug, 2010 6 commits
  8. 03 Aug, 2010 10 commits
  9. 02 Aug, 2010 6 commits
  10. 01 Aug, 2010 1 commit
    • Gleb Shchepa's avatar
      Bug #54461: crash with longblob and union or update with subquery · 38165ce4
      Gleb Shchepa authored
      Queries may crash, if
        1) the GREATEST or the LEAST function has a mixed list of
           numeric and LONGBLOB arguments and
        2) the result of such a function goes through an intermediate
           temporary table.
      
      An Item that references a LONGBLOB field has max_length of
      UINT_MAX32 == (2^32 - 1).
      
      The current implementation of GREATEST/LEAST returns REAL
      result for a mixed list of numeric and string arguments (that
      contradicts with the current documentation, this contradiction
      was discussed and it was decided to update the documentation).
      
      The max_length of such a function call was calculated as a
      maximum of argument max_length values (i.e. UINT_MAX32).
      
      That max_length value of UINT_MAX32 was used as a length for
      the intermediate temporary table Field_double to hold
      GREATEST/LEAST function result.
      
      The Field_double::val_str() method call on that field
      allocates a String value.
      
      Since an allocation of String reserves an additional byte
      for a zero-termination, the size of String buffer was
      set to (UINT_MAX32 + 1), that caused an integer overflow:
      actually, an empty buffer of size 0 was allocated.
      
      An initialization of the "first" byte of that zero-size
      buffer with '\0' caused a crash.
      
      The Item_func_min_max::fix_length_and_dec() has been
      modified to calculate max_length for the REAL result like
      we do it for arithmetical operators.
      
      
      ******
      Bug #54461: crash with longblob and union or update with subquery
      
      Queries may crash, if
        1) the GREATEST or the LEAST function has a mixed list of
           numeric and LONGBLOB arguments and
        2) the result of such a function goes through an intermediate
           temporary table.
      
      An Item that references a LONGBLOB field has max_length of
      UINT_MAX32 == (2^32 - 1).
      
      The current implementation of GREATEST/LEAST returns REAL
      result for a mixed list of numeric and string arguments (that
      contradicts with the current documentation, this contradiction
      was discussed and it was decided to update the documentation).
      
      The max_length of such a function call was calculated as a
      maximum of argument max_length values (i.e. UINT_MAX32).
      
      That max_length value of UINT_MAX32 was used as a length for
      the intermediate temporary table Field_double to hold
      GREATEST/LEAST function result.
      
      The Field_double::val_str() method call on that field
      allocates a String value.
      
      Since an allocation of String reserves an additional byte
      for a zero-termination, the size of String buffer was
      set to (UINT_MAX32 + 1), that caused an integer overflow:
      actually, an empty buffer of size 0 was allocated.
      
      An initialization of the "first" byte of that zero-size
      buffer with '\0' caused a crash.
      
      The Item_func_min_max::fix_length_and_dec() has been
      modified to calculate max_length for the REAL result like
      we do it for arithmetical operators.
      38165ce4
  11. 31 Jul, 2010 2 commits