Fossil SCM

Add the ".eqp" dot-command to the ".help" output in the command-line shell. Fix CSV import issue, reported via the mailing list, in the shell when the file to be imported ends with an empty line.

jan.nijtmans 2014-06-17 11:51 trunk
Commit 3467da7901347838741eb1fec95c3826cc2d24cc
1 file changed +2 -1
+2 -1
--- src/shell.c
+++ src/shell.c
@@ -1577,10 +1577,11 @@
15771577
".databases List names and files of attached databases\n"
15781578
".dump ?TABLE? ... Dump the database in an SQL text format\n"
15791579
" If TABLE specified, only dump tables matching\n"
15801580
" LIKE pattern TABLE.\n"
15811581
".echo on|off Turn command echo on or off\n"
1582
+ ".eqp on|off Enable or disable automatic EXPLAIN QUERY PLAN\n"
15821583
".exit Exit this program\n"
15831584
".explain ?on|off? Turn output mode suitable for EXPLAIN on or off.\n"
15841585
" With no args, it turns EXPLAIN on.\n"
15851586
".headers on|off Turn display of headers on or off\n"
15861587
".help Show this message\n"
@@ -2551,11 +2552,11 @@
25512552
if( i<nCol-1 && sCsv.cTerm!=sCsv.cSeparator ){
25522553
fprintf(stderr, "%s:%d: expected %d columns but found %d - "
25532554
"filling the rest with NULL\n",
25542555
sCsv.zFile, startLine, nCol, i+1);
25552556
i++;
2556
- while( i<nCol ){ sqlite3_bind_null(pStmt, i); i++; }
2557
+ while( i<=nCol ){ sqlite3_bind_null(pStmt, i); i++; }
25572558
}
25582559
}
25592560
if( sCsv.cTerm==sCsv.cSeparator ){
25602561
do{
25612562
csv_read_one_field(&sCsv);
25622563
--- src/shell.c
+++ src/shell.c
@@ -1577,10 +1577,11 @@
1577 ".databases List names and files of attached databases\n"
1578 ".dump ?TABLE? ... Dump the database in an SQL text format\n"
1579 " If TABLE specified, only dump tables matching\n"
1580 " LIKE pattern TABLE.\n"
1581 ".echo on|off Turn command echo on or off\n"
 
1582 ".exit Exit this program\n"
1583 ".explain ?on|off? Turn output mode suitable for EXPLAIN on or off.\n"
1584 " With no args, it turns EXPLAIN on.\n"
1585 ".headers on|off Turn display of headers on or off\n"
1586 ".help Show this message\n"
@@ -2551,11 +2552,11 @@
2551 if( i<nCol-1 && sCsv.cTerm!=sCsv.cSeparator ){
2552 fprintf(stderr, "%s:%d: expected %d columns but found %d - "
2553 "filling the rest with NULL\n",
2554 sCsv.zFile, startLine, nCol, i+1);
2555 i++;
2556 while( i<nCol ){ sqlite3_bind_null(pStmt, i); i++; }
2557 }
2558 }
2559 if( sCsv.cTerm==sCsv.cSeparator ){
2560 do{
2561 csv_read_one_field(&sCsv);
2562
--- src/shell.c
+++ src/shell.c
@@ -1577,10 +1577,11 @@
1577 ".databases List names and files of attached databases\n"
1578 ".dump ?TABLE? ... Dump the database in an SQL text format\n"
1579 " If TABLE specified, only dump tables matching\n"
1580 " LIKE pattern TABLE.\n"
1581 ".echo on|off Turn command echo on or off\n"
1582 ".eqp on|off Enable or disable automatic EXPLAIN QUERY PLAN\n"
1583 ".exit Exit this program\n"
1584 ".explain ?on|off? Turn output mode suitable for EXPLAIN on or off.\n"
1585 " With no args, it turns EXPLAIN on.\n"
1586 ".headers on|off Turn display of headers on or off\n"
1587 ".help Show this message\n"
@@ -2551,11 +2552,11 @@
2552 if( i<nCol-1 && sCsv.cTerm!=sCsv.cSeparator ){
2553 fprintf(stderr, "%s:%d: expected %d columns but found %d - "
2554 "filling the rest with NULL\n",
2555 sCsv.zFile, startLine, nCol, i+1);
2556 i++;
2557 while( i<=nCol ){ sqlite3_bind_null(pStmt, i); i++; }
2558 }
2559 }
2560 if( sCsv.cTerm==sCsv.cSeparator ){
2561 do{
2562 csv_read_one_field(&sCsv);
2563

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button