]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
New test cases to cover the "--quote relaxed" feature.
authordrh <>
Sat, 6 Dec 2025 11:35:30 +0000 (11:35 +0000)
committerdrh <>
Sat, 6 Dec 2025 11:35:30 +0000 (11:35 +0000)
FossilOrigin-Name: d00d9556edc198d49cf9aa2f14e46bb5b1021ef0622aee1fa4ae585ed9a13a98

manifest
manifest.uuid
src/shell.c.in
test/modeA.clitest
test/qrf01.test

index bc3c56c20f3d48dd86680bbc6cc7d169104500ed..7f91e766f148ff2e864efdc43d57903aba0f9974 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Update\stest\scases\sto\swork\swith\sthe\snew\sbox\sformat\sand\swith\s--quote\srelaxed.
-D 2025-12-06T11:02:14.503
+C New\stest\scases\sto\scover\sthe\s"--quote\srelaxed"\sfeature.
+D 2025-12-06T11:35:30.934
 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 8d53771eb51a4ab5f970150c3a70969d8db79cd04a8774c2d296bbcf471a0dd0
 F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97
 F src/select.c 344518c1bba9c4636bf651b7642304abd2e7075ba35feb4bae42a51e5efe991f
-F src/shell.c.in c5646a3c7aa844bd4981c3028a2e412fd9d513f848aa884fbf5cda7e0f3fb531
+F src/shell.c.in 8d843d54a725728800948caf367d985cfb85454db4cbcf7f2814601f1636ccb7
 F src/sqlite.h.in 706cacea5308b0244fb6cec92e08310fb427a125375c64137cc1f878ae4cf5c0
 F src/sqlite3.rc 015537e6ac1eec6c7050e17b616c2ffe6f70fca241835a84a4f0d5937383c479
 F src/sqlite3ext.h 5d5330f5f8461f5ce74960436ddcfa53ecd09c2b8b23901e22ae38aec3243998
@@ -1441,7 +1441,7 @@ F test/mmap4.test 2e2b4e32555b58da15176e6fe750f17c9dcf7f93
 F test/mmapcorrupt.test 470fb44fe92e99c1d23701d156f8c17865f5b027063c9119dcfdb842791f4465
 F test/mmapfault.test d4c9eff9cd8c2dc14bc43e71e042f175b0a26fe3
 F test/mmapwarm.test 2272005969cd17a910077bd5082f70bc1fefad9a875afec7fc9af483898ecaf3
-F test/modeA.clitest dc575548084eaa9b0214c4a8d544a3755e3befb08c657fd866047f16c85ffa37
+F test/modeA.clitest 96939c5fac8595213d84de82f3e09e4d126bafed19ec30167953627f4afa1723
 F test/multiplex.test d74c034e52805f6de8cc5432cef8c9eb774bb64ec29b83a22effc8ca4dac1f08
 F test/multiplex2.test 580ca5817c7edbe4cc68fa150609c9473393003a
 F test/multiplex3.test fac575e0b1b852025575a6a8357701d80933e98b5d2fe6d35ddaa68f92f6a1f7
@@ -1511,7 +1511,7 @@ F test/printf2.test 3f55c1871a5a65507416076f6eb97e738d5210aeda7595a74ee895f2224c
 F test/progress.test ebab27f670bd0d4eb9d20d49cef96e68141d92fb
 F test/ptrchng.test ef1aa72d6cf35a2bbd0869a649b744e9d84977fc
 F test/pushdown.test 46a626ef1c0ca79b85296ff2e078b9da20a50e9b804b38f441590c3987580ddd
-F test/qrf01.test 5e4128aa6b20f07b2c96b5969736912f76f5d08263244a803d4d2103f6105a4b
+F test/qrf01.test 7ad8bb08eaaf9dee2a76a807741dfe4d6752614baa3c03afc734580bccc59afa
 F test/qrf02.test 39b4afdc000bedccdafc0aecf17638df67a67aaa2d2942865ae6abcc48ba0e92
 F test/qrf03.test e7efe46d204671726b4707585126cd78d107368de4a7d0c7b8d5157cdd8624ed
 F test/qrf04.test 0894692c998d2401dcc33449c02051b503ecce0c94217be54fb007c82d2d1379
@@ -2184,8 +2184,8 @@ F tool/version-info.c 33d0390ef484b3b1cb685d59362be891ea162123cea181cb8e6d2cf6dd
 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
 F tool/warnings.sh d924598cf2f55a4ecbc2aeb055c10bd5f48114793e7ba25f9585435da29e7e98
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P d2049bffe6674b8840663b0e5f404a040b715640c87f022517cf11546548fda3
-R e97d553da9f54d493dfdd1ccf5eb3ae4
+P e3f442d08f455e0aa260cc8db4922a5f611e17afe71b0bb251328ab4b3ad46ca
+R e60459669c3f8c574529928b09b1a54a
 U drh
-Z 84fa93b37bf781cb02b209931a6e3fae
+Z 10e2a2cc1e2b9542db47a3f99f2383b9
 # Remove this line to create a well-formed Fossil manifest.
index e7bff36cb5fd5f971a7ce99286cc4f157e40170c..91deeb979c3b3393cd7c8989c02fa7f474258b06 100644 (file)
@@ -1 +1 @@
-e3f442d08f455e0aa260cc8db4922a5f611e17afe71b0bb251328ab4b3ad46ca
+d00d9556edc198d49cf9aa2f14e46bb5b1021ef0622aee1fa4ae585ed9a13a98
index 26d073db8388274e5a0a741f101fef53a0e32c51..4e4dc880c21d26d284d10e7780e5c48617ce5359 100644 (file)
@@ -7708,8 +7708,8 @@ static int modeTitleDsply(ShellState *p, int bAll){
 **   --once                   Setting changes to the right are reverted after
 **                            the next SQL command.
 **   --quote ARG              Enable/disable quoting of text. ARG can be
-**                            "off", "on", "sql", "csv", "html", "tcl",
-**                            or "json".  "off" means show the text as-is.
+**                            "off", "on", "sql", "relaxed", "csv", "html",
+**                            "tcl", or "json". "off" means show the text as-is.
 **                            "on" is an alias for "sql".
 **   --reset                  Changes all mode settings back to their default.
 **   --rowsep STRING          Use STRING as the row separator
index 830bf793383e8afcb3898e07e03b2baf5ca335c1..ec5fab6774cd36618b658de6239fb8c307920542 100644 (file)
@@ -48,6 +48,45 @@ SELECT * FROM t1;
 ╰─────┴───────┴───────┴───────┴───────╯
 END
 
+# Default output mode is qbox --quote relaxed
+#
+.mode tty --wrap 10
+CREATE TABLE t2(a,b,c,d);
+INSERT INTO t2 VALUES(1,2.5,'three',x'4444');
+INSERT INTO t2 VALUES('The quick fox jumps over the lazy brown dog',2,3,4);
+INSERT INTO t2 VALUES('10','', -1.25,NULL);
+INSERT INTO t2 VALUES('a,b,c','"Double-Quoted"','-1.25','NULL');
+.output memory
+SELECT * FROM t2;
+.output --verify END
+╭────────────┬────────────┬─────────┬─────────╮
+│     a      │     b      │    c    │    d    │
+╞════════════╪════════════╪═════════╪═════════╡
+│          1 │        2.5 │ three   │ x'4444' │
+├────────────┼────────────┼─────────┼─────────┤
+│ The quick  │          2 │       3 │       4 │
+│ fox jumps  │            │         │         │
+│ over the   │            │         │         │
+│ lazy brown │            │         │         │
+│ dog        │            │         │         │
+├────────────┼────────────┼─────────┼─────────┤
+│ '10'       │            │   -1.25 │ NULL    │
+├────────────┼────────────┼─────────┼─────────┤
+│ a,b,c      │ "Double-   │ '-1.25' │ 'NULL'  │
+│            │ Quoted"    │         │         │
+╰────────────┴────────────┴─────────┴─────────╯
+END
+.output memory
+.mode
+.output --verify END
+current output mode: qbox --limits 5,300 --quote relaxed --screenwidth auto --textjsonb on
+END
+.output memory
+.mode -v
+.output --verify END
+current output mode: qbox --align "" --border on --blob-quote auto --colsep "" --escape auto --limits 5,300 --null "NULL" --quote relaxed --rowsep "" --screenwidth auto --tablename "" --textjsonb on --titles on --widths "" --wordwrap off --wrap 10
+END
+
 .output memory --error-prefix "Error:"
 .mode foo
 .output --verify END
index ecbdd63efcde1388b20bfa9449dfec12f010fb0a..89624002afb028c1e93e457dd3d62215437a4177 100644 (file)
@@ -1040,6 +1040,72 @@ do_test 12.1 {
 ╰───────┴────┴───────╯
 }
 
+# Tests for "relaxed" quoting
+#
+do_test 13.2 {
+  db eval {
+    CREATE TABLE t13(a,b);
+    INSERT INTO t13(a,b) VALUES
+      (1,'NULL'),
+      (0,'-NULL-'),
+      (0,''),
+      (1,'''abcde'),
+      (1,'abcde'''),
+      (0,'abcde'),
+      (1,' abcde'),
+      (1,'abcde '),
+      (1,'+0'),
+      (1,'-0'),
+      (1,'012345'),
+      (0,'012xyz345'),
+      (1,'0123.45'),
+      (0,'12.34.56'),
+      (0,'12.3e'),
+      (1,'12.3e+123'),
+      (1,'12.3e-34'),
+      (1,'12.3E56'),
+      (1,'12E56'),
+      (0,'12.5E5.6'),
+      (0,'12.5e+'),
+      (0,'12.5e-'),
+      (1,'+Inf'),(1,'-Inf'),(1,'Inf');
+  }
+  set result \n[db format -style box -text relaxed -null NULL \
+                 -align {center left} \
+                 {SELECT if(a,'yes','') AS 'quoted?', b AS string
+                   FROM t13 ORDER BY rowid}]
+} {
+╭─────────┬─────────────╮
+│ quoted? │   string    │
+╞═════════╪═════════════╡
+│   yes   │ 'NULL'      │
+│         │ -NULL-      │
+│         │             │
+│   yes   │ '''abcde'   │
+│   yes   │ 'abcde'''   │
+│         │ abcde       │
+│   yes   │ ' abcde'    │
+│   yes   │ 'abcde '    │
+│   yes   │ '+0'        │
+│   yes   │ '-0'        │
+│   yes   │ '012345'    │
+│         │ 012xyz345   │
+│   yes   │ '0123.45'   │
+│         │ 12.34.56    │
+│         │ 12.3e       │
+│   yes   │ '12.3e+123' │
+│   yes   │ '12.3e-34'  │
+│   yes   │ '12.3E56'   │
+│   yes   │ '12E56'     │
+│         │ 12.5E5.6    │
+│         │ 12.5e+      │
+│         │ 12.5e-      │
+│   yes   │ '+Inf'      │
+│   yes   │ '-Inf'      │
+│   yes   │ 'Inf'       │
+╰─────────┴─────────────╯
+}
+
 db close
 
 finish_test