From: Date: April 3 2006 10:33am Subject: Re: getting table meta data (primary key, in this case) List-Archive: http://lists.mysql.com/internals/33495 Message-Id: <20060403083349.GB5668@serg.mylan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Hi! On Apr 01, Eric Prud'hommeaux wrote: > How can I, during query parsing on the server, efficiently find what > field is labeled as a primary key for a given table? ... Generally, you cannot do it. During the parsing you only do syntax checks. Later, tables are identified and opened - and then you have access to table structure and can find a primary key. > I have only seen this done when the client asks the question, which it > does with a particular query. I'm hoping not to have to do a query > while parsing, but will if I have to. I currently share no info > between queries. (how do I do that, anyways?) Store the information in THD. Or, you want to share information between _connections_ ? Regards, Sergei -- __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Sergei Golubchik / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Senior Software Developer /_/ /_/\_, /___/\___\_\___/ Kerpen, Germany <___/ www.mysql.com