Do not enforce the SQLITE_LIMIT_FUNCTION_ARG limit for internally generated

SQL.  This prevents problems with statements like ALTER TABLE if the
function argument limit is set too low.
[forum:/forumpost/17735aa21f3ddab2|Forum post 17735aa21f3ddab2].

FossilOrigin-Name: 763fdec5b3151eeab001c50e78f654cd9b4b4c10e81e50a663046a70e64d5339
This commit is contained in:
drh 2021-06-30 11:53:21 +00:00
parent cf1e25566b
commit 14a1b1c132
3 changed files with 12 additions and 9 deletions

View File

@ -1,5 +1,5 @@
C When\sgenerating\sdata\sfor\sa\sRETURNING\sclause,\savoid\sassuming\scursor\snumber\s0\sis\savailable\sfor\suse.
D 2021-06-28T15:25:17.222
C Do\snot\senforce\sthe\sSQLITE_LIMIT_FUNCTION_ARG\slimit\sfor\sinternally\sgenerated\nSQL.\s\sThis\sprevents\sproblems\swith\sstatements\slike\sALTER\sTABLE\sif\sthe\nfunction\sargument\slimit\sis\sset\stoo\slow.\n[forum:/forumpost/17735aa21f3ddab2|Forum\spost\s17735aa21f3ddab2].
D 2021-06-30T11:53:21.401
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -496,7 +496,7 @@ F src/date.c e0632f335952b32401482d099321bbf12716b29d6e72836b53ae49683ebae4bf
F src/dbpage.c 8a01e865bf8bc6d7b1844b4314443a6436c07c3efe1d488ed89e81719047833a
F src/dbstat.c 3aa79fc3aed7ce906e4ea6c10e85d657299e304f6049861fe300053ac57de36c
F src/delete.c 62451bba9fe641159e9c0b7d9d2bab1c48d0cff11e16de2d14000603d2af1fcf
F src/expr.c 30a2abf526531ce6bd45fbc85bfec0fc3f6e5a0fb490cd2350855f2fc34dd789
F src/expr.c d571a83580d0034697a29abbfe95a7750eb8ae7172d6e2c794b1d89ef4ef31dc
F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007
F src/fkey.c e9063648396c58778f77583a678342fe4a9bc82436bf23c5f9f444f2df0fdaa4
F src/func.c c96ac6f7c4f2d684217c4673a80446e1b50e25b5ea79366f333f484622d010a0
@ -1919,7 +1919,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 d4bf5243f2bf0a2bc77ad12f3e1e4797cb62f2745f9d54eee5f675c3b5f80880
R fa1451caa0f45c6ae133c6c4d565c752
U dan
Z 71577863a4009a469e681a38dfbd9444
P 4b2c59acce6ff1bb6c9c04c45c80945ae23a26588718cc20635d60f7497adabb
R 89bc87e746b6516fa7d6d328ad72bca6
U drh
Z 155cf10bfa58b42375927d36c55cd29c

View File

@ -1 +1 @@
4b2c59acce6ff1bb6c9c04c45c80945ae23a26588718cc20635d60f7497adabb
763fdec5b3151eeab001c50e78f654cd9b4b4c10e81e50a663046a70e64d5339

View File

@ -986,7 +986,10 @@ Expr *sqlite3ExprFunction(
sqlite3ExprListDelete(db, pList); /* Avoid memory leak when malloc fails */
return 0;
}
if( pList && pList->nExpr > pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){
if( pList
&& pList->nExpr > pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG]
&& !pParse->nested
){
sqlite3ErrorMsg(pParse, "too many arguments on function %T", pToken);
}
pNew->x.pList = pList;