1. 24 Mar, 2014 19 commits
  2. 23 Mar, 2014 3 commits
    • Alexander Barkov's avatar
      MDEV-5781 Item_sum_std::val_real(): Assertion `nr >= 0.0' fails on query with... · ce3c457e
      Alexander Barkov authored
      MDEV-5781 Item_sum_std::val_real(): Assertion `nr >= 0.0' fails on query with STDDEV_POP, ROUND and variable
      
      ce3c457e
    • Alexander Barkov's avatar
      A joint patch for: · 92bd6801
      Alexander Barkov authored
      - MDEV-5689 ExtractValue(xml, 'substring(/x,/y)') crashes
      - MDEV-5709 ExtractValue() with XPath variable references returns wrong result.
      
      Description:
      
      1. The main problem was that that nodeset_func->fix_fields() was
      called in Item_func_xml_extractvalue::val_str() and
      Item_func_xml_update::val_str(), which led in some cases to
      execution of the XPath engine *before* having a parsed XML value.
      Moved to Item_xml_str_func::fix_fields().
      
      2. Cleanup: added a new method Item_xml_str_func::fix_fields() and moved
      most of the code from Item_xml_str_func::fix_length_and_dec()
      to Item_xml_str_func::fix_fields(), to follow the usual Item layout.
      
      3. Cleanup: a parsed XML value is useless without the raw XML value
      it was built from.
      
      Previously the parsed and the raw values where stored in separate String
      instances. It was hard to follow how they are synchronized.
      Added a helper class XML which contains both parsed and raw values.
      Makes things easier to read and modify.
      
      4. MDEV-5709: const_item() could incorrectly return a "true"
      result when XPath expression contains users/SP variable references.
      Now nodeset_func->const_item() is also taken into account to
      catch such cases.
      
      5. Minor code enhancements.
      92bd6801
    • Alexander Barkov's avatar
      MDEV-5870 Assertion `ltime->neg == 0' fails with COALESCE, ADDDATE, MAKEDATE · e0f75b1b
      Alexander Barkov authored
      A huge number in the "day" part of an interval made the code to return
      a negative date erroneously. Adding a test to return an error on a too
      large "day" value.
      e0f75b1b
  3. 22 Mar, 2014 1 commit
    • Igor Babaev's avatar
      Fixed bug mdev-5931. · 887a210f
      Igor Babaev authored
      After constant table row substitution the where condition may be converted
      to always true. The function calculate_cond_selectivity_for_table() should
      take into account this possibility.
      887a210f
  4. 21 Mar, 2014 4 commits
    • unknown's avatar
      MDEV-5914: Parallel replication deadlock due to InnoDB lock conflicts · b3529691
      unknown authored
      Due to how gap locks work, two transactions could group commit together on the
      master, but get lock conflicts and then deadlock due to different thread
      scheduling order on slave.
      
      For now, remove these deadlocks by running the parallel slave in READ
      COMMITTED mode. And let InnoDB/XtraDB allow statement-based binlogging for the
      parallel slave in READ COMMITTED.
      
      We are also investigating a different solution long-term, which is based on
      relaxing the gap locks only between the transactions running in parallel for
      one slave, but not against possibly external transactions.
      b3529691
    • unknown's avatar
      MDEV-5921: In parallel replication, an error is not correctly signalled to the next transaction · a5418c55
      unknown authored
      When a transaction fails in parallel replication, it should signal the error
      to any following transactions doing wait_for_prior_commit() on it. But the
      code for this was incorrect, and would not correctly remember a prior error
      when sending the signal. This caused corruption when slave stopped due to an
      error.
      
      Fix by remembering the error code when we first get an error, and passing the
      saved error code to wakeup_subsequent_commits().
      
      Thanks to nanyi607rao who reported this bug on
      maria-developers@lists.launchpad.net and analysed the root cause.
      a5418c55
    • Sergey Petrunya's avatar
      MDEV-5917: EITS: different order of predicates in IN (...) causes different estimates · e59dec03
      Sergey Petrunya authored
      - Forgot to update one .result file.
      e59dec03
    • Jan Lindström's avatar
      MDEV-5830: Assertion failure mutex_get_waiters(mutex) == 0 at shutdown. · affe1731
      Jan Lindström authored
      Analysis: XtraDB merge regression, at the end of mutex_spin_wait before goto mutex_loop
      there is missing  
      
      if (prio_mutex) { 
      	os_atomic_decrement_ulint(&prio_mutex->high_priority_waiters, 1); 
      }
      
      Hence we get unbalanced waiter count.
      
      Thanks to Laurynas Biveinis for finding this.
      affe1731
  5. 20 Mar, 2014 3 commits
  6. 19 Mar, 2014 10 commits
    • Michael Widenius's avatar
      Automatic merge · f71dc02e
      Michael Widenius authored
      f71dc02e
    • Michael Widenius's avatar
      Fix for MDEV-5589: "Discrepancy in binlog on half-failed CREATE OR REPLACE" · c4bb7cd6
      Michael Widenius authored
      Now if CREATE OR REPLACE fails but we have deleted a table already, we will generate a DROP TABLE in the binary log.
      This fixes this issue.
      
      In addition, for a failing CREATE OR REPLACE TABLE ... SELECT we don't generate a log of all the inserted rows, only the DROP TABLE.
      
      I added code for not logging DROP TEMPORARY TABLE for tables where the CREATE TABLE was not logged. This code will be activated in 10.1
      by removing the code protected by DONT_LOG_DROP_OF_TEMPORARY_TABLES.
      
      
      
      
      
      mysql-test/suite/rpl/r/create_or_replace_mix.result:
        More test cases
      mysql-test/suite/rpl/r/create_or_replace_row.result:
        More test cases
      mysql-test/suite/rpl/r/create_or_replace_statement.result:
        More test cases
      mysql-test/suite/rpl/t/create_or_replace.inc:
        More test cases
      sql/log.cc:
        Added binlog_reset_cache() to clear the binary log.
      sql/log.h:
        Added prototype
      sql/sql_insert.cc:
        If CREATE OR REPLACE TABLE ... SELECT fails:
        - Don't log anything if nothing changed
        - If table was deleted, log a DROP TABLE.
        Remember if we table creation of temporary tables was logged.
      sql/sql_table.cc:
        Added log_drop_table()
        Remember if we table creation of temporary tables was logged.
        If CREATE OR REPLACE TABLE ... SELECT fails and a table was deleted, log a DROP TABLE.
      sql/sql_table.h:
        Added prototype
      sql/sql_truncate.cc:
        Remember if we table creation of temporary tables was logged.
      sql/table.h:
        Added table_creation_was_logged
      c4bb7cd6
    • Igor Babaev's avatar
      Merge. · d51ee6d4
      Igor Babaev authored
      d51ee6d4
    • Jan Lindström's avatar
      Better to use ut_ad macro. · a60f227c
      Jan Lindström authored
      a60f227c
    • Sergey Petrunya's avatar
      MDEV-5901: EITS: killing the server leaves statistical tables in "marked as crashed" state · 6b0fa540
      Sergey Petrunya authored
      - Part#2: call HA_EXTRA_FLUSH for the correct handler object, and call it after every change
        (ha_write_row, ha_update_row, ha_delete_row).
      6b0fa540
    • Jan Lindström's avatar
    • Michael Widenius's avatar
      Automatic merge · d1655ba6
      Michael Widenius authored
      d1655ba6
    • Michael Widenius's avatar
      MDEV-5854 Interrupted CREATE OR REPLACE is written into binlog, and in a wrong format · 913d1f19
      Michael Widenius authored
      
      mysql-test/r/create_or_replace2.result:
        Added test case
      mysql-test/t/create_or_replace.test:
        Fixed comment
      mysql-test/t/create_or_replace2.test:
        Added test case
      sql/sql_base.cc:
        Safety fix:
        Don't let threads with query_id=0 free temporary tables as this may free temporary tables not in use.
        This is mostly the case for the slave io threads, as most other threads has thd->query_id != 0.
      sql/sql_table.cc:
        Added comment.
        Ignore kill when opening temporary table for CREATE ... LIKE.
        This fixed the original isue
      913d1f19
    • Sergey Petrunya's avatar
      Merge · 7ba9f064
      Sergey Petrunya authored
      7ba9f064
    • Sergey Petrunya's avatar
      MDEV-5901: EITS: killing the server leaves statistical tables in "marked as crashed" state · ebd4a820
      Sergey Petrunya authored
      - Do like sp.cc does with mysql.proc table: call HA_EXTRA_FLUSH after we've modified
        a statistical table.
      ebd4a820