1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Bug fixes in the MATCH and ORDER BY processing of virtual tables. (CVS 3249)

FossilOrigin-Name: c996185a9e0671e46bed06e5803b1ca3b42d61e2
This commit is contained in:
drh
2006-06-14 22:07:10 +00:00
parent 4cbdda9e27
commit 1a90e099f4
5 changed files with 40 additions and 30 deletions

View File

@@ -13,7 +13,7 @@
** 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"
@@ -440,9 +440,14 @@ static int echoBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){
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";