summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.3 into 10.4Marko Mäkelä2022-04-21111-527/+3127
|\
| * MDEV-28369 ibuf_bitmap_mutex is an unnecessary contention pointMarko Mäkelä2022-04-216-50/+14
| | | | | | | | | | | | | | | | | | | | The only purpose of ibuf_bitmap_mutex is to prevent a deadlock between two concurrent invocations of ibuf_update_free_bits_for_two_pages_low() on the same pair of bitmap pages, but in opposite order. The mutex is unnecessarily serializing the execution of the function even when it is being invoked on totally different tablespaces. To avoid deadlocks, it suffices to ensure that the two page latches are being acquired in a deterministic (sorted) order.
| * MDEV-20194 Warnings inconsistently issued upon CHECK on table from older ↵Thirunarayanan Balathandayuthapani2022-04-203-9/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | versions The following condition has to added: 1) InnoDB fails to include the offset of the node pointer field in non-leaf record for redundant row format. 2) If the Fixed length field does have only prefix length then calculate the field maximum size as prefix length. - Added the test case to test (2) and to check maximum number of fields can exist in the index.
| * MDEV-28314 : The Galera cluster primary node goes into hang mode when ↵Jan Lindström2022-04-204-1/+230
| | | | | | | | | | | | | | | | | | | | | | innodb_encryption_threads is enabled When we enable writes after Galera SST srv_n_fil_crypt_threads needs to be set temporally to 0 (as was done when writes were disabled) to make sure that encryption threads will be really started based on old value of encryption threads. Fix provided by Marko Mäkelä.
| * MDEV-24176 fixup: GCC -Wmaybe-uninitializedMarko Mäkelä2022-04-191-1/+1
| |
| * MDEV-24176 Server crashes after insert in the table with virtualAleksey Midenkov2022-04-1810-87/+342
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | column generated using date_format() and if() vcol_info->expr is allocated on expr_arena at parsing stage. Since expr item is allocated on expr_arena all its containee items must be allocated on expr_arena too. Otherwise fix_session_expr() will encounter prematurely freed item. When table is reopened from cache vcol_info contains stale expression. We refresh expression via TABLE::vcol_fix_exprs() but first we must prepare a proper context (Vcol_expr_context) which meets some requirements: 1. As noted above expr update must be done on expr_arena as there may be new items created. It was a bug in fix_session_expr_for_read() and was just not reproduced because of no second refix. Now refix is done for more cases so it does reproduce. Tests affected: vcol.binlog 2. Also name resolution context must be narrowed to the single table. Tested by: vcol.update main.default vcol.vcol_syntax gcol.gcol_bugfixes 3. sql_mode must be clean and not fail expr update. sql_mode such as MODE_NO_BACKSLASH_ESCAPES, MODE_NO_ZERO_IN_DATE, etc must not affect vcol expression update. If the table was created successfully any further evaluation must not fail. Tests affected: main.func_like Reviewed by: Sergei Golubchik <serg@mariadb.org>
| * MDEV-24176 PreparationsAleksey Midenkov2022-04-187-115/+110
| | | | | | | | | | | | | | | | | | 1. moved fix_vcol_exprs() call to open_table() mysql_alter_table() doesn't do lock_tables() so it cannot win from fix_vcol_exprs() from there. Tests affected: main.default_session 2. Vanilla cleanups and comments.
| * MDEV-27699 ANALYZE FORMAT=JSON fields are incorrect for UNION ALL queriesOleg Smirnov2022-04-186-78/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | UNION ALL queries are a subject of optimization introduced in MDEV-334 when creation of a temporary table is skipped. While there is a check for this optimization in Explain_union::print_explain() there was no such in Explain_union::print_explain_json(). This resulted in printing irrelevant data like: "union_result": { "table_name": "<union2,3>", "access_type": "ALL", "r_loops": 0, "r_rows": null in case when creation of the temporary table was actually optimized out. This commits adds a check whether the temporary table was actually created during the UNION ALL processing and eliminates printing of the irrelevant data.
| * An additional patch for MDEV-27690 Crash on `CHARACTER SET csname COLLATE ↵Alexander Barkov2022-04-143-8/+63
| | | | | | | | | | | | DEFAULT` in column definition Applying the fix to sql_yacc_ora.yy. Adding a test for sql_mode=ORACLE.
| * Merge remote-tracking branch 'origin/10.2' into 10.3Alexander Barkov2022-04-1419-23/+374
| |\
| | * MDEV-27448 MTR returns success (zero) upon invalid optionShunpoco2022-04-121-1/+1
| | | | | | | | | | | | | | | I change from `exit;` to `exit(1);` on a function `usage()`. When we try to run mtr with a wrong option, a function `usage()` is called with the wrong option as its argument. In this case, because the function call `exit` in a first if statement, we get exit status 0.
| | * MDEV-27690 Crash on `CHARACTER SET csname COLLATE DEFAULT` in column definitionAlexander Barkov2022-04-113-8/+46
| | | | | | | | | | | | | | | | | | | | | This is a temporary fix for 10.2. This problem was permanently fixed in 10.9 under terms of MDEV-27743. This patch should propagate up to 10.8 then null-merged to 10.9.
| | * MDEV-28225 Disallow user to create Spider temporary tableKiyoshiTakeda2022-04-113-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Creating a temporary table with Spider is non-sense because a Spider table cannot hold any physical data and it requires an additional effort to manage even if it is configured correctly. Set HTON_TEMPORARY_NOT_SUPPORTED to spider_hton->flags. Reviewed-by: nayuta.yanagisawa@hey.com Co-authored-by: d8sk4ueun@gmail.com
| | * MDEV-27065 Partitioning tables with custom data directories moves data back ↵Nayuta Yanagisawa2022-04-085-4/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to default directory The partitioning engine does not support the table-level DATA/INDEX DIRECTORY specification. If one create a non-partitioned table with the DATA/INDEX DIRECTORY option and then performs ALTER TABLE ... PARTITION BY on it, the DATA/INDEX DIRECTORY specification of the old schema is ignored. The behavior might be a bit surprising for users because the value of a usual table option applies to all the partitions. Thus, we raise a warning on such ALTER TABLE ... PARTITION BY.
| | * Better comments in Item_in_subselect::inject_in_to_exists_cond()Sergei Petrunia2022-04-071-1/+6
| | |
| | * MDEV-28077 'Wrong create options' error with 'big_tables' enabledOleg Smirnov2022-04-066-2/+78
| | | | | | | | | | | | | | | | | | The cause of the bug is overflow of uint16 KEY_PART_INFO::length and/or uint16 KEY_PART_INFO::store_length. The solution is to increase the size of those variables to the 'uint' type (which is 32-bit long)
| | * MDEV-24560 SIGSEGV in st_join_table::cleanupOleg Smirnov2022-04-065-7/+116
| | | | | | | | | | | | | | | | | | | | | If JOIN::create_postjoin_aggr_table encounters errors during execution then free_tmp_table() is then called twice for JOIN_TAB::aggr. The solution is to initialize JOIN_TAB::aggr only on successful completion of JOIN::create_postjoin_aggr_table
| * | MDEV-28266 Crash in Field_string::type_handler when calling proceduresOleksandr Byelkin2022-04-131-13/+3
| | | | | | | | | | | | | | | | | | on_table_fill_finished() should always be done at the end of open() even if result is not Select_materialize but (for example) Select_fetch_into_spvars.
| * | MDEV-28304 innodb.instant_alter,8k.rdiff does not apply on FreeBSDMarko Mäkelä2022-04-134-91/+83
| | | | | | | | | | | | | | | | | | This is conceptually a backport of commit 6f4740fde709b94681bab6d66317ddabeac2c252 (re-recording the .rdiff files).
| * | MDEV-26171: wsrep_sst_receive_address does not parse IPv6 address correctlyJulius Goryavsky2022-04-1222-123/+555
| | | | | | | | | | | | | | | | | | | | | | | | This commit fixes problems with parsing ipv6 addresses given via the wsrep_sst_receive_address and wsrep_node_address options. Also, this commit removes extra lines in the configuration files in the mtr test suites for Galera related to these parameters.
| * | MDEV-27834 Incorrect provides of MariaDB-shared for CentOS8Sergei Golubchik2022-04-121-3/+1
| | | | | | | | | | | | fix bad merge
| * | MDEV-24317 Data race in LOGGER::init_error_log at sql/log.cc:1443 and in ↵Sergei Golubchik2022-04-124-17/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LOGGER::error_log_print at sql/log.cc:1181 don't initialize error_log_handler_list in set_handlers() * error_log_handler_list is initialized to LOG_FILE early, in init_base() * set_handlers always reinitializes it to LOG_FILE, so it's pointless * after init_base() concurrent threads start using sql_log_warning, so following set_handlers() shouldn't modify error_log_handler_list without some protection
| * | MDEV-28269 Assertion `save_errno' in maria_write or ER_GET_ERRNOMonty2022-04-114-2/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The issue was that the value of MARIA_FOUND_WRONG_KEY was a value that could be returned by ha_key_cmp. This was already fixed in MyISAM, now using the same fix in Aria: Setting the value to INT_MAX32, which should be impossible in any normal cases. I also fixed so that if there is a wrong key, we now get a proper error message and not an assert.
| * | MDEV-28267 ASAN heap-use-after-free in Item_sp::func_name_cstringAlexander Barkov2022-04-096-5/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This crash happens on a combination of multiple conditions: - There is a thead#1 running an "ANALYZE FORMAT=JSON" query for a "SELECT .. FROM INFORMATION_SCHEMA.COLUMNS WHERE .. " - The WHERE clause contains a stored function call, say f1(). - The WHERE clause is built in the way so that the function f1() is never actually called, e.g. WHERE .. AND (TRUE OR f1()=expr) - The database contains multiple VIEWs that have the function f1() call, e.g. in their <select list> - The WHERE clause is built in the way so that these VIEWs match the condition. - There is a parallel thread#2 running. It creates or drops or recreates some other stored routine, say f2(), which is not used in the ANALYZE query. It effectively invalidates the stored routine cache for thread#1 without locking. Note, it is important that f2() is NOT used by ANALYZE query. Otherwise, thread#2 would be locked until the ANALYZE query finishes. When all of the above conditions are met, the following happens: 1. thread#1 starts the ANALYZE query. It notices a call for the stored function f1() in the WHERE condition. The function f1() gets parsed and cached to the SP cache. Its address also gets assigned to Item_func_sp::m_sp. 2. thread#1 starts iterating through all tables that match the WHERE condition to find the information about their columns. 3. thread#1 processes columns of the VIEW v1. It notices a call for f1() in the VIEW v1 definition. But f1() is already cached in the step#1 and it is up to date. So nothing happens with the SP cache. 4. thread#2 re-creates f2() in a non-locking mode. It effectively invalidates the SP cache in thread#1. 5. thread#1 processes columns of the VIEW v2. It notices a call for f1() in the VIEW v2 definition. It also notices that the cached version of f1() is not up to date. It frees the old definition of f1(), parses it again, and puts a new version of f1() to the SP cache. 6. thread#1 finishes processing rows and generates the JSON output. When printing the "attached_condition" value, it calls Item_func_sp::print() for f1(). But this Item_func_sp links to the old (freed) version of f1(). The above scenario demonstrates that Item_func_sp::m_sp can point to an alredy freed instance when Item_func_sp::func_name() is called, so accessing to Item_sp::m_sp->m_handler is not safe. This patch rewrites the code to use Item_func_sp::m_handler instead, which is always reliable. Note, this patch is only a cleanup for MDEV-28166 to quickly fix the regression. It fixes MDEV-28267. But it does not fix the core problem: The code behind I_S does not take into account that the SP cache can be updated while evaluating rows of the COLUMNS table. This is a corner case and it never happens with any other tables. I_S.COLUMNS is very special. Another example of the core problem is reported in MDEV-25243. The code accesses to Item_sp::m_sp->m_chistics of an already freed m_sp, again. It will be addressed separately.
| * | MDEV-22282 When using mysqldump to backup a view that contains derived ↵Sergei Golubchik2022-04-096-14/+15
| | | | | | | | | | | | | | | | | | | | | tables, the database name is prepended to each table in the view derived tables have db = "", table_name = "*", those aren't real names to be compared with.
| * | MDEV-28062 Assertion `(length % 4) == 0' failed in my_lengthsp_utf32 on ↵Alexander Barkov2022-04-082-0/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | INSERT..SELECT Adding an MTR test only. This problem was earlier fixed by the patch for: MDEV-28078 Garbage on multiple equal ENUMs with tricky character sets
| * | MDEV-25116 Spider: IF(COUNT( trigger SQL Error (1054)_ Unknown column '' in ↵Nayuta Yanagisawa2022-04-084-2/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | field list The original query "SELECT IF(COUNT(a.`id`)>=0,'Y','N') FROM t" is transformed to "SELECT COUNT(a.`id`), IF(ref >= 0, 'Y', 'N') FROM t", where ref is Item_ref to "COUNT(a.`id`)", by split_sum_func(). Spider walks the item list twice, invoking spider_db_print_item_type(). The first invocation is in spider_create_group_by_handler() with str == NULL. The second one is in spider_group_by_handler::init_scan() with str != NULL. spider_db_print_item_type() prints nothing at the first invocation, and it prints item at the second invocation. However, at the second invocation, the above mentioned ref to "COUNT(a.`id`)" points to a field in a temporary table where the result will be stored. Thus, to look behind the item_ref, Spider need to generate the query earlier. A possible fix would be to generate a query to send in spider_create_group_by_handler(). However, the fix requires a considerable amount of changes of the Spider's GROUP BY handler. I'd like to avoid that. So, I fix the problem by not to use the GROUP BY handler when a query contains Item_ref whose table_name, name, and alias_name_used are not set.
| * | MDEV-28253 Mysqldump - INVISIBLE column errorSergei Golubchik2022-04-078-11/+34
| | |
| * | MDEV-28205: SST via mariabackup stops on failure while archiving logsJulius Goryavsky2022-04-075-8/+511
| | | | | | | | | | | | | | | | | | | | | | | | | | | Currenly SST script for mariabackup stops on any failure while archiving logs, e.g. when unable to create directory, insufficient permissions, gzip failure, etc. However, in case of such problems, the script should issue a warning and continue without archiving, but not exit with a fatal error. This commit adds this fix to the SST script for mariabackup.
* | | MDEV-28227 Error message Chinese translationHaidong Ji2022-04-215-880/+2024
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Simplified Chinese translation added - Character encoding is gdk -- gdk covers more characters -- gdk includes both Simplified and Traditional -- best option I think, may need to work along with other locale settings - Other cleanup -- Within each error, messages are sorted according to language code -- More consistent formatting (8 spaces proceeding each translation) -- jps removed as duplicate of jpn translation This should be a good starting point. More refinement is appreciated, and needed down the road. English "containt" (sic) spelling fixes on ER_FK_NO_INDEX_{CHILD,PARENT} resulting in mtr test case adjustments. Edited/reviewed by Daniel Black
* | | MDEV-26575 Crash on shutdown after starting an XA transactionDaniele Sciascia2022-04-203-1/+28
| | | | | | | | | | | | | | | | | | Disallow XA when Galera library is loaded. Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
* | | MDEV-28329 : galera_3nodes.galera_garbd_backup fails with extra connection linesJan Lindström2022-04-191-0/+2
| | | | | | | | | | | | Add missing connection lines to result set
* | | MDEV-24529 Assertion failed in vers_select_conds_t::printOleg Smirnov2022-04-183-1/+28
| | | | | | | | | | | | | | | This commit adds processing of SYSTEM_TIME_BEFORE and SYSTEM_TIME_HISTORY to vers_select_conds_t::print().
* | | Disable galera_bf_abort_ps_bind under --ps-protocolDaniele Sciascia2022-04-161-0/+1
| | |
* | | MDEV-22266: Diagnostics_area::sql_errno() const: AssertionRucha Deodhar2022-04-123-1/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `m_status == DA_ERROR' failed on SELECT after setting tmp_disk_table_size. Analysis: Mismatch in number of warnings between "194 warnings" vs "64 rows in set" is because of max_error_count variable which has default value of 64. About the corrupted tables, the error that occurs because of insufficient tmp_disk_table_size variable is not reported correctly and we continue to execute the statement. But because the previous error (about table being full)is not reported correctly, this error moves up the stack and is wrongly reported as parsing error later on while parsing frm file of one of the information schema table. This parsing error gives corrupted table error. As for the innodb error, it occurs even when tmp_disk_table_size is not insufficient is default but the internal error handler takes care of it and the error doesn't show. But when tmp_disk_table_size is insufficient, the fatal error which wasn't reported correctly moves up the stack so internal error handler is not called. So it shows errors. Fix: Report the error correctly.
* | | Remove a garbage file from mysql-testbb-10.4-osmirnovOleg Smirnov2022-04-071-0/+0
| | |
* | | Merge 10.3 into 10.4Marko Mäkelä2022-04-073-1/+508
|\ \ \ | |/ /
| * | MDEV-28247 : Disable background ibuf merge during Galera SSTJan Lindström2022-04-071-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | This failure was caused by MDEV-25975, which removed the parameter innodb_disallow_writes. Added a check for wsrep_sst_disable_writes to the function ibuf_merge_in_background().
| * | Adding MTR tests to cover how keywords of different kinds behave in various ↵Alexander Barkov2022-04-072-0/+498
| | | | | | | | | | | | contexts
* | | MDEV-25975 merge fixupMarko Mäkelä2022-04-063-11/+6
| | |
* | | MDEV-25975: Merge 10.3 into 10.4Marko Mäkelä2022-04-0633-465/+179
|\ \ \ | |/ /
| * | MDEV-25975 innodb_disallow_writes causes shutdown to hangMarko Mäkelä2022-04-0630-398/+229
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We will remove the parameter innodb_disallow_writes because it is badly designed and implemented. The parameter was never allowed at startup. It was only internally used by Galera snapshot transfer. If a user executed SET GLOBAL innodb_disallow_writes=ON; the server could hang even on subsequent read operations. During Galera snapshot transfer, we will block writes to implement an rsync friendly snapshot, as follows: sst_flush_tables() will acquire a global lock by executing FLUSH TABLES WITH READ LOCK, which will block any writes at the high level. sst_disable_innodb_writes(), invoked via ha_disable_internal_writes(true), will suspend or disable InnoDB background tasks or threads that could initiate writes. As part of this, log_make_checkpoint() will be invoked to ensure that anything in the InnoDB buf_pool.flush_list will be written to the data files. This has the nice side effect that the Galera joiner will avoid crash recovery. The changes to sql/wsrep.cc and to the tests are based on a prototype that was developed by Jan Lindström. Reviewed by: Jan Lindström
* | | MDEV-23328 fixup: sign mismatch in format stringsMarko Mäkelä2022-04-061-5/+6
| | | | | | | | | | | | | | | | | | kill_one_thread(): Fix integer sign mismatch in some format strings. Some of this was introduced in commit 5c230b21bfa582ac304db526c3638c514cf98b13
* | | Merge 10.3 into 10.4Marko Mäkelä2022-04-0633-481/+427
|\ \ \ | |/ /
| * | Merge 10.2 into 10.3Marko Mäkelä2022-04-0614-306/+84
| |\ \ | | |/
| | * MDEV-26136: Correct AIX/macOS cast warning (my_time.h)Daniel Black2022-04-041-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tv_usec is a (suseconds_t) so we cast to it. Prevents the AIX(gcc-10) warning: include/my_time.h: In function 'void my_timeval_trunc(timeval*, uint)': include/my_time.h:249:65: warning: conversion from 'long int' to 'suseconds_t' {aka 'int'} may change value [-Wconversion] 249 | tv->tv_usec-= my_time_fraction_remainder(tv->tv_usec, decimals); | macOS is: conversion from 'long int' to '__darwin_suseconds_t' {aka 'int'} may change value On Windows suseconds_t isn't defined so we use the existing long return type of my_time_fraction_remainder. Reviewed by Marko Mäkelä Closes: #2079
| | * MDEV-27343 Useless warning "InnoDB: Allocated tablespace ID <id> for ↵Vlad Lesin2022-03-303-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | <tablename>, old maximum was 0" during backup stage mariabackup does not load dictionary during backup, but it loads tablespaces, that is why fil_system.max_assigned_id is not set with dict_check_tablespaces_and_store_max_id(). There is no sense to issue the warning during backup.
| | * Cleanup: Remove some unused functionsMarko Mäkelä2022-03-304-279/+4
| | |
| | * MDEV-19631: Assertion `0' failed in st_select_lex_unit::optimize or ↵Dmitry Shulga2022-03-303-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | different plan upon 2nd execution of PS with EXPLAIN Second execution of a prepared statement for a query containing a constant subquery with union that can be optimized away, could result in server abnormal termination for debug build or incorrect result set output for release build. For example, the following test case crashes a server built with debug on second run of the statement EXECUTE stmt CREATE TABLE t1 (a INT); PREPARE stmt FROM 'EXPLAIN SELECT * FROM t1 HAVING 6 IN ( SELECT 6 UNION SELECT 5 )'; EXECUTE stmt; EXECUTE stmt; The reason for incorrect result set output or abnormal server termination is careless working with the data member fake_select_lex->options inside the function mysql_explain_union(). Once the flag SELECT_DESCRIBE is set in the data member fake_select_lex->option before calling the methods SELECT_LEX_UNIT::prepare/SELECT_LEX_UNIT::execute the original value of the option is no longer restored. As a consequence, next time the prepared statement is re-executed we have the fake_select_lex with the flag SELECT_DESCRIBE set in the data member fake_select_lex->option, that is incorrect. In result, the method Item_subselect::assigned() is not invoked during evaluation of a constant condition (constant subquery with union) that being performed on OPTIMIZE phase of query handling. This leads to the fact that records in the temporary table are not deleted before calling table->file->ha_enable_indexes(HA_KEY_SWITCH_ALL) in the method st_select_lex_unit::optimize(). In result table->file->ha_enable_indexes(HA_KEY_SWITCH_ALL) returns error and DBUG_ASSERT(0) is fired. Stack trace to the line where the error generated on re-enabling indexes for next subselect iteration is below: st_select_lex_unit::optimize (at sql_union.cc:954) handler::ha_enable_indexes (at handler.cc:4338) ha_heap::enable_indexes (at ha_heap.cc:519) heap_enable_indexes (at hp_clear.c:164) The code snippet to clarify raising the error is also listed: int heap_enable_indexes(HP_INFO *info) { int error= 0; HP_SHARE *share= info->s; if (share->data_length || share->index_length) error= HA_ERR_CRASHED; <<== set error the value HA_ERR_CRASHED since share->data_length != 0 To fix this issue the original value of unit->fake_select_lex->options has to be saved before setting the flag SELECT_DESCRIBE and restored on return from invocation of SELECT_LEX_UNIT::prepare/SELECT_LEX_UNIT::execute
| | * MDEV-27835 innochecksum -S crashes for encrypted .ibd tablespaceVlad Lesin2022-03-293-27/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As main() invokes parse_page() when -S or -D are set, it can be a case when parse_page() is invoked when -D filename is not set, that is why any attempt to write to page dump file must be done only if the file name is set with -D. The bug is caused by 2ef7a5a13a988842450cbeeaceaf0ea1a78a3c27 (MDEV-13443).