mtgjson / mtgsqlive

MTGJSON build scripts to generate alternative data formats
https://mtgjson.com
MIT License
54 stars 32 forks source link

Duplicate Primary Key #72

Closed splatterb0y closed 1 year ago

splatterb0y commented 3 years ago

Current version of https://mtgjson.com/api/v5/AllPrintings.sql.gz delivers multiple duplicate primary key errors when being imported into MySQL 8.

ERROR 1062 (23000) at line 113265: Duplicate entry '22d06541-1812-5b49-8d64-98e79286f45c' for key 'cards.uuid'

splatterb0y commented 3 years ago

this is most likely related to: https://github.com/mtgjson/mtgjson/issues/812

cerietke commented 2 years ago

I get a similar error:

ERROR 1062 (23000) at line 761213 in file: '/tmp/AllPrintings.sql': Duplicate entry 'a4bc221d-5e3e-5566-8e0e-be9d0dabd5d3' for key 'uuid'

Looking at the file in Notepad++ I indeed seem to see some duplicate inserts:

image (I suspect the 3 comment lines at the beginning of the .sql file are not counted in the error message).

This is on "Server version: 5.5.5-10.6.0-MariaDB-1:10.6.0+maria~focal mariadb.org binary distribution" running in Docker under "Ubuntu 20.04.3 LTS".

I've now worked around this by replacing all the INSERT INTO's with INSERT IGNORE INTO's.

ZeldaZach commented 1 year ago

This should be addressed