On Tue, Oct 06, 2009 at 05:47:10PM -0700, Brian Aker wrote:
> This bug was pointed out to me:
> http://bugs.mysql.com/bug.php?id=27645
Ahh.... FRM and the random limits you place on things.
> Thanks to proto we can add the ability of "use this function" with no
> real difficulty. The problem is what do we call a "function".
we can also easily do this for any field, not just DATE.
We currently even do this for TIMESTAMP DEFAULT NOW(), it puts the
"NOW()" function in the table proto (and then string compares it to pull
it out into the unireg_check crud in the server).
> Right now we have just one type of "function" in the server. Now we
> could reuse those if we wanted too but we would need to flag which can,
> and cannot be used in create table.
> We could try to shoehorn in the current function system so that it
> worked everywhere. Does that make sense? MySQL's partitioning system
> tried that and it made a mess of the functions. Why? Because not every
> function makes sense in every context.
What about allowing all non-aggregate functions?
perhaps also disallowing arguments that have to be further evaluated
(e.g. you can't have "FIELDA DEFAULT MD5(FIELDB)" but you could have
"FIELDA DEFAULT MD5("PANTS")") ?
> My personal take on this? I would rather declare a set of functions just
> for this and add them in as plugins. If convergence was to happen we
> would eventually figure it out, but I sort of doubt we would see a
> perfect convergence happen.
Is there any situation where an Item_func_str or an Item_func_int could
not be safely evaluated by throwing it some parameters that are just
strings or numbers? Some may be ahem... interesting (default gearman job
or something)
> Thoughts on this? I'm not talking "virtual functions" but just a set of
> simple functions (at least to begin with) that we would use for this sort
> of thing. They would generate a value on start of a statement and then
> that value would be used throughout the execution (aka... for a bulk
> insert it would be done just once). We could straighten out the now()
> code used for timestamp at the same time (for those playing along at
> home... that code is currently down in the engines, and not in the
> interface where it belongs... which means I should just fix this at some
> point).
++
--
Stewart Smith
_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help : https://help.launchpad.net/ListHelp