summaryrefslogtreecommitdiff
path: root/sql-common
Commit message (Collapse)AuthorAgeFilesLines
* Minimize unsafe C functions usageChristian Gonzalez2023-03-081-1/+1
| | | | | | | | | | | | | | | Replace calls to `sprintf` and `strcpy` by the safer options `snprintf` and `safe_strcpy` in the following directories: - libmysqld - mysys - sql-common - strings 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.
* MDEV-11853: semisync thread can be killed after sync binlog but before ACK ↵Brandon Nesterenko2022-04-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in the sync state Problem: ======== If a primary is shutdown during an active semi-sync connection during the period when the primary is awaiting an ACK, the primary hard kills the active communication thread and does not ensure the transaction was received by a replica. This can lead to an inconsistent replication state. Solution: ======== During shutdown, the primary should wait for an ACK or timeout before hard killing a thread which is awaiting a communication. We extend the `SHUTDOWN WAIT FOR SLAVES` logic to identify and ignore any threads waiting for a semi-sync ACK in phase 1. Then, before stopping the ack receiver thread, the shutdown is delayed until all waiting semi-sync connections receive an ACK or time out. The connections are then killed in phase 2. Notes: 1) There remains an unresolved corner case that affects this patch. MDEV-28141: Slave crashes with Packets out of order when connecting to a shutting down master. Specifically, If a slave is connecting to a master which is actively shutting down, the slave can crash with a "Packets out of order" assertion error. To get around this issue in the MTR tests, the primary will wait a small amount of time before phase 1 killing threads to let the replicas safely stop (if applicable). 2) This patch also fixes MDEV-28114: Semi-sync Master ACK Receiver Thread Can Error on COM_QUIT Reviewed By ============ Andrei Elkin <andrei.elkin@mariadb.com>
* Merge branch '10.3' into 10.4Sujatha2020-09-281-2/+2
|\
| * Merge branch '10.2' into 10.3Sujatha2020-09-281-2/+2
| |\
| | * UBSAN: Fix a bit shift overflowMarko Mäkelä2020-09-231-2/+2
| | | | | | | | | | | | | | | | | | Shifting a 16-bit type by 16 bits is undefined behaviour. The result is at least 32 bits, so let us cast the shift operand to a wider type before shifting.
* | | Merge 10.3 into 10.4Marko Mäkelä2020-07-311-0/+2
|\ \ \ | |/ /
| * | Merge 10.2 into 10.3Marko Mäkelä2020-07-311-0/+2
| |\ \ | | |/
| | * MDEV-14203: rpl.rpl_extra_col_master_myisam, ↵Sujatha2020-07-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rpl.rpl_slave_load_tmpdir_not_exist failed in buildbot with a warning Problem: ======= rpl.rpl_slave_load_tmpdir_not_exist 'stmt' w3 [ fail ] Found warnings/errors in server log file! Test ended at 2017-09-27 20:34:55 [Warning] Master is configured to log replication events with checksum, but will not send such events to slaves that cannot process them ^ Found warnings in /mnt/buildbot/build/mariadb-10.2.10/mysql-test/var/3/log/mysqld.1.err ok Analysis: ======== When slave tries to connect to master 'get_master_version_and_clock' function is invoked to perform elaborated slave-master handshake. During this process slave server queries master server, to know if it is checksum aware and at the same time master is notified about its CRC-awareness. The master's side instant value of @@global.binlog_checksum is stored in the dump thread's uservar area as well as cached locally to become known in consensus by master and slave. Post hand-shake slave requests master for binlog dump. It sends 'COM_BINLOG_DUMP'. This command is sent to master by 'cli_advanced_command' call. If there is some temporary network failure during this request_dump call, 'end_server' is invoked to close the current connection between master and slave. Upon connection close the dump thread on the master gets terminated and it clears the 'uservar' data it got through master-slave handshake. The 'COM_BINLOG_DUMP' command is sent once again without master-slave handshake. Since the checksum data is not available with new dump thread a warning gets reported. Fix: === Upon network write error donot attempt reconnect, proceed to master-slave handshake. This ensures that master is aware of slave's capability to use checksums.
* | | Merge 10.3 into 10.4Marko Mäkelä2020-05-051-3/+17
|\ \ \ | |/ /
| * | Merge branch '10.2' into 10.3Oleksandr Byelkin2020-05-041-3/+17
| |\ \ | | |/
| | * Merge branch '10.1' into 10.2Oleksandr Byelkin2020-05-021-3/+17
| | |\
| | | * Merge branch '5.5' into 10.1Oleksandr Byelkin2020-04-301-3/+17
| | | |\
| | | | * Bug#30689251 - BACKPORT TO MYSQL-5.6, BUG#29597896 - NULL POINTER ↵Anushree Prakash B2020-04-301-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DEREFERENCE IN LIBMYSQL DESCRIPTION: ============ There can be issues if the packets sent by the server are not proper. Certain checks should be performed at the client side while unpacking fields data. FIX: ==== Check for the appropriate fields data and error out if it is not present. RB: 23601
* | | | | Merge branch '10.3' into 10.4Oleksandr Byelkin2020-01-211-1/+4
|\ \ \ \ \ | |/ / / /
| * | | | Merge branch '10.2' into 10.3Oleksandr Byelkin2020-01-211-1/+4
| |\ \ \ \ | | |/ / /
| | * | | Merge branch '10.1' into 10.2Oleksandr Byelkin2020-01-201-1/+4
| | |\ \ \ | | | |/ /
| | | * | Merge branch '5.5' into 10.1Oleksandr Byelkin2020-01-191-1/+4
| | | |\ \ | | | | |/
| | | | * Bug#29630767 - USE OF UNINITIALIZED VALUE IN LIBMYSQL (CLIENT.CC FUNCTION ↵mariadb-5.5.67Sergei Golubchik2020-01-181-1/+4
| | | | | | | | | | | | | | | | | | | | RUN_PLUGIN_AUTH)
* | | | | Merge branch '10.3' into 10.4Oleksandr Byelkin2019-12-091-1/+1
|\ \ \ \ \ | |/ / / /
| * | | | Lintian complains on spelling errorFaustin Lammler2019-12-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | The lintian check complains on spelling error: https://salsa.debian.org/mariadb-team/mariadb-10.3/-/jobs/95739
* | | | | Merge 10.3 into 10.4Marko Mäkelä2019-10-101-8/+5
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.2 into 10.3Marko Mäkelä2019-10-091-8/+5
| |\ \ \ \ | | |/ / /
| | * | | Fix problem with warnings of new compilers.Oleksandr Byelkin2019-10-041-2/+0
| | | | |
* | | | | Merge 10.3 into 10.4, except for MDEV-20265Marko Mäkelä2019-08-231-1/+1
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The MDEV-20265 commit e746f451d57def4be679caafc29976741b3e89f7 introduces DBUG_ASSERT(right_op == r_tbl) in st_select_lex::add_cross_joined_table(), and that assertion would fail in several tests that exercise joins. That commit was skipped in this merge, and a separate fix of MDEV-20265 will be necessary in 10.4.
| * | | | Merge 10.2 into 10.3Marko Mäkelä2019-08-211-1/+1
| |\ \ \ \ | | |/ / /
| | * | | Merge 10.1 into 10.2Marko Mäkelä2019-08-201-1/+1
| | |\ \ \ | | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For MDEV-15955, the fix in create_tmp_field_from_item() would cause a compilation error. After a discussion with Alexander Barkov, the fix was omitted and only the test case was kept. In 10.3 and later, MDEV-15955 is fixed properly by overriding create_tmp_field() in Item_func_user_var.
| | | * | MDEV-19034 ASAN unknown-crash in get_date_time_separator with ↵Alexander Barkov2019-08-201-1/+1
| | | | | | | | | | | | | | | | | | | | PAD_CHAR_TO_FULL_LENGTH
* | | | | MDEV-19301 Assertion `!is_valid_datetime() || ↵Alexander Barkov2019-08-061-1/+5
| | | | | | | | | | | | | | | | | | | | fraction_remainder(((item->decimals) < (6) ? (item->decimals) : (6))) == 0' failed in Datetime_truncation_not_needed::Datetime_truncation_not_needed
* | | | | Merge branch '10.3' into 10.4Oleksandr Byelkin2019-07-281-1/+7
|\ \ \ \ \ | |/ / / /
| * | | | Merge branch '10.2' into 10.3Oleksandr Byelkin2019-07-261-1/+7
| |\ \ \ \ | | |/ / /
| | * | | Merge branch '10.1' into 10.2Oleksandr Byelkin2019-07-261-1/+7
| | |\ \ \ | | | |/ /
| | | * | Merge branch '5.5' into 10.1Oleksandr Byelkin2019-07-251-1/+1
| | | |\ \ | | | | |/
| | | | * Backslash added to wrong cachacters of names of client plugin.mariadb-5.5.65Oleksandr Byelkin2019-07-251-1/+1
| | | | |
| | | * | Merge branch '5.5' into 10.1Oleksandr Byelkin2019-07-251-1/+7
| | | |\ \ | | | | |/
| | | | * MDEV-20110 don't try to load client plugins with invalid namesSergei Golubchik2019-07-211-1/+7
| | | | | | | | | | | | | | | | | | | | reported by lixtelnis
* | | | | Merge 10.3 into 10.4Marko Mäkelä2019-06-191-246/+6
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.2 into 10.3Marko Mäkelä2019-06-191-246/+6
| |\ \ \ \ | | |/ / /
| | * | | MDEV-19750 mysql command wrong encodingVladislav Vaintroub2019-06-171-246/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Restore the detection of default charset in command line utilities. It worked up to 10.1, but was broken by Connector/C. Moved code for detection of default charset from sql-common/client.c to mysys, and make command line utilities to use this code if charset was not specified on the command line.
* | | | | MDEV-18531 : Use WolfSSL instead of YaSSL as "bundled" SSL/encryption libraryVladislav Vaintroub2019-05-221-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add new submodule for WolfSSL - Build and use wolfssl and wolfcrypt instead of yassl/taocrypt - Use HAVE_WOLFSSL instead of HAVE_YASSL - Increase MY_AES_CTX_SIZE, to avoid compile time asserts in my_crypt.cc (sizeof(EVP_CIPHER_CTX) is larger on WolfSSL)
* | | | | Merge branch '10.3' into 10.4Oleksandr Byelkin2019-05-197-9/+11
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.2 into 10.3Marko Mäkelä2019-05-147-7/+7
| |\ \ \ \ | | |/ / /
| | * | | Merge 10.1 into 10.2Marko Mäkelä2019-05-137-7/+7
| | |\ \ \ | | | |/ /
| | | * | Merge branch '5.5' into 10.1Vicențiu Ciorbaru2019-05-115-5/+5
| | | |\ \ | | | | |/
| | | | * Update FSF AddressVicențiu Ciorbaru2019-05-115-5/+5
| | | | | | | | | | | | | | | | | | | | * Update wrong zip-code
| * | | | Merge branch '10.2' into 10.3Oleksandr Byelkin2019-05-121-2/+4
| |\ \ \ \ | | |/ / /
| | * | | Merge branch '10.1' into 10.2Oleksandr Byelkin2019-05-041-2/+4
| | |\ \ \ | | | |/ /
| | | * | MDEV-18131 MariaDB does not verify IP addresses from subject alternativeVladislav Vaintroub2019-04-281-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | names Added a call to X509_check_ip_asc() in case server_hostname represents an IP address.
| | | * | cmake: re-enable -Werror in the maintainer modeSergei Golubchik2019-03-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | now we can afford it. Fix -Werror errors. Note: * old gcc is bad at detecting uninit variables, disable it. * time_t is int or long, cast it for printf's
* | | | | Merge branch '10.3' into 10.4Oleksandr Byelkin2019-02-211-3/+27
|\ \ \ \ \ | |/ / / /
| * | | | dirty mergeOleksandr Byelkin2019-02-071-3/+27
| |\ \ \ \ | | |/ / /