Merge #16653 - Fix #15994 - Attribute bug when default current_timestamp used with on update current_timestamp

Pull-request: #16653
Fixes: #15994

Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
William Desportes 2021-02-16 15:09:17 +01:00
commit 9316921a8a
No known key found for this signature in database
GPG Key ID: 90A0EF1B8251A889

View File

@ -1,7 +1,8 @@
{% if submit_attribute is defined and submit_attribute != false %}
{% set attribute = submit_attribute %}
{# MariaDB has additional parentheses #}
{% elseif column_meta['Extra'] is defined
and column_meta['Extra'] == 'on update CURRENT_TIMESTAMP' %}
and ('on update CURRENT_TIMESTAMP' in column_meta['Extra'] or 'on update CURRENT_TIMESTAMP()' in column_meta['Extra']) %}
{% set attribute = 'on update CURRENT_TIMESTAMP' %}
{% elseif extracted_columnspec['attribute'] is defined %}
{% set attribute = extracted_columnspec['attribute'] %}