-C Added\scode\sto\sINSERT,\sDELETE\sand\sUPDATE\svirtual\stables.\s\sThe\snew\scode\sis\nmostly\suntested.\s(CVS\s3248)
-D 2006-06-14T19:00:21
+C Bug\sfixes\sin\sthe\sMATCH\sand\sORDER\sBY\sprocessing\sof\svirtual\stables.\s(CVS\s3249)
+D 2006-06-14T22:07:11
F Makefile.in 200f6dc376ecfd9b01e5359c4e0c10c02f649b34
F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
F src/test5.c 7162f8526affb771c4ed256826eee7bb9eca265f
F src/test6.c 60a02961ceb7b3edc25f5dc5c1ac2556622a76de
F src/test7.c 03fa8d787f6aebc6d1f72504d52f33013ad2c8e3
-F src/test8.c a698ff6a0e4b3b919bdd3ee493fee7fe45e3d29a
+F src/test8.c e923b74e2e627d5d53413b3d69fc89b621eb8253
F src/test_async.c e3deaedd4d86a56391b81808fde9e44fbd92f1d3
F src/test_loadext.c 22065d601a18878e5542191001f0eaa5d77c0ed8
F src/test_md5.c 6c42bc0a3c0b54be34623ff77a0eec32b2fa96e3
F src/vdbefifo.c 9efb94c8c3f4c979ebd0028219483f88e57584f5
F src/vdbemem.c 5f0afe3b92bb2c037f8d5d697f7c151fa50783a3
F src/vtab.c 507cbb4e2101900339ce88e57144cc01dafa374e
-F src/where.c 393022cb4ac77d1f00d9c27540ce13ca5486c5b0
+F src/where.c d7c3cc011834882b2d58ebb3a6a1a569ead7ebd7
F tclinstaller.tcl 046e3624671962dc50f0481d7c25b38ef803eb42
F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
F test/all.test 5df90d015ca63fcef2a4b62c24f7316b66c4bfd4
F test/vacuum2.test 5aea8c88a65cb29f7d175296e7c819c6158d838c
F test/varint.test ab7b110089a08b9926ed7390e7e97bdefeb74102
F test/view.test 16e2774fe35e47a07ac4471b7f0bcc948b1aa6d5
-F test/vtab1.test c74328129c2b6c3821c903b05dea8076fc362bf9
+F test/vtab1.test 3897a14010f3e74cd64dd03c71e8c87248facbea
F test/where.test ee7c9a6659b07e1ee61177f6e7ff71565ee2c9df
F test/where2.test a16476a5913e75cf65b38f2daa6157a6b7791394
F test/where3.test 3b5ad2c58069e12be2bd86bc5e211a82810521aa
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
-P 0d369ff071d296501cc33d4622144b22946ac555
-R 0b4c2c0c45eeadd2de545aaca4dfef08
+P 32c97b884b104d120db3c0a87f5eab28f36851f8
+R 343eac0ed8ef0f1713e901c87b91ee1c
U drh
-Z 2664815c8d0942e02de99ff6b38443c3
+Z 8a0af575be32f8c2cbffbf5691e9cf94
-32c97b884b104d120db3c0a87f5eab28f36851f8
\ No newline at end of file
+c996185a9e0671e46bed06e5803b1ca3b42d61e2
\ No newline at end of file
** is not included in the SQLite library. It is used for automated
** testing of the SQLite library.
**
-** $Id: test8.c,v 1.17 2006/06/14 15:16:36 danielk1977 Exp $
+** $Id: test8.c,v 1.18 2006/06/14 22:07:11 drh Exp $
*/
#include "sqliteInt.h"
#include "tcl.h"
case SQLITE_INDEX_CONSTRAINT_GE:
zOp = ">="; break;
case SQLITE_INDEX_CONSTRAINT_MATCH:
- zOp = "MATCH"; break;
+ zOp = "LIKE"; break;
+ }
+ if( zOp[0]=='L' ){
+ zNew = sqlite3_mprintf("%s %s %s LIKE (SELECT '%%'||?||'%%')",
+ zQuery, zSep, zCol);
+ } else {
+ zNew = sqlite3_mprintf("%s %s %s %s ?", zQuery, zSep, zCol, zOp);
}
- zNew = sqlite3_mprintf("%s %s %s %s ?", zQuery, zSep, zCol, zOp);
sqlite3_free(zQuery);
zQuery = zNew;
zSep = "AND";
** so is applicable. Because this module is responsible for selecting
** indices, you might also think of this module as the "query optimizer".
**
-** $Id: where.c,v 1.217 2006/06/14 19:00:22 drh Exp $
+** $Id: where.c,v 1.218 2006/06/14 22:07:11 drh Exp $
*/
#include "sqliteInt.h"
prereqExpr = exprTableUsage(pMaskSet, pRight);
prereqColumn = exprTableUsage(pMaskSet, pLeft);
if( (prereqExpr & prereqColumn)==0 ){
- idxNew = whereClauseInsert(pWC, pExpr, TERM_VIRTUAL);
+ Expr *pNewExpr;
+ pNewExpr = sqlite3Expr(TK_MATCH, 0, sqlite3ExprDup(pRight), 0);
+ idxNew = whereClauseInsert(pWC, pNewExpr, TERM_VIRTUAL|TERM_DYNAMIC);
pNewTerm = &pWC->a[idxNew];
pNewTerm->prereqRight = prereqExpr;
pNewTerm->leftCursor = pLeft->iTable;
ppOrderBy ? *ppOrderBy : 0, i==0,
&pLevel->pIdxInfo);
flags = WHERE_VIRTUALTABLE;
+ if( pLevel->pIdxInfo && pLevel->pIdxInfo->orderByConsumed ){
+ flags = WHERE_VIRTUALTABLE | WHERE_ORDERBY;
+ }
pIdx = 0;
nEq = 0;
}else
# This file implements regression tests for SQLite library. The
# focus of this file is creating and dropping virtual tables.
#
-# $Id: vtab1.test,v 1.14 2006/06/14 08:48:26 danielk1977 Exp $
+# $Id: vtab1.test,v 1.15 2006/06/14 22:07:11 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
xFilter {SELECT rowid, * FROM 'treal' WHERE b >= ? AND b <= ?} 2 10 ]
# Add a function for the MATCH operator. Everything always matches!
-proc test_match {lhs rhs} {
- lappend ::echo_module MATCH $lhs $rhs
- return 1
-}
-db function match test_match
+#proc test_match {lhs rhs} {
+# lappend ::echo_module MATCH $lhs $rhs
+# return 1
+#}
+#db function match test_match
set echo_module ""
do_test vtab1-3.12 {
set echo_module ""
- execsql {
+ catchsql {
SELECT * FROM t1 WHERE a MATCH 'string';
}
-} {1 2 3 4 5 6}
+} {1 {MATCH is not implemented}}
do_test vtab1-3.13 {
set echo_module
} [list xBestIndex {SELECT rowid, * FROM 'treal'} \
- xFilter {SELECT rowid, * FROM 'treal'} \
- MATCH string 1 \
- MATCH string 4 \
-]
+ xFilter {SELECT rowid, * FROM 'treal'}]
do_test vtab1-3.14 {
set echo_module ""
+btree_breakpoint
execsql {
SELECT * FROM t1 WHERE b MATCH 'string';
}
-} {1 2 3 4 5 6}
+} {}
do_test vtab1-3.15 {
set echo_module
-} [list xBestIndex {SELECT rowid, * FROM 'treal' WHERE b MATCH ?} \
- xFilter {SELECT rowid, * FROM 'treal' WHERE b MATCH ?} string ]
+} [list xBestIndex \
+ {SELECT rowid, * FROM 'treal' WHERE b LIKE (SELECT '%'||?||'%')} \
+ xFilter \
+ {SELECT rowid, * FROM 'treal' WHERE b LIKE (SELECT '%'||?||'%')} \
+ string ]
#----------------------------------------------------------------------
# Test case vtab1-3 test table scans and the echo module's
xFilter {SELECT rowid, * FROM 'treal'} ]
finish_test
-