On 1/16/15, Scott Robison <sc...@casaderobison.com> wrote: > LIKE & GLOB can be overridden with user defined functions. According to > https://www.sqlite.org/lang_corefunc.html LIKE can be a 2 or 3 argument > function, GLOB can be a 2 argument function, and neither MATCH nor REGEXP > can be redefined.
Where did you read that MATCH and REGEXP could not be redefined? That is a bug in the documentation that needs to be fixed. They are undefined by default and are given meaning by redefining. They would be useless if they were not redefinable. > > MATCH is only used in FTS queries if my understanding is correct, so I can > appreciate why MATCH can't be redefined given the close integration between > the keyword and a specific virtual table module. > > That leaves LIKE & GLOB & REGEXP. Why the differences in redefinition > capabilities? Why can't an ESCAPE clause form of GLOB be redefined? Why > can't any form of REGEXP be redefined? Or are some or all of these > "exceptions" possible but the documentation doesn't cover them? > > I have no desire to redefine anything myself, this is primarily an exercise > in understanding why the design choices were made, and I am wondering if > there is ever a reason in SQL code to choose the function form of the LIKE > (or other) operator over the operator itself. Is it intended that the > operator form of the expression will always behave exactly like the > function form of the expression (with the appropriate reordering of > arguments)? > > -- > Scott Robison > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- D. Richard Hipp d...@sqlite.org _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users