summaryrefslogtreecommitdiff
path: root/sql
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.4 into 10.5Marko Mäkelä2019-12-301-1/+2
|\
| * Merge 10.3 into 10.4Marko Mäkelä2019-12-301-1/+2
| |\
| | * MDEV-18875 Assertion `thd->transaction.stmt.ha_list == __null || trans == ↵Nikita Malyavin2019-12-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | &thd->transaction.stmt' failed or bogus ER_DUP_ENTRY upon ALTER TABLE with versioning Cause: * when autocommit=0 (or transaction is issued by user), `ha_commit_trans` is called twice on ALTER TABLE, causing a duplicated insert into `transaction_registry` (ER_DUP_ENTRY). Solution: * ALTER TABLE makes an implicit commit by a second call. We actually need to make an insert only when it is a real commit. So is_real variable is additionally checked.
* | | Merge 10.4 into 10.5Marko Mäkelä2019-12-2719-260/+307
|\ \ \ | |/ /
| * | Merge 10.3 into 10.4Marko Mäkelä2019-12-2713-100/+114
| |\ \ | | |/
| | * After-merge cleanupAlexander Barkov2019-12-273-19/+23
| | |
| | * Merge 10.2 into 10.3Marko Mäkelä2019-12-2712-100/+109
| | |\
| | | * MDEV-21318: Wrong results with window functions and implicit groupingVarun Gupta2019-12-262-1/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The issue here is for degenerate joins we should execute the window function but it is not getting executed in all the cases. To get the window function values window function needs to be executed always. This currently does not happen in few cases where the join would return 0 or 1 row like 1) IMPOSSIBLE WHERE 2) MIN/MAX optimization 3) EMPTY CONST TABLE The fix is to make sure that window functions get executed and the temporary table is setup for the execution of window functions
| | | * MDEV-21388 Wrong result of DAYNAME()=xxx in combination with ↵Alexander Barkov2019-12-242-23/+22
| | | | | | | | | | | | | | | | condition_pushdown_for_derived=on
| | | * Merge 10.1 into 10.2Marko Mäkelä2019-12-237-38/+40
| | | |\
| | | | * MDEV-21319 COUNT(*) returns 1, actual SELECT returns no result in 10.3.21, ↵Alexander Barkov2019-12-192-5/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | but 1 result in 10.1.41 Item_ref::val_(datetime|time)_packed() erroneously called (*ref)->val_(datetime|time)_packed(). - Fixing to call (*ref)->val_(datetime|time)_packed_result(). - Backporting Item::val_(datetime|time)_packed_result() from 10.3. - Fixing Item_field::get_date_result() to handle null_value in the same way how Item_field::get_date() does.
| | | | * MDEV-21341: Fix UBSAN failures, part #3Sergei Petrunia2019-12-181-1/+2
| | | | | | | | | | | | | | | | | | | | One may not call memcpy(dst, src=NULL, size), even if size==0.
| | | | * MDEV-21341: Fix optimizer-related UBSAN failures, part #2Sergei Petrunia2019-12-181-22/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove Query_tables_list::lock_tables_state - it is not used and it causes errors like this: sql_lex.h:1675:7: runtime error: load of value 2779096485, which is not a valid value for type 'enum_lock_tables_state'
| | | | * MDEV-21341: Fix optimizer-related UBSAN failures, part #1:Sergei Petrunia2019-12-181-1/+1
| | | | | | | | | | | | | | | | | | | | Fix wrong typecast
| | | | * CMake,Windows - cleanup data directory prior to bootstrap for ↵Vladislav Vaintroub2019-12-121-2/+4
| | | | | | | | | | | | | | | | | | | | nitial_database target
| | | | * MDEV-21209 : mysql_tzinfo_to_sql's Galera checks do not workJan Lindström2019-12-051-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | wsrep_on parameter can be visible even when wsrep_on is set OFF so we need to check variable_value from I_S also.
| | | * | MDE-21369 rpl.rpl_timezone fails with valgrind: Use of uninitialised value.Alexey Botchkov2019-12-212-36/+27
| | | | | | | | | | | | | | | | | | | | | | | | | It's not safe to chenge the THD::thread_id. So send the thread_id as an argument to the mysql_audit_external_lock.
| | | * | MDEV-21343 Threadpool/Unix- wait_begin() function does not wake/create ↵Vladislav Vaintroub2019-12-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | threads, when it should Fixed the condition for waking up/creating another thread. If there is some work to do (if the request queue is not empty), a thread should be woken or created. The condition was incorrect since 18c9b345b43b62b7c4dbac8ce0289c1c8103c2d1
| | | * | MDEV-16579: Wrong result of query using DISTINCT COUNT(*) OVER (*)Varun Gupta2019-12-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The query requires 2 temporary tables for execution, the window function is always attached to the last temporary table, but in this case the result field of the window function points to the first temporary table rather than the last one. Fixed this by not changing window function items with temporary table items of the first temporary table.
| | | * | PR #1127 and PR #1150Anel Husakovic2019-12-131-9/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR#1127: Fix is_check_constraints.result to be compatibile with 10.3 The patch is done according to the original patch for MDEV-14474 1edd09c325525cba33152 and not one which is merged on server d526679efd108478cc2af07578. This patch includes: - Rename from `is_check_constraint` to `is_check_constraints` to tests and results - Per review, change the order of fields in IS check_constraints table by adding the column `table_name` before `constraint_name`. According to the standard 2006 there is no `table_name` column. - Original patch and one in `10.3` supports embedded server this patch doesn't support. After the merge `10.3` will not support also. - Don't use patch c8b8b01b61 to change the length of `CHECK_CLAUSE` field PR#1150: MDEV-18440: Information_schema.check_constraints possible data leak This patch is extension of PR 1127 and includes: - Check for table grants - Additional test according to the MDEV specification Signed-off-by: Vicențiu Ciorbaru <vicentiu@mariadb.org>
| * | | | Merge remote-tracking branch 'origin/10.3' into 10.4Alexander Barkov2019-12-256-153/+190
| |\ \ \ \ | | |/ / /
| | * | | MDEV-21392 Cleanup redundant overriding in Item_sum_numAlexander Barkov2019-12-254-133/+156
| | | | |
| | * | | MDEV-21389 Derive Item_func_month from Item_long_funcAlexander Barkov2019-12-241-18/+3
| | | | |
| | * | | Merge branch '10.2' into 10.3Vicențiu Ciorbaru2019-12-131-16/+28
| | |\ \ \
| | | * | | PR #1127 and PR #1150Anel Husakovic2019-12-131-9/+28
| | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR#1127: Fix is_check_constraints.result to be compatibile with 10.3 The patch is done according to the original patch for MDEV-14474 1edd09c325525cba33152 and not one which is merged on server d526679efd108478cc2af07578. This patch includes: - Rename from `is_check_constraint` to `is_check_constraints` to tests and results - Per review, change the order of fields in IS check_constraints table by adding the column `table_name` before `constraint_name`. According to the standard 2006 there is no `table_name` column. - Original patch and one in `10.3` supports embedded server this patch doesn't support. After the merge `10.3` will not support also. - Don't use patch c8b8b01b61 to change the length of `CHECK_CLAUSE` field PR#1150: MDEV-18440: Information_schema.check_constraints possible data leak This patch is extension of PR 1127 and includes: - Check for table grants - Additional test according to the MDEV specification
| * | | | MDEV-21335 : Galera test failure on suite wsrepbb-10.4-MDEV-21335Jan Lindström2019-12-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem was that wsrep_on was OFF. This is 10.4 version.
* | | | | MDEV-20632: prerequisite:Oleksandr Byelkin2019-12-273-19/+20
| | | | | | | | | | | | | | | | | | | | Removed hack with with_list
* | | | | MDEV-18648: slave_parallel_mode= optimistic default in 10.5Sujatha2019-12-233-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Description: ============ To change 'CONSERVATIVE' @@global.slave_parallel_mode default to 'OPTIMISTIC' in 10.5. @sql/sys_vars.cc Changed default parallel_mode to 'OPTIMISTIC' @sql/rpl_filter.cc Changed default parallel_mode to 'OPTIMISTIC' @sql/mysqld.cc Removed the initialization of 'SLAVE_PARALLEL_CONSERVATIVE' to 'opt_slave_parallel_mode' variable. @mysql-test/suite/rpl/t/rpl_parallel_mdev6589.test @mysql-test/suite/rpl/t/rpl_mdev6386.test Added 'mtr' suppression to ignore 'ER_PRIOR_COMMIT_FAILED'. In case of 'OPTIMISTIC' mode if a transaction gets killed during "wait_for_prior_commit" it results in above error "1964". Hence suppression needs to be added for this error. @mysql-test/suite/rpl/t/rpl_parallel_conflicts.test Test has a 'slave.opt' which explicitly sets slave_parallel_mode to 'conservative'. When the test ends this mode conflicts with new default mode. Hence check test case reports an error. The 'slave.opt' is removed and options are set and reset within test. @mysql-test/suite/multi_source/info_logs.result @mysql-test/suite/multi_source/reset_slave.result @mysql-test/suite/multi_source/simple.result Result content mismatch in "show slave status" output. This is expected as new slave_parallel_mode='OPTIMISTIC'. @mysql-test/include/check-testcase.test Updated default 'slave_parallel_mode' to 'optimistic'. Refactored rpl_parallel.test into following test cases. Test case 1: @mysql-test/suite/rpl/t/rpl_parallel_domain.test Test case 2: @mysql-test/suite/rpl/t/rpl_parallel_domain_slave_single_grp.test Test case 3: @mysql-test/suite/rpl/t/rpl_parallel_single_grpcmt.test Test case 4: @mysql-test/suite/rpl/t/rpl_parallel_stop_slave.test Test case 5: @mysql-test/suite/rpl/t/rpl_parallel_slave_bgc_kill.test Test case 6: @mysql-test/suite/rpl/t/rpl_parallel_gco_wait_kill.test Test case 7: @mysql-test/suite/rpl/t/rpl_parallel_free_deferred_event.test Test case 8: @mysql-test/suite/rpl/t/rpl_parallel_missed_error_handling.test Test case 9: @mysql-test/suite/rpl/t/rpl_parallel_innodb_lock_conflict.test Test case 10: @mysql-test/suite/rpl/t/rpl_parallel_gtid_slave_pos_update_fail.test Test case 11: @mysql-test/suite/rpl/t/rpl_parallel_wrong_exec_master_pos.test Test case 12: @mysql-test/suite/rpl/t/rpl_parallel_partial_binlog_trans.test Test case 13: @mysql-test/suite/rpl/t/rpl_parallel_ignore_error_on_rotate.test Test case 14: @mysql-test/suite/rpl/t/rpl_parallel_wrong_binlog_order.test Test case 15: @mysql-test/suite/rpl/t/rpl_parallel_incorrect_relay_pos.test Test case 16: @mysql-test/suite/rpl/t/rpl_parallel_retry_deadlock.test Test case 17: @mysql-test/suite/rpl/t/rpl_parallel_deadlock_corrupt_binlog.test Test case 18: @mysql-test/suite/rpl/t/rpl_parallel_mode.test Test case 19: @mysql-test/suite/rpl/t/rpl_parallel_analyze_table_hang.test Test case 20: @mysql-test/suite/rpl/t/rpl_parallel_record_gtid_wakeup.test Test case 21: @mysql-test/suite/rpl/t/rpl_parallel_stop_on_con_kill.test Test case 22: @mysql-test/suite/rpl/t/rpl_parallel_rollback_assert.test
* | | | | correct dbug function namesSergei Golubchik2019-12-211-2/+2
| | | | |
* | | | | dependencies for VSSergei Golubchik2019-12-214-23/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | item_cmpfunc.h includes pcre2.h, so with the bundled pcre2 it has to be built before anything that includes pcre2.h . And item_cmpfunc.h is indirectly included everywhere, also in many plugins. Somehow Ninja and Makefiles generators can still deduce the correct build dependencies, but Visual Studio generator cannot. Two changes: * move pcre2.h from item_cmpfunc.h to item_cmpfunc.cc * create an explicit dependency on pcre2 for the server
* | | | | longer regex error messagesSergei Golubchik2019-12-211-7/+7
| | | | |
* | | | | MDEV-14024 PCRE2.Alexey Botchkov2019-12-219-199/+84
| | | | | | | | | | | | | | | | | | | | Related changes in the server code.
* | | | | Merge 10.4 into 10.5Marko Mäkelä2019-12-173-3/+17
|\ \ \ \ \ | |/ / / /
| * | | | Update wsrep-lib. (#1426)Teemu Ollakka2019-12-163-3/+17
| | | | | | | | | | | | | | | | | | | | This commit updates the wsrep-lib. The changes are a cleanup in client_state TOI processing and stub methods for future extensions.
* | | | | Merge 10.4 into 10.5Marko Mäkelä2019-12-1646-207/+481
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.3 into 10.4Marko Mäkelä2019-12-138-28/+180
| |\ \ \ \ | | |/ / / | | | | | | | | | | | | | | | We disable the MDEV-21189 test galera.galera_partition because it times out.
| | * | | Merge 10.2 into 10.3Marko Mäkelä2019-12-125-25/+116
| | |\ \ \ | | | |/ /
| | | * | MDEV-19380: ASAN heap-use-after-free in Protocol::net_store_dataVarun Gupta2019-12-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The issue here is window function makes the passed string object to point to an area in a temporary table's record buffer. Then, the temporary table is freed, together with its record buffer. Then, Item_cache_str attempts to read this value. The fix is to call value_buff.copy(). This will make the value_buff to store its string in a buffer that it owns, which will not disappear unexpectedly.
| | | * | MDEV-11345 Compile english error messages into mysqld executable.Vladislav Vaintroub2019-12-111-22/+53
| | | | |
| | | * | MDEV-18460: Server crashed in strmake / tdc_create_key / ↵Oleksandr Byelkin2019-12-101-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | THD::create_tmp_table_def_key When there is a WITH clause we postpone check for tables without database for later stages when tables in WITH will be defined. But we should not try to open such tables as temporary tables because temporary tables always belong to a some database.
| | | * | MDEV-21189: Dropping partition with 'wsrep_OSU_method=RSU' and 'SESSION ↵Jan Lindström2019-12-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sql_log_bin = 0' cases the galera node to hang Found two bugs (1) have_committing_connections was missing mutex unlock on one exit case. As this function is called on a loop it caused mutex lock when we already owned the mutex. This could cause hang. (2) wsrep_RSU_begin did set up error code when partition to be dropped could not be MDL-locked because of concurrent operations but wrong error code was propagated to upper layer causing error to be ignored. This could have also caused the hang.
| | | * | MDEV-18463 Don't allow multiple table CONSTRAINTs with the same name.Alexey Botchkov2019-12-091-2/+52
| | | | | | | | | | | | | | | | | | | | Add necessary checks.
| | * | | MDEV-20667 Server crash on pop_cursorAlexander Barkov2019-12-121-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When backpatching a forward GOTO label, the old code erroneously used CURSOR/HANDLER difference between context frames "c" and "a" to tune a cpop/hpop command. So the cpop/hpop command later tried to pop all cursors/handlers declared between "a" and "c", but those between "b" and "c" were not cpushed/hpoped yet during the execution of "GOTO x". Fixing the code to use the difference between frames "b" and "a" only. BEGIN -- a ... GOTO x; -- b ... <<x>> -- c ... END -- d
| | * | | MDEV-20900: IN predicate to IN subquery conversion causes performance regressionVarun Gupta2019-12-103-2/+62
| | | | | | | | | | | | | | | | | | | | | | | | | Disable the IN predicate to IN subquery conversion when the types on the left and right hand side of the IN predicate are not of comparable type.
| * | | | MDEV-20780 Fixes for failures on galera_sr_ddl_master (#1425)Daniele Sciascia2019-12-114-108/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test galera_sr_ddl_master would sometimes fail due to leftover streaming replication fragments. Rollbacker thread would attempt to open streaming_log table to remove the fragments, but would fail in check_stack_overrun(). Ultimately the check_stack_overrun() failure was caused by rollbacker missing to switch the victim's THD thread stack to rollbacker's thread stack. Also in this patch: - Remove duplicate functionality in rollbacker helper functions, and extract rollbacker fragment removal into function wsrep_remove_streaming_fragments() - Reuse open_for_write() in wsrep_schema::remove_fragments - Partially revert changes to galera_sr_ddl_master test from commit 44a11a7c085f4f5a4042100df0828d54d596103d. Removed unnecessary wait condition and isolation level setting
| * | | | Merge branch '10.3' into 10.4Oleksandr Byelkin2019-12-0934-53/+223
| |\ \ \ \ | | |/ / /
| | * | | MDEV-21234 Server crashes in in setup_on_expr upon 3rd execution of SPAleksey Midenkov2019-12-051-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | Versioned conditions in on_expr can not be rebuilt at optimization stage on non-conventional arena.
| | * | | Merge pull request #1261 from robertbindar/mdev-17978Robert Bindar2019-12-051-1/+2
| | | | | | | | | | | | | | | MDEV-17978 Server crash in SHOW CREATE SEQUENCE on a broken view
| | * | | MDEV-21233 Assertion `m_extra_cache' failed in ha_partition::late_extra_cacheAleksey Midenkov2019-12-051-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Incorrect assertion of EXTRA_CACHE for HA_EXTRA_PREPARE_FOR_UPDATE. The latter is related to read cache, but must operate without it as a noop. Related to Bug#55458 and MDEV-20441.
| | * | | Merge branch '10.2' into 10.3Oleksandr Byelkin2019-12-047-6/+96
| | |\ \ \ | | | |/ /