summaryrefslogtreecommitdiff
path: root/ext/fts3/fts3_aux.c
diff options
context:
space:
mode:
authorHans-Christoph Steiner <hans@eds.org>2013-08-13 15:43:01 -0400
committerHans-Christoph Steiner <hans@eds.org>2013-08-13 15:43:01 -0400
commit4228998fd796fa2f9e84fb73632e0a07cc7cd188 (patch)
tree15b2336f351468fedd0c39e9de4ad905a686f3b0 /ext/fts3/fts3_aux.c
parentbdee7cf7d974b2f70d5934786c5666006e7360be (diff)
parent08119c361d1181b3e8f1abb429236e488a664753 (diff)
Merge tag 'upstream/2.2.1'
Upstream version 2.2.1 # gpg: Signature made Tue 13 Aug 2013 03:42:56 PM EDT using RSA key ID 374BBE81 # gpg: Good signature from "Hans-Christoph Steiner <hans@at.or.at>" # gpg: aka "[jpeg image of size 5408]" # gpg: aka "Hans-Christoph Steiner <hs420@nyu.edu>" # gpg: aka "Hans-Christoph Steiner <hans@eds.org>" # gpg: aka "Hans-Christoph Steiner <hans@guardianproject.info>" # gpg: aka "Hans-Christoph Steiner <hansi@nyu.edu>" # gpg: aka "Hans-Christoph Steiner <hans@guardianproject.info>"
Diffstat (limited to 'ext/fts3/fts3_aux.c')
-rw-r--r--ext/fts3/fts3_aux.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/ext/fts3/fts3_aux.c b/ext/fts3/fts3_aux.c
index a2bff2e..9b582fc 100644
--- a/ext/fts3/fts3_aux.c
+++ b/ext/fts3/fts3_aux.c
@@ -70,17 +70,26 @@ static int fts3auxConnectMethod(
UNUSED_PARAMETER(pUnused);
- /* The user should specify a single argument - the name of an fts3 table. */
- if( argc!=4 ){
- *pzErr = sqlite3_mprintf(
- "wrong number of arguments to fts4aux constructor"
- );
- return SQLITE_ERROR;
- }
+ /* The user should invoke this in one of two forms:
+ **
+ ** CREATE VIRTUAL TABLE xxx USING fts4aux(fts4-table);
+ ** CREATE VIRTUAL TABLE xxx USING fts4aux(fts4-table-db, fts4-table);
+ */
+ if( argc!=4 && argc!=5 ) goto bad_args;
zDb = argv[1];
nDb = (int)strlen(zDb);
- zFts3 = argv[3];
+ if( argc==5 ){
+ if( nDb==4 && 0==sqlite3_strnicmp("temp", zDb, 4) ){
+ zDb = argv[3];
+ nDb = (int)strlen(zDb);
+ zFts3 = argv[4];
+ }else{
+ goto bad_args;
+ }
+ }else{
+ zFts3 = argv[3];
+ }
nFts3 = (int)strlen(zFts3);
rc = sqlite3_declare_vtab(db, FTS3_TERMS_SCHEMA);
@@ -103,6 +112,10 @@ static int fts3auxConnectMethod(
*ppVtab = (sqlite3_vtab *)p;
return SQLITE_OK;
+
+ bad_args:
+ *pzErr = sqlite3_mprintf("invalid arguments to fts4aux constructor");
+ return SQLITE_ERROR;
}
/*