summaryrefslogtreecommitdiff
path: root/sql/share
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-13115: Implement SELECT SKIP LOCKEDDaniel Black2021-04-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds an implementation for SELECT ... FOR UPDATE SKIP LOCKED / SELECT ... LOCK IN SHARED MODE SKIP LOCKED This is implemented only InnoDB at the moment, not in RockDB yet. This adds a new hander flag HA_CAN_SKIP_LOCKED than will be used when the storage engine advertises the flag. When a storage engine indicates this flag it will get TL_WRITE_SKIP_LOCKED and TL_READ_SKIP_LOCKED transaction types. The Lex structure has been updated to store both the FOR UPDATE/LOCK IN SHARE as well as the SKIP LOCKED so the SHOW CREATE VIEW implementation is simplier. "SELECT FOR UPDATE ... SKIP LOCKED" combined with CREATE TABLE AS or INSERT.. SELECT on the result set is not safe for STATEMENT based replication. MIXED replication will replicate this as row based events." Thanks to guidance from Facebook commit https://github.com/facebook/mysql-5.6/commit/193896c466d43fd905a62a60f1d73fd9c551a6e4 This helped verify basic test case, and components that need implementing (even though every part was implemented differently). Thanks Marko for guidance on simplier InnoDB implementation. Reviewers: Marko, Monty
* MDEV-7317: Make an index ignorable to the optimizerVarun Gupta2021-03-041-0/+2
| | | | | | | | | | | | | | This feature adds the functionality of ignorability for indexes. Indexes are not ignored be default. To control index ignorability explicitly for a new index, use IGNORE or NOT IGNORE as part of the index definition for CREATE TABLE, CREATE INDEX, or ALTER TABLE. Primary keys (explicit or implicit) cannot be made ignorable. The table INFORMATION_SCHEMA.STATISTICS get a new column named IGNORED that would store whether an index needs to be ignored or not.
* MDEV-20008: Galera strict modebb-10.6-MDEV-20008mkaruza2021-01-261-1/+1
| | | | | | | | | | | | | Added new enum variable `wsrep_mode` which can be used to turn on WSREP features which are not part of default behaviour. Added enum `BINLOG_ROW_FORMAT_ONLY`, `REQUIRED_PRIMARY_KEY` and `STRICT_REPLICATION`. `wsrep-mode=STRICT_REPLICATION` behaves like variable `wsrep_strict_ddl`. Variable wsrep_strict_ddl is deprecated and if set we use new wsrep_mode setting instead. Reviewed and improved by: Jan Lindström <jan.lindstrom@mariadb.com>
* MDEV-23497 Make ROW_FORMAT=COMPRESSED read-only by defaultMarko Mäkelä2020-11-111-2/+2
| | | | | | | | | | | | | | | | | | Let us introduce the parameter innodb_read_only_compressed that is ON by default, making any ROW_FORMAT=COMPRESSED tables read-only. I developed the ROW_FORMAT=COMPRESSED format based on Heikki Tuuri's rough design between 2005 and 2008. It might have been a good idea back then, but no proper benchmarks were ever run to validate the design or the implementation. The format has been more or less obsolete for years. It limits innodb_page_size to 16384 bytes (the default), and instant ALTER TABLE is not supported. This is the first step towards deprecating and removing write support for ROW_FORMAT=COMPRESSED tables.
* Merge 10.5 into 10.6Marko Mäkelä2020-11-021-3/+12
|\
| * Merge 10.4 to 10.5Marko Mäkelä2020-10-221-2/+3
| |\
| | * Better German Error message.Oleksandr Byelkin2020-10-071-1/+1
| | |
| | * MDEV-23518 Syntax error in ond SP results in misleading message on SHOW ↵Oleksandr Byelkin2020-10-031-2/+3
| | | | | | | | | | | | | | | | | | CREATE PROCEDURE Add info to the error message how to get details about error which happened.
| * | Merge branch '10.4' into 10.5Sujatha2020-09-291-1/+9
| |\ \ | | |/
| | * Merge branch '10.3' into 10.4Sujatha2020-09-281-1/+9
| | |\
| | | * Merge branch '10.2' into 10.3Sujatha2020-09-281-1/+9
| | | |\
| | | | * Ukrainian error text translations added.bb-10.2-ukOleksandr Byelkin2020-09-221-1/+9
| | | | |
* | | | | Merge branch '10.5' into 10.6Oleksandr Byelkin2020-09-021-1/+1
|\ \ \ \ \ | |/ / / /
| * | | | Fix spelling mistake in error messageIan Gilfillan2020-08-211-1/+1
| | | | |
* | | | | Merge 10.5 into 10.6Marko Mäkelä2020-08-121-19/+19
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.4 into 10.5Marko Mäkelä2020-08-101-19/+19
| |\ \ \ \ | | |/ / /
| | * | | Merge 10.3 into 10.4Marko Mäkelä2020-08-101-19/+19
| | |\ \ \ | | | |/ /
| | | * | Merge 10.2 into 10.3Marko Mäkelä2020-08-101-19/+19
| | | |\ \ | | | | |/
| | | | * MDEV-23082: ER_TABLEACCESS_DENIED_ERROR error message is truncated,Rucha Deodhar2020-08-041-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and inaccurately Analysis: The list of all privileges is 118 characters wide. However, the format of error message was: "%-.32s command denied to user...". get_length() sets the maximum width to 32 characters. As a result, only first 32 characters of list of privilege are stored. Fix: Changing the format to "%-.100T..." so that get_length() sets width to 100. Hence, first 100 characters of the list of privilege are stored and the type specifier 'T' appends '...' so that truncation can be seen.
| | | | * MDEV-22726: Add check that one can't change general or slow log to aVlad Lesin2020-06-241-0/+2
| | | | | | | | | | | | | | | | | | | | transactional engine
* | | | | Merge 10.5 into 10.6Marko Mäkelä2020-08-041-1/+1
|\ \ \ \ \ | |/ / / /
| * | | | Fix spelling errorsOtto Kekäläinen2020-07-301-1/+1
| | | | |
* | | | | MDEV-21612 - remove COM_MULTI from server and C/CVladislav Vaintroub2020-07-141-7/+4
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | The COM_MULTI did not take off. No connector is using it. Remove related code from server, and client. If anything it is a step simplification of already-bloated dispatch_command(), and related code.
* | | | MDEV-22844 JSON_ARRAYAGG is limited by group_concat_max_len.Alexey Botchkov2020-06-151-1/+1
| | | | | | | | | | | | | | | | Warning message and function result fixed
* | | | Merge 10.4 into 10.5Marko Mäkelä2020-05-311-177/+177
|\ \ \ \ | |/ / /
| * | | Merge 10.3 into 10.4Marko Mäkelä2020-05-261-177/+177
| |\ \ \ | | |/ /
| | * | Merge 10.2 into 10.3Marko Mäkelä2020-05-251-177/+177
| | |\ \ | | | |/
| | | * MDEV-22545: my_vsnprintf behaves not as in C standardOleksandr Byelkin2020-05-241-178/+178
| | | | | | | | | | | | | | | | Added parameter %T for string which should be visibly truncated.
* | | | Aria will now register it's transactionsMonty2020-05-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MDEV-22531 Remove maria::implicit_commit() MDEV-22607 Assertion `ha_info->ht() != binlog_hton' failed in MYSQL_BIN_LOG::unlog_xa_prepare From the handler point of view, Aria now looks like a transactional engine. One effect of this is that we don't need to call maria::implicit_commit() anymore. This change also forces the server to call trans_commit_stmt() after doing any read or writes to system tables. This work will also make it easier to later allow users to have system tables in other engines than Aria. To handle the case that Aria doesn't support rollback, a new handlerton flag, HTON_NO_ROLLBACK, was added to engines that has transactions without rollback (for the moment only binlog and Aria). Other things - Moved freeing of MARIA_SHARE to a separate function as the MARIA_SHARE can be still part of a transaction even if the table has closed. - Changed Aria checkpoint to use the new MARIA_SHARE free function. This fixes a possible memory leak when using S3 tables - Changed testing of binlog_hton to instead test for HTON_NO_ROLLBACK - Removed checking of has_transaction_manager() in handler.cc as we can assume that as the transaction was started by the engine, it does support transactions. - Added new class 'start_new_trans' that can be used to start indepdendent sub transactions, for example while reading mysql.proc, using help or status tables etc. - open_system_tables...() and open_proc_table_for_Read() doesn't anymore take a Open_tables_backup list. This is now handled by 'start_new_trans'. - Split thd::has_transactions() to thd::has_transactions() and thd::has_transactions_and_rollback() - Added handlerton code to free cached transactions objects. Needed by InnoDB. squash! 2ed35999f2a2d84f1c786a21ade5db716b6f1bbc
* | | | Merge remote-tracking branch 'origin/10.4' into 10.5Alexander Barkov2020-05-191-0/+2
|\ \ \ \ | |/ / /
* | | | MDEV-17812 Use MariaDB in error messages instead of MySQLRasmus Johansson2020-04-081-66/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Changed wording in error messages from MySQL to MariaDB. In cases where the word server could be used instead it was done. Tests that have these errors recorded were updated.
* | | | MDEV-21889 Typo fix: ER_KEY_DOES_NOT_EXISTSAleksey Midenkov2020-04-041-1/+1
| | | | | | | | | | | | | | | | libmariadb revision updated.
* | | | MDEV-16978 Application-time periods: WITHOUT OVERLAPSNikita Malyavin2020-03-311-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * The overlaps check is implemented on a handler level per row command. It creates a separate cursor (actually, another handler instance) and caches it inside the original handler, when ha_update_row or ha_insert_row is issued. Cursor closes on unlocking the handler. * Containing the same key in index means unique constraint violation even in usual terms. So we fetch left and right neighbours and check that they have same key prefix, excluding from the key only the period part. If it doesnt match, then there's no such neighbour, and the check passes. Otherwise, we check if this neighbour intersects with the considered key. * The check does not introduce new error and fails with ER_DUPP_KEY error. This might break REPLACE workflow and should be fixed separately
* | | | unify "partitioning cannot do X" error messagesNikita Malyavin2020-03-311-4/+2
| | | |
* | | | Improve update handler (long unique keys on blobs)Monty2020-03-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MDEV-21606 Improve update handler (long unique keys on blobs) MDEV-21470 MyISAM and Aria start_bulk_insert doesn't work with long unique MDEV-21606 Bug fix for previous version of this code MDEV-21819 2 Assertion `inited == NONE || update_handler != this' - Move update_handler from TABLE to handler - Move out initialization of update handler from ha_write_row() to prepare_for_insert() - Fixed that INSERT DELAYED works with update handler - Give an error if using long unique with an autoincrement column - Added handler function to check if table has long unique hash indexes - Disable write cache in MyISAM and Aria when using update_handler as if cache is used, the row will not be inserted until end of statement and update_handler would not find conflicting rows. - Removed not used handler argument from check_duplicate_long_entries_update() - Syntax cleanups - Indentation fixes - Don't use single character indentifiers for arguments
* | | | Added support for replication for S3Monty2020-03-241-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MDEV-19964 S3 replication support Added new configure options: s3_slave_ignore_updates "If the slave has shares same S3 storage as the master" s3_replicate_alter_as_create_select "When converting S3 table to local table, log all rows in binary log" This allows on to configure slaves to have the S3 storage shared or independent from the master. Other thing: Added new session variable '@@sql_if_exists' to force IF_EXIST to DDL's.
* | | | MDEV-13362: implement --require_secure_transport optionJulius Goryavsky2020-03-121-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, if a user wants to require TLS for every connection made over the network, then every user account on the system needs to be created with "REQUIRE SSL" or one of the other TLS options. Implementing a require_secure_transport system varuable (which, in particular, can be set using the --require_secure_transport=ON command line option) in the MariaDB Server would make it a lot easier to require TLS (or other secure transport) system-wide. This patch implements this new system variable, adds the ability to set it with SQL statements, from the command line and from the configuration file, and also contains improvements for mtr that allow the user to establish non-secure TCP/IP connections (for example, to verify the operation of the new option).
* | | | MDEV-20500: Bad error msg on disabling local infileRahul Anand2020-03-031-1/+4
| | | |
* | | | Revert "MDEV-17554 Auto-create new partition for system versioned tables ↵Sergei Golubchik2020-02-271-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | with history partitioned by INTERVAL/LIMIT" This reverts commit 9894751a2a61ef952ac6ac556fd683e53fc150e2. This reverts commit f707c83fff4fa3f5291684e6226542fdb75bbdeb.
* | | | MDEV-17554 Auto-create new partition for system versioned tables with ↵Aleksey Midenkov2020-02-251-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | MDEV-20051: Add new mode to wsrep_OSU_method in which Galera checks storage ↵Jan Lindström2020-02-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | engine of the effected table Introduced a new wsrep_strict_ddl configuration variable in which Galera checks storage engine of the effected table. If table is not InnoDB (only storage engine currently fully supporting Galera replication) DDL-statement will return error code: ER_GALERA_REPLICATION_NOT_SUPPORTED eng "DDL-statement is forbidden as table storage engine does not support Galera replication" However, when wsrep_replicate_myisam=ON we allow DDL-statements to MyISAM tables. If effected table is allowed storage engine Galera will run normal TOI. This new setting should be for now set globally on all nodes in a cluster. When this setting is set following DDL-clauses accessing tables not supporting Galera replication are refused: * CREATE TABLE (e.g. CREATE TABLE t1(a int) engine=Aria * ALTER TABLE * TRUNCATE TABLE * CREATE VIEW * CREATE TRIGGER * CREATE INDEX * DROP INDEX * RENAME TABLE * DROP TABLE Statements on PROCEDURE, EVENT, FUNCTION are allowed as effected tables are known only at execution. Furthermore, USER, ROLE, SERVER, DATABASE statements are also allowed as they do not really have effected table.
* | | | longer regex error messagesSergei Golubchik2019-12-211-7/+7
| | | |
* | | | Merge 10.4 into 10.5Marko Mäkelä2019-12-161-2/+2
|\ \ \ \ | |/ / /
| * | | Merge branch '10.3' into 10.4Oleksandr Byelkin2019-12-091-2/+2
| |\ \ \ | | |/ /
| | * | Lintian complains on spelling errorFaustin Lammler2019-12-021-2/+2
| | | | | | | | | | | | | | | | | | | | The lintian check complains on spelling error: https://salsa.debian.org/mariadb-team/mariadb-10.3/-/jobs/95739
* | | | MDEV-17553 Enable setting start datetime for interval partitioned history of ↵Aleksey Midenkov2019-11-071-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | system versioned tables * Explicit STARTS syntax * SHOW CREATE * Default STARTS rounding depending on INTERVAL type * Warn when STARTS timestamp is later than query time * Fix uninitialized Lex->create_last_non_select_table under mysql_unpack_partition() Default STARTS rounding depending on INTERVAL type If STARTS clause is omitted, default one is assigned with value derived from query timestamp. The rounding is done on STARTS value depending on INTERVAL type: SECOND: no rounding is done; MINUTE: timestamp seconds is set to 0; HOUR: timestamp seconds and minutes are set to 0; DAY, WEEK, MONTH and YEAR: timestamp seconds, minutes and hours are set to 0 (the date of rotation is kept as current date).
* | | | Merge 10.4 into 10.5Marko Mäkelä2019-09-121-0/+2
|\ \ \ \ | |/ / /
| * | | Merge 10.3 into 10.4Marko Mäkelä2019-09-121-0/+2
| |\ \ \ | | |/ /
| | * | Merge 10.2 into 10.3Marko Mäkelä2019-09-111-0/+2
| | |\ \ | | | |/
| | | * Merge 10.1 into 10.2Marko Mäkelä2019-09-111-0/+2
| | | |\