On Tue, Oct 23, 2012 at 10:16:07PM +0200, gwenn scratched on the wall:
> Hello,
> 
> The documentation says the xRename function is mandatory:
> http://sqlite.org/vtab.html#xrename
> "The xRename method is required for every virtual table implementation."
> 
> But it seems possible to not specify it:
>   static const sqlite3_module fts3aux_module = {
> ...
>      0,                           /* xRename       */
> ...
>   };


  And when you attempt to rename the table, what happens?


  The virtual table interface is advanced, in the sense that there are
  very few safety nets or double-checks.  It is designed to be used by
  an intelligent programmer that knows their stuff.  You need to do what
  the docs say, exactly, or something bad can happen.  That's not to
  say something bad will happen right away.  The fact that you can assign
  a NULL function pointer to the xRename() function only means the system
  is not double-checking your work when you pass in the structure... it
  does not mean that passing a NULL is allowed.  I strongly suspect that
  if you do not provide a xRename() function, and someone attempts to
  rename the table, the whole application will simply crash.  Your fault.

   -j

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Intelligence is like underwear: it is important that you have it,
 but showing it to the wrong people has the tendency to make them
 feel uncomfortable." -- Angela Johnson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to