1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-01 06:27:03 +03:00

Increase the maximum number of arguments on an SQL function to 1000 with the

capability to increase it further up to 32767 using a compile-time option.

FossilOrigin-Name: e8d7d68ba0bb0bc2f948db5d9966990a5d23597fc3658b7cd0bc99d53c7353a9
This commit is contained in:
drh
2024-12-12 15:11:27 +00:00
parent 6e53f67c63
commit 35d302ccb1
13 changed files with 41 additions and 33 deletions

View File

@ -1183,7 +1183,9 @@ set midargs {}
unset -nocomplain midres
set midres {}
unset -nocomplain result
for {set i 1} {$i<[sqlite3_limit db SQLITE_LIMIT_FUNCTION_ARG -1]} {incr i} {
set limit [sqlite3_limit db SQLITE_LIMIT_FUNCTION_ARG -1]
if {$limit>400} {set limit 400}
for {set i 1} {$i<$limit} {incr i} {
append midargs ,'/$i'
append midres /$i
set result [md5 \
@ -1261,7 +1263,8 @@ do_test func-26.1 {
#
do_test func-26.2 {
set a {}
for {set i 1} {$i<=$::SQLITE_MAX_FUNCTION_ARG} {incr i} {
set limit $::SQLITE_MAX_FUNCTION_ARG
for {set i 1} {$i<=$limit} {incr i} {
lappend a $i
}
db eval "
@ -1279,7 +1282,8 @@ do_test func-26.3 {
} {1 {too many arguments on function nullx_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789}}
do_test func-26.4 {
set a {}
for {set i 1} {$i<=$::SQLITE_MAX_FUNCTION_ARG-1} {incr i} {
set limit [expr {$::SQLITE_MAX_FUNCTION_ARG-1}]
for {set i 1} {$i<=$limit} {incr i} {
lappend a $i
}
catchsql "