Closed ponponon closed 1 week ago
After my investigation, I know the reason, because the video id needs int64, but the table I created is int32, there is an overflow, which leads to inexplicable problems
Yes this is just an overflow. The client library (pymysql or whatever you're using) is converting your 64-bit int into a 32-bit one and hence the problem.
About peewee.IntegrityError error when using peewee get_or_create
Here's the full code log
Here is peewee's model
The ddl in the database.
Part of the code implemented
Apparently the problem is in the
FoundedVideoCoverImageOcrCountTable.get_or_create(video_id=video_id)
stageWhat confuses me is the secondary read, why does
WHERE (
t1.video_id= %s) LIMIT %s OFFSET %s Params: [2397088498, 1, 0]
appear? This is the same aspeewee.IntegrityError: (1062, “Duplicate entry ‘2147483647’ for key 'found_video_cover_image_ocr_count.
foundedvideocoverimageocrcounttable_video_id'")
of 2147483647 does not match. I don't know why the value 2397088498 appears?When I try to minimally reproduce this reported error, the lack of reproduction doesn't work
Because the execution doesn't report an error