summaryrefslogtreecommitdiff
path: root/sql
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-28958 Crash when checking whether condition can be pushed into viewbb-10.8-igorIgor Babaev2023-03-141-7/+16
| | | | | | | | | | Do not set any flags in the items for constant subformulas TRUE/FALSE when checking pushability of a formula into a view. Occurrences of these subformulas can be ignored when checking pushability of the formula. At the same time the items used for these constants became immutable starting from version 10.7. Approved by Oleksandr Byelkin <sanja@mariadb.com>
* Merge 10.6 into 10.8Marko Mäkelä2023-03-069-28/+49
|\
| * Merge 10.5 into 10.6Marko Mäkelä2023-03-061-1/+1
| |\
| | * Fix GCC 5.3.1 -Wsign-compareMarko Mäkelä2023-03-061-1/+1
| | | | | | | | | | | | This fixes up commit 57c526ffb852fb027e25fdc77173d45bdc60b8a2
| * | Merge 10.5 into 10.6Marko Mäkelä2023-02-289-31/+51
| |\ \ | | |/
| | * Added detection of memory overwrite with multi_mallocbb-10.5-montyMonty2023-02-279-38/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch also fixes some bugs detected by valgrind after this patch: - Not enough copy_func elements was allocated by Create_tmp_table() which causes an memory overwrite in Create_tmp_table::add_fields() I added an ASSERT() to be able to detect this also without valgrind. The bug was that TMP_TABLE_PARAM::copy_fields was not correctly set when calling create_tmp_table(). - Aria::empty_bits is not allocated if there is no varchar/char/blob fields in the table. Fixed code to take this into account. This cannot cause any issues as this is just a memory access into other Aria memory and the content of the memory would not be used. - Aria::last_key_buff was not allocated big enough. This may have caused issues with rtrees and ma_extra(HA_EXTRA_REMEMBER_POS) as they would use the same memory area. - Aria and MyISAM didn't take extended key parts into account, which caused problems when copying rec_per_key from engine to sql level. - Mark asan builds with 'asan' in version strihng to detect these in not_valgrind_build.inc. This is needed to not have main.sp-no-valgrind fail with asan.
| | * Fix clang -Winconsistent-missing-overrideMarko Mäkelä2023-02-161-1/+1
| | |
* | | Merge 10.6 into 10.8Marko Mäkelä2023-02-164-10/+9
|\ \ \ | |/ /
| * | Merge 10.5 into 10.6Marko Mäkelä2023-02-161-4/+2
| |\ \ | | |/
| | * MDEV-30333 Wrong result with not_null_range_scan and LEFT JOIN with empty tableMonty2023-02-151-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was a bug in JOIN::make_notnull_conds_for_range_scans() when clearing TABLE->tmp_set, which was used to mark fields that could not be null. This function was only used if 'not_null_range_scan=on' is set. The effect was that tmp_set contained a 'random value' and this caused the optimizer to think that some fields could not be null. FLUSH TABLES clears tmp_set and because of this things worked temporarily. Fixed by clearing tmp_set properly.
| * | MDEV-30324: Wrong result upon SELECT DISTINCT ... WITH TIESVicențiu Ciorbaru2023-02-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | WITH TIES would not take effect if SELECT DISTINCT was used in a context where an INDEX is used to resolve the ORDER BY clause. WITH TIES relies on the `JOIN::order` to contain the non-constant fields to test the equality of ORDER BY fiels required for WITH TIES. The cause of the problem was a premature removal of the `JOIN::order` member during a DISTINCT optimization. This lead to WITH TIES code assuming ORDER BY only contained "constant" elements. Disable this optimization when WITH TIES is in effect. (side-note: the order by removal does not impact any current tests, thus it will be removed in a future version) Reviewed by: monty@mariadb.org
| * | Whitespace fixVicențiu Ciorbaru2023-02-151-1/+1
| | |
| * | Update comments to match new debug_sync implementationVicențiu Ciorbaru2023-02-151-3/+4
| | |
| * | Merge 10.5 into 10.6Marko Mäkelä2023-02-141-1/+1
| |\ \ | | |/
| | * MDEV-30412: JSON_OBJECTAGG doesn't escape double quote in keyWeijun Huang2023-02-141-1/+1
| | |
* | | Fix RPL tests post DEBUG_SYNC changeVicențiu Ciorbaru2023-02-101-2/+2
| | | | | | | | | | | | | | | The tests expect the SIGNAL to not be cleared. Thus set NO_CLEAR_EVENT within DBUG_EXECUTE_IF
* | | Merge 10.6 into 10.8Marko Mäkelä2023-02-10105-1057/+1173
|\ \ \ | |/ /
| * | Merge 10.5 into 10.6Marko Mäkelä2023-02-10102-999/+942
| |\ \ | | |/
| | * Merge 10.4 into 10.5Marko Mäkelä2023-02-10100-978/+881
| | |\
| | | * MDEV-30621: Türkiye is the correct current country namingDaniel Black2023-02-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | As requested to the UN the country formerly known as Turkey is to be refered to as Türkiye. Reviewer: Alexander Barkov
| | | * MDEV-30608: rpl.rpl_delayed_parallel_slave_sbm sometimes fails with ↵Brandon Nesterenko2023-02-091-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Seconds_Behind_Master should not have used second transaction timestamp One of the constraints added in the MDEV-29639 patch, is that only the first event after idling should update last_master_timestamp; and as long as the replica has more events to execute, the variable should not be updated. The corresponding test, rpl_delayed_parallel_slave_sbm.test, aims to verify this; however, if the IO thread takes too long to queue events, the SQL thread can appear to catch up too fast. This fix ensures that the relay log has been fully written before executing the events. Note that the underlying cause of this test failure needs to be addressed as a bug-fix, this is a temporary fix to stop test failures. To track work on the bug-fix for the underlying issue, please see MDEV-30619.
| | | * MDEV-30586 DELETE with aggregation in subquery of WHERE returns bogus errorIgor Babaev2023-02-092-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The parser code for single-table DELETE missed the call of the function LEX::check_main_unit_semantics(). As a result the the field nested level of SELECT_LEX structures remained set 0 for all non-top level selects. This could lead to different kind of problems. In particular this did not allow to determine properly the selects where set functions had to be aggregated when they were used in inner subqueries. Approved by Oleksandr Byelkin <sanja@mariadb.com>
| | | * Apply clang-tidy to remove empty constructors / destructorsVicențiu Ciorbaru2023-02-0996-963/+850
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is the result of running run-clang-tidy -fix -header-filter=.* -checks='-*,modernize-use-equals-default' . Code style changes have been done on top. The result of this change leads to the following improvements: 1. Binary size reduction. * For a -DBUILD_CONFIG=mysql_release build, the binary size is reduced by ~400kb. * A raw -DCMAKE_BUILD_TYPE=Release reduces the binary size by ~1.4kb. 2. Compiler can better understand the intent of the code, thus it leads to more optimization possibilities. Additionally it enabled detecting unused variables that had an empty default constructor but not marked so explicitly. Particular change required following this patch in sql/opt_range.cc result_keys, an unused template class Bitmap now correctly issues unused variable warnings. Setting Bitmap template class constructor to default allows the compiler to identify that there are no side-effects when instantiating the class. Previously the compiler could not issue the warning as it assumed Bitmap class (being a template) would not be performing a NO-OP for its default constructor. This prevented the "unused variable warning".
| | | * Update Windows time zone mappings using latest CLDR dataVladislav Vaintroub2023-02-091-1/+2
| | | |
| | | * MDEV-30558: ER_KILL_{,QUERY_}DENIED_ERROR - normalize id typeDaniel Black2023-02-072-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The error string from ER_KILL_QUERY_DENIED_ERROR took a different type to ER_KILL_DENIED_ERROR for the thread id. This shows up in differences on 32 big endian arches like powerpc (Deb notation). Normalize the passing of the THD->id to its real type of my_thread_id, and cast to (long long) on output. As such normalize the ER_KILL_QUERY_DENIED_ERROR to that convention too. Note for upwards merge, convert the type to %lld on new translations of ER_KILL_QUERY_DENIED_ERROR.
| | | * Merge branch '10.4.28' into 10.4Oleksandr Byelkin2023-02-063-6/+20
| | | |\
| | | | * MDEV-24301 [Warning] Aborted connection (This connection closed normally)Daniel Black2023-02-061-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Warning on a normal graceful disconnnect is excessive, so lets not do it. MDEV-19282 restructed the code from 10.3 so applying this as a 10.4+ fix.
| | | | * MDEV-30538 Plans for SELECT and multi-table UPDATE/DELETE unexpectedly differIgor Babaev2023-02-031-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch allowed transformation of EXISTS subqueries into equivalent IN predicands at the top level of WHERE conditions for multi-table UPDATE and DELETE statements. There was no reason to prohibit the transformation for such statements. The transformation provides more opportunities of using semi-join optimizations. Approved by Oleksandr Byelkin <sanja@mariadb.com>
| | | | * MDEV-30473 : Do not allow GET_LOCK() / RELEASE_LOCK() in clusterJan Lindström2023-01-271-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | If WSREP_ON=ON do not allow GET_LOCK and RELEASE_LOCK functions. Instead print clear error message.
| | * | | Merge mariadb-10.5.19 into 10.5Marko Mäkelä2023-02-0642-255/+606
| | |\ \ \
| | * | | | MDEV-30473 : Do not allow GET_LOCK() / RELEASE_LOCK() in clusterJan Lindström2023-01-271-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 10.5 If WSREP_ON=ON do not allow RELEASE_ALL_LOCKS function. Instead print clear error message.
| | * | | | MDEV-30473 : Do not allow GET_LOCK() / RELEASE_LOCK() in clusterJan Lindström2023-01-271-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If WSREP_ON=ON do not allow GET_LOCK and RELEASE_LOCK functions. Instead print clear error message.
| | * | | | MDEV-25037 : SIGSEGV in MDL_lock::hog_lock_types_bitmapJan Lindström2023-01-272-13/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We should not call mdl_context.release_explicit_locks() in Wsrep_client_service::bf_rollback() if client is quiting because it will be done again in THD::cleanup(). Note that problem with GET_LOCK() / RELEASE_LOCK() will be fixed on MDEV-30473.
| * | | | | Merge branch '10.6.12' into 10.6Oleksandr Byelkin2023-02-064-48/+221
| |\ \ \ \ \
| | * | | | | debug_sync: Print all current active signals within the trace file during waitVicențiu Ciorbaru2023-02-031-5/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When running with DBUG trace enabled, print all current active signals. The output looks like this with the signals present in curr: T@6 ... debug_sync_exec: wait for 'nothing' at: 'now', curr: 'something,from_function,from_myvar'
| | * | | | | sql_hset.h - include what you use uchar comes from my_global.hVicențiu Ciorbaru2023-02-031-1/+2
| | | | | | |
| | * | | | | Implement DEBUG_SYNC multiple signal firing capabilityVicențiu Ciorbaru2023-02-031-12/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One can now do: set DEBUG_SYNC='... SIGNAL s1,s2,s3...' Multiple signals can be fired, they need to be split by commas.
| | * | | | | Extend Binary_string::strstr to also take in a const char pointerVicențiu Ciorbaru2023-02-032-12/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One shouldn't have to instantiate a Binary_string every time a strstr call is needed.
| | * | | | | debug_sync: Implement NO_CLEAR_EVENT syntaxVicențiu Ciorbaru2023-02-031-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When waiting on a signal, NO_CLEAR_EVENT allows one to not clear the signal, effectively allowing other threads to wait for the same signal.
| | * | | | | Implement multiple-signal debug_syncVicențiu Ciorbaru2023-02-031-25/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch is inspired from MySQL. Instead of using a single String to hold the current active debug_sync signal, use a Hash_set to store LEX_STRINGS. This patch ensures that a signal can not be lost, by being overwritten by another thread via set DEBUG_SYNC = '... SIGNAL ...'; All signals are kepts "alive" until they are consumed by a wait event. This requires updating test cases that assume the GLOBAL signal is never consumed. Follow-up work needed: Port the additional syntax that allows one to set multiple signals and also conditionally deactivate signals when waiting.
| | * | | | | Initialize the Hash_set during creationVicențiu Ciorbaru2023-02-031-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the Hash_set is not initialized, one can not call find() on it before at least one element has been inserted into it.
* | | | | | | Merge branch '10.7' into 10.8Oleksandr Byelkin2023-01-3147-295/+674
|\ \ \ \ \ \ \
| * \ \ \ \ \ \ Merge branch '10.6' into 10.7Oleksandr Byelkin2023-01-3147-295/+674
| |\ \ \ \ \ \ \ | | |/ / / / / /
| | * | | | | | Merge branch '10.5' into 10.6Oleksandr Byelkin2023-01-3147-295/+674
| | |\ \ \ \ \ \ | | | |/ / / / / | | |/| | / / / | | | | |/ / / | | | |/| | |
| | | * | | | Merge branch '10.4' into 10.5Oleksandr Byelkin2023-01-301-3/+7
| | | |\ \ \ \ | | | | | |/ / | | | | |/| |
| | | | * | | Fix number of rows passing in case of EQ_REFmariadb-10.4.28Oleksandr Byelkin2023-01-301-3/+5
| | | | | | |
| | | | * | | MDEV-30218: Incorrect optimization for rowid_filtering, correctionSergei Petrunia2023-01-281-6/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable use of Rowid Filter optimization with eq_ref access. Use the following assumptions: - Assume index-only access cost is 50% of non-index-only access cost. - Take into account that "Eq_ref access cache" reduces the number of lookups eq_ref access will make. = This means the number of Rowid Filter checks is reduced also = Eq_ref access cost is computed using that assumption (see prev_record_reads() call), so we should use it in all cost ' computations.
| | | | * | | Merge branch '10.3' into 10.4Oleksandr Byelkin2023-01-2817-131/+156
| | | | |\ \ \ | | | | | |_|/ | | | | |/| |
| | | * | | | Merge branch '10.4' into 10.5Oleksandr Byelkin2023-01-2742-254/+601
| | | |\ \ \ \ | | | | |_|_|/ | | | |/| | |
| | | | * | | MDEV-30218: Incorrect optimization for rowid_filtering, correctionSergei Petrunia2023-01-261-6/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable use of Rowid Filter optimization with eq_ref access. Use the following assumptions: - Assume index-only access cost is 50% of non-index-only access cost. - Take into account that "Eq_ref access cache" reduces the number of lookups eq_ref access will make. = This means the number of Rowid Filter checks is reduced also = Eq_ref access cost is computed using that assumption (see prev_record_reads() call), so we should use it in all cost ' computations.