summaryrefslogtreecommitdiff
path: root/client
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-26221: DYNAMIC_ARRAY use size_t for sizesEric Herman2021-10-192-8/+7
| | | | | | | | | | | | | | | | | https://jira.mariadb.org/browse/MDEV-26221 my_sys DYNAMIC_ARRAY and DYNAMIC_STRING inconsistancy The DYNAMIC_STRING uses size_t for sizes, but DYNAMIC_ARRAY used uint. This patch adjusts DYNAMIC_ARRAY to use size_t like DYNAMIC_STRING. As the MY_DIR member number_of_files is copied from a DYNAMIC_ARRAY, this is changed to be size_t. As MY_TMPDIR members 'cur' and 'max' are copied from a DYNAMIC_ARRAY, these are also changed to be size_t. The lists of plugins and stored procedures use DYNAMIC_ARRAY, but their APIs assume a size of 'uint'; these are unchanged.
* Merge 10.6 into 10.7Marko Mäkelä2021-10-131-7/+17
|\
| * Merge 10.5 into 10.6Marko Mäkelä2021-10-131-7/+17
| |\ | | | | | | | | | | | | | | | | | | The changes to galera.galear_var_replicate_myisam_on in commit d9b933bec6061758c5d7b34f55afcae32a85c110 are omitted due to conflicts with commit 27d66d644cf2ebe9201e0362f2050036cce2908a.
| | * Merge 10.4 into 10.5Marko Mäkelä2021-10-131-7/+17
| | |\
| | | * Merge 10.3 into 10.4Marko Mäkelä2021-10-131-7/+17
| | | |\
| | | | * Merge 10.2 into 10.3Marko Mäkelä2021-10-131-5/+8
| | | | |\
| | | | | * MDEV-25444: mysql --binary-mode is not able to replay some mysqlbinlog outputsbb-10.2-MDEV-25444-docsBrandon Nesterenko2021-10-071-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a documentation-only patch to refine the description of binary mode for the mariadb client. Reviewed By: ============ Andrei Elkin <andrei.elkin@mariadb.com>
| | | | | * MDEV-25444: mysql --binary-mode is not able to replay some mysqlbinlog outputsbb-10.2-MDEV-25444Brandon Nesterenko2021-10-061-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note: This patch backports commits 10cd281 and 1755ea4 from 10.3. 10cd281: Problem:- Some binary data is inserted into the table using Jconnector. When binlog dump of the data is applied using mysql client it gives syntax error. Reason:- After investigating it turns out to be a issue of mysql client not able to properly handle \\0 <0 in binary>. In all binary files where mysql client fails to insert these 2 bytes are common (0x5c00) Solution:- I have changed mysql.cc to include for the possibility that binary string can have \\0 in it 1755ea4: Changes on top of Sachin’s patch. Specifically: 1) Refined the parsing break condition to only change the parser’s behavior for parsing strings in binary mode (behavior of \0 outside of strings is unchanged). 2) Prefixed binary_zero_insert.test with ‘mysql_’ to more clearly associate the purpose of the test. 3) As the input of the test contains binary zeros (0x5c00), different text editors can visualize this sequence differently, and Github would not display it at all. Therefore, the input itself was consolidated into the test and created out of hex sequences to make it easier to understand what is happening. 4) Extended test to validate that the rows which correspond to the INSERTS with 0x5c00 have the correct binary zero data. Reviewed By: ============ Andrei Elkin <andrei.elkin@mariadb.com>
| | | | * | MDEV-25444: mysql --binary-mode is not able to replay some mysqlbinlog outputsbb-10.3-25444Brandon Nesterenko2021-10-051-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes on top of Sachin’s patch. Specifically: 1) Refined the parsing break condition to only change the parser’s behavior for parsing strings in binary mode (behavior of \0 outside of strings is unchanged). 2) Prefixed binary_zero_insert.test with ‘mysql_’ to more clearly associate the purpose of the test. 3) As the input of the test contains binary zeros (0x5c00), different text editors can visualize this sequence differently, and Github would not display it at all. Therefore, the input itself was consolidated into the test and created out of hex sequences to make it easier to understand what is happening. 4) Extended test to validate that the rows which correspond to the INSERTS with 0x5c00 have the correct binary zero data. Reviewed By: =========== Andrei Elkin <andrei.elkin@mariadb.com>
| | | | * | MDEV-25444 mysql --binary-mode is not able to replay some mysqlbinlog outputsSachin Kumar2021-10-051-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem:- Some binary data is inserted into the table using Jconnector. When binlog dump of the data is applied using mysql cleint it gives syntax error. Reason:- After investigating it turns out to be a issue of mysql client not able to properly handle \\\0 <0 in binary>. In all binary files where mysql client fails to insert these 2 bytes are commom (0x5c00) Solution:- I have changed mysql.cc to include for the possibility that binary string can have \\\0 in it
* | | | | | Merge 10.6 into 10.7Marko Mäkelä2021-10-051-1/+1
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge 10.5 into 10.6Marko Mäkelä2021-10-051-1/+1
| |\ \ \ \ \ | | |/ / / /
| | * | | | MDEV-19867: postfix - syntax spelling ALTER TABLEDaniel Black2021-10-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Fixes: 5c5ea59bf88bc7cd9774f48e847168b47de7b249
* | | | | | MDEV-25152: Insert linebreaks in mysqldump --extended-insertDaniel Black2021-10-011-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Per review by Serg, include start row with new line. We are hoping we haven't annoyed people that prefered the old way. Adding an option for new lines seems like over-engineering in advance. So if there are complaints, let them be known (JIRA), and we'll add this under an option. Test cases updated.
* | | | | | MDEV-25152 Insert linebreaks in mysqldump --extended-insertrmfalves2021-10-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, mysqldump --extended-insert outputs all rows on a single line, which makes it difficult to use with various Unix command-line utilities such as grep and diff. We change mysqldump to emit a linebreak between each row, that would make it easier to work with, without significantly affecting dump or restore performance, or affecting compatibility. Closes: #1865
* | | | | | Merge 10.6 into 10.7Marko Mäkelä2021-09-301-53/+47
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge 10.5 into 10.6Marko Mäkelä2021-09-301-53/+47
| |\ \ \ \ \ | | |/ / / /
| | * | | | Merge 10.4 into 10.5Marko Mäkelä2021-09-241-53/+47
| | |\ \ \ \ | | | |/ / /
| | | * | | Merge 10.3 into 10.4Marko Mäkelä2021-09-241-0/+8
| | | |\ \ \ | | | | |/ /
| | | | * | Fixup "Windows, mysqltest : cleanup, remove dead code USE_CYGWIN"Vladislav Vaintroub2021-09-241-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | last commit 8221708e389728aef799046eef3c49b1eec2e400 removed too much, mtr is failing
| | | * | | Merge branch '10.3' into 10.4Vladislav Vaintroub2021-09-241-61/+47
| | | |\ \ \ | | | | |/ /
| | | | * | Windows, mysqltest : cleanup, remove dead code USE_CYGWINVladislav Vaintroub2021-09-241-54/+0
| | | | | |
| | | | * | MDEV-11499 mysqltest, Windows : improve diagnostics if server fails to shutdownVladislav Vaintroub2021-09-241-7/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create minidump when server fails to shutdown. If process is being debugged, cause a debug break. Moves some code which is part of safe_kill into mysys, as both safe_kill, and mysqltest produce minidumps on different timeouts. Small cleanup in wait_until_dead() - replace inefficient loop with a single wait.
* | | | | | Merge 10.6 into 10.7Marko Mäkelä2021-09-171-2/+3
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge 10.5 into 10.6Marko Mäkelä2021-09-161-2/+3
| |\ \ \ \ \ | | |/ / / /
| | * | | | Merge branch '10.4' into 10.5Monty2021-09-151-2/+3
| | |\ \ \ \ | | | |/ / / | | | | | | | | | | | | Fixed also an error in suite/perfschema/t/transaction_nested_events-master.opt
| | | * | | MDEV-23519 Protocol packet - "Original Name" info is showing alias name,Monty2021-09-141-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instead of original name of the column When doing refactoring of temporary table field creation a mistake was done when copying the column name when creating internal temporary tables. For internal temporary tables we should use the original field name, not the item name (= alias).
* | | | | | Merge 10.6 into 10.7Marko Mäkelä2021-09-112-13/+53
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge 10.5 into 10.6Marko Mäkelä2021-09-112-13/+53
| |\ \ \ \ \ | | |/ / / /
| | * | | | Merge remote-tracking branch 'upstream/10.4' into 10.5Vicențiu Ciorbaru2021-09-102-13/+53
| | |\ \ \ \ | | | |/ / /
| | | * | | Merge remote-tracking branch 'upstream/10.3' into 10.4Vicențiu Ciorbaru2021-09-092-13/+53
| | | |\ \ \ | | | | |/ /
| | | | * | Merge branch '10.2' into 10.3Sergei Golubchik2021-09-071-11/+52
| | | | |\ \ | | | | | |/
| | | | | * MDEV-19227: mysql_plugin doesn't run bootstrap from sourceAnel Husakovic2021-09-071-11/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed by: serg@mariadb.com daniel@mariadb.org
| | | | * | Merge branch '10.2' into 10.3Vicențiu Ciorbaru2021-09-071-2/+1
| | | | |\ \ | | | | | |/
| | | | | * Cleanup - remove confusing comment.Vladislav Vaintroub2021-09-011-1/+0
| | | | | |
| | | | | * MDEV-26514 Option to build a separate test zip package on WindowsElena Stepanova2021-09-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | echo is needed for the tests
* | | | | | increase the version string buffer in mariadb-upgradeSergei Golubchik2021-09-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | there's no point in keeping it small. this fixes numerous test failures in preview branches with versions like 10.7.0-MDEV-xxxx-short-feature-description-MariaDB
* | | | | | Merge 10.6 into 10.7Marko Mäkelä2021-08-311-0/+10
|\ \ \ \ \ \ | |/ / / / /
| * | | | | MDEV-25919: Lock tables before acquiring dict_sys.latchMarko Mäkelä2021-08-311-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit 1bd681c8b3c5213ce1f7976940a7dc38b48a0d39 (MDEV-25506 part 3) we introduced a "fake instant timeout" when a transaction would wait for a table or record lock while holding dict_sys.latch. This prevented a deadlock of the server but could cause bogus errors for operations on the InnoDB persistent statistics tables. A better fix is to ensure that whenever a transaction is being executed in the InnoDB internal SQL parser (which will for now require dict_sys.latch to be held), it will already have acquired all locks that could be required for the execution. So, we will acquire the following locks upfront, before acquiring dict_sys.latch: (1) MDL on the affected user table (acquired by the SQL layer) (2) If applicable (not for RENAME TABLE): InnoDB table lock (3) If persistent statistics are going to be modified: (3.a) MDL_SHARED on mysql.innodb_table_stats, mysql.innodb_index_stats (3.b) exclusive table locks on the statistics tables (4) Exclusive table locks on the InnoDB data dictionary tables (not needed in ANALYZE TABLE and the like) Note: Acquiring exclusive locks on the statistics tables may cause more locking conflicts between concurrent DDL operations. Notably, RENAME TABLE will lock the statistics tables even if no persistent statistics are enabled for the table. DROP DATABASE will only acquire locks on statistics tables if persistent statistics are enabled for the tables on which the SQL layer is invoking ha_innobase::delete_table(). For any "garbage collection" in innodb_drop_database(), a timeout while acquiring locks on the statistics tables will result in any statistics not being deleted for any tables that the SQL layer did not know about. If innodb_defragment=ON, information may be written to the statistics tables even for tables for which InnoDB persistent statistics are disabled. But, DROP TABLE will no longer attempt to delete that information if persistent statistics are not enabled for the table. This change should also fix the hangs related to InnoDB persistent statistics and STATS_AUTO_RECALC (MDEV-15020) as well as a bug that running ALTER TABLE on the statistics tables concurrently with running ALTER TABLE on InnoDB tables could cause trouble. lock_rec_enqueue_waiting(), lock_table_enqueue_waiting(): Do not issue a fake instant timeout error when the transaction is holding dict_sys.latch. Instead, assert that the dict_sys.latch is never being held here. lock_sys_tables(): A new function to acquire exclusive locks on all dictionary tables, in case DROP TABLE or similar operation is being executed. Locking non-hard-coded tables is optional to avoid a crash in row_merge_drop_temp_indexes(). The SYS_VIRTUAL table was introduced in MySQL 5.7 and MariaDB Server 10.2. Normally, we require all these dictionary tables to exist before executing any DDL, but the function row_merge_drop_temp_indexes() is an exception. When upgrading from MariaDB Server 10.1 or MySQL 5.6 or earlier, the table SYS_VIRTUAL would not exist at this point. ha_innobase::commit_inplace_alter_table(): Invoke log_write_up_to() while not holding dict_sys.latch. dict_sys_t::remove(), dict_table_close(): No longer try to drop index stubs that were left behind by aborted online ADD INDEX. Such indexes should be dropped from the InnoDB data dictionary by row_merge_drop_indexes() as part of the failed DDL operation. Stubs for aborted indexes may only be left behind in the data dictionary cache. dict_stats_fetch_from_ps(): Use a normal read-only transaction. ha_innobase::delete_table(), ha_innobase::truncate(), fts_lock_table(): While waiting for purge to stop using the table, do not hold dict_sys.latch. ha_innobase::delete_table(): Implement a work-around for the rollback of ALTER TABLE...ADD PARTITION. MDL_EXCLUSIVE would not be held if ALTER TABLE hits lock_wait_timeout while trying to upgrade the MDL due to a conflicting LOCK TABLES, such as in the first ALTER TABLE in the test case of Bug#53676 in parts.partition_special_innodb. Therefore, we must explicitly stop purge, because it would not be stopped by MDL. dict_stats_func(), btr_defragment_chunk(): Allocate a THD so that we can acquire MDL on the InnoDB persistent statistics tables. mysqltest_embedded: Invoke ha_pre_shutdown() before free_used_memory() in order to avoid ASAN heap-use-after-free related to acquire_thd(). trx_t::dict_operation_lock_mode: Changed the type to bool. row_mysql_lock_data_dictionary(), row_mysql_unlock_data_dictionary(): Implemented as macros. rollback_inplace_alter_table(): Apply an infinite timeout to lock waits. innodb_thd_increment_pending_ops(): Wrapper for thd_increment_pending_ops(). Never attempt async operation for InnoDB background threads, such as the trx_t::commit() in dict_stats_process_entry_from_recalc_pool(). lock_sys_t::cancel(trx_t*): Make dictionary transactions immune to KILL. lock_wait(): Make dictionary transactions immune to KILL, and to lock wait timeout when waiting for locks on dictionary tables. parts.partition_special_innodb: Use lock_wait_timeout=0 to instantly get ER_LOCK_WAIT_TIMEOUT. main.mdl: Filter out MDL on InnoDB persistent statistics tables Reviewed by: Thirunarayanan Balathandayuthapani
* | | | | | MDEV-16355 Add option for mysqldump to read data as of specific timestamp ↵Sergei Golubchik2021-08-272-7/+51
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from system-versioned tables Based on Aleksey Midenkov's patch mysqldump changes: * --as-of option specifies historical point; * query forging protection for --as-of parameter. system versioned tables are detected by querying I_S.TABLES: * it transfers much less data when the full table definition is not needed * it does not give false positives on x TEXT DEFAULT 'WITH SYSTEM VERSIONING'
* | | | | MDEV-26146: The test main.limit_rows_examined fails in case it is run in PS ↵Dmitry Shulga2021-07-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mode. Test failed by firing assert in append_warnings() when it is called from run_query_stmt() and there are more results from server. Obviously, append_warnings() should be called after the last packet received from server. So, to fix the assertion failure the function mysql_more_results() has to be called to check that now more results does exist and invokes append_warnings() in case the condition satisfied.
* | | | | Merge 10.5 into 10.6Marko Mäkelä2021-06-211-7/+11
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.4 into 10.5Marko Mäkelä2021-06-211-7/+11
| |\ \ \ \ | | |/ / /
| | * | | Merge 10.3 into 10.4Marko Mäkelä2021-06-211-6/+9
| | |\ \ \ | | | |/ /
| | | * | Merge 10.2 into 10.3Marko Mäkelä2021-06-211-6/+9
| | | |\ \ | | | | |/
| | | | * fix mysqlest crash on ./mtr --sp innodb_fts.innodb-fts-stopwordSergei Golubchik2021-06-121-2/+2
| | | | |
| | | | * fix mysqltest crash report outputSergei Golubchik2021-06-121-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * read_command_buf is a pointer now, sizeof() no longer reflects its length, read_command_buflen is. * my_safe_print_str() prints multiple screens of '\0' bytes after the query end and up to read_command_buflen. Use fprintf() instead. * when setting connection->name to "-closed_connection-" update connection->name_len to match.
* | | | | MDEV-16708: fixed issue with handling of the directive ↵Dmitry Shulga2021-06-171-1/+1
| | | | | | | | | | | | | | | | | | | | --enable-prepared-warnings in mysqltest
* | | | | MDEV-16708: Fixed ths issue with handling of ERR packet received by mysqltestDmitry Shulga2021-06-171-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | on response to COM_STMT_EXECUTE The test cases like the following one delimiter |; CREATE PROCEDURE SP001() BEGIN DECLARE C1 CURSOR FOR SELECT 1; OPEN C1; SELECT 1; CLOSE C1; CLOSE C1; END| delimiter ;| --error 1326 call SP001(); are failed since processing of ERR packet was missed by mysqltest in case it is run with --ps-protocol Additionally, the test sp-error was changed to don't run multi-statements since they are not supported by PS protocol
* | | | | MDEV-16708: Unsupported commands for prepared statementsDmitry Shulga2021-06-171-1/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Disable running of the statements PREPARE FROM/EXECUTE/EXECUTE IMMEDIATE/DEALLOCATE in PS mode. Adjust tests main.ps, main.ps_1general