From: drh <> Date: Thu, 23 Mar 2023 19:22:54 +0000 (+0000) Subject: Fix test cases so that they work when SQLITE_ENABLE_NAN_INF is defined. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8b70c07802a8ad89dade31ebf8c8924af6b0f381;p=thirdparty%2Fsqlite.git Fix test cases so that they work when SQLITE_ENABLE_NAN_INF is defined. FossilOrigin-Name: 95c7af79cf55a333d35556877be2d8d4af95161a84fc8bc7c81ee71072bf3e6a --- diff --git a/ext/rtree/rtreedoc.test b/ext/rtree/rtreedoc.test index b64faa2e99..45bda4f49a 100644 --- a/ext/rtree/rtreedoc.test +++ b/ext/rtree/rtreedoc.test @@ -250,14 +250,26 @@ do_execsql_test 8.2 { FROM rtI } {integer integer integer integer integer integer} -do_execsql_test 8.3 { - DELETE FROM rtF; - INSERT INTO rtF VALUES( - 1, 'hello world', X'616263', NULL, 44 - ); - SELECT * FROM rtF; -} { - 1 0.0 0.0 0.0 44.0 +ifcapable nan_inf { + do_execsql_test 8.3a { + DELETE FROM rtF; + INSERT INTO rtF VALUES( + 1, 'hello world', X'616263', NULL, 44 + ); + SELECT * FROM rtF; + } { + 1 0.0 0.0 NaN 44.0 + } +} else { + do_execsql_test 8.3b { + DELETE FROM rtF; + INSERT INTO rtF VALUES( + 1, 'hello world', X'616263', NULL, 44 + ); + SELECT * FROM rtF; + } { + 1 0.0 0.0 0.0 44.0 + } } do_execsql_test 8.4 { SELECT @@ -394,16 +406,29 @@ foreach {tn cols lCol} { } # Show the default values have not been modified - do_execsql_test 1.$tn.4 { - INSERT INTO abc DEFAULT VALUES; - SELECT * FROM abc WHERE rowid NOT IN (1,2) - } {3 0.0 0.0 0.0 0.0} - - # Show that there are no NOT NULL constraints - do_execsql_test 1.$tn.5 { - INSERT INTO abc VALUES(NULL, NULL, NULL, NULL, NULL); - SELECT * FROM abc WHERE rowid NOT IN (1,2,3) - } {4 0.0 0.0 0.0 0.0} + ifcapable nan_inf { + do_execsql_test 1.$tn.4a { + INSERT INTO abc DEFAULT VALUES; + SELECT * FROM abc WHERE rowid NOT IN (1,2) + } {3 NaN NaN NaN NaN} + + # Show that there are no NOT NULL constraints + do_execsql_test 1.$tn.5a { + INSERT INTO abc VALUES(NULL, NULL, NULL, NULL, NULL); + SELECT * FROM abc WHERE rowid NOT IN (1,2,3) + } {4 NaN NaN NaN NaN} + } else { + do_execsql_test 1.$tn.4b { + INSERT INTO abc DEFAULT VALUES; + SELECT * FROM abc WHERE rowid NOT IN (1,2) + } {3 0.0 0.0 0.0 0.0} + + # Show that there are no NOT NULL constraints + do_execsql_test 1.$tn.5b { + INSERT INTO abc VALUES(NULL, NULL, NULL, NULL, NULL); + SELECT * FROM abc WHERE rowid NOT IN (1,2,3) + } {4 0.0 0.0 0.0 0.0} + } # EVIDENCE-OF: R-06893-30579 In an RTREE virtual table, the first column # always has a type affinity of INTEGER and all other data columns have diff --git a/ext/rtree/rtreedoc2.test b/ext/rtree/rtreedoc2.test index ca0c6b31bd..ebaee07a62 100644 --- a/ext/rtree/rtreedoc2.test +++ b/ext/rtree/rtreedoc2.test @@ -124,7 +124,7 @@ do_execsql_test 1.0 { CREATE VIRTUAL TABLE rt2 USING rtree(id, x1,x2, y1,y2); CREATE VIRTUAL TABLE rt3 USING rtree(id, x1,x2, y1,y2, z1,z2); - INSERT INTO rt1 DEFAULT VALUES; + INSERT INTO rt1(id,x1,x2) VALUES(1,0,0); INSERT INTO rt2 DEFAULT VALUES; INSERT INTO rt3 DEFAULT VALUES; } @@ -343,4 +343,3 @@ do_test 6.3 { finish_test - diff --git a/manifest b/manifest index 92d37c15d8..9e9cd4d454 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\s#ifdefs\sthat\suse\sthe\swrong\spreprocessor\smacro. -D 2023-03-23T12:00:03.949 +C Fix\stest\scases\sso\sthat\sthey\swork\swhen\sSQLITE_ENABLE_NAN_INF\sis\sdefined. +D 2023-03-23T19:22:54.195 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -418,8 +418,8 @@ F ext/rtree/rtree_util.tcl db734b4c5e75fed6acc56d9701f2235345acfdec750b5fc7b5879 F ext/rtree/rtreecheck.test 4e859a9cd49d2353ff10c122f72183ec37b400e35d2b0349b2e9696649b6a00e F ext/rtree/rtreecirc.test aec664eb21ae943aeb344191407afff5d392d3ae9d12b9a112ced0d9c5de298e F ext/rtree/rtreeconnect.test 225ad3fcb483d36cbee423a25052a6bbae762c9576ae9268332360c68c170d3d -F ext/rtree/rtreedoc.test 27a5703cb1200f6f69051de68da546cef3dfdcf59be73afadfc50b9f9c9960d9 -F ext/rtree/rtreedoc2.test 194ebb7d561452dcdc10bf03f44e30c082c2f0c14efeb07f5e02c7daf8284d93 +F ext/rtree/rtreedoc.test 678ce6ec98dd971590523c6222561109979e7af38aa7a8314c3e7fdd4a3a45e7 +F ext/rtree/rtreedoc2.test 69e0c043a8e5d90dbb332b56e4ae22862f7085112c50ca3dbd4e9d4916e3821b F ext/rtree/rtreedoc3.test 555a878c4d79c4e37fa439a1c3b02ee65d3ebaf75d9e8d96a9c55d66db3efbf8 F ext/rtree/rtreefuzz001.test 0fc793f67897c250c5fde96cefee455a5e2fb92f4feeabde5b85ea02040790ee F ext/rtree/sqlite3rtree.h 03c8db3261e435fbddcfc961471795cbf12b24e03001d0015b2636b0f3881373 @@ -570,7 +570,7 @@ F src/btreeInt.h 06bb2c1a07172d5a1cd27a2a5d617b93b1e976c5873709c31964786f86365a6 F src/build.c 8357d6ca9a8c9afc297c431df28bc2af407b47f3ef2311875276c944b30c4d54 F src/callback.c 4cd7225b26a97f7de5fee5ae10464bed5a78f2adefe19534cc2095b3a8ca484a F src/complete.c a3634ab1e687055cd002e11b8f43eb75c17da23e -F src/ctime.c 20507cc0b0a6c19cd882fcd0eaeda32ae6a4229fb4b024cfdf3183043d9b703d +F src/ctime.c 534fa410fd717337300f4bfc39cabf95981d4936f8943ecd1de13554d3edd724 F src/date.c f21815ca7172ce073db3163ac54c8d9f2841077165c1a6123b4d1c376a0c7ec7 F src/dbpage.c d47549716549311f79dc39fe5c8fb19390a6eb2c960f8e37c89a9c4de0c1052e F src/dbstat.c ec92074baa61d883de58c945162d9e666c13cd7cf3a23bc38b4d1c4d0b2c2bef @@ -649,7 +649,7 @@ F src/test_backup.c bf5da90c9926df0a4b941f2d92825a01bbe090a0 F src/test_bestindex.c 68c62586d2ae9f032903fe53be743657d0c2aac0a850b880938b668e1161d516 F src/test_blob.c ae4a0620b478548afb67963095a7417cd06a4ec0a56adb453542203bfdcb31ce F src/test_btree.c 8b2dc8b8848cf3a4db93f11578f075e82252a274 -F src/test_config.c 8264637b06a3c1f0727c88d1ea32dcf7986b9e7e358a970cae87cdac8a5b2708 +F src/test_config.c 7f1ee1ebe6410e13885705337342d675decef88eaf73ccab694629bd334cfdf7 F src/test_delete.c e2fe07646dff6300b48d49b2fee2fe192ed389e834dd635e3b3bac0ce0bf9f8f F src/test_demovfs.c 38a459d1c78fd9afa770445b224c485e079018d6ac07332ff9bd07b54d2b8ce9 F src/test_devsym.c aff2255ea290d7718da08af30cdf18e470ff7325a5eff63e0057b1496ed66593 @@ -813,7 +813,7 @@ F test/bigfile2.test 1b489a3a39ae90c7f027b79110d6b4e1dbc71bfc F test/bigmmap.test 6021e205487347c6d7e5a541aa472a4b8efc4e9f4a3799a823b61a8e6616105d F test/bigrow.test f0aeb7573dcb8caaafea76454be3ade29b7fc747 F test/bigsort.test 997e172009905873c06426145e4b3794c7dfe2d563724cb2fd39d45f319cf3d2 -F test/bind.test 1e136709b306f7ed3192d349c2930d89df6ab621654ad6f1a72381d3fe76f483 +F test/bind.test 72950d3b68b720d65ba4f611b45858130318f5f17a26fe1fc4384534d99ac28d F test/bind2.test 918bc35135f4141809ead7585909cde57d44db90a7a62aef540127148f91aab7 F test/bindxfer.test efecd12c580c14df5f4ad3b3e83c667744a4f7e0 F test/bitvec.test 75894a880520164d73b1305c1c3f96882615e142 @@ -836,9 +836,9 @@ F test/cache.test 13bc046b26210471ca6f2889aceb1ea52dc717de F test/cacheflush.test af25bb1509df04c1da10e38d8f322d66eceedf61 F test/cachespill.test 895997f84a25b323b166aecb69baab2d6380ea98f9e0bcc688c4493c535cfab9 F test/capi2.test 4ee545824adc3eb33bf57ef89f77440b28188ec3da72e5425ff0fcdba32e8d5a -F test/capi3.test 3910a73c38ac76d69778dd9eb481ab7cd6ed59117fc047b4f6056a5c72529de1 +F test/capi3.test 6b6babe2ebc6d634744d747b5927127974d8dec5ae1e7a54e5079590304d8863 F test/capi3b.test efb2b9cfd127efa84433cd7a2d72ce0454ae0dc4 -F test/capi3c.test 31d3a6778f2d06f2d9222bd7660c41a516d1518a059b069e96ebbeadb5a490f7 +F test/capi3c.test 5733b14e843b1a203a98f8e411e933dcbe244853c54e658330982ea2a6fd9acb F test/capi3d.test 8b778794af891b0dca3d900bd345fbc8ebd2aa2aae425a9dccdd10d5233dfbde F test/capi3e.test 3d49c01ef2a1a55f41d73cba2b23b5059ec460fe F test/carray01.test 23ed7074307c4a829ba5ff2970993a9d87db7c5cdbbe1a2cbef672d0df6d6e31 @@ -977,7 +977,7 @@ F test/exclusive.test 7ff63be7503990921838d5c9f77f6e33e68e48ed1a9d48cd28745bf650 F test/exclusive2.test 984090e8e9d1b331d2e8111daf6e5d61dda0bef7 F test/exec.test e949714dc127eaa5ecc7d723efec1ec27118fdd7 F test/exists.test 79a75323c78f02bbe9c251ea502a092f9ef63dac -F test/expr.test 5c06696478212e5a04e04b043f993373f6f8e5ce5a80f5548a84703b123b6caa +F test/expr.test 30d038a92a4f6a94cdd9c419e8055b3ac0052fc89bb93f1fa8bd2e139cd62b87 F test/expr2.test c27327ae9c017a7ff6280123f67aff496f912da74d78c888926d68b46ec75fd8 F test/exprfault.test da33606d799718e2f8e34efd0e5858884a1ad87f608774c552a7f5517cc27181 F test/extension01.test 00d13cec817f331a687a243e0e5a2d87b0e358c9 @@ -1131,10 +1131,10 @@ F test/full.test 6b3c8fb43c6beab6b95438c1675374b95fab245d F test/func.test 4be8bed4be235e333f1e0ea31e32f5be3c9f456c30780363e7fcb15e3ff3e6bc F test/func2.test 772d66227e4e6684b86053302e2d74a2500e1e0f F test/func3.test 600a632c305a88f3946d38f9a51efe145c989b2e13bd2b2a488db47fe76bab6a -F test/func4.test 2285fb5792d593fef442358763f0fd9de806eda47dbc7a5934df57ffdc484c31 +F test/func4.test e61ba44570930832bd1259e00720b4dd52376fcc7fd4294cb0da436add9ee57a F test/func5.test 863e6d1bd0013d09c17236f8a13ea34008dd857d87d85a13a673960e4c25d82a F test/func6.test 9cc9b1f43b435af34fe1416eb1e318c8920448ea7a6962f2121972f5215cb9b0 -F test/func7.test adbfc910385a6ffd15dc47be3c619ef070c542fcb7488964badb17b2d9a4d080 +F test/func7.test 6b9f37f554d090240a711a37d1a12bef9afdb48dbf922b6bcdc7fc66cad07cf9 F test/func8.test c4e2ecacf9f16e47a245e7a25fbabcc7e78f9c7c41a80f158527cdfdc6dd299d F test/fuzz-oss1.test 514dcabb24687818ea949fa6760229eaacad74ca70157743ef36d35bbe01ffb0 F test/fuzz.test 4608c1310cff4c3014a84bcced6278139743e080046e5f6784b0de7b069371d8 @@ -1165,7 +1165,7 @@ F test/hidden.test 23c1393a79e846d68fd902d72c85d5e5dcf98711 F test/hook.test 18cae9140fa7f9a6f346e892a3fe3e31b2ca0be1494cd01b918adb74281016a6 F test/hook2.test b9ff3b8c6519fb67f33192f1afe86e7782ee4ac8 F test/icu.test 716a6b89fbabe5cc63e0cd4c260befb08fd7b9d761f04d43669233292f0753b1 -F test/ieee754.test b0945d12be7d255f3dfa18e2511b17ca37e0edd2b803231c52d05b86c04ab26e +F test/ieee754.test 073b399ced1e63130191fc2f961392b3a68bdef6f08aecaa08134bb3767d4650 F test/imposter1.test c3f1db2d3db2c24611a6596a3fc0ffc14f1466c8 F test/in.test 7399a6562fb09de7f786901f0b24b7bbe7c0b541f29ead9eb13f091edea37da4 F test/in2.test 5d4c61d17493c832f7d2d32bef785119e87bde75 @@ -1218,7 +1218,7 @@ F test/ioerr3.test d3cec5e1a11ad6d27527d0d38573fbff14c71bdd F test/ioerr4.test f130fe9e71008577b342b8874d52984bd04ede2c F test/ioerr5.test 2edfa4fb0f896f733071303b42224df8bedd9da4 F test/ioerr6.test a395a6ab144b26a9e3e21059a1ab6a7149cca65b -F test/istrue.test e7f285bb70282625c258e866ce6337d4c762922f5a300e1b50f958aef6e7d9c9 +F test/istrue.test df34067a471617733407e19d7b3fb608bce6442b45046e56031f646f458644a5 F test/join.test ed1daf99958fed1b9f017e56bae2bb6b49339a1ec0b70b9e8f7259960c6bf387 F test/join2.test 8561fe82ce434ac96de91544072e578dc2cadddf2d9bc9cd802f866a9b92502e F test/join3.test 6f0c774ff1ba0489e6c88a3e77b9d3528fb4fda0 @@ -1330,7 +1330,7 @@ F test/multiplex3.test fac575e0b1b852025575a6a8357701d80933e98b5d2fe6d35ddaa68f9 F test/multiplex4.test e8ae4c4bd70606a5727743241f13b5701990abe4 F test/mutex1.test 4d7ecb155ae5ba9ca6f1817c1c74d51b5bb284d7f599de1859a9f2c9a1ca0d38 F test/mutex2.test bfeaeac2e73095b2ac32285d2756e3a65e681660 -F test/nan.test 437d40e6d0778b050d7750726c0cbd2c9936b81962926e8f8c48ca698f00f4d1 +F test/nan.test dfb4e47e1db17ebb8760cc259323629c8afb256b4bc5ed82ff78438e416d4601 F test/nockpt.test 8c43b25af63b0bd620cf1b003529e37b6f1dc53bd22690e96a1bd73f78dde53a F test/nolock.test f196cf8b8fbea4e2ca345140a2b3f3b0da45c76e F test/normalize.test f23b6c5926c59548635fcf39678ac613e726121e073dd902a3062fbb83903b72 @@ -1976,7 +1976,7 @@ F tool/max-limits.c cbb635fbb37ae4d05f240bfb5b5270bb63c54439 F tool/merge-test.tcl de76b62f2de2a92d4c1ca4f976bce0aea6899e0229e250479b229b2a1914b176 F tool/mkautoconfamal.sh f62353eb6c06ab264da027fd4507d09914433dbdcab9cb011cdc18016f1ab3b8 F tool/mkccode.tcl 86463e68ce9c15d3041610fedd285ce32a5cf7a58fc88b3202b8b76837650dbe x -F tool/mkctimec.tcl 38e3db33210a200aae791635125052a643a27aa0619a0debf19aa9c55e1b2dde x +F tool/mkctimec.tcl cf2e2485c291d259655a28140317840387a374851f3608410449d660026064d2 x F tool/mkkeywordhash.c 35bfc41adacc4aa6ef6fca7fd0c63e0ec0534b78daf4d0cfdebe398216bbffc3 F tool/mkmsvcmin.tcl 6ecab9fe22c2c8de4d82d4c46797bda3d2deac8e763885f5a38d0c44a895ab33 F tool/mkopcodec.tcl 33d20791e191df43209b77d37f0ff0904620b28465cca6990cf8d60da61a07ef @@ -2051,8 +2051,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 96ec8306457eebf5ce955402d7b8b88aa7d73803e22144cc6a22da0048741016 -R ecf7f53684129937630d2122df0ae80d +P 0aecf360fbc8ece7decf95132349ac58bca532aaa0655541023771f5a3cdea83 +R d6286852d3ebc9c14df55956bf4f556c U drh -Z abe4a4a96925f84320d9b8b9319bd107 +Z 363c17f88d43eb10c53e8426c3c93b8b # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 679099f650..5923d5e43b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -0aecf360fbc8ece7decf95132349ac58bca532aaa0655541023771f5a3cdea83 \ No newline at end of file +95c7af79cf55a333d35556877be2d8d4af95161a84fc8bc7c81ee71072bf3e6a \ No newline at end of file diff --git a/src/ctime.c b/src/ctime.c index c853e5ba46..94a292a6fd 100644 --- a/src/ctime.c +++ b/src/ctime.c @@ -60,9 +60,6 @@ static const char * const sqlite3azCompileOpt[] = { #ifdef SQLITE_4_BYTE_ALIGNED_MALLOC "4_BYTE_ALIGNED_MALLOC", #endif -#ifdef SQLITE_64BIT_STATS - "64BIT_STATS", -#endif #ifdef SQLITE_ALLOW_COVERING_INDEX_SCAN # if SQLITE_ALLOW_COVERING_INDEX_SCAN != 1 "ALLOW_COVERING_INDEX_SCAN=" CTIMEOPT_VAL(SQLITE_ALLOW_COVERING_INDEX_SCAN), @@ -286,6 +283,9 @@ static const char * const sqlite3azCompileOpt[] = { #ifdef SQLITE_ENABLE_MULTIPLEX "ENABLE_MULTIPLEX", #endif +#ifdef SQLITE_ENABLE_NAN_INF + "ENABLE_NAN_INF", +#endif #ifdef SQLITE_ENABLE_NORMALIZE "ENABLE_NORMALIZE", #endif diff --git a/src/test_config.c b/src/test_config.c index a362dbc567..b19996a72f 100644 --- a/src/test_config.c +++ b/src/test_config.c @@ -771,6 +771,12 @@ Tcl_SetVar2(interp, "sqlite_options", "mergesort", "1", TCL_GLOBAL_ONLY); Tcl_SetVar2(interp, "sqlite_options", "uri_00_error", "0", TCL_GLOBAL_ONLY); #endif +#if defined(SQLITE_ENABLE_NAN_INF) + Tcl_SetVar2(interp, "sqlite_options", "nan_inf", "1", TCL_GLOBAL_ONLY); +#else + Tcl_SetVar2(interp, "sqlite_options", "nan_inf", "0", TCL_GLOBAL_ONLY); +#endif + #if defined(SQLITE_ENABLE_NORMALIZE) Tcl_SetVar2(interp, "sqlite_options", "normalize", "1", TCL_GLOBAL_ONLY); #else diff --git a/test/bind.test b/test/bind.test index 8cafaab2bc..4a5cac1510 100644 --- a/test/bind.test +++ b/test/bind.test @@ -224,19 +224,35 @@ do_test bind-4.3 { DELETE FROM t1; } } {} -do_test bind-4.4 { - sqlite3_bind_double $VM 1 NaN - sqlite3_bind_double $VM 2 1e300 - sqlite3_bind_double $VM 3 -1e-300 - sqlite_step $VM N VALUES COLNAMES - sqlite3_reset $VM - set x [execsql {SELECT rowid, * FROM t1}] - regsub {1e-005} $x {1e-05} y - set y -} {1 {} 1e+300 -1e-300} -do_test bind-4.5 { - execsql {SELECT typeof(a), typeof(b), typeof(c) FROM t1} -} {null real real} +ifcapable nan_inf { + do_test bind-4.4nan { + sqlite3_bind_double $VM 1 NaN + sqlite3_bind_double $VM 2 1e300 + sqlite3_bind_double $VM 3 -1e-300 + sqlite_step $VM N VALUES COLNAMES + sqlite3_reset $VM + set x [execsql {SELECT rowid, * FROM t1}] + regsub {1e-005} $x {1e-05} y + set y + } {1 NaN(7ffffffffffff) 1e+300 -1e-300} + do_test bind-4.5nan { + execsql {SELECT typeof(a), typeof(b), typeof(c) FROM t1} + } {real real real} +} else { + do_test bind-4.4 { + sqlite3_bind_double $VM 1 NaN + sqlite3_bind_double $VM 2 1e300 + sqlite3_bind_double $VM 3 -1e-300 + sqlite_step $VM N VALUES COLNAMES + sqlite3_reset $VM + set x [execsql {SELECT rowid, * FROM t1}] + regsub {1e-005} $x {1e-05} y + set y + } {1 {} 1e+300 -1e-300} + do_test bind-4.5 { + execsql {SELECT typeof(a), typeof(b), typeof(c) FROM t1} + } {null real real} +} do_test bind-4.6 { execsql { DELETE FROM t1; diff --git a/test/capi3.test b/test/capi3.test index 40d87ac8e3..c0455a667a 100644 --- a/test/capi3.test +++ b/test/capi3.test @@ -607,7 +607,9 @@ do_test capi3-5.5 { check_header $STMT capi3-5.6 {a b c} {VARINT BLOB VARCHAR(16)} check_origin_header $STMT capi3-5.6 {main main main} {t1 t1 t1} {a b c} -check_data $STMT capi3-5.7 {TEXT TEXT NULL} {0 0 0} {0.0 0.0 0.0} {one two {}} +ifcapable !nan_inf { + check_data $STMT capi3-5.7 {TEXT TEXT NULL} {0 0 0} {0.0 0.0 0.0} {one two {}} +} do_test capi3-5.8 { sqlite3_step $STMT diff --git a/test/capi3c.test b/test/capi3c.test index 247dbf35e5..f982179409 100644 --- a/test/capi3c.test +++ b/test/capi3c.test @@ -577,7 +577,9 @@ do_test capi3c-5.5 { check_header $STMT capi3c-5.6 {a b c} {VARINT BLOB VARCHAR(16)} check_origin_header $STMT capi3c-5.6 {main main main} {t1 t1 t1} {a b c} -check_data $STMT capi3c-5.7 {TEXT TEXT NULL} {0 0 0} {0.0 0.0 0.0} {one two {}} +ifcapable !nan_inf { + check_data $STMT capi3c-5.7 {TEXT TEXT NULL} {0 0 0} {0.0 0.0 0.0} {one two {}} +} do_test capi3c-5.8 { sqlite3_step $STMT diff --git a/test/expr.test b/test/expr.test index 55b1dc9502..d331c31644 100644 --- a/test/expr.test +++ b/test/expr.test @@ -390,8 +390,13 @@ ifcapable floatingpoint { test_expr expr-2.23 {r1=1.23, r2=2.34} {max(r1,r2,r1+r2,r1-r2)} {3.57} test_expr expr-2.24 {r1=25.0, r2=11.0} {r1%r2} 3.0 test_expr expr-2.25 {r1=1.23, r2=NULL} {coalesce(r1+r2,99.0)} 99.0 - test_expr expr-2.26 {r1=1e300, r2=1e300} {coalesce((r1*r2)*0.0,99.0)} 99.0 - test_expr expr-2.26b {r1=1e300, r2=-1e300} {coalesce((r1*r2)*0.0,99.0)} 99.0 + ifcapable nan_inf { + test_expr expr-2.26a {r1=1e300, r2=1e300} {coalesce((r1*r2)*0.0,99.0)} -NaN + test_expr expr-2.26b {r1=1e300, r2=-1e300} {coalesce((r1*r2)*0.0,99.0)} -NaN + } else { + test_expr expr-2.26c {r1=1e300, r2=1e300} {coalesce((r1*r2)*0.0,99.0)} 99.0 + test_expr expr-2.26d {r1=1e300, r2=-1e300} {coalesce((r1*r2)*0.0,99.0)} 99.0 + } test_expr expr-2.27 {r1=1.1, r2=0.0} {r1/r2} {{}} test_expr expr-2.28 {r1=1.1, r2=0.0} {r1%r2} {{}} } diff --git a/test/func4.test b/test/func4.test index 924c1fa538..50b6dd3501 100644 --- a/test/func4.test +++ b/test/func4.test @@ -724,33 +724,35 @@ ifcapable floatingpoint { do_execsql_test func4-6.3.16 { SELECT toreal(x'7ff0000000000000'); } {Inf} - do_execsql_test func4-6.3.17 { - SELECT toreal(x'fff8000000000000'); - } {{}} - do_execsql_test func4-6.3.18 { - SELECT toreal(x'fff0000000000001'); - } {{}} - do_execsql_test func4-6.3.19 { - SELECT toreal(x'fff7ffffffffffff'); - } {{}} - do_execsql_test func4-6.3.20 { - SELECT toreal(x'7ff0000000000001'); - } {{}} - do_execsql_test func4-6.3.21 { - SELECT toreal(x'7ff7ffffffffffff'); - } {{}} - do_execsql_test func4-6.3.22 { - SELECT toreal(x'fff8000000000001'); - } {{}} - do_execsql_test func4-6.3.23 { - SELECT toreal(x'ffffffffffffffff'); - } {{}} - do_execsql_test func4-6.3.24 { - SELECT toreal(x'7ff8000000000000'); - } {{}} - do_execsql_test func4-6.3.25 { - SELECT toreal(x'7fffffffffffffff'); - } {{}} + ifcapable !nan_inf { + do_execsql_test func4-6.3.17 { + SELECT toreal(x'fff8000000000000'); + } {{}} + do_execsql_test func4-6.3.18 { + SELECT toreal(x'fff0000000000001'); + } {{}} + do_execsql_test func4-6.3.19 { + SELECT toreal(x'fff7ffffffffffff'); + } {{}} + do_execsql_test func4-6.3.20 { + SELECT toreal(x'7ff0000000000001'); + } {{}} + do_execsql_test func4-6.3.21 { + SELECT toreal(x'7ff7ffffffffffff'); + } {{}} + do_execsql_test func4-6.3.22 { + SELECT toreal(x'fff8000000000001'); + } {{}} + do_execsql_test func4-6.3.23 { + SELECT toreal(x'ffffffffffffffff'); + } {{}} + do_execsql_test func4-6.3.24 { + SELECT toreal(x'7ff8000000000000'); + } {{}} + do_execsql_test func4-6.3.25 { + SELECT toreal(x'7fffffffffffffff'); + } {{}} + } } set tcl_precision $saved_tcl_precision diff --git a/test/func7.test b/test/func7.test index bb4f80b325..5eb8d7936a 100644 --- a/test/func7.test +++ b/test/func7.test @@ -165,9 +165,15 @@ do_execsql_test func7-pg-550 { do_execsql_test func7-mysql-100 { SELECT acos(1); } {0.0} -do_execsql_test func7-mysql-110 { - SELECT acos(1.0001); -} {{}} +ifcapable nan_inf { + do_execsql_test func7-mysql-110a { + SELECT acos(1.0001); + } {NaN} +} else { + do_execsql_test func7-mysql-110b { + SELECT acos(1.0001); + } {{}} +} do_execsql_test func7-mysql-120 { SELECT round( acos(0.0), 7); } {1.5707963} @@ -237,9 +243,15 @@ do_execsql_test func7-mysql-300 { do_execsql_test func7-mysql-310 { SELECT sin(pi()) BETWEEN -1.0e-15 AND 1.0e-15; } {1} -do_execsql_test func7-mysql-320 { - SELECT sqrt(4), round(sqrt(20),7), quote(sqrt(-16)); -} {2.0 4.472136 NULL} +ifcapable nan_inf { + do_execsql_test func7-mysql-320a { + SELECT sqrt(4), round(sqrt(20),7), quote(sqrt(-16)); + } {2.0 4.472136 NaN} +} else { + do_execsql_test func7-mysql-320b { + SELECT sqrt(4), round(sqrt(20),7), quote(sqrt(-16)); + } {2.0 4.472136 NULL} +} do_execsql_test func7-mysql-330 { SELECT tan(pi()) BETWEEN -1.0e-15 AND 1.0e-15; } {1} diff --git a/test/ieee754.test b/test/ieee754.test index bd806d2cf3..ba92cbe0ac 100644 --- a/test/ieee754.test +++ b/test/ieee754.test @@ -53,8 +53,10 @@ do_test ieee754-111 { db eval {SELECT ieee754(-1,1024), ieee754(-4503599627370495,972);} ] } {-inf -1.79769313486232e+308} -do_execsql_test ieee754-112 { - SELECT ieee754(4503599627370495,973) is null; -} {1} +ifcapable !nan_inf { + do_execsql_test ieee754-112 { + SELECT ieee754(4503599627370495,973) is null; + } {1} +} finish_test diff --git a/test/istrue.test b/test/istrue.test index f1ba63248f..20342598f8 100644 --- a/test/istrue.test +++ b/test/istrue.test @@ -135,9 +135,14 @@ foreach {tn val} [list 1 NaN 2 -NaN 3 NaN0 4 -NaN0 5 Inf 6 -Inf] { sqlite3_reset $::STMT sqlite3_finalize $::STMT } {SQLITE_OK} + ifcapable nan_inf { + set res 1 + } else { + set res [expr {$tn in [list 5 6] ? {1} : {0}}] + } do_execsql_test istrue-600.$tn.3 { SELECT x IS TRUE FROM t1; - } [expr {$tn in [list 5 6] ? {1} : {0}}] + } $res do_execsql_test istrue-600.$tn.4 { SELECT x IS FALSE FROM t1; } {0} diff --git a/test/nan.test b/test/nan.test index 615a4ad227..0a8b777142 100644 --- a/test/nan.test +++ b/test/nan.test @@ -24,6 +24,11 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl +ifcapable nan_inf { + finish_test + return +} + # Do not use a codec for tests in this file, as the database file is # manipulated directly using tcl scripts (using the [hexio_write] command). # diff --git a/tool/mkctimec.tcl b/tool/mkctimec.tcl index bcb1a54bb8..df230d33e9 100755 --- a/tool/mkctimec.tcl +++ b/tool/mkctimec.tcl @@ -149,6 +149,7 @@ set boolean_defnil_options { SQLITE_ENABLE_MEMSYS3 SQLITE_ENABLE_MEMSYS5 SQLITE_ENABLE_MULTIPLEX + SQLITE_ENABLE_NAN_INF SQLITE_ENABLE_NORMALIZE SQLITE_ENABLE_NULL_TRIM SQLITE_ENABLE_OFFSET_SQL_FUNC