1. 15 Oct, 2010 2 commits
  2. 14 Oct, 2010 3 commits
    • Jimmy Yang's avatar
      27c80dd4
    • Vasil Dimov's avatar
      Tune the test for Bug#56143 too many foreign keys causes output of show create... · c8163ef1
      Vasil Dimov authored
      Tune the test for Bug#56143 too many foreign keys causes output of show create table to become invalid
      
      Use a CREATE statement with all the FKs instead of ALTERing the table many
      times because it is faster (11 seconds vs 3 seconds).
      
      c8163ef1
    • Vasil Dimov's avatar
      Fix Bug#56143 too many foreign keys causes output of show create table to become invalid · f918ad43
      Vasil Dimov authored
      This is a port of the following changeset from
      5.1/storage/innobase to 5.1/storage/innodb_plugin:
      
        ------------------------------------------------------------
        revno: 3626
        revision-id: vasil.dimov@oracle.com-20101013171859-gi9n558yj89x9v3w
        parent: klewis@mysql.com-20101012175933-ce9kkgl0z8oeqffa
        committer: Vasil Dimov <vasil.dimov@oracle.com>
        branch nick: mysql-5.1-innodb
        timestamp: Wed 2010-10-13 20:18:59 +0300
        message:
          Fix Bug#56143 too many foreign keys causes output of show create table to become invalid
          
          Just remove the check whether the file is "too big".
          A similar code exists in ha_innobase::update_table_comment() but that
          method does not seem to be used.
      
      Also use a CREATE statement with all the FKs instead of ALTERing the
      table 550 times because it is faster.
      f918ad43
  3. 13 Oct, 2010 1 commit
  4. 14 Oct, 2010 1 commit
  5. 13 Oct, 2010 1 commit
  6. 12 Oct, 2010 1 commit
    • unknown's avatar
      Bug#56632 - The warning code related to KEY_BLOCK_SIZE and ROW_FORMAT when... · 891bbf22
      unknown authored
      Bug#56632 - The warning code related to KEY_BLOCK_SIZE and ROW_FORMAT  when innodb_strict_mode=OFF  is improved in order to take into account whether the KEY_BLOCK_SIZE is specified on the current ALTER statement or the previous CREATE statement.
          
      The testcase shows the expected results of 12 different combinations of these settings.
      891bbf22
  7. 11 Oct, 2010 2 commits
  8. 05 Oct, 2010 1 commit
  9. 04 Oct, 2010 3 commits
  10. 01 Oct, 2010 1 commit
  11. 30 Sep, 2010 2 commits
    • Vasil Dimov's avatar
      Fix Bug#56340 innodb updates index stats too frequently after non-index updates · eaaea8eb
      Vasil Dimov authored
      This is a simple optimization issue. All stats are related to only indexed
      columns, index size or number of rows in the whole table. UPDATEs that touch
      only non-indexed columns cannot affect stats and we can avoid calling the
      function row_update_statistics_if_needed() which may result in unnecessary I/O.
      
      Approved by:	Marko (rb://466)
      eaaea8eb
    • Vasil Dimov's avatar
      Fix a potential bug when using __sync_lock_test_and_set() · 51cdf595
      Vasil Dimov authored
      TYPE __sync_lock_test_and_set (TYPE *ptr, TYPE value, ...)
      
      it is not documented what happens if the two arguments are of different
      type like it was before: the first one was lock_word_t (byte) and the
      second one was 1 or 0 (int).
      
      Approved by:	Marko (via IRC)
      51cdf595
  12. 28 Sep, 2010 3 commits
  13. 24 Sep, 2010 3 commits
  14. 22 Sep, 2010 1 commit
  15. 21 Sep, 2010 1 commit
  16. 17 Sep, 2010 1 commit
  17. 16 Sep, 2010 4 commits
    • Sergey Glukhov's avatar
      Bug#50402 Optimizer producing wrong results when using Index Merge on InnoDB · 31a38c0f
      Sergey Glukhov authored
      Subselect executes twice, at JOIN::optimize stage
      and at JOIN::execute stage. At optimize stage
      Innodb prebuilt struct which is used for the
      retrieval of column values is initialized in.
      ha_innobase::index_read(), prebuilt->sql_stat_start is true.
      After QUICK_ROR_INTERSECT_SELECT finished his job it
      restores read_set/write_set bitmaps with initial values
      and deactivates one of the handlers used by
      QUICK_ROR_INTERSECT_SELECT in JOIN::cleanup
      (it's the case when we reuse original handler as one of
       handlers required by QUICK_ROR_INTERSECT_SELECT object).
      On second subselect execution inactive handler is activated
      in  QUICK_RANGE_SELECT::reset, file->ha_index_init().
      In ha_index_init Innodb prebuilt struct is reinitialized
      with inappropriate read_set/write_set bitmaps. Further
      reinitialization in ha_innobase::index_read() does not
      happen as prebuilt->sql_stat_start is false.
      It leads to partial retrieval of required field values
      and we get a mix of field values from different records
      in the record buffer.
      The fix is to reset
      read_set/write_set bitmaps as these values
      are required for proper intialization of
      internal InnoDB struct which is used for
      the retrieval of column values
      (see build_template(), ha_innodb.cc)
      
      
      mysql-test/include/index_merge_ror_cpk.inc:
        test case
      mysql-test/r/index_merge_innodb.result:
        test case
      mysql-test/r/index_merge_myisam.result:
        test case
      sql/opt_range.cc:
        if ROR merge scan is used we need to reset
        read_set/write_set bitmaps as these values
        are required for proper intialization of
        internal InnoDB struct which is used for
        the retrieval of column values
        (see build_template(), ha_innodb.cc)
      31a38c0f
    • Magne Mahre's avatar
      Bug #54606 innodb fast alter table + pack_keys=0 prevents · ebd207ba
      Magne Mahre authored
                 adding new indexes
      
      A fast alter table requires that the existing (old) table
      and indices are unchanged (i.e only new indices can be
      added).  To verify this, the layout and flags of the old
      table/indices are compared for equality with the new.
      
      The PACK_KEYS option is a no-op in InnoDB, but the flag
      exists, and is used in the table compare.  We need to
      check this (table) option flag before deciding whether an 
      index should be packed or not.  If the table has
      explicitly set PACK_KEYS to 0, the created indices should
      not be marked as packed/packable. 
      ebd207ba
    • Dmitry Shulga's avatar
      Fixed bug#42503 - "Lost connection" errors when using · 0c91b53d
      Dmitry Shulga authored
      compression protocol.
      
      The loss of connection was caused by a malformed packet
      sent by the server in case when query cache was in use.
      When storing data in the query cache, the query  cache
      memory allocation algorithm had a tendency to reduce
      the amount of memory block necessary to store a result
      set, up to finally storing the entire result set in a single
      block. With a significant result set, this memory block
      could turn out to be quite large - 30, 40 MB and on.
      When such a result set was sent to the client, the entire
      memory block was compressed and written to network as a
      single network packet. However, the length of the
      network packet is limited by 0xFFFFFF (16MB), since
      the packet format only allows 3 bytes for packet length.
      As a result, a malformed, overly large packet
      with truncated length would be sent to the client
      and break the client/server protocol.
      
      The solution is, when sending result sets from the query
      cache, to ensure that the data is chopped into
      network packets of size <= 16MB, so that there
      is no corruption of packet length. This solution,
      however, has a shortcoming: since the result set
      is still stored in the query cache as a single block,
      at the time of sending, we've lost boundaries of individual
      logical packets (one logical packet = one row of the result
      set) and thus can end up sending a truncated logical
      packet in a compressed network packet.
      
      As a result, on the client we may require more memory than 
      max_allowed_packet to keep, both, the truncated
      last logical packet, and the compressed next packet.
      This never (or in practice never) happens without compression,
      since without compression it's very unlikely that
      a) a truncated logical packet would remain on the client
      when it's time to read the next packet
      b) a subsequent logical packet that is being read would be
      so large that size-of-new-packet + size-of-old-packet-tail >
      max_allowed_packet.
      To remedy this issue, we send data in 1MB sized packets,
      that's below the current client default of 16MB for
      max_allowed_packet, but large enough to ensure there is no
      unnecessary overhead from too many syscalls per result set.
      
      
      sql/net_serv.cc:
        net_realloc() modified: consider already used memory
        when compare packet buffer length
      sql/sql_cache.cc:
        modified Query_cache::send_result_to_client: send result to client
        in chunks limited by 1 megabyte.
      0c91b53d
    • Mikael Ronstrom's avatar
  18. 15 Sep, 2010 9 commits