Hi!

On May 15, 2009, at 3:36 AM, Toru Maesaka wrote:

Hi Kay!

This is awesome to hear. So if I didn't misunderstand, does this mean
that we can logically separate the lexical analyzer and the parse tree
generator at the point you feed it out to the SQL warning? This would
be exciting!

Right now there's no separation, just a wrapper function that queues up the tokens, serializes them to a string at the EOF marker and then attaches that string as a warning to the response. In fact, there's no such thing as a token stream in the current mysql/ drizzle implementation which is fair enough because there never was the need to have one. But I think for a truly pluggable and extensible subsystem it's the easiest and cleanest way to structure the code and will probably be the first thing I'll do. From cursory inspection this doesn't seem to be a highly invasive change so it's a good start.

Currently there's no support to dump the structure of that, although there's
support for getting the query text back (in a "normalized" form).
I suppose we can take a good, hard stare the various print methods and abstract something out of that, then reimplement print in terms of that.

Right, so I'm pretty naive on this... would you be able to explain the
goodness we can achieve from this?

My problem is that I cannot easily picture the datastructures and their relationships from looking at a query string. Which means I have a hard time deciding what parts to tackle first and what shape a sensible API would have. Thus I want to be able to dump graphviz (or so) files that i can then look at - debuggers are just an incovenient tool to look at trees with. The second point is that by having a visitor infrastructure you can write tests that check that after modifications the trees are still correct. Right now the system tests confirm the entire system still works, but they tend to take a long time to run. Simpler tests are faster and thus we can check more cases.

cheers,
-k
--
Kay Roepke
Software Engineer, MySQL Enterprise Tools

Sun Microsystems GmbH    Sonnenallee 1, DE-85551 Kirchheim-Heimstetten
Geschaeftsfuehrer:    Thomas Schroeder,  Wolfang Engels,  Wolf Frenkel
Vorsitz d. Aufs.rat.: Martin Haering                    HRB MUC 161028


_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp

Reply via email to