/ Check-in [5800d032]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Another test for overflow in strftime(). It was not broken. (CVS 3969)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5800d0327ebc122e679ef860b58098b3c08eb709
User & Date: danielk1977 2007-05-10 11:43:53
Context
2007-05-10
13:23
Fix a C++ism in func.c. (CVS 3970) check-in: 9c0050a1 user: drh tags: trunk
11:43
Another test for overflow in strftime(). It was not broken. (CVS 3969) check-in: 5800d032 user: danielk1977 tags: trunk
10:46
Add code to enforce the MAX_EXPR_DEPTH limit. (CVS 3968) check-in: 2c9c94a2 user: danielk1977 tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/sqllimits1.test.

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
...
418
419
420
421
422
423
424















425
426
427
428
#    May you share freely, never taking more than you give.
#
#***********************************************************************
#
# This file contains tests to verify that the limits defined in
# sqlite source file limits.h are enforced.
#
# $Id: sqllimits1.test,v 1.7 2007/05/10 10:46:57 danielk1977 Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

# Test organization:
#
#     sqllimits-1.*:  SQLITE_MAX_LENGTH
................................................................................
  set max $::SQLITE_MAX_LIKE_PATTERN_LENGTH
  set ::pattern [string repeat "A%" [expr {($max/2) + 1}]]
  set ::string  [string repeat "A" [expr {$max*2}]]
  catchsql {
    SELECT $::string LIKE $::pattern;
  }
} {1 {LIKE or GLOB pattern too complex}}
















finish_test









|







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>




8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
...
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
#    May you share freely, never taking more than you give.
#
#***********************************************************************
#
# This file contains tests to verify that the limits defined in
# sqlite source file limits.h are enforced.
#
# $Id: sqllimits1.test,v 1.8 2007/05/10 11:43:53 danielk1977 Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

# Test organization:
#
#     sqllimits-1.*:  SQLITE_MAX_LENGTH
................................................................................
  set max $::SQLITE_MAX_LIKE_PATTERN_LENGTH
  set ::pattern [string repeat "A%" [expr {($max/2) + 1}]]
  set ::string  [string repeat "A" [expr {$max*2}]]
  catchsql {
    SELECT $::string LIKE $::pattern;
  }
} {1 {LIKE or GLOB pattern too complex}}

#--------------------------------------------------------------------
# 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 sqllimits-1.12.1 {
  set ::N [expr int(([expr pow(2,32)]/50) + 1)]
  expr (($::N*50) & 0xffffffff)<55
} {1}
do_test sqllimits-1.12.2 {
  set ::format "[string repeat A 60][string repeat "%J" $::N]"
  catchsql {
    SELECT strftime($::format, 1);
  }
} {1 {string or blob too big}}

finish_test