- 21 Oct, 2022 5 commits
-
-
Daniel Black authored
st_select_lex::init_query is called in the exectuion of EXECUTE IMMEDIATE 'alter table ...'. so reset the initialization at the same point we set join= 0.
-
Sergei Petrunia authored
and also MDEV-25564, MDEV-18157. Attempt to produce EXPLAIN output caused a crash in Explain_node::print_explain_for_children. The cause of this was that an Explain_node (actually a derived) had a link to child select#N, but there was no query plan present for select#N. The query plan wasn't present because the subquery was eliminated. - Either it was a degenerate subquery like "(SELECT 1)" in MDEV-25564. - Or it was a subquery in a UNION subquery's ORDER BY clause: col IN (SELECT ... UNION SELECT ... ORDER BY (SELECT FROM t1)) In such cases, legacy code structure in subquery/union processing code(*) makes it hard to detect that the subquery was eliminated, so we end up with EXPLAIN data structures (Explain_node::children) having dangling links to child subqueries. Do make the checks and don't follow the dangling links. (In ideal world, we should not have these dangling links. But fixing the code (*) would have high risk for the stable versions).
-
Anel authored
Reviewer: andrew@mariadb.org
-
Thirunarayanan Balathandayuthapani authored
InnoDB fails to fetch FTS_DOC_ID if the select query uses secondary index. So always do extra lookup on clustered index in case of fts query
-
kurt authored
Add a test related to the Encrypted Key File by following instructions in kb example https://mariadb.com/kb/en/file-key-management-encryption-plugin/#creating-the-key-file Reviewed by Daniel Black (with minor formatting and re-org of duplicate close(f) calls).
-
- 19 Oct, 2022 4 commits
-
-
Alexey Botchkov authored
Disallow subqueries in The PARTITIN BY INTERVAL syntax. Fix various interval types that now fail as they break syntax in the par file.
-
Daniel Black authored
This reverts commit cee7175b.
-
kurt authored
-
kurt authored
-
- 18 Oct, 2022 3 commits
-
-
Daniel Black authored
The population of default values in INSERT SELECT was being performed twice. With sequences, this resulted in every second sequence value being used. With SELECT INSERT we remove the second invokation of table->update_default_fields(). This was already performed in store_values() invoking fill_record_n_invoke_before_triggers() which invoked update_default_fields() previously. We do need to return an error on duplicate values, so the ::store_values is extended to take the ignore option.
-
Marko Mäkelä authored
-
Anel Husakovic authored
=========== Problem ============= - `show columns` is not working for temporary tables, even though there is enough privilege `create temporary tables`. =========== Solution ============= - Append `TMP_TABLE_ACLS` privilege when running `show columns` for temp tables. - Additionally `check_access()` for database only once, not for each field =========== Additionally ============= - Update comments for function `check_table_access` arguments Reviewed by: <vicentiu@mariadb.org>
-
- 17 Oct, 2022 1 commit
-
-
Dmitry Shulga authored
For some queries that involve tables with different but convertible character sets for columns taking part in the query, repeatable execution of such queries in PS mode or as part of a stored routine would result in server abnormal termination. For example, CREATE TABLE t1 (a2 varchar(10)); CREATE TABLE t2 (u1 varchar(10) CHARACTER SET utf8); CREATE TABLE t3 (u2 varchar(10) CHARACTER SET utf8); PREPARE stmt FROM "SELECT t1.* FROM (t1 JOIN t2 ON (t2.u1 = t1.a2)) WHERE (EXISTS (SELECT 1 FROM t3 WHERE t3.u2 = t1.a2))"; EXECUTE stmt; EXECUTE stmt; <== Running this prepared statement the second time results in server crash. The reason of server crash is that an instance of the class Item_func_conv_charset, that created for conversion of a column from one character set to another, is allocated on execution memory root but pointer to this instance is stored in an item placed on prepared statement memory root. Below is calls trace to the place where an instance of the class Item_func_conv_charset is created. setup_conds Item_func::fix_fields Item_bool_rowready_func2::fix_length_and_dec Item_func::setup_args_and_comparator Item_func_or_sum::agg_arg_charsets_for_comparison Item_func_or_sum::agg_arg_charsets Item_func_or_sum::agg_item_set_converter Item::safe_charset_converter And the following trace shows the place where a pointer to the instance of the class Item_func_conv_charset is passed to the class Item_func_eq, that is created on a memory root of the prepared statement. Prepared_statement::execute mysql_execute_command execute_sqlcom_select handle_select mysql_select JOIN::optimize JOIN::optimize_inner convert_join_subqueries_to_semijoins convert_subq_to_sj To fix the issue, switch to the Prepared Statement memory root before calling the method Item_func::setup_args_and_comparator in order to place any created Items on permanent memory root. It may seem that such approach would result in a memory leakage in case the parameter marker '?' is used in the query as in the following example PREPARE stmt FROM "SELECT t1.* FROM (t1 JOIN t2 ON (t2.u1 = t1.a2)) WHERE (EXISTS (SELECT 1 FROM t3 WHERE t3.u2 = ?))"; EXECUTE stmt USING convert('A' using latin1); but it wouldn't since for such case any of the parameter markers is treated as a constant and no subquery to semijoin optimization is performed.
-
- 16 Oct, 2022 3 commits
-
-
Oleksandr Byelkin authored
-
Anel authored
* ODBC Connect cosmetic fixes - Update command for connection for default `peer` authentication for user `postgres` (unless changed in `pg_hba.conf`). - Update command for privilege to be more verbose. - Update path for `.sql` file - Update instructions for `pg_hba.conf` file to use unix socket (`local`) type as well as TCP/IP type `host`. - Update instruction about usage of user dsn (data source file) over system dsn. - Update path of `odbc-postgresql` driver path in comment * Connect SE: update ODBC result file
-
Brad Smith authored
-
- 15 Oct, 2022 1 commit
-
-
Sergei Golubchik authored
should be the same behavior as for virtual columns: * a warning on every inserted row * silently ignored in a trigger
-
- 14 Oct, 2022 3 commits
-
-
Marko Mäkelä authored
This fixes up 3d9b350a
-
Marko Mäkelä authored
-
Oleksandr Byelkin authored
-
- 13 Oct, 2022 1 commit
-
-
Marko Mäkelä authored
WITH_EMBEDDED_SERVER compiles the SQL parsers separately. Thanks to Vladislav Vaintroub for helping with this. Fixes up commit e05ab0cf
-
- 12 Oct, 2022 2 commits
-
-
Nikita Malyavin authored
See also commits aa8a31da and 64678c for a Bug #22990029 fix. In this scenario INSERT chose to check if delete unmarking is available for a just deleted record. To build an update vector, it needed to calculate the vcols as well. Since this INSERT was not IGNORE-flagged, recalculation failed. Solutiuon: temporarily set abort_on_warning=true, while calculating the column for delete-unmarked insert.
-
Nikita Malyavin authored
As of now innodb does not store trx_id for each record in secondary index. The idea behind is following: let us store only per-page max_trx_id, and delete-mark the records when they are deleted/updated. If the read starts, it rememders the lowest id of currently active transaction. Innodb refers to it as trx->read_view->m_up_limit_id. See also ReadView::open. When the page is fetched, its max_trx_id is compared to m_up_limit_id. If the value is lower, and the secondary index record is not delete-marked, then this page is just safe to read as is. Else, a clustered index could be needed ato access. See page_get_max_trx_id call in row_search_mvcc, and the corresponding switch (row_search_idx_cond_check(...)) below. Virtual columns are required to be updated in case if the record was delete-marked. The motivation behind it is documented in Row_sel_get_clust_rec_for_mysql::operator() near row_sel_sec_rec_is_for_clust_rec call. This was basically a description why virtual column computation can normally happen during SELECT, and, generally, a vcol index access. Sometimes stats tables are updated by innodb. This starts a new transaction, and it can happen that it didn't finish to the moment of SELECT execution, forcing virtual columns recomputation. If the result was a something that normally outputs a warning, like division by zero, then it could be outputted in a racy manner. The solution is to suppress the warnings when a column is computed for the described purpose. ignore_wrnings argument is added innobase_get_computed_value. Currently, it is only true for a call from row_sel_sec_rec_is_for_clust_rec.
-
- 11 Oct, 2022 4 commits
-
-
Vladislav Vaintroub authored
MDEV-19243 introduced a regression on Windows. In (supposedly rare) case, where environment variable TZ was set, @@system_time_zone no longer derives from TZ. Instead, it incorrecty refers to system default time zone, eventhough UTC time conversion takes TZ into account. The fix is to restore TZ-aware handling (timezone name derives from tzname), if TZ is set.
-
Marko Mäkelä authored
-
Zhibo Zhang authored
The statement 'Verify checksum binlog events.' is confusing. Fix word order to make it clear.
-
Julius Goryavsky authored
The problem is related to performing operations without switching wsrep off, this commit fixes this and allows disabled tests.
-
- 10 Oct, 2022 2 commits
-
-
Marko Mäkelä authored
-
Marko Mäkelä authored
A previous fix in commit efd8af53 failed to cover ALTER TABLE. PageBulk::isSpaceAvailable(): Check for record heap number overflow.
-
- 09 Oct, 2022 1 commit
-
-
Anel Husakovic authored
Reviewer: <wlad@mariadb.com>
-
- 06 Oct, 2022 2 commits
-
-
Jan Lindström authored
-
Jan Lindström authored
Do not allow setting wsrep_on=ON if no provider is set.
-
- 05 Oct, 2022 8 commits
-
-
Aleksey Midenkov authored
upon CREATE OR REPLACE causing ER_UPDATE_TABLE_USED Missed set return status to 1.
-
Aleksey Midenkov authored
When f.ex. table is partitioned by HASH(a) and we rename column `a' to `b' partitioning filter stays unchanged: HASH(a). That's the wrong behavior. The patch updates partitioning filter in accordance to the new columns names. That includes partition/subpartition expression and partition/subpartition field list.
-
Aleksey Midenkov authored
For "const char *" replace() and after() accepted const as "T *" and passed forward "void *". This cannot be cast implicitly, so we better use "const void *" instead of "void *" in the input interface. This way we avoid problems with using List for any const type.
-
Vlad Lesin authored
MDEV-27927 row_sel_try_search_shortcut_for_mysql() does not latch a page, violating read view isolation btr_search_guess_on_hash() would only acquire an index page latch if it is invoked with ahi_latch=NULL. If it's invoked from row_sel_try_search_shortcut_for_mysql() with ahi_latch!=NULL, a page will not be latched, and row_search_mvcc() will get a pointer to the record, which can be changed by some other transaction before the record was stored in result buffer with row_sel_store_mysql_rec() call. ahi_latch argument of btr_cur_search_to_nth_level_func() and btr_pcur_open_with_no_init_func() is used only for row_sel_try_search_shortcut_for_mysql(). btr_cur_search_to_nth_level_func(..., ahi_latch !=0, ...) is invoked only from btr_pcur_open_with_no_init_func(..., ahi_latch !=0, ...), which, in turns, is invoked only from row_sel_try_search_shortcut_for_mysql(). I suppose that separate case with ahi_latch!=0 was intentionally implemented to protect row_sel_store_mysql_rec() call in row_search_mvcc() just after row_sel_try_search_shortcut_for_mysql() call. After the ahi_latch was moved from row_seach_mvcc() to row_sel_try_search_shortcut_for_mysql(), there is no need in it at all if btr_search_guess_on_hash() latches a page unconditionally. And if btr_search_guess_on_hash() latched the page, any access to the record in row_sel_try_search_shortcut_for_mysql() after btr_pcur_open_with_no_init() call will be protected with the page latch. The fix is to remove ahi_latch argument from btr_pcur_open_with_no_init_func(), btr_cur_search_to_nth_level_func() and btr_search_guess_on_hash(). There will not be test, as to test it we need to freeze some SELECT execution in the point between row_sel_try_search_shortcut_for_mysql() and row_sel_store_mysql_rec() calls in row_search_mvcc(), and to change the record in some other transaction to let row_sel_store_mysql_rec() to store changed record in result buffer. Buf we can't do this with the fix, as the page will be latched in btr_search_guess_on_hash() call.
-
Marko Mäkelä authored
Let us disable Valgrind on tests that would fail because a server shutdown or a STOP SLAVE command would take longer, causing the test harness to forcibly and silently kill the server due to an exceeded timeout.
-
Marko Mäkelä authored
Under Valgrind, this test may occasionally fail because the sleep-based timeouts of less than 1 second could be exceeded.
-
Marko Mäkelä authored
The test could emit some I/O error when run under Valgrind.
-
Marko Mäkelä authored
-