/ Check-in [201ab3b5]
Login

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

Overview
Comment:Add a test to make sure parser stack overflow is detected and reported. (CVS 3114)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 201ab3b5238c4afeb9a9f254f9ed3632b106066d
User & Date: drh 2006-02-27 23:19:21
Context
2006-02-27
23:44
Reduce the size of a memory allocation in the windows driver to the minimum needed. Ticket #1690. (CVS 3115) check-in: 1fe9ca07 user: drh tags: trunk
23:19
Add a test to make sure parser stack overflow is detected and reported. (CVS 3114) check-in: 201ab3b5 user: drh tags: trunk
22:22
The parser now permits very large triggers - triggers with 10000 or more statements. (CVS 3113) check-in: b4fa96d0 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/misc5.test.

     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.
    12     12   #
    13     13   # This file implements tests for miscellanous features that were
    14     14   # left out of other test files.
    15     15   #
    16         -# $Id: misc5.test,v 1.11 2006/01/17 09:35:02 danielk1977 Exp $
           16  +# $Id: misc5.test,v 1.12 2006/02/27 23:19:21 drh Exp $
    17     17   
    18     18   set testdir [file dirname $argv0]
    19     19   source $testdir/tester.tcl
    20     20   
    21     21   # Build records using the MakeRecord opcode such that the size of the 
    22     22   # header is at the transition point in the size of a varint.
    23     23   #
................................................................................
   551    551         SELECT * FROM logs WHERE logs.id >= (SELECT head FROM logs_base) 
   552    552         UNION ALL 
   553    553         SELECT * FROM logs 
   554    554         LIMIT (SELECT lmt FROM logs_base) ;
   555    555       }
   556    556     } {1 {no such column: logs.id}}
   557    557   }
          558  +
          559  +# Overflow the lemon parser stack by providing an overly complex
          560  +# expression.  Make sure that the overflow is detected and reported.
          561  +#
          562  +do_test misc5-7.1 {
          563  +  execsql {CREATE TABLE t1(x)}
          564  +  set sql "INSERT INTO t1 VALUES("
          565  +  set tail ""
          566  +  for {set i 0} {$i<200} {incr i} {
          567  +    append sql "(1+"
          568  +    append tail ")"
          569  +  }
          570  +  append sql 2$tail
          571  +  catchsql $sql
          572  +} {1 {parser stack overflow}}
   558    573   
   559    574   finish_test