Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: Best way to determine table name in INFORMATION_SCHEMA's fill_table()?

From: Sergei Golubchik <serg(at)mysql.com>
Date: Mon Jul 16 2007 - 05:38:14 EDT


Hi!

On Jul 13, Vasil Dimov wrote:
> Hi,
>
> Some background:
> The init() function of an INFORMATION_SCHEMA plugin sets the
> ::fill_table member which is a function that takes
> THD*, TABLE_LIST*, COND* arguments.
>
> My question is:
>
> What is the best way to determine the name of the table from this
> function?
>
> (I intend to use one function for several plugins, in the case of one
> plugin this question does not make sense because the table being filled
> is known in advance).
>
> I can see that (assuming the TABLE_LIST* argument name "table") the
> name of the table being filled is set in these fields:
> table->alias
> table->schema_table_name
> table->schema_table->table_name
>
> Does it matter which one am I going to use? Is it possible that in
> some circumstances some of these is not set or is set to something
> else than the plain table name?

<disclaimer>I didn't look in the debugger, below is an educated guess</disclaimer>

I'd use table->schema_table_name. table->schema_table->table_name seems to be the same though. table->alias looks problematic, try for example

  SELECT * FROM INFORMATION_SCHEMA.ENGINES as t1;

Regards / Mit vielen Grüssen,
Sergei

-- 
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /   Sergei Golubchik 
 / /|_/ / // /\ \/ /_/ / /__  Principal Software Developer
/_/  /_/\_, /___/\___\_\___/  MySQL GmbH, Radlkoferstr. 2, D-81373 München
       <___/                  Geschäftsführer: Kaj Arnö - HRB München 162140

-- 
MySQL Internals Mailing List
For list archives: 
http://lists.mysql.com/internals
To unsubscribe:    
http://lists.mysql.com/internals?unsub=lists@pantek.com
Received on Mon Jul 16 05:39:20 2007

This archive was generated by hypermail 2.1.8 : Thu Aug 09 2007 - 19:06:16 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library