From: drh Date: Mon, 15 Jun 2020 20:05:37 +0000 (+0000) Subject: Fix the CLI so that interrupts work in columnar output mode. X-Git-Tag: version-3.33.0~121 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=999429882edbf4fb04add7bb5338764271aead89;p=thirdparty%2Fsqlite.git Fix the CLI so that interrupts work in columnar output mode. FossilOrigin-Name: 9472f1fe58222b738ad10fc93ceb365dc33b65c2bbca571f52bcd5bdb74b347e --- diff --git a/manifest b/manifest index 188f6f98bd..268c0001e3 100644 --- a/manifest +++ b/manifest @@ -1,6 +1,6 @@ B fd5abb1a7b5a55127d5c0d5ff448020d8bccab44e4f5afe1eb88fc19578af735 -C Fix\sthe\s--enable-update-limit\soption\sto\s./configure. -D 2020-06-15T14:38:57.043 +C Fix\sthe\sCLI\sso\sthat\sinterrupts\swork\sin\scolumnar\soutput\smode. +D 2020-06-15T20:05:37.857 F configure f594931bd7b23dad12db96b81e1dba43b41b30a4560d6eb008014e3d9f1617e8 x F configure.ac 13e4ecf89214c3aa0ba099a9e0178f13f03261ace627126737d8cee240ec5c1c F ext/fts3/fts3.c acc51e4378dd772251b31ead0ccd19070fc1774f6f6a55b11e00cb885e0f34bc @@ -8,6 +8,7 @@ F src/btree.c fabc215bd1ebab0e48108e95e0f50531da9883156b95888f479f6c696db032ad F src/expr.c 36bb737d2ca78ee9bd4fde46cf1e51a37e7e1b263e55fccfaef32922a19e9524 F src/global.c 0409ae635839e0bef26a69b68be64126ab6cba62ac19bd7694f1652e591c4c17 F src/select.c 6ddd86a7272ff1f443bd9efcbb0f5ab590674d4c732e4cb8c3d5dd8e3a70cae6 +F src/shell.c.in 0e439519aae3c08cac2c0da84bc5899bbea4d5f273d3e970febb9bf7516d680b F src/sqliteInt.h abf448e9f839964086d5508ba795e948dbf36d773b6568cf4c830f6c7ad2110e F src/test1.c e9f68f157f8fd027ee4c32c4b427f4eed274749bfb745427e2d954fa89d95ad3 F src/vdbe.c 2f5cdcd66be9bc1d1c6ca23b4a4ae003a5a36cf9830d9fa160efce66d9161c9d @@ -20,7 +21,7 @@ F test/select3.test c49fbb758903f3718e2de5aa4655eda4838131cbea24a86db908f8b6889a F test/selectA.test 68de52409e45a3313d00b8461b48bef4fb729faf36ade9067a994eae55cc86f4 F test/whereG.test 9363b2a97d914cb1b81aff5069ef0cf2a071a67e2b604eac6fe9c0114017d9aa F test/window1.test 9d7f4990e5b36d95af93b189da4aa75216c6690ce95cced3c8b6d3234be51c2c -P 10fa79d00f8091e5748c245f4cae5b5f499a5f8db20da741c130e05a21ede443 -R 53b85d8633b314f290bd62efdc804e58 +P d31fd57ea538668238787fde10a6a57bbd8a428c73f2e54b2e95ee9a645bc75b +R 9bf0d64a5e369f6303626cfabb9127fe U drh -Z 8f731d1ee1a28a5f07dfda9349a595b2 +Z b4b377f6d8e70e8e674e66c244cb5822 diff --git a/manifest.uuid b/manifest.uuid index ec8859317b..98f74649fe 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -d31fd57ea538668238787fde10a6a57bbd8a428c73f2e54b2e95ee9a645bc75b \ No newline at end of file +9472f1fe58222b738ad10fc93ceb365dc33b65c2bbca571f52bcd5bdb74b347e \ No newline at end of file diff --git a/src/shell.c.in b/src/shell.c.in index d1b1203ebe..057c95ad48 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -3052,10 +3052,7 @@ static void exec_prepared_stmt_columnar( sqlite3_free_table(azData); return; } - if( nRow==0 || nColumn==0 ){ - sqlite3_free_table(azData); - return; - } + if( nRow==0 || nColumn==0 ) goto columnar_end; if( nColumn>p->nWidth ){ p->colWidth = realloc(p->colWidth, nColumn*2*sizeof(int)); if( p->colWidth==0 ) shell_out_of_memory(); @@ -3077,6 +3074,7 @@ static void exec_prepared_stmt_columnar( j = i%nColumn; if( n>p->actualWidth[j] ) p->actualWidth[j] = n; } + if( seenInterrupt ) goto columnar_end; switch( p->cMode ){ case MODE_Column: { colSep = " "; @@ -3139,6 +3137,7 @@ static void exec_prepared_stmt_columnar( } } for(i=nColumn, j=0; icMode!=MODE_Column ){ utf8_printf(p->out, "%s", p->cMode==MODE_Box?BOX_13" ":"| "); } @@ -3159,6 +3158,7 @@ static void exec_prepared_stmt_columnar( }else if( p->cMode==MODE_Box ){ print_box_row_separator(p, nColumn, BOX_12, BOX_124, BOX_14); } +columnar_end: sqlite3_free_table(azData); }