summaryrefslogtreecommitdiff
path: root/sql/sql_yacc.yy
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '10.2' into 10.2-mdev986410.2-test1234Galina Shalygina2016-05-251-232/+344
|\
| * 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-241-25/+31
| | | | | | | | ..} .. UNION ..
| * MDEV-10103 Disallow syntactically UNION SELECT .. PROCEDURE ANALYSE()Alexander Barkov2016-05-241-12/+56
| |
| * MDEV-10102 Disallow CREATE VIEW .. PROCEDURE ANALYSE() syntacticallyAlexander Barkov2016-05-231-23/+66
| |
| * MDEV-10051 Fix subselect to return a syntax error instead of "Incorrect ↵Alexander Barkov2016-05-231-20/+16
| | | | | | | | usage of UNION and LIMIT"
| * MDEV-10095 Fix derived tables to return a syntax error instead of "Illegal ↵Alexander Barkov2016-05-211-21/+34
| | | | | | | | 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-10080 Derived tables allow double LIMIT clauseAlexander Barkov2016-05-201-7/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-10079 sql_yacc.yy: Remove non-parenthesized SELECT from table_refAlexander Barkov2016-05-171-7/+9
| |
| * 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-161-15/+34
| |/ | | | | | | | | This was a bug in the parser. As a result it could accept queries with invalid derived tables if they used With clauses.
| * 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.
| * 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).
| * 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-101-45/+30
| | | | | | | | | | | | constructs with INTO, PROCEDURE, UNION MDEV-10037 UNION with LIMIT ROWS EXAMINED does not require parentheses
| * MDEV-10030 sql_yacc.yy: Split table_expression and remove PROCEDURE from ↵Alexander Barkov2016-05-061-23/+42
| | | | | | | | | | | | | | | | | | 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 ...".
| * Convert ntile to work with expressions as parameters.Vicențiu Ciorbaru2016-04-041-6/+1
| |
| * Implement ntile window function.Vicențiu Ciorbaru2016-04-041-0/+13
| | | | | | | | | | The current implementation does not allow for a dynamic expression within the sum function's parameter.
| * Merge branch '10.2' into bb-10.2-mdev9543Sergei Petrunia2016-03-281-128/+317
| |\
| * | Changed the base class for Item_window_func from Item_result_field toIgor Babaev2016-03-231-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Item_func_or_sum. Implemented method update_used_tables for class Item_findow_func. Added the flag Item::with_window_func. Made sure that window functions could be used only in SELECT list and ORDER BY clause. Added test cases that checked different illegal placements of window functions.
| * | Fixed a problems in the parser.Igor Babaev2016-02-191-2/+3
| | | | | | | | | | | | | | | | | | Resolved window names. Checked some constraints for window frames. Added test cases for window name resolution.
| * | Initial patch for the implementation of window functions (MDEV-6115):Igor Babaev2016-02-121-2/+260
| | | | | | | | | | | | | | | | | | - All parsing problems look like resolved - Stub performing name resolution of window functions in simplest queries has been added.
* | | Main patch for mdev-9864Galina Shalygina2016-05-091-4/+13
| | |
* | | Merge branch '10.2' into 10.2-mdev9864Galina Shalygina2016-05-081-24/+314
| |/ |/|
* | Manual merge of branch 'bb-10.2-mdev8789' into 10.2Igor Babaev2016-03-211-17/+115
|\ \
| * | Addressed the issues raised in the review for the main patchbb-10.2-mdev8789Igor Babaev2016-02-171-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | of mdev-8789. Fixed a bug in TABLE_LIST::print. Fixed another bug for the case when the definition of a WITH table contained column list while the join in the main query used two instances of this table.
| * | Fixed compile errors of the merge of the patch for mdev-8789 with 10.2.Igor Babaev2015-12-211-1/+1
| | |
| * | MDEV-8789 Implement non-recursive common table expressionsGalina Shalygina2015-12-181-17/+116
| | | | | | | | | | | | Initial implementation
* | | [MDEV-7978] Post review fixes and cleanups.Vicențiu Ciorbaru2016-03-081-8/+9
| | | | | | | | | | | | | | | | | | * Maintain coding style in sql_yacc.yy in regards to optional clauses. * Remove unused variable from sql_acl.cc. * Update test case
* | | [MDEV-7978] Added show create user implementation.Vicențiu Ciorbaru2016-03-081-1/+1
| | |
* | | [MDEV-7978] Updated syntax for SHOW CREATE USERVicențiu Ciorbaru2016-03-081-0/+12
| | |
* | | [MDEV-7978] Implement alter user and tested create userVicențiu Ciorbaru2016-03-081-1/+2
| | | | | | | | | | | | | | | Implemented the alter user syntax. Also tested that create user creates users accordingly.
* | | [MDEV-7978] Update grammar for new syntaxVicențiu Ciorbaru2016-03-081-18/+39
| | | | | | | | | | | | | | | Extend the syntax accepted by the grammar to account for the new create user and alter user syntax.
* | | Merge branch '10.1' into 10.2Sergei Golubchik2016-02-251-11/+12
|\ \ \
| * \ \ Merge branch '10.0' into 10.1Sergei Golubchik2016-02-231-9/+9
| |\ \ \
| | * \ \ Merge branch '5.5' into 10.0Sergei Golubchik2016-02-151-9/+9
| | |\ \ \
| | | * | | MDEV-9462: Out of memory using explain on 2 empty tablesOleksandr Byelkin2016-02-061-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | Fixed adding derived tables items to outer one.
| * | | | | disable SHOW I_S_table for built-in I_S tablesSergei Golubchik2016-02-231-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes MDEV-9538 Server crashes in check_show_access on SHOW STATISTICS MDEV-9539 Server crashes in make_columns_old_format on SHOW GEOMETRY_COLUMNS MDEV-9540 SHOW SPATIAL_REF_SYS and SHOW SYSTEM_VARIABLES return empty results with numerous warnings
* | | | | | Merge branch '10.1' into 10.2Monty2016-02-061-76/+131
|\ \ \ \ \ \ | |/ / / / / | | | | | / | |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: VERSION cmake/plugin.cmake config.h.cmake configure.cmake plugin/server_audit/server_audit.c sql/sql_yacc.yy
| * | | | Merge branch '10.0' into 10.1Monty2016-02-021-1/+1
| |\ \ \ \ | | |/ / / | | | | | | | | | | | | | | | Conflicts: configure.cmake
| | * | | MDEV-6421 SQL_ERROR_LOG doesn't log comments in Events.Alexey Botchkov2016-01-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Change parser so it saves all the query line to the ';' in the sp_instr::m_query.
| * | | | MDEV-8615: Assertion `m_cpp_buf <= begin_ptr && begin_ptr <= m_cpp_buf + ↵Oleksandr Byelkin2016-01-271-57/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | m_buf_length' failed in Lex_input_stream::body_utf8_start Nothing should be done before any keyword recognized.
| * | | | cleanup: LEX_USER::pwtext and LEX_USER::pwhashSergei Golubchik2016-01-251-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Was: * LEX_USER::password was storing sometimes plaintext password and sometimes password hash * LEX_USER::auth was storing sometimes password hash and sometimes plugin authentication string Now: * LEX_USER::pwtext stores the password in plain-text * LEX_USER::pwhash stores the password hash * LEX_USER::auth stores the plugin authentication string
| * | | | cleanup: create LEX_USER::reset_auth()Sergei Golubchik2016-01-251-12/+4
| | | | | | | | | | | | | | | | | | | | as this is used quite often