[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql-internals
Subject:    Re: How to create hidden Field  in Storage Engine?
From:       "xiao feng" <cnstar9988 () gmail ! com>
Date:       2007-04-22 2:56:35
Message-ID: CA48A5C5AC024B7FB9EC16278C3E9DE4 () xiaofeng
[Download RAW message or body]

Hi,
> > > Are you wanting to do the query so that new fields can be specified  in the \
> > > select, or that a * would return whatever >>>additional fields  you wanted to \
> > > return at the time?
    Like Oracle's virtual fields rowid/rownum:
      1.when select * from tables,  not return additional fields.
            rowid, rownum can in where condition, like "select * from tables where \
rowid='xxxxx'".  not return additional fields.
      2.when select rowid, * from tables, return the additional field "rowid".

Thanks!

    

----- Original Message ----- 
From: "Brian Aker" <brian@tangent.org>
To: "xiao feng" <cnstar9988@gmail.com>
Cc: <peter@ddengine.org>; "Sergei Golubchik" <serg@mysql.com>; "MySQL Internal" \
                <internals@lists.mysql.com>
Sent: Saturday, April 21, 2007 11:59 PM
Subject: Re: How to create hidden Field in Storage Engine?


Hi!

On Apr 21, 2007, at 2:42 AM, xiao feng wrote:

> I have a db engine, I have use it as an mysql Storage Engine.
> I wan to auto create some hidden fields in table, such as  
> Oracle's rownum/rowid, it can be used for query data, but not in  
> tables "desc¡±¡£
> So  I think storage should have a vritual function like  
> prepare_create ,  allow user can add their own hidden fields before  
> create table.

If you wanted to do deep hackery, you could adjust the query at some  
early point in the query and add fields.

This would be an incredible hack though.

Are you wanting to do the query so that new fields can be specified  
in the select, or that a * would return whatever additional fields  
you wanted to return at the time?

In 5.2 we do have the ability to add comments per field, you could  
use that to say which fields are virtual, and which are not.

Cheers,
-Brian

> Thanks!
> 
> ----- Original Message -----
> From: <peter@ddengine.org>
> To: "xiao feng" <cnstar9988@gmail.com>
> Cc: <peter@ddengine.org>; "Sergei Golubchik" <serg@mysql.com>;  
> "MySQL Internal" <internals@lists.mysql.com>
> Sent: Wednesday, April 11, 2007 3:07 PM
> Subject: Re: How to create hidden Field in Storage Engine?
> 
> 
> > Hi Xiao,
> > 
> > > I think storage should have a vritual function like  
> > > prepare_create ,
> > > allow user can add their own hidden fields before create table.
> > 
> > if you could explain a bit more in detail what you trying to  
> > implement it
> > would be better to understand why you need it. Also what type of  
> > storage
> > engine are you trying to implement?
> > 
> > Cheers,
> > Peter
> > 
> 
> -- 
> MySQL Internals Mailing List
> For list archives: http://lists.mysql.com/internals
> To unsubscribe:    http://lists.mysql.com/internals? 
> unsub=brian@tangent.org
> 

--
_______________________________________________________
Brian "Krow" Aker, brian at tangent.org
Seattle, Washington
http://krow.net/
http://tangent.org/
_______________________________________________________
You can't grep a dead tree.



-- 
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe:    http://lists.mysql.com/internals?unsub=mysql-internals@progressive-comp.com



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic