Console View
|
Categories: connectors experimental galera main |
|
| connectors | experimental | galera | main | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Vladislav Vaintroub
vvaintroub@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Support multi-factor authentication MySQL way - Allow to specify password2/password3 via mysql_optionsv(mysql,MYSQL_OPT_USER_PASSWORD, factor,N) - Handle 0x2 (AuthNextFactor) server packet Switch password according to factor - make sure TLS "trust" works for self-signed certificate if any of the MFA factors is password-based (e.g gssapi + mysql_native_password would use second factor's verification) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Nikita Malyavin
nikitamalyavin@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-40283 Statement restart Add an api to request statement restart, that can be used by any engine or a plugin in case of an error (thd_request_statement_restart). The retry loop runs in dispatch_command(), based on value of THD::backoff_requested. THD::backoff_dispatch_safe() guards incompatible cases. Some sql commands and server commands are incompatible with statement restart: * Statements are filtered based on blacklist (only a few statements cannot restart), with CF_FORBIDS_BACKOFF flag. * Server commands are filtered based on whitelist (only a few commands can restart), with CF_ALLOWS_BACKOFF flag. This commit enables COM_QUERY only. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Vladislav Vaintroub
vvaintroub@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-42698 follow-up: wait for pending operations in ~thd_async_state() The destructor asserted that there are no pending operations. That assumption did not hold for a legitimate case: when a connection is closed, the engine may still have an asynchronous operation in flight, from InnoDB log flush started by the rollback of the connection's transaction. This flush is not needed, this is filed as separate performance bug MDEV-42859. Until it is fixed, assertion needs to be removed, and condition wait is right thing to do. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Oleg Smirnov
olernov@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-41654 Account cost of subqueries in conditions attached to tables The optimizer costs the condition attached to a table at WHERE_COST per row. A correlated subquery in that condition is executed again for every row that reaches it, and costs far more than WHERE_COST. Plans that check the condition on many rows, such as a full scan with a join buffer, therefore look cheaper than they are compared to ref access. Collect, once per JOIN in make_join_statistics(), the top-level conjuncts of WHERE and of every ON condition that contain a subquery executed again for each evaluation: an uncacheable subquery that is not served by the subquery cache. The cost of one execution is a lower bound, as correlated subqueries are optimized only after the outer plan: one lookup into the first table of the subquery, KEY_LOOKUP_COST + ROW_LOOKUP_COST + ROW_COPY_COST of its engine. best_access_path() adds the cost of these executions to the access method of the table where the conjunct is checked. A subquery is assumed to run only for the rows that pass the cheap conjuncts, as MDEV-40439 evaluates them first: - with a join buffer, a conjunct that refers only to the table is in the scan filter, checked for the rows that pass the table's conditions on constants, once per buffer refill; - otherwise it is checked for every row combination that passes the other conditions; - in an outer join, the ON condition is checked again on the first match, or on every match with a join buffer on the last inner table. An ON conjunct on outer tables only is checked once per row combination before the inner tables are read, and again for every row of the first inner table. test_if_cheaper_ordering() adds the cost per row read for ORDER BY ... LIMIT. Row estimates do not change, only costs. The optimizer trace shows the added cost as subquery_cond_cost. The fix is OFF by default and enabled by setting FIX_SUBQUERY_COND_COST flag in @@new_mode. The costs match the executions when REORDER_EXPENSIVE_CONDS (MDEV-40439) is set as well. Not covered yet: LooseScan (its cost is saved without the subquery cost). |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Nikita Malyavin
nikitamalyavin@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-40283 mysqltest: add PS_bind_array command PS_bind_array binds every parameter to an array of values, so that PS_execute sends them in one COM_STMT_BULK_EXECUTE. The new connect option BULK_UNIT_RESULTS asks for a result per parameter set. Assisted-by: Fable 5.2 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Nikita Malyavin
nikitamalyavin@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-40283 Statement restart: a KILL QUERY is not lost to a restart A statement killed before it failed is refused the restart; a kill that comes after the request stops the retry, as the kill is reset once per command. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Rucha Deodhar
rucha.deodhar@mariadb.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-42739: Subquery without a table in a trigger resolves an outer column named new/old to the whole row NEW/OLD A column or select list alias named new or old in a trigger query was resolved to the whole NEW/OLD row in a table-less subquery, and in ORDER BY, GROUP BY and HAVING, giving an error or a wrong result. Analysis: Item_trigger_row::fix_fields() looked for a column only in the innermost query block, which has no tables in SELECT (SELECT new). Aliases were not looked up at all by find_order_in_list(), and in HAVING the late-created item was an Item_field, where the parser creates an Item_ref. Fix: Look for the column in the outer query blocks too, and in HAVING. In find_order_in_list() try the select list alias before the trigger row. Create an Item_ref in HAVING, as the parser does. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Vladislav Vaintroub
vvaintroub@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-33387 - multifactor authentication Support "AND" between authentication plugins in CREATE/ALTER USER, so that a user must pass every factor to log in (multi-factor auth), in addition to the existing "OR" (alternative plugins). Mixing AND and OR in one user definition is rejected. CREATE USER u IDENTIFIED VIA mysql_native_password AS PASSWORD('...') AND some_other_plugin USING '...'; Grammar and storage - USER_AUTH gets a logical_operator (NONE/OR/AND) telling how each factor combines with the next; the parser tags the factor list and rejects a mix of AND/OR. - The operator is persisted in mysql.global_priv: the factor array is stored under "auth_and" (mirroring the existing "auth_or"). ALTER USER that collapses a multi-factor account back to a single plugin removes the stale "auth_and"/"auth_or" key. - SHOW CREATE USER prints " AND " between factors. - Two password-based (hashing) plugins in one AND chain are rejected; at most one factor may carry a password hash. Authentication protocol - New client capability CLIENT_MULTI_FACTOR_AUTHENTICATION and an AuthNextFactor (0x02) command that tells the client to proceed to the next factor after the current one succeeded. send_plugin_request_packet becomes send_change_plugin_packet, handling both the auth-switch (0xFE) and next-factor (0x02) commands. Clients that do not announce the capability fall back to an auth switch. - acl_authenticate() runs the factors sequentially for AND (every factor must return CR_OK), while OR keeps its "first success wins" behavior. - The in-server client (sql-common/client.c, used by mariadb-backup, replication, etc.) also handles AuthNextFactor: it advertises the new capability, recognises the 0x02 packet in run_plugin_auth(), and uses the same is_auth_switch_command() helper (with AUTH_SWITCH_PLUGIN_PACKET and AUTH_NEXT_FACTOR_PACKET symbolic constants) as libmariadb does. TLS server-identity via password hash - When the connection uses a self-signed certificate and no CA is configured, the server sends a fingerprint challenge in the OK packet, computed from the certificate fingerprint and the password hash. For a multi-factor account the salt of the first password-hashing factor is used. The client recomputes it and, on a match, trusts the certificate even with --ssl-verify-server-cert, so password-based verification of the server does not raise a certificate error. Tests - New plugins suite tests: mfa (portable machinery: AuthNextFactor round trip, non-hashing factor, auth_and persistence and ALTER round-trip, distinct per-factor secrets, negative cases, TLS fingerprint), mfa_unix (unix_socket + password), mfa_win (named_pipe/gssapi + password), mfa_unix_pam (password + PAM PIN). - auth_gssapi multiauth trimmed to the OR cases it still owns. Client side changes are in the bundled libmariadb (submodule bump). Assisted-by: Claude:claude-haiku-4.5-20251001 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Alexander Barkov
bar@mariadb.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-42858 Garbage or heap-use-after-free in UPDATE FOR PORTION OF UPDATE ... FOR PORTION OF could read a freed blob buffer, or return garbage, if a BEFORE INSERT trigger assigned a blob column and an AFTER UPDATE trigger then read the updated row. TABLE::period_make_insert() saves the row with store_record(). This copies the blob pointers but not the blob data. The BEFORE INSERT trigger assigns NEW.b, which reallocates Field_blob::value and frees the buffer that the saved row points to. restore_record() then puts the pointer to the freed buffer back, and the AFTER UPDATE trigger reads it through NEW.b. TABLE::remember_blob_values() protected only generated blob fields, so normal blob columns were not covered. Added TABLE::remember_all_blob_values() and restore_all_blob_values(). They move Field_blob::value of every blob field (normal, virtual and stored) into a temporary String array and back, and period_make_insert() uses them instead of remember_blob_values(). |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Vladislav Vaintroub
vvaintroub@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-42338 macOS: treat the Homebrew include directory as system Homebrew keeps the headers of all installed libraries in one directory. libmariadb, which does not inherit include directories from the server, adds it as a plain -I. That shadows the SYSTEM OpenSSL path, and -Werror fails on warnings in OpenSSL 4.1 headers. Add the directory to CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES, which CMake emits as -isystem for all languages, and which drops a plain -I of the same directory. IGNORE_HOMEBREW_INCLUDE_PATH opts out. Assisted-by: Claude:claude-sonnet-5-5 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Nikita Malyavin
nikitamalyavin@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| MDEV-40283 Statement restart: a statement of a stored procedure | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Nikita Malyavin
nikitamalyavin@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| MDEV-40283 Statement restart: a statement of a stored procedure | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Vladislav Vaintroub
vvaintroub@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Support multi-factor authentication MySQL way - Allow to specify password2/password3 via mysql_optionsv(mysql,MYSQL_OPT_USER_PASSWORD, factor,N) - Handle 0x2 (AuthNextFactor) server packet Switch password according to factor - make sure TLS "trust" works for self-signed certificate if any of the MFA factors is password-based (e.g gssapi + mysql_native_password would use second factor's verification) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Alexey Botchkov
holyfoot@mariadb.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-42643 XMLISVALID: recursive type copies its whole compositor at every nesting level, gigabytes per query, max_session_mem_used ignored. tests added since the bug was fixed already. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Nikita Malyavin
nikitamalyavin@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-40283 Statement restart Add an api to request statement restart, that can be used by any engine or a plugin in case of an error (thd_request_statement_restart). The retry loop runs in dispatch_command(), based on value of THD::backoff_requested. THD::backoff_dispatch_safe() guards incompatible cases. Some sql commands and server commands are incompatible with statement restart: * Statements are filtered based on blacklist (only a few statements cannot restart), with CF_FORBIDS_BACKOFF flag. * Server commands are filtered based on whitelist (only a few commands can restart), with CF_ALLOWS_BACKOFF flag. This commit enables COM_QUERY only. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Nikita Malyavin
nikitamalyavin@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-40283 Statement restart: the prepared statement commands Covered: Prepare, execute and bulk execute. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Nikita Malyavin
nikitamalyavin@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-40283 Statement restart: a KILL QUERY is not lost to a restart A statement killed before it failed is refused the restart; a kill that comes after the request stops the retry, as the kill is reset once per command. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Vladislav Vaintroub
vvaintroub@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
main.mysql_client_test: show client output on failure The output goes to var/log/mysql_client_test.out.log, so it is missing from the test failure report and CI logs. Print it when mysql_client_test fails. Assisted-by: Claude:claude-sonnet-5-5 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Monty
monty@mariadb.org |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Bug fixes, to be squashed with c750f09e489537cefa44c248afa31a9c79f6d41b - A statement that fails to open its tables (multi-table UPDATE and DELETE, HANDLER OPEN) releases the metadata locks it took, also inside a transaction. The statement transaction is rolled back first, as opening a GTT instance with ON COMMIT DELETE ROWS registers it there. - ALTER TABLE of a GTT waits for metadata locks up to lock_wait_timeout, like other DDL. - Check for GTT instances first in check_pseudo_slave_mode(). Improved warning for using pseudo_slave_mode when a GTT instance exists. - pseudo_slave_mode and pseudo_thread_id can be changed while the connection has GTT instances, and GTTs can be used in pseudo_slave_mode. A connection always has at most one instance of a GTT, independent of pseudo_thread_id. - XA PREPARE in pseudo_slave_mode detaches the XA transaction from the connection. This ends the transaction for GTTs, so ON COMMIT DELETE ROWS GTT instances are emptied. - Removed unneeded temporary table lock when dropping ON COMMIT DELETE ROWS GTT instances. - Moved open_global_temporary_table() to temporary_tables.cc and made it a THD method. use_global_tmp_table_tp() is now private. - Moved all GTT-only functions to the end of temporary_tables.cc - Removed partial MDEV-37771 fix (pseudo_thread_id default). It is not needed for GTTs and belongs to 10.11. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Alexey (Holyfoot) Botchkov
holyfoot@mariadb.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-42640 XMLISVALID: exponential time in check_type on a schema where groups reference each other twice, KILL QUERY ignored. Guard check_type() against checking the same or lesser depth twice. That eliminates exponential calls. Checks for thd->killed added. Also attributeGroup guarded against exponential search for attribute name. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Oleg Smirnov
olernov@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-41654 Account cost of subqueries in conditions for LooseScan The LooseScan semi-join strategy costs the first inner table of the semi-join apart from the other access methods: Loose_scan_opt keeps the cost of the best index access that enumerates the duplicate groups, and save_to_position() stores it without the cost of the subqueries in the condition of the table. With FIX_SUBQUERY_COND_COST, LooseScan therefore looked cheaper than FirstMatch, DuplicateWeedout and SJ-Materialization, whose costs include it. Pass the cost of the subqueries to Loose_scan_opt and add it to each LooseScan access before they are compared, for the rows the access reads: - full index scan: all rows of the index, scaled by the selectivity of the conditions of the table on constants; - ref: the rows per lookup, scaled the same way unless the ref binds a key part to a constant, whose selectivity the estimate includes; - range: the rows of the range, which already pass its conditions on constants. As for FirstMatch, the exit at the first match of a duplicate group is not modelled: all rows of a group are charged. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Nikita Malyavin
nikitamalyavin@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-40283 SET STATEMENT ... FOR EXECUTE lost its clause in a reprepare execute() restores the clause at its end, so the reprepare and the execution after it ran without it, as main.ps_ddl recorded for MDEV-10702 (1025). |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Rucha Deodhar
rucha.deodhar@mariadb.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-42740: GET DIAGNOSTICS CONDITION NEW in a trigger assigns condition values although the condition number is a row GET DIAGNOSTICS CONDITION NEW in a trigger used the first column of the row as the condition number and assigned the values of that condition to the targets. It now raises an error and assigns nothing. Analysis: NEW is a row, and Item_trigger_row::val_int() raises an error and returns 1. The error was dropped and 1 was used as the condition number. Fix: Check that the condition number expression is not a row before evaluating it, so that the operand error is reported. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Vladislav Vaintroub
vvaintroub@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-42338 macOS: treat the Homebrew include directory as system Homebrew keeps the headers of all installed libraries in one directory. libmariadb, which does not inherit include directories from the server, adds it as a plain -I. That shadows the SYSTEM OpenSSL path, and -Werror fails on warnings in OpenSSL 4.1 headers. Add the directory to CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES, which CMake emits as -isystem for all languages, and which drops a plain -I of the same directory. IGNORE_HOMEBREW_INCLUDE_PATH opts out. Assisted-by: Claude:claude-sonnet-5-5 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Khaled Riyad
khaled57.dev@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-42486 Prepared statement returns incorrect result after subquery data changes Item_in_optimizer caches the result of "NULL IN (SELECT ...)" for a non-correlated subquery in result_for_null_param, so that later rows with a NULL left value do not evaluate the subquery again. The cache was never reset in Item_in_optimizer::cleanup(), so the next execution of a prepared statement or stored routine reused the result computed from the data of an earlier execution. Reset result_for_null_param to UNKNOWN in cleanup(). |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Nikita Malyavin
nikitamalyavin@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-42758 SET STATEMENT ... FOR EXECUTE lost its clause in a reprepare execute() restores the clause at its end, so the reprepare and the execution after it ran without it, as main.ps_ddl recorded for MDEV-10702 (1025). |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Nikita Malyavin
nikitamalyavin@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-40283 Statement restart: test array binding with PS_bind_array The two array binding cases of restart.test ran functions that mysql_client_test does not have. They now use PS_bind_array on a connection made with BULK_UNIT_RESULTS. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Raghunandan Bhat
raghunandan.bhat96@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-39095: Fixes to MariaDB Syntax Checker - Skip initializing stopwords for full-text indexes when checking syntax. - Skip changing data directory when checking syntax. - Show help message when syntax checker is used in interactive mode. - Initialize THD with a dummy database name to prevent `No database selected` error. - Rename `PARSER_STATE` in check_syntax.cc to `Syntax_checker_state` to avoid confusion with `Parser_state` class. - Increase max length of delimiter token to 16 to match mariadb client. - Support many statements in one query, like the client does (e.g. `SET @a=1; SELECT @a|` with DELIMITER |). Report correct line numbers for errors in them. - Report only errors, not notes or warnings. A stored function with the name of a native function is accepted, a UDF with such a name is an error. - Apply SET statements that change how later statements are parsed: - Applied: session sql_mode and character_set_client, SET NAMES, SET CHARACTER SET. Values can be constants, DEFAULT, user variables, @@sql_mode or @@character_set_client. - Tracked: user variables set from such values, so the `SET @OLD_SQL_MODE=@@SQL_MODE ... SET SQL_MODE=@OLD_SQL_MODE` pattern from dumps works. - Ignored: SET GLOBAL, other variables, and values that need executing (a user variable set from one is unset). - Split statements using the current client character set. - Treat enabled plugins as available, so that partitioning syntax is accepted. Initialize data type and function plugins, so that their types and functions are known. - Recognize system variables of enabled plugins (binlog_checksum, innodb_*, aria_*) without initializing the plugins. - Support CREATE PACKAGE BODY when CREATE PACKAGE is earlier in the input. DROP PACKAGE removes it. A body without its package is an error. - Refuse to run --check-syntax together with --bootstrap. - More tests: DDLs, DMLs, Stored Procedures, Views, sql_mode, character sets, plugins, packages |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Alexey Botchkov
holyfoot@mariadb.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-42645 XMLISVALID: attribute declared in a simpleContent base type is rejected in the derived type. Missed reference to the base type added to validate_attr(). |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Vladislav Vaintroub
vvaintroub@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
main.mysql_client_test: show client output on failure The output goes to var/log/mysql_client_test.out.log, so it is missing from the test failure report and CI logs. Print it when mysql_client_test fails. Assisted-by: Claude:claude-sonnet-5-5 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Vladislav Vaintroub
vvaintroub@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-33387 - multifactor authentication Support "AND" between authentication plugins in CREATE/ALTER USER, so that a user must pass every factor to log in (multi-factor auth), in addition to the existing "OR" (alternative plugins). Mixing AND and OR in one user definition is rejected. CREATE USER u IDENTIFIED VIA mysql_native_password AS PASSWORD('...') AND some_other_plugin USING '...'; Grammar and storage - USER_AUTH gets a logical_operator (NONE/OR/AND) telling how each factor combines with the next; the parser tags the factor list and rejects a mix of AND/OR. - The operator is persisted in mysql.global_priv: the factor array is stored under "auth_and" (mirroring the existing "auth_or"). ALTER USER that collapses a multi-factor account back to a single plugin removes the stale "auth_and"/"auth_or" key. - SHOW CREATE USER prints " AND " between factors. - Two password-based (hashing) plugins in one AND chain are rejected; at most one factor may carry a password hash. Authentication protocol - New client capability CLIENT_MULTI_FACTOR_AUTHENTICATION and an AuthNextFactor (0x02) command that tells the client to proceed to the next factor after the current one succeeded. send_plugin_request_packet becomes send_change_plugin_packet, handling both the auth-switch (0xFE) and next-factor (0x02) commands. Clients that do not announce the capability fall back to an auth switch. - acl_authenticate() runs the factors sequentially for AND (every factor must return CR_OK), while OR keeps its "first success wins" behavior. - The in-server client (sql-common/client.c, used by mariadb-backup, replication, etc.) also handles AuthNextFactor: it advertises the new capability, recognises the 0x02 packet in run_plugin_auth(), and uses the same is_auth_switch_command() helper (with AUTH_SWITCH_PLUGIN_PACKET and AUTH_NEXT_FACTOR_PACKET symbolic constants) as libmariadb does. TLS server-identity via password hash - When the connection uses a self-signed certificate and no CA is configured, the server sends a fingerprint challenge in the OK packet, computed from the certificate fingerprint and the password hash. For a multi-factor account the salt of the first password-hashing factor is used. The client recomputes it and, on a match, trusts the certificate even with --ssl-verify-server-cert, so password-based verification of the server does not raise a certificate error. Tests - New plugins suite tests: mfa (portable machinery: AuthNextFactor round trip, non-hashing factor, auth_and persistence and ALTER round-trip, distinct per-factor secrets, negative cases, TLS fingerprint), mfa_unix (unix_socket + password), mfa_win (named_pipe/gssapi + password), mfa_unix_pam (password + PAM PIN). - auth_gssapi multiauth trimmed to the OR cases it still owns. Client side changes are in the bundled libmariadb (submodule bump). Assisted-by: Claude:claude-haiku-4.5-20251001 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Rucha Deodhar
rucha.deodhar@mariadb.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-42738: Wrong result: HAVING on a column named new/old in a trigger query returns every group Add tests for a column named new in GROUP BY, ORDER BY and HAVING of a trigger query. They are fixed by the change for MDEV-42739, which makes HAVING resolve new/old as a column reference, as the parser does. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Nikita Malyavin
nikitamalyavin@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-40283 Statement restart: the prepared statement commands Covered: Prepare, execute and bulk execute. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Rucha Deodhar
rucha.deodhar@mariadb.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-42737: SIGSEGV in sp_lex_keeper::validate_lex_and_exec_core after a trigger statement fails to re-parse A trigger statement that failed to re-parse after a metadata change, such as dropping a column it uses, crashed the server on the next execution. Analysis: When the re-parse failed, m_lex was already freed (null), but the instruction was left marked valid. The next execution skipped the re-parse and dereferenced the null m_lex. Fix: Mark the instruction invalid again when the re-parse fails, so the next execution re-parses it and reports the error again. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Vladislav Vaintroub
vvaintroub@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
main.mysql_client_test: show client output on failure The output goes to var/log/mysql_client_test.out.log, so it is missing from the test failure report and CI logs. Print it when mysql_client_test fails. Assisted-by: Claude:claude-sonnet-5-5 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Nikita Malyavin
nikitamalyavin@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-40283 Statement restart: an execute with converted long data It was refused, as conversion replaces the bytes the client sent. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Jan Lindström
jan.lindstrom@galeracluster.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-33763 : Buffered error logging for Server error log New read-only system variables (set at startup, need --log-error): * log_error_file_buffer_size: error log buffer size, default 0 (off) * log_error_file_rotate_size: rotate the error log above this size, default 1073741824 * log_error_file_rotations: number of rotated files kept, default 0 Changes: * When log_error_file_buffer_size is set, the error log is written through the file logger (mysys/file_logger.c), which keeps messages in an in-memory buffer. The logger has its own descriptor of the error log file. stdout and stderr stay open on the same file for direct writes, and are reopened on the new file after each rotation. * FLUSH ERROR LOGS writes the buffered messages to the old file and opens the error log file again. * At shutdown the buffered messages are written and the logger is closed. Later messages go to stderr. * On a fatal signal the buffered messages are written before the crash report. * The file logger does not call my_error() on a write error, because my_error() can write to the error log. A failed buffered write returns -1, and the server then writes the message to stderr. * After a failed rotation the next write opens the log file again. * print_buffer_to_file() uses one static buffer, allocated on first use (MAX_LOG_BUFFER_SIZE+1), grown as needed and freed at shutdown. * vprint_msg_to_log() writes lines longer than 1024 bytes in full, up to 1 MB. * Galera messages use the same error log path. Debug messages are written only if wsrep_debug is set. * Add a unit test for write errors of the file logger, and mtr tests for the three variables, buffered logging, rotation, a crash after rotation, FLUSH ERROR LOGS and long lines. Assisted-by: https://mariadb.org/governance/governance-ai-policy/ Assisted-by: Claude:claude-4.6-sonnet |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Nikita Malyavin
nikitamalyavin@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-40283 Statement restart: an execute with converted long data It was refused, as conversion replaces the bytes the client sent. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Alessandro Vetere
iminelink@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-21725 Log page reorganization as the ranges by which records moved btr_page_reorganize_low() logged the payload as one WRITE from the first to the last changed byte. When the reorganization removes a gap near the start of the page, it moves all the later records, and this WRITE covers almost the whole page. btr_page_reorganize_log_payload(): Log the payload with MEMMOVE for the runs of records that only moved, and WRITE for the rest. The function first copies the runs that moved towards the end of the page, in descending order of destination. Then it copies the runs that moved towards the start of the page, in ascending order of destination. In each order, no copy changes the source of a later copy. If a copy of the first order changed a part of a source, the function does not copy that part. Instead, it logs with WRITE the bytes at the destination of that part that differ from the old page. The function does not copy a run that is shorter than 8 bytes. It also does not copy the shortest runs that moved towards the end of the page when the working memory is full. It logs the changed bytes of these runs with WRITE. The log format does not change. With the debug keyword page_reorganize_log_max_up_2, the working memory holds at most 2 runs that moved towards the end of the page. btr_page_reorganize_low(): Reserve a second scratch frame for the working memory of btr_page_reorganize_log_payload(). Start a new same_page chain before the log records of the reorganization, and end it after them. mtr_t::reset_last_page(): New function. Make the next log record write its page identifier. page_copy_rec_list_end_no_locks(): Add the output parameter extra. If extra is not nullptr, return DB_CORRUPTION for a record of the source page that starts below the end of the supremum record or ends above PAGE_HEAP_TOP. Only btr_page_reorganize_low() passes extra, to log MEMMOVE records from the old page, and it restores the old page on this error before it moves the locks or writes log. The other callers trust a page with a valid checksum and do not change. In all versions since the 10.8 redo log format, the recovery parser has an error. For a same_page record that follows a MEMSET or MEMMOVE record, it calculates an offset that is too low. It can then reject a valid MEMMOVE whose source is below its destination as "Malformed log record". The new payload logging avoids this. The reorganization starts a new same_page chain, and writes only WRITE records before the first MEMMOVE whose source is below its destination. Each later such MEMMOVE has its destination below the end of the previous record, so it has the page identifier, and the parser reads its offset correctly. The next record for the page after the reorganization also has the page identifier. Older servers and backup tools can thus recover the log. recv_sys_t::parse_tail(): Add a FIXME for the parser error. innodb.page_reorganize_log: Reorganize the index pages of 4 tables with page_reorganize_log_max_up_2, kill the server before a checkpoint, and check the recovered tables. The pages contain a record with no data bytes, runs that the working memory cannot hold, and runs that are shorter than 8 bytes. In the page of the fourth table, all records after the first one moved down by the same distance. The test checks that the INSERT that reorganizes this page writes less redo log than a quarter of the page size. Before this change, the INSERT writes 3,051 bytes at 4k, 12,297 bytes at 16k and 49,280 bytes at 64k. innodb.alter_copy and innodb.instant_alter_crash also recover page reorganizations. innodb.index_lock_upgrade,on with 4k pages (Debug) writes 2,816,405 bytes of redo log instead of 3,293,565 (shutdown LSN minus startup LSN). Assisted-by: Claude:claude-opus-5-5 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||