/ Check-in [d5b6b374]
Login

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

Overview
Comment:The sqlite3_overload_function() interface returns an error if it is unable to create the overload function. Ticket [20f9d4fbbff3a3]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d5b6b374c5225d21c386fb3d6507d3938296e759
User & Date: drh 2011-10-12 23:49:49
Context
2011-10-13
00:11
Be sure to allocate plenty of space for error messages coming out of sqlite3_load_extension(), so that filenames and procedure names are not truncated. Ticket [7d32c69b50f89d] check-in: af8bcdd9 user: drh tags: trunk
2011-10-12
23:49
The sqlite3_overload_function() interface returns an error if it is unable to create the overload function. Ticket [20f9d4fbbff3a3] check-in: d5b6b374 user: drh tags: trunk
23:13
The date/time functions return NULL if the xCurrentTime or xCurrentTimeInt64 VFS methods fail. Ticket [0b803bff856c644c] check-in: c96651dd user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/main.c.

  1210   1210   */
  1211   1211   int sqlite3_overload_function(
  1212   1212     sqlite3 *db,
  1213   1213     const char *zName,
  1214   1214     int nArg
  1215   1215   ){
  1216   1216     int nName = sqlite3Strlen30(zName);
  1217         -  int rc;
         1217  +  int rc = SQLITE_OK;
  1218   1218     sqlite3_mutex_enter(db->mutex);
  1219   1219     if( sqlite3FindFunction(db, zName, nName, nArg, SQLITE_UTF8, 0)==0 ){
  1220         -    sqlite3CreateFunc(db, zName, nArg, SQLITE_UTF8,
  1221         -                      0, sqlite3InvalidFunction, 0, 0, 0);
         1220  +    rc = sqlite3CreateFunc(db, zName, nArg, SQLITE_UTF8,
         1221  +                           0, sqlite3InvalidFunction, 0, 0, 0);
  1222   1222     }
  1223         -  rc = sqlite3ApiExit(db, SQLITE_OK);
         1223  +  rc = sqlite3ApiExit(db, rc);
  1224   1224     sqlite3_mutex_leave(db->mutex);
  1225   1225     return rc;
  1226   1226   }
  1227   1227   
  1228   1228   #ifndef SQLITE_OMIT_TRACE
  1229   1229   /*
  1230   1230   ** Register a trace function.  The pArg from the previously registered trace