Hi Pavel,

>I believe you need to show us your sql query. Maybe something in it
>forces SQLite to use UTF-16 version of the function.


On the contrary, I believe this is due to a serious design bug, where 
it is impossible to perform anything like:

        select load_extension('whatever.dll');

to load an extension that needs to override existing functions.

The code even says it very clearly.  See 3.6.18 amalgamation line 93648:

------------------
   /* Check if an existing function is being overridden or deleted. If so,
   ** and there are active VMs, then return SQLITE_BUSY. If a function
   ** is being overridden/deleted but there are no active VMs, allow the
   ** operation to continue but invalidate all precompiled statements.
   */
   p = sqlite3FindFunction(db, zFunctionName, nName, nArg, (u8)enc, 0);
   if( p && p->iPrefEnc==enc && p->nArg==nArg ){
     if( db->activeVdbeCnt ){
       sqlite3Error(db, SQLITE_BUSY,
         "unable to delete/modify user-function due to active statements");
       assert( !db->mallocFailed );
       return SQLITE_BUSY;
     }else{
       sqlite3ExpirePreparedStatements(db);
     }
   }
------------------

It is then obvious that such a situation returns SQLITE_BUSY, because 
"select load_extension(...)" _is_ a running statement (an active VM) by 
itself.

Now the question is: how are users of SQLite DB managers supposed to 
override built-in functions or collations?

If they are unable to do so, the functions / collations have to use 
different names.  But then, the main application(s) for the same 
base(s) also have to use the same different names for collations 
(indices) and functions (triggers).





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

Reply via email to