Hi Xiao,
Why not just insist that the table be created with a column with a
specific name, like "row#". The table definition would also have to
include a unique index definition on this column.
Your engine can then handle this column internally as the rowid
column. So the engine would generate an error if the column is
inserted or updated (or just ignore such operations), and handle
index access on this column as a special case.
With this method the rowID column would not be hidden, but does it
really have to be?
Best regards,
Paul
On Apr 21, 2007, at 11:42 AM, xiao feng wrote:
> Hi,
> 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.
> Thanks!
>
> ----- Original Message -----
> From: <peter@stripped>
> To: "xiao feng" <cnstar9988@stripped>
> Cc: <peter@stripped>; "Sergei Golubchik" <serg@stripped>;
> "MySQL Internal" <internals@stripped>
> 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=paul.mccullagh@stripped
>