summaryrefslogtreecommitdiff
path: root/sql
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-17832 Protocol: extensions for Pluggable types and JSON, GEOMETRYAlexander Barkov2020-03-1011-3/+171
|
* Fixing a compilation failure on windowsVarun Gupta2020-03-101-3/+28
|
* MDEV-21580: Allow packed sort keys in sort bufferVarun Gupta2020-03-1015-279/+1505
| | | | | | | | | | | | | | | | | | This task deals with packing the sort key inside the sort buffer, which would lead to efficient usage of the memory allocated for the sort buffer. The changes brought by this feature are 1) Sort buffers would have sort keys of variable length 2) The format for sort keys inside the sort buffer would look like |<sort_length><null_byte><key_part1><null_byte><key_part2>.......| sort_length is the extra bytes that are required to store the variable length of a sort key. 3) When packing of sort key is done we store the ORIGINAL VALUES inside the sort buffer and not the STRXFRM form (mem-comparable sort keys). 4) Special comparison function packed_keys_comparison() is introduced to compare 2 sort keys. This patch also contains contributions from Sergei Petrunia.
* MDEV-20632: Recursive CTE cycle detection using CYCLE clause (nonstandard)Oleksandr Byelkin2020-03-1013-136/+307
| | | | Added CYCLE ... RESTRICT (nonstandard) clause to recursive CTE.
* MDEV-21833 Make slave_run_triggers_for_rbr enforce triggers to run on slave, ↵Oleksandr Byelkin2020-03-094-14/+19
| | | | | | | | even when there are triggers on the master A bit changed patch of Anders Karlsson with examples added. New parameters "ENFORCE" to slave-run-triggers-for-rbr added.
* Fixed signed/unsigned error on WindowsSergey Vojtovich2020-03-091-1/+2
|
* MDEV-21659 XA rollback foreign_xid is allowed inside active XAAndrei Elkin2020-03-091-2/+29
| | | | | | | | | | MDEV-21854 xa commit `xid` one phase for already prepared transaction must always error out Added state and one-phase option checks to XA "external" commit/rollback branches. While the XA standard does not prohibit it, Commit and Rollback of an XA external to the current ongoing transaction is not allowed; after all the current transaction may rollback to not being able to revert that decision.
* Attempt fixing build failure on WindowsSergey Vojtovich2020-03-091-2/+2
| | | | Let ulong_num being converted by strtoul() rather than strtol().
* MDEV-21856 - xid_t::formatID has to be constrained to 4 byte sizeSergey Vojtovich2020-03-091-1/+3
| | | | | | Engine (InnoDB) and XA replication MDEV-742 requires the XID member be of a constant minimum across supported platform ulong size which is 4 bytes.
* Basic LEX::print function that supports UPDATEsSergei Petrunia2020-03-072-0/+65
|
* Provide a show_create_table_ex() functionSergei Petrunia2020-03-072-27/+62
| | | | | It is like show_create_table() but allows the caller to specify the database_name and table_name which are to be printed.
* MDEV-21887: federatedx crashes on SELECT ... INTO query in select_handler codeSergei Petrunia2020-03-071-22/+4
| | | | | | | | | | - Don't try to push down SELECTs that have a side effect - In case the storage engine did support pushdown of SELECT with an INTO clause, write the rows we've got from it into select->join->result, and not thd->protocol. This way, SELECT ... INTO ... FROM smart_engine_table will put the result into where instructed, and NOT send it to the client.
* MDEV-20500: Bad error msg on disabling local infileRahul Anand2020-03-032-3/+7
|
* MDEV-21747 needless alter_ctx arg in prep_alter_part_table()Aleksey Midenkov2020-03-033-6/+3
|
* MDEV-7318 RENAME INDEXAleksey Midenkov2020-03-036-2/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support of RENAME INDEX operation to the ALTER TABLE statement. Code which determines if ALTER TABLE can be done in-place for "simple" storage engines like MyISAM, Heap and etc. was updated to handle ALTER TABLE ... RENAME INDEX as an in-place operation. Support for in-place ALTER TABLE ... RENAME INDEX for InnoDB was covered by MDEV-13301. Syntax changes ============== A new type of <alter_specification> is added: <rename index clause> ::= RENAME ( INDEX | KEY ) <oldname> TO <newname> Where <oldname> and <newname> are identifiers for old name and new name of the index. Semantic changes ================ The result of "ALTER TABLE t1 RENAME INDEX a TO b" is a table which contents and structure are identical to the old version of 't1' with the only exception index 'a' being called 'b'. Neither <oldname> nor <newname> can be "primary". The index being renamed should exist and its new name should not be occupied by another index on the same table. Related to: WL#6555, MDEV-13301
* MDEV-16290 ALTER TABLE ... RENAME COLUMN syntaxAleksey Midenkov2020-03-035-34/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | The existing syntax for renaming a column uses "ALTER TABLE ... CHANGE" command. This requires full column specification to rename the column. This patch adds new syntax "ALTER TABLE ... RENAME COLUMN", which do not expect users to provide full column specification. It means that the new syntax would pick in-place or copy algorithm in the same way as that of existing "ALTER TABLE ... CHANGE" command. The existing syntax "ALTER TABLE ... CHANGE" will continue to work. Syntax changes ============== ALTER TABLE tbl_name [alter_specification [, alter_specification] ...] [partition_options] Following is a new <alter_specification> added: | RENAME COLUMN <oldname> TO <newname> Where <oldname> and <newname> are identifiers for old name and new name of the column. Related to: WL#10761
* MDEV-21766 - Forbid XID with empty 'gtrid'Sergey Vojtovich2020-02-281-0/+2
| | | | | | | | | XA specification doesn't permit empty gtrid. It is now enforced by this patch. This solution was agreed in favour of fixing InnoDB, which doesn't expect empty XID since early 10.5. Also fixed wrong assertion (and added a test cases) that didn't permit 64 bytes gtrid + 64 bytes bqual.
* MDEV-21704 Add a new JSON field "version_id" into mysql.global_priv.privAlexander Barkov2020-02-282-11/+65
|
* MDEV-21838: Add information about packed addon fields in ANALYZE FORMAT=JSON10.5-mdev21784-reg1-baseVarun Gupta2020-02-283-1/+39
| | | | | It is useful to know whether sorting uses addon fields[packed|unpacked] or ROWID. Provide this information in ANALYZE FORMAT=JSON output.
* cleanup trailing wsSergey Vojtovich2020-02-271-1/+1
|
* MDEV-10569: Add RELEASE_ALL_LOCKS function. Implementing the SQLDaniel-Solo2020-02-273-28/+88
| | | | function to release all named locks
* Revert "MDEV-17554 Auto-create new partition for system versioned tables ↵Sergei Golubchik2020-02-278-345/+43
| | | | | | | with history partitioned by INTERVAL/LIMIT" This reverts commit 9894751a2a61ef952ac6ac556fd683e53fc150e2. This reverts commit f707c83fff4fa3f5291684e6226542fdb75bbdeb.
* Compilation fixAleksey Midenkov2020-02-251-0/+1
|
* MDEV-17554 Auto-create new partition for system versioned tables with ↵Aleksey Midenkov2020-02-258-43/+344
| | | | | | | | | | | | | | | | | | | | | | | | | | | | history partitioned by INTERVAL/LIMIT When there are E empty partitions left, auto-create N new empty partitions for SYSTEM_TIME partitioning rotated by INTERVAL/LIMIT and marked by AUTO_INCREMENT keyword. Syntax change: AUTO_INCREMENT keyword (or shorter AUTO may be used instead) after LIMIT/INTERVAL clause. CREATE OR REPLACE TABLE t (x INT) WITH SYSTEM VERSIONING PARTITION BY SYSTEM_TIME LIMIT 100000 AUTO_INCREMENT; CREATE OR REPLACE TABLE t (x INT) WITH SYSTEM VERSIONING PARTITION BY SYSTEM_TIME INTERVAL 1 WEEK AUTO_INCREMENT; The current revision implements hard-coded values of 1 for E and N. As well as auto-creation threshold MinInterval = 1 hour, MinLimit = 1000. The name for newly added partition will be first chosen as "pX", where X is partition number and "p" is hard-coded name prefix. If this name is already occupied, the X will be incremented until the resulting name will be free to use. ALTER TABLE ADD PARTITION is now always fast. If there some history partition overflow occurs manual ALTER TABLE REBUILD PARTITION is needed.
* Clarify, spelling for wsrep_strict_ddl description (#1447)Ian Gilfillan2020-02-171-1/+1
|
* MDEV-18650: Options deprecated in previous versions - multi_range_countVicențiu Ciorbaru2020-02-134-8/+3
| | | | Remove deprecated system variable multi_range_count. It was ignored from 5.3.
* MDEV-18650: Options deprecated in previous versions - skip-bdbVicențiu Ciorbaru2020-02-132-3/+3
| | | | Remove the option from mysqld --help text.
* MDEV-18650: Options deprecated in previous versions - thread_concurrencyVicențiu Ciorbaru2020-02-133-26/+8
| | | | thread_concurrency was ignored since 5.5. Remove it.
* MDEV-18650: Options deprecated in previous versions - old_alter_tableVicențiu Ciorbaru2020-02-131-1/+3
| | | | | It was deprecated in 5.5 but it never issued a deprecation warning. Make it issue a warning in 10.5.1.
* for every deprecated sysvar note a version when it happenedSergei Golubchik2020-02-131-11/+14
|
* Policy improvement for removed options and system variablesVicențiu Ciorbaru2020-02-132-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | REMOVED OPTIONS / SYSTEM VARIABLES * mysqld removed options will not stop the server from starting. They will be silently accepted, as if --loose flag is set. Removed options prefixes will not interfere with existing options prefixes. They are consumed last. * mysqld removed options will not show in --help. * mysqld system variables will be removed according to the deprecation & removal timeline and not function within the client interface once removed. DEPRECTATED OPTIONS / SYSTEM VARIABLES * mysqld deprecated options will issue a warning to the user. * mysqld deprecated options will still be visible in --help. * mysqld system variables will be removed in the next GA version that is past EOL of the version that deprecated the variable. * deprecated options / variables will not be used anywhere in the server code the moment they are deprecated. At most, they will act as aliases. The advantage of this policy is that it ensures upgrades will always allow the user to start the server, even when upgrading from a very old version. It is still possible for user applications to break when upgrading, as system variables set via the client interface will return errors. However, this will happen after a long time, with lots of warnings between versions. The expected timeline is ~ 5 years until a deprecated variable dissapears from the server.
* MDEV-18650: Options deprecated in previous versions - storage_engineVicențiu Ciorbaru2020-02-131-2/+2
| | | | | | | Remove usage of deprecated variable storage_engine. It was deprecated in 5.5 but it never issued a deprecation warning. Make it issue a warning in 10.5.1. Replaced with default_storage_engine.
* MDEV-21665: Server crashes in my_qsort2 / Filesort_buffer::sort_bufferVarun Gupta2020-02-121-1/+2
| | | | | Allocation should use ALIGN_SIZE when we need to make sure that we have atleast enough space to store one record in MERGEBUFF2 buffers
* Merge branch '10.4' into 10.5Oleksandr Byelkin2020-02-1214-94/+204
|\
| * Merge branch '10.3' into 10.4Oleksandr Byelkin2020-02-1114-94/+204
| |\
| | * Merge branch '10.2' into 10.3Oleksandr Byelkin2020-02-103-5/+11
| | |\
| | | * Merge branch '10.1' into 10.2Oleksandr Byelkin2020-02-101-1/+0
| | | |\
| | | | * Merge branch '5.5' into 10.1Oleksandr Byelkin2020-02-101-1/+0
| | | | |\
| | | | | * Clean the comment for `table_f_c unt` parameterAnel Husakovic2020-01-291-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | Deleted with commit: c70a9fa1e3c4
| | | * | | MDEV-16308 : protocol messed up sporadicallyVladislav Vaintroub2020-02-101-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Context involves semicolon batching, and the error starts 10.2 No reproducible examples were made yet, but TCP trace suggests multiple packets that are "squeezed" together (e.g overlong OK packet that has a trailer which is belongs to another packet) Remove thd->get_stmt_da()->set_skip_flush() when processing a batch. skip_flush stems from the COM_MULTI code, which was checked in during 10.2 (and is never used) The fix is confirmed to work, when evaluated by bug reporter (one of them) We never reproduced it locally, with multiple tries thus the root cause analysis is still missing.
| | | * | | MDEV-18027: Running out of file descriptors and eventual crashOleksandr Byelkin2020-02-051-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | For automatic number of opened files limit take into account number of table instances for table cache
| | * | | | MDEV-21614 Wrong query results with optimizer_switch="split_materialized=on"Igor Babaev2020-02-071-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not materialize a semi-join nest if it contains a materialized derived table /view that potentially can be subject to the split optimization. Splitting of materialization of such nest would help, but currently there is no code to support this technique.
| | * | | | MDEV-20076: SHOW GRANTS does not quote role names properlybb-10.3-MDEV-20076Oleksandr Byelkin2020-02-051-53/+35
| | | | | | | | | | | | | | | | | | | | | | | | Quotes added to output.
| | * | | | ha_partition: add comments, comment out unused member variablesSergei Petrunia2020-02-052-3/+90
| | | | | |
| | * | | | MDEV-21195 INSERT chooses wrong partition for RANGE partitioning by DECIMAL ↵Aleksey Midenkov2020-02-023-6/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | column Use FLOOR rounding for DECIMAL_RESULT item_expr in partition function.
| | * | | | MDEV-17798 System variable system_versioning_asof accepts wrong valuesAleksey Midenkov2020-02-021-2/+2
| | | | | |
| | * | | | Merge 10.2 into 10.3Marko Mäkelä2020-01-313-25/+32
| | |\ \ \ \ | | | |/ / /
| | | * | | MDEV-21586: Fix a warning for converting my_bool to boolMarko Mäkelä2020-01-311-3/+4
| | | | | |
| | | * | | Merge 10.1 into 10.2Marko Mäkelä2020-01-312-20/+25
| | | |\ \ \ | | | | |/ /
| | | | * | MDEV-20923:UBSAN: member access within address … which does not point to ↵Sujatha2020-01-292-17/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | an object of type 'xid_count_per_binlog' Problem: ------- Accessing a member within 'xid_count_per_binlog' structure results in following error when 'UBSAN' is enabled. member access within address 0xXXX which does not point to an object of type 'xid_count_per_binlog' Analysis: --------- The problem appears to be that no constructor for 'xid_count_per_binlog' is being called, and thus the vtable will not be initialized. Fix: --- Defined a parameterized constructor for 'xid_count_per_binlog' class.