Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: Need new accessors to THD internals

From: Marko Mäkelä <marko.makela(at)oracle.com>
Date: Thu Aug 30 2007 - 09:33:27 EDT


On Thu, Aug 30, 2007 at 02:29:35PM +0300, Jan Lindström wrote:
> Hi,
>
> I'm implementing dynamic plugin for solidDB storage engine and I would
> need to access following THD variables from my storage engine:
>
> 1) thd->query
>
> e.g with
>
> extern "C" const char *thd_query(MYSQL_THD thd)
> {
> return(thd->query);
> }
>
> This is needed for foreign keys (at the moment you must parse
> create table or alter table yourself).

Have you looked at storage/innobase/handler/ha_innodb.h recently?

> 2) thd->query_id
>
> e.g. with
>
> extern "C" ulong thd_query_id(MYSQL_THD thd)
> {
> return(&thd->query_id);
> }

InnoDB doesn't need this any more.

> 3) thd->lex->drop_mode;
>
> e.g. with
>
> extern "C" int thd_drop_mode(MYSQL_THD thd)
> {
> return(&thd->lex->drop_mode);
> }
>
> this is needed also for foreign keys and to support drop table ...
> cascade.

I guess InnoDB doesn't support DROP TABLE ... CASCADE then. On a related note, while testing smart ALTER TABLE, I found out that ALTER TABLE ... DROP FOREIGN KEY is not too smart: it will rebuild the table and all indexes in the old-fashioned way. This is a MySQL limitation.

> Could someone from MySQL add support for these assessors to
> plugin.h

I seriously doubt it. The accessors that we requested were defined inside #ifdef INNODB_COMPATIBILITY_HOOKS, and they are not visible unless MYSQL_SERVER is defined. That's why InnoDB has to declare them "manually".

Do you need help?X

        Marko

-- 
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 Thu Aug 30 09:36:55 2007

This archive was generated by hypermail 2.1.8 : Sun Oct 07 2007 - 07:59:16 EDT


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