From c79b1f7d6ce0f7eba42671c42489af6594964a42 Mon Sep 17 00:00:00 2001 From: drh <> Date: Fri, 30 Jan 2026 16:03:22 +0000 Subject: [PATCH] Fix the new CLI so that the ".eqp" setting does not affect the output of other dot commands such as .schema or .tables. FossilOrigin-Name: a5a1b69b3feedb507ecfe2e9ddc039d7c01e1bb54e3e881df5010481886cdef9 --- manifest | 15 ++++++------ manifest.uuid | 2 +- src/shell.c.in | 3 ++- test/dotcmd01.sql | 62 +++++++++++++++++++++++++++++++++++++++++++++++ test/shellB.test | 1 + 5 files changed, 74 insertions(+), 9 deletions(-) create mode 100644 test/dotcmd01.sql diff --git a/manifest b/manifest index 4ffa2758fd..ea4319c897 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Change\sthe\snew\sescape-character\smechanism\sfor\sCSV\simport\sso\sthat\sthere\sare\nseparate\soptions\sfor\san\sescape\scharacter\sfor\squoted\sand\sunquoted\sfields\sof\nthe\sCSV. -D 2026-01-30T13:11:20.460 +C Fix\sthe\snew\sCLI\sso\sthat\sthe\s".eqp"\ssetting\sdoes\snot\saffect\sthe\soutput\sof\sother\sdot\ncommands\ssuch\sas\s.schema\sor\s.tables. +D 2026-01-30T16:03:22.503 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -739,7 +739,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c F src/resolve.c 47aa7fdc9ec4c19b103ac5e79d7887d30119b5675309facf5eed1118391c868b F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97 F src/select.c 4bee1bb231771e7c6e5aef243b1f74c3d330df5a005909d5e2c338fb1510fe55 -F src/shell.c.in 461c163897e1d001e957c69cad624ddac367e24e6da0b2de54592ea4e18fe98a +F src/shell.c.in c5c6cbbc518472ebd9662c9876133517f5e85f995e9725fafaeda88fc55b6ac0 F src/sqlite.h.in 8bcbaecfe2cbecf8c5c1381354fcdd7d307443e88b4953fccb222456c1267b61 F src/sqlite3.rc 015537e6ac1eec6c7050e17b616c2ffe6f70fca241835a84a4f0d5937383c479 F src/sqlite3ext.h 1b7a0ee438bb5c2896d0609c537e917d8057b3340f6ad004d2de44f03e3d3cca @@ -1060,6 +1060,7 @@ F test/diskfull.test 106391384780753ea6896b7b4f005d10e9866b6e F test/distinct.test 691c9e850b0d0b56b66e7e235453198cb4cf0760e324b7403d3c5abbeab0a014 F test/distinct2.test a6af6a90b2c1eea64c3cc87ea7f8feb832053f7276fe3c212abacf646de4762a F test/distinctagg.test 40d7169ae5846caaf62c6e307d2ca3c333daf9b6f7cde888956a339a97afe85f +F test/dotcmd01.sql 3aca4a41ee5d2ccc3386e429148e04f4d57328f573cec863b66892da0595cab4 F test/e_blobbytes.test 4c01dfe4f12087b92b20705a3fdfded45dc4ed16d5a211fed4e1d2786ba68a52 F test/e_blobclose.test 692fc02a058476c2222a63d97e3f3b2b809c1842e5525ded7f854d540ac2e075 F test/e_blobopen.test 29f6055ee453b8e679fe9570c4d3acfedbef821622c5dad16875148c5952ef50 @@ -1627,7 +1628,7 @@ F test/shell7.test 43fd8e511c533bab5232e95c7b4be93b243451709e89582600d4b6e67693d F test/shell8.test 641cf21a99c59404c24e3062923734951c4099a6b6b6520de00cf7a1249ee871 F test/shell9.test 8742a5b390cdcef6369f5aa223e415aa4255a4129ef249b177887dc635a87209 F test/shellA.test 05cdaafa1f79913654487ce3aefa038d4106245d58f52e02faf506140a76d480 -F test/shellB.test 37464875e251c22c4a94c39cd3f86f2a35471a6e6f8296ae39ec5643b311648c +F test/shellB.test b2afd5c28aba750c066996a082210d6a4fcab8fd042cad076d9c1023164af9b1 F test/shmlock.test 9f1f729a7fe2c46c88b156af819ac9b72c0714ac6f7246638a73c5752b5fd13c F test/shortread1.test bb591ef20f0fd9ed26d0d12e80eee6d7ac8897a3 F test/show_speedtest1_rtree.tcl 32e6c5f073d7426148a6936a0408f4b5b169aba5 @@ -2193,8 +2194,8 @@ F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee F tool/warnings.sh d924598cf2f55a4ecbc2aeb055c10bd5f48114793e7ba25f9585435da29e7e98 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f F tool/winmain.c 00c8fb88e365c9017db14c73d3c78af62194d9644feaf60e220ab0f411f3604c -P f11a05d52a1eb933f394d48c0d4ee0353f07ad725b7378c40afd01632e67f72d -R a8ba995b68957165836a359cdc9bda8c +P 293ec20e29e46d822a98302f8a0ba52ad6f74a7e93f780536d393730c2edbf61 +R 6219427f72f1032a75f0a00a557f2be0 U drh -Z ebb3f29c37b6be76dd377e9cc977e6a7 +Z 9a3047fdcb8c1ee9e50be3311ebce2d4 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 9910be4c8d..6b3edb18fb 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -293ec20e29e46d822a98302f8a0ba52ad6f74a7e93f780536d393730c2edbf61 +a5a1b69b3feedb507ecfe2e9ddc039d7c01e1bb54e3e881df5010481886cdef9 diff --git a/src/shell.c.in b/src/shell.c.in index d9b32e4859..b6acc86d29 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -3251,7 +3251,7 @@ static int shell_exec( /* Show the EXPLAIN QUERY PLAN if .eqp is on */ isExplain = sqlite3_stmt_isexplain(pStmt); - if( pArg && pArg->mode.autoEQP && isExplain==0 ){ + if( pArg && pArg->mode.autoEQP && isExplain==0 && pArg->dot.nArg==0 ){ int triggerEQP = 0; disable_debug_trace_modes(); sqlite3_db_config(db, SQLITE_DBCONFIG_TRIGGER_EQP, -1, &triggerEQP); @@ -11907,6 +11907,7 @@ meta_command_exit: if( p->nPopOutput==0 ) output_reset(p); } p->bSafeMode = p->bSafeModePersist; + p->dot.nArg = 0; return rc; } diff --git a/test/dotcmd01.sql b/test/dotcmd01.sql new file mode 100644 index 0000000000..216787aa2b --- /dev/null +++ b/test/dotcmd01.sql @@ -0,0 +1,62 @@ +#!sqlite3 +# +# 2026-01-30 +# +# The author disclaims copyright to this source code. In place of +# a legal notice, here is a blessing: +# +# May you do good and not evil. +# May you find forgiveness for yourself and forgive others. +# May you share freely, never taking more than you give. +# +#*********************************************************************** +# +# Miscellaneous tests for dot-commands +# +# ./sqlite3 test/dotcmd01.sql +# + +.testcase setup +.open :memory: +.mode tty +.check '' + +# The ".eqp on" setting does not affect the output from .fullschema +# and similar. +# +.testcase 100 +CREATE TABLE t1(a,b,c); +WITH RECURSIVE c(n) AS (VALUES(1) UNION ALL SELECT n+1 FROM c WHERE n<300) + INSERT INTO t1(a,b,c) + SELECT n%10, n%30, n%100 FROM c; +CREATE INDEX t1a ON t1(a); +CREATE INDEX t1b ON t1(b); +ANALYZE; +.eqp on +.fullschema +.check <