summaryrefslogtreecommitdiff
path: root/sql
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-25553 : Avoid unnecessary rollbacks with SRbb-10.4-MDEV-25553Daniele Sciascia2021-04-283-34/+6
| | | | | | | | | | | | | | | | | This patch changes statement rollback for streaming replication. Previously, a statement rollback was turned into full transaction rollback in the case where the transaction had already replicated a fragment. This was introduced in the initial implementation of streaming replication due to the fact that we do not have a mechanism to perform a statement rollback on the applying side. This policy is however overly pessimistic, causing full rollbacks even in cases where a local statement rollback, would not require a statement rollback on the applying side. This happens to be case when the statement itself has not replicated any fragments. So the patch changes the condition that determines if a statement rollback should be turned into a full rollback accordingly. Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
* MDEV-22227 Assertion `state_ == s_exec' failed in ↵bb-10.4-MDEV-22227mkaruza2021-04-282-3/+11
| | | | | | | | | | | wsrep::client_state::start_transaction Removed redundant code for BF abort transaction in `thr_lock.cc`. TOI operations will ignore provided lock_wait_timeout and use `LONG_TIMEOUT` until operation is finished. Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
* Merge 10.3 into 10.4Marko Mäkelä2021-04-272-1/+15
|\
| * MDEV-24758 heap-use-after-poison in innobase_add_instant_try/rec_copyMarko Mäkelä2021-04-264-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a backport of commit fd9ca2a742abe2e91b2b77e70915dec7bd3cd7e1 (MDEV-23295) and commit 9a156e1a23046ba3e37bdb1e4e1ad887d3f5829b (MDEV-23345) to 10.3. An instant ADD/DROP/reorder column could create a dummy table object with the wrong ROW_FORMAT when innodb_default_row_format was changed between CREATE TABLE and ALTER TABLE. prepare_inplace_alter_table_dict(): If we had promised that ALGORITHM=INPLACE is supported, we must preserve the ROW_FORMAT. The rest of the changes are related to adding Alter_inplace_info::inplace_supported to cache the return value of handler::check_if_supported_inplace_alter().
| * MDEV-24773: slave_compressed_protocol doesn't work properly with semi-sync ↵Sujatha2021-04-261-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | replication Back port upstream fix commit 1800b015a1d487330f7b15f2020b887be348a66b Author: Venkatesh Duggirala <venkatesh.duggirala@oracle.com> Date: Fri Sep 8 20:29:22 2017 +0530 Bug#26027024 SLAVE_COMPRESSED_PROTOCOL DOESN'T WORK WITH SEMI-SYNC REPLICATION IN MYSQL-5.7 Analysis: In mysql-5.6, dump thread (the thread that is created on Master after Slave requested for a binlog dump) is also used to receive acknowledgements from the Slave and act on them accordingly. For performance reasons, a special thread called Ack Receiver thread is added in mysql-5.7 Semi synchronous replication plugin. This thread does not have special handling to receive acknowledgements if Slave has enabled compression in the protocol. Hence Master is unable to handle any slave if Slave_compressed_protocol is enabled on it. Fix: Enable compress flag on the communication channels if the Slave has Slave_compressed_protocol ON.
| * MDEV-24925: Server crashes in Item_subselect::init_expr_cache_trackerSergei Petrunia2021-04-251-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | The optimizer removes redundant GROUP BY operations. If GROUP BY element is a subselect, it is "eliminated". However one must not eliminate the item if it is used both in the select list and in the GROUP BY, like so: select (select ... ) as SUBQ from ... group by SUBQ Do not eliminate such items.
* | Merge 10.3 into 10.4bb-10.4-mergeMarko Mäkelä2021-04-2511-34/+179
|\ \ | |/
| * This commit adds the same call of st_select_lex::set_unique_exclude() thatIgor Babaev2021-04-243-1/+24
| | | | | | | | | | complemented the fix for MDEV-24823 in 10.2. As it is the only call of this function in 10.3 the commit also has added the code of the function.
| * Merge 10.2 into 10.3Marko Mäkelä2021-04-245-6/+105
| |\ | | | | | | | | | except commit 1288dfffe77a99d6c5906d12010a1677ee149308
| | * This patch complements the patch for MDEV-24823.Igor Babaev2021-04-231-1/+1
| | |
| | * MDEV-25091 CREATE TABLE: field references qualified by a wrong table name ↵Aleksey Midenkov2021-04-233-5/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | succeed Before FRM is written walk vcol expressions through check_table_name_processor() and check if field items match (db, table_name) qualifier. We cannot do this in check_vcol_func_processor() as there is already no table name qualifiers in expressions of written and loaded FRM.
| | * MDEV-24823 Crash with invalid multi-table update of view in 2nd execution of SPIgor Babaev2021-04-227-26/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch mergeable derived tables / view used in a multi-table update / delete were merged before the preparation stage. When the merge of a derived table / view is performed the on expression attached to it is fixed and ANDed with the where condition of the select S containing this derived table / view. It happens after the specification of the derived table / view has been merged into S. If the ON expression refers to a non existing field an error is reported and some other mergeable derived tables / views remain unmerged. It's not a problem if the multi-table update / delete statement is standalone. Yet if it is used in a stored procedure the select with incompletely merged derived tables / views may cause a problem for the second call of the procedure. This does not happen for select queries using derived tables / views, because in this case their specifications are merged after the preparation stage at which all ON expressions are fixed. This patch makes sure that merging of the derived tables / views used in a multi-table update / delete statement is performed after the preparation stage. Approved by Oleksandr Byelkin <sanja@mariadb.com>
| | * Update timezone data on WindowsVladislav Vaintroub2021-04-222-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | There is new Yukon Standard time Windows timezone. Also fix the powershell script that generates the Windows locale mapping, tell powershell to use TLSv1.2 to access the github (on some reason it is TLS1.1 that powershell is using by default, and it does no work)
| * | MDEV-24823 Crash with invalid multi-table update of view in 2nd execution of SPIgor Babaev2021-04-225-25/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch mergeable derived tables / view used in a multi-table update / delete were merged before the preparation stage. When the merge of a derived table / view is performed the on expression attached to it is fixed and ANDed with the where condition of the select S containing this derived table / view. It happens after the specification of the derived table / view has been merged into S. If the ON expression refers to a non existing field an error is reported and some other mergeable derived tables / views remain unmerged. It's not a problem if the multi-table update / delete statement is standalone. Yet if it is used in a stored procedure the select with incompletely merged derived tables / views may cause a problem for the second call of the procedure. This does not happen for select queries using derived tables / views, because in this case their specifications are merged after the preparation stage at which all ON expressions are fixed. This patch makes sure that merging of the derived tables / views used in a multi-table update / delete statement is performed after the preparation stage. Approved by Oleksandr Byelkin <sanja@mariadb.com>
* | | Merge 10.3 into 10.4st-10.4Marko Mäkelä2021-04-225-15/+39
|\ \ \ | |/ /
| * | Merge 10.2 into 10.3Marko Mäkelä2021-04-225-15/+43
| |\ \ | | |/
| | * MDEV-24526 binlog rotate via FLUSH LOGS may obsolate binlog file for ↵Andrei Elkin2021-04-211-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | recovery too eary There was race between a committing transaction and the following in binlog order FLUSH LOGS that could create a 2nd Binlog checkpoint (BCP) event in the new file *before* the first logged-in-old-binlog transaction gets committed in Innodb. That would cause the transaction loss at recovery, should the server stop right after the BCP. The race is tackled by enforcing the necessary set of mutexes to be acquired by FLUSH-LOGS handler in the correct order (of the group commit leader pattern). Note, there remain two cases where a similar race is still possible: - the above race as it is when the server is run with ("unlikely") non-default `--binlog-optimize-thread-scheduling=0` (MDEV-24530), and - at unlikely event of bin-logging of Incident event (MDEV-24531) that also triggers binlog rotation, in both cases though with lesser chances after the current fixes.
| | * Fixup: Event_queue_element_for_exec initializer list not supported on gcc-4.1Vicențiu Ciorbaru2021-04-211-1/+5
| | |
| | * fixed some korean error messagesbb-10.2-danielblack-pr1811-korean-translationLee Keun Won2021-04-211-14/+17
| | | | | | | | | | | | Closes #1811
| | * MDEV-24807:A possibility for double free in dtor of ↵Vicențiu Ciorbaru2021-04-203-1/+3
| | | | | | | | | | | | | | | | | | | | | Event_queue_element_for_exec in the case of OOM Eliminate a memory leak when init can fail by forgetting to delete the Event_queue_element_for_exec object.
* | | MDEV-25362 after-merge fix: Remove unnecessary codeMarko Mäkelä2021-04-221-3/+1
| | |
* | | MDEV-25362 after-merge fix: GCC -Og -Wmaybe-uninitializedMarko Mäkelä2021-04-211-2/+1
| | |
* | | Merge 10.3 into 10.4Marko Mäkelä2021-04-217-12/+82
|\ \ \ | |/ /
| * | Merge 10.2 into 10.3Marko Mäkelä2021-04-216-8/+69
| |\ \ | | |/
| | * MDEV-25362 Incorrect name resolution for subqueries in ON expressionsprot-10.2Igor Babaev2021-04-172-1/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch sets the proper name resolution context for outer references used in a subquery from an ON clause. Usually this context is more narrow than the name resolution context of the parent select that were used before this fix. This fix revealed another problem that concerned ON expressions used in from clauses of specifications of derived tables / views / CTEs. The name resolution outer context for such ON expression must be set to NULL to prevent name resolution beyond the derived table where it is used. The solution to resolve this problem applied in sql_derived.cc was provided by Sergei Petrunia <sergey@mariadb.com>. The change in sql_parse.cc is not good for 10.4+. A corresponding diff for 10.4+ will be provided in JIRA entry for this bug. Approved by Oleksandr Byelkin <sanja@mariadb.com>
| | * MDEV-15064: IO_CACHE mysys read_pos, not libmaria rc_posbb-10.2-danielblack-MDEV-15064-IO_CACHE-read_posRainer Orth2021-04-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | It seems some overly tolerant compilers (gcc) allow the structure of IO_CACHE that is defined differently in libmaria to have members equalivance to the iocache in mysys. More strict Solaris compilers recognise that rc_pos really isn't a structure member and won't compile.
| | * MDEV-25407: EXISTS subquery with correlation in ON expression crashesbb-10.2-mdev25407Sergei Petrunia2021-04-161-1/+29
| | | | | | | | | | | | Make Item_subselect::walk() walk the ON expressions, too.
| | * MDEV-25403 ALTER TABLE wrongly checks for field's default value if AFTER is usedSergei Golubchik2021-04-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | When a column is added to an non-empty table, existing rows will have a column's default value for existing rows. Or a "zero value" if the column has no default. But this check should be skipped when an existing column is altered.
| | * signal handler, display coredump file pattern similarly to MDEV-25294 but ↵David Carlier2021-04-151-3/+3
| | | | | | | | | | | | for FreeBSD, thankfully the sysctl OID is the same.
| * | MDEV-25327 Unexpected ER_DUP_ENTRY upon dropping PK column from ↵Aleksey Midenkov2021-04-191-2/+10
| | | | | | | | | | | | | | | | | | system-versioned table When dropped all user key-parts we also drop key-parts of implicit system fields.
* | | Fix all warnings given by UBSANMonty2021-04-2032-212/+355
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The easiest way to compile and test the server with UBSAN is to run: ./BUILD/compile-pentium64-ubsan and then run mysql-test-run. After this commit, one should be able to run this without any UBSAN warnings. There is still a few compiler warnings that should be fixed at some point, but these do not expose any real bugs. The 'special' cases where we disable, suppress or circumvent UBSAN are: - ref10 source (as here we intentionally do some shifts that UBSAN complains about. - x86 version of optimized int#korr() methods. UBSAN do not like unaligned memory access of integers. Fixed by using byte_order_generic.h when compiling with UBSAN - We use smaller thread stack with ASAN and UBSAN, which forced me to disable a few tests that prints the thread stack size. - Verifying class types does not work for shared libraries. I added suppression in mysql-test-run.pl for this case. - Added '#ifdef WITH_UBSAN' when using integer arithmetic where it is safe to have overflows (two cases, in item_func.cc). Things fixed: - Don't left shift signed values (byte_order_generic.h, mysqltest.c, item_sum.cc and many more) - Don't assign not non existing values to enum variables. - Ensure that bool and enum values are properly initialized in constructors. This was needed as UBSAN checks that these types has correct values when one copies an object. (gcalc_tools.h, ha_partition.cc, item_sum.cc, partition_element.h ...) - Ensure we do not called handler functions on unallocated objects or deleted objects. (events.cc, sql_acl.cc). - Fixed bugs in Item_sp::Item_sp() where we did not call constructor on Query_arena object. - Fixed several cast of objects to an incompatible class! (Item.cc, Item_buff.cc, item_timefunc.cc, opt_subselect.cc, sql_acl.cc, sql_select.cc ...) - Ensure we do not do integer arithmetic that causes over or underflows. This includes also ++ and -- of integers. (Item_func.cc, Item_strfunc.cc, item_timefunc.cc, sql_base.cc ...) - Added JSON_VALUE_UNITIALIZED to json_value_types and ensure that value_type is initialized to this instead of to -1, which is not a valid enum value for json_value_types. - Ensure we do not call memcpy() when second argument could be null. - Fixed that Item_func_str::make_empty_result() creates an empty string instead of a null string (safer as it ensures we do not do arithmetic on null strings). Other things: - Changed struct st_position to an OBJECT and added an initialization function to it to ensure that we do not copy or use uninitialized members. The change to a class was also motived that we used "struct st_position" and POSITION randomly trough the code which was confusing. - Notably big rewrite in sql_acl.cc to avoid using deleted objects. - Changed in sql_partition to use '^' instead of '-'. This is safe as the operator is either 0 or 0x8000000000000000ULL. - Added check for select_nr < INT_MAX in JOIN::build_explain() to avoid bug when get_select() could return NULL. - Reordered elements in POSITION for better alignment. - Changed sql_test.cc::print_plan() to use pointers instead of objects. - Fixed bug in find_set() where could could execute '1 << -1'. - Added variable have_sanitizer, used by mtr. (This variable was before only in 10.5 and up). It can now have one of two values: ASAN or UBSAN. - Moved ~Archive_share() from ha_archive.cc to ha_archive.h and marked it virtual. This was an effort to get UBSAN to work with loaded storage engines. I kept the change as the new place is better. - Added in CONNECT engine COLBLK::SetName(), to get around a wrong cast in tabutil.cpp. - Added HAVE_REPLICATION around usage of rgi_slave, to get embedded server to compile with UBSAN. (Patch from Marko). - Added #ifdef for powerpc64 to avoid a bug in old gcc versions related to integer arithmetic. Changes that should not be needed but had to be done to suppress warnings from UBSAN: - Added static_cast<<uint16_t>> around shift to get rid of a LOT of compiler warnings when using UBSAN. - Had to change some '/' of 2 base integers to shift to get rid of some compile time warnings. Reviewed by: - Json changes: Alexey Botchkov - Charset changes in ctype-uca.c: Alexander Barkov - InnoDB changes & Embedded server: Marko Mäkelä - sql_acl.cc changes: Vicențiu Ciorbaru - build_explain() changes: Sergey Petrunia
* | | More fixes to variable wsrep_onDaniele Sciascia2021-04-203-14/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Disallow setting wsrep_on = 1 if wsrep_provider is unset. Also, move wsrep_on_basic from sys_vars to wsrep suite: this test now requires to run with wsrep_provider set * Disallow setting @@session.wsrep_on = 1 when @@global.wsrep_on = 0 * Handle the case where a new connection turns @@global.wsrep_on from off to on. In this case we would miss a call to wsrep_open, causing unexpected states in wsrep::client_state (causing assertions). * Disable wsrep.MDEV-22443 because it is no longer possible to enable wsrep_on, if server is started with wsrep_provider='none' Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
* | | MDEV-25423 : Donor node fails to shutdown after mysqldump SSTbb-10.4-MDEV-25423Jan Lindström2021-04-191-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | * Table should have primary key * Enable wsrep_sync_wait before final selects * Enable autocommit before final selects. * Fix joiner monitoring in case of mysqldump. * Add wait_conditions to stabilize
* | | MDEV-22668: "Flush SSL" command doesn't reload wsrep certbb-10.4-MDEV-22668mkaruza2021-04-153-0/+35
| | | | | | | | | | | | | | | | | | | | | Trigger `socket.ssl_reload` when FLUSH SSL is issued. To triger reloading of certificate, key and CA, files needs to be physically changed. Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
* | | Merge 10.3 into 10.4Marko Mäkelä2021-04-1411-58/+95
|\ \ \ | |/ /
| * | Fixup merge 6e6318b29b446f76f01f2ef65d1460870b607d2aMarko Mäkelä2021-04-141-3/+3
| | |
| * | Merge 10.2 into 10.3Marko Mäkelä2021-04-137-22/+40
| |\ \ | | |/
| | * MDEV-25182 Complex query in Store procedure corrupts resultsbb-10.2-MDEV-25182Oleksandr Byelkin2021-04-124-7/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the second execution of the PS 1. mark_as_dependent() is called with the same parameters as at the first execution (select#4 and select#3) 2. as outer_select (select#3) has been already merged at the first execution of PS it cannot be reached using the outer_select() function anymore (and so can not stop iteration). 3. as a result all selects towards the top level select including the select for 'ca' are marked as uncacheable. 4. Marked uncacheable it executed incorrectly triggering filling its temporary table several times and using freed memory at the end. To avoid the problem we use name resolution context to go "up". NOTE: problem also exists in 10.2 but has no visible effect on execution. That is why the problem is fixed in 10.2. The patch also add debug logging of important procedures and better specify parameters types of st_select_lex::mark_as_dependent.
| | * MDEV-25108: Running of the EXPLAIN EXTENDED statement produces extra warning ↵bb-10.2-MDEV-25108-2Dmitry Shulga2021-04-124-15/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in case it is executed in PS (prepared statement) mode The EXPLAIN EXTENDED statement run as a prepared statement can produce extra warning comparing with a case when EXPLAIN EXTENDED statement is run as a regular statement. For example, the following test case CREATE TABLE t1 (c int); CREATE TABLE t2 (d int); EXPLAIN EXTENDED SELECT (SELECT 1 FROM t2 WHERE d = c) FROM t1; produces the extra warning "Field or reference 'c' of SELECT #2 was resolved in SELECT #1" in case the above mentioned "EXPLAIN EXTENDED" statement is executed in PS mode, that is by submitting the following statements: PREPARE stmt FROM "EXPLAIN EXTENDED SELECT (SELECT 1 FROM t2 WHERE d = c) FROM t1"; EXECUTE stmt; The reason of the extra warning emittion is in a way items are handled (being fixed) during execution of the JOIN::prepare() method. The method Item_field::fix_fields() calls the find_field_in_tables() function in case a field hasn't been associated yet with the item. Implementation of the find_field_in_tables() function first checks whether a table containing the required field was already opened and cached. It is done by checking the data member item->cached_table. This data member is set on handling the PRERARE FROM statement and checked on executing the EXECUTE statement. If the data member item->cached_table is set the find_field_in_tables() function invoked and the mark_select_range_as_dependent() function called if the field is an outer referencee. The mark_select_range_as_dependent() function calls the mark_as_dependent() function that finally invokes the push_warning_printf() function that produces extra warning. To fix the issue, calling of push_warning_printf() is elimited in case it was run indirectly in result of hanlding already opened table from the Item_field::fix_fields() method.
| * | Merge 10.2 into 10.3Marko Mäkelä2021-04-091-7/+15
| |\ \ | | |/
| | * MDEV-13467 fixup: Improve error handlingMarko Mäkelä2021-04-081-7/+15
| | |
| * | fix gcc optimized buildEugene Kosov2021-04-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ../sql/spatial.cc: In member function ‘double Gis_point::calculate_haversine(const Geometry*, double, int*)’: ../sql/spatial.cc:1093:45: error: ‘y1r’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 1093 | res= 2*sphere_radius*asin((sqrt(dlat + cos(y1r)*cos(y2r)*dlong))); | ~~~^~~~~ ../sql/spatial.cc:1092:20: error: ‘x1r’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 1092 | dlong= sin((x2r - x1r)/2)*sin((x2r - x1r)/2); | ~~~~~^~~~~~ ../sql/spatial.cc:1093:54: error: ‘y2r’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 1093 | res= 2*sphere_radius*asin((sqrt(dlat + cos(y1r)*cos(y2r)*dlong))); | ~~~^~~~~ ../sql/spatial.cc:1092:20: error: ‘x2r’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 1092 | dlong= sin((x2r - x1r)/2)*sin((x2r - x1r)/2); | ~~~~~^~~~~~ c
| * | MDEV-25172 Wrong error message for ADD COLUMN .. AS ROW STARTAleksey Midenkov2021-03-311-0/+5
| | | | | | | | | | | | | | | Handle one more condition in fix_alter_info() for non-versioned table and produce ER_VERS_NOT_VERSIONED error.
| * | MDEV-22562 Assertion `next_insert_id == 0' upon UPDATE on system-versioned tableAleksey Midenkov2021-03-311-9/+11
| | | | | | | | | | | | | | | Don't update autoinc counter on history row insert. Uniqueness is kept due to merge with row_end.
| * | MDEV-24690 Dropping primary key column from versioned table always fails ↵Aleksey Midenkov2021-03-311-1/+4
| | | | | | | | | | | | | | | | | | | | | with 1072 Exclude system-invisible key-parts from MDEV-11114 (04b288ae) restriction.
| * | MDEV-23446 goto error cleanupAleksey Midenkov2021-03-311-17/+18
| | |
* | | MDEV-25197: The statement set password=password('') executed in PS mode ↵bb-10.4-MDEV-25197-3Dmitry Shulga2021-04-132-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fails in case it is run by a user with expired password A user connected to a server with an expired password can't change password with the statement "SET password=..." if this statement is run in PS mode. In mentioned use case a user gets the error ER_MUST_CHANGE_PASSWORD on attempt to run the statement PREPARE stmt FOR "SET password=..."; The reason of failure to reset password by a locked user using the statement PREPARE stmt FOR "SET password=..." is that PS-related statements are not listed among the commands allowed for execution by a user with expired password. However, simple adding of PS-related statements (PREPARE FOR/EXECUTE/DEALLOCATE PREPARE ) to the list of statements allowed for execution by a locked user is not enough to solve problems, since it opens the opportunity for a locked user to execute any statement in the PS mode. To exclude this opportunity, additional checking that the statement being prepared for execution in PS-mode is the SET statement has to be added. This extra checking has been added by this patch into the method Prepared_statement::prepared() that executed on preparing any statement for execution in PS-mode.
* | | Fixed assert in WSREP if one started with --wsrep_provider=.. --wsrep_on=OFFMonty2021-04-122-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Assert was: mariadbd: /my/maria-10.6/wsrep-lib/src/client_state.cpp:256: int wsrep::client_state::after_statement(): Assertion `state() == s_exec' The reason was because of two faults: - A missing test for WSREP(thd) when checking wsrep_after_statement(() - THD->wsrep_cs().state was set to s_idle instead of s_none
* | | MDEV-23634: Select query hanged the server and leads to OOM ...bb-10.4-mdev23634Sergei Petrunia2021-04-082-22/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Handle "col<>const" in the same way that MDEV-21958 did for "col NOT IN(const-list)": do not use the condition for range/index_merge accesses if there is a unique UNIQUE KEY(col). The testcase is in main/range.test. The rest of test updates are due to widespread use of 'pk<>1' in the testsuite. Changed the test to use different but equivalent forms of the conditions.
* | | MDEV-25334 FTWRL/Backup blocks DDL on temporary tables with binlog enabled, ↵Monty2021-04-071-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | assertion fails in Diagnostics_area::set_error_status Fixed by adding a MDL_BACKUP_COMMIT lock before altering temporary tables whose creation was logged to binary log (in which case the ALTER TABLE must also be logged)