summaryrefslogtreecommitdiff
path: root/test/capi3.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/capi3.test')
-rw-r--r--test/capi3.test19
1 files changed, 13 insertions, 6 deletions
diff --git a/test/capi3.test b/test/capi3.test
index cbba04c..d910626 100644
--- a/test/capi3.test
+++ b/test/capi3.test
@@ -894,18 +894,25 @@ do_test capi3-11.9.2 {
catchsql {
ROLLBACK;
}
-} {1 {cannot rollback transaction - SQL statements in progress}}
+} {0 {}}
do_test capi3-11.9.3 {
sqlite3_get_autocommit $DB
-} 0
+} 1
do_test capi3-11.10 {
sqlite3_step $STMT
-} {SQLITE_ROW}
+} {SQLITE_ERROR}
+ifcapable !autoreset {
+ # If SQLITE_OMIT_AUTORESET is defined, then the statement must be
+ # reset() before it can be passed to step() again.
+ do_test capi3-11.11a { sqlite3_step $STMT } {SQLITE_MISUSE}
+ do_test capi3-11.11b { sqlite3_reset $STMT } {SQLITE_ABORT}
+}
do_test capi3-11.11 {
sqlite3_step $STMT
} {SQLITE_ROW}
do_test capi3-11.12 {
sqlite3_step $STMT
+ sqlite3_step $STMT
} {SQLITE_DONE}
do_test capi3-11.13 {
sqlite3_finalize $STMT
@@ -914,15 +921,15 @@ do_test capi3-11.14 {
execsql {
SELECT a FROM t2;
}
-} {1 2 3}
+} {1 2}
do_test capi3-11.14.1 {
sqlite3_get_autocommit $DB
-} 0
+} 1
do_test capi3-11.15 {
catchsql {
ROLLBACK;
}
-} {0 {}}
+} {1 {cannot rollback - no transaction is active}}
do_test capi3-11.15.1 {
sqlite3_get_autocommit $DB
} 1