Sync w/trunk
FossilOrigin-Name: a4c18b2f0ce4a0f4d0c4f4c25dc69fbed4cb4876d2b69e3e5e0e756410892d74
This commit is contained in:
commit
34896c6855
22
manifest
22
manifest
@ -1,5 +1,5 @@
|
||||
C Add\sextra\stests\sfor\sthe\sgroup_concat()\sfix\son\sthis\sbranch.
|
||||
D 2021-09-29T14:14:16.714
|
||||
C Sync\sw/trunk
|
||||
D 2021-09-29T16:35:14.868
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
||||
@ -481,7 +481,7 @@ F spec.template 86a4a43b99ebb3e75e6b9a735d5fd293a24e90ca
|
||||
F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b
|
||||
F sqlite3.1 fc7ad8990fc8409983309bb80de8c811a7506786
|
||||
F sqlite3.pc.in 48fed132e7cb71ab676105d2a4dc77127d8c1f3a
|
||||
F src/alter.c a279ff8e6e079dcec20eb736d6399229f4b495f01e6da26052467c9963ead595
|
||||
F src/alter.c ad192981c345625621048ae1145ac7fc94b39912c44940e458f439627aa18137
|
||||
F src/analyze.c 989eb1146f4a2c320623e190f8913bf1829fd8954a52dbfd0f792efc69db0e66
|
||||
F src/attach.c a514e81758ba7b3a3a0501faf70af6cfc509de8810235db726cfc9f25165e929
|
||||
F src/auth.c f4fa91b6a90bbc8e0d0f738aa284551739c9543a367071f55574681e0f24f8cf
|
||||
@ -497,9 +497,9 @@ F src/complete.c a3634ab1e687055cd002e11b8f43eb75c17da23e
|
||||
F src/ctime.c 8159d5f706551861c18ec6c8f6bdf105e15ea00367f05d9ab65d31a1077facc1
|
||||
F src/date.c e0632f335952b32401482d099321bbf12716b29d6e72836b53ae49683ebae4bf
|
||||
F src/dbpage.c 8a01e865bf8bc6d7b1844b4314443a6436c07c3efe1d488ed89e81719047833a
|
||||
F src/dbstat.c 14d9098266fa712472bed757986eee70eb3613e9ba6e55bddac6708acf8d2857
|
||||
F src/dbstat.c bea044cfe99eab6c527837e196a5335c128989bdb354cf1b4973b85ea561d66b
|
||||
F src/delete.c 3ce6af6b64c8b476de51ccc32da0cb3142d42e65754e1d8118addf65b8bcba15
|
||||
F src/expr.c 38597afb008db2e0a5f86a82827567acb98f502cab61663ef16bc688bc256803
|
||||
F src/expr.c f2e0f5dd07d1b202f700f26b0851f2ea485e36ec8f335b05aec2cd91cd08853f
|
||||
F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007
|
||||
F src/fkey.c 1905af1821b88321e1bb9d6a69e704495b6844a9b6c29398d40117cc251e893c
|
||||
F src/func.c c852d68d0a984263f969e3b84d602c6d821147a32905fecca65b1d86098367b4
|
||||
@ -659,11 +659,11 @@ F test/alterdropcol2.test 527fce683b200d620f560f666c44ae33e22728e990a10a48a54328
|
||||
F test/alterlegacy.test f38c6d06cda39e1f7b955bbce57f2e3ef5b7cb566d3d1234502093e228c15811
|
||||
F test/altermalloc.test 167a47de41b5c638f5f5c6efb59784002b196fff70f98d9b4ed3cd74a3fb80c9
|
||||
F test/altermalloc2.test ca3ebc01670d9313953a2b7628d8cc00dc5ea9988f229b3cbbbe1cca506dae45
|
||||
F test/altermalloc3.test 059841a3de6b6780efd9f0b30bf1d9b4443c555f68d39975cbcac2583167b239
|
||||
F test/altermalloc3.test 4660ac6240a8c82ba3947b927612dcc7c05a8eec3fe3c9f38e047ca69a789a33
|
||||
F test/alterqf.test 67568ad152db8c1187b15633b801242cf960f1beafc51261a3d1725d910baeb2
|
||||
F test/altertab.test a13e11cb1933575002367613b1094f0eeb31f493e4bd9ebeca73279fe00c85e7
|
||||
F test/altertab2.test b0d62f323ca5dab42b0bc028c52e310ebdd13e655e8fac070fe622bad7852c2b
|
||||
F test/altertab3.test 2b82fa2236a3a91553d53ae5555d8e723c7eec174c41f1fa62ff497355398479
|
||||
F test/altertab3.test 9a8aad735c48440c05787b4ab5ac821340a72c6febd1ff8bf74e065fb75882b2
|
||||
F test/amatch1.test b5ae7065f042b7f4c1c922933f4700add50cdb9f
|
||||
F test/analyze.test 547bb700f903107b38611b014ca645d6b5bb819f5210d7bf39c40802aafeb7d7
|
||||
F test/analyze3.test 4440c4932247adb2b4e0c838f657c19dc7af4f56859255436dc4e855f39b9324
|
||||
@ -1927,7 +1927,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
|
||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||
P 98e0f2bf67cdee1da1edadeb54ff8564728b3f28fc821e46e8de201247c3fc87
|
||||
R 1629e1fee3aa6c55d78d8125420eddd7
|
||||
U dan
|
||||
Z 18e23ea62384af634dfba68431ad5780
|
||||
P 3d148615f9d9c6a3d63d8eb015f3d70f453a66de49b28e665831254387c700b9 df0d7e36dbf98ab5405d8366ce92fb85176d4388b47a57b0ca1aa1ba6ae5212e
|
||||
R 4764117e20f212be49211212953ddad0
|
||||
U larrybr
|
||||
Z 559da611469829addf62248db5ff3864
|
||||
|
@ -1 +1 @@
|
||||
3d148615f9d9c6a3d63d8eb015f3d70f453a66de49b28e665831254387c700b9
|
||||
a4c18b2f0ce4a0f4d0c4f4c25dc69fbed4cb4876d2b69e3e5e0e756410892d74
|
@ -802,6 +802,7 @@ void sqlite3RenameTokenRemap(Parse *pParse, const void *pTo, const void *pFrom){
|
||||
static int renameUnmapExprCb(Walker *pWalker, Expr *pExpr){
|
||||
Parse *pParse = pWalker->pParse;
|
||||
sqlite3RenameTokenRemap(pParse, 0, (const void*)pExpr);
|
||||
sqlite3RenameTokenRemap(pParse, 0, (const void*)&pExpr->y.pTab);
|
||||
return WRC_Continue;
|
||||
}
|
||||
|
||||
@ -831,6 +832,7 @@ static void renameWalkWith(Walker *pWalker, Select *pSelect){
|
||||
memset(&sNC, 0, sizeof(sNC));
|
||||
sNC.pParse = pParse;
|
||||
if( pCopy ) sqlite3SelectPrep(sNC.pParse, p, &sNC);
|
||||
if( sNC.pParse->db->mallocFailed ) return;
|
||||
sqlite3WalkSelect(pWalker, p);
|
||||
sqlite3RenameExprlistUnmap(pParse, pWith->a[i].pCols);
|
||||
}
|
||||
|
53
src/dbstat.c
53
src/dbstat.c
@ -92,9 +92,8 @@ struct StatCell {
|
||||
/* Size information for a single btree page */
|
||||
struct StatPage {
|
||||
u32 iPgno; /* Page number */
|
||||
DbPage *pPg; /* Page content */
|
||||
u8 *aPg; /* Page buffer from sqlite3_malloc() */
|
||||
int iCell; /* Current cell */
|
||||
|
||||
char *zPath; /* Path to this page */
|
||||
|
||||
/* Variables populated by statDecodePage(): */
|
||||
@ -306,10 +305,11 @@ static void statClearCells(StatPage *p){
|
||||
}
|
||||
|
||||
static void statClearPage(StatPage *p){
|
||||
u8 *aPg = p->aPg;
|
||||
statClearCells(p);
|
||||
sqlite3PagerUnref(p->pPg);
|
||||
sqlite3_free(p->zPath);
|
||||
memset(p, 0, sizeof(StatPage));
|
||||
p->aPg = aPg;
|
||||
}
|
||||
|
||||
static void statResetCsr(StatCursor *pCsr){
|
||||
@ -320,6 +320,8 @@ static void statResetCsr(StatCursor *pCsr){
|
||||
** this happens. dbsqlfuzz 9ed3e4e3816219d3509d711636c38542bf3f40b1. */
|
||||
for(i=0; i<ArraySize(pCsr->aPage); i++){
|
||||
statClearPage(&pCsr->aPage[i]);
|
||||
sqlite3_free(pCsr->aPage[i].aPg);
|
||||
pCsr->aPage[i].aPg = 0;
|
||||
}
|
||||
sqlite3_reset(pCsr->pStmt);
|
||||
pCsr->iPage = 0;
|
||||
@ -386,7 +388,7 @@ static int statDecodePage(Btree *pBt, StatPage *p){
|
||||
int isLeaf;
|
||||
int szPage;
|
||||
|
||||
u8 *aData = sqlite3PagerGetData(p->pPg);
|
||||
u8 *aData = p->aPg;
|
||||
u8 *aHdr = &aData[p->iPgno==1 ? 100 : 0];
|
||||
|
||||
p->flags = aHdr[0];
|
||||
@ -516,6 +518,37 @@ static void statSizeAndOffset(StatCursor *pCsr){
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** Load a copy of the page data for page iPg into the buffer belonging
|
||||
** to page object pPg. Allocate the buffer if necessary. Return SQLITE_OK
|
||||
** if successful, or an SQLite error code otherwise.
|
||||
*/
|
||||
static int statGetPage(
|
||||
Btree *pBt, /* Load page from this b-tree */
|
||||
u32 iPg, /* Page number to load */
|
||||
StatPage *pPg /* Load page into this object */
|
||||
){
|
||||
int pgsz = sqlite3BtreeGetPageSize(pBt);
|
||||
DbPage *pDbPage = 0;
|
||||
int rc;
|
||||
|
||||
if( pPg->aPg==0 ){
|
||||
pPg->aPg = (u8*)sqlite3_malloc(pgsz);
|
||||
if( pPg->aPg==0 ){
|
||||
return SQLITE_NOMEM_BKPT;
|
||||
}
|
||||
}
|
||||
|
||||
rc = sqlite3PagerGet(sqlite3BtreePager(pBt), iPg, &pDbPage, 0);
|
||||
if( rc==SQLITE_OK ){
|
||||
const u8 *a = sqlite3PagerGetData(pDbPage);
|
||||
memcpy(pPg->aPg, a, pgsz);
|
||||
sqlite3PagerUnref(pDbPage);
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
** Move a DBSTAT cursor to the next entry. Normally, the next
|
||||
** entry will be the next page, but in aggregated mode (pCsr->isAgg!=0),
|
||||
@ -534,7 +567,7 @@ static int statNext(sqlite3_vtab_cursor *pCursor){
|
||||
pCsr->zPath = 0;
|
||||
|
||||
statNextRestart:
|
||||
if( pCsr->aPage[0].pPg==0 ){
|
||||
if( pCsr->iPage<0 ){
|
||||
/* Start measuring space on the next btree */
|
||||
statResetCounts(pCsr);
|
||||
rc = sqlite3_step(pCsr->pStmt);
|
||||
@ -546,7 +579,7 @@ statNextRestart:
|
||||
pCsr->isEof = 1;
|
||||
return sqlite3_reset(pCsr->pStmt);
|
||||
}
|
||||
rc = sqlite3PagerGet(pPager, iRoot, &pCsr->aPage[0].pPg, 0);
|
||||
rc = statGetPage(pBt, iRoot, &pCsr->aPage[0]);
|
||||
pCsr->aPage[0].iPgno = iRoot;
|
||||
pCsr->aPage[0].iCell = 0;
|
||||
if( !pCsr->isAgg ){
|
||||
@ -597,9 +630,8 @@ statNextRestart:
|
||||
|
||||
if( !p->iRightChildPg || p->iCell>p->nCell ){
|
||||
statClearPage(p);
|
||||
if( pCsr->iPage>0 ){
|
||||
pCsr->iPage--;
|
||||
}else if( pCsr->isAgg ){
|
||||
pCsr->iPage--;
|
||||
if( pCsr->isAgg && pCsr->iPage<0 ){
|
||||
/* label-statNext-done: When computing aggregate space usage over
|
||||
** an entire btree, this is the exit point from this function */
|
||||
return SQLITE_OK;
|
||||
@ -618,7 +650,7 @@ statNextRestart:
|
||||
}else{
|
||||
p[1].iPgno = p->aCell[p->iCell].iChildPg;
|
||||
}
|
||||
rc = sqlite3PagerGet(pPager, p[1].iPgno, &p[1].pPg, 0);
|
||||
rc = statGetPage(pBt, p[1].iPgno, &p[1]);
|
||||
pCsr->nPage++;
|
||||
p[1].iCell = 0;
|
||||
if( !pCsr->isAgg ){
|
||||
@ -748,6 +780,7 @@ static int statFilter(
|
||||
}
|
||||
|
||||
if( rc==SQLITE_OK ){
|
||||
pCsr->iPage = -1;
|
||||
rc = statNext(pCursor);
|
||||
}
|
||||
return rc;
|
||||
|
@ -518,7 +518,10 @@ Expr *sqlite3ExprForVectorField(
|
||||
}else{
|
||||
if( pVector->op==TK_VECTOR ) pVector = pVector->x.pList->a[iField].pExpr;
|
||||
pRet = sqlite3ExprDup(pParse->db, pVector, 0);
|
||||
sqlite3RenameTokenRemap(pParse, pRet, pVector);
|
||||
if( IN_RENAME_OBJECT && pRet ){
|
||||
SWAP(Expr, *pRet, *pVector);
|
||||
sqlite3RenameTokenRemap(pParse, pRet, pVector);
|
||||
}
|
||||
}
|
||||
return pRet;
|
||||
}
|
||||
|
@ -43,5 +43,36 @@ do_faultsim_test 1 -prep {
|
||||
faultsim_test_result {0 {}}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
# dbsqlfuzz e3dd84cda3848016a6a6024c7249d09bc2ef2615
|
||||
#
|
||||
reset_db
|
||||
do_execsql_test 2.0 {
|
||||
CREATE TABLE t2(k,v);
|
||||
CREATE TRIGGER r2 AFTER INSERT ON t2 BEGIN
|
||||
UPDATE t2 SET (k,v)= (
|
||||
(WITH cte1(a) AS ( SELECT 1 FROM ( SELECT * FROM t2 ) )
|
||||
SELECT a FROM cte1
|
||||
), 1);
|
||||
END;
|
||||
}
|
||||
|
||||
faultsim_save_and_close
|
||||
faultsim_restore_and_reopen
|
||||
|
||||
do_execsql_test 2.1 {
|
||||
ALTER TABLE t2 RENAME TO t2x;
|
||||
}
|
||||
|
||||
do_faultsim_test 2.2 -prep {
|
||||
faultsim_restore_and_reopen
|
||||
db eval { SELECT * FROM sqlite_master }
|
||||
} -body {
|
||||
execsql {
|
||||
ALTER TABLE t2 RENAME TO t2x;
|
||||
}
|
||||
} -test {
|
||||
faultsim_test_result {0 {}}
|
||||
}
|
||||
|
||||
finish_test
|
||||
|
@ -648,4 +648,30 @@ do_catchsql_test 26.6 {
|
||||
} {1 {error in trigger xx: ambiguous column name: xx}}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
reset_db
|
||||
|
||||
do_execsql_test 27.1 {
|
||||
CREATE TABLE t1(a, b AS ((WITH w1 (xyz) AS ( SELECT t1.b FROM t1 ) SELECT 123) IN ()), c);
|
||||
}
|
||||
|
||||
do_execsql_test 27.2 {
|
||||
ALTER TABLE t1 DROP COLUMN c;
|
||||
SELECT sql FROM sqlite_schema WHERE name = 't1';
|
||||
} {
|
||||
{CREATE TABLE t1(a, b AS ((WITH w1 (xyz) AS ( SELECT t1.b FROM t1 ) SELECT 123) IN ()))}
|
||||
}
|
||||
|
||||
do_execsql_test 27.3 {
|
||||
CREATE TABLE t0(c0 , c1 AS (CASE TRUE NOT IN () WHEN NULL THEN CASE + 0xa ISNULL WHEN NOT + 0x9 THEN t0.c1 ELSE CURRENT_TIME LIKE CAST (t0.c1 REGEXP '-([1-9]\d*.\d*|0\.\d*[1-9]\d*)'ESCAPE (c1) COLLATE BINARY BETWEEN c1 AND c1 NOT IN (WITH t4 (c0) AS (WITH t3 (c0) AS NOT MATERIALIZED (WITH RECURSIVE t2 (c0) AS (WITH RECURSIVE t1 AS (VALUES (x'717171ff71717171' ) ) SELECT DISTINCT t0.c0 FROM t0 NOT INDEXED WHERE t0.c0 =t0.c0 GROUP BY 0x9 ) SELECT DISTINCT t0.c0 FROM t0 NOT INDEXED WHERE t0.c0 =t0.c1 ) SELECT DISTINCT t0.c0 FROM t0 NOT INDEXED WHERE t0.c0 =t0.c0 GROUP BY typeof(0x9 ) ) SELECT DISTINCT t0.c0 FROM t0 NOT INDEXED WHERE t0.c0 =t0.c0 GROUP BY typeof(typeof(0x9 ) ) ) IN t0 BETWEEN typeof(typeof(typeof(hex(*) FILTER (WHERE + x'5ccd1e68' ) ) ) ) AND 1 >0xa AS BLOB (+4.4E4 , -0xe ) ) END <> c1 IN () END ) VIRTUAL , c35 PRIMARY KEY , c60 , c64 NUMERIC (-6.8 , -0xE ) ) WITHOUT ROWID ;
|
||||
} {}
|
||||
|
||||
do_execsql_test 27.4 {
|
||||
ALTER TABLE t0 DROP COLUMN c60;
|
||||
} {}
|
||||
|
||||
finish_test
|
||||
|
||||
|
||||
|
||||
finish_test
|
||||
|
Loading…
Reference in New Issue
Block a user