summaryrefslogtreecommitdiff
path: root/mysql-test/main
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.7 into 10.8Marko Mäkelä2022-12-1332-66/+417
|\
| * Merge 10.6 into 10.7Marko Mäkelä2022-12-1332-66/+417
| |\
| | * Merge 10.5 into 10.6Marko Mäkelä2022-12-1332-66/+417
| | |\
| | | * Merge 10.4 into 10.5Marko Mäkelä2022-12-1332-67/+315
| | | |\
| | | | * Merge 10.3 into 10.4Marko Mäkelä2022-12-1332-67/+315
| | | | |\
| | | | | * MDEV-30150 ST_GeomFromGeoJSON, 'geometry' before 'type: feature' errorDaniel Black2022-12-092-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The geometry type requires Type:"Feature" but the feature need not be first in the JSON structure. Adjust code to return an error if geometry isn't a JSON object, but continue parsing searching for Type: "Feature" to trigger the geometry parsing. Thanks Derick Magnusen for the bug report.
| | | | | * MDEV-30162 Fix occasional "Permission denied" on Windows caused by buggy 3rd ↵Vladislav Vaintroub2022-12-072-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | party Add retry logic for CreateFile, DeleteFile, or MoveFile when GetLastError() is ERROR_SHARING_VIOLATION.
| | | | | * fix more sporadic failures on main.killSergei Golubchik2022-12-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sometimes `KILL QUERY ID @id` was executed before the previous `send SELECT SLEEP(1000)` has reached the parser. As the statement resets the kill status before execution, the effect of the KILL was ignored.
| | | | | * MDEV-30082 View definition losing brackets changes semantics of the query ↵Sergei Golubchik2022-12-022-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and causes wrong result Item_func_not_all::print() either uses Item_func::print() or directly invokes args[0]->print(). Thus the precedence should be either the one of Item_func or of args[0]. Item_allany_subselect::print() prints args[0], then a comparison op, then a subquery. That is, the precedence should be the one of a comparison.
| | | | | * MDEV-30056 Impossible to export column grantsSergei Golubchik2022-12-026-26/+26
| | | | | |
| | | | | * MDEV-30066 (limit + offset) union all (...) limit = incorrect resultSergei Golubchik2022-12-022-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | select_union_direct::send_data() only sends a record when the LIMIT ... OFFSET clause of the individual select won't skip it. Thus, select_union_direct::send_data() should not do any actions related to a sending a record if the offset of a select isn't reached yet
| | | | | * cleanup: union.testSergei Golubchik2022-12-022-25/+20
| | | | | |
| | | | | * MDEV-28643: view protocol fails due to different column nameOleksandr Byelkin2022-12-022-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | Decent name given to the column.
| | | | | * MDEV-28696 View created as "select b''; " references invalid table(s) or ↵Alexander Barkov2022-12-023-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | column(s) or function(s) or definer/invoker of view lack rights to use them
| | | | | * MDEV-30112 ASAN errors in Item_ident::print / generate_partition_syntaxbb-10.3-midenokAleksey Midenkov2022-12-012-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Like in MDEV-16110 we must release items allocated on thd->mem_root by reopening the table. MDEV-16290 relocated MDEV-16110 fix in 10.5 so it works for MDEV-28576 as well. 10.3 without MDEV-16290 now duplicates this fix.
| | | | | * MDEV-30023 Revoking Privilege on the Column Yields the Errorbb-10.3-vicentiuVicențiu Ciorbaru2022-11-302-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The change from MDEV-29465 exposed a flaw in replace_column_table where again we were not properly updating the column-level bits. replace_table_table was changed in MDEV-29465 to properly update grant_table->init_cols, however replace_column_table still only modified grant_column->rights when the GRANT_COLUMN already existed. This lead to a missmatch between GRANT_COLUMN::init_rights and GRANT_COLUMN::rights, *if* the GRANT_COLUMN already existed. As an example: GRANT SELECT (col1) ... Here: For col1 GRANT_COLUMN::init_rights and GRANT_COLUMN::rights are set to 1 (SELECT) in replace_column_table. GRANT INSERT (col1) ... Here, without this patch GRANT_COLUMN::init_rights is still 1 and GRANT_COLUMN::rights is 3 (SELECT_PRIV | INSERT_PRIV) Finally, if before this patch, one does: REVOKE SELECT (col1) ... replace_table_table will see that init_rights loses bit 1 thus it considers there are no more rights granted on that particular table. This prompts the whole GRANT_TABLE to be removed via the first revoke, when the GRANT_COLUMN corresponding to it should still have init_rights == 2. By also updating replace_column_table to keep init_rights in sync properly, the issue is resolved. Reviewed by <serg@mariadb.com>
| | | | | * [MDEV-30002] Skip bad_startup_options test when running as root (#2344)Robin Newhouse2022-11-291-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 32158be added a new test `bad_startup_options`. This test fails if run as root, which is common on many CI systems. This test should include `not_as_root.inc` so it is skipped, just like all other similar tests in MariaDB. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc.
| | | | | * MDEV-16735 Ensure mysql_upgrade works when changing alter_algorithmChristian Gonzalez2022-11-292-0/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MDEV-16735 describes how mysql_upgrade fails when alter_algorithm is set to a value different than 'DEFAULT'/'COPY'. It was marked as fixed by 0ee0868, but the fix didn't covered the possibility of having the global value of alter_algorithm set to something different than 'DEFAULT'/'COPY'. To ensure that the upgrade process works properly regardless the global value of alter_altorithm, this commit force it's value to 'DEFAULT' (note the quotes) for the mysql_upgrade session. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc.
| | | | | * MDEV-29473 UBSAN: Signed integer overflow: X * Y cannot be represented in ↵Alexander Barkov2022-11-172-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | type 'int' in strings/dtoa.c Fixing a few problems relealed by UBSAN in type_float.test - multiplication overflow in dtoa.c - uninitialized Field::geom_type (and Field::srid as well) - Wrong call-back function types used in combination with SHOW_FUNC. Changes in the mysql_show_var_func data type definition were not properly addressed all around the code by the following commits: b4ff64568c88ab3ce559e7bd39853d9cbf86704a 18feb62feeb833494d003615861b9c78ec008a90 0ee879ff8ac1b80cd9a963015344f5698a81f309 Adding a helper SHOW_FUNC_ENTRY() function and replacing all mysql_show_var_func declarations using SHOW_FUNC to SHOW_FUNC_ENTRY, to catch mysql_show_var_func in the future at compilation time.
| | | | | * MDEV 28970: Add RESET MASTER to clear possible remaining binlog from ↵asklavou2022-11-094-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | previous test
| | | | * | remove redundant test fileWeijun-H2022-11-272-20/+0
| | | | | |
| | | | * | increase max field nameWeijun-H2022-11-272-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Weijun-H <huangweijun1001@gmail.com>
| | | | * | remove redundant test fileWeijun-H2022-11-272-20/+0
| | | | | |
| | | | * | increase max field nameWeijun-H2022-11-272-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Weijun-H <huangweijun1001@gmail.com>
| | | | * | MDEV-27670 Assertion `(cs->state & 0x20000) == 0' failed in ↵Alexander Barkov2022-11-222-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | my_strnncollsp_nchars_generic_8bit Also fixes: MDEV-27768 MDEV-25440: Assertion `(cs->state & 0x20000) == 0' failed in my_strnncollsp_nchars_generic_8bit The "strnncollsp_nchars" virtual function pointer for tis620_thai_nopad_ci was incorrectly initialized to a generic function my_strnncollsp_nchars_generic_8bit(), which crashed on assert. Implementing a tis620 specific function version.
* | | | | | Merge 10.7 into 10.8Marko Mäkelä2022-12-0710-9/+194
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge 10.6 into 10.7Marko Mäkelä2022-12-0710-9/+194
| |\ \ \ \ \ | | |/ / / /
| | * | | | Merge 10.5 into 10.6Marko Mäkelä2022-12-052-0/+56
| | |\ \ \ \ | | | |/ / /
| | | * | | Merge 10.4 into 10.5Jan Lindström2022-11-302-0/+56
| | | | | |
| | * | | | MDEV-29129: Performance regression starting in 10.6: select order by limit ...Sergei Petrunia2022-12-036-9/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The cause of regression was handling for ROWNUM() function. For queries like SELECT ROWNUM() FROM ... ORDER BY ... ROWNUM() should be computed before the ORDER BY. The computation was moved to be before the ORDER BY for any entries in the select list that had RAND_TABLE_BIT set. This had a negative impact on queries in form: SELECT sp_func() FROM t1 ORDER BY ... LIMIT n where sp_func() is NOT declared as DETERMINISTIC (and so has RAND_TABLE_BIT set). The fix is to require evaluation for sorting only for the ROWNUM() function. Functions that just have RAND_TABLE_BIT() can be computed after ORDER BY ... LIMIT is applied. (think about a possible index that satisfies the ORDER BY clause. In that case, the the rows would be read in the needed order and we would stop after reading LIMIT rows, achieving the same effect).
| | * | | | MDEV-28206: SIGSEGV in Item_field::fix_fields when using LEAD...OVERDaniel Black2022-12-022-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | thd->lex->in_sum_func->max_arg_level cannot be set to a bigger value of select->nest_level if select is null.
* | | | | | Merge 10.7 into 10.8Marko Mäkelä2022-11-282-0/+48
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge 10.6 into 10.7Marko Mäkelä2022-11-282-0/+48
| |\ \ \ \ \ | | |/ / / /
| | * | | | Merge 10.5 into 10.6Marko Mäkelä2022-11-282-0/+48
| | |\ \ \ \ | | | |/ / /
| | | * | | MDEV-29760: DROP DATABASE hangs when particular query cache is presentDaniel Black2022-11-262-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the regression introduced in dfb41fddf69ccbca89fd322901f2809bc3bcc0e9. In the restructure of mysql_rm_table_no_locks the early condition of !frm_error that enabled non_tmp_table_deleted, and hence the query cache invalidation, was removed. The query_cache_invalidate1(thd, dbnorm) called after mysql_rm_table_no_locks depends on the query cache removal (for unexamined reasons). Under DROP DATABASE, in mysql_rm_table_no_locks, dont_log_query is true preventing the late setting of non_tmp_table_deleted (which retained one of its purposes as a replication deletion of temporary tables, but not query cache invalidation). The non_temp_tables_count however can still be used to invalidate the query cache.
* | | | | | Merge 10.7 into 10.8Marko Mäkelä2022-11-102-2/+2
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge 10.6 into 10.7Marko Mäkelä2022-11-102-2/+2
| |\ \ \ \ \ | | |/ / / /
| | * | | | Add STATS_PERSISTENT=0 to a testMarko Mäkelä2022-11-102-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes up commit 314ed9f5eccc527654b0a63064561749a7b842f5 and commit 9608773f75e2ca21491ef6825c3616cdc96d1ca5
* | | | | | Merge 10.7 into 10.8Marko Mäkelä2022-11-0910-90/+69
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge 10.6 into 10.7Marko Mäkelä2022-11-0910-88/+68
| |\ \ \ \ \ | | |/ / / /
| | * | | | Merge 10.5 into 10.6Marko Mäkelä2022-11-089-84/+68
| | |\ \ \ \ | | | |/ / /
| | | * | | Merge 10.4 into 10.5Marko Mäkelä2022-11-089-84/+68
| | | |\ \ \ | | | | |/ /
| | | | * | Work around MDEV-24813 in main.rowid_filter_innodb_debugMarko Mäkelä2022-11-083-20/+10
| | | | | | | | | | | | | | | | | | | | | | | | Let us avoid excessive allocation of explicit record locks.
| | | | * | Merge 10.3 into 10.4Marko Mäkelä2022-11-084-64/+38
| | | | |\ \ | | | | | |/
| | | | | * Work around MDEV-24813 in some testsMarko Mäkelä2022-11-084-64/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not creating explicit record locks will speed up the test. Also, disable the use of InnoDB persistent statistics in the test of MDEV-27270 to avoid intermittent failures in 10.6 or later (after commit 9608773f75e2ca21491ef6825c3616cdc96d1ca5) due to the nondeterministic scheduling of STATS_AUTO_PERSISTENT.
| | | | * | Merge branch '10.4' into bb-10.4-releaseOleksandr Byelkin2022-11-072-0/+20
| | | | |\ \
| | | | | * | MDEV-23264 Unique blobs allow duplicate values upon UPDATESachin2022-11-072-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem:- We are able to insert duplicate value in table because cmp_binary_offset is not able to differentiate between NULL and empty string. So check_duplicate_long_entry_key is never called and we don't check for duplicate. Solution Added a if condition with is_null() on field which can differentiate between NULL and empty string.
| | * | | | | MDEV-29504/MDEV-29849 TRUNCATE breaks FOREIGN KEY lockingMarko Mäkelä2022-11-081-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ha_innobase::referenced_by_foreign_key(): Protect the check with dict_sys.freeze(), to prevent races with TRUNCATE TABLE. The test innodb.instant_alter_crash has been adjusted for this additional locking. dict_table_is_referenced_by_foreign_key(): Removed (merged to the only caller). create_table_info_t::create_table(): Ignore missing indexes for FOREIGN KEY constraints if foreign_key_checks=0. create_table_info_t::create_table_update_dict(): Rewritten as a static function. Do not return any error. ha_innobase::create(): When trx!=nullptr and we are operating on a persistent table, do not rollback, commit, or release the data dictionary latch. ha_innobase::truncate(): Protect the entire critical section with an exclusive dict_sys.latch, so that ha_innobase::referenced_by_foreign_key() on referenced tables will return a consistent result. In case of a failure, invoke dict_load_foreigns() to restore also any FOREIGN KEY constraints. ha_innobase::free_foreign_key_create_info(): Define inline. lock_release(): Disregard innodb_evict_tables_on_commit_debug=ON when dict_sys.locked() holds. It would hold when fts_load_stopword() is invoked by create_table_info_t::create_table_update_dict(). dict_sys_t::locked(): Return whether the current thread is holding the exclusive dict_sys.latch. dict_sys_t::frozen_not_locked(): Return whether any thread is holding a shared dict_sys.latch. In the test main.mysql_upgrade, the InnoDB persistent statistics will no longer be recalculated in ha_innobase::open() as part of CHECK TABLE ... FOR UPGRADE. They were deleted earlier in the test. Tested by: Matthias Leich
| * | | | | | Merge branch '10.6' into 10.7Oleksandr Byelkin2022-11-0231-163/+1919
| |\ \ \ \ \ \ | | |/ / / / /
* | | | | | | Merge branch '10.7' into 10.8Oleksandr Byelkin2022-11-0231-163/+1959
|\ \ \ \ \ \ \