Fix the Xfer-optimization on the INSERT statement so that it is omitted if

there is a RETURNING clause, since that optimization is not able to deal
with RETURNING.  See [forum:/forumpost/595e132f71|forum thread 595e132f71]
for details.

FossilOrigin-Name: 1d3760a517b8bd2a6be82d2d5788945f49397cdc539fe28fd23e2c0c62a1dbe2
This commit is contained in:
drh
2022-02-28 16:44:58 +00:00
parent 8552b10c45
commit 935c37229c
5 changed files with 36 additions and 17 deletions
+7 -1
View File
@@ -11,7 +11,6 @@
# This file implements regression tests for SQLite library. The
# focus of this file is testing the INSERT transfer optimization.
#
# $Id: insert4.test,v 1.10 2008/01/21 16:22:46 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -598,6 +597,13 @@ do_test 10.3 {
set sqlite3_xferopt_count
} {1}
do_test 10.4 {
execsql { PRAGMA integrity_check }
set sqlite3_xferopt_count 0
execsql { INSERT INTO x SELECT * FROM t8 RETURNING * }
set sqlite3_xferopt_count
} {0}
#-------------------------------------------------------------------------
# xfer transfer between tables where the source has an empty partial index.
#