>From the command line, I see:

sqlite> SELECT section, count(*) FROM 'index' WHERE name MATCH '"*'
GROUP BY section;
Error: malformed MATCH expression: ["*]


But when I do a prepare/step, I get a much less informative message:

int result = sqlite3_prepare_v2(routeDb, sql, -1, &compiledStatement, NULL );
NSAssert2( SQLITE_OK == result, @"Error preparing statment <%s>: %s",
sql, sqlite3_errmsg( routeDb ) );
---> preparation works fine

while ( SQLITE_ROW == (result = sqlite3_step(compiledStatement)) ) {
    // ...
}
NSAssert3( result == SQLITE_DONE, @"Unexpected result of stepping
<%s>. %d '%s'", sql, result, sqlite3_errmsg( routeDb ) );

---> This returns a very generic message:

          Unexpected result of stepping <SELECT section, count(*) FROM
'index' WHERE name MATCH '"*' GROUP BY section;>. 1 'SQL logic error
or missing database'

In this case, the user typed a double quote into an FTS3 search field,
which isn't valid, but I want to get the message that says that, not
'SQL logic error'!

Is there a better API I can use to get validation of the match syntax?

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

Reply via email to