Hello, Martin!
* Martin Hansson <martin.hansson@stripped> [11/03/24 12:29]:
> #At file:///data0/martin/bzrroot/bug11746628/t-enginestuff/ based on
> revid:tor.didriksen@stripped
>
> 3318 Martin Hansson 2011-03-24
> Preliminary refactoring in order to fix Bug 11746628 -
> 27645: DATETIME FIELD DOES NOT ACCEPT DEFAULT NOW()
>
> This patch removes all references to the members
> TABLE::timestamp_field and TABLE::timestamp_field_type from
> the handler API, as these are subject to removal in the fix
> for the bug. Instead a new interface
> TABLE::[begin|end][insert|update]() has been introduced. The
> new member functions are called from the handler class as
> opposed to copy-pasting the code in all handler subclasses,
> as was the case previously.
Why do the code setting default value for columns with DEFAULT
NOW() clause has to be called from the handler class at all?
I know that it works this way now, but, IMO, this is rather a bug than
a feature. Particularly, this means that correct default values for
such columns are not accessible from BEFORE INSERT trigger as they
should be per SQL standard.
I think that rather than following old approach and making code that
implements it more generic/nicer we should bite the bullet now and
move this code/call to it out of handler, completely, to the different
stage of row processing for INSERT, to some point before execution of
BEFORE INSERT triggers.
I will be happy to provide any assistance with this if needed!
--
Dmitry Lenev, Software Developer
Oracle Development SPB/MySQL, www.mysql.com
Are you MySQL certified? http://www.mysql.com/certification