[MDEV-26948] MariaDB 10.2.10 does not write create temporary table into binary log in mixed mode Created: 2021-11-01  Updated: 2021-11-02  Resolved: 2021-11-02

Status: Closed
Project: MariaDB Server
Component/s: Replication
Affects Version/s: 10.2.10
Fix Version/s: N/A

Type: Bug Priority: Critical
Reporter: Luke Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: replication, temporary-table-replication
Environment:

centos 6.10


Issue Links:
Duplicate
duplicates MDEV-9266 Creating index on temporaray table br... Closed

 Description   

MariaDB 10.2.10 does not write create temporary tables into the binary log when using mixed mode.

How to repeat:
On a master, execute:

mysql>show master logs;
....
| mysql-bin.004699 |  73567816 |
+------------------+-----------+
mysql> create temporary table temp1(id int ,c1 int);
Query OK, 0 rows affected (0.21 sec)
 
mysql> create index idx_1 on temp1(c1);
Query OK, 0 rows affected (0.27 sec)
Records: 0  Duplicates: 0  Warnings: 0
 
mysql> show binlog events in 'mysql-bin.004699' from 73567816;
+------------------+----------+------------+-----------+-------------+----------------------------------------------+
| Log_name         | Pos      | Event_type | Server_id | End_log_pos | Info                                         |
+------------------+----------+------------+-----------+-------------+----------------------------------------------+
| mysql-bin.004699 | 73567816 | Gtid       |        10 |    73567854 | GTID 0-10-59799559                           |
| mysql-bin.004699 | 73567854 | Query      |        10 |    73567949 | use `test`; create index idx_1 on temp1(c1) |
+------------------+----------+------------+-----------+-------------+----------------------------------------------+

but what is wired is it does write in the following create index statement into the binary log, which causes our replication break.

mysql>show slave status\G
*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: somehost
                  Master_User: user
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: mysql-bin.004699
          Read_Master_Log_Pos: 73567949
               Relay_Log_File: mysql-relay.000027
                Relay_Log_Pos: 73568111
        Relay_Master_Log_File: mysql-bin.004699
             Slave_IO_Running: Yes
            Slave_SQL_Running: No
              Replicate_Do_DB:
          Replicate_Ignore_DB:
           Replicate_Do_Table:
       Replicate_Ignore_Table:
      Replicate_Wild_Do_Table:
  Replicate_Wild_Ignore_Table:
                   Last_Errno: 1146
                   Last_Error: Error 'Table 'marin.temp1' doesn't exist' on query. Default database: 'test'. Query: 'create index idx_1 on temp1(c1)'

I tried this in MariaDB 10.2.40 and community version 5.7.30, both do not have this error happen.



 Comments   
Comment by Alice Sherepa [ 2021-11-02 ]

Yes, that's right, the bug was fixed in 10.2.17 (MDEV-9266)

Generated at Thu Feb 08 09:49:09 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.