-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for configurable NULL encoding #14
Comments
Sorry, but you did not mention one critical issue that causes the behavior you see, as in the default setup, it works exactly as documented:
But I am sure you have setup your instance with
I'll see if there can be a more explicit attribute to achieve this, as callbacks are not an option to make this combination work. |
Try a pull/clone from here. I added the
See https://github.com/Tux/Text-CSV_XS/blob/master/doc/CSV_XS.md#undef_str |
Wow, that's great! Thankyou so much for the fast response and patch. |
Feedback would be more than welcome BTW. |
@dankasak would you be so kind to pull/clone again? I changed a lot of code to make it work on 5.18.x and below. If my tests do not cover all issues, your code might. |
I've pulled and re-tested, using a couple of options for supporting different databases. Looks good to me :) |
Thanks for the feedback. I'll start the big test-to-release process |
Current NULL encoding options are limited. It works for some cases - where upstream can handle what we produce. Other cases - eg MySQL 'load data infile' - is unable to correctly identify
NULL
s using our encoding method ( eg ,, ). The docs here:http://search.cpan.org/~hmbrand/Text-CSV_XS-1.35/CSV_XS.pm#csv
... suggest you can produce output that databases can parse by doing:
... but this is absolutely not the case. Given the data:
... the required output for importing into MySQL or other DBs would be:
... but the above hack instead gives us:
There are 2 problems with this:
\N
, giving us\\N
. DBs won't parse this correctly.\\N
. DBs won't parse this correctly either.What we really need is a way to pass in any string sequence that can be used to encode a
NULL
value. Additionally, this string sequence should not be quoted.The text was updated successfully, but these errors were encountered: