Fix for ticket #105: Fix the UPDATE command so that it works properly with

indexed tables when there is a subquery in the WHERE clause.  Add tests
to verify correct operation. (CVS 680)

FossilOrigin-Name: bbca16f88d00cd33ac7229edf3ee4623eff6e62f
This commit is contained in:
drh
2002-07-16 17:22:50 +00:00
parent 0c36cbe0c2
commit 53e3fc70bf
4 changed files with 36 additions and 13 deletions
+16 -1
View File
@@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this file is testing the UPDATE statement.
#
# $Id: update.test,v 1.9 2002/05/21 12:56:44 drh Exp $
# $Id: update.test,v 1.10 2002/07/16 17:22:51 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -480,4 +480,19 @@ do_test update-10.10 {
}
} {0 {1 2 3 4 13 6 2 3 4 4 6 7}}
# Make sure we can handle a subquery in the where clause.
#
do_test update-11.1 {
execsql {
UPDATE t1 SET e=e+1 WHERE b IN (SELECT b FROM t1);
SELECT b,e FROM t1;
}
} {2 14 3 7}
do_test update-11.2 {
execsql {
UPDATE t1 SET e=e+1 WHERE a IN (SELECT a FROM t1);
SELECT a,e FROM t1;
}
} {1 15 2 8}
finish_test