maria-developers team mailing list archive
Mailing list archive
Re: Getting the columns from LEX or THD
On Jun 14, Sriram Patil wrote:
> Hi all,
> I wanted to retrieve a tables columns i.e its schema definition when a
> query is executed. I figured out LEX and THD structures store these in
> different variables for different queries.
> I wanted to get the same when a simple INSERT query is executed, e.g
> INSERT INTO <table> VALUES(<values>). Where can I find it?
> Is there any mechanism to get a tables schema that will work for any
> kind of query?
You're working on MaxScale now, so, I'm guessing that you only have the
parser and have all the data that the parser created, but no more.
In that case, the answer is no, it is impossible to get a table schema
(or all table columns). Most probably you only have the information that
the parser has, that was contained in the query. Table definition is
stored in the real dbms server, the proxy doesn't have it, as far as I