- 14 Aug, 2024 4 commits
-
-
Alexander Barkov authored
- Using Lex_ident_sys to scan identifiers, like the SQL parser does. This fixes handling of double-quote-delimited and backtick-delimited identifiers, as well as handling of non-ASCII identifiers. Unescaping and converting from the client character set to the system character set is now done using Lex_ident_cli_st and Lex_ident_sys, like it's done in the SQL tokenizer/parser. Adding helper methods to_ident_cli() and to_ident_sys() in Optimizer_hint_parser::Token. - Fixing the hint parser to report a syntax error when an empty identifiers: SELECT /*+ BKA(``) */ * FROM t1; - Moving a part of the code from opt_hints_parser.h to opt_hints_parser.cc Moving these method definitions: - Optimizer_hint_tokenizer::find_keyword() - Optimizer_hint_tokenizer::get_token() to avoid huge pieces of the code in the header file. - A Lex_ident_cli_st cleanup Fixing a few Lex_ident_cli_st methods to return Lex_ident_cli_st & instead of void, to use them easier in the caller code. - Fixing the hint parser to display the correct line number Adding a new data type Lex_comment_st (a combination of LEX_CSTRING and a line number) Using it in sql_yacc.yy - Getting rid of redundant dependencies on sql_hints_parser.h Moving void LEX::resolve_optimizer_hints() from sql_lex.h to sql_lex.cc Adding a class Optimizer_hint_parser_output, deriving from Optimizer_hint_parser::Hint_list. Fixing the hint parser to return a pointer to an allocated instance of Optimizer_hint_parser_output rather than an instance of Optimizer_hint_parser::Hint_list. This allows to use a forward declaration of Optimizer_hint_parser_output in sql_lex.h and thus avoid dependencies on sql_hints_parser.h.
-
Oleg Smirnov authored
This commit introduces: - the infrastructure for optimizer hints; - hints for join buffering: BNL(), NO_BNL(), BKA(), NO_BKA(); - NO_ICP() hint for disabling index condition pushdown; - MRR(), MO_MRR() hint for multi-range reads control; - NO_RANGE_OPTIMIZATION() for disabling range optimization; - QB_NAME() for assigning names for query blocks.
-
Alexander Barkov authored
Implementing a recursive descent parser for optimizer hints.
-
Alexander Barkov authored
- Lex_ident_cli* into a new file sql/lex_ident_cli.h - Lex_ident_sys* into a new file sql/lex_ident_sys.h - Well_formed_prefix into include/m_ctype.h This change is needed to the optimizer hint parser coming soon.
-
- 25 Jul, 2024 1 commit
-
-
Monty authored
MDEV-33856: Alternative Replication Lag Representation via Received/Executed Master Binlog Event Timestamps This commit adds 3 new status variables to 'show all slaves status': - Master_last_event_time ; timestamp of the last event read from the master by the IO thread. - Slave_last_event_time ; Master timestamp of the last event committed on the slave. - Master_Slave_time_diff: The difference of the above two timestamps. All the above variables are NULL until the slave has started and the slave has read one query event from the master that changes data. - Added information_schema.slave_status, which allows us to remove: - show_master_info(), show_master_info_get_fields(), send_show_master_info_data(), show_all_master_info() - class Sql_cmd_show_slave_status. - Protocol::store(I_List<i_string_pair>* str_list) as it is not used anymore. - Changed old SHOW SLAVE STATUS and SHOW ALL SLAVES STATUS to use the SELECT code path, as all other SHOW ... STATUS commands. Other things: - Xid_log_time is set to time of commit to allow slave that reads the binary log to calculate Master_last_event_time and Slave_last_event_time. This is needed as there is not 'exec_time' for row events. - Fixed that Load_log_event calculates exec_time identically to Query_event. - Updated RESET SLAVE to reset Master/Slave_last_event_time - Updated SQL thread's update on first transaction read-in to only update Slave_last_event_time on group events. - Fixed possible (unlikely) bugs in sql_show.cc ...old_format() functions if allocation of 'field' would fail. Reviewed By: Brandon Nesterenko <brandon.nesterenko@mariadb.com> Kristian Nielsen <knielsen@knielsen-hq.org>
-
- 24 Jul, 2024 1 commit
-
-
Souradeep Saha authored
Cleanup unnecessary whitespace at the end of lines and end of files in the unittest/ directory. Note that all code changes are non-functional. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc.
-
- 17 Jul, 2024 1 commit
-
-
Tuukka Pasanen authored
As this is MariaDB then also variable names in mariadb-server.*inst should correlate when possible this change variable and directory names
-
- 16 Jul, 2024 6 commits
-
-
Daniel Black authored
Gain MySQL compatibility by allowing table aliases in a single table statement. This now supports the syntax of: DELETE [delete_opts] FROM tbl_name [[AS] tbl_alias] [PARTITION (partition_name [, partition_name] ...)] .... The delete.test is from MySQL commit 1a72b69778a9791be44525501960b08856833b8d / Change-Id: Iac3a2b5ed993f65b7f91acdfd60013c2344db5c0. Co-Author: Gleb Shchepa <gleb.shchepa@oracle.com> (for delete.test) Reviewed by Igor Babaev (igor@mariadb.com)
-
Brandon Nesterenko authored
Result file needed re-recording to account for the new information_schema columns
-
Vladislav Vaintroub authored
With that, it is possible to restore the full "instance" from a backup made with mariadb-dump --dir The patch implements executing DDL (tables, views, triggers) using statements that are stored in .sql file, created by mariadb-dump --dir . Care is taken of creating triggers correctly after the data is loaded, disabling foreign keys and unique key checks etc. The files are loaded in descending order by datafile size - to ensure better work distribution when running with --parallel option. In addition to --dir option, following options are implemented for partial restore include-only options: --database - import one or several databases --table - import one or several tables exclude options: --ignore-database -. ignore one or several databases when importing --ignore-table - to ignore one or several tables when importing All options above are only valid together with --dir option, and can be specified multiple times.
-
Vladislav Vaintroub authored
Use threadpool, instead of one-thread-and-connection-per-table
-
Vladislav Vaintroub authored
Fix tpool to not use maintenance timer for fixed pool size.
-
Vladislav Vaintroub authored
-
- 12 Jul, 2024 1 commit
-
-
Monty authored
Trivial batch, using the handler statistics already collected for the slow query log. The reason for the changes in test cases was mainly to change to use select TABLE_SCHEMA ... from information_schema.table_statistics instead of 'show table_statistics' to avoid future changes to test results if we add more columns to table_statistics.
-
- 11 Jul, 2024 2 commits
-
-
Daniel Black authored
There is no need for a character-set-server configuration when utf8mb4 is now the server default. Also remove the character-set-collations as its no longer required and the uca1400_ai_ci is now the default for all character sets that support it. ref: MDEV-25829 / MDEV-34430.
-
Alexander Barkov authored
Changing the default server character set from latin1 to utf8mb4.
-
- 10 Jul, 2024 2 commits
-
-
Alexander Barkov authored
-
Alexander Barkov authored
-
- 09 Jul, 2024 7 commits
-
-
Alexander Barkov authored
-
Vladislav Vaintroub authored
Rename some threads to workaround this restrictions, e.g "rpl_parallel_thread"->"rpl_parallel", "slave_background" -> "slave_bg" etc.
-
Vladislav Vaintroub authored
Use SetThreadDescription/pthread_setname_np to give threads a name.
-
Vladislav Vaintroub authored
Use SetThreadDescription/pthread_setname_np to give threads a name.
-
Alexander Barkov authored
-
Alexander Barkov authored
-
Alexander Barkov authored
Builders: - amd64-fedora-38-last-N-failed - amd64-debian-10-last-N-failed erroneously execute MTR for these files: - rpl/include/rpl_extra_col_master.test - rpl/include.rpl_binlog_max_cache_size.test - rpl/include.rpl_charset.test when these files are changed by a commit. Changing their extension from *.test to *.inc to avoid this.
-
- 08 Jul, 2024 10 commits
-
-
Oleksandr Byelkin authored
-
Alexander Barkov authored
-
Alexander Barkov authored
-
Alexander Barkov authored
my_like_range*() can create longer keys than Field::char_length(). This caused warnings during print_range(). Fix: Suppressing warnings in print_range().
-
Alexander Barkov authored
-
Anson Chung authored
Line numbers had to be removed from the ignorelists in order to be diffed against since locations of the same findings can differ across runs. Therefore preprocessing has to be done on the CI findings so that it can be compared to the ignorelist and new findings can be outputted. However, since line numbers have to be removed, a situation occurs where it is difficult to reference the location of findings in code given the output of the CI job. To lessen this pain, change the cppcheck template to include code snippets which make it easier to reference where in the code the finding is referring to, even in the absence of line numbers. Ignorelisting works as before since locations of the finding may change but not the code it is referring to. Furthermore, due to the innate difficulty in maintaining ignorelists across branches and triaging new findings, allow failure as to not have constantly failing pipelines as a result of a new findings that have not been addressed yet. Lastly, update SAST ignorelists to match the newly refactored cppcheck job and the current state of the codebase. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc.
-
Anson Chung authored
Rectify cases of mismatched brackets and address possible cases of division by zero by checking if the denominator is zero before dividing. No functional changes were made. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc.
-
Robin Newhouse authored
Several variables declared in mysqld.h appear to be old system variables that have been left over after deprecation. Delete them using IDE refactoring to automatically search for other uses. Most cases had no other uses in the code. slave_allow_batching had a test that was effectively unused, as the result was only -ERROR HY000: Unknown system variable 'slave_allow_batching' so that was deleted as well. Build and test still works without issue as expected. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services.
-
Alexander Barkov authored
-
Marko Mäkelä authored
crc32_avx512(): Explicitly cast ssize_t(size) to make it clear that we are indeed applying a negative offset to a pointer.
-
- 07 Jul, 2024 1 commit
-
-
Monty authored
The issue was that when repairing an Aria table of row format PAGE and the data file was bigger the 4G, the data file length was cut short because of wrong parameters to MY_ALIGN(). The effect was that ALTER TABLE, OPTIMIZE TABLE or REPAIR TABLE would fail on these tables, possibly corrupting them. The MDEV also exposed a bug where error state was not propagated properly to the upper level if the number of rows in the table changed.
-
- 06 Jul, 2024 3 commits
-
-
Monty authored
-
Monty authored
The problem was using safe_table_name() instead of safe_table_name().str with DBUG_PRINT
-
Brandon Nesterenko authored
The current semi-sync binlog fail-over recovery process uses rpl_semi_sync_slave_enabled==TRUE as its condition to truncate a primary server’s binlog, as it is anticipating the server to re-join a replication topology as a replica. However, for servers configured with both rpl_semi_sync_master_enabled=1 and rpl_semi_sync_slave_enabled=1, if a primary is just re-started (i.e. retaining its role as master), it can truncate its binlog to drop transactions which its replica(s) has already received and executed. If this happens, when the replica reconnects, its gtid_slave_pos can be ahead of the recovered primary’s gtid_binlog_pos, resulting in an error state where the replica’s state is ahead of the primary’s. This patch changes the condition for semi-sync recovery to truncate the binlog to instead use the configuration variable --init-rpl-role, when set to SLAVE. This allows for both rpl_semi_sync_master_enabled and rpl_semi_sync_slave_enabled to be set for a primary that is restarted, and no transactions will be lost, so long as --init-rpl-role is not set to SLAVE. Reviewed By: ============ Sergei Golubchik <serg@mariadb.com>
-
- 05 Jul, 2024 1 commit
-
-
Brandon Nesterenko authored
The special logic used by the memory storage engine to keep slaves in sync with the master on a restart can break replication. In particular, after a restart, the master writes DELETE statements in the binlog for each MEMORY-based table so the slave can empty its data. If the DELETE is not executable, e.g. due to invalid triggers, the slave will error and fail, whereas the master will never see the problem. Instead of DELETE statements, use TRUNCATE to keep slaves in-sync with the master, thereby bypassing triggers. Reviewed By: =========== Kristian Nielsen <knielsen@knielsen-hq.org> Andrei Elkin <andrei.elkin@mariadb.com>
-