SQLite

Check-in [201ab3b523]
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
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 201ab3b5238c4afeb9a9f254f9ed3632b106066d
User & Date: drh 2006-02-27 23:19:21.000
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: 1fe9ca078b user: drh tags: trunk)
23:19
Add a test to make sure parser stack overflow is detected and reported. (CVS 3114) (check-in: 201ab3b523 user: drh tags: trunk)
22:22
The parser now permits very large triggers - triggers with 10000 or more statements. (CVS 3113) (check-in: b4fa96d0e9 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/misc5.test.
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#
#***********************************************************************
# This file implements regression tests for SQLite library.
#
# This file implements tests for miscellanous features that were
# left out of other test files.
#
# $Id: misc5.test,v 1.11 2006/01/17 09:35:02 danielk1977 Exp $

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

# Build records using the MakeRecord opcode such that the size of the 
# header is at the transition point in the size of a varint.
#







|







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#
#***********************************************************************
# This file implements regression tests for SQLite library.
#
# This file implements tests for miscellanous features that were
# left out of other test files.
#
# $Id: misc5.test,v 1.12 2006/02/27 23:19:21 drh Exp $

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

# Build records using the MakeRecord opcode such that the size of the 
# header is at the transition point in the size of a varint.
#
551
552
553
554
555
556
557
558















559
      SELECT * FROM logs WHERE logs.id >= (SELECT head FROM logs_base) 
      UNION ALL 
      SELECT * FROM logs 
      LIMIT (SELECT lmt FROM logs_base) ;
    }
  } {1 {no such column: logs.id}}
}
















finish_test








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

551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
      SELECT * FROM logs WHERE logs.id >= (SELECT head FROM logs_base) 
      UNION ALL 
      SELECT * FROM logs 
      LIMIT (SELECT lmt FROM logs_base) ;
    }
  } {1 {no such column: logs.id}}
}

# Overflow the lemon parser stack by providing an overly complex
# expression.  Make sure that the overflow is detected and reported.
#
do_test misc5-7.1 {
  execsql {CREATE TABLE t1(x)}
  set sql "INSERT INTO t1 VALUES("
  set tail ""
  for {set i 0} {$i<200} {incr i} {
    append sql "(1+"
    append tail ")"
  }
  append sql 2$tail
  catchsql $sql
} {1 {parser stack overflow}}

finish_test