CLI .import to accept EOF in lieu of record terminator on last field of CSV (with multiple field records), per RFC 4180. [forum:5b21c25bdfa|forum post 5b21c25bdfa]
FossilOrigin-Name: 6f7842f577a28df1f809cd4bae9e8eafa26f2b54a25a1362ebbdebf5026be57c
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
C Fix\sa\suse-after-free\serror\sin\sfts5\sthat\scould\soccur\swhen\squerying\sthe\s"rank"\scolumn\simmediately\safter\sanother\sconnection\schanges\sits\sdefinition.\s[forum:a2dd636330|forum\spost\sa2dd636330].
|
||||
D 2023-09-12T18:36:46.401
|
||||
C CLI\s.import\sto\saccept\sEOF\sin\slieu\sof\srecord\sterminator\son\slast\sfield\sof\sCSV\s(with\smultiple\sfield\srecords),\sper\sRFC\s4180.\s[forum:5b21c25bdfa|forum\spost\s5b21c25bdfa]
|
||||
D 2023-09-12T23:21:39.042
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
||||
@@ -709,7 +709,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c
|
||||
F src/resolve.c 37953a5f36c60bea413c3c04efcd433b6177009f508ef2ace0494728912fe2e9
|
||||
F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97
|
||||
F src/select.c e9fb48546ab1882639a3a960383f6342dddb776c0227615f8e19de51f0102f68
|
||||
F src/shell.c.in 6c177bf142b0a2bf6a176b3f2a2d96e251ab235cb5ec02185a39a9d5c62884f8
|
||||
F src/shell.c.in 62708bea44d4e43aa7b1270ed422d1d29e82297924d4e0f223c39336a3f582f8
|
||||
F src/sqlite.h.in 931a58d119d5cf87110648f39fa0bb9f1738b0068cb68250d893304a471bd6c0
|
||||
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
|
||||
F src/sqlite3ext.h 2f30b2671f4c03cd27a43f039e11251391066c97d11385f5f963bb40b03038ac
|
||||
@@ -2119,8 +2119,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
|
||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||
P 4ae7199a82f0b6e0f5575e39d8bd454e527ab949f0c59b773a44a078c65c5676
|
||||
R 8707d73b389f3757fd9cb0bb401c6a3b
|
||||
U dan
|
||||
Z 0aa1a0cbd236f6658a05cc1196d81dde
|
||||
P cb54c2da52d3175844127ead41cfed18793e91ea52e02af2d57c1d17b4312437
|
||||
R 86a79ec16a16370ae7ab57df84d9fabf
|
||||
U larrybr
|
||||
Z 5cce62a4c79e08e73bd815b21ee95070
|
||||
# Remove this line to create a well-formed Fossil manifest.
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
cb54c2da52d3175844127ead41cfed18793e91ea52e02af2d57c1d17b4312437
|
||||
6f7842f577a28df1f809cd4bae9e8eafa26f2b54a25a1362ebbdebf5026be57c
|
||||
@@ -9063,6 +9063,14 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
** the remaining columns.
|
||||
*/
|
||||
if( p->mode==MODE_Ascii && (z==0 || z[0]==0) && i==0 ) break;
|
||||
/*
|
||||
** For CSV mode, per RFC 4180, accept EOF in lieu of final
|
||||
** record terminator but only for last field of multi-field row.
|
||||
** (If there are too few fields, it's not valid CSV anyway.)
|
||||
*/
|
||||
if( z==0 && (xRead==csv_read_one_field) && i==nCol-1 && i>0 ){
|
||||
z = "";
|
||||
}
|
||||
sqlite3_bind_text(pStmt, i+1, z, -1, SQLITE_TRANSIENT);
|
||||
if( i<nCol-1 && sCtx.cTerm!=sCtx.cColSep ){
|
||||
utf8_printf(stderr, "%s:%d: expected %d columns but found %d - "
|
||||
|
||||
Reference in New Issue
Block a user