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

An attempt to delete a single row using a WHERE clause that specifies

the rowid would result in an error if the rowid did not exist.  This
problem has been resolved. (CVS 338)

FossilOrigin-Name: 011be9a9d2632d261489005d97c69b0a0bc5a108
This commit is contained in:
drh
2002-01-04 03:09:29 +00:00
parent c839258651
commit c6b52df32d
12 changed files with 124 additions and 44 deletions

View File

@ -12,7 +12,7 @@
# focus of this file is testing the magic ROWID column that is
# found on all tables.
#
# $Id: rowid.test,v 1.6 2001/11/08 00:45:22 drh Exp $
# $Id: rowid.test,v 1.7 2002/01/04 03:09:30 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -263,4 +263,25 @@ do_test rowid-5.1 {
execsql {SELECT max(x) FROM t1}
} {8}
# Make sure a "WHERE rowid=X" clause works when there is no ROWID of X.
#
do_test rowid-6.1 {
execsql {
SELECT x FROM t1
}
} {1 2 3 4 5 6 7 8}
do_test rowid-6.2 {
for {set ::norow 1} {[execsql {SELECT x FROM t1 WHERE rowid=10}]!=""} \
{incr ::norow} {}
execsql [subst {
DELETE FROM t1 WHERE rowid=$::norow
}]
} {}
do_test rowid-6.3 {
execsql {
SELECT x FROM t1
}
} {1 2 3 4 5 6 7 8}
finish_test