summaryrefslogtreecommitdiff
path: root/sql/lex.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge bb-10.2-ext into 10.3Marko Mäkelä2017-09-251-0/+1
|\
| * MDEV-11553 Can't restore a PERSISTENT column that uses DATE_FORMAT()Sergei Golubchik2017-09-231-0/+1
| | | | | | | | 3-argument form of DATE_FORMAT
* | Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.310.3-MDEV-10953Alexander Barkov2017-05-171-0/+2
|\ \ | |/
| * MDEV-10139 Support for SEQUENCE objectsMonty2017-05-081-0/+2
| | | | | | | | | | | | | | | | | | | | - SETVAL(sequence_name, next_value, is_used, round) - ALTER SEQUENCE, including RESTART WITH Other things: - Added handler::extra() option HA_EXTRA_PREPARE_FOR_ALTER_TABLE to signal ha_sequence() that it should allow write_row statments. - ALTER ONLINE TABLE now works with SEQUENCE:s
* | Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3Alexander Barkov2017-04-071-1/+12
|\ \ | |/
| * MDEV-10139 Support for SEQUENCE objectsMonty2017-04-071-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Working features: CREATE OR REPLACE [TEMPORARY] SEQUENCE [IF NOT EXISTS] name [ INCREMENT [ BY | = ] increment ] [ MINVALUE [=] minvalue | NO MINVALUE ] [ MAXVALUE [=] maxvalue | NO MAXVALUE ] [ START [ WITH | = ] start ] [ CACHE [=] cache ] [ [ NO ] CYCLE ] ENGINE=xxx COMMENT=".." SELECT NEXT VALUE FOR sequence_name; SELECT NEXTVAL(sequence_name); SELECT PREVIOUS VALUE FOR sequence_name; SELECT LASTVAL(sequence_name); SHOW CREATE SEQUENCE sequence_name; SHOW CREATE TABLE sequence_name; CREATE TABLE sequence-structure ... SEQUENCE=1 ALTER TABLE sequence RENAME TO sequence2; RENAME TABLE sequence TO sequence2; DROP [TEMPORARY] SEQUENCE [IF EXISTS] sequence_names Missing features - SETVAL(value,sequence_name), to be used with replication. - Check replication, including checking that sequence tables are marked not transactional. - Check that a commit happens for NEXT VALUE that changes table data (may already work) - ALTER SEQUENCE. ANSI SQL version of setval. - Share identical sequence entries to not add things twice to table list. - testing insert/delete/update/truncate/load data - Run and fix Alibaba sequence tests (part of mysql-test/suite/sql_sequence) - Write documentation for NEXT VALUE / PREVIOUS_VALUE - NEXTVAL in DEFAULT - Ensure that NEXTVAL in DEFAULT uses database from base table - Two NEXTVAL for same row should give same answer. - Oracle syntax sequence_table.nextval, without any FOR or FROM. - Sequence tables are treated as 'not read constant tables' by SELECT; Would be better if we would have a separate list for sequence tables so that select doesn't know about them, except if refereed to with FROM. Other things done: - Improved output for safemalloc backtrack - frm_type_enum changed to Table_type - Removed lex->is_view and replaced with lex->table_type. This allows use to more easy check if item is view, sequence or table. - Added table flag HA_CAN_TABLES_WITHOUT_ROLLBACK, needed for handlers that want's to support sequences - Added handler calls: - engine_name(), to simplify getting engine name for partition and sequences - update_first_row(), to be able to do efficient sequence implementations. - Made binlog_log_row() global to be able to call it from ha_sequence.cc - Added handler variable: row_already_logged, to be able to flag that the changed row is already logging to replication log. - Added CF_DB_CHANGE and CF_SCHEMA_CHANGE flags to simplify deny_updates_if_read_only_option() - Added sp_add_cfetch() to avoid new conflicts in sql_yacc.yy - Moved code for add_table_options() out from sql_show.cc::show_create_table() - Added String::append_longlong() and used it in sql_show.cc to simplify code. - Added extra option to dd_frm_type() and ha_table_exists to indicate if the table is a sequence. Needed by DROP SQUENCE to not drop a table.
* | Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3Alexander Barkov2017-04-071-0/+1
|\ \ | |/
| * MDEV-12461 TYPE OF and ROW TYPE OF anchored data typesAlexander Barkov2017-04-071-0/+1
| |
* | Merge bb-10.2-compatibility into 10.3Alexander Barkov2017-04-061-0/+13
|\ \ | |/
| * MDEV-12133 sql_mode=ORACLE: table%ROWTYPE in variable declarationsAlexander Barkov2017-04-051-0/+1
| |
| * MDEV-10697 GOTO statementhalfspawn2017-04-051-0/+1
| |
| * MDEV-10588 sql_mode=ORACLE: TRUNCATE TABLE t1 [ {DROP|REUSE} STORAGE ]Alexander Barkov2017-04-051-0/+1
| |
| * MDEV-10840 sql_mode=ORACLE: RAISE statement for predefined exceptionsAlexander Barkov2017-04-051-0/+1
| |
| * MDEV-10582 sql_mode=ORACLE: explicit cursor attributes %ISOPEN, %ROWCOUNT, ↵Alexander Barkov2017-04-051-0/+2
| | | | | | | | %FOUND, %NOTFOUND
| * MDEV-10583 sql_mode=ORACLE: SQL%ROWCOUNTAlexander Barkov2017-04-051-0/+1
| |
| * MDEV-10342 Providing compatibility for basic SQL built-in functionsAlexander Barkov2017-04-051-0/+1
| | | | | | | | | | | | Adding the Oracle style DECODE function: DECODE(operand, search, result [, search, result ...] [, default_result])
| * MDEV-10411 Providing compatibility for basic PL/SQL constructsAlexander Barkov2017-04-051-0/+1
| | | | | | | | | | | | | | Part 15: ELSIF vs ELSEIF Also, moving tests for Oracle keywords in sql_mode=DEFAULT from "parser.test" to a better place "keywords.test".
| * MDEV-10411 Providing compatibility for basic PL/SQL constructsAlexander Barkov2017-04-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Part 9: EXCEPTION handlers - Adding exception handler syntax: WHEN exception_name THEN statement - Adding EXCEPTION section intoi the top BEGIN..END SP block. Note, currently EXCEPTION goes in the beginning of the top BEGIN..END SP block. TODO: - add EXCEPTION section into inner blocks - move EXCEPTION to the end of the block
| * MDEV-10343 Providing compatibility for basic SQL data typesAlexander Barkov2017-04-051-0/+3
| | | | | | | | Based on the patch by Dmitry Tolpeko.
| * MDEV-10141: Add support for INTERSECT (and common parts for EXCEPT)Oleksandr Byelkin2017-03-141-0/+2
| | | | | | | | MDEV-10140: Add support for EXCEPT
* | MDEV-11379, MDEV-11388 - [WAIT n|NOWAIT]Sergey Vojtovich2017-03-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extended syntax so that it is now possible to set lock_wait_timeout for the following statements: SELECT ... FOR UPDATE [WAIT n|NOWAIT] SELECT ... LOCK IN SHARED MODE [WAIT n|NOWAIT] LOCK TABLE ... [WAIT n|NOWAIT] CREATE ... INDEX ON tbl_name (index_col_name, ...) [WAIT n|NOWAIT] ... ALTER TABLE tbl_name [WAIT n|NOWAIT] ... OPTIMIZE TABLE tbl_name [WAIT n|NOWAIT] DROP INDEX ... [WAIT n|NOWAIT] TRUNCATE TABLE tbl_name [WAIT n|NOWAIT] RENAME TABLE tbl_name [WAIT n|NOWAIT] ... DROP TABLE tbl_name [WAIT n|NOWAIT] ... Valid range of lock_wait_timeout and innodb_lock_wait_timeout was extended so that 0 is acceptable value (means no wait). This is amended AliSQL patch. We prefer Oracle syntax for [WAIT n|NOWAIT] instead of original [WAIT [n]|NO_WAIT].
* | MDEV-10141: Add support for INTERSECT (and common parts for EXCEPT)Oleksandr Byelkin2017-03-131-0/+2
|/ | | | MDEV-10140: Add support for EXCEPT
* Fixed bug mdev-9976.Igor Babaev2017-01-311-1/+1
| | | | | | | | This bug happens due to a conflict in the construct window_spec. (win_ref conflicts with the non-reserved key word ROWS). The standard SQL-2003 says that ROWS is a reserved key word. Made this key word reserved in our grammar and removed the conflict.
* cleanup: parser: s/USER/USER_SYM/Sergei Golubchik2016-12-121-3/+3
|
* MDEV-9143 JSON_xxx functions.Alexey Botchkov2016-11-151-0/+1
| | | | | The rest of mysql/json functions implemented. CAST AS JSON implemented.
* MDEV-7145: Delayed replicationKristian Nielsen2016-10-161-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge feature into 10.2 from feature branch. Delayed replication adds an option CHANGE MASTER TO master_delay=<seconds> Replication will then delay applying events with that many seconds. This creates a replication slave that reflects the state of the master some time in the past. Feature is ported from MySQL source tree. Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
| * MDEV-7145: Delayed replication, intermediate commit.Kristian Nielsen2016-10-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Initial merge of delayed replication from MySQL git. The code from the initial push into MySQL is merged, and the associated test case passes. A number of tasks are still pending: 1. Check full test suite run for any regressions or .result file updates. 2. Extend the feature to also work for parallel replication. 3. There are some todo-comments about future refactoring left from MySQL, these should be located and merged on top. 4. There are some later related MySQL commits, these should be checked and merged. These include: e134b9362ba0b750d6ac1b444780019622d14aa5 b38f0f7857c073edfcc0a64675b7f7ede04be00f fd2b210383358fe7697f201e19ac9779879ba72a afc397376ec50e96b2918ee64e48baf4dda0d37d 5. The testcase from MySQL relies heavily on sleep and timing for testing, and seems likely to sporadically fail on heavily loaded test servers in buildbot or distro build farms. Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
* | MDEV-10585 EXECUTE IMMEDIATE statementAlexander Barkov2016-10-081-0/+1
| |
* | MDEV-6112 multiple triggers per tableMonty2016-10-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is similar to MysQL Worklog 3253, but with a different implementation. The disk format and SQL syntax is identical with MySQL 5.7. Fetures supported: - "Any" ammount of any trigger - Supports FOLLOWS and PRECEDES to be able to put triggers in a certain execution order. Implementation details: - Class Trigger added to hold information about a trigger. Before this trigger information was stored in a set of lists in Table_triggers_list and in Table_triggers_list::bodies - Each Trigger has a next field that poinst to the next Trigger with the same action and time. - When accessing a trigger, we now always access all linked triggers - The list are now only used to load and save trigger files. - MySQL trigger test case (trigger_wl3253) added and we execute these identically. - Even more gracefully handling of wrong trigger files than before. This is useful if a trigger file uses functions or syntax not provided by the server. - Each trigger now has a "Created" field that shows when the trigger was created, with 2 decimals. Other comments: - Many of the changes in test files was done because of the new "Created" field in the trigger file. This shows up in SHOW ... TRIGGER and when using information_schema.trigger. - Don't check if all memory is released if on uses --gdb; This is needed to be able to get a list from safemalloc of not freed memory while debugging. - Added option to trim_whitespace() to know how many prefix characters was skipped. - Changed a few ulonglong sql_mode to sql_mode_t, to find some wrong usage of sql_mode.
* | Implement LEAD and LAG and NTH_VALUE functionsVicențiu Ciorbaru2016-09-241-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactour out (into a copy for now) the logic of Item_sum_hybrid, to allow for multiple arguments. It does not contain the comparator members. The result is the class Item_sum_hybrid_simple. LEAD and LAG make use of this Item to store previous rows in a chache. It also helps in specifying the field type. Currently LEAD/LAG do not support default values. NTH_VALUE behaves identical to LEAD and LAG, except that the starting position cursor is placed on the top of the frame instead of the current row.
* | Implement first_value and last_value as window functionsVicențiu Ciorbaru2016-09-241-0/+1
| | | | | | | | | | Currently the implementation doesn't support removal, thus the computation is performed by running over the window frame again.
* | Merge branch '10.1' into 10.2Sergei Golubchik2016-06-301-3/+0
|\ \ | |/
| * Merge branch '10.0' into 10.1Sergei Golubchik2016-06-281-3/+0
| |\
| | * Merge branch '5.5' into bb-10.0Sergei Golubchik2016-06-211-3/+0
| | |\
| | | * MDEV-8328 Evaluation of two "!" operators depends on space in beetweenSergei Golubchik2016-06-141-3/+0
| | | | | | | | | | | | | | | | | | | | fix the lexer to backtrack when parsing "<=", "<>", "!=", ">=", "<<", ">>", "<=>".
* | | | MDEV-7563 Support CHECK constraint as in (or close to) SQL StandardMichael Widenius2016-06-301-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MDEV-10134 Add full support for DEFAULT - Added support for using tables with MySQL 5.7 virtual fields, including MySQL 5.7 syntax - Better error messages also for old cases - CREATE ... SELECT now also updates timestamp columns - Blob can now have default values - Added new system variable "check_constraint_checks", to turn of CHECK constraint checking if needed. - Removed some engine independent tests in suite vcol to only test myisam - Moved some tests from 'include' to 't'. Should some day be done for all tests. - FRM version increased to 11 if one uses virtual fields or constraints - Changed to use a bitmap to check if a field has got a value, instead of setting HAS_EXPLICIT_VALUE bit in field flags - Expressions can now be up to 65K in total - Ensure we are not refering to uninitialized fields when handling virtual fields or defaults - Changed check_vcol_func_processor() to return a bitmap of used types - Had to change some functions that calculated cached value in fix_fields to do this in val() or getdate() instead. - store_now_in_TIME() now takes a THD argument - fill_record() now updates default values - Add a lookahead for NOT NULL, to be able to handle DEFAULT 1+1 NOT NULL - Automatically generate a name for constraints that doesn't have a name - Added support for ALTER TABLE DROP CONSTRAINT - Ensure that partition functions register virtual fields used. This fixes some bugs when using virtual fields in a partitioning function
* | | | Implement ntile window function.Vicențiu Ciorbaru2016-04-041-0/+1
| | | | | | | | | | | | | | | | | | | | 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-0/+1
|\ \ \ \
| * | | | MDEV-8789 Implement non-recursive common table expressionsGalina Shalygina2015-12-181-0/+1
| |/ / / | | | | | | | | | | | | Initial implementation
* | | | Initial patch for the implementation of window functions (MDEV-6115):Igor Babaev2016-02-121-0/+13
|/ / / | | | | | | | | | | | | | | | - All parsing problems look like resolved - Stub performing name resolution of window functions in simplest queries has been added.
* | | Merge tag 'mariadb-10.0.19' into 10.1Sergei Golubchik2015-06-011-1/+3
|\ \ \ | |/ /
| * | Merge branch '5.5' into 10.0Sergei Golubchik2015-05-041-1/+3
| |\ \ | | |/
| | * MDEV-6916 REPAIR VIEW / mysql migrationOleksandr Byelkin2015-04-121-0/+1
| | | | | | | | | | | | from: r4407
* | | MDEV-60 Support for Spatial Reference systems for the GIS data.Alexey Botchkov2014-12-041-0/+1
| | | | | | | | | | | | | | | | | | The GEOMETRY field metadata is stored in the FRM file. SRID for a spatial column now can be stored, it was added to the CREATE TABLE syntax, so the AddGeometryData() stored procedure is now possible. Script adding the required Add/DropGeometryColumn sp-s added.
* | | cleanup: s/(OLD_)?PASSWORD/&_SYM/gSergei Golubchik2014-12-041-2/+2
| | |
* | | MDEV-6593 : domain_id based replication filtersNirbhay Choubey2014-12-031-0/+2
| | | | | | | | | | | | Implementation for domain ID based filtering of replication events.
* | | Merge ../10.1-explain-json-r4 into 10.1Sergei Petrunia2014-11-271-0/+1
|\ \ \
| * \ \ Merge ../10.1 into bb-10.1-explain-jsonSergei Petrunia2014-10-151-7/+3
| |\ \ \
| * | | | MDEV-6109: EXPLAIN JSON10.1-explain-jsonSergei Petrunia2014-05-271-0/+1
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | - First code, "EXPLAIN FORMAT=JSON stmt" and "ANALYZE FORMAT=JSON stmt" work for basic queries. Complex constructs (e.g subqueries, etc) not yet supported. - No test infrastructure yet
* | | | MDEV-5231: Per query variables from Percona Server (rewritten)Oleksandr Byelkin2014-11-111-0/+1
| |/ / |/| |