summaryrefslogtreecommitdiff
path: root/mysql-test
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* MDEV-29636 Assertion `part_share->auto_inc_initialized || ↵Nayuta Yanagisawa2022-12-076-0/+73
| | | | | | | | | | !can_use_for_auto_inc_init()' failed in ha_partition::set_auto_increment_if_higher upon REPLACE with partition pruning The bug is caused by a similar mechanism as MDEV-21027. The function, check_insert_or_replace_autoincrement, failed to open all the partitions on REPLACE SELECT statements and it results in the assertion error.
* dgcov: parsing without dot to get specific versionAnel Husakovic2022-12-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | - Regression introduced 7baf24a0f8e9491a55 for multidigit gcc dump. There is no dot in `dumpversion`. ``` $ gcc -dumpversion 10 ``` Otherwise it will fail and not produce the output ``` Running dgcov Name "IO::Uncompress::Gunzip::GunzipError" used only once: possible typo at ./dgcov.pl line 197. Cannot parse gcc -dumpversion: 9 ``` - The warning `once` is always generated: ``` Running dgcov Name "IO::Uncompress::Gunzip::GunzipError" used only once: possible typo at ./dgcov.pl line 197. <number> ``` Suppresing the line `Name "IO::Uncompress::Gunzip::GunzipError" used only once: possible typo at ./dgcov.pl line 197.` with the patch. - Reviewed by: <>
* dgcov: also remove rpm dependency on IO::Uncompress::GunzipSergei Golubchik2022-12-041-5/+5
| | | | and enable option bundling
* MDEV-26102 followupSergei Golubchik2022-12-022-15/+9
| | | | | | | | | * update README * fix version regex to support versions with two digits * die if the version cannot be parsed * support gcc versions 11+ * require JSON::PP not use, to avoid introducing new rpm dependency into MariaDB-test
* MDEV-26102 dgcov: add support for *.gcda.gcov.json.gz files of gcov 9.1+Anel Husakovic2022-12-021-18/+36
| | | | | | | - Script covers situation for gcov (gcc) < 9 with non-json format of generated files as well as for gcov (gcc) >=8 with json generated format Reviewed by: serg@mariadb.com
* 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.
* try harder to reject not strictly deterministic vcols in indexes/storedSergei Golubchik2022-12-022-0/+28
| | | | | | detect non-determinism in vcol of vcol, like: create table t1 (a int, b real as (rand()), c real as (b) stored);
* MDEV-30016 Virtual columns do not support autoincrement columnsSergei Golubchik2022-12-026-6/+49
| | | | change vcol_upgrade test to use stored gcols
* cleanup: VCOL_NOT_VIRTUAL->VCOL_NEXTVALSergei Golubchik2022-12-023-0/+10
| | | | | | | | | | | | rename to stress that is a specific hack for Item_func_nextval and should not be used for other items. If a vcol uses Item_func_nextval, a corresponding table for the sequence should be added to the prelocking list (in that sense NEXTVAL is not simply a function, but more like a subquery), see add_internal_tables() in DML_prelocking_strategy::handle_table(). At the moment it is only implemented for DEFAULT, not for GENERATED ALWAYS AS, thus the VCOL_NEXTVAL hack.
* MDEV-30056 Impossible to export column grantsSergei Golubchik2022-12-0220-89/+89
|
* 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.
* Add a global suppression for O_DIRECT failuresMarko Mäkelä2022-11-292-6/+1
| | | | Fixes up commit b8ad6fbd95830b61d282abc1167300fff261be7e
* Fixed warning from innodb.create_isl_with_direct if have_symlink is disabledbb-10.3-montyMonty2022-11-291-6/+5
|
* Enable valgrind for replication testMonty2022-11-294-2/+8
| | | | | | | The following tests are disabled when running --valgrding without --big: - rpl.rpl_ssl - rpl.rpl_semi_sync_event - All encryption test (which includes have_file_key_management.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-29348 rpl.rpl_rewrt_db test fails with [gdb,manual-gdb] with wrong parsingAnel Husakovic2022-11-281-1/+1
| | | | | Reviewer: <serg@mariadb.com> Closes PR #2244
* MDEV-29169 Using MATCH returns NULL for Virtual ColumnNikita Malyavin2022-11-232-0/+33
| | | | | | | Virtual column values are updated in handler in reading commands, like ha_index_next, etc. This was missing for ha_ft_read. handler::ha_ft_read: add table->update_virtual_fields() call
* 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-29977 Memory leak in row_log_table_apply_updateThirunarayanan Balathandayuthapani2022-11-152-4/+37
| | | | | | - InnoDB fails to free the persistent cursor for the clustered index when InnoDB replays the update operation on the table that is being rebuilt.
* Clean up file load.in in a testMarko Mäkelä2022-11-141-0/+1
| | | | | | | | This fixes the following test invocation: ./mtr --no-reorder parts.partition_special_myisam parts.partition_debug This was broken ever since afd4b25d8a0ab1447d37033a377ee05a03314d44 a.k.a. mysql/mysql-server@bde21e58108a1f311d15088c50414bb43ab45d62
* MDEV-27882 Innodb - recognise MySQL-8.0 innodb flags and give a specific ↵Daniel Black2022-11-1114-13/+127
| | | | | | | | | | | | | | | | | | | | | | | error message Per fsp0types.h, SDI is on tablespace flags position 14 where MariaDB stores its pagesize. Flag at position 13, also in MariaDB pagesize flags, is a MySQL encryption flag. These are checked only if fsp_flags_is_valid fails, so valid MariaDB pages sizes don't become errors. The error message "Cannot reset LSNs in table" was rather specific and not always true to replaced with more generic error. ALTER TABLE tbl IMPORT TABLESPACE now reports Unsupported on MySQL tablespace (rather than index corrupted) along with a server error message. MySQL innodb Errors are with with UNSUPPORTED rather than CORRUPTED to avoid user anxiety. Reviewer: Marko Mäkelä
* MDEV-10087 mysqld_update()/mysql_delete() continues execution even after ↵Vlad Lesin2022-11-092-0/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | subquery with JOIN gets error from storage engine The issue is that record_should_be_deleted() returns true in mysql_delete() even if sub-select with join gets error from storage engine when DELETE FROM ... WHERE ... IN (SELECT ...) statement is executed. The same is true for mysql_update() where select->skip_record() returns true even if sub-select with join gets error from storage engine. In the test case if sub-select is chosen as deadlock victim the whole transaction is rolled back during sub-select execution, but mysql_delete()/mysql_update() continues transaction execution and invokes table->delete_row() as record_should_be_deleted() wrongly returns true in mysql_delete() and table->update_row() as select->skip_record(thd) wrongly returns 1 for mysql_update(). record_should_be_deleted() wrogly returns true because thd->is_error() returns false SQL_SELECT::skip_record() invoked from record_should_be_deleted(). It's supposed that THD error should be set in rr_handle_error() called from rr_sequential() during sub-select JOIN::exec_inner() execution. But rr_handle_error() does not set THD error because READ_RECORD::print_error is not set in JOIN_TAB::read_record. READ_RECORD::print_error should be initialized in init_read_record()/init_read_record_idx(). But make_join_readinfo() does not invoke init_read_record()/init_read_record_idx() for JOIN_TAB::read_record. The fix is to set JOIN_TAB::read_record.print_error in make_join_readinfo(), i.e. in the same place where JOIN_TAB::read_record.table is set. Reviewed by Sergey Petrunya.
* MDEV 28970: Add RESET MASTER to clear possible remaining binlog from ↵asklavou2022-11-0912-6/+12
| | | | previous test
* MDEV-29856 heap-use-after-poison in row_merge_spatial_rows() w/ column prefixMarko Mäkelä2022-11-082-0/+22
| | | | | | | | | | spatial_index_info: Replaces index_tuple_info_t. Always take a memory heap as a parameter to the member functions. Remove pointer indirection for m_dtuple_vec. spatial_index_info::add(): Duplicate any PRIMARY KEY fields that would point to within ext->buf because that buffer will be allocated in a shorter-lifetime memory heap.
* MDEV-22512: Disable frequently failing testsMarko Mäkelä2022-11-082-1/+2
| | | | | | | | | InnoDB crash recovery can run out of memory before commit 50324ce62448f284522ee1e3be24d8f5ba3bf904 in MariaDB Server 10.5. Let us disable some frequently failing recovery tests in earlier versions.
* 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.3' into bb-10.3-releaseOleksandr Byelkin2022-11-073-0/+39
|\
| * MDEV-27121 mariabackup incompatible with disabled dedicated undo log ↵Thirunarayanan Balathandayuthapani2022-11-073-0/+39
| | | | | | | | | | | | | | tablespaces - mariabackup fails to assign srv_undo_space_id_start when the dedicated undo tablespaces are disabled
* | MDEV-29926: ASAN heap-use-after-free in Explain_query::~Explain_querymariadb-10.3.37Oleksandr Byelkin2022-11-027-0/+80
|/ | | | Make sure that EXPLAIN object allocated on runtime arena.
* MDEV-26161 crash in Gis_point::calculate_haversineAlexey Botchkov2022-10-262-0/+8
| | | | More checks for bad geometry data added.
* MDEV-26161 crash in Gis_point::calculate_haversineSergei Golubchik2022-10-252-0/+10
| | | | return an error on invalid gis data
* MDEV-29490 Renaming internally used client API to avoid name conflictsLawrin Novitsky2022-10-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | with C/C. The patch introduces mariadb_capi_rename.h which is included into mysql.h. The hew header contains macro definitions for the names being renamed. In versions 10.6+(i.e. where sql service exists) the renaming condition in the mariadb_capi_rename.h should be added with && !defined(MYSQL_DYNAMIC_PLUGIN) and look like The patch also contains removal of mysql.h from the api check. Disabling false_duper-6543 test for embedded. ha_federated.so uses C API. C API functions are being renamed in the server, but not renamed in embedded, since embedded server library should have proper C API, as expected by programs using it. Thus the same ha_federated.so cannot work both for server and embedded server library. As all federated tests are already disabled for embedded, federated isn't supposed to work for embedded anyway, and thus the test is being disabled.
* MDEV-29811 server advertises ssl even if it's unusable.Vladislav Vaintroub2022-10-252-0/+20
| | | | | | Abort startup, if SSL setup fails. Also, for the server always check that certificate matches private key (even if ssl_cert is not set, OpenSSL will try to use default one)
* MDEV-16549 Server crashes in Item_field::fix_fields on query with view and ↵Oleksandr Byelkin2022-10-242-0/+36
| | | | | | | subquery, Assertion `context' failed, Assertion `field' failed Add one-table-resolve context for items created with an aim of switching to temporary table because then it can be cloned in push-down-condition.
* MDEV-14983 Wrong error message with SET sql_mode=sha2(ucs2_value)Alexander Barkov2022-10-242-0/+26
| | | | The problem was fixed earlier. Adding an MTR test only.
* MDEV-29851 Cached role privileges are not invalidated when neededSergei Golubchik2022-10-222-0/+55
| | | | GRANT ROLE can update db-level privileges -> must invalidate acl_cache
* cleanup: rename test fileSergei Golubchik2022-10-222-0/+14
|
* MDEV-29678 Valgrind/MSAN uninitialised value errors upon PS with ALTER under ↵Daniel Black2022-10-222-0/+10
| | | | | | | | ONLY_FULL_GROUP_BY st_select_lex::init_query is called in the exectuion of EXECUTE IMMEDIATE 'alter table ...'. so reset the initialization at the same point we set join= 0.
* MDEV-23160: SIGSEGV in Explain_node::print_explain_for_children on UNION SELECTSergei Petrunia2022-10-212-0/+77
| | | | | | | | | | | | | | | | | | | | | | | | and also MDEV-25564, MDEV-18157. Attempt to produce EXPLAIN output caused a crash in Explain_node::print_explain_for_children. The cause of this was that an Explain_node (actually a derived) had a link to child select#N, but there was no query plan present for select#N. The query plan wasn't present because the subquery was eliminated. - Either it was a degenerate subquery like "(SELECT 1)" in MDEV-25564. - Or it was a subquery in a UNION subquery's ORDER BY clause: col IN (SELECT ... UNION SELECT ... ORDER BY (SELECT FROM t1)) In such cases, legacy code structure in subquery/union processing code(*) makes it hard to detect that the subquery was eliminated, so we end up with EXPLAIN data structures (Explain_node::children) having dangling links to child subqueries. Do make the checks and don't follow the dangling links. (In ideal world, we should not have these dangling links. But fixing the code (*) would have high risk for the stable versions).
* MDEV-29778 Having Unique index interference with MATCH from a FULLTEXTThirunarayanan Balathandayuthapani2022-10-212-0/+21
| | | | | | InnoDB fails to fetch FTS_DOC_ID if the select query uses secondary index. So always do extra lookup on clustered index in case of fts query
* MDEV-25343 Error log message not helpful when filekey is too longkurt2022-10-219-0/+59
| | | | | | | | Add a test related to the Encrypted Key File by following instructions in kb example https://mariadb.com/kb/en/file-key-management-encryption-plugin/#creating-the-key-file Reviewed by Daniel Black (with minor formatting and re-org of duplicate close(f) calls).
* MDEV-19569 Assertion `table_list->table' failed in find_field_in_table_ref.Alexey Botchkov2022-10-192-0/+175
| | | | | | Disallow subqueries in The PARTITIN BY INTERVAL syntax. Fix various interval types that now fail as they break syntax in the par file.