julien-duponchelle / julien-duponchelle/python-mysql-replication

Unknown status variable in query event - mariadb 11.7

Open
#632 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
2.4k
Forks
690
PR merge metrics
No merged PRs in 30d

Description

I am trying to read binlogs from my local mariadb server, which has version 11.7.

in the binlogs, there is an event status with the key 131 and a uint16 as the content.

```
Traceback (most recent call last):
File "binlog2sql/test.py", line 7, in
for binlogevent in stream:
^^^^^^
File "binlog2sql/venv/lib/python3.13/site-packages/pymysqlreplication/binlogstream.py", line 618, in fetchone
binlog_event = BinLogPacketWrapper(
pkt,
...<12 lines>...
self.__optional_meta_data,
)
File "binlog2sql/venv/lib/python3.13/site-packages/pymysqlreplication/packet.py", line 116, in __init__
self.event = event_class(
~~~~~~~~~~~^
self,
^^^^^
...<11 lines>...
optional_meta_data=optional_meta_data,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "binlog2sql/venv/lib/python3.13/site-packages/pymysqlreplication/event.py", line 496, in __init__
self._read_status_vars_value_for_key(status_vars_key)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "binlog2sql/venv/lib/python3.13/site-packages/pymysqlreplication/event.py", line 596, in _read_status_vars_value_for_key
raise StatusVariableMismatch
pymysqlreplication.exceptions.StatusVariableMismatch: Unknown status variable in query event. Possible parse failure in preceding fields or outdated constants.STATUS_VAR_KEY Refer to MySQL documentation/source code or create an issue on GitHub
```

```
MariaDB [(none)]> select VERSION();
+--------------------+
| VERSION() |
+--------------------+
| 11.7.2-MariaDB-log |
+--------------------+
1 row in set (0.002 sec)
```

query that triggered it is a create table.

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with MariaDB 11.7.2 and the CREATE TABLE query described, then inspect pymysqlreplication/event.py around _read_status_vars_value_for_key and the constants.STATUS_VAR_KEY reference. Compare status variable key 131 and its uint16 value with the MariaDB binlog query-event format; done means the event parses without StatusVariableMismatch and existing behavior remains covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
mariadb, python
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.