/ Check-in [b0650aa6]
Login

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

Overview
Comment:Additional tests of sqlite3_prepare_v2. (CVS 3577)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b0650aa6cfcb4c59fd8556b8f5523573538bd7e5
User & Date: drh 2007-01-08 22:40:33
Context
2007-01-09
14:01
When an automatic re-prepare occurs, take care not to reset the internal schema symbol table. Ticket #2156. This change also includes some debugging enhancements. (CVS 3578) check-in: 43fe7fc1 user: drh tags: trunk
2007-01-08
22:40
Additional tests of sqlite3_prepare_v2. (CVS 3577) check-in: b0650aa6 user: drh tags: trunk
21:07
Fix a critical bug in sqlite3_prepare_v2 that can lead to segfaults when the schema changes and the statement is recompiled automatically. Ticket #2154. (CVS 3576) check-in: 3401388d user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/capi3c.test.

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
....
1123
1124
1125
1126
1127
1128
1129
1130


1131























1132
#
#***********************************************************************
# This file implements regression tests for SQLite library.  
#
# This is a copy of the capi3.test file that has been adapted to
# test the new sqlite3_prepare_v2 interface.
#
# $Id: capi3c.test,v 1.2 2007/01/08 21:07:18 drh Exp $
#

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

# Return the UTF-16 representation of the supplied UTF-8 string $str.
# If $nt is true, append two 0x00 bytes as a nul terminator.
................................................................................
} two
do_test capi3c-17.18 {
  sqlite3_step $STMT
} SQLITE_DONE
do_test capi3c-17.99 {
  sqlite3_finalize $STMT
} SQLITE_OK



























finish_test







|







 








>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
....
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
#
#***********************************************************************
# This file implements regression tests for SQLite library.  
#
# This is a copy of the capi3.test file that has been adapted to
# test the new sqlite3_prepare_v2 interface.
#
# $Id: capi3c.test,v 1.3 2007/01/08 22:40:33 drh Exp $
#

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

# Return the UTF-16 representation of the supplied UTF-8 string $str.
# If $nt is true, append two 0x00 bytes as a nul terminator.
................................................................................
} two
do_test capi3c-17.18 {
  sqlite3_step $STMT
} SQLITE_DONE
do_test capi3c-17.99 {
  sqlite3_finalize $STMT
} SQLITE_OK

# On the mailing list it has been reported that finalizing after
# an SQLITE_BUSY return leads to a segfault.  Here we test that case.
#
do_test capi3c-18.1 {
  sqlite3 db2 test.db
  set STMT [sqlite3_prepare_v2 $DB {SELECT max(a) FROM t1} -1 TAIL]
  sqlite3_step $STMT
} SQLITE_ROW
do_test capi3c-18.2 {
  sqlite3_column_int $STMT 0
} 4
do_test capi3c-18.3 {
  sqlite3_reset $STMT
  db2 eval {BEGIN EXCLUSIVE}
  sqlite3_step $STMT
} SQLITE_BUSY
do_test capi3c-18.4 {
  sqlite3_finalize $STMT
} SQLITE_BUSY
do_test capi3c-18.5 {
  db2 eval {COMMIT}
  db2 close
} {}



finish_test