I did some more testing, and it is actually the code that register's the
tokenizer, not the code that creates the table that is seg faulting.

-----Original Message-----
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Travis Orr
Sent: October 5, 2010 9:34 AM
To: sqlite-users@sqlite.org
Subject: [sqlite] Help registering custom tokenizer

I am currently working on writing a custom tokenizer for use with a FTS3
indexed database. I believe I have written the new tokenizer module
correctly and am just missing something with registering the tokenizer
with the database.

 

To verify this I copied the simple_tokenizer1.c to a new file and
replaced all instances of 'simple' with 'unaccent'.

 

The following code was used to register the tokenizer.

 

sqlite3_stmt *pStmt;

            const char *zSql = "SELECT fts3_tokenizer(?, ?)";

 

            rc = sqlite3_prepare_v2(ldb_con, zSql, -1, &pStmt, 0);

            if( rc!=SQLITE_OK ){

                        return rc;

            }

 

            rc = sqlite3_bind_text(pStmt, 1, "unaccent", -1,
SQLITE_STATIC);

            rc = sqlite3_bind_blob(pStmt, 2, &p, sizeof(p),
SQLITE_STATIC);

            rc = sqlite3_step(pStmt);

 

            rc = sqlite3_finalize(pStmt);

 

SQLITE_OK is the final rc.

 

When I try to create a table using the new tokenizer I get a segfault in
sqlite3Fts3InitTokenizer(). The code to create the table is:

 

            query = "CREATE VIRTUAL TABLE testTable USING fts3
(tokenize='unaccent');";

            rc = db_run_query_on_con (ldb_con, query, LOCAL_DB_ROOT,
false);

 

Am I missing something obvious?

 

Thanks,

 

Travis Orr

 

IVL Audio Inc.

#3-6703 Rajpur Place

Victoria BC

V8M 1Z5

 

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to