summaryrefslogtreecommitdiff
path: root/sql/share
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* | | 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
* | | 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
| | |\
| | | * MDEV-16594 ALTER DATA DIRECTORY in PARTITIONS of InnoDB storage does nothing ↵Alexey Botchkov2019-09-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | silently InnoDB intentionally (it's a documented behavior) ignores changing of DATA DIRECTORY and INDEX DIRECTORY for partitions. Though we should issue warning when this happens.
* | | | Merge 10.3 into 10.4Marko Mäkelä2019-08-311-1/+1
|\ \ \ \ | |/ / /
| * | | Merge 10.2 into 10.3Marko Mäkelä2019-08-281-1/+1
| |\ \ \ | | |/ /
| | * | MDEV-19925: Column ... cannot be converted from type 'varchar(20)' to type ↵Sujatha2019-08-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'varchar(20)' Cherry picking: Bug#25135304: RBR: WRONG FIELD LENGTH IN ERROR MESSAGE commit 47bd3f7cf3c8518f62b1580ec65af2ba7ac13b95 Description: ============ In row based replication, when replicating from a table with a field with character set set to UTF8mb3 to the same table with the same field set to character set UTF8mb4 I get a confusing error message: For VARCHAR: VARCHAR(1) 'utf8mb3' to VARCHAR(1) 'utf8mb4' "Column 0 of table 'test.t1' cannot be converted from type 'varchar(3)' to type 'varchar(1)'" Similar issue with CHAR type as well. Issue with respect to BLOB types: For BLOB: LONGBLOB to TINYBLOB - Error message displays incorrect blob type. "Column 0 of table 'test.t1' cannot be converted from type 'tinyblob' to type 'tinyblob'" For BINARY to BINARY - Error message displays incorrect type for master side field. "Column 0 of table 'test.t' cannot be converted from type 'char(1)' to type 'binary(10)'" Similar issue exists for VARBINARY type. It is displayed as 'VARCHAR'. Analysis: ========= In Row based replication charset information is not sent as part of metadata from master to slave. For VARCHAR field its character length is converted into equivalent octets/bytes and stored internally. At the time of displaying the data to user it is converted back to original character length. For example: VARCHAR(2)- utf8mb3 is stored as:2*3 = VARCHAR(6) At the time of displaying it to user VARCHAR(6)- charset utf8mb3:6/3= VARCHAR(2). At present the internally converted octect length is sent from master to slave with out providing the charset information. On slave side if the type conversion fails 'show_sql_type' function is used to get the type specific information from metadata. Since there is no charset information is available the filed type is displayed as VARCHAR(6). This results in confused error message. For CHAR fields CHAR(1)- utf8mb3 - CHAR(3) CHAR(1)- utf8mb4 - CHAR(4) 'show_sql_type' function which retrieves type information from metadata uses (bytes/local charset length) to get actual character length. If slave's chaset is 'utf8mb4' then CHAR(3/4)-->CHAR(0) CHAR(4/4)-->CHAR(1). This results in confused error message. Analysis for BLOB type issue: BLOB's length is represented in two forms. 1. Actual length i.e (length < 256) type= MYSQL_TYPE_TINY_BLOB; (length < 65536) type= MYSQL_TYPE_BLOB; ... 2. packlength - The number of bytes used to represent the length of the blob 1- tinyblob 2- blob ... In row based replication only the packlength is written in the binary log. On the slave side this packlength is interpreted as actual length of the blob. Hence the length is always < 256 and the type is displayed as tiny blob. Analysis for BINARY to BINARY type issue: The character set information is needed to identify a filed's type as char or binary. Since master side character set information is not available on the slave side both binary and char fields are displayed as char. Fix: === For CHAR and VARCHAR fields display their length in octets for both source and target fields. For target field display the charset information if it is relevant. For blob type changed the code to use the packlength and display appropriate blob type in error message. For binary and varbinary fields use the slave side character set as reference to map them to binary or varbinary fields.
| * | | MDEV-18862 Unfortunate error message upon attempt to drop system versioningAleksey Midenkov2019-08-141-2/+0
| | | | | | | | | | | | | | | | Fix error code.
| * | | MDEV-18862 Unfortunate error message upon attempt to drop system versioningAleksey Midenkov2019-08-111-0/+2
| | | | | | | | | | | | | | | | Special case for DROP PERIOD when system fields are implicit.
* | | | Merge branch '10.3' into 10.4Oleksandr Byelkin2019-05-1928-29/+29
|\ \ \ \ | |/ / /
| * | | Merge 10.2 into 10.3Marko Mäkelä2019-05-1427-27/+27
| |\ \ \ | | |/ /
| | * | Merge 10.1 into 10.2Marko Mäkelä2019-05-1327-27/+27
| | |\ \ | | | |/
| | | * Merge branch '5.5' into 10.1Vicențiu Ciorbaru2019-05-1127-27/+27
| | | |\
| | | | * Update FSF AddressVicențiu Ciorbaru2019-05-1127-27/+27
| | | | | | | | | | | | | | | | | | | | * Update wrong zip-code
| * | | | Merge branch '10.2' into 10.3Oleksandr Byelkin2019-05-121-2/+2
| |\ \ \ \ | | |/ / /
| | * | | Merge branch '10.1' into 10.2Oleksandr Byelkin2019-05-041-2/+2
| | |\ \ \ | | | |/ /
| | | * | MDEV-19262 Server error message is unclear if event is created and ↵Vladislav Vaintroub2019-04-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | event_scheduler = DISABLED Change error message.
* | | | | generalize the error messageSergei Golubchik2019-05-181-6/+4
| | | | |
* | | | | MDEV-15966 Behavior for TRUNCATE versioned table is not documented and not ↵Sergei Golubchik2019-05-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | covered by tests * add error for truncation of versioned tables: `ER_TRUNCATE_ILLEGAL_VERS` * make a full table open with `tdc_aquire_share` instead of just `ha_table_exists` check test suites run: main, parts, versioning Closes #785
* | | | | Merge 10.3 into 10.4bb-10.4-supermergejanMarko Mäkelä2019-04-121-1/+1
|\ \ \ \ \ | |/ / / /
| * | | | MDEV-19236 Improve error message for ↵Eugene Kosov2019-04-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE remove a sometimes misleading word INPLACE from error message
* | | | | Merge 10.3 into 10.4Marko Mäkelä2019-04-021-29/+6
|\ \ \ \ \ | |/ / / /
| * | | | Merge branch '10.2' into 10.3Sergei Golubchik2019-03-291-25/+2
| |\ \ \ \ | | |/ / /
| | * | | Merge branch '10.1' into 10.2Sergei Golubchik2019-03-291-25/+2
| | |\ \ \ | | | |/ /
| * | | | MDEV-15951 system versioning by trx id doesn't work with partitioningSergei Golubchik2019-03-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clarify the error message, use the wording from the manual. Closes #870
| * | | | MDEV-15951 system versioning by trx id doesn't work with partitioningNikita Malyavin2019-03-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix partitioning for trx_id-versioned tables. `partition by hash`, `range` and others now work. `partition by system_time` is forbidden. Currently we cannot use row_start and row_end in `partition by`, because insertion of versioned field is done by engine's handler, as well as row_start/row_end's value set up, which is a transaction id -- so it's also forbidden. The drawback is that it's now impossible to use `partition by key()` without parameters for such tables, because it references row_start and row_end implicitly. * add handler::vers_can_native() * drop Table_scope_and_contents_source_st::vers_native() * drop partition_element::find_engine_flag as unused * forbid versioning partitioning for trx_id as not supported * adopt vers tests for trx_id partitioning * forbid any row_end referencing in `partition by` clauses,   including implicit `by key()`
| * | | | Merge 10.2 into 10.3Marko Mäkelä2019-03-271-1/+1
| |\ \ \ \ | | |/ / /
| | * | | Merge 10.1 into 10.2Marko Mäkelä2019-03-271-1/+1
| | |\ \ \ | | | |/ /
| | | * | Merge 10.0 into 10.1Marko Mäkelä2019-03-271-1/+1
| | | |\ \
| | | | * \ Merge 5.5 into 10.0bb-10.0-mergeMarko Mäkelä2019-03-261-1/+1
| | | | |\ \ | | | | | |/
| | | | | * Fix for MDEV-17449, typo in error message (#1146)Chris Calender2019-03-241-1/+1
| | | | | |
* | | | | | Merge 10.3 into 10.4Marko Mäkelä2019-03-251-1/+1
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge 10.2 into 10.3Marko Mäkelä2019-03-251-1/+1
| |\ \ \ \ \ | | |/ / / /
| | * | | | Fix for MDEV-18276, typo in error message + all other occurrences of referingChris Calender2019-03-231-1/+1
| | | | | |
* | | | | | MDEV-18813 PROCEDURE and anonymous blocks silently ignore FETCH GROUP NEXT ROWAlexander Barkov2019-03-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Part#2 (final): rewritting the code to pass the correct enum_sp_aggregate_type to the sp_head constructor, so sp_head never changes its aggregation type later on. The grammar has been simplified and defragmented. This allowed to check aggregate specific instructions right after a routine body has been scanned, by calling new LEX methods: sp_body_finalize_{procedure|function|trigger|event}() Moving some C++ code from *.yy to a few new helper methods in LEX.
* | | | | | MDEV-371 Unique Index for long columnsSergei Golubchik2019-02-221-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | post-merge fixes
* | | | | | MDEV-371 Unique Index for long columnsSachin2019-02-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements engine independent unique hash index. Usage:- Unique HASH index can be created automatically for blob/varchar/test column whose key length > handler->max_key_length() or it can be explicitly specified. Automatic Creation:- Create TABLE t1 (a blob unique); Explicit Creation:- Create TABLE t1 (a int , unique(a) using HASH); Internal KEY_PART Representations:- Long unique key_info will have 2 representations. (lets understand this with an example create table t1(a blob, b blob , unique(a, b)); ) 1. User Given Representation:- key_info->key_part array will be similar to what user has defined. So in case of example it will have 2 key_parts (a, b) 2. Storage Engine Representation:- In this case there will be only one key_part and it will point to HASH_FIELD. This key_part will be always after user defined key_parts. So:- User Given Representation [a] [b] [hash_key_part] key_info->key_part ----^ Storage Engine Representation [a] [b] [hash_key_part] key_info->key_part ------------^ Table->s->key_info will have User Given Representation, While table->key_info will have Storage Engine Representation.Representation can be changed into each other by calling re/setup_keyinfo_hash function. Working:- 1. So when user specifies HASH_INDEX or key_length is > handler->max_key_length(), In mysql_prepare_create_table One extra vfield is added (for each long unique key). And key_info->algorithm is set to HA_KEY_ALG_LONG_HASH. 2. In init_from_binary_frm_image values for hash_keypart is set (like fieldnr , field and flags) 3. In parse_vcol_defs, HASH_FIELD->vcol_info is created. Item_func_hash is used with list of Item_fields, When Explicit length is given by user then Item_left is used to concatenate Item_field values. 4. In ha_write_row/ha_update_row check_duplicate_long_entry_key is called which will create the hash key from table->record[0] and then call ha_index_read_map , if we found duplicated hash , we will compare the result field by field.
* | | | | | MDEV-7597 Expiration of user passwordsRobert Bindar2019-02-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for expiring user passwords. The following statements are extended: CREATE USER user@localhost PASSWORD EXPIRE [option] ALTER USER user@localhost PASSWORD EXPIRE [option] If no option is specified, the password is expired with immediate effect. If option is DEFAULT, global policy applies according to the default_password_lifetime system var (if 0, password never expires, if N, password expires every N days). If option is NEVER, the password never expires and if option is INTERVAL N DAY, the password expires every N days. The feature also supports the disconnect_on_expired_password system var and the --connect-expired-password client option. Closes #1166
* | | | | | MDEV-16975 Application-time periods: ALTER TABLENikita Malyavin2019-02-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * implicit period constraint is hidden and cannot be dropped independently * create...like and create...select support
* | | | | | MDEV-16974 Application-time periods: UPDATENikita Malyavin2019-02-211-4/+6
| | | | | |
* | | | | | MDEV-16973 Application-time periods: DELETENikita Malyavin2019-02-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * inject portion of time updates into mysql_delete main loop * triggered case emits delete+insert, no updates * PORTION OF `SYSTEM_TIME` is forbidden * `DELETE HISTORY .. FOR PORTION OF ...` is forbidden as well
* | | | | | MDEV-17082 Application-time periods: CREATENikita Malyavin2019-02-211-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add syntax `CREATE TABLE ... PERIOD FOR <apptime>` * add table period entity
* | | | | | MDEV-13095 Implement User Account lockingRobert Bindar2019-02-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add server support for user account locking. This patch extends the ALTER/CREATE USER statements for denying a user's subsequent login attempts: ALTER USER user [, user2] ACCOUNT [LOCK | UNLOCK] CREATE USER user [, user2] ACCOUNT [LOCK | UNLOCK] The SHOW CREATE USER statement was updated to display the locking state of an user. Closes #1006
* | | | | | MDEV-7598 Lock user after too many password errorsVladislav Vaintroub2019-01-081-0/+2
| | | | | |
* | | | | | Merge 10.3 into 10.4Marko Mäkelä2018-12-181-2/+2
|\ \ \ \ \ \ | |/ / / / /