1. 17 Aug, 2011 5 commits
    • unknown's avatar
      Fix bug lp:813473 · 6b70cc53
      unknown authored
      The bug is a duplicate of MySQL's Bug#11764086,
      however MySQL's fix is incomplete for MariaDB, so
      this fix is slightly different.
      
      In addition, this patch renames
      Item_func_not_all::top_level() to is_top_level_item()
      to make it in line with the analogous methods of
      Item_in_optimizer, and Item_subselect.
      
      Analysis:
      It is possible to determine whether a predicate is
      NULL-rejecting only if it is a top-level one. However,
      this was not taken into account for Item_in_optimizer.
      As a result, a NOT IN predicate was erroneously
      considered as NULL-rejecting, and the NULL-complemented
      rows generated by the outer join were rejected before
      being checked by the NOT IN predicate.
      
      Solution:
      Change Item_in_optimizer to be considered as
      NULL-rejecting only if it a top-level predicate.
      6b70cc53
    • Sergey Petrunya's avatar
      field_conv.cc: added comments · f240aa4c
      Sergey Petrunya authored
      opt_range.cc: modified print_key() so that it doesn't do memory re-allocs when
      printing multipart keys over varchar columns. When it did, key printout in 
      debug trace was interrupted with my_malloc/free printouts.
      f240aa4c
    • Sergey Petrunya's avatar
      Merge · 63216194
      Sergey Petrunya authored
      63216194
    • Sergey Petrunya's avatar
      BUG#826935 Assertion `!table || (!table->read_set ||... · e4bb5334
      Sergey Petrunya authored
      BUG#826935 Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' failed
      - add_ref_to_table_cond() should not just overwrite pre_idx_push_select_cond
        with the contents tab->select_cond.
        pre_idx_push_select_cond exists precisely for the reason that it may contain
        a condition that is a strict superset of what is in tab->select_cond. 
        The fix is to inject generated equality into pre_idx_push_select_cond.
      e4bb5334
    • Igor Babaev's avatar
      Fixed LP bug #825035. · 249a10c7
      Igor Babaev authored
      The value of maybe_null flag should be saved for the second execution
      of a prepared statement from SELECT that uses an outer join.
      249a10c7
  2. 16 Aug, 2011 9 commits
  3. 15 Aug, 2011 6 commits
    • Michael Widenius's avatar
      Fixed recovery crash lp:814806 "Unclean shutdown corrupted Aria table blocking startup" · 13af3982
      Michael Widenius authored
      storage/maria/ma_recovery.c:
        Moved trman_init() before parse_checkpoint_record() as this calls trnman functions if we have to open tables.
      13af3982
    • Michael Widenius's avatar
      Automatic merge with 5.2 · fb135f7e
      Michael Widenius authored
      fb135f7e
    • Michael Widenius's avatar
      Merge in bug fix from 5.1 · b5f830d8
      Michael Widenius authored
      b5f830d8
    • Michael Widenius's avatar
      Increase server version · 8740e596
      Michael Widenius authored
      8740e596
    • Michael Widenius's avatar
      Fixed bug lp:826377 "Aria DB Format: Reading specific table from dump causes Wrong bytesec" · e71eb27a
      Michael Widenius authored
      The bug was that when using bulk insert combined with lock table, we intitalized the io cache with the wrong file position.
      This fixed a bug where MariaDB could not read in a table dump done with mysqldump.
      
      
      mysql-test/suite/maria/r/locking.result:
        Test case for locking + write cache bug
      mysql-test/suite/maria/t/locking.test:
        Test case for locking + write cache bug
      storage/maria/ma_extra.c:
        Initialize write cache used with bulk insert to correct file length.
        (The old code didn't work if one was using LOCK TABLE for the given table).
      e71eb27a
    • Michael Widenius's avatar
      Fixes bugs found by testcase for lp:815022 and lp:726374 "ma_blockrec.c:3000:... · b95d2778
      Michael Widenius authored
      Fixes bugs found by testcase for lp:815022 and lp:726374 "ma_blockrec.c:3000: write_block_record: Assertion `cur_block[1].page_count == 0' failed with a multi-index Aria workload"
      The issues was:
      - For some tables with a lot of not packed fields, we didn't allocate enough memory in head page which caused DBUG_ASSERT's
      - Removed wrong DBUG_ASSERT()
      - Fixed a problem with underflow() where it generates a key page where all keys didn't fit.
      - Max key length is now limited by block_size/3  (was block_size /2).  This is required for underflow() to work with packed keys.
      
      
      
      
      mysql-test/lib/v1/mysql-test-run.pl:
        Remove --alignment=8 as this doesn't work on 64 bit systems
      mysql-test/suite/maria/r/small_blocksize.result:
        Test case for Aria bug
      mysql-test/suite/maria/t/small_blocksize-master.opt:
        Test case for Aria bug
      mysql-test/suite/maria/t/small_blocksize.test:
        Test case for Aria bug
      storage/maria/ha_maria.cc:
        Fixed comment
      storage/maria/ma_bitmap.c:
        Fixed wrong variable usage in find_where_to_split_row() where we allocated too little memory for head page.
        We did not take into account space for head extents (long VARCHAR) when trying to split row on head page. This caused us to allocate too little space from bitmap which lead to ASSERT failures later.
      storage/maria/ma_blockrec.c:
        Made some argument const (to ensure they was not accidently changed)
        Removed wrong DBUG_ASSERT()
      storage/maria/ma_blockrec.h:
        Removed not used variable
      storage/maria/ma_delete.c:
        Added my_afree() in case of error
        More comments and DBUG_ASSERT() for underflow()
      storage/maria/ma_open.c:
        Make keyinfo->underflow_block_length smaller for packed keys. This has to be done as for long packed keys, underflow() otherwise generates a key page where all keys didn't fit.
      storage/maria/ma_page.c:
        New DBUG_ASSERT()
      storage/maria/ma_write.c:
        Fixed comment
      storage/maria/maria_def.h:
        We have to have space for at least 3 keys on a key page.
        (Otherwise the underflow() code doesn't work for packed keys, even when we have an underflow() for an empty key page)
      b95d2778
  4. 12 Aug, 2011 8 commits
  5. 11 Aug, 2011 1 commit
    • Igor Babaev's avatar
      Fixed LP bug #823826. · 4ddea0cb
      Igor Babaev authored
      The method Item_func_isnull::update_used_tables() erroneously did not
      update cached values stored in the fields used_tables_cache and
      const_item_cache of the Item_func_isnull objects. As a result the
      Item_func_isnull::used_tables() returned wrong bitmaps and, as a
      consequence, push-down predicates could be attached to wrong tables.
      4ddea0cb
  6. 10 Aug, 2011 2 commits
    • Michael Widenius's avatar
      Fixed bug lp:814054 'Assertion `block->hash_link == hash_link &&... · b5ef802f
      Michael Widenius authored
      Fixed bug lp:814054 'Assertion `block->hash_link == hash_link && hash_link->block == block' in ma_pagecache.c:2275 with Aria'
      - Replaced old DBUG_ASSERT with a new correct one + a comment.
      
      storage/maria/ma_pagecache.c:
        Replaced old DBUG_ASSERT with a new correct one + a comment.
      b5ef802f
    • Michael Widenius's avatar
      Fixes MySQL bug#48972: mysqldump --insert-ignore leaves set unique_checks=0. · 397fc34f
      Michael Widenius authored
      This fixes a bug that when you use mysqldump --no-create-info to generate a dump that you want to merge with an existing table,
      you can get an innodb table with duplicated unique keys.
      Patch orignally by Eric Bergen.
      
      
      client/mysqldump.c:
        Only use UNIQUE_CHECKS=0 for tables that are created.
        This solves the issue that you can't get duplicate unique keys when merging two dumps.
      mysql-test/r/mysqldump.result:
        Test for mysqldump --no-create-info
      397fc34f
  7. 09 Aug, 2011 3 commits
    • unknown's avatar
      Bug lp:781508: Take relevant test cases from MySQL 5.6 feature preview trees · 20968257
      unknown authored
      Identified all test cases in the MySQL file subquery_mat.inc that are
      not present in MariaDB. In total found 8 test cases for the following
      MySQL bugs:
      * BUG#49630 - not a bug in MariaDB, added test case
      * BUG#52538 - not a bug in MariaDB, added test case (checked with VG)
      * BUG#53103 - not a bug in MariaDB, added test case
      * BUG#54511 - not a bug in MariaDB, added test case
      * BUG#56367 - not a bug in MariaDB, added test case
      * BUG#59833 - not a bug in MariaDB, added test case
      * BUG#11852644 - not a bug in MariaDB, added test case
      * BUG#12668294 - not a bug in MariaDB, added test case
      
      All of these MySQL bugs are not present in MariaDB 5.3.
      
      The comparison was based on the following version of
      mysql-trunk:
      
      revno: 3350 [merge]
      committer: Marko Mäkelä <marko.makela@oracle.com>
      branch nick: mysql-trunk
      timestamp: Mon 2011-08-08 12:42:09 +0300
      message:
        Merge mysql-5.5 to mysql-trunk.
      20968257
    • unknown's avatar
      Fix bug lp:817384 · a6037394
      unknown authored
      This bug is a special case of lp:813447.
      
      Analysis:
      Constant optimization finds that the condition t2.a = 1
      can be used to access the primary key of table 't2'. As
      a result both outer table t1,t2 are considered as constant
      when we reach the execution phase. At the same time, during
      constant optimization, the IN predicate is not evaluated
      because it is expensive.
      
      When execution of the outer query reaches do_select(),
      control flow enter the branch:
      if (join->table_count == join->const_tables)
      { ... }
      This branch checks only the WHERE and HAVING clauses,
      but doesn't check the ON clauses of the query. Since the
      IN predicate was not evaluated during optimization, it is
      not evaluated at all, thus execution doesn't detect that
      the ON clause is FALSE.
      
      Solution:
      Similar to the patch for bug lp:813447, exclude system
      tables from constant substitution based on unique key
      lookups if there is an expensive ON condition on the
      inner table.
      a6037394
    • Igor Babaev's avatar
      Fixed LP bug #819716. · b7e9713e
      Igor Babaev authored
      Do not optimize derived table for the second time ever.
      b7e9713e
  8. 08 Aug, 2011 6 commits
    • Sergey Petrunya's avatar
      Merge fix for BUG#822134 · 2ea5096c
      Sergey Petrunya authored
      2ea5096c
    • Sergey Petrunya's avatar
      BUG#822134: Invalid plan and wrong result set for Q20 from DBT3 benchmark set · 81335120
      Sergey Petrunya authored
      - create_ref_for_key() has the code that walks KEYUSE array and tries to use
        maximum number of keyparts for ref (and eq_ref and ref_or_null) access.
        When one constructs ref access for table that is inside a SJ-Materialization
        nest, it is not possible to use tables that are ouside the nest (because 
        materialization is performed before they have any "current value").
        The bug was caused by this function not taking this into account.
      81335120
    • Sergey Petrunya's avatar
      Merge · b468a80e
      Sergey Petrunya authored
      b468a80e
    • Sergey Petrunya's avatar
      Update test results for previous cset · 0c459a01
      Sergey Petrunya authored
      0c459a01
    • Vladislav Vaintroub's avatar
      Fix long xtradb shutdown on Windows XP · fcb29391
      Vladislav Vaintroub authored
      The reason for the long shutdown is hanging in io threads. It appears
      that just closing completion port on XP does not necessarily signal 
      thread waiting in GetIOCompletionStatus() (even if this works fine
      on later Windows versions)
      
      The fix is to wakeup background threads using PostQueuedCompletionStatus()
      with a special 'key' parameter indicating shutdown.
      fcb29391
    • Vladislav Vaintroub's avatar
      LPBUG#882689 - crash during startup on XP. · 0a837698
      Vladislav Vaintroub authored
      The reason for the crash is Innodb assertion after trying to load condition variables function
      dynamically and not finding them
      
      The fix is to skip dynamic loading if srv_use_native_conditions is FALSE. srv_use_native_conditions 
      is derived from Windows version and would be FALSE on XP and TRUE on later Windows.
      
      This is the same handling as in MySQL 5.. In Maria 5.3 srv_use_native_conditions check was 
      presumably  lost in the downporting.
      0a837698