1. 04 Mar, 2013 2 commits
  2. 02 Mar, 2013 2 commits
    • Igor Babaev's avatar
      Merge · fe6c8d42
      Igor Babaev authored
      fe6c8d42
    • Igor Babaev's avatar
      Fixed bug mdev-4220. · bd305d6b
      Igor Babaev authored
      This bug is a regression bug. The regression was introduced by
      the patch for mdev-3851, that tried to weaken the condition when
      a ref access with an extended key can be converted to an eq_ref
      access. The patch incorrectly formed this condition. As a result,
      while improving performance for some queries, the patch caused 
      worse performance for another queries.
      bd305d6b
  3. 01 Mar, 2013 8 commits
    • Vladislav Vaintroub's avatar
      MDEV-4216 : export additional functions ... · 6c4f41ff
      Vladislav Vaintroub authored
      MDEV-4216 : export additional functions  mysql_get_timeout_value(),mysql_get_timeout_value_ms(),  mysql_get_socket() from shared client library. They are documented as part of async API.
      
      Also, remove  functions mysql_close_slow_part_start() and mysql_close_slow_part_cont() from exports - they are not documented anywhere.
      6c4f41ff
    • Daniel Bartholomew's avatar
      Removed the obsolete instructions from the MySQL 5.1 manual. Instead provide a... · 7f47237f
      Daniel Bartholomew authored
      Removed the obsolete instructions from the MySQL 5.1 manual. Instead provide a link to https://kb.askmonty.org/en/compiling-mariadb-from-source/
      
      7f47237f
    • Michael Widenius's avatar
      Automatic merge · 4cace76d
      Michael Widenius authored
      4cace76d
    • Michael Widenius's avatar
      Fixed bug MPDEV-628 / LP:989055 - Querying myisam table metadata may corrupt the table. · 8ed283d8
      Michael Widenius authored
      The issue was that there was that SHOW commands could open the table in the store engine, even in cases
      where it should not be allowed to do that (ie, the storage engines meta data for that table was under big changes).
      
      The cases where this should not be allowed are:
      - ALTER TABLE DISABLE KEYS
      - ALTER TABLE ENABLE KEYS
      - REPAIR TABLE
      - OPTIMIZE TABLE
      - DROP TABLE
      
      This patch adds a new mode, protected_against_usage(). If this is used then the SHOW command will wait until the table
      is accessable. This is implemented by re-using the already exising 'version' flag for TABLE_SHARE.
      It also added functions to be used to change TABLE_SHARE->version instead of changing it directly.
      	
      
      
      mysql-test/r/myisam-metadata.result:
        Added test case
      mysql-test/t/myisam-metadata.test:
        Added test case
      sql/mysqld.cc:
        Start from refresh_version 2 as 0 and 1 are reserved.
      sql/sql_admin.cc:
        Added MYSQL_OPEN_FOR_REPAIR
        Updated call to wait_while_table_is_used()
      sql/sql_base.cc:
        Updated call to wait_while_table_is_used()
        - Allow one to specify how the table should be removed (for all commands except show or for all commands).
        - Don't allow one to reopen the table if one has called share->protect_against_usage()
      sql/sql_base.h:
        Added TDC_RT_REMOVE_NOT_OWN_AND_MARK_NOT_USABLE, which is used to mark that no one can reopen this table, except with MYSQL_OPEN_FOR_REPAIR .
        - Added MYSQL_OPEN_FOR_REPAIR
        - Updated prototype for wait_while_table_is_used()
      sql/sql_table.cc:
        Updated call to wait_while_table_is_used()
        Use MYSQL_OPEN_FOR_REPAIR for open tables that where repaired.
      sql/sql_truncate.cc:
        Updated call to wait_while_table_is_used()
      sql/table.cc:
        Use set_refresh_version()
      sql/table.h:
        Added functions to be used to change TABLE_SHARE->version instead of changing it directly
      8ed283d8
    • unknown's avatar
    • Sergey Petrunya's avatar
      Merge 5.3->5.5 · 1a998ee2
      Sergey Petrunya authored
      1a998ee2
    • Sergey Petrunya's avatar
      4ad2fd7c
    • Igor Babaev's avatar
      Merge · 8fb2919e
      Igor Babaev authored
      8fb2919e
  4. 28 Feb, 2013 14 commits
  5. 27 Feb, 2013 1 commit
  6. 26 Feb, 2013 1 commit
  7. 25 Feb, 2013 1 commit
    • Igor Babaev's avatar
      Fixed bug mdev-4177 · d434d79a
      Igor Babaev authored
      The function remove_eq_cond removes the parts of a disjunction
      for which it has been proved that they are always true. In the
      result of this removal the disjunction may be converted into a 
      formula without OR that must be merged into the the AND formula
      that contains the disjunction.
      The merging of two AND conditions must take into account the
      multiple equalities that may be part of each of them.
      These multiple equality must be merged and become part of the
      and object built as the result of the merge of the AND conditions.
      Erroneously the function remove_eq_cond lacked the code that 
      would merge multiple equalities of the merged AND conditions.
      This could lead to confusing situations when at the same AND 
      level there were two multiple equalities with common members
      and the list of equal items contained only some of these 
      multiple equalities.
      This, in its turn, could lead to an incorrect work of the
      function substitute_for_best_equal_field when it tried to optimize
      ref accesses. This resulted in forming invalid TABLE_REF objects
      that were used to build look-up keys when materialized subqueries
      were exploited.
         
      d434d79a
  8. 24 Feb, 2013 1 commit
  9. 22 Feb, 2013 1 commit
    • Igor Babaev's avatar
      Fixed bug mdev-4172. · ed7671d5
      Igor Babaev authored
      This bug in the legacy code could manifest itself in queries with
      semi-join materialized subqueries.
      When a subquery is materialized all conditions that are imposed
      only on the columns belonging to the tables from the subquery 
      are taken into account.The code responsible for subquery optimizations
      that employes subquery materialization  makes sure to remove these
      conditions from the WHERE conditions of the query obtained after
      it has transformed the original query into a query with a semi-join.
      If the condition to be removed is an equality condition it could
      be added to ON expressions and/or conditions from disjunctive branches
      (parts of OR conditions) in an attempt to generate better access keys
      to the tables of the query. Such equalities are supposed to be removed
      later from all the formulas where they have been added to.
      However, erroneously, this was not done in some cases when an ON
      expression and/or a disjunctive part of the OR condition could
      be converted into one multiple equality. As a result some equality
      predicates over columns belonging to the tables of the materialized
      subquery remained in the ON condition and/or the a disjunctive 
      part of the OR condition, and the excuter later, when trying to
      evaluate them, returned wrong answers as the values of the fields
      from these equalities were not valid.  
      This happened because any standalone multiple equality (a multiple
      equality that are not ANDed with any other predicates) lacked
      the information about equality predicates inherited from upper
      levels (in particular, inherited from the WHERE condition).
      The fix adds a reference to such information to any standalone
      multiple equality. 
      ed7671d5
  10. 21 Feb, 2013 5 commits
    • Vladislav Vaintroub's avatar
    • Vladislav Vaintroub's avatar
      142c0a04
    • Vladislav Vaintroub's avatar
      MDEV-4021 : Enable Ctrl-C handler when reading password, on Windows. · c6d31b27
      Vladislav Vaintroub authored
      Prior to this patch, _getch() was used to read password input from console. getch() has a property that it reads Ctrl-C as character with ASCII code 0x03, and disregards Ctrl-C handler for  current process. 
      The fix is to use ReadConsole() API instead of getch() , after setting console mode to ENABLE_PROCESSED_INPUT - this mode allows current process to handle Ctrl-C events.
      c6d31b27
    • Igor Babaev's avatar
      Merge. · 6537b551
      Igor Babaev authored
      6537b551
    • Igor Babaev's avatar
      Fixed bug mdev-3913. · c9b63e6a
      Igor Babaev authored
      The wrong result set returned by the left join query  from
      the bug test case happened due to several inconsistencies 
      and bugs of the legacy mysql code.
      
      The bug test case uses an execution plan that employs a scan
      of a materialized IN subquery from the WHERE condition.
      When materializing such an IN- subquery the optimizer injects
      additional equalities  into the WHERE clause. These equalities
      express the constraints imposed by the subquery predicate.
      The injected equality of the query in the  test case happens
      to belong to the same equality class, and a new equality 
      imposing a condition on the rows of the materialized subquery
      is inferred from this class. Simultaneously the multiple
      equality is added to the ON expression of the LEFT JOIN
      used in the main query.
        
      The inferred equality of the form f1=f2 is taken into account
      when optimizing the scan of  the rows the temporary table 
      that is the result of the subquery materialization: only the 
      values of the field f1 are read from the table into the record 
      buffer. Meanwhile the inferred equality is removed from the
      WHERE conditions altogether as a constraint on the fields
      of the temporary table that has been used when filling this table. 
      This equality is supposed to be removed from the ON expression
      when the multiple equalities of the ON expression are converted
      into an optimal set of equality predicates. It supposed to be
      removed from the ON expression as an equality inferred from only
      equalities of the WHERE condition. Yet, it did not happened
      due to the following bug in the code.
      
      Erroneously the code tried to build multiple equality for ON
      expression twice: the first time, when it called optimize_cond()
      for the WHERE condition, the second time, when it called
      this function for the HAVING condition. When executing
      optimize_con() for the WHERE condition  a reference
      to the multiple equality of the WHERE condition is set
      in the multiple equality of the  ON expression. This reference
      would allow later to convert multiple equalities of the
      ON expression into equality predicates. However the 
      the second call of build_equal_items() for the ON expression
      that happened when optimize_cond() was called for the
      HAVING condition reset this reference to NULL.
      
      This bug fix blocks calling build_equal_items() for ON
      expressions for the second time. In general, it will be
      beneficial for many queries as it removes from ON 
      expressions any equalities that are to be checked for the
      WHERE condition.
      The patch also fixes two bugs in the list manipulation
      operations and a bug in the function  
      substitute_for_best_equal_field() that resulted
      in passing wrong reference to the multiple equalities
      of where conditions when processing multiple
      equalities  of ON expressions.
      
      The code of substitute_for_best_equal_field() and
      the code the helper function eliminate_item_equal()
      were also streamlined and cleaned up.
      Now the conversion of the multiple equalities into
      an optimal set of equality predicates first produces
      the sequence of the all equalities processing multiple
      equalities one by one, and, only after this, it inserts
      the equalities at the beginning of the other conditions.
      
      The multiple changes in the output of EXPLAIN
      EXTENDED are mainly the result of this streamlining,
      but in some cases is the result of the removal of
      unneeded equalities from ON expressions. In
      some test cases this removal were reflected in the
      output of EXPLAIN resulted in disappearance of 
      “Using where” in some rows of the execution plans.
      c9b63e6a
  11. 20 Feb, 2013 2 commits
  12. 19 Feb, 2013 1 commit
  13. 18 Feb, 2013 1 commit