1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Fix for #2497. Set the database error code to the return value of sqlite3_step(). (CVS 4155)

FossilOrigin-Name: b01fda5f50e40b6122faf169c44486bde7ffe16c
This commit is contained in:
danielk1977
2007-07-12 13:18:05 +00:00
parent d8e9b6238e
commit 612642de32
4 changed files with 41 additions and 10 deletions

View File

@ -13,7 +13,7 @@
# 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.7 2007/03/30 20:46:14 drh Exp $
# $Id: capi3c.test,v 1.8 2007/07/12 13:18:06 danielk1977 Exp $
#
set testdir [file dirname $argv0]
@ -1212,4 +1212,34 @@ do_test capi3c-20.4 {
sqlite3_finalize $STMT
} SQLITE_OK
# Test that sqlite3_step() sets the database error code correctly.
# See ticket #2497.
#
do_test capi3c-21.1 {
set STMT [sqlite3_prepare_v2 $DB {SELECT * FROM t3} -1 TAIL]
db progress 5 "expr 1"
sqlite3_step $STMT
} {SQLITE_INTERRUPT}
do_test capi3c-21.2 {
sqlite3_errcode $DB
} {SQLITE_INTERRUPT}
do_test capi3c-21.3 {
sqlite3_finalize $STMT
} {SQLITE_INTERRUPT}
do_test capi3c-21.4 {
set STMT [sqlite3_prepare $DB {SELECT * FROM t3} -1 TAIL]
db progress 5 "expr 1"
sqlite3_step $STMT
} {SQLITE_ERROR}
do_test capi3c-21.5 {
sqlite3_errcode $DB
} {SQLITE_ERROR}
do_test capi3c-21.6 {
sqlite3_finalize $STMT
} {SQLITE_INTERRUPT}
do_test capi3c-21.7 {
sqlite3_errcode $DB
} {SQLITE_INTERRUPT}
finish_test