summaryrefslogtreecommitdiff
path: root/sql
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.5 into 10.6Marko Mäkelä2021-09-164-14/+28
|\
| * Merge branch '10.4' into 10.5Monty2021-09-153-14/+25
| |\ | | | | | | | | | Fixed also an error in suite/perfschema/t/transaction_nested_events-master.opt
| | * MDEV-23519 Protocol packet - "Original Name" info is showing alias name,Monty2021-09-141-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | instead of original name of the column When doing refactoring of temporary table field creation a mistake was done when copying the column name when creating internal temporary tables. For internal temporary tables we should use the original field name, not the item name (= alias).
| | * MDEV-21613 Failed to open table mysql.wsrep_streaming_log for writingbb-10.4-MDEV-21613Daniele Sciascia2021-09-142-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix sporadic failure for MTR test galera_sr.GCF-1018B. The test sometimes fails due to an error that is logged to the error log unnecessarily. A deterministic test case (included in this patch) shows that the error is loggen when a transaction is BF aborted right before it opens the streaming log table to perform fragment removal. When that happens, the attempt to open the table fails and consequently an error is logged. There is no need to log this error, as an ER_LOCK_DEADLOCK error is returned to the client. Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
| | * Merge branch '10.3' into 10.4Vladislav Vaintroub2021-09-111-1/+1
| | |\
| * | | Improve error messages from Ariatmp-10.5-montyMonty2021-09-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | - Error on commit now returns HA_ERR_COMMIT_ERROR instead of HA_ERR_INTERNAL_ERROR - If checkpoint fails, it will now print out where it failed.
* | | | Merge branch '10.5' into 10.6Vladislav Vaintroub2021-09-111-1/+1
|\ \ \ \ | |/ / / | | | | | | | | | | | | # Conflicts: # appveyor.yml
| * | | Fix Windows warnings and tests for -DPLUGIN_PERFSCHEMA=NOVladislav Vaintroub2021-09-111-0/+4
| | | |
| * | | Merge branch '10.4' into 10.5Vladislav Vaintroub2021-09-111-1/+1
| |\ \ \ | | | | | | | | | | | | | | | | | | | | # Conflicts: # appveyor.yml
| | * \ \ Merge branch '10.3' into 10.4Vladislav Vaintroub2021-09-111-1/+1
| | |\ \ \ | | | |/ / | | |/| / | | | |/
| | | * Merge branch '10.2' into 10.3Vladislav Vaintroub2021-09-111-1/+1
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | # Conflicts: # cmake/os/Windows.cmake # sql/sql_yacc.yy
| | | | * Bison 3.7 - fix "conversion from 'ptrdiff_t' to 'ulong', possible loss of data"Vladislav Vaintroub2021-09-112-4/+4
| | | | |
* | | | | Merge 10.5 into 10.6Marko Mäkelä2021-09-114-5/+26
|\ \ \ \ \ | |/ / / /
| * | | | Backport "Fix generation of bison output for out-of-source builds."to 10.5Vladislav Vaintroub2021-09-112-9/+5
| | | | | | | | | | | | | | | | | | | | Apply 115fec58f16d3c49 to 10.5
| * | | | Merge remote-tracking branch 'upstream/10.4' into 10.5Vicențiu Ciorbaru2021-09-104-5/+26
| |\ \ \ \ | | |/ / /
| | * | | Merge remote-tracking branch 'upstream/10.3' into 10.4Vicențiu Ciorbaru2021-09-093-4/+14
| | |\ \ \ | | | |/ /
| | | * | Merge branch '10.2' into 10.3Vicențiu Ciorbaru2021-09-072-4/+3
| | | |\ \ | | | | |/
| | | | * MDEV-23365: Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())'bb-10.2-MDEV-23365Rucha Deodhar2021-09-061-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | failed upon killed TRUNCATE Note: This is a backport of 1cb4caa66d5fd2a9bc095d68988324b7b358d70f from 10.3 Analysis: Assertion failure happens because less session memory is set and so table can't be reopened. So the statement can't be used. This error goes unreported. Fix: Return the error state.
| | | | * MDEV-26529: binlog.binlog_flush_binlogs_delete_domain fails on RISC-Vbb-10.2-danielblack-MDEV-26529-riscv-test-failDaniel Black2021-09-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Per https://bugs.gentoo.org/807995 The test failed with: CURRENT_TEST: binlog.binlog_flush_binlogs_delete_domain — /tmp/mariadb-10.5.11/mysql-test/suite/binlog/r/binlog_flush_binlogs_delete_domain.result 2021-06-18 18:19:11.000000000 +0800 +++ /tmp/mariadb-10.5.11/mysql-test/suite/binlog/r/binlog_flush_binlogs_delete_domain.reject 2021-09-01 22:55:29.406655479 +0800 @@ -85,6 +85,6 @@ ERROR HY000: The value of gtid domain being deleted ('4294967296') exceeds its maximum size of 32 bit unsigned integer FLUSH BINARY LOGS DELETE_DOMAIN_ID = (4294967295); Warnings: -Warning 1076 The gtid domain being deleted ('4294967295') is not in the current binlog state +Warning 1076 The gtid domain being deleted ('18446744073709551615') is not in the current binlog state DROP TABLE t; RESET MASTER; mysqltest: Result length mismatch ptr_domain_id is a uint32* so explicitly cast this when printing it out. Thanks Marek Szuba for the bug report and testing the patch.
| | | * | MDEV-26362: incorrect nest_level value with INTERSECTbb-10.3-MDEV-26362Oleksandr Byelkin2021-09-052-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | Add DBUG_ASSERT (should be kept in merge) Fix nest_level assignment in LEX::add_unit_in_brackets (should be ignored in merge to 10.4)
| | * | | MDEV-25718 Assertion `transaction.is_streaming()' failedDaniele Sciascia2021-09-061-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Update wsrep-lib which contains the fix * Add deterministic test case that reproduces the assertion Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
* | | | | Fix generation of bison output for out-of-source builds.Vladislav Vaintroub2021-09-082-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure the #line directives contain existing source file sql_yacc.yy. Before the patch #line directive would point out to non-existing path in current build directory.
* | | | | Fixed typo in sql/log_event_server.cc related to ddl xid's.Monty2021-09-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This could only cause an issue if we got a crash at the very end of a DDL log execution of an ALTER TABLE. The possible effect would be that we would get two ALTER TABLE events in the binary log.
* | | | | Errors from failed drop tables where ignored by atomic ddl.Monty2021-09-071-5/+11
| | | | |
* | | | | Merge 10.5 into 10.6Marko Mäkelä2021-09-071-7/+9
|\ \ \ \ \ | |/ / / /
| * | | | Fix a false positive GCC5 warning.Vladislav Vaintroub2021-09-061-7/+9
| | | | |
* | | | | Merge 10.5 into 10.6Marko Mäkelä2021-09-064-29/+56
|\ \ \ \ \ | |/ / / /
| * | | | MDEV-26533 fixup: GCC -WformatMarko Mäkelä2021-09-061-2/+2
| | | | |
| * | | | MDEV-26533 MariaDB 10.5 crashes with key_buffer_size > 4Gb on Windows x64Vladislav Vaintroub2021-09-041-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a side-effect of my_large_malloc() introduction,MDEV-18851 It removed a cast to size_t to variable 'blocks' in multiplication blocks * keycache->key_cache_block_size , creating ulong value instead of correct size_t. Replaced a couple of ulongs with appropriate data type, which is size_t. Also, fixed casts to ulongs in crash handler messages, so that people would not be confused by that, too. Interestingly, aria did not expose the same problem even if it contains copied and pasted code in ma_pagecache, because Aria had some ulongs removed when fixing a similar problem in MDEV-9256.
| * | | | Fix create_background_thd()Vladislav Vaintroub2021-09-021-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow the caller to have current_thd. Also do not store PSI_CALL_get_thread() in the new THD, it is a thread local storage variable that can become invalid any time, we do not control the lifetime of the caller's thread.
| * | | | Added support for ANALYZE TABLE to S3 tablesMonty2021-09-013-26/+61
| | | | | | | | | | | | | | | | | | | | | | | | | Other things - Cleaned up error messages for CHECK, REPAIR and OPTIMIZE
* | | | | fix Binary_string::c_ptr and c_ptr_safeSergei Golubchik2021-09-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | if the Ptr="abc", then str_length=3, and for a C ptr it needs Ptr[3]=0; but it passes str_length+1 (=4) to realloc, and realloc allocates arg_length+1 bytes (that is 5) and does Ptr[arg_length]= 0; (Ptr[4]=0)
* | | | | cleanup: only do work when neededSergei Golubchik2021-09-051-4/+3
| | | | |
* | | | | Fix Windows warnings and tests for -DPLUGIN_PERFSCHEMA=NOVladislav Vaintroub2021-09-051-0/+4
| | | | |
* | | | | Fix warnings from -DPLUGIN_PARTITION=NO, portably.Vladislav Vaintroub2021-09-052-2/+6
| | | | | | | | | | | | | | | | | | | | Also fix Spider's cmake.
* | | | | MDEV-26538 Incorrect error condition check for ReadFile (named pipes)Vladislav Vaintroub2021-09-041-1/+1
| | | | |
* | | | | MDEV-25919: Lock tables before acquiring dict_sys.latchMarko Mäkelä2021-08-312-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit 1bd681c8b3c5213ce1f7976940a7dc38b48a0d39 (MDEV-25506 part 3) we introduced a "fake instant timeout" when a transaction would wait for a table or record lock while holding dict_sys.latch. This prevented a deadlock of the server but could cause bogus errors for operations on the InnoDB persistent statistics tables. A better fix is to ensure that whenever a transaction is being executed in the InnoDB internal SQL parser (which will for now require dict_sys.latch to be held), it will already have acquired all locks that could be required for the execution. So, we will acquire the following locks upfront, before acquiring dict_sys.latch: (1) MDL on the affected user table (acquired by the SQL layer) (2) If applicable (not for RENAME TABLE): InnoDB table lock (3) If persistent statistics are going to be modified: (3.a) MDL_SHARED on mysql.innodb_table_stats, mysql.innodb_index_stats (3.b) exclusive table locks on the statistics tables (4) Exclusive table locks on the InnoDB data dictionary tables (not needed in ANALYZE TABLE and the like) Note: Acquiring exclusive locks on the statistics tables may cause more locking conflicts between concurrent DDL operations. Notably, RENAME TABLE will lock the statistics tables even if no persistent statistics are enabled for the table. DROP DATABASE will only acquire locks on statistics tables if persistent statistics are enabled for the tables on which the SQL layer is invoking ha_innobase::delete_table(). For any "garbage collection" in innodb_drop_database(), a timeout while acquiring locks on the statistics tables will result in any statistics not being deleted for any tables that the SQL layer did not know about. If innodb_defragment=ON, information may be written to the statistics tables even for tables for which InnoDB persistent statistics are disabled. But, DROP TABLE will no longer attempt to delete that information if persistent statistics are not enabled for the table. This change should also fix the hangs related to InnoDB persistent statistics and STATS_AUTO_RECALC (MDEV-15020) as well as a bug that running ALTER TABLE on the statistics tables concurrently with running ALTER TABLE on InnoDB tables could cause trouble. lock_rec_enqueue_waiting(), lock_table_enqueue_waiting(): Do not issue a fake instant timeout error when the transaction is holding dict_sys.latch. Instead, assert that the dict_sys.latch is never being held here. lock_sys_tables(): A new function to acquire exclusive locks on all dictionary tables, in case DROP TABLE or similar operation is being executed. Locking non-hard-coded tables is optional to avoid a crash in row_merge_drop_temp_indexes(). The SYS_VIRTUAL table was introduced in MySQL 5.7 and MariaDB Server 10.2. Normally, we require all these dictionary tables to exist before executing any DDL, but the function row_merge_drop_temp_indexes() is an exception. When upgrading from MariaDB Server 10.1 or MySQL 5.6 or earlier, the table SYS_VIRTUAL would not exist at this point. ha_innobase::commit_inplace_alter_table(): Invoke log_write_up_to() while not holding dict_sys.latch. dict_sys_t::remove(), dict_table_close(): No longer try to drop index stubs that were left behind by aborted online ADD INDEX. Such indexes should be dropped from the InnoDB data dictionary by row_merge_drop_indexes() as part of the failed DDL operation. Stubs for aborted indexes may only be left behind in the data dictionary cache. dict_stats_fetch_from_ps(): Use a normal read-only transaction. ha_innobase::delete_table(), ha_innobase::truncate(), fts_lock_table(): While waiting for purge to stop using the table, do not hold dict_sys.latch. ha_innobase::delete_table(): Implement a work-around for the rollback of ALTER TABLE...ADD PARTITION. MDL_EXCLUSIVE would not be held if ALTER TABLE hits lock_wait_timeout while trying to upgrade the MDL due to a conflicting LOCK TABLES, such as in the first ALTER TABLE in the test case of Bug#53676 in parts.partition_special_innodb. Therefore, we must explicitly stop purge, because it would not be stopped by MDL. dict_stats_func(), btr_defragment_chunk(): Allocate a THD so that we can acquire MDL on the InnoDB persistent statistics tables. mysqltest_embedded: Invoke ha_pre_shutdown() before free_used_memory() in order to avoid ASAN heap-use-after-free related to acquire_thd(). trx_t::dict_operation_lock_mode: Changed the type to bool. row_mysql_lock_data_dictionary(), row_mysql_unlock_data_dictionary(): Implemented as macros. rollback_inplace_alter_table(): Apply an infinite timeout to lock waits. innodb_thd_increment_pending_ops(): Wrapper for thd_increment_pending_ops(). Never attempt async operation for InnoDB background threads, such as the trx_t::commit() in dict_stats_process_entry_from_recalc_pool(). lock_sys_t::cancel(trx_t*): Make dictionary transactions immune to KILL. lock_wait(): Make dictionary transactions immune to KILL, and to lock wait timeout when waiting for locks on dictionary tables. parts.partition_special_innodb: Use lock_wait_timeout=0 to instantly get ER_LOCK_WAIT_TIMEOUT. main.mdl: Filter out MDL on InnoDB persistent statistics tables Reviewed by: Thirunarayanan Balathandayuthapani
* | | | | Merge 10.5 into 10.6Marko Mäkelä2021-08-312-9/+16
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.4 into 10.5Marko Mäkelä2021-08-312-9/+16
| |\ \ \ \ | | |/ / /
| | * | | Merge 10.3 into 10.4Marko Mäkelä2021-08-312-9/+16
| | |\ \ \ | | | |/ /
| | | * | Merge 10.2 into 10.3Marko Mäkelä2021-08-311-3/+1
| | | |\ \ | | | | |/
| | | | * MDEV-26504 THD::copy_db_to() fails to return true if THD::db is nullMarko Mäkelä2021-08-301-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | THD::copy_db_to(): Always return true if the output parameter was left uninitialized. This fixes a regression that was caused by commit 7d0d934ca642e485b2c008727dc20c83e26cce10 (MDEV-16473). MariaDB Server 10.3 and later were unaffected by this bug thanks to commit a7e352b54ddfaf91c92951d605cb02a4ffd2676b. Possibly this bug only affects mysql_list_fields() in the Embedded Server (libmysqld). This bug was found by GCC 11.2.0 in CMAKE_BUILD_TYPE=RelWithDebInfo.
| | | * | MDEV 22785 Crash with prepared statements and NEXTVAL()Michael Widenius2021-08-261-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem was that a PREARE followed by a non prepared statement using DEFAULT NEXT_VALUE() could change table->next_local to point to a not persitent memory aria. The next EXECUTE would then try to use the wrong pointer, which could cause a crash. Fixed by reseting the pointer to it's old value when doing EXECUTE.
| | | * | Fixed compile errors when compiling with HAVE_valgrindMichael Widenius2021-08-241-1/+1
| | | | |
* | | | | Merge 10.5 into 10.6Marko Mäkelä2021-08-2610-29/+78
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.4 into 10.5Marko Mäkelä2021-08-2610-32/+80
| |\ \ \ \ | | |/ / /
| | * | | After-merge fix f84e28c119b495da77e197f7cd18af4048fc3126Marko Mäkelä2021-08-2510-44/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a rebase of the merge, two preceding commits were accidentally reverted: commit 112b23969a30ba6441efa5e22a3017435febfa17 (MDEV-26308) commit ac2857a5fbf851d90171ac55f23385869ee6ba83 (MDEV-25717) Thanks to Daniele Sciascia for noticing this.
* | | | | Merge 10.5 into 10.6Marko Mäkelä2021-08-233-2/+5
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.4 into 10.5Marko Mäkelä2021-08-232-2/+2
| |\ \ \ \ | | |/ / /
| | * | | Merge 10.3 into 10.4Marko Mäkelä2021-08-233-3/+3
| | |\ \ \ | | | |/ /