[MDEV-30698]  Cover missing test cases for mariadb-binlog options --raw [and] --flashback Created: 2023-02-21  Updated: 2023-03-08  Resolved: 2023-03-08

Status: Closed
Project: MariaDB Server
Component/s: Replication, Scripts & Clients
Affects Version/s: 10.11
Fix Version/s: 10.4.29

Type: Bug Priority: Major
Reporter: Anel Husakovic Assignee: Andrew Hutchings
Resolution: Fixed Votes: 0
Labels: Papercut


 Description   

Here we should address 2 missing test cases in test suite:
1. There is no test case where --raw is used without -R, since it is required option
Proof:
raw option (option used to create raw/binary data instead of SQL query) should be used with -R, --read-from-remote-server (see
options)

$ ./client/mysqlbinlog mysql-test/var/tmp/mysqlbinlog_row_flashback_3.sql  --raw
ERROR: The --raw mode only works with --read-from-remote-server

However we don't have that covered in test case mysql-test/suite/binlog/t/binlog_mysqlbinlog_raw_flush.test, this MDEV should create one.

2. There is no test case for raw and --flashback and it is not documented behavior (spoted by cvicentiu).
Theoretically mariadb-binlog can be used with both options to generate the file (what flashback option is used for); but generated file, will contain wrong data and as polluted cannot be used by mariadb client for query execution.

  • Proof:

    $ ./client/mariadb-binlog ../../src/10.11/mysql-test/master-bin.000003
     
    /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
    /*!40019 SET @@session.max_delayed_threads=0*/;
    /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
    DELIMITER /*!*/;
    # at 4
    #010909  3:46:40 server id 1  end_log_pos 256 CRC32 0x06b549c7  Start: binlog v 4, server v 10.11.3-MariaDB-debug-log created 010909  3:46:40
    BINLOG '
    AMqaOw8BAAAA/AAAAAABAAAAAAQAMTAuMTEuMy1NYXJpYURCLWRlYnVnLWxvZwAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAEzgNAAgAEgAEBAQEEgAA5AAEGggAAAAICAgCAAAACgoKAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAEEwQADQgICAoKCgHHSbUG
    ....
    

Since this is not desired situation, we need to generate an error when the options are used together

The tasks should be:
1. Cover the test case for --raw without -R
2. Write test case for -raw and -flasback and generate the error when used in conjuction and document in the KB.

The above is not catched with Coverity scan.


Generated at Thu Feb 08 10:18:13 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.