1. 19 Nov, 2010 3 commits
    • Igor Babaev's avatar
      Got the declarations related to the class JOIN_CACHE, its derivatives and · cf46424f
      Igor Babaev authored
      companions out of sql_select.h into a separate file sql_join_cache.h.
      cf46424f
    • Igor Babaev's avatar
      Fixed LP bug #675922. · 17225075
      Igor Babaev authored
      The bug happened when BKA join algorithm used an incremental buffer
      and some of the fields over which access keys were constructed
      - were allocated in the previous join buffers
      - were non-nullable
      - belonged to inner tables of outer joins.
      For such fields an offset to the field value in the record is saved
      in the postfix of the record, and a zero offset indicates that the value 
      is null. Before the key using the field value is constructed the
      value is read into the corresponding field of the record buffer and
      the null bit is set for the field if the offset is 0. However if
      the field is non-nullable the table->null_row must be set to 1
      for null values and to 0 for non-null values  to ensure proper reading
      of the value from the record buffer.
      
      17225075
    • Igor Babaev's avatar
      Fixed LP #bug 660963. · 375cf7d8
      Igor Babaev authored
      The condition that was supposed to check whether a join table
      is an inner table of a nested outer join or semi-join was not
      quite correct in the code of the function check_join_cache_usage.
      That's why some queries with nested outer joins triggered 
      an assertion failure.
      Encapsulated this condition in the new method called
      JOIN_TAB::is_nested_inner and provided a proper code for it.
      
      Also corrected a bug in the code of check_join_cache_usage()
      that caused a downgrade of not first join buffers of the
      level 5 and 7 to level 4 and 6 correspondingly.
      375cf7d8
  2. 16 Nov, 2010 1 commit
    • Igor Babaev's avatar
      Fixed LP bug #675516. · 8228cca1
      Igor Babaev authored
      When pushing the condition for a table in the function
      JOIN_TAB::make_scan_filter the optimizer must not push
      conditions from WHERE if the table is some inner table
      of an outer join..
      8228cca1
  3. 15 Nov, 2010 1 commit
    • Igor Babaev's avatar
      Fixed LP bug #675095. · bd03909b
      Igor Babaev authored
      The condition over outer tables extracted from the on expression
      for a outer join must be ANDed to the condition pushed to the
      first inner table of this outer join only.
      Nested outer joins cannot use flat join buffers. So if join_cache_level
      is set to 1 then any join algorithm employing join buffers cannot be used
      for nested outer joins.
      bd03909b
  4. 13 Nov, 2010 4 commits
    • Igor Babaev's avatar
      Fixed LP bug #674423. · 7068cfa0
      Igor Babaev authored
      The patch that introduced the new enumeration type Match_flag
      for the values of match flags in the records put into join buffers
      missed the necessary modifications in JOIN_CACHE::set_match_flag_if_none.
      This could cause wrong results for outer joins with on expressions
      only over outer tables.
      
      
      7068cfa0
    • Igor Babaev's avatar
      Merge · acf1981d
      Igor Babaev authored
      acf1981d
    • Igor Babaev's avatar
      Fixed LP bug #674431. · 0053ef0a
      Igor Babaev authored
      A non-incremental join buffer cannot be used for inner tables of nested
      outer joins. That's why when join_cache_level is set to 7 it must
      be downgraded to level 6 for the inner tables of nested outer joins.
      For the same reason with join_cache_level set to 3 no join buffer is
      used for the inner tables of outer joins (we could downgrade it to
      level 2, but this level does not support ref access).
      0053ef0a
    • Igor Babaev's avatar
      Corrected the fix for LP bug 672551. · f9d1f3c7
      Igor Babaev authored
      f9d1f3c7
  5. 12 Nov, 2010 3 commits
    • Igor Babaev's avatar
      Merge · 6b4dc02e
      Igor Babaev authored
      6b4dc02e
    • Igor Babaev's avatar
      Fixed LP bug #672551. · 637885c1
      Igor Babaev authored
      Made sure that the function that copy a long varchar field from the record
      buffer into a key buffer does not copy bytes after the field value.
      637885c1
    • Igor Babaev's avatar
      Merge · 349bcf09
      Igor Babaev authored
      349bcf09
  6. 11 Nov, 2010 1 commit
    • Igor Babaev's avatar
      Fixed LP bug#672497. · 12bd888c
      Igor Babaev authored
      Miscalculation of the minimum possible buffer size could trigger
      an assert in JOIN_CACHE_HASHED::put_record when if join_buffer_size
      was set to the values that is less than the length of one record to
      stored in the join buffer.
      It happened due to the following mistakes:
      - underestimation of space needed for a key in the hash table
        (we have to take into account that hash table can have more
        buckets than the expected number of records).
      - the value of maximum total length of all records stored in
        the join buffer was not saved in the field max_used_fieldlength
        by the function calc_used_field_length.
      12bd888c
  7. 10 Nov, 2010 2 commits
  8. 09 Nov, 2010 3 commits
  9. 08 Nov, 2010 3 commits
  10. 07 Nov, 2010 1 commit
    • Igor Babaev's avatar
      Fixed LP bug #671901. · e5a07fcd
      Igor Babaev authored
      Currently BNLH join uses a simplified implementation of hash function
      when hash function is calculated over the whole key buffer, not only
      the significant bytes of it. It means that both building keys and
      probing keys both must fill insignificant bytes with the same filler.
      Usually 0 is used as such a filler.
      Yet the code before patch filled insignificant bytes only for probing
      keys. 
      e5a07fcd
  11. 06 Nov, 2010 3 commits
    • Igor Babaev's avatar
      Merge · 79a7c321
      Igor Babaev authored
      79a7c321
    • Igor Babaev's avatar
      Merge · c755753a
      Igor Babaev authored
      c755753a
    • Igor Babaev's avatar
      BNL and BNLH algorithms scan the join table and for each its record they · c3fb76db
      Igor Babaev authored
      try to find a match in the join buffer. It makes sense to check for a match
      only those records satisfying WHERE/ON conditions that can be pushed to
      the scanned table. It allows us to discard early some join candidates.
      
      Such pushdown conditions were built when BNL join algorithm was employed,
      but for they were not built when BNLH algorithm was used.
      The patch removes this shortcoming. 
      c3fb76db
  12. 05 Nov, 2010 4 commits
  13. 04 Nov, 2010 4 commits
  14. 03 Nov, 2010 5 commits
    • unknown's avatar
      MBug#643463: slow XtraDB shutdown due to 10 second sleep in purge thread · 665cdc08
      unknown authored
      Implement os_event_wait_time() for POSIX systems.
      
      In the purge thread, use os_event_wait_time() when sleeping rather than sleep,
      and signal the event when server shuts down, so we do not need to wait for
      upto 10 seconds until the purge thread wakes up.
      
      Also fix bug that warnings that were pushed after we call set_ok_status() were
      not included in the waning count sent to the client in the result packet.
      
      Also in mysqltest, in recursive die() invocation at least print the message
      before aborting.
      
      client/mysqltest.cc:
        If we detect recursive die(), at least print the message before aborting.
      mysql-test/r/warnings_debug.result:
        Test case.
      mysql-test/t/warnings_debug.test:
        Test case.
      sql/handler.cc:
        Force generation of a warning with specific debug option, for testing.
      sql/protocol.cc:
        Fix wrong DBUG_ENTER
      sql/sql_class.h:
        Add method to count warnings pushed after set_ok_status() is called.
      sql/sql_error.cc:
        Also count warnings pushed after set_ok_status() is called.
      storage/xtradb/include/os0sync.h:
        Implement working os_sync_wait_time() for POSIX.
      storage/xtradb/include/srv0srv.h:
        Make the purge thread wait for an event when sleeping, so we can signal it to
        wakeup immediately at shutdown.
      storage/xtradb/log/log0log.c:
        Make the purge thread wait for an event when sleeping, so we can signal it to
        wakeup immediately at shutdown.
      storage/xtradb/os/os0sync.c:
        Implement working os_sync_wait_time() for POSIX.
      storage/xtradb/srv/srv0srv.c:
        Make the purge thread wait for an event when sleeping, so we can signal it to
        wakeup immediately at shutdown.
      665cdc08
    • Igor Babaev's avatar
      Fixed LP bug #664594 and other bugs leading to invalid execution · 3d8c7a2c
      Igor Babaev authored
      plans or wrong results due to the fact that JOIN_CACHE functions
      ignored the possibility of interleaving materialized semijoin 
      tables with tables whose records were stored in join buffers.
      This fixes would become mostly unnecessary if the new code of
      mwl 90 was merged into 5.3 right now.
      Yet the fix the code of optimize_wo_join_buffering was needed
      in any case.
      
      3d8c7a2c
    • Michael Widenius's avatar
    • Michael Widenius's avatar
      Automatic merge · f50c7d17
      Michael Widenius authored
      f50c7d17
    • Michael Widenius's avatar
      Fixed compiler & valgrind warnings from my previous push. · f435db5b
      Michael Widenius authored
      Fixed a bug in Aria when two threads was inserting into the same table and row page and one thread did an abort becasue of duplicate key.
      
      
      
      mysys/thr_lock.c:
        Fixed valgrind warning
      sql/sql_base.cc:
        Remove not used variable
      storage/maria/ma_bitmap.c:
        Added ma_bitmap_lock() & ma_bitmap_unlock() to protect against two threads using the bitmap at the same time.
        More DBUG_PRINT()
      storage/maria/ma_blockrec.c:
        Fixed a bug in Aria when two threads was inserting into the same table and row page and one thread did an abort becasue of duplicate key.
        Fix was that we block other threads to modify the bitmap while we are removing the row with a duplicate key.
      storage/maria/ma_blockrec.h:
        Added ma_bitmap_lock() & ma_bitmap_unlock() to protect against two threads using the bitmap at the same time.
      storage/maria/maria_def.h:
        Changed flush_all_requested to be a counter.
      storage/myisam/mi_locking.c:
        Fixed compiler error on windows (typo).
      f435db5b
  15. 02 Nov, 2010 2 commits