summaryrefslogtreecommitdiff
path: root/mysql-test/main
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-18323 Convert MySQL JSON type to MariaDB TEXT in mysql_upgradeVicențiu Ciorbaru2020-10-285-0/+430
| | | | | | | | | | | | | | | | | This patch solves two key problems. 1. There is a type number clash between MySQL and MariaDB. The number 245, used for MariaDB Virtual Fields is the same as MySQL's JSON. This leads to corrupt FRM errors if unhandled. The code properly checks frm table version number and if it matches 5.7+ (until 10.0+) it will assume it is dealing with a MySQL table with the JSON datatype. 2. MySQL JSON datatype uses a proprietary format to pack JSON data. The patch introduces a datatype plugin which parses the format and convers it to its string representation. The intended conversion path is to only use the JSON datatype within ALTER TABLE <table> FORCE, to force a table recreate. This happens during mysql_upgrade or via a direct ALTER TABLE <table> FORCE.
* MDEV-24015: SQL Error (1038): Out of sort memory when enough memory for the ↵Varun Gupta2020-10-282-0/+141
| | | | | | | | | | | | | | sort buffer is provided For a correlated subquery filesort is executed multiple times. During each execution, sortlength() computed total sort key length in Sort_keys::sort_length, without resetting it first. Eventually Sort_keys::sort_length got larger than @@sort_buffer_size, which caused filesort() to be aborted with error. Fixed by making sortlength() to compute lengths only during the first invocation. Subsequent invocations return pre-computed values.
* MDEV-23437 Item_func_json_objectagg::print is not implemented.Alexey Botchkov2020-10-242-0/+9
| | | | Fix the Item_func_json_objectagg::fix_fields to save the orig_args.
* Merge 10.4 to 10.5Marko Mäkelä2020-10-2243-101/+1211
|\
| * Merge 10.3 into 10.4Marko Mäkelä2020-10-2223-95/+550
| |\
| | * Merge 10.2 into 10.3Marko Mäkelä2020-10-2229-89/+692
| | |
| | * MDEV-23445: LIMIT ROWS EXAMINED throws error in Debug build onlyRucha Deodhar2020-10-201-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | Analysis: When we reach the maximum limit to examine rows killed_state is set as ABORT. But this isn't an actual error and we still return TRUE. This eventually sets error as UNKNOWN ERROR. Fix: Check if need to stop execution by checking the killed state. If we have to abort it, return false because this isn't an actual error.
| | * Merge branch '10.2' into 10.3Sujatha2020-09-281-2/+2
| | |
| * | MDEV-20945: BACKUP UNLOCK + FTWRL assertion failureRinat Ibragimov2020-10-224-0/+241
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MDEV-20945: BACKUP UNLOCK + FTWRL assertion failure | SIGSEGV in I_P_List from MDL_context::release_lock on INSERT w/ BACKUP LOCK (on optimized builds) | Assertion `ticket->m_duration == MDL_EXPLICIT' failed BACKUP LOCK behavior is modified so it won't be used wrong: - BACKUP LOCK should commit any active transactions. - BACKUP LOCK should not be allowed in stored procedures. - When BACKUP LOCK is active, don't allow any DDL's for that connection. - FTWRL is forbidden on the same connection while BACKUP LOCK is active. Reviewed-by: monty@mariadb.com
| * | MDEV-22761: innodb row_search_idx_cond_check handle CHECK_ABORTED_BY_USERSergei Petrunia2020-10-1410-5/+236
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Part #2: - row_search_mvcc() should return DB_INTERRUPTED when it got - Move the sync point from innodb internals to handler_rowid_filter_check() where other storage engines can use it too - Add a similar syncpoint for the ICP check. - Add a bigger test and test coverage for Rowid Filter with MyISAM - Add test coverage for killed-during-ICP-check scenario
| * | MDEV-22761: innodb row_search_idx_cond_check handle CHECK_ABORTED_BY_USERDaniel Black2020-10-142-0/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | handler_rowid_filter_check can return CHECK_ABORTED_BY_USER. All the functions that call row_search_idx_cond_check handle the CHECK_ABORTED_BY_USER return value. So return it rather than generating an error. This incorrect handling was introduced in MDEV-21794 (8d85715d507d). Reviewer: Marko Mäkelä
| * | MDEV-23518 Syntax error in ond SP results in misleading message on SHOW ↵Oleksandr Byelkin2020-10-036-8/+119
| | | | | | | | | | | | | | | | | | CREATE PROCEDURE Add info to the error message how to get details about error which happened.
* | | MDEV-23852 alter table rename column to uppercase doesn't workAleksey Midenkov2020-10-202-0/+35
| | | | | | | | | | | | | | | Case-sensitive compare to detect column name case change in inplace alter rename.
* | | Merge branch '10.4' into 10.5Sujatha2020-09-293-2/+37
|\ \ \ | |/ /
| * | Reverted wrong patch for mysql_upgradeMonty2020-09-251-2/+2
| | | | | | | | | | | | | | | The original code was correct. mysql_upgrade calls the mysql client to talk with MariaDB. It doesn't call itself!
| * | MDEV-23318 Assertion `cache_empty(keycache)' failed in ↵Monty2020-09-252-0/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | prepare_resize_simple_key_cache The reason was that during MyISAM parallel repair two threads used the same changed TABLE object to compute virtual columns Fixed by adding a mutex in compute_vcols()
| * | MDEV-21470 ASAN heap-use-after-free in my_hash_sort_binMonty2020-09-252-0/+35
| | | | | | | | | | | | | | | | | | | | | The problem was that the server was calling virtual functions on a record that was not initialized with new data. This happened when fill_record() was aborted in the middle because an error in save_val() or save_in_field()
* | | Merge 10.4 into 10.5Marko Mäkelä2020-09-237-2/+75
|\ \ \ | |/ /
| * | Merge 10.3 into 10.4Marko Mäkelä2020-09-225-2/+60
| |\ \ | | |/
| | * Merge 10.2 into 10.3Marko Mäkelä2020-09-225-2/+56
| | |
| * | Merge 10.3 into 10.4Marko Mäkelä2020-09-212-0/+15
| |\ \ | | |/
| | * MDEV-23741: Fix the resultMarko Mäkelä2020-09-211-1/+1
| | |
| | * MDEV-23741 Windows : error when renaming file in ALTER TABLEVladislav Vaintroub2020-09-172-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The presumed reason for the error is that the file was opened by 3rd party antivirus or backup program, causing ERROR_SHARING_VIOLATION on rename. The fix, actually a workaround, is to retry MoveFileEx couple of times before finally giving up. We expect 3rd party programs not to hold file for extended time.
* | | MDEV-23767: IN-to-subquery conversion is not visible in optimizer tracebb-10.5-mdev23767Sergei Petrunia2020-09-202-0/+124
| | | | | | | | | | | | Add the printout
* | | MDEV-23549 CREATE fails after DROP without FRMAleksey Midenkov2020-09-072-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | Related to 7c2ba9e: ha_table_exists() is replaced by dd_frm_type(). ha_table_exists() checked the existence of share and that succeeded to enter the execution branch of ha_delete_table() where tdc_remove_table() was called. Now it is skipped because dd_frm_type() returns TABLE_TYPE_UNKNOWN. Fix it by calling tdc_remove_table() in this case as well.
* | | MDEV-23680 Assertion `data' failed in crcr32_calc_pclmulqdqVladislav Vaintroub2020-09-072-0/+11
| | | | | | | | | | | | Fix DBUG_ASSERT
* | | Merge 10.4 into 10.5Marko Mäkelä2020-09-0417-669/+755
|\ \ \ | |/ /
| * | Merge 10.3 into 10.4Marko Mäkelä2020-09-0312-669/+558
| |\ \ | | |/
| | * Merge 10.2 into 10.3Marko Mäkelä2020-09-0310-652/+495
| | |
| | * MDEV-16372 ER_BASE64_DECODE_ERROR upon replaying binary log via mysqlbinlog ↵Andrei Elkin2020-08-312-16/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --verbose (This commit is for 10.3 and upper branches) In case of a pattern of non-STMT_END-marked Rows-log-event (A) followed by a STMT_END marked one (B) mysqlbinlog mixes up the base64 encoded rows events with their pseudo sql representation produced by the verbose option: BINLOG ' base64 encoded data for A ### verbose section for A base64 encoded data for B ### verbose section for B '/*!*/; In effect the produced BINLOG '...' query is not valid and is rejected with the error. Examples of this way malformed BINLOG could have been found in binlog_row_annotate.result that gets corrected with the patch. The issue is fixed with introduction an auxiliary IO_CACHE to hold on the verbose comments until the terminal STMT_END event is found. The new cache is emptied out after two pre-existing ones are done at that time. The correctly produced output now for the above case is as the following: BINLOG ' base64 encoded data for A base64 encoded data for B '/*!*/; ### verbose section for A ### verbose section for B Thanks to Alexey Midenkov for the problem recognition and attempt to tackle, and to Venkatesh Duggirala who produced a patch for the upstream whose idea is exploited here, as well as to MDEV-23077 reporter LukeXwang who also contributed a piece of a patch aiming at this issue.
| * | Make rowid_filter_innodb test stableSergei Petrunia2020-09-033-0/+13
| | | | | | | | | | | | It was failing on mac-1012-bintar.
| * | MDEV-23094: Multiple calls to a Stored Procedure from another Stored ↵bb-10.4-MDEV-23094Oleksandr Byelkin2020-08-312-0/+186
| | | | | | | | | | | | | | | | | | | | | | | | Procedure crashes server Added system-SELECT to IF/WHILE/REPET/FOR for correct subqueries connecting. Added control of system/usual selects for correct error detection.
* | | Merge 10.4 into 10.5Marko Mäkelä2020-08-264-0/+81
|\ \ \ | |/ /
| * | Merge 10.3 into 10.4Marko Mäkelä2020-08-264-0/+81
| |\ \ | | |/
| | * MDEV-18335: Assertion `!error || error == 137' failed in ↵Varun Gupta2020-08-262-0/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | subselect_rowid_merge_engine::init When duplicates are removed from a table using a hash, if the record is a duplicate it is marked as deleted. The handler API check if the record is deleted and send an error flag HA_ERR_RECORD_DELETED. When we scan over the table if the thread is not killed then we skip the records marked as HA_ERR_RECORD_DELETED. The issue here is when a query is aborted by a user (this is happening when the LIMIT for ROWS EXAMINED is exceeded), the scan over the table does not skip the records for which HA_ERR_RECORD_DELETED is sent. It just returns an error flag HA_ERR_ABORTED_BY_USER. This error flag is not checked at the upper level and hence we hit the assert. If the query is aborted by the user we should just skip reading rows and return control to the upper levels of execution.
| | * MDEV-23467 SIGSEGV in fill_record/fill_record_n_invoke_before_triggers on ↵Aleksey Midenkov2020-08-252-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | INSERT DELAYED Field::make_new_field() resets invisible property (needed for "CREATE .. SELECT" f.ex.). Recover invisible property in Delayed_insert::get_local_table() (unireg_check works by the same principle).
* | | Merge remote-tracking branch 'origin/10.4' into 10.5Alexander Barkov2020-08-222-0/+182
|\ \ \ | |/ /
| * | MDEV-23525 Wrong result of MIN(time_expr) and MAX(time_expr) with GROUP BYAlexander Barkov2020-08-222-0/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: When calculatung MIN() and MAX() in a query with GROUP BY, like this: SELECT MIN(time_expr), MAX(time_expr) FROM t1 GROUP BY i; the code in Item_sum_min_max::update_field() erroneosly used string format comparison, therefore '100:20:30' was considered as smaller than '10:20:30'. Fix: 1. Implementing low level "native" related methods in class Time: Time::Time(const Native &native) - convert native to Time Time::to_native(Native *to, uint decimals) - convert Time to native The "native" binary representation for TIME is equal to the binary data format of Field_timef, which is used to store TIME when mysql56_temporal_format is ON (default). 2. Implementing Type_handler_time_common "native" related methods: Type_handler_time_common::cmp_native() Type_handler_time_common::Item_val_native_with_conversion() Type_handler_time_common::Item_val_native_with_conversion_result() Type_handler_time_common::Item_param_val_native() 3. Implementing missing "native representation" related methods in Field_time and Field_timef: Field_time::store_native() Field_time::val_native() Field_timef::store_native() Field_timef::val_native() 4. Implementing missing "native" related methods in all Items that can have the TIME data type: Item_timefunc::val_native() Item_name_const::val_native() Item_time_literal::val_native() Item_cache_time::val_native() Item_handled_func::val_native() 5. Marking Type_handler_time_common as "native ready". So now Item_sum_min_max::update_field() calculates values using min_max_update_native_field(), which uses native binary representation rather than string representation. Before this change, only the TIMESTAMP data type used native representation to calculate MIN() and MAX(). Benchmarks (see more details in MDEV): This change not only fixes the wrong result, but also makes a "SELECT .. MAX.. GROUP BY .." query faster: # TIME(0) CREATE TABLE t1 (id INT, time_col TIME) ENGINE=HEAP; INSERT INTO t1 VALUES (1,'10:10:10'); -- repeat this 1m times SELECT id, MAX(time_col) FROM t1 GROUP BY id; MySQL80: 0.159 sec 10.3: 0.108 sec 10.4: 0.094 sec (fixed) # TIME(6): CREATE TABLE t1 (id INT, time_col TIME(6)) ENGINE=HEAP; INSERT INTO t1 VALUES (1,'10:10:10.999999'); -- repeat this 1m times SELECT id, MAX(time_col) FROM t1 GROUP BY id; My80: 0.154 10.3: 0.135 10.4: 0.093 (fixed)
* | | Merge 10.4 into 10.5Marko Mäkelä2020-08-214-5/+5
|\ \ \ | |/ /
| * | Merge 10.3 into 10.4Marko Mäkelä2020-08-214-5/+5
| |\ \ | | |/
| | * Merge 10.2 into 10.3Marko Mäkelä2020-08-214-5/+5
| | |
* | | Merge 10.4 into 10.5Marko Mäkelä2020-08-201-0/+6
|\ \ \ | |/ /
| * | Merge 10.3 into 10.4Marko Mäkelä2020-08-201-0/+6
| |\ \ | | |/
| | * Merge 10.2 into 10.3Marko Mäkelä2020-08-201-0/+6
| | |
* | | Merge 10.4 into 10.5Marko Mäkelä2020-08-142-0/+9
|\ \ \ | |/ /
| * | Merge 10.3 into 10.4, except MDEV-22543Marko Mäkelä2020-08-132-0/+9
| |\ \ | | |/ | | | | | | Also, fix GCC -Og -Wmaybe-uninitialized in run_backup_stage()
| | * Merge 10.2 into 10.3Marko Mäkelä2020-08-132-0/+9
| | |
* | | Merge 10.4 into 10.5Marko Mäkelä2020-08-112-8/+13
|\ \ \ | |/ /
| * | Merge 10.3 into 10.4Marko Mäkelä2020-08-112-8/+13
| |\ \ | | |/
| | * Work around MDEV-23445 in the MDEV-14836 test caseMarko Mäkelä2020-08-113-5/+27
| | |