summaryrefslogtreecommitdiff
path: root/client
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.3 into 10.4Marko Mäkelä2022-06-022-1/+12
|\
| * Add option --enable-cleartext-plugin to the MariaDB clientTing Nian2022-05-262-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For compatibility reasons, add the option to the MariaDB client without any functional changes besides simply accepting the option and emitting a warning that it is obsolete. In MySQL this security related option is compulsory in certain use cases. When users switch to MariaDB, this client command that used to work starts failing without a sensible error message. In worst case users resort to re-installing the mysql client from MySQL. In MariaDB the option is obsolete and should simply be ignored. Users however don't have any opportunity to learn that unless the client program tells them so. Before: mysql --enable-cleartext-plugin ... mysql: unknown option '--enable-cleartext-plugin' (program terminates) After: mysql --enable-cleartext-plugin ... WARNING: option '--enable-cleartext-plugin' is obsolete. (program executes) 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.
* | Merge branch '10.3' into 10.4Sergei Golubchik2022-05-081-38/+68
|\ \ | |/
| * MDEV-4875 Can't restore a mysqldump if --add-drop-database meets general_logDaniel Black2022-05-061-35/+65
| | | | | | | | | | | | | | | | | | | | | | | | or slow query log when the log_output=TABLE. When this happens, we temporary disable by changing log_output until we've created the general_log and slow_log tables again. Move </database> in xml mode until after the transaction_registry. General_log and slow_log tables where moved to be first to be dumped so that the disabling of the general/slow queries is minimal.
| * MDEV-27816 Set sql_mode before DROP IF EXISTS alreadyHartmut Holzgraefe2022-05-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | Previously the correct SQL mode for a stored routine or package was only set before doing the CREATE part, this worked out for PROCEDUREs and FUNCTIONs, but with ORACLE mode specific PACKAGEs the DROP also only works in ORACLE mode. Moving the setting of the sql_mode a few lines up to happen right before the DROP statement is writen fixes this.
* | Fixed that mysql_upgrade doesn't give errors about mariadb.sysMonty2022-04-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The reason for this fix was that when I tried to run mysql_upgrade at home to update an old 10.5 installation, mysql_upgrade failed with warnings about mariadb.sys user not existing. If the server was started with --skip-grants, there would be no warnings from mysql_upgrade, but in some cases running mysql_upgrade again could produce new warnings. The reason for the warnings was that any access of the mysql.user view will produce a warning if the mariadb.sys user does not exists. Fixed with the following changes: - Disable warnings about mariadb.sys user not existing - Don't overwrite old mariadb.sys entries in tables_priv and global_priv - Ensure that tables_priv has an entry for mariadb.sys if the user exists. This fixes an issue that tables_priv would not be updated if there was a failure directly after global_priv was updated.
* | Galera test failure on galera_bf_abort_ps_bindDaniele Sciascia2022-03-301-1/+4
| | | | | | | | | | | | | | Fix a possible crash on my_free() due to the use of strdup() versus my_strdup(), and a memory leak. Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
* | Merge 10.3 into 10.4Marko Mäkelä2022-03-291-0/+1
|\ \ | |/
| * Merge 10.2 into 10.3Marko Mäkelä2022-03-291-0/+1
| |\
| | * MDEV-14608: mysqlbinlog lastest backupfile size is 0Brandon Nesterenko2022-03-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: ======== When using mariadb-binlog with --raw and --stop-never, events from the master's currently active log file should be written to their respective log file specified by --result-file, and shown on-disk. There is a bug where mariadb-binlog does not flush the result file to disk when new events are received Solution: ======== Add a function call to flush mariadb-binlog’s result file after receiving an event in --raw mode. Reviewed By: ============ Andrei Elkin <andrei.elkin@mariadb.com>
* | | MDEV-27649 Crash with PS execute after BF abortsjaakola2022-03-181-0/+450
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit contains a test for reproducing the issue in MDEV-27649, where a transaction, executing a prepared statment, is BF aborted. The scenario, in MDEV-27649 has a transaction which has prepared a PS, but not yet executed it, and this transaction is then BF aborted in this state. When the BF aborted transaction tries to execute the PS, it will receive deadlock error. But, when it tries to execute the PS second time, the node crashes. Mtr test galera.galera_bf_abort_ps_bind, exercises this scenario. However, mtr test platform does not have mechanism to control the execution of PS in required detail. For this purpose, mysqltetst.cc was extended to contain 4 new commands: PS_prepare - to prepare a prepared statement PS_bind - to bind values for parameters for the PS PS_execute - to execute the PS PS_close - to close the PS The support for controlling prepared statments in mtr scripts is quite minimal in this commit. Limitations are: * only one PS can be used by a connection, at a time * only input parameters can be bound for the PS * only varchar, integer or float type of parameters can be bound added the result fixes Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
* | | Merge 10.3 into 10.4Marko Mäkelä2022-02-171-0/+23
|\ \ \ | |/ /
| * | MDEV-27691: make working view-protocolLena Startseva2022-02-161-0/+23
| | | | | | | | | | | | | | | | | | Added ability to disable/enable (--disable_view_protocol/--enable_view_protocol) view-protocol in tests. When the option "--disable_view_protocol" is used util connections are closed. Added new test for checking view-protocol
* | | Merge branch '10.3' into 10.4mariadb-10.4.24Sergei Golubchik2022-02-101-15/+11
|\ \ \ | |/ /
| * | Merge branch '10.2' into 10.3mariadb-10.3.34Sergei Golubchik2022-02-101-15/+11
| |\ \ | | |/
| | * MDEV-27789 mysql_upgrade / mariadb-upgrade in 10.6.6 is putting password in ↵Monty2022-02-101-15/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | host argument Removed all dependencies of command line arguments based on positions in an array (this kind of code should never have been written). Instead use option names, which are stable. Reviewer: Sergei Golubchik
* | | Merge branch '10.3' into 10.4Oleksandr Byelkin2022-01-302-96/+223
|\ \ \ | |/ /
| * | Merge branch '10.2' into 10.3mariadb-10.3.33Oleksandr Byelkin2022-01-292-98/+225
| |\ \ | | |/
| | * MDEV-27068 running mariadb-upgrade in parallel make it hangs foreverMonty2022-01-202-90/+224
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MDEV-27107 prevent two mariadb-upgrade running in parallel MDEV-27279 mariadb_upgrade add --check-if-upgrade-is-needed / restrict tests to major version Code is based of pull request from Daniel Black, but with a several extensions. - mysql_upgrade now locks the mysql_upgrade file with my_lock() (Advisory record locking). This ensures that two mysql_upgrades cannot be run in parallel. - Added --check-if-upgrade-is-needed to mysql_upgrade. This will return 0 if one has to run mysql_upgrade. Other changes: - mysql_upgrade will now immediately exit if the major version and minor version (two first numbers in the version string) is same as last run. Before this change mysql_upgrade was run if the version string was different from last run. - Better messages when there is no need to run mysql_upgrade. - mysql_upgrade --verbose now prints out a lot more information about the version checking. - mysql_upgrade --debug now uses default debug arguments if there is no option to --debug - "MySQL" is renamed to MariaDB in the messages - mysql_upgrade version increased to 2.0 Notes Verifying "prevent two mariadb-upgrade running in parallel" was done in a debugger as it would be a bit complex to do that in mtr. Reviewer: Danial Black <daniel@mariadb.org>
* | | Merge branch 10.3 into 10.4Julius Goryavsky2021-12-251-8/+3
|\ \ \ | |/ /
| * | Merge branch 10.2 into 10.3Julius Goryavsky2021-12-231-8/+3
| |\ \ | | |/
| | * MDEV-27191 MariaDB client - "system" command does not work on WindowsVladislav Vaintroub2021-12-071-8/+3
| | | | | | | | | | | | | | | - define USE_POPEN, like it is done elsewhere. - use Notepad as default editor on Windows for the "edit" command.
* | | Add --optimizer_trace option to mysqltestMonty2021-12-151-2/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This enables optimizer_trace output for the next SQL command. Identical as if one would have done: - Store value of @@optimizer_trace - Set @optimizer_trace="enabled=on" - Run query - SELECT * from OPTIMIZER_TRACE - Restore value of @@optimizer_trace This is a great time saver when one wants to quickly check the optimizer trace for a query in a mtr test.
* | | Merge 10.3 into 10.4Marko Mäkelä2021-11-091-5/+9
|\ \ \ | |/ /
| * | Merge 10.2 into 10.3Marko Mäkelä2021-11-091-5/+9
| |\ \ | | |/
| | * MDEV-19129: Xcode compatibility update: #include <editline/readline.h> pathSergei Krivonos2021-10-311-1/+5
| | |
* | | 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.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.
* | | 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 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
* | | 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.
* | | Fix all warnings given by UBSANMonty2021-04-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The easiest way to compile and test the server with UBSAN is to run: ./BUILD/compile-pentium64-ubsan and then run mysql-test-run. After this commit, one should be able to run this without any UBSAN warnings. There is still a few compiler warnings that should be fixed at some point, but these do not expose any real bugs. The 'special' cases where we disable, suppress or circumvent UBSAN are: - ref10 source (as here we intentionally do some shifts that UBSAN complains about. - x86 version of optimized int#korr() methods. UBSAN do not like unaligned memory access of integers. Fixed by using byte_order_generic.h when compiling with UBSAN - We use smaller thread stack with ASAN and UBSAN, which forced me to disable a few tests that prints the thread stack size. - Verifying class types does not work for shared libraries. I added suppression in mysql-test-run.pl for this case. - Added '#ifdef WITH_UBSAN' when using integer arithmetic where it is safe to have overflows (two cases, in item_func.cc). Things fixed: - Don't left shift signed values (byte_order_generic.h, mysqltest.c, item_sum.cc and many more) - Don't assign not non existing values to enum variables. - Ensure that bool and enum values are properly initialized in constructors. This was needed as UBSAN checks that these types has correct values when one copies an object. (gcalc_tools.h, ha_partition.cc, item_sum.cc, partition_element.h ...) - Ensure we do not called handler functions on unallocated objects or deleted objects. (events.cc, sql_acl.cc). - Fixed bugs in Item_sp::Item_sp() where we did not call constructor on Query_arena object. - Fixed several cast of objects to an incompatible class! (Item.cc, Item_buff.cc, item_timefunc.cc, opt_subselect.cc, sql_acl.cc, sql_select.cc ...) - Ensure we do not do integer arithmetic that causes over or underflows. This includes also ++ and -- of integers. (Item_func.cc, Item_strfunc.cc, item_timefunc.cc, sql_base.cc ...) - Added JSON_VALUE_UNITIALIZED to json_value_types and ensure that value_type is initialized to this instead of to -1, which is not a valid enum value for json_value_types. - Ensure we do not call memcpy() when second argument could be null. - Fixed that Item_func_str::make_empty_result() creates an empty string instead of a null string (safer as it ensures we do not do arithmetic on null strings). Other things: - Changed struct st_position to an OBJECT and added an initialization function to it to ensure that we do not copy or use uninitialized members. The change to a class was also motived that we used "struct st_position" and POSITION randomly trough the code which was confusing. - Notably big rewrite in sql_acl.cc to avoid using deleted objects. - Changed in sql_partition to use '^' instead of '-'. This is safe as the operator is either 0 or 0x8000000000000000ULL. - Added check for select_nr < INT_MAX in JOIN::build_explain() to avoid bug when get_select() could return NULL. - Reordered elements in POSITION for better alignment. - Changed sql_test.cc::print_plan() to use pointers instead of objects. - Fixed bug in find_set() where could could execute '1 << -1'. - Added variable have_sanitizer, used by mtr. (This variable was before only in 10.5 and up). It can now have one of two values: ASAN or UBSAN. - Moved ~Archive_share() from ha_archive.cc to ha_archive.h and marked it virtual. This was an effort to get UBSAN to work with loaded storage engines. I kept the change as the new place is better. - Added in CONNECT engine COLBLK::SetName(), to get around a wrong cast in tabutil.cpp. - Added HAVE_REPLICATION around usage of rgi_slave, to get embedded server to compile with UBSAN. (Patch from Marko). - Added #ifdef for powerpc64 to avoid a bug in old gcc versions related to integer arithmetic. Changes that should not be needed but had to be done to suppress warnings from UBSAN: - Added static_cast<<uint16_t>> around shift to get rid of a LOT of compiler warnings when using UBSAN. - Had to change some '/' of 2 base integers to shift to get rid of some compile time warnings. Reviewed by: - Json changes: Alexey Botchkov - Charset changes in ctype-uca.c: Alexander Barkov - InnoDB changes & Embedded server: Marko Mäkelä - sql_acl.cc changes: Vicențiu Ciorbaru - build_explain() changes: Sergey Petrunia
* | | Merge 10.3 into 10.4Marko Mäkelä2021-03-271-1/+5
|\ \ \ | |/ /