Skip to content

datetime '0000-00-00' return string '0000-00-00' #225

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

Open
seanlook opened this issue Aug 29, 2017 · 0 comments
Open

datetime '0000-00-00' return string '0000-00-00' #225

seanlook opened this issue Aug 29, 2017 · 0 comments

Comments

@seanlook
Copy link

'0000-00-00 00:00:00' is a invalid datetime but it can be inserted in datetime column type. If I have f_time datetime NOT NULL defined, the parsed value in row event is set to None: row_event.py: __read_datetime2()

Then I use all column values to insert/update, that None value would lead to no data matched, or insert a null value to NOT NULL columns(error occurs).

We all know datetime '0000-00-00' is nasty but when it already exists, we shall keep the data consistent. It's nice if a parameter like date_tostr is given to BinlogStreamReader to decide the behavior.

I've implemented this, I will make a pull request later.

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

No branches or pull requests

1 participant