summaryrefslogtreecommitdiff
path: root/client/mysqlbinlog.cc
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.5 into 10.6Marko Mäkelä2023-04-111-9/+20
|\
| * Merge remote-tracking branch '10.4' into 10.5Oleksandr Byelkin2023-03-311-9/+20
| |\
| | * MDEV-30698 Cover missing test cases for mariadb-binlog options --raw [and] ↵Anel Husakovic2023-03-081-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | --flashback - Adding test case for --raw without -R - Adding unsuported combination of --raw and --flashback parameters and covered with test case
| | * Update handling of mysqlbinlog's `die()` functionAnel Husakovic2023-03-081-9/+9
| | | | | | | | | | | | - Update per Monty's review for commit 5328dbdaa237d97e443120f2e08437fb274198c2
| | * MDEV-30697: Memory leak detected when mariadb-binlog is used with option ↵Anel Husakovic2023-03-081-0/+5
| | | | | | | | | | | | flashback
| | * Ensure that mysqlbinlog frees all memory at exitMonty2023-03-081-14/+23
| | |
| | * MDBF-534: Coverity scan: fix client folderAnel Husakovic2023-02-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --------------------------------- File: `mysqlbinlog` --------------------------------- - Coverity (FORWARD_NULL): https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728438&defectInstanceId=53074517&mergedDefectId=1519690&eventId=53074517-46 `mysqlbinlog` - for `opt_raw_mode` file is set to 0, make sure it opened before.
* | | Merge 10.5 into 10.6Marko Mäkelä2023-02-101-2/+2
|\ \ \ | |/ /
| * | Merge 10.4 into 10.5Marko Mäkelä2023-02-101-2/+2
| |\ \ | | |/
| | * Apply clang-tidy to remove empty constructors / destructorsVicențiu Ciorbaru2023-02-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is the result of running run-clang-tidy -fix -header-filter=.* -checks='-*,modernize-use-equals-default' . Code style changes have been done on top. The result of this change leads to the following improvements: 1. Binary size reduction. * For a -DBUILD_CONFIG=mysql_release build, the binary size is reduced by ~400kb. * A raw -DCMAKE_BUILD_TYPE=Release reduces the binary size by ~1.4kb. 2. Compiler can better understand the intent of the code, thus it leads to more optimization possibilities. Additionally it enabled detecting unused variables that had an empty default constructor but not marked so explicitly. Particular change required following this patch in sql/opt_range.cc result_keys, an unused template class Bitmap now correctly issues unused variable warnings. Setting Bitmap template class constructor to default allows the compiler to identify that there are no side-effects when instantiating the class. Previously the compiler could not issue the warning as it assumed Bitmap class (being a template) would not be performing a NO-OP for its default constructor. This prevented the "unused variable warning".
* | | Merge 10.5 into 10.6Marko Mäkelä2022-10-121-1/+1
|\ \ \ | |/ /
| * | Merge 10.4 into 10.5Marko Mäkelä2022-10-121-1/+1
| |\ \ | | |/
| | * Merge 10.3 into 10.4Marko Mäkelä2022-10-111-1/+1
| | |\
| | | * MDEV-29183: Clarify mysqlbinlog command description (#2245)Zhibo Zhang2022-10-111-1/+1
| | | | | | | | | | | | The statement 'Verify checksum binlog events.' is confusing. Fix word order to make it clear.
* | | | Merge branch '10.5' into 10.6Oleksandr Byelkin2022-08-101-1/+1
|\ \ \ \ | |/ / /
| * | | Merge branch '10.4' into 10.5mariadb-10.5.17Oleksandr Byelkin2022-08-101-1/+1
| |\ \ \ | | |/ /
| | * | Merge branch '10.3' into bb-10.4-releasemariadb-10.4.26Oleksandr Byelkin2022-08-101-1/+1
| | |\ \ | | | |/
| | | * Fix typos in the codebase.fluesvamp2022-08-091-1/+1
| | | |
* | | | Merge 10.5 into 10.6Marko Mäkelä2022-03-291-0/+1
|\ \ \ \ | |/ / /
| * | | Merge 10.4 into 10.5Marko Mäkelä2022-03-291-0/+1
| |\ \ \ | | |/ /
| | * | 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-16372 ER_BASE64_DECODE_ERROR upon replaying binary log via mysqlbinlog ↵Andrei Elkin2020-08-311-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --verbose (This commit is exclusively for 10.2 branch. Do not merge it to 10.3) In case of a pattern of non-STMT_END-marked Rows-log-event (A) followed by a STMT_END marked one (B) mysqlbinlog mixes up the base64 encoded rows events with their pseudo sql representation produced by the verbose option: BINLOG ' base64 encoded data for A ### verbose section for A base64 encoded data for B ### verbose section for B '/*!*/; In effect the produced BINLOG '...' query is not valid and is rejected with the error. Examples of this way malformed BINLOG could have been found in binlog_row_annotate.result that gets corrected with the patch. The issue is fixed with introduction an auxiliary IO_CACHE to hold on the verbose comments until the terminal STMT_END event is found. The new cache is emptied out after two pre-existing ones are done at that time. The correctly produced output now for the above case is as the following: BINLOG ' base64 encoded data for A base64 encoded data for B '/*!*/; ### verbose section for A ### verbose section for B Thanks to Alexey Midenkov for the problem recognition and attempt to tackle, and to Venkatesh Duggirala who produced a patch for the upstream whose idea is exploited here, as well as to MDEV-23077 reporter LukeXwang who also contributed a piece of a patch aiming at this issue.
* | | | | MDEV-25602 get rid of __WIN__ in favor of standard _WIN32Vladislav Vaintroub2021-06-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixed the MySQL bug# 20338 about misuse of double underscore prefix __WIN__, which was old MySQL's idea of identifying Windows Replace it by _WIN32 standard symbol for targeting Windows OS (both 32 and 64 bit) Not that connect storage engine is not fixed in this patch (must be fixed in "upstream" branch)
* | | | | MDEV-22189: Change error messages inside code to have mariadb instead ofRucha Deodhar2021-05-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysql Fix: Changed error messages, rerecorded results and changed other relevant files.
* | | | | Change replication to use uchar for all buffers instead of charMonty2021-05-191-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change is to get rid of randomly failing tests, especially those that reads random position of the binary log. From looking at the logs it's clear that some failures is because of a read char (with value >= 128) is converted to a big long value. Using uchar everywhere makes this much less likely to happen. Another benefit is that a lot of cast of char to uchar could be removed. Other things: - Removed some extra space before '=' and '+=' in assignments - Fixed indentations and lines > 80 characters - Replace '16' with 'element_size' (from class definition) in Gtid_list_log_event()
* | | | | MDEV-25222: mysqlbinlog --base64-output wrong option default drops BINLOG ↵Brandon Nesterenko2021-05-191-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from output The --help comment for the --base64-output option in mysqlbinlog was hard to decipher. This quick patch aims to refine it. Reviewed By: ========== Andrei Elkin: <andrei.elkin@mariadb.com>
* | | | | Merge 10.5 into 10.6Marko Mäkelä2021-05-181-93/+18
|\ \ \ \ \ | |/ / / /
| * | | | MDEV-25222: mysqlbinlog --base64-output wrong option default drops BINLOG ↵Brandon Nesterenko2021-05-171-93/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from output Problem: ======= The ALWAYS option of the mariadb-binlog --base64-output flag formats its output incorrectly. This option is deprecated, and MySQL 8.0 has removed it entirely. Solution: ======== Adhere to MySQL and remove this option from MariaDB. Behavioral Changes: ================== Use Case: ./mariadb-binlog --base64-output Previous Behavior: Sets base64-output mode to always New Behavior: Error message indicating incomplete argument Use Case: ./mariadb-binlog --base64-output=always Previous Behavior: Sets base64-output mode to always New Behavior: Error message indicating invalid argument value Reviewed By: ========== Andrei Elkin: <andrei.elkin@mariadb.com>
* | | | | MDEV-14974: --port ignored for --host=localhostBrandon Nesterenko2021-05-111-1/+57
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: ======= MariaDB's command line utilities (e.g., mysql, mysqldump, etc) silently ignore connection property options (e.g., --port and --socket) when protocol is not explicitly set via the command-line for localhost connections. Fix: === If connection properties are specified without a protocol, override the protocol to be consistent. For example, if --port is specified, automatically set protocol=tcp. Caveats: ======= * When multiple connection properties are specified, nothing is overridden * If protocol is is set via the command-line, its value is used Reviewers: ======== Sergei Golubchik <serg@mariadb.com> Vladislav Vaintroub <wlad@mariadb.com>
* | | | Added 'const' to arguments in get_one_option and find_typeset()Monty2021-02-081-24/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One should not change the program arguments! This change also reduces warnings from the icc compiler. Almost all changes are just syntax changes (adding const to 'get_one_option function' declarations). Other changes: - Added a few cast of 'argument' from 'const char*' to 'char *'. This was mainly in calls to 'external' functions we don't have control of. - Ensure that all reset of 'password command line argument' are similar. (In almost all cases it was just adding a comment and a cast) - In mysqlbinlog.cc and mysqld.cc there was a few cases that changed the command line argument. These places where changed to instead allocate the option in a MEM_ROOT to avoid changing the argument. Some of this code was changed to ensure that different programs did parsing the same way. Added a test case for the changes in mysqlbinlog.cc - Changed a few variables that took their value from command line options from 'char *' to 'const char *'.
* | | | Ensure that mysqlbinlog frees all memory at exitMonty2021-02-081-14/+23
| | | |
* | | | Merge 10.4 into 10.5Marko Mäkelä2020-09-041-2/+6
|\ \ \ \ | |/ / /
| * | | Merge 10.3 into 10.4Marko Mäkelä2020-09-031-2/+6
| |\ \ \ | | |/ /
| | * | MDEV-16372 ER_BASE64_DECODE_ERROR upon replaying binary log via mysqlbinlog ↵Andrei Elkin2020-08-311-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --verbose (This commit is for 10.3 and upper branches) In case of a pattern of non-STMT_END-marked Rows-log-event (A) followed by a STMT_END marked one (B) mysqlbinlog mixes up the base64 encoded rows events with their pseudo sql representation produced by the verbose option: BINLOG ' base64 encoded data for A ### verbose section for A base64 encoded data for B ### verbose section for B '/*!*/; In effect the produced BINLOG '...' query is not valid and is rejected with the error. Examples of this way malformed BINLOG could have been found in binlog_row_annotate.result that gets corrected with the patch. The issue is fixed with introduction an auxiliary IO_CACHE to hold on the verbose comments until the terminal STMT_END event is found. The new cache is emptied out after two pre-existing ones are done at that time. The correctly produced output now for the above case is as the following: BINLOG ' base64 encoded data for A base64 encoded data for B '/*!*/; ### verbose section for A ### verbose section for B Thanks to Alexey Midenkov for the problem recognition and attempt to tackle, and to Venkatesh Duggirala who produced a patch for the upstream whose idea is exploited here, as well as to MDEV-23077 reporter LukeXwang who also contributed a piece of a patch aiming at this issue.
* | | | Merge 10.4 into 10.5Marko Mäkelä2020-06-141-2/+2
|\ \ \ \ | |/ / /
| * | | Merge 10.3 into 10.4Marko Mäkelä2020-06-131-2/+2
| |\ \ \ | | |/ /
| | * | Merge 10.2 into 10.3Marko Mäkelä2020-06-131-2/+2
| | |\ \ | | | |/
| | | * Merge branch '10.1' into 10.2Vicențiu Ciorbaru2020-06-111-2/+2
| | | |\
| | | | * Client spelling mistakesIan Gilfillan2020-06-081-2/+2
| | | | |
* | | | | Updated client and server to use new binary names in --debug tracesMonty2020-04-191-1/+1
| | | | |
* | | | | MDEV-22214 mariadbd.exe calls function mysqld.exe, and crashesVladislav Vaintroub2020-04-101-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stop linking plugins to the server executable on Windows. Instead, extract whole server functionality into a large DLL, called server.dll. Link both plugins, and small server "stub" exe to it. This eliminates plugin dependency on the name of the server executable. It also reduces the size of the packages (since tiny mysqld.exe and mariadbd.exe are now both linked to one big DLL) Also, simplify the functionality of exporing all symbols from selected static libraries. Rely on WINDOWS_EXPORT_ALL_SYMBOLS, rather than old self-backed solution. fix compile error replace GetProcAddress(GetModuleHandle(NULL), "variable_name") for server exported data with actual variable names. Runtime loading was never required,was error prone , since symbols could be missing at runtime, and now it actually failed, because we do not export symbols from executable anymore, but from a shared library This did require a MYSQL_PLUGIN_IMPORT decoration for the plugin, but made the code more straightforward, and avoids missing symbols at runtime (as mentioned before). The audit plugin is still doing some dynamic loading, as it aims to work cross-version. Now it won't work cross-version on Windows, as it already uses some symbols that are *not* dynamically loaded, e.g fn_format and those symbols now exported from server.dll , when earlier they were exported by mysqld.exe Windows, fixes for storage engine plugin loading after various rebranding stuff Create server.dll containing functionality of the whole server make mariadbd.exe/mysqld.exe a stub that is only calling mysqld_main() fix build
* | | | | Merge 10.4 into 10.5Marko Mäkelä2020-03-231-0/+1
|\ \ \ \ \ | |/ / / /
| * | | | default_gtid_pos_table: my_atomic to std::atomicSergey Vojtovich2020-03-211-0/+1
| | | | |
* | | | | Merge 10.4 into 10.5Marko Mäkelä2020-03-171-7/+7
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.3 into 10.4Marko Mäkelä2020-03-161-7/+7
| |\ \ \ \ | | |/ / /
| | * | | Merge 10.2 into 10.3Marko Mäkelä2020-03-131-7/+7
| | |\ \ \ | | | |/ /
| | | * | Merge 10.1 into 10.2Marko Mäkelä2020-03-131-7/+7
| | | |\ \ | | | | |/
| | | | * Merge 5.5 into 10.1Marko Mäkelä2020-03-131-7/+7
| | | | |\