nixys / nxs-data-anonymizer

A tool for anonymizing PostgreSQL and MySQL databases' dump
Apache License 2.0
233 stars 10 forks source link

Whitespace sensitive parsing #9

Closed akademic closed 1 year ago

akademic commented 1 year ago

I have two sql

INSERT INTO `my_table` (id, first_name, last_name) VALUES (1, 'John',NULL);
INSERT INTO `my_table` (id, first_name, last_name) VALUES (1, 'John', NULL);

First one produces value []byte("NULL") with type ValueTypeNULL Second one []byte(" NULL") with type ValueTypeString

borisershov commented 1 year ago

Could you please specify a mysqldump version which creates a dumps with spaces? I mean this case:

INSERT INTO `my_table` (id, first_name, last_name) VALUES (1, 'John', NULL);
akademic commented 1 year ago

It is not mysqldump I wrote this sql by hands

borisershov commented 1 year ago

This case may be solved with additional checks within the code. And it's affect to performance. So I don't think we need to fix this without real issue. I hope you are agree with me?

akademic commented 1 year ago

no problem i can live with it