1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Update sqllimits1.test to account for recent changes to SQL function strftime().

FossilOrigin-Name: 7bba415f91884a20f665e982376c2c5e91a4431e218c8eefe275be3684f2e59a
This commit is contained in:
dan
2021-11-05 14:13:12 +00:00
parent 608af68ad3
commit 695c87f67d
3 changed files with 24 additions and 19 deletions

View File

@@ -401,7 +401,7 @@ do_test sqllimits1-5.19 {
unset blobvalue
ifcapable datetime {
set strvalue [string repeat D [expr {$SQLITE_LIMIT_LENGTH-12}]]
set strvalue [string repeat D [expr {$SQLITE_LIMIT_LENGTH-11}]]
do_test sqllimits1-5.20 {
catchsql {SELECT strftime('%Y ' || $::strvalue, '2008-01-02')}
} [list 0 [list "2008 $strvalue"]]
@@ -869,16 +869,21 @@ do_test sqllimits1-15.2 {
# This test case doesn't really belong with the other limits tests.
# It is in this file because it is taxing to run, like the limits tests.
#
do_test sqllimits1-16.1 {
set ::N [expr int(([expr pow(2,32)]/50) + 1)]
expr (($::N*50) & 0xffffffff)<55
} {1}
do_test sqllimits1-16.2 {
set ::format "[string repeat A 60][string repeat "%J" $::N]"
catchsql {
SELECT strftime($::format, 1);
}
} {1 {string or blob too big}}
# Update for 3.37.0: strftime() used to allocate a large static buffer
# into which it would write its result. With that implementation, the
# following would trigger an SQLITE_TOOBIG error. But strftime() now
# uses the StrAccum functions, causing this test to fail.
#
#do_test sqllimits1-16.1 {
# set ::N [expr int(([expr pow(2,32)]/50) + 1)]
# expr (($::N*50) & 0xffffffff)<55
#} {1}
#do_test sqllimits1-16.2 {
# set ::format "[string repeat A 60][string repeat "%J" $::N]"
# catchsql {
# SELECT strftime($::format, 1);
# }
#} {1 {string or blob too big}}
do_catchsql_test sqllimits1.17.0 {
SELECT *,*,*,*,*,*,*,* FROM (