On Fri, Jun 06, 2008 at 13:18:19 +0300, Sanja Byelkin wrote:
> It is about "MySQL plugin interface: syntax extensions for CREATE
> TABLE" and for them who writes thier own engines.
>
> If you have some ideas or you see something wrong please say ASAP.
>
> Syntax will looks like this:
> CREATE TABLE table(
> id INT ENGINE_OPTIONS(OPT1=123, OPT2='someval',OPT3=aflag),
> INDEX USING BTREE (id)
> ) ENGINE = MEMORY
> ENGINE_OPTIONS(loc1='/mnt/d1/bigdat/mine',loc2=/mnt/d2/bigdata/mine') ;
>
> But we do not discuss syntax now but interface between plugin and MySQL:
>
> -----------------------------------------------------------------
>
> Proposed Implementation:
>
> Plugin supply 3 my_getopt-like list of parameters (for table/keys/fields)
> where offset from beginning of some descriptor structure mentioned for writing
> parsed result or default value in, Also it provide sizes of 3 structures (for
> table/keys/fields).
>
> MySQL server during parsing CREATE/ALTER statement or FRM file (actually
> just after parsing but it is not visible for plugin) allocates 1 structure of
> given size for table and 2 arrayes for fields and keys and fill them according
> to descriptor arrays (with default value or found value).
>
> Parser match keys (enums/sets) case insensitively and use system_charset for
> this task.
[...]
Hi,
What if the engine wants only INT fields to get FOO='bar', because
FOO does not make sense for VARCHAR fields (for example)?
What will happen if the engine specifies A1= and A2= as possible
table options but the user only creates the table with A1='x'? Will A2
be passed to the engine with the default value? If yes, then how would
the engine understand whether the user has specied
A2='the default value' or has not specied A2= at all?
--
Vasil Dimov
moc.elcaro@stripped Software Developer @ Oracle/Innobase Oy
gro.DSBeerF@dv Committer @ FreeBSD.org
gro.d5v@dv Home @ Sofia, Bulgaria
Attachment: [application/pgp-signature]