diff --git a/db_converter.py b/db_converter.py index 439957b..a099f78 100644 --- a/db_converter.py +++ b/db_converter.py @@ -83,7 +83,7 @@ def parse(input_filename, output_filename): creation_lines = [] # Inserting data into a table? elif line.startswith("INSERT INTO"): - output.write(line.encode("utf8").replace("'0000-00-00 00:00:00'", "NULL") + "\n") + output.write(re.sub(r"([^'])'0000-00-00 00:00:00'", r"\1NULL", line.encode("utf8")) + "\n") num_inserts += 1 # ??? else: