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:
11
src/test8.c
11
src/test8.c
@@ -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";
|
||||
|
Reference in New Issue
Block a user