Reapply two recent ALTER TABLE error checks that turned out to be necessary

after all.  dbsqlfuzz fc5a9deefda00dda914748985155a6d4c44174e5.

FossilOrigin-Name: 230fedd923c87741d20caf55f29e8464cc6df344536f9b89331e0a0059a926f7
This commit is contained in:
drh 2021-06-11 13:18:56 +00:00
parent cf145047b0
commit 35e6cd09f2
4 changed files with 29 additions and 27 deletions

View File

@ -1,5 +1,5 @@
C Avoid\sbugs\sin\ssome\simplementations\sof\sdlopen()\sby\savoiding\scalls\sto\ndlopen()\swith\sa\sfilename\sargument\sthat\sexceeds\sFILENAME_MAX\sbytes.\n[forum:/forumpost/08a0d6d9bf|Forum\spost\s08a0d6d9bf].
D 2021-06-11T12:41:14.442
C Reapply\stwo\srecent\sALTER\sTABLE\serror\schecks\sthat\sturned\sout\sto\sbe\snecessary\nafter\sall.\s\sdbsqlfuzz\sfc5a9deefda00dda914748985155a6d4c44174e5.
D 2021-06-11T13:18:56.772
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -478,7 +478,7 @@ F spec.template 86a4a43b99ebb3e75e6b9a735d5fd293a24e90ca
F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b
F sqlite3.1 fc7ad8990fc8409983309bb80de8c811a7506786
F sqlite3.pc.in 48fed132e7cb71ab676105d2a4dc77127d8c1f3a
F src/alter.c a5ddc873aeb9c162082735e3f33f0c97eff3827fe3512a9c55699966565c6c24
F src/alter.c 3de695d859627b1a80f673c16155260a12af310b5853012da411f81e6f4442a4
F src/analyze.c 01c6c6765cb4d40b473b71d85535093730770bb186f2f473abac25f07fcdee5c
F src/attach.c a514e81758ba7b3a3a0501faf70af6cfc509de8810235db726cfc9f25165e929
F src/auth.c 08954fdc4cc2da5264ba5b75cfd90b67a6fc7d1710a02ccf917c38eadec77853
@ -1056,7 +1056,7 @@ F test/fuzzdata4.db b502c7d5498261715812dd8b3c2005bad08b3a26e6489414bd13926cd3e4
F test/fuzzdata5.db e35f64af17ec48926481cfaf3b3855e436bd40d1cfe2d59a9474cb4b748a52a5
F test/fuzzdata6.db 92a80e4afc172c24f662a10a612d188fb272de4a9bd19e017927c95f737de6d7
F test/fuzzdata7.db 0166b56fd7a6b9636a1d60ef0a060f86ddaecf99400a666bb6e5bbd7199ad1f2
F test/fuzzdata8.db 98f0e365370523732a5ae916af0e231b34a7645e82d1aa9b9fedad35730dd926
F test/fuzzdata8.db 9e0123ce3df47d1f159f7b71d60b96bd8b89800a40ab081c5402167d7239ead7
F test/fuzzer1.test 3d4c4b7e547aba5e5511a2991e3e3d07166cfbb8
F test/fuzzer2.test a85ef814ce071293bce1ad8dffa217cbbaad4c14
F test/fuzzerfault.test f64c4aef4c9e9edf1d6dc0d3f1e65dcc81e67c996403c88d14f09b74807a42bc
@ -1918,7 +1918,9 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 6f1f2a0a9cd75ca43b81cc325296b843ccefe6f8040da8f2e873f49928423f10
R 23cea976e993f7dc439db4b62b27e10a
P 01f3877c7172d52225705d2461addc6129fe9cdb04e6f643518fc74bb4b526e4
Q -6f1f2a0a9cd75ca43b81cc325296b843ccefe6f8040da8f2e873f49928423f10
Q -852ee0e91ceae090157c4ab2805530f5d7985a490ce77f54d7b148f56e466f79
R 209079f8bae7abdeeccb2384f599febc
U drh
Z 412447a47d8555a8bfce30ac9e03c884
Z 7b5e924ec5b470cee8adabc26d15dbda

View File

@ -1 +1 @@
01f3877c7172d52225705d2461addc6129fe9cdb04e6f643518fc74bb4b526e4
230fedd923c87741d20caf55f29e8464cc6df344536f9b89331e0a0059a926f7

View File

@ -802,27 +802,27 @@ static void renameWalkWith(Walker *pWalker, Select *pSelect){
if( pWith ){
Parse *pParse = pWalker->pParse;
int i;
With *pCopy;
/* Push a copy of the With object onto the with-stack. We use a copy
** here as the original will be expanded and resolved (flags SF_Expanded
** and SF_Resolved) below. And the parser code that uses the with-stack
** fails if the Select objects on it have already been expanded and
** resolved. */
With *pCopy = 0;
assert( pWith->nCte>0 );
assert( (pWith->a[0].pSelect->selFlags & SF_Expanded)==0 );
pCopy = sqlite3WithDup(pParse->db, pWith);
if( pCopy ){
if( (pWith->a[0].pSelect->selFlags & SF_Expanded)==0 ){
/* Push a copy of the With object onto the with-stack. We use a copy
** here as the original will be expanded and resolved (flags SF_Expanded
** and SF_Resolved) below. And the parser code that uses the with-stack
** fails if the Select objects on it have already been expanded and
** resolved. */
pCopy = sqlite3WithDup(pParse->db, pWith);
sqlite3WithPush(pParse, pCopy, 1);
for(i=0; i<pWith->nCte; i++){
Select *p = pWith->a[i].pSelect;
NameContext sNC;
memset(&sNC, 0, sizeof(sNC));
sNC.pParse = pParse;
sqlite3SelectPrep(sNC.pParse, p, &sNC);
sqlite3WalkSelect(pWalker, p);
sqlite3RenameExprlistUnmap(pParse, pWith->a[i].pCols);
}
}
for(i=0; i<pWith->nCte; i++){
Select *p = pWith->a[i].pSelect;
NameContext sNC;
memset(&sNC, 0, sizeof(sNC));
sNC.pParse = pParse;
if( pCopy ) sqlite3SelectPrep(sNC.pParse, p, &sNC);
sqlite3WalkSelect(pWalker, p);
sqlite3RenameExprlistUnmap(pParse, pWith->a[i].pCols);
}
if( pCopy && pParse->pWith==pCopy ){
pParse->pWith = pCopy->pOuter;
}
}

Binary file not shown.