Skip to content

Conversation

@dongwook-chan
Copy link
Collaborator

@dongwook-chan dongwook-chan commented Oct 16, 2021

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

@julien-duponchelle
Copy link
Owner

I will ship a new release with your work. Thanks a lot

@julien-duponchelle julien-duponchelle merged commit f028364 into julien-duponchelle:main Oct 18, 2021
self.assertEqual(event.catalog_nz_code, b'std')
self.assertEqual(event.mts_accessed_db_names, [b'pymysqlreplication_test'])

def test_null_bitmask(self)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

def test_null_bitmask(self):

for i in range(16):
values.append('0')

insert_query += f' ({",".join(values)})')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

insert_query += f' ({",".join(values)})'

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the comment. 👍👍
I will have these fixed in a separate PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants