Repository navigation
Parse NULL-bitmask in table map event - #361
Conversation
[Fields in table map event](https://dev.mysql.com/doc/internals/en/table-map-event.html) [buffer layout for table map event](https://github.com/mysql/mysql-server/blob/beb865a960b9a8a16cf999c323e46c5b0c67f21f/libbinlogevents/include/rows_event.h#L633-L639) [null bitmask in mysql-server](https://github.com/mysql/mysql-server/blob/beb865a960b9a8a16cf999c323e46c5b0c67f21f/libbinlogevents/src/rows_event.cpp#L93)
|
I will ship a new release with your work. Thanks a lot |
| self.assertEqual(event.catalog_nz_code, b'std') | ||
| self.assertEqual(event.mts_accessed_db_names, [b'pymysqlreplication_test']) | ||
|
|
||
| def test_null_bitmask(self) |
There was a problem hiding this comment.
def test_null_bitmask(self):
| for i in range(16): | ||
| values.append('0') | ||
|
|
||
| insert_query += f' ({",".join(values)})') |
There was a problem hiding this comment.
insert_query += f' ({",".join(values)})'
There was a problem hiding this comment.
Thank you for the comment. 👍👍
I will have these fixed in a separate PR.
|
Thanks for the null-bitmask review. Both syntax corrections in the test are valid: the function definition needs its trailing colon, and the INSERT construction must not have the extra closing parenthesis. I acknowledged one of these earlier but did not provide a follow-up commit in this discussion. Since this PR is already merged, I am recording that gap rather than claiming the old review was fully implemented. Review threads addressed in this reply: |
This PR adds null-bitmask attribute to table map event.
The attribute is a bit mask where (i - 1) th bit is set if i th column is nullable.
Added and passed relevant tests.
This feature is suggested in the following comments:
https://github.com/noplay/python-mysql-replication/blob/f70f05bc143bbf50dad5461dcb3a2a47a7f67202/pymysqlreplication/row_event.py#L651-L652
References
MySQL Documentation
mysql-server source code