summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Fixed a problem with unreferenced CTE:Igor Babaev2016-08-053-4/+89
| | | | | | | | explain for the query containing WITH clause with an unreferenced CTE caused a crash. Added a test covered this case. Also added a test for usage CTE in different parts of union.
* Fixed bug mdev-10344.Igor Babaev2016-07-293-1/+42
| | | | | | The patch for bug mdev-9937 actually did not fix the problem of name resolution for tables used in views referred in queries with WITH clauses. This fix corrects the patch.
* Fixed the following problem:Igor Babaev2016-07-2611-55/+184
| | | | | | | | Temporary tables created for recursive CTE were instantiated at the prepare phase. As a result these temporary tables missed indexes for look-ups and optimizer could not use them.
* Added a proper check for acceptable mutually recursive CTE.Igor Babaev2016-06-305-36/+77
|
* Adjusted test results.Igor Babaev2016-06-293-4/+32
|
* Simplified the code that fills recursive tables.Igor Babaev2016-06-257-205/+135
|
* A commit to force buildbot working.Igor Babaev2016-06-071-0/+1
|
* The method With_element::reset_for_exec was not called in non-debugIgor Babaev2016-06-072-2/+30
| | | | builds.
* Fixed numerous problems for mutually recursive CTE.Igor Babaev2016-06-068-32/+653
| | | | | | | Actually mutually recursive CTE were not functional. Now the code for mutually recursive CTE looks like functional, but still needs re-writing. Added many new test cases for mutually recursive CTE.
* Merge branch '10.2' into 10.2-mdev986410.2-test1234Galina Shalygina2016-05-25112-2193/+2344
|\
| * Merge branch '10.2' of github.com:MariaDB/server into 10.2Galina Shalygina2016-05-25112-2193/+2344
| |\
| | * An sql_yacc.yy clean-upAlexander Barkov2016-05-241-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Moving opt_union_order_or_limit inside union_opt, as it's not used in other places any more. - Changing union_opt to have no type. Earlier (before all MDEV-8909 dependency tasks) it had the <num> type, and it's return value was used to generate errors. Now union_opt does not need a return value because the grammar disallows ORDER and LIMIT clauses in wrong context.
| | * MDEV-10109 Disallow syntactically INSERT .. SELECT .. {ORDER BY ..| LIMIT ↵Alexander Barkov2016-05-245-27/+57
| | | | | | | | | | | | ..} .. UNION ..
| | * MDEV-10103 Disallow syntactically UNION SELECT .. PROCEDURE ANALYSE()Alexander Barkov2016-05-245-18/+62
| | |
| | * MDEV-10102 Disallow CREATE VIEW .. PROCEDURE ANALYSE() syntacticallyAlexander Barkov2016-05-2311-44/+85
| | |
| | * MDEV-10051 Fix subselect to return a syntax error instead of "Incorrect ↵Alexander Barkov2016-05-2310-41/+37
| | | | | | | | | | | | usage of UNION and LIMIT"
| | * MDEV-10095 Fix derived tables to return a syntax error instead of "Illegal ↵Alexander Barkov2016-05-2110-48/+61
| | | | | | | | | | | | usage of UNION and LIMIT"
| | * sql_yacc.yy: Removing unnecessary init_nested_join() and end_nested_join()Alexander Barkov2016-05-211-15/+1
| | | | | | | | | | | | from select_derived_init.
| | * A derived_query_specification clean-upAlexander Barkov2016-05-201-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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.
| | * MDEV-8429: Change binlog_checksum default to match MySQL 5.6.6+Oleksandr Byelkin2016-05-2037-1499/+1571
| | |
| | * MDEV-10080 Derived tables allow double LIMIT clauseAlexander Barkov2016-05-203-9/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * This patch is a cleanup simplifying upcomingAlexander Barkov2016-05-191-20/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "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.
| | * MDEV-9947: COM_MULTI united responseOleksandr Byelkin2016-05-1710-23/+57
| | |
| | * MDEV-6353 my_ismbchar() and my_mbcharlen() refactoringAlexander Barkov2016-05-1728-270/+118
| | |
| | * MDEV-10079 sql_yacc.yy: Remove non-parenthesized SELECT from table_refAlexander Barkov2016-05-174-10/+12
| | |
| | * sql_yacc.yy: Adding a helper rule get_select_lex_derived,Alexander Barkov2016-05-171-11/+14
| | | | | | | | | | | | to simplify further MDEV-8909 refactoring.
| | * MDEV-10078 sql_yacc.yy: Remove non-parenthesized SELECT from table_factorAlexander Barkov2016-05-171-23/+34
| | |
| | * Merge branch '10.2' of github.com:MariaDB/server into 10.2Igor Babaev2016-05-161-10/+19
| | |\
| | | * sql_yacc.yy cleanup, to simplify further changes for MDEV-8909.Alexander Barkov2016-05-161-10/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Moving "SELECT_SYM select_init2_derived opt_table_expression" from query_term into a new separate rule query_specification, and using query_specification in the beginning of query_term. - query_term now does not have a %type, query_specification has a %type instead. This removes duplicate code that returns Lex->current_select->master_unit()->first_select();
| | * | Fixed bug mdev-10058.Igor Babaev2016-05-163-15/+70
| | |/ | | | | | | | | | | | | This was a bug in the parser. As a result it could accept queries with invalid derived tables if they used With clauses.
| | * attempt to fix debian build (gssapi plugins require 10.1 client or server ↵Vladislav Vaintroub2016-05-143-4/+8
| | | | | | | | | | | | instead of 10.2
| | * sql_yacc.yy: adding a new rule union_head_non_top, to reuse some codeAlexander Barkov2016-05-131-15/+13
| | | | | | | | | | | | | | | between select_derived_union and query_expression_body. An upcoming patch for MDEV-10035 will also reuse union_head_non_top.
| | * Fix of PSI & COM_MULTIOleksandr Byelkin2016-05-131-0/+8
| | |
| | * sql_yacc.yy:Alexander Barkov2016-05-131-7/+4
| | | | | | | | | | | | | | | | | | | | | - Moving select_options_and_item_list from select_init2 to select_init and view_select_aux - Renaming select_init2 to select_init3 This will simplify upcoming sql_yacc.yy fixes (e.g. MDEV-10035, MDEV-8909).
| | * close_open_tables() is not meaningful anymoreSergey Vojtovich2016-05-101-19/+2
| | |
| | * MDEV-505 - feature request: add \H option for mysql client promptSergey Vojtovich2016-05-101-2/+4
| | | | | | | | | | | | | | | | | | An addition to original patch: - use FN_REFLEN instead of HOST_NAME_MAX (the latter can be undefined) - avoid calling gethostname() on every prompt construction by caching it
| | * MDEV-505: feature request: add \H option for mysql client promptDan Ungureanu2016-05-101-10/+22
| | | | | | | | | | | | | | | | | | Introduce `\H` option which behaves mostly like `\h`. The only exception is when the client connects to the server hosted on localhost. In this case, the hostname will be used instead.
| | * Renaming query_specification to query_term, to make the sql_yacc.yy grammarAlexander Barkov2016-05-101-5/+5
| | | | | | | | | | | | | | | | | | | | | closer the grammar in the SQL Standard: - <query specification> is only a SELECT followed by <set quantifier>, <select list> and <table expression>. - While <query term> includes SELECT queries and derived tables.
| | * MDEV-10036 sql_yacc.yy: Split select_part2 to disallow syntactically bad ↵Alexander Barkov2016-05-107-99/+85
| | | | | | | | | | | | | | | | | | constructs with INTO, PROCEDURE, UNION MDEV-10037 UNION with LIMIT ROWS EXAMINED does not require parentheses
* | | Fixed the problem of wrong identification of WITH tables defined in WITH ↵Galina Shalygina2016-05-2416-141/+491
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | clauses without RECURSIVE. Added test cases to check the fix. Fixed the problem of wrong types of recursive tables when the type of anchor part does not coincide with the type of recursive part. Prevented usage of marerialization and subquery cache for subqueries with recursive references. Introduced system variables 'max_recursion_level'. Added a test case to test usage of this variable.
* | | Changes in test filesGalina Shalygina2016-05-192-89/+89
| | |
* | | Fixed many problems in the code of With_element::check_unrestricted_recursive().Galina Shalygina2016-05-1913-52/+675
| | | | | | | | | | | | | | | | | | | | | Added the check whether there are set functions in the specifications of recursive CTE. Added the check whether there are recursive references in subqueries. Introduced boolean system variable 'standards_compliant_cte'. By default it's set to 'on'. When it's set to 'off' non-standard compliant CTE can be executed.
* | | Fixed a bug that caused crashes for SHOW CREATE VIEW <view> when <view> was ↵Galina Shalygina2016-05-144-16/+72
| | | | | | | | | | | | recursive. Added a test case to check the fix.
* | | Made prepared statement, explain and views working with recursuve CTE.Galina Shalygina2016-05-128-21/+198
| | |
* | | Fixed merge problems to allow mysql-test suite 'main' to passGalina Shalygina2016-05-106-20/+26
| | |
* | | Main patch for mdev-9864Galina Shalygina2016-05-0914-73/+856
| | |
* | | Merge branch '10.2' into 10.2-mdev9864Galina Shalygina2016-05-090-0/+0
|\ \ \ | |/ /
| * | Initial commit for mdev-9864 containing only test filesGalina Shalygina2016-05-082-0/+530
| |/
| * MDEV-10030 sql_yacc.yy: Split table_expression and remove PROCEDURE from ↵Alexander Barkov2016-05-0613-38/+110
| | | | | | | | | | | | | | | | | | create_select, select_paren_derived, select_derived2, query_specification This change refactors the "table_expression" rule in sql_yacc.yy. Queries with subselects and derived tables, as well as "CREATE TABLE ... SELECT" now return syntax error instead of "Incorrect usage of PROCEDURE and ...".
| * MDEV-6720 - enable connection log in mysqltest by defaultSergey Vojtovich2016-05-052-4/+0
| | | | | | | | | | | | This is an addition to original patch. Removed meaningless "echo SET SESSION AUTOCOMMIT=0" (transaction is started explicitely on master anyway).