You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Export of database table does not honour quote setting #845
Testing the export of a database table issue on Windows, and noticed I can't get quotes around field contents with spaces in. Have tried both quote options, and the 'Other'. Nothing.
Tried 3.9.1 and the latest nightly. In my experiments with options, it did do quotes once, even putting quotes round fields that didn't need it. I couldn't reproduce that though, so unsure if something is screwy somewhere.
Edit: Just filling in the info below, and noted I'm using the 64bit version. Unsure if it'll make a difference, but will try on the 32bit version too.
32bit was the same, and on a different computer, so its not just me... ;)
Haven't tried older versions to pick out where it went wrong. I'm sure it used to work...
Looked (briefly) through the code, but without debug info, its hard to find out whats going on .... it should work. Guess I'll add some...
, that is, it quotes the contents of a field only if there are characters to be escaped. For example, if you have the following data:
you can export like this:
id,flaga,"E""E"b,D Dc,C Cd,B Be,A A
So maybe we should introduce something like chars_to_quote alongside with special_chars?
Aah, might just be me then. I was under the mis-conception that fields with spaces in would need quoting (not just escaping quote characters). Thats why 'A' would not need quoting, but 'A A' would. I must just be having a brain fart then. I'll close this then, and revisit it if its an issue. 😄
Activity
justinclift commentedon Oct 25, 2016
Oh, interesting. Something doesn't seem correct there.
It'd be really useful for us to add some kind of automatic testing for this to catch regressions. Not sure how to achieve it though.
chrisjlocke commentedon Oct 26, 2016
32bit was the same, and on a different computer, so its not just me... ;)
Haven't tried older versions to pick out where it went wrong. I'm sure it used to work...
Looked (briefly) through the code, but without debug info, its hard to find out whats going on .... it should work. Guess I'll add some...
prutz1311 commentedon Nov 2, 2016
It seems like it has to do with these lines
sqlitebrowser/src/ExportDataDialog.cpp
Line 92 in 60e4cb7
sqlitebrowser/src/ExportDataDialog.cpp
Lines 113 to 116 in 60e4cb7
you can export like this:
So maybe we should introduce something like
chars_to_quotealongside withspecial_chars?justinclift commentedon Nov 3, 2016
Interesting thought. 😄
Thinking about this more, it sounds like Chris wants an option to "quote all fields", even if the quotes are not strictly needed.
Hmmm... trying to think of a use for that though... not sure what it would be useful for? 😄
chrisjlocke commentedon Nov 3, 2016
Aah, might just be me then. I was under the mis-conception that fields with spaces in would need quoting (not just escaping quote characters). Thats why 'A' would not need quoting, but 'A A' would. I must just be having a brain fart then. I'll close this then, and revisit it if its an issue. 😄
justinclift commentedon Nov 3, 2016
Cool. 😄