|
|||||||||||
|
Re: [PATCH] (super)user-loadable mysqld parsers
From: Eric Prud'hommeaux <eric(at)w3.org>
Date: Wed Sep 05 2007 - 17:03:57 EDT
The extension works by adding three new request types to the client/server protocol: PARSER1, PARSER2, PARSER3. The API function mysql_send_query takes a fourth parameter in order to send this to the server. On the server side, sql_parse.cc responds to requests for PARSER{1,2,3} by invoking dynamic_parsers[N].initialize->parse(). See [SRC] and [DYN] (below) for compilation and execution instructions. [SRC] http://www.w3.org/2005/05/22-SPARQL-MySQL/#srcbuild [DYN] http://www.w3.org/2005/05/22-SPARQL-MySQL/#dynParser
A couple notes about protocol compatibility: a stock 5.x client does
everything we need except invoke PARSERn requests. This is 'cause I
left COM_QUERY where it was, and stuck the user-selected parsers at
the end of the enum.
COM_PARSER0 is only used as a base for counting parser offsetsd; it is never passed so we could save an enum by assigning it to the previous value:
/* add-on parsers */
Brian and I discussed implementing a stacked parser approach: mysql> add_parser("libsparql", ParserPos_FRONT); mysql> SELECT ?s WHERE { ?s <foo.bar> "hibbyhop"; The cost of this is that you can't force any particular parser to handle a particular request (unless you remove_parser and add_parser to get the one you like up front for that query). It would, however, provide a neat extensibility mechanism where 3rd party providers could supply parsers for add-on functionality. I prototyped this a bit in a Dynamic_parser and believe that a Dynamic_parser could provide a parser that stacked other Dynamic_parsers and even target queries at a particular parser if one chose. However, I have not really implemented this. Any feedback will be enthusiastically welcomed. I'm motivated to type madly on this on the off-chance I can get it into the 5.2 release as I have several pharmaceuticals interested in the SPASQL project and am anxious to get them working with the MySQL implementation. -- -eric office: +1.617.258.5741 NE43-344, MIT, Cambridge, MA 02144 USA mobile: +1.617.599.3509 (eric@w3.org) Feel free to forward this message to any list for any purpose other than email address distribution.
This archive was generated by hypermail 2.1.8 : Sun Oct 07 2007 - 07:59:19 EDT |
||||||||||
|
|||||||||||