mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Merge the branch-3.28a fixes into branch-3.28.
FossilOrigin-Name: ba6bf331476d0217f4132b73cb3da559e75bfb21856ec94f82c0f0150a53592b
This commit is contained in:
22
manifest
22
manifest
@@ -1,5 +1,5 @@
|
|||||||
C Fix\sa\srounding\serror\scaused\sby\sscalar->logarithm->scalar\sconversion\swhen\susing\sstat4\sdata\sto\sestimate\ssome\srange\sscans.
|
C Merge\sthe\sbranch-3.28a\sfixes\sinto\sbranch-3.28.
|
||||||
D 2022-08-09T20:22:01.525
|
D 2022-08-10T17:03:43.321
|
||||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||||
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
||||||
@@ -518,12 +518,12 @@ F src/printf.c 67f79227273a9009d86a017619717c3f554f50b371294526da59faa6014ed2cd
|
|||||||
F src/random.c 80f5d666f23feb3e6665a6ce04c7197212a88384
|
F src/random.c 80f5d666f23feb3e6665a6ce04c7197212a88384
|
||||||
F src/resolve.c 567888ee3faec14dae06519b4306201771058364a37560186a3e0e755ebc4cb8
|
F src/resolve.c 567888ee3faec14dae06519b4306201771058364a37560186a3e0e755ebc4cb8
|
||||||
F src/rowset.c d977b011993aaea002cab3e0bb2ce50cf346000dff94e944d547b989f4b1fe93
|
F src/rowset.c d977b011993aaea002cab3e0bb2ce50cf346000dff94e944d547b989f4b1fe93
|
||||||
F src/select.c 3c78ea0e7039cbe5e342c4734ad96ef707269d4e9ea6f748f349c54d6c4b33ae
|
F src/select.c a75028a3d35a4e56f7428fd716d6340f0ca6666a98cd48af246ad450c093a5b1
|
||||||
F src/shell.c.in c1986496062f9dba4ed5b70db06b5e0f32e1954cdcfab0b30372c6c186796810
|
F src/shell.c.in c1986496062f9dba4ed5b70db06b5e0f32e1954cdcfab0b30372c6c186796810
|
||||||
F src/sqlite.h.in 59f5e145b8d7a915ca29c6bf4a1f00e3112c1605c9ac5c627c45060110332ba2
|
F src/sqlite.h.in 59f5e145b8d7a915ca29c6bf4a1f00e3112c1605c9ac5c627c45060110332ba2
|
||||||
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
|
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
|
||||||
F src/sqlite3ext.h 9ecc93b8493bd20c0c07d52e2ac0ed8bab9b549c7f7955b59869597b650dd8b5
|
F src/sqlite3ext.h 9ecc93b8493bd20c0c07d52e2ac0ed8bab9b549c7f7955b59869597b650dd8b5
|
||||||
F src/sqliteInt.h e19d89d6a1c24cded45b39f4bd9249c0222ded77681576675f91f035aca769c6
|
F src/sqliteInt.h 3d599ca87796deba6ebc5cab518262661c855ae31aa63eed0504223ec2339d13
|
||||||
F src/sqliteLimit.h 1513bfb7b20378aa0041e7022d04acb73525de35b80b252f1b83fedb4de6a76b
|
F src/sqliteLimit.h 1513bfb7b20378aa0041e7022d04acb73525de35b80b252f1b83fedb4de6a76b
|
||||||
F src/status.c 46e7aec11f79dad50965a5ca5fa9de009f7d6bde08be2156f1538a0a296d4d0e
|
F src/status.c 46e7aec11f79dad50965a5ca5fa9de009f7d6bde08be2156f1538a0a296d4d0e
|
||||||
F src/table.c b46ad567748f24a326d9de40e5b9659f96ffff34
|
F src/table.c b46ad567748f24a326d9de40e5b9659f96ffff34
|
||||||
@@ -737,7 +737,7 @@ F test/collate9.test 3adcc799229545940df2f25308dd1ad65869145a
|
|||||||
F test/collateA.test b8218ab90d1fa5c59dcf156efabb1b2599c580d6
|
F test/collateA.test b8218ab90d1fa5c59dcf156efabb1b2599c580d6
|
||||||
F test/collateB.test 1e68906951b846570f29f20102ed91d29e634854ee47454d725f2151ecac0b95
|
F test/collateB.test 1e68906951b846570f29f20102ed91d29e634854ee47454d725f2151ecac0b95
|
||||||
F test/colmeta.test 2c765ea61ee37bc43bbe6d6047f89004e6508eb1
|
F test/colmeta.test 2c765ea61ee37bc43bbe6d6047f89004e6508eb1
|
||||||
F test/colname.test fb28b3687e03625425bc216edf8b186ce974aa71008e2aa1f426a7dcb75a601d
|
F test/colname.test 87ad5458bb8709312dac0d6755fd30e8e4ca83298d0a9ef6e5c24277a3c3390e
|
||||||
F test/conflict.test c7cc007e2af151516ddf38f7412fe10d473a694f55e3df437e2c7b31c2590e8d
|
F test/conflict.test c7cc007e2af151516ddf38f7412fe10d473a694f55e3df437e2c7b31c2590e8d
|
||||||
F test/conflict2.test bb0b94cf7196c64a3cbd815c66d3ee98c2fecd9c
|
F test/conflict2.test bb0b94cf7196c64a3cbd815c66d3ee98c2fecd9c
|
||||||
F test/conflict3.test a83db76a6c3503b2fa057c7bfb08c318d8a422202d8bc5b86226e078e5b49ff9
|
F test/conflict3.test a83db76a6c3503b2fa057c7bfb08c318d8a422202d8bc5b86226e078e5b49ff9
|
||||||
@@ -1276,7 +1276,7 @@ F test/select6.test 39eac4a5c03650b2b473c532882273283ee8b7a0
|
|||||||
F test/select7.test f659f231489349e8c5734e610803d7654207318f
|
F test/select7.test f659f231489349e8c5734e610803d7654207318f
|
||||||
F test/select8.test 8c8f5ae43894c891efc5755ed905467d1d67ad5d
|
F test/select8.test 8c8f5ae43894c891efc5755ed905467d1d67ad5d
|
||||||
F test/select9.test aebc2bb0c3bc44606125033cbcaac2c8d1f33a95
|
F test/select9.test aebc2bb0c3bc44606125033cbcaac2c8d1f33a95
|
||||||
F test/selectA.test b8a590f6493cad5b0bb4dfe1709bf7dcda0b6c40bb4caf32d1e36a89eebc8fc5
|
F test/selectA.test 68de52409e45a3313d00b8461b48bef4fb729faf36ade9067a994eae55cc86f4
|
||||||
F test/selectB.test 954e4e49cf1f896d61794e440669e03a27ceea25
|
F test/selectB.test 954e4e49cf1f896d61794e440669e03a27ceea25
|
||||||
F test/selectC.test e25243f8ca503e06f252eb0218976d07cfeceac3
|
F test/selectC.test e25243f8ca503e06f252eb0218976d07cfeceac3
|
||||||
F test/selectD.test fc20452847a01775710090383cfb4423275d2f745fed61f34fbf37573ac0d214
|
F test/selectD.test fc20452847a01775710090383cfb4423275d2f745fed61f34fbf37573ac0d214
|
||||||
@@ -1684,7 +1684,7 @@ F test/win32heap.test 10fd891266bd00af68671e702317726375e5407561d859be1aa04696f2
|
|||||||
F test/win32lock.test fbf107c91d8f5512be5a5b87c4c42ab9fdd54972
|
F test/win32lock.test fbf107c91d8f5512be5a5b87c4c42ab9fdd54972
|
||||||
F test/win32longpath.test 169c75a3b2e43481f4a62122510210c67b08f26d
|
F test/win32longpath.test 169c75a3b2e43481f4a62122510210c67b08f26d
|
||||||
F test/win32nolock.test ac4f08811a562e45a5755e661f45ca85892bdbbc
|
F test/win32nolock.test ac4f08811a562e45a5755e661f45ca85892bdbbc
|
||||||
F test/window1.test 8d453bfaa3f8f0873ba16ca1270c7368f18445065a0003a1b5954ac4e95797b4
|
F test/window1.test 2a692388f8919bbe70676136e4c969ab8aa6af83bbd327b46cb58a7f6fb23202
|
||||||
F test/window2.tcl 9bfa842d8a62b0d36dc8c1b5972206393c43847433c6d75940b87fec93ce3143
|
F test/window2.tcl 9bfa842d8a62b0d36dc8c1b5972206393c43847433c6d75940b87fec93ce3143
|
||||||
F test/window2.test 8e6d2a1b9f54dfebee1cde961c8590cd87b4db45c50f44947a211e1b63c2a05e
|
F test/window2.test 8e6d2a1b9f54dfebee1cde961c8590cd87b4db45c50f44947a211e1b63c2a05e
|
||||||
F test/window3.tcl acea6e86a4324a210fd608d06741010ca83ded9fde438341cb978c49928faf03
|
F test/window3.tcl acea6e86a4324a210fd608d06741010ca83ded9fde438341cb978c49928faf03
|
||||||
@@ -1819,9 +1819,9 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
|
|||||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||||
P 263293f1e6db26039d94c9ed7efa2cdea25df5e5f42673a116ce2d03b9fadff4
|
P 68d86f2b20ffa815f9f6bc1b402969ce76651a50e5b6f47daa8b6c8f5e696f52 d2e672203704aa18fdc652e9567eb29b71dae32e871f514308478a7a96025f29
|
||||||
Q +86e30d7c4bb1cebe25b66686d6d1ee170c1a88e5a6c1bed6652ebbb024d62062
|
R 88ef982e5e56f20bd999e4280ab176a8
|
||||||
R e66630f522d53c9737288eaeca403808
|
T +closed d2e672203704aa18fdc652e9567eb29b71dae32e871f514308478a7a96025f29
|
||||||
U drh
|
U drh
|
||||||
Z be09c684553cac509a2534656a541682
|
Z ec095a6c54b68c4641d9afdfd01f70d2
|
||||||
# Remove this line to create a well-formed Fossil manifest.
|
# Remove this line to create a well-formed Fossil manifest.
|
||||||
|
@@ -1 +1 @@
|
|||||||
68d86f2b20ffa815f9f6bc1b402969ce76651a50e5b6f47daa8b6c8f5e696f52
|
ba6bf331476d0217f4132b73cb3da559e75bfb21856ec94f82c0f0150a53592b
|
10
src/select.c
10
src/select.c
@@ -1643,8 +1643,6 @@ static const char *columnTypeImpl(
|
|||||||
|
|
||||||
assert( pExpr!=0 );
|
assert( pExpr!=0 );
|
||||||
assert( pNC->pSrcList!=0 );
|
assert( pNC->pSrcList!=0 );
|
||||||
assert( pExpr->op!=TK_AGG_COLUMN ); /* This routine runes before aggregates
|
|
||||||
** are processed */
|
|
||||||
switch( pExpr->op ){
|
switch( pExpr->op ){
|
||||||
case TK_COLUMN: {
|
case TK_COLUMN: {
|
||||||
/* The expression is a column. Locate the table the column is being
|
/* The expression is a column. Locate the table the column is being
|
||||||
@@ -1966,7 +1964,6 @@ int sqlite3ColumnsFromExprList(
|
|||||||
pColExpr = pColExpr->pRight;
|
pColExpr = pColExpr->pRight;
|
||||||
assert( pColExpr!=0 );
|
assert( pColExpr!=0 );
|
||||||
}
|
}
|
||||||
assert( pColExpr->op!=TK_AGG_COLUMN );
|
|
||||||
if( pColExpr->op==TK_COLUMN ){
|
if( pColExpr->op==TK_COLUMN ){
|
||||||
/* For columns use the column name name */
|
/* For columns use the column name name */
|
||||||
int iCol = pColExpr->iColumn;
|
int iCol = pColExpr->iColumn;
|
||||||
@@ -2692,9 +2689,7 @@ static int multiSelect(
|
|||||||
selectOpName(p->op)));
|
selectOpName(p->op)));
|
||||||
rc = sqlite3Select(pParse, p, &uniondest);
|
rc = sqlite3Select(pParse, p, &uniondest);
|
||||||
testcase( rc!=SQLITE_OK );
|
testcase( rc!=SQLITE_OK );
|
||||||
/* Query flattening in sqlite3Select() might refill p->pOrderBy.
|
assert( p->pOrderBy==0 );
|
||||||
** Be sure to delete p->pOrderBy, therefore, to avoid a memory leak. */
|
|
||||||
sqlite3ExprListDelete(db, p->pOrderBy);
|
|
||||||
pDelete = p->pPrior;
|
pDelete = p->pPrior;
|
||||||
p->pPrior = pPrior;
|
p->pPrior = pPrior;
|
||||||
p->pOrderBy = 0;
|
p->pOrderBy = 0;
|
||||||
@@ -4010,7 +4005,7 @@ static int flattenSubquery(
|
|||||||
** We look at every expression in the outer query and every place we see
|
** We look at every expression in the outer query and every place we see
|
||||||
** "a" we substitute "x*3" and every place we see "b" we substitute "y+10".
|
** "a" we substitute "x*3" and every place we see "b" we substitute "y+10".
|
||||||
*/
|
*/
|
||||||
if( pSub->pOrderBy ){
|
if( pSub->pOrderBy && (pParent->selFlags & SF_NoopOrderBy)==0 ){
|
||||||
/* At this point, any non-zero iOrderByCol values indicate that the
|
/* At this point, any non-zero iOrderByCol values indicate that the
|
||||||
** ORDER BY column expression is identical to the iOrderByCol'th
|
** ORDER BY column expression is identical to the iOrderByCol'th
|
||||||
** expression returned by SELECT statement pSub. Since these values
|
** expression returned by SELECT statement pSub. Since these values
|
||||||
@@ -5644,6 +5639,7 @@ int sqlite3Select(
|
|||||||
sqlite3ExprListDelete(db, p->pOrderBy);
|
sqlite3ExprListDelete(db, p->pOrderBy);
|
||||||
p->pOrderBy = 0;
|
p->pOrderBy = 0;
|
||||||
p->selFlags &= ~SF_Distinct;
|
p->selFlags &= ~SF_Distinct;
|
||||||
|
p->selFlags |= SF_NoopOrderBy;
|
||||||
}
|
}
|
||||||
sqlite3SelectPrep(pParse, p, 0);
|
sqlite3SelectPrep(pParse, p, 0);
|
||||||
if( pParse->nErr || db->mallocFailed ){
|
if( pParse->nErr || db->mallocFailed ){
|
||||||
|
@@ -2889,6 +2889,7 @@ struct Select {
|
|||||||
#define SF_Converted 0x10000 /* By convertCompoundSelectToSubquery() */
|
#define SF_Converted 0x10000 /* By convertCompoundSelectToSubquery() */
|
||||||
#define SF_IncludeHidden 0x20000 /* Include hidden columns in output */
|
#define SF_IncludeHidden 0x20000 /* Include hidden columns in output */
|
||||||
#define SF_ComplexResult 0x40000 /* Result contains subquery or function */
|
#define SF_ComplexResult 0x40000 /* Result contains subquery or function */
|
||||||
|
#define SF_NoopOrderBy 0x0400000 /* ORDER BY is ignored for this query */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** The results of a SELECT can be distributed in several ways, as defined
|
** The results of a SELECT can be distributed in several ways, as defined
|
||||||
|
@@ -399,6 +399,12 @@ ifcapable vtab {
|
|||||||
SELECT name FROM pragma_table_info('t2');
|
SELECT name FROM pragma_table_info('t2');
|
||||||
} {Bbb}
|
} {Bbb}
|
||||||
}
|
}
|
||||||
|
do_execsql_test colname-9.330 { -- added 2019-08-10 to invalidate
|
||||||
|
DROP TABLE IF EXISTS t1; -- a couple assert()s that were
|
||||||
|
CREATE TABLE t1(a); -- added by ticket 3b44500725
|
||||||
|
INSERT INTO t1 VALUES(17),(2),(99),(-3),(7);
|
||||||
|
SELECT (SELECT avg(a) UNION SELECT min(a) OVER()) FROM t1;
|
||||||
|
} {17}
|
||||||
|
|
||||||
# Issue detected by OSSFuzz on 2017-12-24 (Christmas Eve)
|
# Issue detected by OSSFuzz on 2017-12-24 (Christmas Eve)
|
||||||
# caused by check-in https://sqlite.org/src/info/6b2ff26c25
|
# caused by check-in https://sqlite.org/src/info/6b2ff26c25
|
||||||
|
@@ -1446,5 +1446,26 @@ do_execsql_test 6.1 {
|
|||||||
SELECT * FROM (SELECT a FROM t1 UNION SELECT b FROM t2) WHERE a=a;
|
SELECT * FROM (SELECT a FROM t1 UNION SELECT b FROM t2) WHERE a=a;
|
||||||
} {12345}
|
} {12345}
|
||||||
|
|
||||||
|
# 2020-06-15 ticket 8f157e8010b22af0
|
||||||
|
#
|
||||||
|
reset_db
|
||||||
|
do_execsql_test 7.1 {
|
||||||
|
CREATE TABLE t1(c1); INSERT INTO t1 VALUES(12),(123),(1234),(NULL),('abc');
|
||||||
|
CREATE TABLE t2(c2); INSERT INTO t2 VALUES(44),(55),(123);
|
||||||
|
CREATE TABLE t3(c3,c4); INSERT INTO t3 VALUES(66,1),(123,2),(77,3);
|
||||||
|
CREATE VIEW t4 AS SELECT c3 FROM t3;
|
||||||
|
CREATE VIEW t5 AS SELECT c3 FROM t3 ORDER BY c4;
|
||||||
|
}
|
||||||
|
do_execsql_test 7.2 {
|
||||||
|
SELECT * FROM t1, t2 WHERE c1=(SELECT 123 INTERSECT SELECT c2 FROM t4) AND c1=123;
|
||||||
|
} {123 123}
|
||||||
|
do_execsql_test 7.3 {
|
||||||
|
SELECT * FROM t1, t2 WHERE c1=(SELECT 123 INTERSECT SELECT c2 FROM t5) AND c1=123;
|
||||||
|
} {123 123}
|
||||||
|
do_execsql_test 7.4 {
|
||||||
|
CREATE TABLE a(b);
|
||||||
|
CREATE VIEW c(d) AS SELECT b FROM a ORDER BY b;
|
||||||
|
SELECT sum(d) OVER( PARTITION BY(SELECT 0 FROM c JOIN a WHERE b =(SELECT b INTERSECT SELECT d FROM c) AND b = 123)) FROM c;
|
||||||
|
} {}
|
||||||
|
|
||||||
finish_test
|
finish_test
|
||||||
|
@@ -1167,6 +1167,19 @@ do_execsql_test 29.2 {
|
|||||||
11 K cc 'xyz' K |
|
11 K cc 'xyz' K |
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
# Test that the SQL in ticket [c8d3b9f0a75] - CVE-2020-13871 - does not
|
||||||
|
# cause a problem for this version.
|
||||||
|
#
|
||||||
|
reset_db
|
||||||
|
do_execsql_test 30.0 {
|
||||||
|
CREATE TABLE a(b);
|
||||||
|
}
|
||||||
|
|
||||||
|
do_execsql_test 30.1 {
|
||||||
|
SELECT(SELECT b FROM a GROUP BY b HAVING(NULL AND b IN((SELECT COUNT() OVER(ORDER BY b) = lead(b) OVER(ORDER BY 3.100000 * SUM(DISTINCT CASE WHEN b LIKE 'SM PACK' THEN b * b ELSE 0 END) / b))))) FROM a EXCEPT SELECT b FROM a ORDER BY b, b, b;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
finish_test
|
finish_test
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user