- 25 Apr, 2022 1 commit
-
-
Marko Mäkelä authored
In merge commit 921c5e93 the call log_free_check() was accidentally duplicated, causing a small performance regression on INSERT.
-
- 22 Apr, 2022 2 commits
-
-
Aleksey Midenkov authored
Implicit system-versioned table does not contain system fields in SHOW CREATE. Therefore after mysqldump recovery such table has system fields in the last place in frm image. The original table meanwhile does not guarantee these system fields on last place because adding new fields via ALTER TABLE places them last. Thus the order of fields may be different between master and slave, so row-based replication may fail. To fix this on ALTER TABLE we now place system-invisible fields always last in frm image. If the table was created via old revision and has an incorrect order of fields it can be fixed via any copy operation of ALTER TABLE, f.ex.: ALTER TABLE t1 FORCE; To check the order of fields in frm file one can use hexdump: hexdump -C t1.frm Note, the replication fails only when all 3 conditions are met: 1. row-based or mixed mode replication; 2. table has new fields added via ALTER TABLE; 3. table was rebuilt on some, but not all nodes via mysqldump image. Otherwise it will operate properly even with incorrect order of fields.
-
Aleksey Midenkov authored
vers_info->hist_part retained stale value after ROLLBACK. The algorithm in vers_set_hist_part() continued iteration from that value. The simplest solution is to process partitions each time from start for LIMIT in vers_set_hist_part().
-
- 21 Apr, 2022 3 commits
-
-
Sergei Golubchik authored
-
Sergei Golubchik authored
-
Marko Mäkelä authored
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.
-
- 20 Apr, 2022 3 commits
-
-
Sergei Golubchik authored
if the view has algorithm=temptable it is not updatable, so DEFAULT() for its fields is meaningless, and thus it's NULL or 0/'' for NOT NULL columns.
-
Thirunarayanan Balathandayuthapani authored
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.
-
Jan Lindström authored
MDEV-28314 : The Galera cluster primary node goes into hang mode when 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ä.
-
- 19 Apr, 2022 4 commits
-
-
Sergei Golubchik authored
because CONTEXT_ANALYSIS_ONLY_VCOL_EXPR can be used only for, exactly, context analysys. Items fixed that way cannot be evaluated. But vcols are going to be evaluated, so they have to be fixed properly, for evaluation.
-
Sergei Golubchik authored
add test
-
Marko Mäkelä authored
Starting with 10.3, an assertion would fail on the rollback of a recovered incomplete transaction if a table definition violates a FOREIGN KEY constraint. DICT_ERR_IGNORE_RECOVER_LOCK: Include also DICT_ERR_IGNORE_FK_NOKEY so that trx_resurrect_table_locks() will be able to load table definitions and resurrect IX locks. Previously, if the FOREIGN KEY constraints of a table were incomplete, the table would fail to load until rollback, and in 10.3 or later an assertion would fail that the rollback was not protected by a table IX lock. Thanks to commit 9de2e60d there will be no problems to enforce subsequent FOREIGN KEY operations even though a table with invalid REFERENCES clause was loaded.
-
Marko Mäkelä authored
-
- 18 Apr, 2022 3 commits
-
-
Aleksey Midenkov authored
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>
-
Aleksey Midenkov authored
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.
-
Oleg Smirnov authored
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.
-
- 15 Apr, 2022 1 commit
-
-
Oleksandr Byelkin authored
Removed prohibition of creating temporary field of Item_default_value (added by mistake by 1d9b043a fix of MDEV-10780 and MDEV-11265).
-
- 14 Apr, 2022 8 commits
-
-
Sergei Golubchik authored
When fixing vcols, fix_fields might call convert_const_to_int(). And that will try to read the field value (from record[0]). Mark the table as having no data to prevent that, because record[0] is not initialized yet.
-
Sergei Golubchik authored
the bug was that in_vector array in Item_func_in was allocated in the statement arena, not in the table->expr_arena. revert part of the 5acd391e. Instead, change the arena correctly in fix_all_session_vcol_exprs(). Remove TABLE_ARENA, that was introduced in 5acd391e to force item tree changes to be rolled back (because they were allocated in the wrong arena and didn't persist. now they do)
-
Sergei Golubchik authored
-
Sergei Golubchik authored
* Item_default_value::fix_fields creates a copy of its argument's field. * Field::default_value is changed when its expression is prepared in unpack_vcol_info_from_frm() This means we must unpack any vcol expression that includes DEFAULT(x) strictly after unpacking x->default_value. To avoid building and solving this dependency graph on every table open, we update Item_default_value::field->default_value after all vcols are unpacked and fixed.
-
Alexander Barkov authored
-
Daniel Black authored
bt full - to include args and locals. set print sevenbit on - it is more useful to be able to see the exact bytes (in case something is dumped as a string and not hexadecimal digits) set print static-members off - there are many interesting (non-const) static members set frame-arguments all - even non-printables are useful to see. Let's make our bb logs give a little bit more detail on those hard to reproduce bugs. Tests on rhel7's gdb-7.6.1-120.el7
-
Alexander Barkov authored
An additional patch for MDEV-27690 Crash on `CHARACTER SET csname COLLATE DEFAULT` in column definition Applying the fix to sql_yacc_ora.yy. Adding a test for sql_mode=ORACLE.
-
Alexander Barkov authored
-
- 13 Apr, 2022 2 commits
-
-
Oleksandr Byelkin authored
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.
-
Marko Mäkelä authored
This is conceptually a backport of commit 6f4740fd (re-recording the .rdiff files).
-
- 12 Apr, 2022 3 commits
-
-
Julius Goryavsky authored
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.
-
Sergei Golubchik authored
fix bad merge
-
Sergei Golubchik authored
MDEV-24317 Data race in LOGGER::init_error_log at sql/log.cc:1443 and in 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
-
- 11 Apr, 2022 4 commits
-
-
Shunpoco authored
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.
-
Alexander Barkov authored
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.
-
Monty authored
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.
-
KiyoshiTakeda authored
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
-
- 09 Apr, 2022 2 commits
-
-
Alexander Barkov authored
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.
-
Sergei Golubchik authored
MDEV-22282 When using mysqldump to backup a view that contains derived 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.
-
- 08 Apr, 2022 3 commits
-
-
Nayuta Yanagisawa authored
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.
-
Alexander Barkov authored
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
-
Nayuta Yanagisawa authored
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.
-
- 07 Apr, 2022 1 commit
-
-
Sergei Golubchik authored
-