1. 05 Oct, 2015 17 commits
    • Sergei Golubchik's avatar
      remove unused group_by_handler::init() method · 3abfe76e
      Sergei Golubchik authored
      The assumption is that the engine should not need to
      evaluate HAVING on the table->record[0] - the engine either
      can evaluate HAVING internally before writing it to the
      table->record[0], or it should leave it to the server,
      that will evaluate HAVING(table->record[0]).
      
      Similarly the engine should not need to evaluate ORDER
      on the table->record[0]. Either it returns the data already
      sorted, or the server will sort the table.
      3abfe76e
    • Sergei Golubchik's avatar
      Don't use flags in the group_by_handler class · 21175bb3
      Sergei Golubchik authored
      instead pass the whole query down and let the engine return
      unsupported parts back
      21175bb3
    • Sergei Golubchik's avatar
      bug: move one_storage_engine checking loop · 8dff1aa5
      Sergei Golubchik authored
      down to the point where all tables are already known
      (and subqueries converted to joins, if needed)
      8dff1aa5
    • Sergei Golubchik's avatar
      cleanups and simplifications · c93ac0a1
      Sergei Golubchik authored
      c93ac0a1
    • Sergei Golubchik's avatar
      move internal API out from group_by_handler · 7ca8b4bb
      Sergei Golubchik authored
      into a Pushdown_query object
      7ca8b4bb
    • Sergei Golubchik's avatar
      remove unused method · 9ca3d9ea
      Sergei Golubchik authored
      9ca3d9ea
    • Sergei Golubchik's avatar
      e8daa418
    • Monty's avatar
      MDEV-6080: Allowing storage engine to shortcut group by queries · cf50e13f
      Monty authored
      This task is to allow storage engines that can execute GROUP BY or
      summary queries efficiently to intercept a full query or sub query from
      MariaDB and deliver the result either to the client or to a temporary
      table for further processing.
      
      - Added code in sql_select.cc to intercept GROUP BY queries.
        Creation of group_by_handler is done after all optimizations to allow
        storage engine to benefit of an optimized WHERE clause and suggested
        indexes to use.
      - Added group by handler to sequence engine and a group_by test suite as
        a way to test the new interface.
      - Intercept EXPLAIN with a message "Storage engine handles GROUP BY"
      
      libmysqld/CMakeLists.txt:
        Added new group_by_handler files
      sql/CMakeLists.txt:
        Added new group_by_handler files
      sql/group_by_handler.cc:
        Implementation of group_by_handler functions
      sql/group_by_handler.h:
        Definition of group_by_handler class
      sql/handler.h:
        Added handlerton function to create a group_by_handler, if the storage
        engine can intercept the query.
      sql/item_cmpfunc.cc:
        Allow one to evaluate item_equal any time.
      sql/sql_select.cc:
        Added code to intercept GROUP BY queries
        - If all tables are from the same storage engine and the query is
          using sum functions, call create_group_by() to check if the storage
          engine can intercept the query.
          - If yes:
             - create a temporary table to hold a GROUP_BY row or result
             - In do_select() intercept normal query execution by instead
               calling the group_by_handler to get the result
             - Intercept EXPLAIN
      sql/sql_select.h:
        Added handling of group_by_handler
        Added caching of the original join tab (needed for cleanup after
        group_by handler)
      storage/sequence/mysql-test/sequence/group_by.result:
        Test group_by_handler interface
      storage/sequence/mysql-test/sequence/group_by.test:
        Test group_by_handler interface
      storage/sequence/sequence.cc:
        Added simple group_by_engine for handling COUNT(*) and
        SUM(primary_key).  This was done as a test of the group_by_handler
        interface
      cf50e13f
    • Monty's avatar
      Bugs, found by valgrind · d8df2b94
      Monty authored
      d8df2b94
    • Monty's avatar
      fix comments · ae2cdc17
      Monty authored
      ae2cdc17
    • Monty's avatar
    • Monty's avatar
      Simple optimization · 4193fa7a
      Monty authored
      4193fa7a
    • Monty's avatar
      Speed up some innodb tests · 7e312796
      Monty authored
      Fixed compiler warnings
      
      sql/sql_view.cc:
      Ensure that merged_for_insert is properly reset
      (Left of an old patch)
      7e312796
    • Monty's avatar
      Don't write DROP TEMPORARY TABLE to binary log · b2b07b33
      Monty authored
      if we didn't write the CREATE TEMPORARY TABLE statement.
      
      - Enable old code from one of my older changesets that didn't make into 10.0
      - Fix test cased that failed as they expected DROP TEMPORARY TABLE in the log.
      b2b07b33
    • Sergei Petrunia's avatar
      MDEV-8830: Weird output in the error log · d2f6166e
      Sergei Petrunia authored
      Remove debug printout that was accidentally left in place
      d2f6166e
    • Alexander Barkov's avatar
      23d4c95b
    • Jan Lindström's avatar
  2. 04 Oct, 2015 1 commit
    • Alexander Barkov's avatar
      A clean-up for MDEV-7950: · ba0b6685
      Alexander Barkov authored
      - Turning get_mm_tree_for_const() from a static function into
        a protected method in Item.
      - Adding a new class Item_bool_func2_with_rev, for the functions and operators
        that have a reverse function and can use the range optimizer for
        to optimize "value OP field" as "field REV_OP value". Deriving
        Item_bool_rowready_func2 and Item_funt_spatial_rel from the new class.
      - Removing Item_bool_func2::have_rev_func().
      ba0b6685
  3. 02 Oct, 2015 5 commits
  4. 01 Oct, 2015 5 commits
  5. 30 Sep, 2015 3 commits
  6. 29 Sep, 2015 1 commit
  7. 28 Sep, 2015 4 commits
  8. 27 Sep, 2015 1 commit
  9. 25 Sep, 2015 3 commits
    • Nirbhay Choubey's avatar
      MDEV-8208: Sporadic SEGFAULT on startup · 6927459e
      Nirbhay Choubey authored
      Addendum:
      * Before calling THD::init_for_queries(), flip the current_thd to wsrep
      thread so that memory gets allocated for the right THD.
      * Use wsrep_creating_startup_threads instead of plugins_are_initialized
      as the condition for the execution of THD::init_for_queries() within
      start_wsrep_THD(), as use of latter could still leave some room for
      race.
      6927459e
    • Nirbhay Choubey's avatar
      MDEV-8208: Sporadic SEGFAULT on startup · 59037d96
      Nirbhay Choubey authored
      Problem:
      When mysqld starts as a galera node, it creates 2 system threads
      (applier & rollbacker) using start_wsrep_THD(). These threads are
      created before plugin initialization (plugin_init()) for SST methods
      like rsync and xtrabackup.
      
      The threads' initialization itself can proceed in parallel to mysqld's
      main thread of execution. As a result, the thread initialization code
      (start_wsrep_THD()) can end up accessing some un/partially initialized
      structures (like maria_hton, in this particular case) resulting in
      segfault.
      
      Solution:
      Fixed by calling THD::init_for_queries() (which accesses maria_hton)
      only after the plugins have been initialized.
      59037d96
    • Alexander Barkov's avatar