Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Fix an off-by-one error that causes a quoted empty string at the end of a CRNL-terminated line of CSV input to be misread by the shell. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
b5617e4fdadc4cded93c985008e90982 |
User & Date: | drh 2013-08-28 13:33:40 |
References
2013-08-29
| ||
13:23 | Fix an off-by-one error that causes a quoted empty string at the end of a CRNL-terminated line of CSV input to be misread by the shell. Cherrypick of [b5617e4fdadc4c]. (check-in: 43aa7d23 user: drh tags: branch-3.8.0) | |
Context
2013-08-29
| ||
13:23 | Fix an off-by-one error that causes a quoted empty string at the end of a CRNL-terminated line of CSV input to be misread by the shell. Cherrypick of [b5617e4fdadc4c]. (check-in: 43aa7d23 user: drh tags: branch-3.8.0) | |
2013-08-28
| ||
13:46 | Increase the version number to 3.8.1 due to the addition of STAT4 support. (check-in: 41c089e2 user: drh tags: trunk) | |
13:33 | Fix an off-by-one error that causes a quoted empty string at the end of a CRNL-terminated line of CSV input to be misread by the shell. (check-in: b5617e4f user: drh tags: trunk) | |
11:57 | Add a test case for empty quoted field in CSV import in the shell. (check-in: 3df56e84 user: drh tags: trunk) | |
Changes
Changes to src/shell.c.
︙ | ︙ | |||
1713 1714 1715 1716 1717 1718 1719 | if( pc==cQuote ){ pc = 0; continue; } } if( (c==cSep && pc==cQuote) || (c=='\n' && pc==cQuote) | | | 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 | if( pc==cQuote ){ pc = 0; continue; } } if( (c==cSep && pc==cQuote) || (c=='\n' && pc==cQuote) || (c=='\n' && pc=='\r' && p->n>=2 && p->z[p->n-2]==cQuote) || (c==EOF && pc==cQuote) ){ do{ p->n--; }while( p->z[p->n]!=cQuote ); p->cTerm = c; break; } if( pc==cQuote && c!='\r' ){ |
︙ | ︙ |
Changes to test/shell5.test.
︙ | ︙ | |||
245 246 247 248 249 250 251 | # Import columns containing quoted strings do_test shell5-1.9 { set out [open shell5.csv w] puts $out {1,"",11} puts $out {2,"x",22} puts $out {3,"""",33} puts $out {4,"hello",44} | | | 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 | # Import columns containing quoted strings do_test shell5-1.9 { set out [open shell5.csv w] puts $out {1,"",11} puts $out {2,"x",22} puts $out {3,"""",33} puts $out {4,"hello",44} puts $out "5,55,\"\"\r" puts $out {6,66,"x"} puts $out {7,77,""""} puts $out {8,88,"hello"} puts $out {"",9,99} puts $out {"x",10,110} puts $out {"""",11,121} puts $out {"hello",12,132} |
︙ | ︙ |