The header setting from the legacy ".headers" dot-command takes precedence
over the current ".mode" setting, for backwards compatibility. [forum:/forumpost/2025-12-31T19:14:24z|Forum post 2025-12-31T19:14:24z]. FossilOrigin-Name: d2c5df41285a9c8a66e9bdea4e28d86fe10665ad01cfbab5a7ce43b8e39b4e34
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
C In\sthe\s(completely\sunused,\sas\sfar\sas\sI\sknow)\sbtreeinfo.c\sextension\s(not\na\spart\sof\sany\sstandard\sbuild)\sdo\sa\sbetter\sjob\sof\sdetecting\scorrupt\sdatabase\nfiles\sand\sprovide\sbetter\serror\smessages\swhen\scorruption\sis\sdetected.\n[forum:/forumpost/e66a458339|Forum\spost\se66a458339].
|
||||
D 2025-12-31T19:45:45.497
|
||||
C The\sheader\ssetting\sfrom\sthe\slegacy\s".headers"\sdot-command\stakes\sprecedence\nover\sthe\scurrent\s".mode"\ssetting,\sfor\sbackwards\scompatibility.\n[forum:/forumpost/2025-12-31T19:14:24z|Forum\spost\s2025-12-31T19:14:24z].
|
||||
D 2025-12-31T20:35:16.273
|
||||
F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
@@ -737,7 +737,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c
|
||||
F src/resolve.c 47aa7fdc9ec4c19b103ac5e79d7887d30119b5675309facf5eed1118391c868b
|
||||
F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97
|
||||
F src/select.c 85852256d860f3ba5be4a9edc1238e68dbea082a0167f31b7345c821ae45775d
|
||||
F src/shell.c.in 55424c650715b34abeea16d4f407079f88125ab3263304110cb5c4d6fcce4eb0
|
||||
F src/shell.c.in cd18d34d3de60dbc8e9e3d1cb16b94bfc6d335974169b823cb893940b84cb4c5
|
||||
F src/sqlite.h.in b6599377f02ef9d545a8da48959213928b63291ad83ff65e5f3a72bf4fec595d
|
||||
F src/sqlite3.rc 015537e6ac1eec6c7050e17b616c2ffe6f70fca241835a84a4f0d5937383c479
|
||||
F src/sqlite3ext.h 5d5330f5f8461f5ce74960436ddcfa53ecd09c2b8b23901e22ae38aec3243998
|
||||
@@ -1444,7 +1444,7 @@ F test/mmap4.test 2e2b4e32555b58da15176e6fe750f17c9dcf7f93
|
||||
F test/mmapcorrupt.test 470fb44fe92e99c1d23701d156f8c17865f5b027063c9119dcfdb842791f4465
|
||||
F test/mmapfault.test d4c9eff9cd8c2dc14bc43e71e042f175b0a26fe3
|
||||
F test/mmapwarm.test 2272005969cd17a910077bd5082f70bc1fefad9a875afec7fc9af483898ecaf3
|
||||
F test/modeA.sql d10f214f8c36f0cf3cae0e55145e5d139d875a85ef1fb828937817f6e37f4cd8
|
||||
F test/modeA.sql 2b2e41bdb157b3af5a71ae700f303e81f547abb150fb693a9f0501cdfb423822
|
||||
F test/multiplex.test d74c034e52805f6de8cc5432cef8c9eb774bb64ec29b83a22effc8ca4dac1f08
|
||||
F test/multiplex2.test 580ca5817c7edbe4cc68fa150609c9473393003a
|
||||
F test/multiplex3.test fac575e0b1b852025575a6a8357701d80933e98b5d2fe6d35ddaa68f92f6a1f7
|
||||
@@ -2189,8 +2189,8 @@ F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee
|
||||
F tool/warnings.sh d924598cf2f55a4ecbc2aeb055c10bd5f48114793e7ba25f9585435da29e7e98
|
||||
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
|
||||
F tool/winmain.c 00c8fb88e365c9017db14c73d3c78af62194d9644feaf60e220ab0f411f3604c
|
||||
P f293a2b3ffcfe20fcda954bd31e88bbfcba18d007e9b5f29a473983f6030f2ce
|
||||
R 6777b763283545ff149c8b38934528b7
|
||||
P 326d29ac7ecd933d6fca80d3d538783ed46939e7bc6e3aa60ded4b619aa73730
|
||||
R b567dd9c0c74c7f7e98db841f70a2525
|
||||
U drh
|
||||
Z 99d22b051960334dbc97679fe5c74860
|
||||
Z 047f31d5fa580b2b91a2d9800561212f
|
||||
# Remove this line to create a well-formed Fossil manifest.
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
326d29ac7ecd933d6fca80d3d538783ed46939e7bc6e3aa60ded4b619aa73730
|
||||
d2c5df41285a9c8a66e9bdea4e28d86fe10665ad01cfbab5a7ce43b8e39b4e34
|
||||
|
||||
+7
-2
@@ -1240,7 +1240,7 @@ typedef struct Mode {
|
||||
u8 autoEQPtrace; /* autoEQP is in trace mode */
|
||||
u8 scanstatsOn; /* True to display scan stats before each finalize */
|
||||
u8 bAutoScreenWidth; /* Using the TTY to determine screen width */
|
||||
u8 mFlags; /* MFLG_ECHO and/or MFLG_CRLF */
|
||||
u8 mFlags; /* MFLG_ECHO, MFLG_CRLF, etc. */
|
||||
u8 eMode; /* One of the MODE_ values */
|
||||
sqlite3_qrf_spec spec; /* Spec to be passed into QRF */
|
||||
} Mode;
|
||||
@@ -1248,6 +1248,7 @@ typedef struct Mode {
|
||||
/* Flags for Mode.mFlags */
|
||||
#define MFLG_ECHO 0x01 /* Echo inputs to output */
|
||||
#define MFLG_CRLF 0x02 /* Use CR/LF output line endings */
|
||||
#define MFLG_HDR 0x04 /* .header used to change headers on/off */
|
||||
|
||||
|
||||
/*
|
||||
@@ -1612,7 +1613,9 @@ static void modeChange(ShellState *p, unsigned char eMode){
|
||||
if( pI->eNull ) modeSetStr(&pM->spec.zNull, aModeStr[pI->eNull]);
|
||||
pM->spec.eText = pI->eText;
|
||||
pM->spec.eBlob = pI->eBlob;
|
||||
pM->spec.bTitles = pI->bHdr;
|
||||
if( (pM->mFlags & MFLG_HDR)==0 ){
|
||||
pM->spec.bTitles = pI->bHdr;
|
||||
}
|
||||
pM->spec.eTitle = pI->eHdr;
|
||||
if( pI->mFlg & 0x01 ){
|
||||
pM->spec.bBorder = QRF_No;
|
||||
@@ -8167,6 +8170,7 @@ static int dotCmdMode(ShellState *p){
|
||||
return 1;
|
||||
}
|
||||
p->mode.spec.bTitles = k>=1 ? QRF_Yes : QRF_No;
|
||||
p->mode.mFlags &= ~MFLG_HDR;
|
||||
p->mode.spec.eTitle = k>1 ? k-1 : aModeInfo[p->mode.eMode].eHdr;
|
||||
chng = 1;
|
||||
}else if( optionMatch(z,"widths") || optionMatch(z,"width") ){
|
||||
@@ -9640,6 +9644,7 @@ static int do_meta_command(const char *zLine, ShellState *p){
|
||||
if( c=='h' && cli_strncmp(azArg[0], "headers", n)==0 ){
|
||||
if( nArg==2 ){
|
||||
p->mode.spec.bTitles = booleanValue(azArg[1]) ? QRF_Yes : QRF_No;
|
||||
p->mode.mFlags |= MFLG_HDR;
|
||||
p->mode.spec.eTitle = aModeInfo[p->mode.eMode].eHdr;
|
||||
}else{
|
||||
eputz("Usage: .headers on|off\n");
|
||||
|
||||
@@ -228,3 +228,40 @@ SELECT a AS 'abcd', b FROM t2 WHERE c=3;
|
||||
...: The quick fox jumps over the lazy brown dog
|
||||
b: 2
|
||||
END
|
||||
|
||||
# https://sqlite.org/forum/forumpost/2025-12-31T19:14:24z
|
||||
#
|
||||
# For legacy compatibility, ".header" settings are not changed
|
||||
# by ".mode" unless the --title or --reset option is used on .mode.
|
||||
#
|
||||
.testcase 600
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1(a,b,c);
|
||||
INSERT INTO t1 VALUES(1,2,3);
|
||||
.header on
|
||||
.mode csv
|
||||
SELECT * FROM t1;
|
||||
.check --glob a,b,c*
|
||||
|
||||
.testcase 610
|
||||
.mode csv -reset
|
||||
SELECT * FROM t1;
|
||||
.check 1,2,3
|
||||
|
||||
.testcase 620
|
||||
.mode tty
|
||||
.mode csv
|
||||
.header on
|
||||
SELECT * FROM t1;
|
||||
.check --glob a,b,c*
|
||||
|
||||
.testcase 630
|
||||
.mode tty
|
||||
.mode csv --title on
|
||||
SELECT * FROM t1;
|
||||
.check --glob a,b,c*
|
||||
.testcase 631
|
||||
.mode tty
|
||||
.mode csv --title off
|
||||
SELECT * FROM t1;
|
||||
.check 1,2,3
|
||||
|
||||
Reference in New Issue
Block a user