1. 04 Jun, 2016 4 commits
    • Sergei Golubchik's avatar
      THD:: cleanup() must be where it used to · 725ce0fe
      Sergei Golubchik authored
      between net_end() and ha_close_connection()
      
      this fixes lockups in main.locked_temporary-5955 and some
      other innodb tests.
      725ce0fe
    • Sergei Golubchik's avatar
      reset @@TIMESTAMP for COM_CHANGE_USER · 69da361c
      Sergei Golubchik authored
      this also fixes tokudb.type_year failure
      (in ./mtr tokudb.type_timestamp tokudb.type_year)
      69da361c
    • Sergei Golubchik's avatar
      fix XID comparison · 4aacb20d
      Sergei Golubchik authored
      according to the standard, the gtrid/bqual pair must be
      "globally unique", so XIDs are equal if their gtrids and
      bquals are identical, formatID simply tells how
      gtrid/bqual were generated. But if formatID == -1
      (it means "null") gtrid/bqual don't have any value at all.
      
      This fixes main.xa_sync failure in
      ./mtr main.quary_cache_debug main.xa_sync
      4aacb20d
    • Monty's avatar
      Reuse THD for new user connections · 89685d55
      Monty authored
      - To ensure that mallocs are marked for the correct THD, even if it's
        allocated in another thread, I added the thread_id to the THD constructor
      - Added st_my_thread_var to thr_lock_info_init() to avoid a call to my_thread_var
      - Moved things from THD::THD() to THD::init()
      - Moved some things to THD::cleanup()
      - Added THD::free_connection() and THD::reset_for_reuse()
      - Added THD to CONNECT::create_thd()
      - Added THD::thread_dbug_id and st_my_thread_var->dbug_id. These are needed
        to ensure that we have a constant thread_id used for debugging with a THD,
        even if it changes thread_id (=connection_id)
      - Set variables.pseudo_thread_id in constructor. Removed not needed sets.
      89685d55
  2. 02 Jun, 2016 3 commits
  3. 01 Jun, 2016 9 commits
    • Vladislav Vaintroub's avatar
      MDEV-9154 : Remove workarounds (mainly dynamic function loading) · 3a7bc23a
      Vladislav Vaintroub authored
      for running obsolete versions of Windows
      3a7bc23a
    • Vladislav Vaintroub's avatar
    • Nirbhay Choubey's avatar
      MDEV-6368: assertion xid_seqno > trx_sys_cur_xid_seqno (postfix) · 23fed784
      Nirbhay Choubey authored
      - Fix build failure when built without wsrep (Win)
      - Update the expected warning in sys_vars.wsrep_start_position
      23fed784
    • Sergey Vojtovich's avatar
      Move wait_for_mdl_deadlock_detector() call to tc_remove_table() · d6d40112
      Sergey Vojtovich authored
      As a side effect tc_remove_all_unused_tables() has to call
      tc_wait_for_mdl_deadlock_detector() once per TABLE object now, while it called
      it only once before. This should be acceptable since actual wait will still be
      performed only once. It only adds redundant checks for all_tables_refs.
      d6d40112
    • Sergey Vojtovich's avatar
      Move table cache private functions out of header · 41dc2fc1
      Sergey Vojtovich authored
      This is mostly needed to hide all references to free_tables, so that further
      implementation of multi-instance list can be done completely inside
      table_cache.cc
      41dc2fc1
    • Sergey Vojtovich's avatar
      Move common code to a separate function · f7048e9a
      Sergey Vojtovich authored
      f7048e9a
    • Alexander Barkov's avatar
    • Alexander Barkov's avatar
      MDEV-10124 Incorrect usage of CUBE/ROLLUP and ORDER BY with GROUP_CONCAT(a ORDER BY a) · caee832d
      Alexander Barkov authored
      Allowing GROUP_CONCAT(... ORDER BY ..) in queries with ROLLUP.
      
      The story of the related code:
      
      1. The original patch from Wax
      commit: 0b505fb4
      date: Tue Mar 18 03:07:40 2003
      
      opt_gorder_clause reused the regular order_clause,
      which already had some protection against ROLLUP queries:
      
      order_clause:
              ORDER_SYM BY
              {
                LEX *lex=Lex;
                if (lex->current_select->linkage != GLOBAL_OPTIONS_TYPE &&
                    lex->current_select->select_lex()->olap !=
                    UNSPECIFIED_OLAP_TYPE)
                {
                  net_printf(lex->thd, ER_WRONG_USAGE,
                             "CUBE/ROLLUP",
                             "ORDER BY");
                  YYABORT;
                }
              } order_list;
      
      The assumption that ORDER BY in group_concat() had to have
      the same ROLLUP restriction (with order_clause) was wrong.
      
      Moreover, GROUP_CONCAT() in select_item_list was not affected
      by this restriction, because WITH ROLLUP goes after
      select_item_list and therefore sel->olap is always equal
      to UNSPECIFIED_OLAP_TYPE during select_item_list.
      
      GROUP BY was not affected for two reasons:
      - it goes before WITH ROLLUP and sel->olap is still
        UNSPECIFIED_OLAP_TYPE
      - Aggregate functions like AVG(), GROUP_CONCAT() in GROUP BY
        are not allowed
      
      So only GROUP_CONCAT() in HAVING and ORDER BY clauses
      were erroneously affected by this restriction.
      
      2. Bug#27848 rollup in union part causes error with order of union
      commit: 3f6073ae
      Author: unknown <igor@olga.mysql.com>  2007-12-15 01:42:46
      
      The condition in the ROLLUP protection code became more complex.
      Note, opt_gconcat_order still reused the regular order_clause.
      
      3. Bug#16347426 ASSERTION FAILED: (SELECT_INSERT &&
                       !TABLES->NEXT_NAME_RESOLUTION_TABLE) || !TAB
      commit: 2d836633
      author: Chaithra Gopalareddy <chaithra.gopalareddy@oracle.com>
      date: 2013-04-14 06:00:49
      
      opt_gorder_clause was refactored not to use order_clause and
      to collect information directly to select->gorder_list.
      The ROLLUP protection code was duplicated from order_clause
      to the new version of opt_gorder_clause.
      caee832d
    • Nirbhay Choubey's avatar
      MDEV-6368: assertion xid_seqno > trx_sys_cur_xid_seqno · de7eafc7
      Nirbhay Choubey authored
      - Validate the specified wsrep_start_position value by also
      checking the return status of wsrep->sst_received. This also
      ensures that changes in wsrep_start_position is not allowed
      when the node is not in JOINING state.
      - Do not allow decrease in seqno within same UUID.
      - The initial checkpoint in SEs should be [0...:-1].
      de7eafc7
  4. 29 May, 2016 2 commits
  5. 28 May, 2016 1 commit
  6. 25 May, 2016 3 commits
  7. 24 May, 2016 3 commits
  8. 23 May, 2016 2 commits
  9. 21 May, 2016 1 commit
  10. 20 May, 2016 4 commits
    • Alexander Barkov's avatar
      sql_yacc.yy: Removing unnecessary init_nested_join() and end_nested_join() · 349da1d6
      Alexander Barkov authored
      from select_derived_init.
      349da1d6
    • Alexander Barkov's avatar
      A derived_query_specification clean-up · c44b2e66
      Alexander Barkov authored
      (to simplify further MDEV-8909 changes)
      
      1. Better semantic readability:
      - Moving get_select_lex_derived inside select_derived_init
        and decomposing it into get_select_lex and
        $1->init_nested_join(lex->thd)
      -  Moving DBUG_ASSERT($1 == Lex->current_select) inside
         select_derived_init
      
      Now init_nested_join() and end_nested_join() reside inside
      the same rule select_derived_init.
      (It's very likely that they can be further removed,
       as there are no any joins in this rule).
      
      3. Better grammar readability:
        Moving SELECT_SYM from select_derived_init to derived_query_specification.
        It's easier to read a rule when it starts from a terminal symbol.
      c44b2e66
    • Oleksandr Byelkin's avatar
    • Alexander Barkov's avatar
      MDEV-10080 Derived tables allow double LIMIT clause · f6a7c1c7
      Alexander Barkov authored
      1. Moving the "| get_select_lex_derived select_derived_init" part of
      select_derived into a separate new rule derived_query_specification.
      2. Using derived_query_specification directly in select_derived_union
      rather than in select_derived.
      3. Moving the sequence "opt_order_clause opt_limit_clause opt_select_lock_type"
      from select_derived2 to select_derived_union,
      after derived_query_specification.
      
      Effectively, the parser now does not go through the sequence
      "opt_order_clause opt_limit_clause ... opt_union_order_or_limit" any more.
      
      This fixes the problem with double LIMIT clause and removes 2 shift/reduce
      conflicts.
      f6a7c1c7
  11. 19 May, 2016 1 commit
    • Alexander Barkov's avatar
      This patch is a cleanup simplifying upcoming · c9629daa
      Alexander Barkov authored
      "MDEV-8909 union parser cleanup" changes.
      
      When the server parses a query like
        SELECT * FROM (SELECT 1);
      a sequence of calls
        st_select_lex::init_nested_join() ..
        st_select_lex::end_nested_join()
      was performed two times (tested in gdb).
      Both pairs of calls seem to be redundant for a query
      like this, because there are actually no any joins here.
      
      This patch moved "table_ref_select" inside "select_derived",
      which revealed that one the pairs was definitely redundant:
      After this transformation we got an init_nested_join()
      immediately followed by end_nested_join() for the same st_select_lex,
      which has no any sense. So this pair of calls was removed.
      c9629daa
  12. 17 May, 2016 7 commits