/ Check-in [de508e83]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix compiler warnings in FTS3.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: de508e831a43f02c3b354a24ea34798da03c163bae5521c852c9ddd252723739
User & Date: drh 2018-04-28 04:10:55
Context
2018-04-28
04:16
Prevent deep recursions on nested COLLATE operators. check-in: 6e098ee4 user: drh tags: trunk
04:10
Fix compiler warnings in FTS3. check-in: de508e83 user: drh tags: trunk
01:46
Document and expose sqlite3_win32_set_directory() function for use on Win32. check-in: 7626b593 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/fts3/fts3_expr.c.

  1177   1177   */
  1178   1178   static void fts3ExprTestCommon(
  1179   1179     int bRebalance,
  1180   1180     sqlite3_context *context,
  1181   1181     int argc,
  1182   1182     sqlite3_value **argv
  1183   1183   ){
  1184         -  sqlite3_tokenizer_module const *pModule = 0;
  1185   1184     sqlite3_tokenizer *pTokenizer = 0;
  1186   1185     int rc;
  1187   1186     char **azCol = 0;
  1188   1187     const char *zExpr;
  1189   1188     int nExpr;
  1190   1189     int nCol;
  1191   1190     int ii;
  1192   1191     Fts3Expr *pExpr;
  1193   1192     char *zBuf = 0;
  1194         -  sqlite3 *db = sqlite3_context_db_handle(context);
  1195   1193     Fts3Hash *pHash = (Fts3Hash*)sqlite3_user_data(context);
  1196   1194     const char *zTokenizer = 0;
  1197   1195     char *zErr = 0;
  1198   1196   
  1199   1197     if( argc<3 ){
  1200   1198       sqlite3_result_error(context, 
  1201   1199           "Usage: fts3_exprtest(tokenizer, expr, col1, ...", -1
  1202   1200       );
  1203   1201       return;
  1204   1202     }
  1205   1203   
  1206         -  zTokenizer = sqlite3_value_text(argv[0]);
         1204  +  zTokenizer = (const char*)sqlite3_value_text(argv[0]);
  1207   1205     rc = sqlite3Fts3InitTokenizer(pHash, zTokenizer, &pTokenizer, &zErr);
  1208   1206     if( rc!=SQLITE_OK ){
  1209   1207       if( rc==SQLITE_NOMEM ){
  1210   1208         sqlite3_result_error_nomem(context);
  1211   1209       }else{
  1212   1210         sqlite3_result_error(context, zErr, -1);
  1213   1211       }

Changes to test/fts3expr.test.

   405    405   # cases in the test code, which makes test coverage easier to measure.
   406    406   # 
   407    407   do_test fts3expr-5.1 {
   408    408     catchsql { SELECT fts3_exprtest('simple', 'a b') }
   409    409   } {1 {Usage: fts3_exprtest(tokenizer, expr, col1, ...}}
   410    410   do_test fts3expr-5.2 {
   411    411     catchsql { SELECT fts3_exprtest('doesnotexist', 'a b', 'c') }
   412         -} {1 {No such tokenizer module}}
          412  +} {1 {unknown tokenizer: doesnotexist}}
   413    413   do_test fts3expr-5.3 {
   414    414     catchsql { SELECT fts3_exprtest('simple', 'a b OR', 'c') }
   415    415   } {1 {Error parsing expression}}
   416    416   
   417    417   #------------------------------------------------------------------------
   418    418   # The next set of tests verifies that things actually work as they are
   419    419   # supposed to when using the new syntax.