-
Notifications
You must be signed in to change notification settings - Fork 682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Distinguish ambiguous column value of None
#489
Distinguish ambiguous column value of None
#489
Conversation
Since column schema has deleted, we cannot get any none sources when optional_meta_data is False.
…ython-mysql-replication into feature/categorize-none-column
pymysqlreplication/row_event.py
Outdated
return self.__read_datetime() | ||
ret = self.__read_datetime() | ||
if ret is None: | ||
self.__none_sources[name] = "out of datetime range" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it should be a constant this will allow people to code behavior based on that. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@julien-duponchelle Thanks for your review!
Do you mean that setting constant like
OUTDATETIME = "out of datetime range"
and set __none_source like below?
self.__none_source[name] = OUTDATETIME
If this is right, I'm going to set constant by enum and set values with that :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@julien-duponchelle
I added pymysqlreplication/constants/NONE_SOURCE.py
and changed row_event.py
to handle values according to the variables in NONE_SORUCE.py
.
Please let me know if there's anything need to change :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thanks for hard work!
Resolve #479
Overview
In RowsEvent, there are three cases in which the column value is
None
.NULL
(ex: '0000-00-00 00:00:00')
Since we cannot distinguish these cases, we're going to provide detail information for
None
value.Changes
__none_sources
variable.__read_values_name
,we check detail information for
None
cases and save it to__none_sources
.dump()
executes, we check for none_sources and show them together with column name and value.Example