An error occurred fetching the project authors.
  1. 14 Nov, 2022 1 commit
  2. 23 Sep, 2022 1 commit
    • Lena Startseva's avatar
      MDEV-27691: make working view-protocol · 72ba96a4
      Lena Startseva authored
      Tests with checking metadata or that cannot be run with
      the view-protocol are excluded from --view-protocol.
      For tests that do not allow the use of an additional connection,
      the util connection is disabled with "--disable_service_connection".
      Also cases with bugs for --view-protocol are disabled.
      72ba96a4
  3. 26 Jul, 2022 2 commits
    • Oleg Smirnov's avatar
      MDEV-28881 Server crash in Dep_analysis_context::create_table_value · c03d50fc
      Oleg Smirnov authored
      SELECT_LEX::first_select()->join is NULL for degenerate derived tables
      which are known to have just one row and so were already materialized
      by the optimizer.
      This commit adds a check for this.
      c03d50fc
    • Oleg Smirnov's avatar
      MDEV-26278 Add functionality to eliminate derived tables from the query · 7f0201a2
      Oleg Smirnov authored
      Elimination of unnecessary tables from SQL queries is already present
      in MariaDB. But it only works for regular tables and not for derived ones.
      
      Imagine we have a view:
        CREATE VIEW v1 AS SELECT a, b, max(c) AS maxc FROM t1 GROUP BY a, b
      
      Due to "GROUP BY a, b" the values of combinations {a, b} are unique,
      and this fact can be treated as like derived table "v1" has a unique key
      on fields {a, b}.
      
      Suppose we have a SQL query:
        SELECT t2.* FROM t2 LEFT JOIN v1 ON t2.a=v1.a and t2.b=v1.b
      
      1. Since {v1.a, v1.b} is unique and both these fields are bound to t2,
         "v1" is functionally dependent on t2.
         This means every record of "t2" will be either joined with
         a single record of "v1" or NULL-complemented.
      2. No fields of "v1" are present on the SELECT list
      
      These two facts allow the server to completely exclude (eliminate)
      the derived table "v1" from the query.
      7f0201a2
  4. 29 Mar, 2018 1 commit
  5. 27 Feb, 2017 1 commit
    • Igor Babaev's avatar
      Fixed bug mdev-12099. · 5a0fff50
      Igor Babaev authored
      The function mysql_derived_merge() erroneously did not mark newly formed
      AND formulas in ON conditions with the flag abort_on_null. As a result
      not_null_tables() calculated incorrectly for these conditions. This
      could prevent conversion of embedded outer joins into inner joins.
      
      Changed a test case from table_elim.test to preserve the former execution
      plan.
      5a0fff50
  6. 04 Sep, 2015 1 commit
  7. 23 Apr, 2015 1 commit
  8. 27 Nov, 2013 1 commit
  9. 22 Aug, 2013 1 commit
    • Sergey Petrunya's avatar
      MDEV-4840: Wrong result (missing rows) on LEFT JOIN with InnoDB tables · 37e9714c
      Sergey Petrunya authored
      Fix two problems in table elimination code:
      - Before marking a "value" as bound, check if it is already bound. Marking the 
        same value as bound twice could confuse a module that depends on this value, 
        because Dep_module_XXX use counters to know when they become bound.
      
      - When checking whether field is part of a key, ignore "extended keys" property.
      37e9714c
  10. 12 May, 2012 1 commit
  11. 20 Feb, 2012 1 commit
  12. 15 Dec, 2011 1 commit
  13. 01 Nov, 2011 1 commit
    • Sergey Petrunya's avatar
      BUG#884184: Wrong result with RIGHT JOIN + derived_merge · f2b6f4e3
      Sergey Petrunya authored
      - Make eliminate_tables_for_list() take into account that it is not possible
        to eliminate a table if it is used in the upper-side ON expressions. Example:
      
          xxx JOIN (t1 LEFT JOIN t2 ON cond ) ON func(t2.columns)
      
        Here it would eliminate t2 which is not possible because of use of t2.columns.
      f2b6f4e3
  14. 01 Oct, 2011 1 commit
  15. 11 Jan, 2011 1 commit
  16. 06 Mar, 2010 1 commit
    • Sergey Petrunya's avatar
      LPBUG#524025 Running RQG outer_join test leads to crash · 81424b5b
      Sergey Petrunya authored
      Save no-records constant tables in JOIN::const_table_map before we invoke
      eliminate_tables(). Failure to do so caused crash when the same table was
      marked as constant two times
      
      mysql-test/r/table_elim.result:
        LPBUG#524025 Running RQG outer_join test leads to crash
        - Testcase
      mysql-test/t/table_elim.test:
        LPBUG#524025 Running RQG outer_join test leads to crash
        - Testcase
      sql/sql_select.cc:
        LPBUG#524025 Running RQG outer_join test leads to crash
        Save no-records constant tables in JOIN::const_table_map before we invoke eliminate_tables(). Failure to do so caused crash when the same table was marked as constant two times.
      81424b5b
  17. 18 Feb, 2010 1 commit
    • Sergey Petrunya's avatar
      LPBUG#523593: Running RQG optimizer_no_subquery crashes MariaDB · 69028d51
      Sergey Petrunya authored
      - When analying multiple equalities, take into account that they 
        may not have a single table field that belongs to one of the tables
        that we're trying to eliminate (and they are not useful for table
        elimination in that case)
      
      mysql-test/r/table_elim.result:
        LPBUG#523593: Running RQG optimizer_no_subquery crashes MariaDB
        - Testcase
      mysql-test/t/table_elim.test:
        LPBUG#523593: Running RQG optimizer_no_subquery crashes MariaDB
        - Testcase
      69028d51
  18. 16 Sep, 2009 1 commit
    • Sergey Petrunya's avatar
      MWL#17: Table elimination: fixes for windows · 2f93e7cd
      Sergey Petrunya authored
      include/my_global.h:
        MWL#17: Table elimination: fixes for windows
        - Add ALIGN_MAX_UNIT (assume malloc returns data aligned to this much)
      mysql-test/r/table_elim.result:
        MWL#17: Table elimination: fixes for windows
        - Use only lower-case as EXPLAIN [EXTENDED] changes case of table names
          on windows
      mysql-test/t/table_elim.test:
        MWL#17: Table elimination: fixes for windows
        - Use only lower-case as EXPLAIN [EXTENDED] changes case of table names
          on windows
      sql/opt_table_elimination.cc:
        MWL#17: Table elimination: fixes for windows
        - Add extra alignment-padding-space for stack-allocated buffers.
      2f93e7cd
  19. 26 Aug, 2009 1 commit
    • Sergey Petrunya's avatar
      MWL#17: Table elimination: · 005c24e9
      Sergey Petrunya authored
      - Fix a trivial problem when OR-merging two multi-equalities
      - Amend testsuite to provide full gcov coverage
      
      mysql-test/r/table_elim.result:
        MWL#17: Table elimination:
        - Amend testsuite to provide full gcov coverage
      mysql-test/t/table_elim.test:
        MWL#17: Table elimination:
        - Amend testsuite to provide full gcov coverage
      005c24e9
  20. 25 Aug, 2009 2 commits
    • Sergey Petrunya's avatar
      MWL#17: Table elimination · de41681a
      Sergey Petrunya authored
      - More test coverage
      - Remove unused code
      
      de41681a
    • Sergey Petrunya's avatar
      MWL#17: Table elimination · 9400700b
      Sergey Petrunya authored
      - Add more testcases.
      - Fix trivial compile failure
      - Remove handling of "column IN (one_element)". This is converted to equality 
        elsewhere
      
      mysql-test/r/table_elim.result:
        MWL#17: Table elimination
        - Add more testcases.
        - Fix trivial compile failure
      mysql-test/t/table_elim.test:
        MWL#17: Table elimination
        - Add more testcases
      sql/mysqld.cc:
        MWL#17: Table elimination
        - Fix trivial compile failure
      sql/opt_table_elimination.cc:
        MWL#17: Table elimination
        - Add more testcases.
        - Remove handling of "column IN (one_element)".This is converted to equality 
          elsewhere
      9400700b
  21. 24 Aug, 2009 1 commit
    • Sergey Petrunya's avatar
      MWL#17: Table elimination · 21d25739
      Sergey Petrunya authored
      - Correctly handle the case where we have multi-table DELETE and a table
        that we're deleting from looks like it could be eliminated.
      
      21d25739
  22. 21 Aug, 2009 1 commit
    • Sergey Petrunya's avatar
      MWL#17: Table elimination · 9c133680
      Sergey Petrunya authored
      - More testcases
      - Set correct dependencies for non-bound multi-equalities.
      
      mysql-test/r/table_elim.result:
        MWL#17: Table elimination
        - More testcases
      mysql-test/t/table_elim.test:
        MWL#17: Table elimination
        - More testcases
      sql/opt_table_elimination.cc:
        MWL#17: Table elimination
        - Set correct dependencies for non-bound multi-equalities.
      9c133680
  23. 17 Aug, 2009 2 commits
  24. 29 Jun, 2009 1 commit
    • Sergey Petrunya's avatar
      MWL#17: Table elimination · 9fa1bce4
      Sergey Petrunya authored
      mysql-test/r/table_elim.result:
        MWL#17: Table elimination
        - More tests
      mysql-test/t/table_elim.test:
        MWL#17: Table elimination
        - More tests
      sql/opt_table_elimination.cc:
        MWL#17: Table elimination
        - Code cleanup
      sql/sql_select.cc:
        MWL#17: Table elimination
        - Code cleanup
      sql/sql_select.h:
        MWL#17: Table elimination
        - Code cleanup
      sql/table.h:
        MWL#17: Table elimination
        - Code cleanup
      9fa1bce4
  25. 23 Jun, 2009 1 commit
    • Sergey Petrunia's avatar
      MWL#17: Table elimination · c4922cbf
      Sergey Petrunia authored
      - More testcases
      - Let add_ft_key() set keyuse->usable
      
      mysql-test/r/table_elim.result:
        MWL#17: Table elimination
        - More testcases
      mysql-test/t/table_elim.test:
        MWL#17: Table elimination
        - More testcases
      sql/sql_select.cc:
        MWL#17: Table elimination
        - Let add_ft_key() set keyuse->usable
      c4922cbf
  26. 14 Jun, 2009 1 commit
  27. 09 Jun, 2009 1 commit
    • Sergey Petrunia's avatar
      MWL#17: Table elimination · fd485ad9
      Sergey Petrunia authored
      - Make elimination work with aggregate functions. The problem was that aggregate functions 
        reported all table bits in used_tables(), and that prevented table elimination. Fixed by 
        making aggregate functions return more correct value from used_tables(). 
      
      mysql-test/r/ps_11bugs.result:
        MWL#17: Table elimination
        - Update test results. The difference is because of Item_ref change: outer references to constants
          are now recognized as constants, too.
      mysql-test/r/subselect.result:
        - Update test results. The difference is because of Item_ref change: outer references to constants
          are now recognized as constants, too.
      mysql-test/r/table_elim.result:
        MWL#17: Table elimination
        - Check that elimination works in presense of aggreagate functions
      mysql-test/t/table_elim.test:
        MWL#17: Table elimination
        - Check that elimination works in presense of aggreagate functions
      sql/item.h:
        MWL#17: Table elimination
        - Add Item_ref::const_item() which calls (*ref)->const_item(). Before this diff Item_ref used the 
          default implementation of const_item(){ return used_tables()==0; }. This is no longer true, as 
          COUNT(*) now has used_tables()==0 but const_item()==FALSE.
      sql/item_sum.cc:
        MWL#17: Table elimination
        - Make Item_sum() and it descendants not to return all bits in used_tables(). This is needed 
          because otherwise table elimination can't work in presense of aggregate functions
        - COUNT(*) now has used_tables()==0 and const_item()==FALSE. Had to change 
          Item_ref::const_item() to account for this.
      sql/item_sum.h:
        MWL#17: Table elimination
        - Add comments
      fd485ad9
  28. 03 Jun, 2009 1 commit
    • Sergey Petrunia's avatar
      MWL#17: Table elimination · 275a4b35
      Sergey Petrunia authored
      - First code. Elimination works for simple cases, passes the testsuite.
      - Known issues:
        = No elimination is done for aggregate functions.
        = EXPLAIN EXTENDED shows eliminated tables (I think it better not)
        = No benchmark yet
        = The code needs some polishing.
      
      mysql-test/r/table_elim.result:
        MWL#17: Table elimination
        - Testcases
      mysql-test/t/table_elim.test:
        MWL#17: Table elimination
        - Testcases
      sql/sql_select.cc:
        MWL#17: Table elimination
      sql/sql_select.h:
        MWL#17: Table elimination
        - Added JOIN_TAB::eliminated (is JOIN_TAB the best place to store this flag?)
      sql/table.h:
        MWL#17: Table elimination
        - ADded NESTED_JOIN::n_tables. We need to have the number of real tables remaining in an outer join nest.
      275a4b35