We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b674611 + 64dd660 commit 81e90baCopy full SHA for 81e90ba
pymysqlreplication/row_event.py
@@ -203,10 +203,17 @@ def __read_date(self):
203
if time == 0: # nasty mysql 0000-00-00 dates
204
return None
205
206
+ year = (time & ((1 << 15) - 1) << 9) >> 9
207
+ if year == 0:
208
+ return None
209
+
210
+ month = (time & ((1 << 4) - 1) << 5) >> 5
211
+ day = (time & ((1 << 5) - 1))
212
213
date = datetime.date(
- year=(time & ((1 << 15) - 1) << 9) >> 9,
- month=(time & ((1 << 4) - 1) << 5) >> 5,
- day=(time & ((1 << 5) - 1))
214
+ year=year,
215
+ month=month,
216
+ day=day
217
)
218
return date
219
0 commit comments