Compare commits

..

1 Commits

Author SHA1 Message Date
drh c733a4c7cc Enhancements to the printf() logic in order to render a negative zero with
a minus sign.

FossilOrigin-Name: 6ba4be66be90799ab0e1edc08c5c09bea239a85027ad0ca1f42818fc2580af4d
2019-06-12 20:11:34 +00:00
62 changed files with 351 additions and 1331 deletions
+1 -1
View File
@@ -1 +1 @@
3.30.0
3.29.0
Vendored
+9 -9
View File
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for sqlite 3.30.0.
# Generated by GNU Autoconf 2.69 for sqlite 3.29.0.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -726,8 +726,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='sqlite'
PACKAGE_TARNAME='sqlite'
PACKAGE_VERSION='3.30.0'
PACKAGE_STRING='sqlite 3.30.0'
PACKAGE_VERSION='3.29.0'
PACKAGE_STRING='sqlite 3.29.0'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -1466,7 +1466,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures sqlite 3.30.0 to adapt to many kinds of systems.
\`configure' configures sqlite 3.29.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1531,7 +1531,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of sqlite 3.30.0:";;
short | recursive ) echo "Configuration of sqlite 3.29.0:";;
esac
cat <<\_ACEOF
@@ -1657,7 +1657,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
sqlite configure 3.30.0
sqlite configure 3.29.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2076,7 +2076,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by sqlite $as_me 3.30.0, which was
It was created by sqlite $as_me 3.29.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -12232,7 +12232,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by sqlite $as_me 3.30.0, which was
This file was extended by sqlite $as_me 3.29.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -12298,7 +12298,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
sqlite config.status 3.30.0
sqlite config.status 3.29.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
+2 -8
View File
@@ -4282,13 +4282,10 @@ static int fts3IncrmergeLoad(
pNode = &pWriter->aNodeWriter[nHeight];
pNode->iBlock = pWriter->iStart + pWriter->nLeafEst*nHeight;
blobGrowBuffer(&pNode->block,
MAX(nRoot, p->nNodeSize)+FTS3_NODE_PADDING, &rc
);
blobGrowBuffer(&pNode->block, MAX(nRoot, p->nNodeSize), &rc);
if( rc==SQLITE_OK ){
memcpy(pNode->block.a, aRoot, nRoot);
pNode->block.n = nRoot;
memset(&pNode->block.a[nRoot], 0, FTS3_NODE_PADDING);
}
for(i=nHeight; i>=0 && rc==SQLITE_OK; i--){
@@ -4308,13 +4305,10 @@ static int fts3IncrmergeLoad(
pNode = &pWriter->aNodeWriter[i-1];
pNode->iBlock = reader.iChild;
rc = sqlite3Fts3ReadBlock(p, reader.iChild, &aBlock, &nBlock, 0);
blobGrowBuffer(&pNode->block,
MAX(nBlock, p->nNodeSize)+FTS3_NODE_PADDING, &rc
);
blobGrowBuffer(&pNode->block, MAX(nBlock, p->nNodeSize), &rc);
if( rc==SQLITE_OK ){
memcpy(pNode->block.a, aBlock, nBlock);
pNode->block.n = nBlock;
memset(&pNode->block.a[nBlock], 0, FTS3_NODE_PADDING);
}
sqlite3_free(aBlock);
}
+1 -1
View File
@@ -1123,7 +1123,7 @@ static JsonNode *jsonLookupStep(
u32 iStart, iLabel;
JsonNode *pNode;
iStart = jsonParseAddNode(pParse, JSON_OBJECT, 2, 0);
iLabel = jsonParseAddNode(pParse, JSON_STRING, nKey, zKey);
iLabel = jsonParseAddNode(pParse, JSON_STRING, i, zPath);
zPath += i;
pNode = jsonLookupAppend(pParse, zPath, pApnd, pzErr);
if( pParse->oom ) return 0;
+4 -10
View File
@@ -63,6 +63,10 @@
#include "sqlite3.h"
#endif
#include <string.h>
#include <assert.h>
#include <stdio.h>
#ifndef SQLITE_AMALGAMATION
#include "sqlite3rtree.h"
typedef sqlite3_int64 i64;
@@ -70,17 +74,7 @@ typedef sqlite3_uint64 u64;
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;
#if !defined(NDEBUG) && !defined(SQLITE_DEBUG)
# define NDEBUG 1
#endif
#if defined(NDEBUG) && defined(SQLITE_DEBUG)
# undef NDEBUG
#endif
#endif
#include <string.h>
#include <stdio.h>
#include <assert.h>
/* The following macro is used to suppress compiler warnings.
*/
+65 -66
View File
@@ -1,5 +1,5 @@
C Rework\sthe\sFILTER\sclause\simplementation\sto\sshare\smore\scode\swith\swindow\sfunctions.
D 2019-07-13T16:22:50.675
C Enhancements\sto\sthe\sprintf()\slogic\sin\sorder\sto\srender\sa\snegative\szero\swith\na\sminus\ssign.
D 2019-06-12T20:11:34.026
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -7,7 +7,7 @@ F Makefile.in 4640daf826b80947a924ac44275c451ffc13007c7c866a5730c8ce5cf9e1dc74
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc 26957950b2b4f3b26e311eeea70437f85a77765f71d3a06489466d66ee321100
F README.md 1514a365ffca3c138e00c5cc839906108a01011a6b082bad19b09781e3aa498a
F VERSION 4c516d84c2a5f26c477ed34c09ac4136630f71c68139631f2eb591b22eea7cf1
F VERSION cc8cd90333c65cdf4cb346f356a2ce1eb0f5b7fa1d17a34d7350103e7320af1f
F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50
F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2
F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90
@@ -34,7 +34,7 @@ F autoconf/tea/win/rules.vc c511f222b80064096b705dbeb97060ee1d6b6d63
F config.guess 883205ddf25b46f10c181818bf42c09da9888884af96f79e1719264345053bd6
F config.h.in 6376abec766e9a0785178b1823b5a587e9f1ccbc
F config.sub c2d0260f17f3e4bc0b6808fccf1b291cb5e9126c14fc5890efc77b9fd0175559
F configure 6f5136d2574d7aa08370021ab63be3ef8a8bf32af60594de08393b01feeb4bab x
F configure 4a97fb6ccce582ebb3dc5a7e281e5e2823574dad851b8ccf814aa6de9f4c7ad2 x
F configure.ac 3552d3aecade98a9d4b64bceb48ffb7726cbc85902efde956812942f060fbd0a
F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad
F doc/F2FS.txt c1d4a0ae9711cfe0e1d8b019d154f1c29e0d3abfe820787ba1e9ed7691160fcd
@@ -99,7 +99,7 @@ F ext/fts3/fts3_tokenizer.h 64c6ef6c5272c51ebe60fc607a896e84288fcbc3
F ext/fts3/fts3_tokenizer1.c 5c98225a53705e5ee34824087478cf477bdb7004
F ext/fts3/fts3_unicode.c 4b9af6151c29b35ed09574937083cece7c31e911f69615e168a39677569b684d
F ext/fts3/fts3_unicode2.c 416eb7e1e81142703520d284b768ca2751d40e31fa912cae24ba74860532bf0f
F ext/fts3/fts3_write.c 9e88111ca9f70e4079880d842c8323bffc4968b39ee38c0a75962a3485af9333
F ext/fts3/fts3_write.c b4c2e8fc90df14b0cdb78be934269689abe29ee652fc672e342a82e8e632cea5
F ext/fts3/fts3speed.tcl b54caf6a18d38174f1a6e84219950d85e98bb1e9
F ext/fts3/mkfts3amal.tcl 252ecb7fe6467854f2aa237bf2c390b74e71f100
F ext/fts3/tool/fts3cov.sh c331d006359456cf6f8f953e37f2b9c7d568f3863f00bb5f7eb87fea4ac01b73
@@ -293,7 +293,7 @@ F ext/misc/fileio.c 288e7230e0fe464d71b0694e2d8bdd3a353118ac2e31da3964b95f460f09
F ext/misc/fossildelta.c 5c04d0a5657615daf4c6cd01c4281de8983dd28f6eed592b2691c10e3f6710e1
F ext/misc/fuzzer.c c4e27daf41433a64cad5265cd27dbcb891147e9994d0422200ce81ce9a54b625
F ext/misc/ieee754.c f190d0cc5182529acb15babd177781be1ac1718c
F ext/misc/json1.c c99b5f04fccba87c1c8c5ab5c0e53eef37c0144086e33911290a67dfba541d59
F ext/misc/json1.c 8af4672f43634257dbcfdb4515b4070325463d67c6968b4be1bd414de28d4d58
F ext/misc/memstat.c 3017a0832c645c0f8c773435620d663855f04690172316bd127270d1a7523d4d
F ext/misc/memtrace.c 7c0d115d2ef716ad0ba632c91e05bd119cb16c1aedf3bec9f06196ead2d5537b
F ext/misc/memvfs.c ab36f49e02ebcdf85a1e08dc4d8599ea8f343e073ac9e0bca18a98b7e1ec9567
@@ -376,7 +376,7 @@ F ext/repair/test/checkindex01.test b530f141413b587c9eb78ff734de6bb79bc3515c3350
F ext/repair/test/test.tcl 686d76d888dffd021f64260abf29a55c57b2cedfa7fc69150b42b1d6119aac3c
F ext/rtree/README 6315c0d73ebf0ec40dedb5aa0e942bc8b54e3761
F ext/rtree/geopoly.c c591164125808f8bba9659e92665b78412cd263e654b6f05294f3a8da7cdd9fb
F ext/rtree/rtree.c 78c0d989c32e5baac471f0463e83cda5006c7e71ded39d633b5fc001a301a26e
F ext/rtree/rtree.c f2ce90120f3e2e01f8a510a227cafbea224c08ba2bf6809b0139c671de2873dc
F ext/rtree/rtree.h 4a690463901cb5e6127cf05eb8e642f127012fd5003830dbc974eca5802d9412
F ext/rtree/rtree1.test 7573134f1b4f59df36c1b0a6de51268fd3b9c714d91f3811482263e734e416ea
F ext/rtree/rtree2.test 5f25b01acd03470067a2d52783b2eb0a50bf836803d4342d20ca39e541220fe2
@@ -456,37 +456,37 @@ F spec.template 86a4a43b99ebb3e75e6b9a735d5fd293a24e90ca
F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b
F sqlite3.1 fc7ad8990fc8409983309bb80de8c811a7506786
F sqlite3.pc.in 48fed132e7cb71ab676105d2a4dc77127d8c1f3a
F src/alter.c c1b5e5639b88dcc146db326315f2dea4f7f1c599e524eeb421d544927a0b1e86
F src/alter.c 12f8c9a79ab51f7574998e3ed28dbafe59bbf0e8a435443c80bc788f661586f7
F src/analyze.c 58db66344a5c58dcabb57f26696f6f2993956c830446da40b444051d2fdaf644
F src/attach.c 78e986baee90cb7b83fb9eafa79c22581a8ada14030fd633b0683c95cf11213c
F src/auth.c 0fac71038875693a937e506bceb492c5f136dd7b1249fbd4ae70b4e8da14f9df
F src/backup.c b1d37f6f7f5913944583733ed0f9e182f3ece0d42c27f46701142141a6e6fd33
F src/bitvec.c 17ea48eff8ba979f1f5b04cc484c7bb2be632f33
F src/btmutex.c 8acc2f464ee76324bf13310df5692a262b801808984c1b79defb2503bbafadb6
F src/btree.c 0e30c98649796a91a889c2ab1c2f032da9918ac5244a3688ed97e8b5779b61fa
F src/btree.c 1dbc191e5c1d9bca84a956fed5d73924c574ae5390855009f067bd0f6422e462
F src/btree.h c11446f07ec0e9dc85af8041cb0855c52f5359c8b2a43e47e02a685282504d89
F src/btreeInt.h 6111c15868b90669f79081039d19e7ea8674013f907710baa3c814dc3f8bfd3f
F src/build.c 23a0253ab53e62feadcc0c6f31e7e418ef9d4b92c82a1398e98433776b920a4e
F src/build.c c5b97d3518c13081169027f291ff84b12661d526deb605031d413223ff2e0f03
F src/callback.c 25dda5e1c2334a367b94a64077b1d06b2553369f616261ca6783c48bcb6bda73
F src/complete.c a3634ab1e687055cd002e11b8f43eb75c17da23e
F src/ctime.c 37f3d21193c4f7d141d0691cced5b39c99951bfef78df9887faf9167b9c42f37
F src/ctime.c 109e58d00f62e8e71ee1eb5944ac18b90171c928ab2e082e058056e1137cc20b
F src/date.c e1d8ac7102f3f283e63e13867acb0efa33861cf34f0faf4cdbaf9fa7a1eb7041
F src/dbpage.c 135eb3b5e74f9ef74bde5cec2571192c90c86984fa534c88bf4a055076fa19b7
F src/dbstat.c c12833de69cb655751487d2c5a59607e36be1c58ba1f4bd536609909ad47b319
F src/delete.c d08c9e01a2664afd12edcfa3a9c6578517e8ff8735f35509582693adbe0edeaf
F src/expr.c 896c4576cd88a0dc5b5ae0abd236b507b778105b58744bd8974fac98fc432b4c
F src/expr.c 069de02008e6190bb684db65ca7cbcab65616f415629c3b884223ce9cbdefd61
F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007
F src/fkey.c 0e14d4bef8eac2d87bbd517e492d9084c65008d117823f8922c5e7b2b599bd33
F src/func.c 905c0424900979fade3731b4a271592059425c988cb7d5b245032253712dd7c8
F src/global.c 1e942b1e6fb6a2a15e6015bda72be0abefc4b1339a8640a47b1b71b7f317917b
F src/global.c 0dea3065ea72a65ae941559b6686aad6516d4913e76fa4f79a95ff7787f624ec
F src/hash.c 8d7dda241d0ebdafb6ffdeda3149a412d7df75102cecfc1021c98d6219823b19
F src/hash.h 9d56a9079d523b648774c1784b74b89bd93fac7b365210157482e4319a468f38
F src/hwtime.h 747c1bbe9df21a92e9c50f3bbec1de841dc5e5da
F src/in-operator.md 10cd8f4bcd225a32518407c2fb2484089112fd71
F src/insert.c f20925c2c08144442dabeb73dcd0f5026f5f085d827f3d5635f7c45e5d195320
F src/insert.c 4ffc3aa5d2aed178b501533428a76e150907e92a1e4bf7af4ffbcb0d77e99823
F src/legacy.c d7874bc885906868cd51e6c2156698f2754f02d9eee1bae2d687323c3ca8e5aa
F src/loadext.c 22afc33c3a61b4fd80a60a54f1882688371e6bc64685df2696b008fce65a999c
F src/main.c 591a0084b1a6b0ed6741f77181bd1a630ca10bb460420f00e8c11809da7df5b9
F src/main.c 3c3925b0bcb4c45687fd52f54c79e98e379252e1d3393f8b7dcccfa26181b661
F src/malloc.c 0f9da2a66b230a5785af94b9672126845099b57b70a32c987d04ac28c69da990
F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
F src/mem1.c c12a42539b1ba105e3707d0e628ad70e611040d8f5e38cf942cee30c867083de
@@ -511,28 +511,28 @@ F src/os_win.c 85d9e532d0444ab6c16d7431490c2e279e282aa0917b0e988996b1ae0de5c5a0
F src/os_win.h 7b073010f1451abe501be30d12f6bc599824944a
F src/pager.c 422fd8cfa59fb9173eff36a95878904a0eeb0dcc62ba49350acc8b1e51c4dc7b
F src/pager.h 217921e81eb5fe455caa5cda96061959706bcdd29ddb57166198645ef7822ac3
F src/parse.y ef494825aa4d633b601af10f936fe50a630bd4c4a6ceb4d941ecfb6756e06c56
F src/pcache.c fd2d0553b3222d6b9f7cb251079e5bca1299d1161da3027b525932d8bf46340a
F src/parse.y 026e3e6fff32432166a4eae0bdb78ad09a53c84eb49acb44dc32e49b4c0b8a48
F src/pcache.c 696a01f1a6370c1b50a09c15972bc3bee3333f8fcd1f2da8e9a76b1b062c59ee
F src/pcache.h 4f87acd914cef5016fae3030343540d75f5b85a1877eed1a2a19b9f284248586
F src/pcache1.c e6373934cdafea272d94feb224344f9fd93ff94318221b64ccabd72d98b4672e
F src/pcache1.c be64b2f3908a7f97c56c963676eb12f0d6254c95b28cdc1d73a186eff213219d
F src/pragma.c 925bcac0afd98a0d4255c7524b93239ab4d83893d96f7f8fdccd78d4929a39bb
F src/pragma.h 4a9fabff14db4487a734dfeeb4be984ce662bfdccfae16145b9c732327735e13
F src/prepare.c d633c3610c23dc98239ea445803c2a6188c2b8ab647e3df4243f369516e6c8d1
F src/printf.c 9be6945837c839ba57837b4bc3af349eba630920fa5532aa518816defe42a7d4
F src/prepare.c 78027c6231fbb19ca186a5f5f0c0a1375d9c2cec0655273f9bd90d9ff74a34b3
F src/printf.c 05d4d769e0dba0bdb4f52255ab3c7ca0b500c5f08d28caced0cce0642ba60e87
F src/random.c 80f5d666f23feb3e6665a6ce04c7197212a88384
F src/resolve.c 6d96d5c1cfa48e49df160aee6032dbb1f79e1d04163c34f9be5625828ac9a2ec
F src/resolve.c f71303e7202743e261b2fb885591b29d4bd826a7dc915745fa376fd1a3943f1a
F src/rowset.c d977b011993aaea002cab3e0bb2ce50cf346000dff94e944d547b989f4b1fe93
F src/select.c 1ac359aed1a83239ce3434c0620e488ad9cf25dee829b86c89f7fe4b5cd366c5
F src/shell.c.in 82f8a473c01662f52233c6c75b9bf88d0d2cab276086d5d4ca6f2ff57a3e48eb
F src/sqlite.h.in 83ebc8ab1a2e82d92214006ea2c15bf8a0604f3fac2c31dd9ce9021f568c71f2
F src/select.c 9187f2c65744e975b191ccee49946732ee922f8bf40da998b322aca1633405ea
F src/shell.c.in 9648bc2035a4dc2a380c863535893dc1d9f8a62bab57b6f2943e530aa62d04a8
F src/sqlite.h.in e80973893802ec7980a602a449c93527f9265f1295ad156c83cbb48f9b58ce4e
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
F src/sqlite3ext.h 9ecc93b8493bd20c0c07d52e2ac0ed8bab9b549c7f7955b59869597b650dd8b5
F src/sqliteInt.h e989d94d02e4389480e7abf4d86dbdd23d94f3e15db77c1424b67c75f8d97428
F src/sqliteInt.h dc9ec3b8754d28700d32302291c03fe048198fa1c8c491c3515cb41759e77e35
F src/sqliteLimit.h 1513bfb7b20378aa0041e7022d04acb73525de35b80b252f1b83fedb4de6a76b
F src/status.c 46e7aec11f79dad50965a5ca5fa9de009f7d6bde08be2156f1538a0a296d4d0e
F src/table.c b46ad567748f24a326d9de40e5b9659f96ffff34
F src/tclsqlite.c cfe7f93daf9d8787f65e099efb67d7cdfc2c35236dec5d3f6758520bd3519424
F src/test1.c f57c229ad7878215d0b3bb5d59ffe94772c099ce5b5e147a4a59d3157923a988
F src/test1.c f4e0be5c344587b2beac474a58018a3833208fb6bbec35d37d58b1270a7a5917
F src/test2.c 3efb99ab7f1fc8d154933e02ae1378bac9637da5
F src/test3.c 61798bb0d38b915067a8c8e03f5a534b431181f802659a6616f9b4ff7d872644
F src/test4.c 405834f6a93ec395cc4c9bb8ecebf7c3d8079e7ca16ae65e82d01afd229694bb
@@ -549,8 +549,8 @@ F src/test_blob.c ae4a0620b478548afb67963095a7417cd06a4ec0a56adb453542203bfdcb31
F src/test_btree.c 8b2dc8b8848cf3a4db93f11578f075e82252a274
F src/test_config.c 5ebafbcd5c75ac1c16bb0c8fe926dc325cc03e780943a88ca50e0d9a4fc4d2f5
F src/test_delete.c e2fe07646dff6300b48d49b2fee2fe192ed389e834dd635e3b3bac0ce0bf9f8f
F src/test_demovfs.c 86142ba864d4297d54c5b2e972e74f3141ae4b30f05b3a95824184ed2d3d7f91
F src/test_devsym.c 6109b45c3db3ef7b002320947ed448c027356ab8b885156ff535fd8684d4a571
F src/test_demovfs.c a0c3bdd45ed044115c2c9f7779e56eafff18741e
F src/test_devsym.c 1960abbb234b97e9b920f07e99503fc04b443f62bbc3c6ff2c2cea2133e3b8a2
F src/test_fs.c ba1e1dc18fd3159fdba0b9c4256f14032159785320dfbd6776eb9973cb75d480
F src/test_func.c 181f992e5495644434c4f0e3cc72362a78c295eb2cf3ff4d02498b8bde7aa276
F src/test_hexio.c 1d4469ca61ab202a1fcec6543f584d2407205e8d
@@ -594,25 +594,25 @@ F src/upsert.c 0dd81b40206841814d46942a7337786932475f085716042d0cb2fc7791bf8ca4
F src/utf.c 2f0fac345c7660d5c5bd3df9e9d8d33d4c27f366bcfb09e07443064d751a0507
F src/util.c aef606a78b85d042138a841babbc0f98471b19b9a340b962e8fae307bc8cf3da
F src/vacuum.c 82dcec9e7b1afa980288718ad11bc499651c722d7b9f32933c4d694d91cb6ebf
F src/vdbe.c 0f2927b83545c544b6804ce46a1f5f9b6f135a4dab71287269c8f95fe73a8437
F src/vdbe.c 42a7966812a5c3305cadd3e1060a0e962d6674e4a647fcc153e8693ecf59af74
F src/vdbe.h 712bca562eaed1c25506b9faf9680bdc75fc42e2f4a1cd518d883fa79c7a4237
F src/vdbeInt.h 889c52272a02cea8af6e21b493b08bc9a043e3372a77fdfe838d25e73a47ac92
F src/vdbeInt.h 3ba14553508d66f58753952d6dd287dce4ec735de02c6440858b4891aed51c17
F src/vdbeapi.c f9161e5c77f512fbb80091ce8af621d19c9556bda5e734cffaac1198407400da
F src/vdbeaux.c eb2b67dcf65e71fd11d977961220f9d1888fb60bbf3730eb60ff971c68dc7dd5
F src/vdbeaux.c 3a803d75875031309204df90977059b12ffb706d16b4baa5e2d99f4353962582
F src/vdbeblob.c f5c70f973ea3a9e915d1693278a5f890dc78594300cf4d54e64f2b0917c94191
F src/vdbemem.c f6f277d17d50972571d1394535d4c3d156fdea871d8f327f5b9479984054015a
F src/vdbemem.c c970d2b480beca04f9a6a70be70acf07aa1aa261f7a723e5beb986d1a83cd851
F src/vdbesort.c 66592d478dbb46f19aed0b42222325eadb84deb40a90eebe25c6e7c1d8468f47
F src/vdbetrace.c fa3bf238002f0bbbdfb66cc8afb0cea284ff9f148d6439bc1f6f2b4c3b7143f0
F src/vtab.c 1fa256c6ddad7a81e2a4dc080d015d4b0a7135767717d311298e47f6fca64bb3
F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
F src/wal.c b09a2a9cab50efa08451a8c81d47052120ad5da174048c6d0b08d405384abdf2
F src/wal.h 606292549f5a7be50b6227bd685fa76e3a4affad71bb8ac5ce4cb5c79f6a176a
F src/walker.c ccbe57a6eeedce5826510c509cebb547e0c877d53f14b3118698643057d4b597
F src/where.c 2f11eeb14335b7640f886b2fb441f54a94c35ab5cde8b53461a1074bfd587081
F src/walker.c 7607f1a68130c028255d8d56094ea602fc402c79e1e35a46e6282849d90d5fe4
F src/where.c 99c7b718ef846ac952016083aaf4e22ede2290beceaf4730a2df55c023251369
F src/whereInt.h 1b728f71654ebf8421a1715497a587f02d6f538e819af58dc826908f8577e810
F src/wherecode.c 37a1004237d630d785c47bba2290eac652a7a8b0047518eba3cb7c808b604c4a
F src/whereexpr.c 5e559bdd24b06e3bc2e68f258bf751302954dc1e432daf71fdd8098a71462326
F src/window.c 6cfb1b3c821a4cb2c6f262c6a61cd400a2803b390370e3d45d7e59b9f38e61da
F src/whereexpr.c d0683adb125754b3edd44d7c73fa2e4ea175eaacd900f1dc6993da2f6f0149cc
F src/window.c 5be2cf7d8763cc97137fc44d015aed8a1a4a56fe9700d7933ed560172617c756
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
F test/affinity2.test a6d901b436328bd67a79b41bb0ac2663918fe3bd
F test/affinity3.test 6a101af2fc945ce2912f6fe54dd646018551710d
@@ -632,7 +632,7 @@ F test/altermalloc.test 167a47de41b5c638f5f5c6efb59784002b196fff70f98d9b4ed3cd74
F test/altermalloc2.test fa7b1c1139ea39b8dec407cf1feb032ca8e0076bd429574969b619175ad0174b
F test/altertab.test b6901287474841cffbd8f90b098d3bd7d8445868b42caeb01b27034698f7245f
F test/altertab2.test 8883693952f6d7fb5f754dbf1d694ed780aa883027bef04cb1fb99a3b88c9272
F test/altertab3.test 7a2419829b2b908985b2c83d680388ef2eb9a74e446b68cee7b9b1551ae69078
F test/altertab3.test 6909f4f31e5fd5622f3ea382b1865e1853fd01cc3f7e6be45e8d10457e7ccf3d
F test/amatch1.test b5ae7065f042b7f4c1c922933f4700add50cdb9f
F test/analyze.test 7168c8bffa5d5cbc53c05b7e9c7fcdd24b365a1bc5046ce80c45efa3c02e6b7c
F test/analyze3.test ff62d9029e6deb2c914490c6b00caf7fae47cc85cdc046e4a0d0a4d4b87c71d8
@@ -672,7 +672,7 @@ F test/autoindex1.test 96185415f5faacd5b8d7a7f505efddd5abb1f111d58338e9c0b1dc40b
F test/autoindex2.test 12ef578928102baaa0dc23ad397601a2f4ecb0df
F test/autoindex3.test 2dd997d6590438b53e4f715f9278aa91c9299cf3f81246a0915269c35beb790e
F test/autoindex4.test 49d3cd791a9baa16fb461d7ea3de80d019a819cf
F test/autoindex5.test a5d72fe8c217cc0ea356dc6fa06a282a8a3fc53aa807709d79dba07a8f248102
F test/autoindex5.test 1d8c1134e1488a35c6fa205b2f52e72fc220972d946c59492d10bba01d6fecd4
F test/autovacuum.test 0831cd34e14695d297187f7f6519265e3121c5b0a1720e548e86829e796129e9
F test/autovacuum_ioerr2.test 8a367b224183ad801e0e24dcb7d1501f45f244b4
F test/avtrans.test b7dc25459ecbd86c6fa9c606ee3068f59d81e225118617dcf2bbb6ded2ade89e
@@ -692,7 +692,7 @@ F test/bestindex3.test 7622e792ff2da16d262d3cea6ad914591ac4806d57ed128e6c940b792
F test/bestindex4.test 038e3d0789332f3f1d61474f9bbc9c6d08c6bd1783a978f31f38ad82688de601
F test/bestindex5.test 67c1166131bb59f9e47c00118f7d432ca5491e6cae6ca3f87ca9db20103a78f9
F test/bestindex6.test d856a9bb63d927493575823eed44053bc36251e241aa364e54d0f2a2d302e1d4
F test/between.test 68137a6e941c221417c15b6fe2d55f27bb1b6ab48bdf9e2aa51efdd85bc53802
F test/between.test 34d375fb5ce1ae283ffe82b6b233e9f38e84fc6c
F test/bigfile.test aa74f4e5db51c8e54a1d9de9fa65d01d1eb20b59
F test/bigfile2.test 1b489a3a39ae90c7f027b79110d6b4e1dbc71bfc
F test/bigmmap.test 31dad31573638bd32de866cdefd11843f75685be4ba6aec1a47918f098f1899b
@@ -723,14 +723,14 @@ F test/capi3b.test efb2b9cfd127efa84433cd7a2d72ce0454ae0dc4
F test/capi3c.test 54e2dc0c8fd7c34ad1590d1be6864397da2438c95a9f5aee2f8fbc60c112e44b
F test/capi3d.test aba917805573a03deed961a21f07a5a84505ad0a616f7e3fc1508844a15bccc4
F test/capi3e.test 3d49c01ef2a1a55f41d73cba2b23b5059ec460fe
F test/cast.test 3619f0c58c2e4b2a94aa86e75607e497d34ef40ab74418e71aef7b4ca5155895
F test/cast.test 2067a08edfe4ded14d0eb845731716d397df78d65b69d8045d25950ad9bffad9
F test/cffault.test 9d6b20606afe712374952eec4f8fd74b1a8097ef
F test/check.test dcc952a127c394ce0de2aa634d26c78207e855327cc63a24d3638ca8fbfa641e
F test/chunksize.test 427d87791743486cbf0c3b8c625002f3255cb3a89c6eba655a98923b1387b760
F test/close.test 799ea4599d2f5704b0a30f477d17c2c760d8523fa5d0c8be4a7df2a8cad787d8
F test/closure01.test 9905883f1b171a4638f98fc764879f154e214a306d3d8daf412a15e7f3a9b1e0
F test/coalesce.test cee0dccb9fbd2d494b77234bccf9dc6c6786eb91
F test/collate1.test f9b653f515ef3324a0c4e3c6adbf136bb1903622af678d482a60c11c9c054e6c
F test/collate1.test 08c18e7512a5a32c97938854263fa15362eeb846
F test/collate2.test 9aaa410a00734e48bcb27f3872617d6f69b2a621
F test/collate3.test 89defc49983ddfbf0a0555aca8c0521a676f56a5
F test/collate4.test c953715fb498b87163e3e73dd94356bff1f317bd
@@ -795,7 +795,7 @@ F test/dbdata.test 042f49acff3438f940eeba5868d3af080ae64ddf26ae78f80c92bec3ca7d8
F test/dbfuzz.c 73047c920d6210e5912c87cdffd9a1c281d4252e
F test/dbfuzz001.test e32d14465f1c77712896fda6a1ccc0f037b481c191c1696a9c44f6c9e4964faf
F test/dbfuzz2-seed1.db e6225c6f3d7b63f9c5b6867146a5f329d997ab105bee64644dc2b3a2f2aebaee
F test/dbfuzz2.c b93db9056ad057733463ba333f89d2d195a95155805065c5962422955d7fb011
F test/dbfuzz2.c 6c355cf70c4a308b1b84a11a65282bcac5b4038db77de5cfc8ad080ef371f109
F test/dbpage.test 650234ba683b9d82b899c6c51439819787e7609f17a0cc40e0080a7b6443bc38
F test/dbstatus.test cd83aa623b8aab477269bc94cf8aa90c1e195a144561dd04a1620770aaa8524e
F test/dbstatus2.test f5fe0afed3fa45e57cfa70d1147606c20d2ba23feac78e9a172f2fe8ab5b78ef
@@ -821,7 +821,7 @@ F test/e_createtable.test 1c602347e73ab80b11b9fa083f47155861aaafcff8054aac9e0b76
F test/e_delete.test ab39084f26ae1f033c940b70ebdbbd523dc4962e
F test/e_droptrigger.test 3cd080807622c13e5bbb61fc9a57bd7754da2412
F test/e_dropview.test 21ce09c361227ddbc9819a5608ee2700c276bdd5
F test/e_expr.test e6048fe3901241799c4315bdd625f39dae790ff089c454979ca85f03b644dc6f
F test/e_expr.test 628c1c5990e7df71bee17c83afcf59f31c3d34914b829ac098ee3a72b2f1d061
F test/e_fkey.test 2febb2084aef9b0186782421c07bc9d377abf067c9cb4efd49d9647ae31f5afe
F test/e_fts3.test 17ba7c373aba4d4f5696ba147ee23fd1a1ef70782af050e03e262ca187c5ee07
F test/e_insert.test f02f7f17852b2163732c6611d193f84fc67bc641fb4882c77a464076e5eba80e
@@ -856,9 +856,6 @@ F test/extraquick.test cb254400bd42bfb777ff675356aabf3287978f79
F test/fallocate.test 37a62e396a68eeede8f8d2ecf23573a80faceb630788d314d0a073d862616717
F test/filectrl.test 6e871c2d35dead1d9a88e176e8d2ca094fec6bb3
F test/filefmt.test f393e80c4b8d493b7a7f8f3809a8425bbf4292af1f5140f01cb1427798a2bbd4
F test/filter1.test 5830d6214399abb874f2c0293d299b8cbd02d56b8e529e509befd322f1bc2003
F test/filter2.tcl 44e525497ce07382915f01bd29ffd0fa49dab3adb87253b5e5103ba8f93393e8
F test/filter2.test 485cf95d1f6d6ceee5632201ca52a71868599836f430cdee42e5f7f14666e30a
F test/fkey1.test d11dbb8a93ead9b5c46ae5d02da016d61245d47662fb2d844c99214f6163f768
F test/fkey2.test d35d1c81e7569bdd2b872e91750f7098117d2e8291369f70b7e3d50a0e523dc2
F test/fkey3.test 76d475c80b84ee7a5d062e56ccb6ea68882e2b49
@@ -1009,7 +1006,7 @@ F test/fuzzdata4.db b502c7d5498261715812dd8b3c2005bad08b3a26e6489414bd13926cd3e4
F test/fuzzdata5.db e35f64af17ec48926481cfaf3b3855e436bd40d1cfe2d59a9474cb4b748a52a5
F test/fuzzdata6.db 92a80e4afc172c24f662a10a612d188fb272de4a9bd19e017927c95f737de6d7
F test/fuzzdata7.db babb1c560fef766171972c119c1bc3b7be20b134e2f46ae0c52390cd3059b6f4
F test/fuzzdata8.db c69ca6d4bf1b25fd56ab432e9b96f2db0da752cfc6aa32700867f3a2d8a0514a
F test/fuzzdata8.db 7f8f849d767a2935ea37a417794672d0508171835a39a55032f490b372732222
F test/fuzzer1.test 3d4c4b7e547aba5e5511a2991e3e3d07166cfbb8
F test/fuzzer2.test a85ef814ce071293bce1ad8dffa217cbbaad4c14
F test/fuzzerfault.test 8792cd77fd5bce765b05d0c8e01b9edcf8af8536
@@ -1090,7 +1087,7 @@ F test/jrnlmode3.test 556b447a05be0e0963f4311e95ab1632b11c9eaa
F test/json101.test 8f8977b00ba02f9a26c1d1f52f29f540f6d5eb162cbd5eb78bb805366d4ab26d
F test/json102.test eeb54efa221e50b74a2d6fb9259963b48d7414dca3ce2fdfdeed45cb28487bc1
F test/json103.test aff6b7a4c17d5a20b487a7bc1a274bfdc63b829413bdfb83bedac42ec7f67e3b
F test/json104.test cf0dbd220cba81e6c3cf8bc326e2321049cec05ab0b529308d76f28a52529800
F test/json104.test 877d5845f6303899b7889ea5dd1bea99076e3100574d5c536082245c5805dcaa
F test/keyword1.test 37ef6bba5d2ed5b07ecdd6810571de2956599dff
F test/kvtest.c 94da54bb66aae7a54e47cf7e4ea4acecc0f217560f79ad3abfcc0361d6d557ba
F test/lastinsert.test 42e948fd6442f07d60acbd15d33fb86473e0ef63
@@ -1098,7 +1095,7 @@ F test/laststmtchanges.test ae613f53819206b3222771828d024154d51db200
F test/lemon-test01.y 58b764610fd934e189ffbb0bbfa33d171b9cb06019b55bdc04d090d6767e11d7
F test/like.test 5013f18e7242fe118524fcf8e484b8827bcd5906b509d106f3587c7bfcf274ae
F test/like2.test 3b2ee13149ba4a8a60b59756f4e5d345573852da
F test/like3.test 62bf82ac674b7d4126e73532e1ad96cdcd8e1752a4ed90b28a6f98305f5a66aa
F test/like3.test ac61947ef35bde9d97718bcfa04659a17d9218f1fffc4104b135b3f82ed43836
F test/limit.test 0c99a27a87b14c646a9d583c7c89fd06c352663e
F test/limit2.test 9409b033284642a859fafc95f29a5a6a557bd57c1f0d7c3f554bd64ed69df77e
F test/loadext.test faa4f6eed07a5aac35d57fdd7bc07f8fc82464cfd327567c10cf0ba3c86cde04
@@ -1213,7 +1210,7 @@ F test/parser1.test 6ccdf5e459a5dc4673d3273dc311a7e9742ca952dd0551a6a6320d27035c
F test/pcache.test c8acbedd3b6fd0f9a7ca887a83b11d24a007972b
F test/pcache2.test af7f3deb1a819f77a6d0d81534e97d1cf62cd442
F test/percentile.test 4243af26b8f3f4555abe166f723715a1f74c77ff
F test/permutations.test 4282fb00e5ac0f8c2cd1be62652f6da4ac03ce3c58b7d785fa17f4684492a0e0
F test/permutations.test b8f0da2f53ef1bd7ff149a140ee625aa7276c94ae15eb9acc2d8ed4af8f22b13
F test/pg_common.tcl 4740dc35190d6acdab14c097783331361301ab504a94d948f6afbb56ce0a51e8
F test/pragma.test cf066fe0f7f5d49f4758de4986407b8676c61aaa7871599340d64f42a8edc352
F test/pragma2.test e5d5c176360c321344249354c0c16aec46214c9f
@@ -1232,7 +1229,7 @@ F test/quick.test 1681febc928d686362d50057c642f77a02c62e57
F test/quota-glob.test 32901e9eed6705d68ca3faee2a06b73b57cb3c26
F test/quota.test bfb269ce81ea52f593f9648316cd5013d766dd2a
F test/quota2.test 7dc12e08b11cbc4c16c9ba2aa2e040ea8d8ab4b8
F test/quote.test 626149eda89ee64d81a3790de370f9f0211921b11568a49c28c861f394330508
F test/quote.test 8258838e5135ff1034e4de929d14bfb5bdd73d2df5a2281404ae79d927b8fa70
F test/randexpr1.tcl 40dec52119ed3a2b8b2a773bce24b63a3a746459
F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df
F test/rbu.test 168573d353cd0fd10196b87b0caa322c144ef736
@@ -1241,8 +1238,8 @@ F test/recover.test ccb8c2623902a92ebb76770edd075cb4f75a4760bb7afde38026572c6e79
F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8
F test/regexp2.test 40e894223b3d6672655481493f1be12012f2b33c
F test/reindex.test cd9d6021729910ece82267b4f5e1b5ac2911a7566c43b43c176a6a4732e2118d
F test/releasetest.tcl 968fc1e8fd23e113fb8a04379747f3a9f2c12d207b2de85aeff5a825962e1cd7 x
F test/releasetest_data.tcl 146a73e8c8212f962b6558fee0711b895f11b607ee0610e6910781dc8f83797d
F test/releasetest.tcl 204efd3a87ec1d62da2efde42c673b18b955350a9d3c6ac0b4dbba5bc8595808 x
F test/releasetest_data.tcl c3746248b5ad8f99a29020f83501bb25e024156ecc37e05c71c76da4fc8601c6
F test/resetdb.test 8062cf10a09d8c048f8de7711e94571c38b38168db0e5877ba7561789e5eeb2b
F test/resolver01.test f4022acafda7f4d40eca94dbf16bc5fc4ac30ceb
F test/rollback.test 06680159bc6746d0f26276e339e3ae2f951c64812468308838e0a3362d911eaa
@@ -1368,7 +1365,7 @@ F test/stmt.test 54ed2cc0764bf3e48a058331813c3dbd19fc1d0827c3d8369914a5d8f564ec7
F test/stmtvtab1.test 6873dfb24f8e79cbb5b799b95c2e4349060eb7a3b811982749a84b359468e2d5
F test/subjournal.test 8d4e2572c0ee9a15549f0d8e40863161295107e52f07a3e8012a2e1fdd093c49
F test/subquery.test d7268d193dd33d5505df965399d3a594e76ae13f
F test/subquery2.test 90cf944b9de8204569cf656028391e4af1ccc8c0cc02d4ef38ee3be8de1ffb12
F test/subquery2.test 8250dfd6a773b04c7a5c37ac63276f62b329157ce171244d0cbe1acc365e3303
F test/subselect.test 0966aa8e720224dbd6a5e769a3ec2a723e332303
F test/substr.test 18f57c4ca8a598805c4d64e304c418734d843c1a
F test/subtype1.test 7fe09496352f97053af1437150751be2d0a0cae8
@@ -1430,7 +1427,7 @@ F test/tkt-5e10420e8d.test 904d1687b3c06d43e5b3555bbcf6802e7c0ffd84
F test/tkt-5ee23731f.test 9db6e1d7209dc0794948b260d6f82b2b1de83a9f
F test/tkt-6bfb98dfc0.test 24780633627b5cfc0635a5500c2389ebfb563336
F test/tkt-752e1646fc.test ea78d88d14fe9866bdd991c634483334639e13bf
F test/tkt-78e04e52ea.test cb44d0f5e7940223be740a39913a1b9b9b30d7e4a17ed3349141f893bae1b8f2
F test/tkt-78e04e52ea.test 1b5be1bac961833a9fd70fe50738cb4064822c61f82c54f7d488435ec806ea62
F test/tkt-7a31705a7e6.test 9e9c057b6a9497c8f7ba7b16871029414ccf6550e7345d9085d6d71c9a56bb6f
F test/tkt-7bbfb7d442.test 7b2cd79c7a17ae6750e75ec1a7846712a69c9d18
F test/tkt-80ba201079.test 105a721e6aad0ae3c5946d7615d1e4d03f6145b8
@@ -1609,7 +1606,7 @@ F test/vacuummem.test 7b42abb3208bd82dd23a7536588396f295a314f2
F test/varint.test bbce22cda8fc4d135bcc2b589574be8410614e62
F test/veryquick.test 57ab846bacf7b90cf4e9a672721ea5c5b669b661
F test/view.test 40d54c9ddf5b9fdee692bf936d3352159fe467838f92742aa1d08c7c7d1eac73
F test/vtab1.test 47b935205d7b6290765973abd6fce0e13e94e040017099170f43f81886efa5ba
F test/vtab1.test 60b4f70aafa6078d6fdfc11417af3bd216d7ef5eafce16707a6ca3dae5166d20
F test/vtab2.test 14d4ab26cee13ba6cf5c5601b158e4f57552d3b055cdd9406cf7f711e9c84082
F test/vtab3.test b45f47d20f225ccc9c28dc915d92740c2dee311e
F test/vtab4.test 8e73ed268f3d596bc3590f45fc948fb40f28e9c3
@@ -1624,7 +1621,7 @@ F test/vtabC.test 4528f459a13136f982e75614d120aef165f17292
F test/vtabD.test 05b3f1d77117271671089e48719524b676842e96
F test/vtabE.test 2a143fe75a11275781d1fd1988d86b66a3f69cb98f4add62e3da8fd0f637b45f
F test/vtabF.test 1918844c7c902f6a16c8dacf1ec8f84886d6e78b
F test/vtabH.test e65540eed0f7434cdf0b160374570b51f3e3179548f0fa5e99b1d33f8dcdf9a0
F test/vtabH.test 3cf9aa1c1c4381b3b3ac33f933376f06fbb99d2294a83c79b7562d3ed87be450
F test/vtabI.test 751b07636700dbdea328e4265b6077ccd6811a3f
F test/vtabJ.test d7b73675708cf63cfcb9d443bb451fc01a028347275b7311e51f9fdf3ca6757f
F test/vtab_alter.test 736e66fb5ec7b4fee58229aa3ada2f27ec58bc58c00edae4836890c3784c6783
@@ -1667,7 +1664,7 @@ F test/walslow.test c05c68d4dc2700a982f89133ce103a1a84cc285f
F test/walthread.test 14b20fcfa6ae152f5d8e12f5dc8a8a724b7ef189f5d8ef1e2ceab79f2af51747
F test/walvfs.test c0faffda13d045a96dfc541347886bb1a3d6f3205857fc98e683edfab766ea88
F test/wapp.tcl b440cd8cf57953d3a49e7ee81e6a18f18efdaf113b69f7d8482b0710a64566ec
F test/wapptest.tcl 56d2b7974ecd8cca3189a670f757306d5ff3334cc9fe3744f7a6ad7ae4380e8c x
F test/wapptest.tcl f387e81750b2938ccf445b8a061541626a4a31f55e9e500b3e38ef3ce177bc61 x
F test/where.test 0607caa5a1fbfe7b93b95705981b463a3a0408038f22ae6e9dc11b36902b0e95
F test/where2.test 478d2170637b9211f593120648858593bf2445a1
F test/where3.test 2341a294e17193a6b1699ea7f192124a5286ca6acfcc3f4b06d16c931fbcda2c
@@ -1699,8 +1696,8 @@ F test/win32lock.test fbf107c91d8f5512be5a5b87c4c42ab9fdd54972
F test/win32longpath.test 169c75a3b2e43481f4a62122510210c67b08f26d
F test/win32nolock.test ac4f08811a562e45a5755e661f45ca85892bdbbc
F test/window1.test 8d453bfaa3f8f0873ba16ca1270c7368f18445065a0003a1b5954ac4e95797b4
F test/window2.tcl a44834af6267be6e14882311ef8790bf5047f1b9bc25685ee1762d48dc24f1e7
F test/window2.test 2f3ae63e171dce7f2ac29a41020f4da413b1d7bdaba48ee124fd336b152e34c5
F test/window2.tcl 0c2918ef2a1640553fd791972d458356808a608418c64c02a0a379cecfc7fb0d
F test/window2.test 96ef949f0197c025652f6c6e5812cdbfb948989bd40cf79cbb02104249a89513
F test/window3.tcl acea6e86a4324a210fd608d06741010ca83ded9fde438341cb978c49928faf03
F test/window3.test e9959a993c8a71e96433be8daaa1827d78b8921e4f12debd7bdbeb3c856ef3cb
F test/window4.tcl 5fbaab489677914ee5686b2008426e336daf88a2f58be7df92757f780a5ebf91
@@ -1711,10 +1708,9 @@ F test/window7.tcl 6a1210f05d40ec89c22960213a22cd3f98d4e2f2eb20646c83c8c30d4d761
F test/window7.test ce7f865241fdd1c5c4db869cd7bb2986c3be836bc2e73649a6846dd920f63e0f
F test/window8.tcl 9e9a82ae9eea90a4a83481d641a812b974980c38f9247f3b89a6e3c8bed45518
F test/window8.test df187dc19921f7be0ab709d531d681bd80ccaac96a913a89ecee8b272b91d43f
F test/window9.test 06495ac733843849b1fca8a79d13ba330d04aba02099703198af2ba7e231f90c
F test/windowerr.tcl abf4d6d0c6d360213af98ed7d538295d905689e83692106f3ece0e3afb9d7f36
F test/windowerr.test 675b5e6debfc9370bfacb0b91e2a93a8923512f92600b16f4ea70a1cd9b8e6e4
F test/windowfault.test 403693d7d951c5473f052f7ecddb61ed15ac9d212f238b8904ea270ba90f83e5
F test/windowfault.test 16e906a2c4110c88372ff4bd5de59ac7397ec2f025912eff8e5677eedd126898
F test/with1.test d32792084dcb5f6c047d77bb8a032822ef9fe050ade07d0aeffa37753a05e3c9
F test/with2.test e0030e2f0267a910d6c0e4f46f2dfe941c1cc0d4f659ba69b3597728e7e8f1ab
F test/with3.test b5f1372097690c6ef84db2f13fc7e64a88c7263c3f88493605f90597e8a68d45
@@ -1834,7 +1830,10 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 86ab963cc5743867e0535b78a5776e18c13835aa44bf2009f77642df8407cb3f
R 7f5ccdaf1d791cabe4704b7e56f0cde3
U dan
Z d18b0c3413514388f116d5ed56fe7aa4
P 5c6146b56a75a94f4baa10e95407c54dd0b9314a57a8702a4b96b15c4d7ac48c
R 32970911aa181195f7f2f26ab5229a78
T *branch * negative-zero
T *sym-negative-zero *
T -sym-trunk *
U drh
Z c775e1b0e8bc7632b27bc5f73f887bcc
+1 -1
View File
@@ -1 +1 @@
5dac8c38dfc3f41c5c8fb49ca35de7fd1b21f269d72e8ba6ba59ed0a4030a54d
6ba4be66be90799ab0e1edc08c5c09bea239a85027ad0ca1f42818fc2580af4d
+4 -13
View File
@@ -731,20 +731,11 @@ static int renameUnmapExprCb(Walker *pWalker, Expr *pExpr){
** Walker callback used by sqlite3RenameExprUnmap().
*/
static int renameUnmapSelectCb(Walker *pWalker, Select *p){
Parse *pParse = pWalker->pParse;
int i;
if( ALWAYS(p->pEList) ){
ExprList *pList = p->pEList;
for(i=0; i<pList->nExpr; i++){
if( pList->a[i].zName ){
sqlite3RenameTokenRemap(pParse, 0, (void*)pList->a[i].zName);
}
}
}
if( ALWAYS(p->pSrc) ){ /* Every Select as a SrcList, even if it is empty */
SrcList *pSrc = p->pSrc;
for(i=0; i<pSrc->nSrc; i++){
sqlite3RenameTokenRemap(pParse, 0, (void*)pSrc->a[i].zName);
Parse *pParse = pWalker->pParse;
int i;
for(i=0; i<p->pSrc->nSrc; i++){
sqlite3RenameTokenRemap(pParse, 0, (void*)p->pSrc->a[0].zName);
}
}
return WRC_Continue;
+4 -4
View File
@@ -8307,13 +8307,11 @@ static int balance(BtCursor *pCur){
VVA_ONLY( int balance_deeper_called = 0 );
do {
int iPage;
int iPage = pCur->iPage;
MemPage *pPage = pCur->pPage;
if( NEVER(pPage->nFree<0) && btreeComputeFreeSpace(pPage) ) break;
if( pPage->nOverflow==0 && pPage->nFree<=nMin ){
break;
}else if( (iPage = pCur->iPage)==0 ){
if( iPage==0 ){
if( pPage->nOverflow ){
/* The root page of the b-tree is overfull. In this case call the
** balance_deeper() function to create a new child for the root-page
@@ -8334,6 +8332,8 @@ static int balance(BtCursor *pCur){
}else{
break;
}
}else if( pPage->nOverflow==0 && pPage->nFree<=nMin ){
break;
}else{
MemPage * const pParent = pCur->apPage[iPage-1];
int const iIdx = pCur->aiIdx[iPage-1];
+3 -7
View File
@@ -618,14 +618,10 @@ static void SQLITE_NOINLINE deleteTable(sqlite3 *db, Table *pTable){
#ifdef SQLITE_DEBUG
/* Record the number of outstanding lookaside allocations in schema Tables
** prior to doing any free() operations. Since schema Tables do not use
** lookaside, this number should not change.
**
** If malloc has already failed, it may be that it failed while allocating
** a Table object that was going to be marked ephemeral. So do not check
** that no lookaside memory is used in this case either. */
** prior to doing any free() operations. Since schema Tables do not use
** lookaside, this number should not change. */
int nLookaside = 0;
if( db && !db->mallocFailed && (pTable->tabFlags & TF_Ephemeral)==0 ){
if( db && (pTable->tabFlags & TF_Ephemeral)==0 ){
nLookaside = sqlite3LookasideUsed(db, 0);
}
#endif
+1 -1
View File
@@ -14,7 +14,7 @@
** SQLite was built with.
*/
#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS /* IMP: R-16824-07538 */
#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
/*
** Include the configuration header output by 'configure' if we're using the
+18 -20
View File
@@ -1040,18 +1040,15 @@ static SQLITE_NOINLINE void sqlite3ExprDeleteNN(sqlite3 *db, Expr *p){
assert( p->x.pList==0 || p->pRight==0 );
if( p->pLeft && p->op!=TK_SELECT_COLUMN ) sqlite3ExprDeleteNN(db, p->pLeft);
if( p->pRight ){
assert( !ExprHasProperty(p, EP_WinFunc) );
sqlite3ExprDeleteNN(db, p->pRight);
}else if( ExprHasProperty(p, EP_xIsSelect) ){
assert( !ExprHasProperty(p, EP_WinFunc) );
sqlite3SelectDelete(db, p->x.pSelect);
}else{
sqlite3ExprListDelete(db, p->x.pList);
#ifndef SQLITE_OMIT_WINDOWFUNC
if( ExprHasProperty(p, EP_WinFunc) ){
sqlite3WindowDelete(db, p->y.pWin);
}
#endif
}
if( ExprHasProperty(p, EP_WinFunc) ){
assert( p->op==TK_FUNCTION );
sqlite3WindowDelete(db, p->y.pWin);
}
}
if( ExprHasProperty(p, EP_MemToken) ) sqlite3DbFree(db, p->u.zToken);
@@ -1335,9 +1332,8 @@ static With *withDup(sqlite3 *db, With *p){
** objects found there, assembling them onto the linked list at Select->pWin.
*/
static int gatherSelectWindowsCallback(Walker *pWalker, Expr *pExpr){
if( pExpr->op==TK_FUNCTION && ExprHasProperty(pExpr, EP_WinFunc) ){
assert( pExpr->y.pWin );
assert( IsWindowFunc(pExpr) );
if( pExpr->op==TK_FUNCTION && pExpr->y.pWin!=0 ){
assert( ExprHasProperty(pExpr, EP_WinFunc) );
pExpr->y.pWin->pNextWin = pWalker->u.pSelect->pWin;
pWalker->u.pSelect->pWin = pExpr->y.pWin;
}
@@ -3391,8 +3387,7 @@ void sqlite3ExprCodeMove(Parse *pParse, int iFrom, int iTo, int nReg){
** register iReg. The caller must ensure that iReg already contains
** the correct value for the expression.
*/
static void exprToRegister(Expr *pExpr, int iReg){
Expr *p = sqlite3ExprSkipCollate(pExpr);
static void exprToRegister(Expr *p, int iReg){
p->op2 = p->op;
p->op = TK_REGISTER;
p->iTable = iReg;
@@ -4843,17 +4838,20 @@ int sqlite3ExprCompare(Parse *pParse, Expr *pA, Expr *pB, int iTab){
return 2;
}
if( pA->op!=TK_COLUMN && pA->op!=TK_AGG_COLUMN && pA->u.zToken ){
if( pA->op==TK_FUNCTION || pA->op==TK_AGG_FUNCTION ){
if( pA->op==TK_FUNCTION ){
if( sqlite3StrICmp(pA->u.zToken,pB->u.zToken)!=0 ) return 2;
#ifndef SQLITE_OMIT_WINDOWFUNC
assert( pA->op==pB->op );
if( ExprHasProperty(pA,EP_WinFunc)!=ExprHasProperty(pB,EP_WinFunc) ){
return 2;
}
/* Justification for the assert():
** window functions have p->op==TK_FUNCTION but aggregate functions
** have p->op==TK_AGG_FUNCTION. So any comparison between an aggregate
** function and a window function should have failed before reaching
** this point. And, it is not possible to have a window function and
** a scalar function with the same name and number of arguments. So
** if we reach this point, either A and B both window functions or
** neither are a window functions. */
assert( ExprHasProperty(pA,EP_WinFunc)==ExprHasProperty(pB,EP_WinFunc) );
if( ExprHasProperty(pA,EP_WinFunc) ){
if( sqlite3WindowCompare(pParse, pA->y.pWin, pB->y.pWin, 1)!=0 ){
return 2;
}
if( sqlite3WindowCompare(pParse,pA->y.pWin,pB->y.pWin)!=0 ) return 2;
}
#endif
}else if( pA->op==TK_NULL ){
+1 -8
View File
@@ -153,15 +153,8 @@ const unsigned char sqlite3CtypeMap[256] = {
** SQLITE_ALLOW_COVERING_INDEX_SCAN compile-time option, or is "on" if
** that compile-time option is omitted.
*/
#if !defined(SQLITE_ALLOW_COVERING_INDEX_SCAN)
#ifndef SQLITE_ALLOW_COVERING_INDEX_SCAN
# define SQLITE_ALLOW_COVERING_INDEX_SCAN 1
#else
# if !SQLITE_ALLOW_COVERING_INDEX_SCAN
# error "Compile-time disabling of covering index scan using the\
-DSQLITE_ALLOW_COVERING_INDEX_SCAN=0 option is deprecated.\
Contact SQLite developers if this is a problem for you, and\
delete this #error macro to continue with your build."
# endif
#endif
/* The minimum PMA size is set to this value multiplied by the database
+1 -1
View File
@@ -1425,7 +1425,7 @@ void sqlite3GenerateConstraintChecks(
}else{
char *zName = pCheck->a[i].zName;
if( zName==0 ) zName = pTab->zName;
if( onError==OE_Replace ) onError = OE_Abort; /* IMP: R-26383-51744 */
if( onError==OE_Replace ) onError = OE_Abort; /* IMP: R-15569-63625 */
sqlite3HaltConstraint(pParse, SQLITE_CONSTRAINT_CHECK,
onError, zName, P4_TRANSIENT,
P5_ConstraintCheck);
+30 -54
View File
@@ -845,9 +845,6 @@ int sqlite3_db_config(sqlite3 *db, int op, ...){
{ SQLITE_DBCONFIG_DEFENSIVE, SQLITE_Defensive },
{ SQLITE_DBCONFIG_WRITABLE_SCHEMA, SQLITE_WriteSchema|
SQLITE_NoSchemaError },
{ SQLITE_DBCONFIG_LEGACY_ALTER_TABLE, SQLITE_LegacyAlter },
{ SQLITE_DBCONFIG_DQS_DDL, SQLITE_DqsDDL },
{ SQLITE_DBCONFIG_DQS_DML, SQLITE_DqsDML },
};
unsigned int i;
rc = SQLITE_ERROR; /* IMP: R-42790-23372 */
@@ -878,17 +875,28 @@ int sqlite3_db_config(sqlite3 *db, int op, ...){
return rc;
}
/*
** Return true if the buffer z[0..n-1] contains all spaces.
*/
static int allSpaces(const char *z, int n){
while( n>0 && z[n-1]==' ' ){ n--; }
return n==0;
}
/*
** This is the default collating function named "BINARY" which is always
** available.
**
** If the padFlag argument is not NULL then space padding at the end
** of strings is ignored. This implements the RTRIM collation.
*/
static int binCollFunc(
void *NotUsed,
void *padFlag,
int nKey1, const void *pKey1,
int nKey2, const void *pKey2
){
int rc, n;
UNUSED_PARAMETER(NotUsed);
n = nKey1<nKey2 ? nKey1 : nKey2;
/* EVIDENCE-OF: R-65033-28449 The built-in BINARY collation compares
** strings byte by byte using the memcmp() function from the standard C
@@ -896,33 +904,29 @@ static int binCollFunc(
assert( pKey1 && pKey2 );
rc = memcmp(pKey1, pKey2, n);
if( rc==0 ){
rc = nKey1 - nKey2;
if( padFlag
&& allSpaces(((char*)pKey1)+n, nKey1-n)
&& allSpaces(((char*)pKey2)+n, nKey2-n)
){
/* EVIDENCE-OF: R-31624-24737 RTRIM is like BINARY except that extra
** spaces at the end of either string do not change the result. In other
** words, strings will compare equal to one another as long as they
** differ only in the number of spaces at the end.
*/
}else{
rc = nKey1 - nKey2;
}
}
return rc;
}
/*
** This is the collating function named "RTRIM" which is always
** available. Ignore trailing spaces.
*/
static int rtrimCollFunc(
void *pUser,
int nKey1, const void *pKey1,
int nKey2, const void *pKey2
){
const u8 *pK1 = (const u8*)pKey1;
const u8 *pK2 = (const u8*)pKey2;
while( nKey1 && pK1[nKey1-1]==' ' ) nKey1--;
while( nKey2 && pK2[nKey2-1]==' ' ) nKey2--;
return binCollFunc(pUser, nKey1, pKey1, nKey2, pKey2);
}
/*
** Return true if CollSeq is the default built-in BINARY.
*/
int sqlite3IsBinary(const CollSeq *p){
assert( p==0 || p->xCmp!=binCollFunc || strcmp(p->zName,"BINARY")==0 );
return p==0 || p->xCmp==binCollFunc;
assert( p==0 || p->xCmp!=binCollFunc || p->pUser!=0
|| strcmp(p->zName,"BINARY")==0 );
return p==0 || (p->xCmp==binCollFunc && p->pUser==0);
}
/*
@@ -3073,35 +3077,7 @@ static int openDatabase(
db->szMmap = sqlite3GlobalConfig.szMmap;
db->nextPagesize = 0;
db->nMaxSorterMmap = 0x7FFFFFFF;
db->flags |= SQLITE_ShortColNames
| SQLITE_EnableTrigger
| SQLITE_CacheSpill
/* The SQLITE_DQS compile-time option determines the default settings
** for SQLITE_DBCONFIG_DQS_DDL and SQLITE_DBCONFIG_DQS_DML.
**
** SQLITE_DQS SQLITE_DBCONFIG_DQS_DDL SQLITE_DBCONFIG_DQS_DML
** ---------- ----------------------- -----------------------
** undefined on on
** 3 on on
** 2 on off
** 1 off on
** 0 off off
**
** Legacy behavior is 3 (double-quoted string literals are allowed anywhere)
** and so that is the default. But developers are encouranged to use
** -DSQLITE_DQS=0 (best) or -DSQLITE_DQS=1 (second choice) if possible.
*/
#if !defined(SQLITE_DQS)
# define SQLITE_DQS 3
#endif
#if (SQLITE_DQS&1)==1
| SQLITE_DqsDML
#endif
#if (SQLITE_DQS&2)==2
| SQLITE_DqsDDL
#endif
db->flags |= SQLITE_ShortColNames | SQLITE_EnableTrigger | SQLITE_CacheSpill
#if !defined(SQLITE_DEFAULT_AUTOMATIC_INDEX) || SQLITE_DEFAULT_AUTOMATIC_INDEX
| SQLITE_AutoIndex
#endif
@@ -3152,7 +3128,7 @@ static int openDatabase(
createCollation(db, sqlite3StrBINARY, SQLITE_UTF16BE, 0, binCollFunc, 0);
createCollation(db, sqlite3StrBINARY, SQLITE_UTF16LE, 0, binCollFunc, 0);
createCollation(db, "NOCASE", SQLITE_UTF8, 0, nocaseCollatingFunc, 0);
createCollation(db, "RTRIM", SQLITE_UTF8, 0, rtrimCollFunc, 0);
createCollation(db, "RTRIM", SQLITE_UTF8, (void*)1, binCollFunc, 0);
if( db->mallocFailed ){
goto opendb_out;
}
+14 -28
View File
@@ -1044,11 +1044,11 @@ expr(A) ::= id(X) LP STAR RP. {
}
%ifndef SQLITE_OMIT_WINDOWFUNC
expr(A) ::= id(X) LP distinct(D) exprlist(Y) RP filter_over(Z). {
expr(A) ::= id(X) LP distinct(D) exprlist(Y) RP over_clause(Z). {
A = sqlite3ExprFunction(pParse, Y, &X, D);
sqlite3WindowAttach(pParse, A, Z);
}
expr(A) ::= id(X) LP STAR RP filter_over(Z). {
expr(A) ::= id(X) LP STAR RP over_clause(Z). {
A = sqlite3ExprFunction(pParse, 0, &X, 0);
sqlite3WindowAttach(pParse, A, Z);
}
@@ -1657,14 +1657,8 @@ windowdefn(A) ::= nm(X) AS LP window(Y) RP. {
%type part_opt {ExprList*}
%destructor part_opt {sqlite3ExprListDelete(pParse->db, $$);}
%type filter_clause {Expr*}
%destructor filter_clause {sqlite3ExprDelete(pParse->db, $$);}
%type over_clause {Window*}
%destructor over_clause {sqlite3WindowDelete(pParse->db, $$);}
%type filter_over {Window*}
%destructor filter_over {sqlite3WindowDelete(pParse->db, $$);}
%type filter_opt {Expr*}
%destructor filter_opt {sqlite3ExprDelete(pParse->db, $$);}
%type range_or_rows {int}
@@ -1730,33 +1724,25 @@ frame_exclude(A) ::= GROUP|TIES(X). {A = @X; /*A-overwrites-X*/}
%destructor window_clause {sqlite3WindowListDelete(pParse->db, $$);}
window_clause(A) ::= WINDOW windowdefn_list(B). { A = B; }
filter_over(A) ::= filter_clause(F) over_clause(O). {
O->pFilter = F;
A = O;
}
filter_over(A) ::= over_clause(O). {
A = O;
}
filter_over(A) ::= filter_clause(F). {
A = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
if( A ){
A->eFrmType = TK_FILTER;
A->pFilter = F;
}
}
over_clause(A) ::= OVER LP window(Z) RP. {
%type over_clause {Window*}
%destructor over_clause {sqlite3WindowDelete(pParse->db, $$);}
over_clause(A) ::= filter_opt(W) OVER LP window(Z) RP. {
A = Z;
assert( A!=0 );
A->pFilter = W;
}
over_clause(A) ::= OVER nm(Z). {
over_clause(A) ::= filter_opt(W) OVER nm(Z). {
A = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
if( A ){
A->zName = sqlite3DbStrNDup(pParse->db, Z.z, Z.n);
A->pFilter = W;
}else{
sqlite3ExprDelete(pParse->db, W);
}
}
filter_clause(A) ::= FILTER LP WHERE expr(X) RP. { A = X; }
filter_opt(A) ::= . { A = 0; }
filter_opt(A) ::= FILTER LP WHERE expr(X) RP. { A = X; }
%endif /* SQLITE_OMIT_WINDOWFUNC */
/*
+3 -4
View File
@@ -243,10 +243,9 @@ static int numberOfCachePages(PCache *p){
** suggested cache size is set to N. */
return p->szCache;
}else{
/* IMPLEMANTATION-OF: R-59858-46238 If the argument N is negative, then the
** number of cache pages is adjusted to be a number of pages that would
** use approximately abs(N*1024) bytes of memory based on the current
** page size. */
/* IMPLEMENTATION-OF: R-61436-13639 If the argument N is negative, then
** the number of cache pages is adjusted to use approximately abs(N*1024)
** bytes of memory. */
return (int)((-1024*(i64)p->szCache)/(p->szPage+p->szExtra));
}
}
+1 -1
View File
@@ -778,7 +778,6 @@ static sqlite3_pcache *pcache1Create(int szPage, int szExtra, int bPurgeable){
}else{
pGroup = &pcache1.grp;
}
pcache1EnterMutex(pGroup);
if( pGroup->lru.isAnchor==0 ){
pGroup->lru.isAnchor = 1;
pGroup->lru.pLruPrev = pGroup->lru.pLruNext = &pGroup->lru;
@@ -788,6 +787,7 @@ static sqlite3_pcache *pcache1Create(int szPage, int szExtra, int bPurgeable){
pCache->szExtra = szExtra;
pCache->szAlloc = szPage + szExtra + ROUND8(sizeof(PgHdr1));
pCache->bPurgeable = (bPurgeable ? 1 : 0);
pcache1EnterMutex(pGroup);
pcache1ResizeHash(pCache);
if( bPurgeable ){
pCache->nMin = 10;
+3 -3
View File
@@ -635,7 +635,7 @@ static int sqlite3Prepare(
rc = sParse.rc;
#ifndef SQLITE_OMIT_EXPLAIN
if( sParse.explain && rc==SQLITE_OK && sParse.pVdbe ){
if( rc==SQLITE_OK && sParse.pVdbe && sParse.explain ){
static const char * const azColName[] = {
"addr", "opcode", "p1", "p2", "p3", "p4", "p5", "comment",
"id", "parent", "notused", "detail"
@@ -660,8 +660,8 @@ static int sqlite3Prepare(
if( db->init.busy==0 ){
sqlite3VdbeSetSql(sParse.pVdbe, zSql, (int)(sParse.zTail-zSql), prepFlags);
}
if( rc!=SQLITE_OK || db->mallocFailed ){
if( sParse.pVdbe ) sqlite3VdbeFinalize(sParse.pVdbe);
if( sParse.pVdbe && (rc!=SQLITE_OK || db->mallocFailed) ){
sqlite3VdbeFinalize(sParse.pVdbe);
assert(!(*ppStmt));
}else{
*ppStmt = (sqlite3_stmt*)sParse.pVdbe;
+8 -1
View File
@@ -105,6 +105,13 @@ static const double arRound[] = {
5.0e-06, 5.0e-07, 5.0e-08, 5.0e-09, 5.0e-10,
};
/* Return TRUE if a floating point number is negative, even a negative 0 */
static int realIsNeg(double r){
i64 x;
memcpy(&x,&r,sizeof(x));
return x<0;
}
/*
** If SQLITE_OMIT_FLOATING_POINT is defined, then none of the floating point
** conversions will work.
@@ -515,7 +522,7 @@ void sqlite3_str_vappendf(
length = 0;
#else
if( precision<0 ) precision = 6; /* Set default precision */
if( realvalue<0.0 ){
if( realIsNeg(realvalue) ){
realvalue = -realvalue;
prefix = '-';
}else{
+18 -46
View File
@@ -148,23 +148,6 @@ int sqlite3MatchSpanName(
return 1;
}
/*
** Return TRUE if the double-quoted string mis-feature should be supported.
*/
static int areDoubleQuotedStringsEnabled(sqlite3 *db, NameContext *pTopNC){
if( db->init.busy ) return 1; /* Always support for legacy schemas */
if( pTopNC->ncFlags & NC_IsDDL ){
/* Currently parsing a DDL statement */
if( sqlite3WritableSchema(db) && (db->flags & SQLITE_DqsDML)!=0 ){
return 1;
}
return (db->flags & SQLITE_DqsDDL)!=0;
}else{
/* Currently parsing a DML statement */
return (db->flags & SQLITE_DqsDML)!=0;
}
}
/*
** Given the name of a column of the form X.Y.Z or Y.Z or just Z, look up
** that name in the set of source tables in pSrcList and make the pExpr
@@ -493,8 +476,8 @@ static int lookupName(
*/
if( cnt==0 && zTab==0 ){
assert( pExpr->op==TK_ID );
if( ExprHasProperty(pExpr,EP_DblQuoted)
&& areDoubleQuotedStringsEnabled(db, pTopNC)
if( ExprHasProperty(pExpr,EP_DblQuoted)
&& 0==(pTopNC->ncFlags&NC_NoDblQStr)
){
/* If a double-quoted identifier does not match any known column name,
** then treat it as a string.
@@ -749,9 +732,7 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
FuncDef *pDef; /* Information about the function */
u8 enc = ENC(pParse->db); /* The database encoding */
int savedAllowFlags = (pNC->ncFlags & (NC_AllowAgg | NC_AllowWin));
#ifndef SQLITE_OMIT_WINDOWFUNC
Window *pWin = (IsWindowFunc(pExpr) ? pExpr->y.pWin : 0);
#endif
assert( !ExprHasProperty(pExpr, EP_xIsSelect) );
zId = pExpr->u.zToken;
nId = sqlite3Strlen30(zId);
@@ -832,18 +813,18 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
|| (pDef->xValue==0 && pDef->xInverse==0)
|| (pDef->xValue && pDef->xInverse && pDef->xSFunc && pDef->xFinalize)
);
if( pDef && pDef->xValue==0 && pWin ){
if( pDef && pDef->xValue==0 && ExprHasProperty(pExpr, EP_WinFunc) ){
sqlite3ErrorMsg(pParse,
"%.*s() may not be used as a window function", nId, zId
);
pNC->nErr++;
}else if(
(is_agg && (pNC->ncFlags & NC_AllowAgg)==0)
|| (is_agg && (pDef->funcFlags&SQLITE_FUNC_WINDOW) && !pWin)
|| (is_agg && pWin && (pNC->ncFlags & NC_AllowWin)==0)
|| (is_agg && (pDef->funcFlags&SQLITE_FUNC_WINDOW) && !pExpr->y.pWin)
|| (is_agg && pExpr->y.pWin && (pNC->ncFlags & NC_AllowWin)==0)
){
const char *zType;
if( (pDef->funcFlags & SQLITE_FUNC_WINDOW) || pWin ){
if( (pDef->funcFlags & SQLITE_FUNC_WINDOW) || pExpr->y.pWin ){
zType = "window";
}else{
zType = "aggregate";
@@ -851,13 +832,6 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
sqlite3ErrorMsg(pParse, "misuse of %s function %.*s()",zType,nId,zId);
pNC->nErr++;
is_agg = 0;
}else if( is_agg==0 && ExprHasProperty(pExpr, EP_WinFunc) ){
assert( !IsWindowFunc(pExpr) );
sqlite3ErrorMsg(pParse,
"filter clause may not be used with non-aggregate %.*s()",
nId, zId
);
pNC->nErr++;
}
#else
if( (is_agg && (pNC->ncFlags & NC_AllowAgg)==0) ){
@@ -883,7 +857,7 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
** Or arguments of other window functions. But aggregate functions
** may be arguments for window functions. */
#ifndef SQLITE_OMIT_WINDOWFUNC
pNC->ncFlags &= ~(NC_AllowWin | (!pWin ? NC_AllowAgg : 0));
pNC->ncFlags &= ~(NC_AllowWin | (!pExpr->y.pWin ? NC_AllowAgg : 0));
#else
pNC->ncFlags &= ~NC_AllowAgg;
#endif
@@ -892,16 +866,16 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
sqlite3WalkExprList(pWalker, pList);
if( is_agg ){
#ifndef SQLITE_OMIT_WINDOWFUNC
if( pWin ){
if( pExpr->y.pWin ){
Select *pSel = pNC->pWinSelect;
if( IN_RENAME_OBJECT==0 ){
sqlite3WindowUpdate(pParse, pSel->pWinDefn, pWin, pDef);
sqlite3WindowUpdate(pParse, pSel->pWinDefn, pExpr->y.pWin, pDef);
}
sqlite3WalkExprList(pWalker, pWin->pPartition);
sqlite3WalkExprList(pWalker, pWin->pOrderBy);
sqlite3WalkExpr(pWalker, pWin->pFilter);
sqlite3WalkExprList(pWalker, pExpr->y.pWin->pPartition);
sqlite3WalkExprList(pWalker, pExpr->y.pWin->pOrderBy);
sqlite3WalkExpr(pWalker, pExpr->y.pWin->pFilter);
if( 0==pSel->pWin
|| 0==sqlite3WindowCompare(pParse, pSel->pWin, pWin, 0)
|| 0==sqlite3WindowCompare(pParse, pSel->pWin, pExpr->y.pWin)
){
pExpr->y.pWin->pNextWin = pSel->pWin;
pSel->pWin = pExpr->y.pWin;
@@ -913,11 +887,6 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
NameContext *pNC2 = pNC;
pExpr->op = TK_AGG_FUNCTION;
pExpr->op2 = 0;
#ifndef SQLITE_OMIT_WINDOWFUNC
if( ExprHasProperty(pExpr, EP_WinFunc) ){
sqlite3WalkExpr(pWalker, pExpr->y.pWin->pFilter);
}
#endif
while( pNC2 && !sqlite3FunctionUsesThisSrc(pExpr, pNC2->pSrcList) ){
pExpr->op2++;
pNC2 = pNC2->pNext;
@@ -1801,7 +1770,10 @@ int sqlite3ResolveSelfReference(
}
sNC.pParse = pParse;
sNC.pSrcList = &sSrc;
sNC.ncFlags = type | NC_IsDDL;
sNC.ncFlags = type;
if( !pParse->db->init.busy && !sqlite3WritableSchema(pParse->db) ){
sNC.ncFlags |= NC_NoDblQStr;
}
if( (rc = sqlite3ResolveExprNames(&sNC, pExpr))!=SQLITE_OK ) return rc;
if( pList ) rc = sqlite3ResolveExprListNames(&sNC, pList);
return rc;
+8 -23
View File
@@ -2096,6 +2096,9 @@ Table *sqlite3ResultSetOfSelect(Parse *pParse, Select *pSelect){
if( pTab==0 ){
return 0;
}
/* The sqlite3ResultSetOfSelect() is only used n contexts where lookaside
** is disabled */
assert( db->lookaside.bDisable );
pTab->nTabRef = 1;
pTab->zName = 0;
pTab->nRowLogEst = 200; assert( 200==sqlite3LogEst(1048576) );
@@ -4403,10 +4406,7 @@ static u8 minMaxQuery(sqlite3 *db, Expr *pFunc, ExprList **ppMinMax){
assert( *ppMinMax==0 );
assert( pFunc->op==TK_AGG_FUNCTION );
assert( !IsWindowFunc(pFunc) );
if( pEList==0 || pEList->nExpr!=1 || ExprHasProperty(pFunc, EP_WinFunc) ){
return eRet;
}
if( pEList==0 || pEList->nExpr!=1 ) return eRet;
zFunc = pFunc->u.zToken;
if( sqlite3StrICmp(zFunc, "min")==0 ){
eRet = WHERE_ORDERBY_MIN;
@@ -4453,7 +4453,7 @@ static Table *isSimpleCount(Select *p, AggInfo *pAggInfo){
if( pExpr->op!=TK_AGG_FUNCTION ) return 0;
if( NEVER(pAggInfo->nFunc==0) ) return 0;
if( (pAggInfo->aFunc[0].pFunc->funcFlags&SQLITE_FUNC_COUNT)==0 ) return 0;
if( ExprHasProperty(pExpr, EP_Distinct|EP_WinFunc) ) return 0;
if( pExpr->flags&EP_Distinct ) return 0;
return pTab;
}
@@ -5333,12 +5333,6 @@ static void updateAccumulator(Parse *pParse, int regAcc, AggInfo *pAggInfo){
int regAgg;
ExprList *pList = pF->pExpr->x.pList;
assert( !ExprHasProperty(pF->pExpr, EP_xIsSelect) );
assert( !IsWindowFunc(pF->pExpr) );
if( ExprHasProperty(pF->pExpr, EP_WinFunc) ){
Expr *pFilter = pF->pExpr->y.pWin->pFilter;
addrNext = sqlite3VdbeMakeLabel(pParse);
sqlite3ExprIfFalse(pParse, pFilter, addrNext, SQLITE_JUMPIFNULL);
}
if( pList ){
nArg = pList->nExpr;
regAgg = sqlite3GetTempRange(pParse, nArg);
@@ -5348,9 +5342,7 @@ static void updateAccumulator(Parse *pParse, int regAcc, AggInfo *pAggInfo){
regAgg = 0;
}
if( pF->iDistinct>=0 ){
if( addrNext==0 ){
addrNext = sqlite3VdbeMakeLabel(pParse);
}
addrNext = sqlite3VdbeMakeLabel(pParse);
testcase( nArg==0 ); /* Error condition */
testcase( nArg>1 ); /* Also an error */
codeDistinct(pParse, pF->iDistinct, addrNext, 1, regAgg);
@@ -6233,16 +6225,9 @@ int sqlite3Select(
minMaxFlag = WHERE_ORDERBY_NORMAL;
}
for(i=0; i<sAggInfo.nFunc; i++){
Expr *pExpr = sAggInfo.aFunc[i].pExpr;
assert( !ExprHasProperty(pExpr, EP_xIsSelect) );
assert( !ExprHasProperty(sAggInfo.aFunc[i].pExpr, EP_xIsSelect) );
sNC.ncFlags |= NC_InAggFunc;
sqlite3ExprAnalyzeAggList(&sNC, pExpr->x.pList);
#ifndef SQLITE_OMIT_WINDOWFUNC
assert( !IsWindowFunc(pExpr) );
if( ExprHasProperty(pExpr, EP_WinFunc) ){
sqlite3ExprAnalyzeAggregates(&sNC, pExpr->y.pWin->pFilter);
}
#endif
sqlite3ExprAnalyzeAggList(&sNC, sAggInfo.aFunc[i].pExpr->x.pList);
sNC.ncFlags &= ~NC_InAggFunc;
}
sAggInfo.mxReg = pParse->nMem;
+13 -19
View File
@@ -6562,7 +6562,7 @@ static int recoverDatabaseCmd(ShellState *pState, int nArg, char **azArg){
char *z = azArg[i];
int n;
if( z[0]=='-' && z[1]=='-' ) z++;
n = strlen30(z);
n = strlen(z);
if( n<=17 && memcmp("-freelist-corrupt", z, n)==0 ){
bFreelist = 0;
}else
@@ -7075,19 +7075,15 @@ static int do_meta_command(char *zLine, ShellState *p){
const char *zName;
int op;
} aDbConfig[] = {
{ "enable_fkey", SQLITE_DBCONFIG_ENABLE_FKEY },
{ "enable_trigger", SQLITE_DBCONFIG_ENABLE_TRIGGER },
{ "fts3_tokenizer", SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER },
{ "load_extension", SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION },
{ "no_ckpt_on_close", SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE },
{ "enable_qpsg", SQLITE_DBCONFIG_ENABLE_QPSG },
{ "trigger_eqp", SQLITE_DBCONFIG_TRIGGER_EQP },
{ "reset_database", SQLITE_DBCONFIG_RESET_DATABASE },
{ "defensive", SQLITE_DBCONFIG_DEFENSIVE },
{ "writable_schema", SQLITE_DBCONFIG_WRITABLE_SCHEMA },
{ "legacy_alter_table", SQLITE_DBCONFIG_LEGACY_ALTER_TABLE },
{ "dqs_dml", SQLITE_DBCONFIG_DQS_DML },
{ "dqs_ddl", SQLITE_DBCONFIG_DQS_DDL },
{ "enable_fkey", SQLITE_DBCONFIG_ENABLE_FKEY },
{ "enable_trigger", SQLITE_DBCONFIG_ENABLE_TRIGGER },
{ "fts3_tokenizer", SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER },
{ "load_extension", SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION },
{ "no_ckpt_on_close", SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE },
{ "enable_qpsg", SQLITE_DBCONFIG_ENABLE_QPSG },
{ "trigger_eqp", SQLITE_DBCONFIG_TRIGGER_EQP },
{ "reset_database", SQLITE_DBCONFIG_RESET_DATABASE },
{ "defensive", SQLITE_DBCONFIG_DEFENSIVE },
};
int ii, v;
open_db(p, 0);
@@ -7303,8 +7299,8 @@ static int do_meta_command(char *zLine, ShellState *p){
};
int filectrl = -1;
int iCtrl = -1;
sqlite3_int64 iRes = 0; /* Integer result to display if rc2==1 */
int isOk = 0; /* 0: usage 1: %lld 2: no-result */
sqlite3_int64 iRes; /* Integer result to display if rc2==1 */
int isOk = 0; /* 0: usage 1: %lld 2: no-result */
int n2, i;
const char *zCmd = 0;
@@ -7400,9 +7396,7 @@ static int do_meta_command(char *zLine, ShellState *p){
utf8_printf(p->out, "Usage: .filectrl %s %s\n", zCmd,aCtrl[iCtrl].zUsage);
rc = 1;
}else if( isOk==1 ){
char zBuf[100];
sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", iRes);
raw_printf(p->out, "%s\n", zBuf);
raw_printf(p->out, "%lld\n", iRes);
}
}else
+1 -32
View File
@@ -2220,34 +2220,6 @@ struct sqlite3_mem_methods {
** integer into which is written 0 or 1 to indicate whether the writable_schema
** is enabled or disabled following this call.
** </dd>
**
** [[SQLITE_DBCONFIG_LEGACY_ALTER_TABLE]]
** <dt>SQLITE_DBCONFIG_LEGACY_ALTER_TABLE</dt>
** <dd>The SQLITE_DBCONFIG_LEGACY_ALTER_TABLE option activates or deactivates
** the legacy behavior of the [ALTER TABLE RENAME] command such it
** behaves as it did prior to [version 3.24.0] (2018-06-04). See the
** "Compatibility Notice" on the [ALTER TABLE RENAME documentation] for
** additional information. This feature can also be turned on and off
** using the [PRAGMA legacy_alter_table] statement.
** </dd>
**
** [[SQLITE_DBCONFIG_DQS_DML]]
** <dt>SQLITE_DBCONFIG_DQS_DML</td>
** <dd>The SQLITE_DBCONFIG_DQS_DML option activates or deactivates
** the legacy [double-quoted string literal] misfeature for DML statement
** only, that is DELETE, INSERT, SELECT, and UPDATE statements. The
** default value of this setting is determined by the [-DSQLITE_DQS]
** compile-time option.
** </dd>
**
** [[SQLITE_DBCONFIG_DQS_DDL]]
** <dt>SQLITE_DBCONFIG_DQS_DDL</td>
** <dd>The SQLITE_DBCONFIG_DQS option activates or deactivates
** the legacy [double-quoted string literal] misfeature for DDL statements,
** such as CREATE TABLE and CREATE INDEX. The
** default value of this setting is determined by the [-DSQLITE_DQS]
** compile-time option.
** </dd>
** </dl>
*/
#define SQLITE_DBCONFIG_MAINDBNAME 1000 /* const char* */
@@ -2262,10 +2234,7 @@ struct sqlite3_mem_methods {
#define SQLITE_DBCONFIG_RESET_DATABASE 1009 /* int int* */
#define SQLITE_DBCONFIG_DEFENSIVE 1010 /* int int* */
#define SQLITE_DBCONFIG_WRITABLE_SCHEMA 1011 /* int int* */
#define SQLITE_DBCONFIG_LEGACY_ALTER_TABLE 1012 /* int int* */
#define SQLITE_DBCONFIG_DQS_DML 1013 /* int int* */
#define SQLITE_DBCONFIG_DQS_DDL 1014 /* int int* */
#define SQLITE_DBCONFIG_MAX 1014 /* Largest DBCONFIG */
#define SQLITE_DBCONFIG_MAX 1011 /* Largest DBCONFIG */
/*
** CAPI3REF: Enable Or Disable Extended Result Codes
+4 -13
View File
@@ -1548,8 +1548,6 @@ struct sqlite3 {
#define SQLITE_LegacyAlter 0x04000000 /* Legacy ALTER TABLE behaviour */
#define SQLITE_NoSchemaError 0x08000000 /* Do not report schema parse errors*/
#define SQLITE_Defensive 0x10000000 /* Input SQL is likely hostile */
#define SQLITE_DqsDDL 0x20000000 /* dbl-quoted strings allowed in DDL*/
#define SQLITE_DqsDML 0x40000000 /* dbl-quoted strings allowed in DML*/
/* Flags used only if debugging */
#define HI(X) ((u64)(X)<<32)
@@ -2491,7 +2489,7 @@ struct Expr {
union {
Table *pTab; /* TK_COLUMN: Table containing column. Can be NULL
** for a column of an index on an expression */
Window *pWin; /* EP_WinFunc: Window/Filter defn for a function */
Window *pWin; /* TK_FUNCTION: Window definition for the func */
struct { /* TK_IN, TK_SELECT, and TK_EXISTS */
int iAddr; /* Subroutine entry address */
int regReturn; /* Register used to hold return address */
@@ -2579,14 +2577,6 @@ struct Expr {
*/
#define EXPRDUP_REDUCE 0x0001 /* Used reduced-size Expr nodes */
/*
** True if the expression passed as an argument was a function with
** an OVER() clause (a window function).
*/
#define IsWindowFunc(p) ( \
ExprHasProperty((p), EP_WinFunc) && p->y.pWin->eFrmType!=TK_FILTER \
)
/*
** A list of expressions. Each expression may optionally have a
** name. An expr/name combination can be used in several ways, such
@@ -2804,7 +2794,8 @@ struct NameContext {
#define NC_Complex 0x2000 /* True if a function or subquery seen */
#define NC_AllowWin 0x4000 /* Window functions are allowed here */
#define NC_HasWin 0x8000 /* One or more window functions seen */
#define NC_IsDDL 0x10000 /* Resolving names in a CREATE statement */
#define NC_NoDblQStr 0x10000 /* Do not allow double-quoted string hack.
** Mnemonic: "NO DouBLe-Quoted STRings" */
/*
** An instance of the following object describes a single ON CONFLICT
@@ -3611,7 +3602,7 @@ void sqlite3WindowDelete(sqlite3*, Window*);
void sqlite3WindowListDelete(sqlite3 *db, Window *p);
Window *sqlite3WindowAlloc(Parse*, int, int, Expr*, int , Expr*, u8);
void sqlite3WindowAttach(Parse*, Expr*, Window*);
int sqlite3WindowCompare(Parse*, Window*, Window*, int);
int sqlite3WindowCompare(Parse*, Window*, Window*);
void sqlite3WindowCodeInit(Parse*, Window*);
void sqlite3WindowCodeStep(Parse*, Select*, WhereInfo*, int, int);
int sqlite3WindowRewrite(Parse*, Select*);
+9 -13
View File
@@ -7608,19 +7608,15 @@ static int SQLITE_TCLAPI test_sqlite3_db_config(
const char *zName;
int eVal;
} aSetting[] = {
{ "FKEY", SQLITE_DBCONFIG_ENABLE_FKEY },
{ "TRIGGER", SQLITE_DBCONFIG_ENABLE_TRIGGER },
{ "FTS3_TOKENIZER", SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER },
{ "LOAD_EXTENSION", SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION },
{ "NO_CKPT_ON_CLOSE", SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE },
{ "QPSG", SQLITE_DBCONFIG_ENABLE_QPSG },
{ "TRIGGER_EQP", SQLITE_DBCONFIG_TRIGGER_EQP },
{ "RESET_DB", SQLITE_DBCONFIG_RESET_DATABASE },
{ "DEFENSIVE", SQLITE_DBCONFIG_DEFENSIVE },
{ "WRITABLE_SCHEMA", SQLITE_DBCONFIG_WRITABLE_SCHEMA },
{ "LEGACY_ALTER_TABLE", SQLITE_DBCONFIG_LEGACY_ALTER_TABLE },
{ "DQS_DML", SQLITE_DBCONFIG_DQS_DML },
{ "DQS_DDL", SQLITE_DBCONFIG_DQS_DDL },
{ "FKEY", SQLITE_DBCONFIG_ENABLE_FKEY },
{ "TRIGGER", SQLITE_DBCONFIG_ENABLE_TRIGGER },
{ "FTS3_TOKENIZER", SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER },
{ "LOAD_EXTENSION", SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION },
{ "NO_CKPT_ON_CLOSE",SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE },
{ "QPSG", SQLITE_DBCONFIG_ENABLE_QPSG },
{ "TRIGGER_EQP", SQLITE_DBCONFIG_TRIGGER_EQP },
{ "RESET_DB", SQLITE_DBCONFIG_RESET_DATABASE },
{ "DEFENSIVE", SQLITE_DBCONFIG_DEFENSIVE },
};
int i;
int v;
+1 -4
View File
@@ -240,9 +240,6 @@ static int demoRead(
if( nRead==iAmt ){
return SQLITE_OK;
}else if( nRead>=0 ){
if( nRead<iAmt ){
memset(&((char*)zBuf)[nRead], 0, iAmt-nRead);
}
return SQLITE_IOERR_SHORT_READ;
}
@@ -372,7 +369,7 @@ static int demoCheckReservedLock(sqlite3_file *pFile, int *pResOut){
** No xFileControl() verbs are implemented by this VFS.
*/
static int demoFileControl(sqlite3_file *pFile, int op, void *pArg){
return SQLITE_NOTFOUND;
return SQLITE_OK;
}
/*
-1
View File
@@ -505,7 +505,6 @@ void devsym_register(int iDeviceChar, int iSectorSize){
void devsym_unregister(){
sqlite3_vfs_unregister(&devsym_vfs);
sqlite3_vfs_unregister(&writecrash_vfs);
g.pVfs = 0;
g.iDeviceChar = 0;
g.iSectorSize = 0;
+15 -103
View File
@@ -2927,36 +2927,14 @@ case OP_MakeRecord: {
#endif
/* Loop through the elements that will make up the record to figure
** out how much space is required for the new record. After this loop,
** the Mem.uTemp field of each term should hold the serial-type that will
** be used for that term in the generated record:
**
** Mem.uTemp value type
** --------------- ---------------
** 0 NULL
** 1 1-byte signed integer
** 2 2-byte signed integer
** 3 3-byte signed integer
** 4 4-byte signed integer
** 5 6-byte signed integer
** 6 8-byte signed integer
** 7 IEEE float
** 8 Integer constant 0
** 9 Integer constant 1
** 10,11 reserved for expansion
** N>=12 and even BLOB
** N>=13 and odd text
**
** The following additional values are computed:
** nHdr Number of bytes needed for the record header
** nData Number of bytes of data space needed for the record
** nZero Zero bytes at the end of the record
** out how much space is required for the new record.
*/
pRec = pLast;
do{
assert( memIsValid(pRec) );
if( pRec->flags & MEM_Null ){
if( pRec->flags & MEM_Zero ){
serial_type = sqlite3VdbeSerialType(pRec, file_format, &len);
if( pRec->flags & MEM_Zero ){
if( serial_type==0 ){
/* Values with MEM_Null and MEM_Zero are created by xColumn virtual
** table methods that never invoke sqlite3_result_xxxxx() while
** computing an unchanging column value in an UPDATE statement.
@@ -2964,83 +2942,19 @@ case OP_MakeRecord: {
** so that they can be passed through to xUpdate and have
** a true sqlite3_value_nochange(). */
assert( pOp->p5==OPFLAG_NOCHNG_MAGIC || CORRUPT_DB );
pRec->uTemp = 10;
serial_type = 10;
}else if( nData ){
if( sqlite3VdbeMemExpandBlob(pRec) ) goto no_mem;
}else{
pRec->uTemp = 0;
nZero += pRec->u.nZero;
len -= pRec->u.nZero;
}
nHdr++;
}else if( pRec->flags & (MEM_Int|MEM_IntReal) ){
/* Figure out whether to use 1, 2, 4, 6 or 8 bytes. */
i64 i = pRec->u.i;
u64 u;
testcase( pRec->flags & MEM_Int );
testcase( pRec->flags & MEM_IntReal );
if( i<0 ){
u = ~i;
}else{
u = i;
}
nHdr++;
testcase( u==127 ); testcase( u==128 );
testcase( u==32767 ); testcase( u==32768 );
testcase( u==8388607 ); testcase( u==8388608 );
testcase( u==2147483647 ); testcase( u==2147483648 );
testcase( u==140737488355327LL ); testcase( u==140737488355328LL );
if( u<=127 ){
if( (i&1)==i && file_format>=4 ){
pRec->uTemp = 8+(u32)u;
}else{
nData++;
pRec->uTemp = 1;
}
}else if( u<=32767 ){
nData += 2;
pRec->uTemp = 2;
}else if( u<=8388607 ){
nData += 3;
pRec->uTemp = 3;
}else if( u<=2147483647 ){
nData += 4;
pRec->uTemp = 4;
}else if( u<=140737488355327LL ){
nData += 6;
pRec->uTemp = 5;
}else{
nData += 8;
if( pRec->flags & MEM_IntReal ){
/* If the value is IntReal and is going to take up 8 bytes to store
** as an integer, then we might as well make it an 8-byte floating
** point value */
pRec->u.r = (double)pRec->u.i;
pRec->flags &= ~MEM_IntReal;
pRec->flags |= MEM_Real;
pRec->uTemp = 7;
}else{
pRec->uTemp = 6;
}
}
}else if( pRec->flags & MEM_Real ){
nHdr++;
nData += 8;
pRec->uTemp = 7;
}else{
assert( db->mallocFailed || pRec->flags&(MEM_Str|MEM_Blob) );
assert( pRec->n>=0 );
len = (u32)pRec->n;
serial_type = (len*2) + 12 + ((pRec->flags & MEM_Str)!=0);
if( pRec->flags & MEM_Zero ){
serial_type += pRec->u.nZero*2;
if( nData ){
if( sqlite3VdbeMemExpandBlob(pRec) ) goto no_mem;
len += pRec->u.nZero;
}else{
nZero += pRec->u.nZero;
}
}
nData += len;
nHdr += sqlite3VarintLen(serial_type);
pRec->uTemp = serial_type;
}
nData += len;
testcase( serial_type==127 );
testcase( serial_type==128 );
nHdr += serial_type<=127 ? 1 : sqlite3VarintLen(serial_type);
pRec->uTemp = serial_type;
if( pRec==pData0 ) break;
pRec--;
}while(1);
@@ -3839,14 +3753,13 @@ case OP_OpenEphemeral: {
/* If the ephermeral table is already open, erase all existing content
** so that the table is empty again, rather than creating a new table. */
assert( pCx->isEphemeral );
pCx->seqCount = 0;
pCx->cacheStatus = CACHE_STALE;
if( pCx->pBtx ){
rc = sqlite3BtreeClearTable(pCx->pBtx, pCx->pgnoRoot, 0);
}
}else{
pCx = allocateCursor(p, pOp->p1, pOp->p2, -1, CURTYPE_BTREE);
if( pCx==0 ) goto no_mem;
pCx->nullRow = 1;
pCx->isEphemeral = 1;
rc = sqlite3BtreeOpen(db->pVfs, 0, db, &pCx->pBtx,
BTREE_OMIT_JOURNAL | BTREE_SINGLE | pOp->p5,
@@ -3882,7 +3795,6 @@ case OP_OpenEphemeral: {
pCx->isOrdered = (pOp->p5!=BTREE_UNORDERED);
}
if( rc ) goto abort_due_to_error;
pCx->nullRow = 1;
break;
}
-2
View File
@@ -486,9 +486,7 @@ int sqlite3VdbeCursorMoveto(VdbeCursor**, int*);
int sqlite3VdbeCursorRestore(VdbeCursor*);
u32 sqlite3VdbeSerialTypeLen(u32);
u8 sqlite3VdbeOneByteSerialTypeLen(u8);
#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
u32 sqlite3VdbeSerialType(Mem*, int, u32*);
#endif
u32 sqlite3VdbeSerialPut(unsigned char*, Mem*, u32);
u32 sqlite3VdbeSerialGet(const unsigned char*, u32, Mem*);
void sqlite3VdbeDeleteAuxData(sqlite3*, AuxData**, int, int);
+5 -12
View File
@@ -3430,16 +3430,10 @@ int sqlite3VdbeCursorMoveto(VdbeCursor **pp, int *piCol){
** of SQLite will not understand those serial types.
*/
#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
/*
** Return the serial-type for the value stored in pMem.
**
** This routine might convert a large MEM_IntReal value into MEM_Real.
**
** 2019-07-11: The primary user of this subroutine was the OP_MakeRecord
** opcode in the byte-code engine. But by moving this routine in-line, we
** can omit some redundant tests and make that opcode a lot faster. So
** this routine is now only used by the STAT3/4 logic.
*/
u32 sqlite3VdbeSerialType(Mem *pMem, int file_format, u32 *pLen){
int flags = pMem->flags;
@@ -3500,7 +3494,6 @@ u32 sqlite3VdbeSerialType(Mem *pMem, int file_format, u32 *pLen){
*pLen = n;
return ((n*2) + 12 + ((flags&MEM_Str)!=0));
}
#endif /* SQLITE_ENABLE_STAT3_OR_STAT4 */
/*
** The sizes for serial types less than 128
@@ -4607,11 +4600,7 @@ static int vdbeRecordCompareString(
nCmp = MIN( pPKey2->aMem[0].n, nStr );
res = memcmp(&aKey1[szHdr], pPKey2->aMem[0].z, nCmp);
if( res>0 ){
res = pPKey2->r2;
}else if( res<0 ){
res = pPKey2->r1;
}else{
if( res==0 ){
res = nStr - pPKey2->aMem[0].n;
if( res==0 ){
if( pPKey2->nField>1 ){
@@ -4625,6 +4614,10 @@ static int vdbeRecordCompareString(
}else{
res = pPKey2->r1;
}
}else if( res>0 ){
res = pPKey2->r2;
}else{
res = pPKey2->r1;
}
}
+2 -5
View File
@@ -693,17 +693,14 @@ int sqlite3VdbeMemRealify(Mem *pMem){
/* Compare a floating point value to an integer. Return true if the two
** values are the same within the precision of the floating point value.
**
** This function assumes that i was obtained by assignment from r1.
**
** For some versions of GCC on 32-bit machines, if you do the more obvious
** comparison of "r1==(double)i" you sometimes get an answer of false even
** though the r1 and (double)i values are bit-for-bit the same.
*/
int sqlite3RealSameAsInt(double r1, sqlite3_int64 i){
double r2 = (double)i;
return r1==0.0
|| (memcmp(&r1, &r2, sizeof(r1))==0
&& i >= -2251799813685248LL && i < 2251799813685248LL);
return memcmp(&r1, &r2, sizeof(r1))==0
&& i >= -2251799813685248 && i < 2251799813685248;
}
/*
+7 -11
View File
@@ -63,22 +63,18 @@ static SQLITE_NOINLINE int walkExpr(Walker *pWalker, Expr *pExpr){
if( pExpr->pLeft && walkExpr(pWalker, pExpr->pLeft) ) return WRC_Abort;
assert( pExpr->x.pList==0 || pExpr->pRight==0 );
if( pExpr->pRight ){
assert( !ExprHasProperty(pExpr, EP_WinFunc) );
pExpr = pExpr->pRight;
continue;
}else if( ExprHasProperty(pExpr, EP_xIsSelect) ){
assert( !ExprHasProperty(pExpr, EP_WinFunc) );
if( sqlite3WalkSelect(pWalker, pExpr->x.pSelect) ) return WRC_Abort;
}else{
if( pExpr->x.pList ){
if( sqlite3WalkExprList(pWalker, pExpr->x.pList) ) return WRC_Abort;
}
#ifndef SQLITE_OMIT_WINDOWFUNC
if( ExprHasProperty(pExpr, EP_WinFunc) ){
if( walkWindowList(pWalker, pExpr->y.pWin) ) return WRC_Abort;
}
#endif
}else if( pExpr->x.pList ){
if( sqlite3WalkExprList(pWalker, pExpr->x.pList) ) return WRC_Abort;
}
#ifndef SQLITE_OMIT_WINDOWFUNC
if( ExprHasProperty(pExpr, EP_WinFunc) ){
if( walkWindowList(pWalker, pExpr->y.pWin) ) return WRC_Abort;
}
#endif
}
break;
}
+11 -10
View File
@@ -562,17 +562,17 @@ static LogEst estLog(LogEst N){
** opcodes into OP_Copy when the table is being accessed via co-routine
** instead of via table lookup.
**
** If the iAutoidxCur is not zero, then any OP_Rowid instructions on
** cursor iTabCur are transformed into OP_Sequence opcode for the
** iAutoidxCur cursor, in order to generate unique rowids for the
** automatic index being generated.
** If the bIncrRowid parameter is 0, then any OP_Rowid instructions on
** cursor iTabCur are transformed into OP_Null. Or, if bIncrRowid is non-zero,
** then each OP_Rowid is transformed into an instruction to increment the
** value stored in its output register.
*/
static void translateColumnToCopy(
Parse *pParse, /* Parsing context */
int iStart, /* Translate from this opcode to the end */
int iTabCur, /* OP_Column/OP_Rowid references to this table */
int iRegister, /* The first column is in this register */
int iAutoidxCur /* If non-zero, cursor of autoindex being generated */
int bIncrRowid /* If non-zero, transform OP_rowid to OP_AddImm(1) */
){
Vdbe *v = pParse->pVdbe;
VdbeOp *pOp = sqlite3VdbeGetOp(v, iStart);
@@ -586,9 +586,11 @@ static void translateColumnToCopy(
pOp->p2 = pOp->p3;
pOp->p3 = 0;
}else if( pOp->opcode==OP_Rowid ){
if( iAutoidxCur ){
pOp->opcode = OP_Sequence;
pOp->p1 = iAutoidxCur;
if( bIncrRowid ){
/* Increment the value stored in the P2 operand of the OP_Rowid. */
pOp->opcode = OP_AddImm;
pOp->p1 = pOp->p2;
pOp->p2 = 1;
}else{
pOp->opcode = OP_Null;
pOp->p1 = 0;
@@ -862,9 +864,8 @@ static void constructAutomaticIndex(
if( pTabItem->fg.viaCoroutine ){
sqlite3VdbeChangeP2(v, addrCounter, regBase+n);
testcase( pParse->db->mallocFailed );
assert( pLevel->iIdxCur>0 );
translateColumnToCopy(pParse, addrTop, pLevel->iTabCur,
pTabItem->regResult, pLevel->iIdxCur);
pTabItem->regResult, 1);
sqlite3VdbeGoto(v, addrTop);
pTabItem->fg.viaCoroutine = 0;
}else{
+19 -22
View File
@@ -264,31 +264,28 @@ static int isLikeOrGlob(
zNew[iTo] = 0;
assert( iTo>0 );
/* If the LHS is not an ordinary column with TEXT affinity, then the
** pattern prefix boundaries (both the start and end boundaries) must
** not look like a number. Otherwise the pattern might be treated as
** a number, which will invalidate the LIKE optimization.
/* If the RHS begins with a digit, a +/- sign or whitespace, then the
** LHS must be an ordinary column (not a virtual table column) with
** TEXT affinity. Otherwise the LHS might be numeric and "lhs >= rhs"
** would be false even though "lhs LIKE rhs" is true. But if the RHS
** does not start with a digit or +/-, then "lhs LIKE rhs" will always
** be false if the LHS is numeric and so the optimization still works.
**
** Getting this right has been a persistent source of bugs in the
** LIKE optimization. See, for example:
** 2018-09-10 https://sqlite.org/src/info/c94369cae9b561b1
** 2019-05-02 https://sqlite.org/src/info/b043a54c3de54b28
** 2019-06-10 https://sqlite.org/src/info/fd76310a5e843e07
** 2019-06-14 https://sqlite.org/src/info/ce8717f0885af975
** 2018-09-10 ticket c94369cae9b561b1f996d0054bfab11389f9d033
** The RHS pattern must not be '/%' because the termination condition
** will then become "x<'0'" and if the affinity is numeric, will then
** be converted into "x<0", which is incorrect.
*/
if( pLeft->op!=TK_COLUMN
|| sqlite3ExprAffinity(pLeft)!=SQLITE_AFF_TEXT
|| IsVirtual(pLeft->y.pTab) /* Value might be numeric */
if( sqlite3Isdigit(zNew[0])
|| sqlite3Isspace(zNew[0])
|| zNew[0]=='-'
|| zNew[0]=='+'
|| zNew[iTo-1]=='0'-1
){
int isNum;
double rDummy;
isNum = sqlite3AtoF(zNew, &rDummy, iTo, SQLITE_UTF8);
if( isNum<=0 ){
zNew[iTo-1]++;
isNum = sqlite3AtoF(zNew, &rDummy, iTo, SQLITE_UTF8);
zNew[iTo-1]--;
}
if( isNum>0 ){
if( pLeft->op!=TK_COLUMN
|| sqlite3ExprAffinity(pLeft)!=SQLITE_AFF_TEXT
|| IsVirtual(pLeft->y.pTab) /* Value might be numeric */
){
sqlite3ExprDelete(db, pPrefix);
sqlite3ValueFree(pVal);
return 0;
+19 -34
View File
@@ -736,7 +736,6 @@ struct WindowRewrite {
Window *pWin;
SrcList *pSrc;
ExprList *pSub;
Table *pTab;
Select *pSubSelect; /* Current sub-select, if any */
};
@@ -797,7 +796,6 @@ static int selectWindowRewriteExprCb(Walker *pWalker, Expr *pExpr){
pExpr->op = TK_COLUMN;
pExpr->iColumn = p->pSub->nExpr-1;
pExpr->iTable = p->pWin->iEphCsr;
pExpr->y.pTab = p->pTab;
}
break;
@@ -841,7 +839,6 @@ static void selectWindowRewriteEList(
Window *pWin,
SrcList *pSrc,
ExprList *pEList, /* Rewrite expressions in this list */
Table *pTab,
ExprList **ppSub /* IN/OUT: Sub-select expression-list */
){
Walker sWalker;
@@ -853,7 +850,6 @@ static void selectWindowRewriteEList(
sRewrite.pSub = *ppSub;
sRewrite.pWin = pWin;
sRewrite.pSrc = pSrc;
sRewrite.pTab = pTab;
sWalker.pParse = pParse;
sWalker.xExprCallback = selectWindowRewriteExprCb;
@@ -913,18 +909,11 @@ int sqlite3WindowRewrite(Parse *pParse, Select *p){
ExprList *pSublist = 0; /* Expression list for sub-query */
Window *pMWin = p->pWin; /* Master window object */
Window *pWin; /* Window object iterator */
Table *pTab;
pTab = sqlite3DbMallocZero(db, sizeof(Table));
if( pTab==0 ){
return SQLITE_NOMEM;
}
p->pSrc = 0;
p->pWhere = 0;
p->pGroupBy = 0;
p->pHaving = 0;
p->selFlags &= ~SF_Aggregate;
/* Create the ORDER BY clause for the sub-select. This is the concatenation
** of the window PARTITION and ORDER BY clauses. Then, if this makes it
@@ -944,8 +933,8 @@ int sqlite3WindowRewrite(Parse *pParse, Select *p){
pMWin->iEphCsr = pParse->nTab++;
pParse->nTab += 3;
selectWindowRewriteEList(pParse, pMWin, pSrc, p->pEList, pTab, &pSublist);
selectWindowRewriteEList(pParse, pMWin, pSrc, p->pOrderBy, pTab, &pSublist);
selectWindowRewriteEList(pParse, pMWin, pSrc, p->pEList, &pSublist);
selectWindowRewriteEList(pParse, pMWin, pSrc, p->pOrderBy, &pSublist);
pMWin->nBufferCol = (pSublist ? pSublist->nExpr : 0);
/* Append the PARTITION BY and ORDER BY expressions to the to the
@@ -987,19 +976,16 @@ int sqlite3WindowRewrite(Parse *pParse, Select *p){
);
p->pSrc = sqlite3SrcListAppend(pParse, 0, 0, 0);
if( p->pSrc ){
Table *pTab2;
p->pSrc->a[0].pSelect = pSub;
sqlite3SrcListAssignCursors(pParse, p->pSrc);
pSub->selFlags |= SF_Expanded;
pTab2 = sqlite3ResultSetOfSelect(pParse, pSub);
if( pTab2==0 ){
if( sqlite3ExpandSubquery(pParse, &p->pSrc->a[0]) ){
rc = SQLITE_NOMEM;
}else{
memcpy(pTab, pTab2, sizeof(Table));
pTab->tabFlags |= TF_Ephemeral;
p->pSrc->a[0].pTab = pTab;
pTab = pTab2;
pSub->selFlags |= SF_Expanded;
p->selFlags &= ~SF_Aggregate;
sqlite3SelectPrep(pParse, pSub, 0);
}
sqlite3VdbeAddOp2(v, OP_OpenEphemeral, pMWin->iEphCsr, pSublist->nExpr);
sqlite3VdbeAddOp2(v, OP_OpenDup, pMWin->iEphCsr+1, pMWin->iEphCsr);
sqlite3VdbeAddOp2(v, OP_OpenDup, pMWin->iEphCsr+2, pMWin->iEphCsr);
@@ -1008,7 +994,6 @@ int sqlite3WindowRewrite(Parse *pParse, Select *p){
sqlite3SelectDelete(db, pSub);
}
if( db->mallocFailed ) rc = SQLITE_NOMEM;
sqlite3DbFree(db, pTab);
}
return rc;
@@ -1196,14 +1181,17 @@ void sqlite3WindowChain(Parse *pParse, Window *pWin, Window *pList){
void sqlite3WindowAttach(Parse *pParse, Expr *p, Window *pWin){
if( p ){
assert( p->op==TK_FUNCTION );
assert( pWin );
p->y.pWin = pWin;
ExprSetProperty(p, EP_WinFunc);
pWin->pOwner = p;
if( (p->flags & EP_Distinct) && pWin->eFrmType!=TK_FILTER ){
sqlite3ErrorMsg(pParse,
"DISTINCT is not supported for window functions"
);
/* This routine is only called for the parser. If pWin was not
** allocated due to an OOM, then the parser would fail before ever
** invoking this routine */
if( ALWAYS(pWin) ){
p->y.pWin = pWin;
ExprSetProperty(p, EP_WinFunc);
pWin->pOwner = p;
if( p->flags & EP_Distinct ){
sqlite3ErrorMsg(pParse,
"DISTINCT is not supported for window functions");
}
}
}else{
sqlite3WindowDelete(pParse->db, pWin);
@@ -1214,7 +1202,7 @@ void sqlite3WindowAttach(Parse *pParse, Expr *p, Window *pWin){
** Return 0 if the two window objects are identical, or non-zero otherwise.
** Identical window objects can be processed in a single scan.
*/
int sqlite3WindowCompare(Parse *pParse, Window *p1, Window *p2, int bFilter){
int sqlite3WindowCompare(Parse *pParse, Window *p1, Window *p2){
if( p1->eFrmType!=p2->eFrmType ) return 1;
if( p1->eStart!=p2->eStart ) return 1;
if( p1->eEnd!=p2->eEnd ) return 1;
@@ -1223,9 +1211,6 @@ int sqlite3WindowCompare(Parse *pParse, Window *p1, Window *p2, int bFilter){
if( sqlite3ExprCompare(pParse, p1->pEnd, p2->pEnd, -1) ) return 1;
if( sqlite3ExprListCompare(p1->pPartition, p2->pPartition, -1) ) return 1;
if( sqlite3ExprListCompare(p1->pOrderBy, p2->pOrderBy, -1) ) return 1;
if( bFilter ){
if( sqlite3ExprCompare(pParse, p1->pFilter, p2->pFilter, -1) ) return 1;
}
return 0;
}
+3 -20
View File
@@ -204,7 +204,6 @@ do_test 8.2.3 {
db2 eval { INSERT INTO t2 VALUES (1), (2), (3) }
db close
} {}
db2 close
#-------------------------------------------------------------------------
reset_db
@@ -214,28 +213,12 @@ do_execsql_test 9.1 {
SELECT true WHERE (SELECT a, b FROM (t1)) IN ();
END;
}
do_execsql_test 9.2 {
ALTER TABLE t1 RENAME TO t1x;
}
#-------------------------------------------------------------------------
reset_db
do_execsql_test 10.1 {
CREATE TABLE t1(a, b, c);
CREATE TABLE t2(a, b, c);
CREATE VIEW v1 AS SELECT * FROM t1 WHERE (
SELECT t1.a FROM t1, t2
) IN () OR t1.a=5;
}
do_execsql_test 10.2 {
ALTER TABLE t2 RENAME TO t3;
SELECT sql FROM sqlite_master WHERE name='v1';
} {
{CREATE VIEW v1 AS SELECT * FROM t1 WHERE (
SELECT t1.a FROM t1, t2
) IN () OR t1.a=5}
}
finish_test
-14
View File
@@ -123,20 +123,6 @@ do_execsql_test 2.1 {
SELECT sum(z) FROM vvv WHERE x='aaa'
) FROM one;
} {8.0}
do_execsql_test 2.2 {
DROP TABLE t1;
CREATE TABLE t1(aaa);
INSERT INTO t1(aaa) VALUES(9);
SELECT (
SELECT aaa FROM t1 GROUP BY (
SELECT bbb FROM (
SELECT ccc AS bbb FROM (
SELECT 1 ccc
) WHERE rowid IS NOT 1
) WHERE bbb = 1
)
);
} {9}
# Ticket https://www.sqlite.org/src/info/787fa716be3a7f65
# Segfault due to multiple uses of the same subquery where the
-20
View File
@@ -119,25 +119,5 @@ do_test between-1.5.3 {
}
} {4 2 25 27 sort t1 *}
#-------------------------------------------------------------------------
reset_db
do_execsql_test between-2.0 {
CREATE TABLE t1(x TEXT, y TEXT COLLATE nocase);
INSERT INTO t1 VALUES('0', 'abc');
}
foreach {tn expr res} {
1 "x BETWEEN 1 AND '5'" 0
2 "x COLLATE binary BETWEEN 1 AND '5'" 0
3 "x COLLATE nocase BETWEEN 1 AND '5'" 0
4 "y BETWEEN 'A' AND 'B'" 1
5 "y COLLATE nocase BETWEEN 'A' AND 'B'" 1
6 "y COLLATE binary BETWEEN 'A' AND 'B'" 0
7 "(y COLLATE binary) BETWEEN 'A' AND 'B'" 0
} {
set sql "SELECT $expr FROM t1"
do_execsql_test between-2.1.$tn $sql $res
}
finish_test
+24 -39
View File
@@ -183,34 +183,34 @@ do_test cast-1.53 {
execsql {SELECT CAST('123.5abc' AS integer)}
} 123
do_test cast-1.60 {
do_test case-1.60 {
execsql {SELECT CAST(null AS REAL)}
} {{}}
do_test cast-1.61 {
do_test case-1.61 {
execsql {SELECT typeof(CAST(null AS REAL))}
} {null}
do_test cast-1.62 {
do_test case-1.62 {
execsql {SELECT CAST(1 AS REAL)}
} {1.0}
do_test cast-1.63 {
do_test case-1.63 {
execsql {SELECT typeof(CAST(1 AS REAL))}
} {real}
do_test cast-1.64 {
do_test case-1.64 {
execsql {SELECT CAST('1' AS REAL)}
} {1.0}
do_test cast-1.65 {
do_test case-1.65 {
execsql {SELECT typeof(CAST('1' AS REAL))}
} {real}
do_test cast-1.66 {
do_test case-1.66 {
execsql {SELECT CAST('abc' AS REAL)}
} {0.0}
do_test cast-1.67 {
do_test case-1.67 {
execsql {SELECT typeof(CAST('abc' AS REAL))}
} {real}
do_test cast-1.68 {
do_test case-1.68 {
execsql {SELECT CAST(x'31' AS REAL)}
} {1.0}
do_test cast-1.69 {
do_test case-1.69 {
execsql {SELECT typeof(CAST(x'31' AS REAL))}
} {real}
@@ -299,7 +299,7 @@ if {[db eval {PRAGMA encoding}]=="UTF-8"} {
} 9223372036854774784
}
}
do_test cast-3.31 {
do_test case-3.31 {
execsql {SELECT CAST(NULL AS numeric)}
} {{}}
@@ -368,7 +368,7 @@ do_execsql_test cast-5.2 {
# ignored because it is no part of the integer prefix.
# EVIDENCE-OF: R-24225-46995 For example, "(CAST '123e+5' AS INTEGER)"
# results in 123, not in 12300000.
do_execsql_test cast-5.3 {
do_execsql_test case-5.3 {
SELECT CAST('123e+5' AS INTEGER);
SELECT CAST('123e+5' AS NUMERIC);
SELECT CAST('123e+5' AS REAL);
@@ -378,7 +378,7 @@ do_execsql_test cast-5.3 {
# The following does not have anything to do with the CAST operator,
# but it does deal with affinity transformations.
#
do_execsql_test cast-6.1 {
do_execsql_test case-6.1 {
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a NUMERIC);
INSERT INTO t1 VALUES
@@ -391,36 +391,38 @@ do_execsql_test cast-6.1 {
# 2019-06-07
# https://www.sqlite.org/src/info/4c2d7639f076aa7c
do_execsql_test cast-7.1 {
do_execsql_test case-7.1 {
SELECT CAST('-' AS NUMERIC);
} {0}
do_execsql_test cast-7.2 {
do_execsql_test case-7.2 {
SELECT CAST('-0' AS NUMERIC);
} {0}
do_execsql_test cast-7.3 {
do_execsql_test case-7.3 {
SELECT CAST('+' AS NUMERIC);
} {0}
do_execsql_test cast-7.4 {
do_execsql_test case-7.4 {
SELECT CAST('/' AS NUMERIC);
} {0}
# 2019-06-07
# https://www.sqlite.org/src/info/e8bedb2a184001bb
do_execsql_test cast-7.10 {
do_execsql_test case-7.10 {
SELECT '' - 2851427734582196970;
} {-2851427734582196970}
do_execsql_test cast-7.11 {
do_execsql_test case-7.11 {
SELECT 0 - 2851427734582196970;
} {-2851427734582196970}
do_execsql_test cast-7.12 {
do_execsql_test case-7.12 {
SELECT '' - 1;
} {-1}
# 2019-06-10
# https://www.sqlite.org/src/info/dd6bffbfb6e61db9
#
# EVIDENCE-OF: R-55084-10555 Casting a TEXT or BLOB value into NUMERIC
# yields either an INTEGER or a REAL result.
# EVIDENCE-OF: R-09295-61337 Casting a TEXT or BLOB value into NUMERIC
# first does a forced conversion into REAL but then further converts the
# result into INTEGER if and only if the conversion from REAL to INTEGER
# is lossless and reversible.
#
do_execsql_test cast-7.20 {
DROP TABLE IF EXISTS t0;
@@ -445,22 +447,5 @@ do_execsql_test cast-7.33 {
SELECT -CAST('.' AS numeric);
} 0
# 2019-06-12
# https://www.sqlite.org/src/info/674385aeba91c774
#
do_execsql_test cast-7.40 {
SELECT CAST('-0.0' AS numeric);
} 0
do_execsql_test cast-7.41 {
SELECT CAST('0.0' AS numeric);
} 0
do_execsql_test cast-7.42 {
SELECT CAST('+0.0' AS numeric);
} 0
do_execsql_test cast-7.43 {
SELECT CAST('-1.0' AS numeric);
} -1
finish_test
-16
View File
@@ -400,21 +400,5 @@ do_execsql_test 7.2 {
ORDER BY 1 COLLATE binary COLLATE binary COLLATE binary COLLATE nocase;
} {abc DEF}
# 2019-06-14
# https://sqlite.org/src/info/f1580ba1b574e9e9
#
do_execsql_test 8.0 {
SELECT ' ' > char(20) COLLATE rtrim;
} 0
do_execsql_test 8.1 {
SELECT '' < char(20) COLLATE rtrim;
} 1
do_execsql_test 8.2 {
DROP TABLE IF EXISTS t0;
CREATE TABLE t0(c0 COLLATE RTRIM, c1 BLOB UNIQUE,
PRIMARY KEY (c0, c1)) WITHOUT ROWID;
INSERT INTO t0 VALUES (123, 3), (' ', 1), (' ', 2), ('', 4);
SELECT * FROM t0 WHERE c1 = 1;
} {{ } 1}
finish_test
-2
View File
@@ -377,7 +377,6 @@ int main(int argc, char **argv){
free(pIn);
}
}
#ifdef RUSAGE_SELF
if( eVerbosity>0 ){
struct rusage x;
printf("SQLite %s\n", sqlite3_sourceid());
@@ -386,7 +385,6 @@ int main(int argc, char **argv){
printf("Maximum RSS = %ld KB\n", x.ru_maxrss);
}
}
#endif
return 0;
}
#endif /*STANDALONE*/
+4 -28
View File
@@ -1644,40 +1644,16 @@ do_expr_test e_expr-31.2.4 {
} integer 9223372036854775807
# EVIDENCE-OF: R-55084-10555 Casting a TEXT or BLOB value into NUMERIC
# yields either an INTEGER or a REAL result.
#
# EVIDENCE-OF: R-48945-04866 If the input text looks like an integer
# (there is no decimal point nor exponent) and the value is small enough
# to fit in a 64-bit signed integer, then the result will be INTEGER.
#
# EVIDENCE-OF: R-47045-23194 Input text that looks like floating point
# (there is a decimal point and/or an exponent) and the text describes a
# value that can be losslessly converted back and forth between IEEE 754
# 64-bit float and a 51-bit signed integer, then the result is INTEGER.
# EVIDENCE-OF: R-09295-61337 Casting a TEXT or BLOB value into NUMERIC
# first does a forced conversion into REAL but then further converts the
# result into INTEGER if and only if the conversion from REAL to INTEGER
# is lossless and reversible.
#
do_expr_test e_expr-32.1.1 { CAST('45' AS NUMERIC) } integer 45
do_expr_test e_expr-32.1.2 { CAST('45.0' AS NUMERIC) } integer 45
do_expr_test e_expr-32.1.3 { CAST('45.2' AS NUMERIC) } real 45.2
do_expr_test e_expr-32.1.4 { CAST('11abc' AS NUMERIC) } integer 11
do_expr_test e_expr-32.1.5 { CAST('11.1abc' AS NUMERIC) } real 11.1
do_expr_test e_expr-32.1.6 {CAST( '9.223372036e14' AS NUMERIC)} integer 922337203600000
do_expr_test e_expr-32.1.7 {CAST('-9.223372036e14' AS NUMERIC)} integer -922337203600000
do_expr_test e_expr-32.1.8 {CAST( '9.223372036e15' AS NUMERIC)} real 9223372036000000.0
do_expr_test e_expr-32.1.9 {CAST('-9.223372036e15' AS NUMERIC)} real -9223372036000000.0
# EVIDENCE-OF: R-50300-26941 Any text input that describes a value
# outside the range of a 64-bit signed integer yields a REAL result.
#
do_expr_test e_expr-32.1.20 { CAST('9223372036854775807' AS numeric) } \
integer 9223372036854775807
do_expr_test e_expr-32.1.21 { CAST('9223372036854775808' AS numeric) } \
real 9.22337203685478e+18
do_expr_test e_expr-32.1.22 { CAST('-9223372036854775808' AS numeric) } \
integer -9223372036854775808
do_expr_test e_expr-32.1.23 { CAST('-9223372036854775809' AS numeric) } \
real -9.22337203685478e+18
# EVIDENCE-OF: R-30347-18702 Casting a REAL or INTEGER value to NUMERIC
# is a no-op, even if a real value could be losslessly converted to an
-106
View File
@@ -1,106 +0,0 @@
# 2018 May 8
#
# 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.
#
#***********************************************************************
# This file implements regression tests for SQLite library.
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
set testprefix filter1
ifcapable !windowfunc {
finish_test
return
}
do_execsql_test 1.0 {
CREATE TABLE t1(a);
CREATE INDEX i1 ON t1(a);
INSERT INTO t1 VALUES(1), (2), (3), (4), (5), (6), (7), (8), (9);
}
do_execsql_test 1.1 { SELECT sum(a) FROM t1; } 45
do_execsql_test 1.2 { SELECT sum(a) FILTER( WHERE a<5 ) FROM t1; } 10
do_execsql_test 1.3 {
SELECT sum(a) FILTER( WHERE a>9 ),
sum(a) FILTER( WHERE a>8 ),
sum(a) FILTER( WHERE a>7 ),
sum(a) FILTER( WHERE a>6 ),
sum(a) FILTER( WHERE a>5 ),
sum(a) FILTER( WHERE a>4 ),
sum(a) FILTER( WHERE a>3 ),
sum(a) FILTER( WHERE a>2 ),
sum(a) FILTER( WHERE a>1 ),
sum(a) FILTER( WHERE a>0 )
FROM t1;
} {{} 9 17 24 30 35 39 42 44 45}
do_execsql_test 1.4 {
SELECT max(a) FILTER (WHERE (a % 2)==0) FROM t1
} {8}
do_execsql_test 1.5 {
SELECT min(a) FILTER (WHERE a>4) FROM t1
} {5}
do_execsql_test 1.6 {
SELECT count(*) FILTER (WHERE a!=5) FROM t1
} {8}
do_execsql_test 1.7 {
SELECT min(a) FILTER (WHERE a>3) FROM t1 GROUP BY (a%2) ORDER BY 1;
} {4 5}
do_execsql_test 1.8 {
CREATE VIEW vv AS
SELECT sum(a) FILTER( WHERE a>9 ),
sum(a) FILTER( WHERE a>8 ),
sum(a) FILTER( WHERE a>7 ),
sum(a) FILTER( WHERE a>6 ),
sum(a) FILTER( WHERE a>5 ),
sum(a) FILTER( WHERE a>4 ),
sum(a) FILTER( WHERE a>3 ),
sum(a) FILTER( WHERE a>2 ),
sum(a) FILTER( WHERE a>1 ),
sum(a) FILTER( WHERE a>0 )
FROM t1;
SELECT * FROM vv;
} {{} 9 17 24 30 35 39 42 44 45}
#-------------------------------------------------------------------------
# Test some errors:
#
# .1 FILTER on a non-aggregate function,
# .2 Window function in FILTER clause,
# .3 Aggregate function in FILTER clause,
#
reset_db
do_execsql_test 2.0 {
CREATE TABLE t1(a);
INSERT INTO t1 VALUES(1), (2), (3), (4), (5), (6), (7), (8), (9);
}
do_catchsql_test 2.1 {
SELECT upper(a) FILTER (WHERE a=1) FROM t1
} {1 {filter clause may not be used with non-aggregate upper()}}
do_catchsql_test 2.2 {
SELECT sum(a) FILTER (WHERE 1 - max(a) OVER () > 0) FROM t1
} {1 {misuse of window function max()}}
do_catchsql_test 2.3 {
SELECT sum(a) FILTER (WHERE 1 - count(a)) FROM t1
} {1 {misuse of aggregate function count()}}
finish_test
-132
View File
@@ -1,132 +0,0 @@
# 2018 May 19
#
# 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.
#
#***********************************************************************
#
source [file join [file dirname $argv0] pg_common.tcl]
#=========================================================================
start_test filter2 "2019 July 2"
ifcapable !windowfunc
execsql_test 1.0 {
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b INTEGER);
INSERT INTO t1 VALUES
(1, 7), (2, 3), (3, 5), (4, 30), (5, 26), (6, 23), (7, 27),
(8, 3), (9, 17), (10, 26), (11, 33), (12, 25), (13, NULL), (14, 47),
(15, 36), (16, 13), (17, 45), (18, 31), (19, 11), (20, 36), (21, 37),
(22, 21), (23, 22), (24, 14), (25, 16), (26, 3), (27, 7), (28, 29),
(29, 50), (30, 38), (31, 3), (32, 36), (33, 12), (34, 4), (35, 46),
(36, 3), (37, 48), (38, 23), (39, NULL), (40, 24), (41, 5), (42, 46),
(43, 11), (44, NULL), (45, 18), (46, 25), (47, 15), (48, 18), (49, 23);
}
execsql_test 1.1 { SELECT sum(b) FROM t1 }
execsql_test 1.2 { SELECT sum(b) FILTER (WHERE a<10) FROM t1 }
execsql_test 1.3 { SELECT count(DISTINCT b) FROM t1 }
execsql_test 1.4 { SELECT count(DISTINCT b) FILTER (WHERE a!=19) FROM t1 }
execsql_test 1.5 {
SELECT min(b) FILTER (WHERE a>19),
min(b) FILTER (WHERE a>0),
max(a+b) FILTER (WHERE a>19),
max(b+a) FILTER (WHERE a BETWEEN 10 AND 40)
FROM t1;
}
execsql_test 1.6 {
SELECT min(b),
min(b),
max(a+b),
max(b+a)
FROM t1
GROUP BY (a%10)
ORDER BY 1, 2, 3, 4;
}
execsql_test 1.7 {
SELECT min(b) FILTER (WHERE a>19),
min(b) FILTER (WHERE a>0),
max(a+b) FILTER (WHERE a>19),
max(b+a) FILTER (WHERE a BETWEEN 10 AND 40)
FROM t1
GROUP BY (a%10)
ORDER BY 1, 2, 3, 4;
}
execsql_test 1.8 {
SELECT sum(a+b) FILTER (WHERE a=NULL) FROM t1
}
execsql_test 1.9 {
SELECT (a%5) FROM t1 GROUP BY (a%5)
HAVING sum(b) FILTER (WHERE b<20) > 34
ORDER BY 1
}
execsql_test 1.10 {
SELECT (a%5), sum(b) FILTER (WHERE b<20) AS bbb
FROM t1
GROUP BY (a%5) HAVING sum(b) FILTER (WHERE b<20) >34
ORDER BY 1
}
execsql_test 1.11 {
SELECT (a%5), sum(b) FILTER (WHERE b<20) AS bbb
FROM t1
GROUP BY (a%5) HAVING sum(b) FILTER (WHERE b<20) >34
ORDER BY 2
}
execsql_test 1.12 {
SELECT (a%5),
sum(b) FILTER (WHERE b<20) AS bbb,
count(distinct b) FILTER (WHERE b<20 OR a=13) AS ccc
FROM t1 GROUP BY (a%5)
ORDER BY 2
}
execsql_test 1.13 {
SELECT
string_agg(CAST(b AS TEXT), '_') FILTER (WHERE b%2!=0),
string_agg(CAST(b AS TEXT), '_') FILTER (WHERE b%2!=1),
count(*) FILTER (WHERE b%2!=0),
count(*) FILTER (WHERE b%2!=1)
FROM t1;
}
execsql_float_test 1.14 {
SELECT
avg(b) FILTER (WHERE b>a),
avg(b) FILTER (WHERE b<a)
FROM t1 GROUP BY (a%2) ORDER BY 1,2;
}
execsql_test 1.15 {
SELECT
a/5,
sum(b) FILTER (WHERE a%5=0),
sum(b) FILTER (WHERE a%5=1),
sum(b) FILTER (WHERE a%5=2),
sum(b) FILTER (WHERE a%5=3),
sum(b) FILTER (WHERE a%5=4)
FROM t1 GROUP BY (a/5) ORDER BY 1;
}
finish_test
-156
View File
@@ -1,156 +0,0 @@
# 2019 July 2
#
# 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.
#
#***********************************************************************
# This file implements regression tests for SQLite library.
#
####################################################
# DO NOT EDIT! THIS FILE IS AUTOMATICALLY GENERATED!
####################################################
set testdir [file dirname $argv0]
source $testdir/tester.tcl
set testprefix filter2
ifcapable !windowfunc { finish_test ; return }
do_execsql_test 1.0 {
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b INTEGER);
INSERT INTO t1 VALUES
(1, 7), (2, 3), (3, 5), (4, 30), (5, 26), (6, 23), (7, 27),
(8, 3), (9, 17), (10, 26), (11, 33), (12, 25), (13, NULL), (14, 47),
(15, 36), (16, 13), (17, 45), (18, 31), (19, 11), (20, 36), (21, 37),
(22, 21), (23, 22), (24, 14), (25, 16), (26, 3), (27, 7), (28, 29),
(29, 50), (30, 38), (31, 3), (32, 36), (33, 12), (34, 4), (35, 46),
(36, 3), (37, 48), (38, 23), (39, NULL), (40, 24), (41, 5), (42, 46),
(43, 11), (44, NULL), (45, 18), (46, 25), (47, 15), (48, 18), (49, 23);
} {}
do_execsql_test 1.1 {
SELECT sum(b) FROM t1
} {1041}
do_execsql_test 1.2 {
SELECT sum(b) FILTER (WHERE a<10) FROM t1
} {141}
do_execsql_test 1.3 {
SELECT count(DISTINCT b) FROM t1
} {31}
do_execsql_test 1.4 {
SELECT count(DISTINCT b) FILTER (WHERE a!=19) FROM t1
} {31}
do_execsql_test 1.5 {
SELECT min(b) FILTER (WHERE a>19),
min(b) FILTER (WHERE a>0),
max(a+b) FILTER (WHERE a>19),
max(b+a) FILTER (WHERE a BETWEEN 10 AND 40)
FROM t1;
} {3 3 88 85}
do_execsql_test 1.6 {
SELECT min(b),
min(b),
max(a+b),
max(b+a)
FROM t1
GROUP BY (a%10)
ORDER BY 1, 2, 3, 4;
} {3 3 58 58 3 3 66 66 3 3 71 71 3 3 88 88 4 4 61 61 5 5 54 54
7 7 85 85 11 11 79 79 16 16 81 81 24 24 68 68}
do_execsql_test 1.7 {
SELECT min(b) FILTER (WHERE a>19),
min(b) FILTER (WHERE a>0),
max(a+b) FILTER (WHERE a>19),
max(b+a) FILTER (WHERE a BETWEEN 10 AND 40)
FROM t1
GROUP BY (a%10)
ORDER BY 1, 2, 3, 4;
} {3 3 58 58 3 3 71 39 4 4 38 61 7 7 85 85 11 5 54 45 16 16 81 81
18 3 66 61 21 3 88 68 23 11 79 79 24 24 68 68}
do_execsql_test 1.8 {
SELECT sum(a+b) FILTER (WHERE a=NULL) FROM t1
} {{}}
do_execsql_test 1.9 {
SELECT (a%5) FROM t1 GROUP BY (a%5)
HAVING sum(b) FILTER (WHERE b<20) > 34
ORDER BY 1
} {3 4}
do_execsql_test 1.10 {
SELECT (a%5), sum(b) FILTER (WHERE b<20) AS bbb
FROM t1
GROUP BY (a%5) HAVING sum(b) FILTER (WHERE b<20) >34
ORDER BY 1
} {3 49 4 46}
do_execsql_test 1.11 {
SELECT (a%5), sum(b) FILTER (WHERE b<20) AS bbb
FROM t1
GROUP BY (a%5) HAVING sum(b) FILTER (WHERE b<20) >34
ORDER BY 2
} {4 46 3 49}
do_execsql_test 1.12 {
SELECT (a%5),
sum(b) FILTER (WHERE b<20) AS bbb,
count(distinct b) FILTER (WHERE b<20 OR a=13) AS ccc
FROM t1 GROUP BY (a%5)
ORDER BY 2
} {2 25 3 0 34 2 1 34 4 4 46 4 3 49 5}
do_execsql_test 1.13 {
SELECT
group_concat(CAST(b AS TEXT), '_') FILTER (WHERE b%2!=0),
group_concat(CAST(b AS TEXT), '_') FILTER (WHERE b%2!=1),
count(*) FILTER (WHERE b%2!=0),
count(*) FILTER (WHERE b%2!=1)
FROM t1;
} {7_3_5_23_27_3_17_33_25_47_13_45_31_11_37_21_3_7_29_3_3_23_5_11_25_15_23 30_26_26_36_36_22_14_16_50_38_36_12_4_46_48_24_46_18_18 27 19}
do_test 1.14 {
set myres {}
foreach r [db eval {SELECT
avg(b) FILTER (WHERE b>a),
avg(b) FILTER (WHERE b<a)
FROM t1 GROUP BY (a%2) ORDER BY 1,2;}] {
lappend myres [format %.4f [set r]]
}
set res2 {30.8333 13.7273 31.4167 13.0000}
set i 0
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
incr i
}
set {} {}
} {}
do_execsql_test 1.15 {
SELECT
a/5,
sum(b) FILTER (WHERE a%5=0),
sum(b) FILTER (WHERE a%5=1),
sum(b) FILTER (WHERE a%5=2),
sum(b) FILTER (WHERE a%5=3),
sum(b) FILTER (WHERE a%5=4)
FROM t1 GROUP BY (a/5) ORDER BY 1;
} {0 {} 7 3 5 30 1 26 23 27 3 17 2 26 33 25 {} 47 3 36 13 45 31 11
4 36 37 21 22 14 5 16 3 7 29 50 6 38 3 36 12 4 7 46 3 48 23 {}
8 24 5 46 11 {} 9 18 25 15 18 23}
finish_test
BIN
View File
Binary file not shown.
-27
View File
@@ -13,7 +13,6 @@
set testdir [file dirname $argv0]
source $testdir/tester.tcl
set testprefix json104
ifcapable !json1 {
finish_test
@@ -126,32 +125,6 @@ do_execsql_test json104-314 {
SELECT json_patch('{}','{"a":{"bb":{"ccc":null}}}');
} {{{"a":{"bb":{}}}}}
#-------------------------------------------------------------------------
do_execsql_test 401 {
CREATE TABLE obj(x);
INSERT INTO obj VALUES('{"a":1,"b":2}');
SELECT * FROM obj;
} {{{"a":1,"b":2}}}
do_execsql_test 402 {
UPDATE obj SET x = json_insert(x, '$.c', 3);
SELECT * FROM obj;
} {{{"a":1,"b":2,"c":3}}}
do_execsql_test 403 {
SELECT json_extract(x, '$.b') FROM obj;
SELECT json_extract(x, '$."b"') FROM obj;
} {2 2}
do_execsql_test 404 {
UPDATE obj SET x = json_set(x, '$."b"', 555);
SELECT json_extract(x, '$.b') FROM obj;
SELECT json_extract(x, '$."b"') FROM obj;
} {555 555}
do_execsql_test 405 {
UPDATE obj SET x = json_set(x, '$."d"', 4);
SELECT json_extract(x, '$."d"') FROM obj;
} {4}
finish_test
-9
View File
@@ -198,15 +198,6 @@ do_execsql_test like3-5.400 {
SELECT * FROM t0 WHERE t0.c0 LIKE './';
} {./}
# 2019-06-14
# Ticket https://www.sqlite.org/src/info/ce8717f0885af975
do_execsql_test like3-5.410 {
DROP TABLE IF EXISTS t0;
CREATE TABLE t0(c0 INT UNIQUE COLLATE NOCASE);
INSERT INTO t0(c0) VALUES ('.1%');
SELECT * FROM t0 WHERE t0.c0 LIKE '.1%';
} {.1%}
# 2019-02-27
# Verify that the LIKE optimization works with an ESCAPE clause when
+1 -1
View File
@@ -966,7 +966,7 @@ test_suite "journaltest" -description {
async4.test bigfile.test backcompat.test e_wal* fstat.test mmap2.test
pager1.test syscall.test tkt3457.test *malloc* mmap* multiplex* nolock*
pager2.test *fault* rowal* snapshot* superlock* symlink.test
delete_db.test shmlock.test chunksize.test
delete_db.test shmlock.test
}]
if {[info commands register_demovfs] != ""} {
-2
View File
@@ -92,8 +92,6 @@ do_test quote-1.6 {
# SQLite can load such a schema from disk.
#
reset_db
sqlite3_db_config db SQLITE_DBCONFIG_DQS_DDL 0
sqlite3_db_config db SQLITE_DBCONFIG_DQS_DML 1
do_execsql_test 2.0 {
CREATE TABLE t1(x, y, z);
}
+1 -1
View File
@@ -281,7 +281,7 @@ array set ::Platforms [strip_comments {
"User-Auth" tcltest
"Update-Delete-Limit" test
"Extra-Robustness" test
"Device-Two" "threadtest test"
"Device-Two" test
"No-lookaside" test
"Devkit" test
"Apple" test
+1 -1
View File
@@ -246,7 +246,7 @@ array set ::Platforms [strip_comments {
"User-Auth" tcltest
"Update-Delete-Limit" test
"Extra-Robustness" test
"Device-Two" "threadtest test"
"Device-Two" test
"No-lookaside" test
"Devkit" test
"Apple" test
-17
View File
@@ -197,22 +197,5 @@ foreach {tn sql} {
}]
}
#-------------------------------------------------------------------------
# Test that ticket [9cdc5c46] is fixed.
#
reset_db
do_execsql_test 5.0 {
CREATE TABLE t1(x);
INSERT INTO t1 VALUES('ALFKI');
INSERT INTO t1 VALUES('ANATR');
CREATE TABLE t2(y, z);
CREATE INDEX t2y ON t2 (y);
INSERT INTO t2 VALUES('ANATR', '1997-08-08 00:00:00');
INSERT INTO t2 VALUES('ALFKI', '1997-08-25 00:00:00');
}
do_execsql_test 5.1 {
SELECT ( SELECT y FROM t2 WHERE x = y ORDER BY y, z) FROM t1;
} {ALFKI ANATR}
finish_test
+1 -1
View File
@@ -41,7 +41,7 @@ do_test tkt-78e04-1.3 {
}
} {}
do_test tkt-78e04-1.4 {
db eval {EXPLAIN QUERY PLAN SELECT "" FROM "" WHERE "" LIKE '1e5%';}
db eval {EXPLAIN QUERY PLAN SELECT "" FROM "" WHERE "" LIKE '1abc%';}
} {/*SCAN TABLE USING COVERING INDEX i1*/}
do_test tkt-78e04-1.5 {
execsql {
+5 -11
View File
@@ -1311,13 +1311,10 @@ foreach {tn sql res filter} {
{xFilter {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ?} 8 9}
1.3 "SELECT a FROM e6 WHERE b LIKE '8J%'" {3 4}
{xFilter {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b like ?} 8J 8k 8J%}
{xFilter {SELECT rowid, a, b FROM 't6' WHERE b like ?} 8J%}
1.4 "SELECT a FROM e6 WHERE b LIKE '8j%'" {3 4}
{xFilter {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b like ?} 8J 8k 8j%}
1.5 "SELECT a FROM e6 WHERE b LIKE '8%'" {3 4}
{xFilter {SELECT rowid, a, b FROM 't6' WHERE b like ?} 8%}
{xFilter {SELECT rowid, a, b FROM 't6' WHERE b like ?} 8j%}
} {
set echo_module {}
do_execsql_test 18.$tn.1 $sql $res
@@ -1326,14 +1323,11 @@ foreach {tn sql res filter} {
do_execsql_test 18.2.0 { PRAGMA case_sensitive_like = ON }
foreach {tn sql res filter} {
2.1 "SELECT a FROM e6 WHERE b LIKE '8%'" {3 4}
{xFilter {SELECT rowid, a, b FROM 't6' WHERE b like ?} 8%}
2.1 "SELECT a FROM e6 WHERE b LIKE '8J%'" {3 4}
{xFilter {SELECT rowid, a, b FROM 't6' WHERE b like ?} 8J%}
2.2 "SELECT a FROM e6 WHERE b LIKE '8j%'" {}
{xFilter {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b like ?} 8j 8k 8j%}
2.3 "SELECT a FROM e6 WHERE b LIKE '8J%'" {3 4}
{xFilter {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b like ?} 8J 8K 8J%}
{xFilter {SELECT rowid, a, b FROM 't6' WHERE b like ?} 8j%}
} {
set echo_module {}
do_execsql_test 18.$tn.1 $sql $res
+3 -17
View File
@@ -32,27 +32,13 @@ do_execsql_test 1.0 {
foreach {tn sql expect} {
1 "SELECT * FROM e6 WHERE b LIKE '8abc'" {
xBestIndex
{SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b like ?}
xFilter
{SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b like ?}
8ABC 8abd 8abc
xBestIndex {SELECT rowid, a, b FROM 't6' WHERE b like ?}
xFilter {SELECT rowid, a, b FROM 't6' WHERE b like ?} 8abc
}
2 "SELECT * FROM e6 WHERE b GLOB '8abc'" {
xBestIndex
{SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b glob ?}
xFilter
{SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b glob ?}
8abc 8abd 8abc
}
3 "SELECT * FROM e6 WHERE b LIKE '8e/'" {
xBestIndex {SELECT rowid, a, b FROM 't6' WHERE b like ?}
xFilter {SELECT rowid, a, b FROM 't6' WHERE b like ?} 8e/
}
4 "SELECT * FROM e6 WHERE b GLOB '8e/'" {
xBestIndex {SELECT rowid, a, b FROM 't6' WHERE b glob ?}
xFilter {SELECT rowid, a, b FROM 't6' WHERE b glob ?} 8e/
xFilter {SELECT rowid, a, b FROM 't6' WHERE b glob ?} 8abc
}
} {
do_test 1.$tn {
+1 -1
View File
@@ -288,7 +288,7 @@ proc slave_test_done {name rc} {
wapptest_output $msg
if {[info exists G(test.$name.errmsg)] && $G(test.$name.errmsg)!=""} {
wapptest_output " $G(test.$name.errmsg)"
wapptest_output " $G(test.$config.errmsg)"
}
}
-7
View File
@@ -424,13 +424,6 @@ execsql_float_test 4.9 {
WINDOW win AS (ORDER BY 1);
}
execsql_test 4.10 {
SELECT count(*) OVER (ORDER BY b) FROM t1
}
execsql_test 4.11 {
SELECT count(distinct a) FILTER (WHERE b='odd') FROM t1
}
finish_test
-8
View File
@@ -893,12 +893,4 @@ do_test 4.9 {
set {} {}
} {}
do_execsql_test 4.10 {
SELECT count(*) OVER (ORDER BY b) FROM t1
} {3 3 3 6 6 6}
do_execsql_test 4.11 {
SELECT count(distinct a) FILTER (WHERE b='odd') FROM t1
} {3}
finish_test
-102
View File
@@ -1,102 +0,0 @@
# 2019 June 8
#
# 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.
#
#***********************************************************************
# This file implements regression tests for SQLite library.
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
set testprefix window9
ifcapable !windowfunc {
finish_test
return
}
do_execsql_test 1.0 {
CREATE TABLE fruits(
name TEXT COLLATE NOCASE,
color TEXT COLLATE NOCASE
);
}
do_execsql_test 1.1 {
INSERT INTO fruits (name, color) VALUES ('apple', 'RED');
INSERT INTO fruits (name, color) VALUES ('APPLE', 'yellow');
INSERT INTO fruits (name, color) VALUES ('pear', 'YELLOW');
INSERT INTO fruits (name, color) VALUES ('PEAR', 'green');
}
do_execsql_test 1.2 {
SELECT name, color, dense_rank() OVER (ORDER BY name) FROM fruits;
} {
apple RED 1
APPLE yellow 1
pear YELLOW 2
PEAR green 2
}
do_execsql_test 1.3 {
SELECT name, color,
dense_rank() OVER (PARTITION BY name ORDER BY color)
FROM fruits;
} {
apple RED 1
APPLE yellow 2
PEAR green 1
pear YELLOW 2
}
do_execsql_test 1.4 {
SELECT name, color,
dense_rank() OVER (ORDER BY name),
dense_rank() OVER (PARTITION BY name ORDER BY color)
FROM fruits;
} {
apple RED 1 1
APPLE yellow 1 2
PEAR green 2 1
pear YELLOW 2 2
}
do_execsql_test 1.5 {
SELECT name, color,
dense_rank() OVER (ORDER BY name),
dense_rank() OVER (PARTITION BY name ORDER BY color)
FROM fruits ORDER BY color;
} {
PEAR green 2 1
apple RED 1 1
APPLE yellow 1 2
pear YELLOW 2 2
}
do_execsql_test 2.0 {
CREATE TABLE t1(a BLOB, b INTEGER, c COLLATE nocase);
INSERT INTO t1 VALUES(1, 2, 'abc');
INSERT INTO t1 VALUES(3, 4, 'ABC');
}
do_execsql_test 2.1.1 {
SELECT c=='Abc' FROM t1
} {1 1}
do_execsql_test 2.1.2 {
SELECT c=='Abc', rank() OVER (ORDER BY b) FROM t1
} {1 1 1 2}
do_execsql_test 2.2.1 {
SELECT b=='2' FROM t1
} {1 0}
do_execsql_test 2.2.2 {
SELECT b=='2', rank() OVER (ORDER BY a) FROM t1
} {1 1 0 2}
finish_test
+1 -2
View File
@@ -209,7 +209,6 @@ proc tmpread_injectstop {} {
return $ret
}
set L [db eval {SELECT 0.0 FROM t}]
do_faultsim_test 9 -end 25 -faults tmpread -body {
execsql {
SELECT sum(y) OVER win FROM t
@@ -218,7 +217,7 @@ do_faultsim_test 9 -end 25 -faults tmpread -body {
)
}
} -test {
faultsim_test_result [list 0 $::L]
faultsim_test_result {0 {}}
}
catch {db close}