-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #15994 - Attribute bug when default current_timestamp used with on update current_timestamp #16653
Conversation
Codecov Report
@@ Coverage Diff @@
## QA_5_1 #16653 +/- ##
=========================================
Coverage 53.03% 53.03%
Complexity 15168 15168
=========================================
Files 470 470
Lines 63112 63112
=========================================
Hits 33469 33469
Misses 29643 29643
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a good fix !
@sudo-robot deploy |
Deployed (phpmyadmin-pr-16653): url: https://phpmyadmin-pr-16653.wdes.eu.org Deploy finished |
Hi @iifawzi I could confirm that your fix works only for MySQL, could you make it MariaDB compatible ? tested using the deployed server |
Hmm, it seems like that's because MariaDB generate the Extra field with additional Parentheses: I will work on it |
i've added an |
Maybe you could add a And add a comment What do you think ? |
I think sure, i will squash them and add the comment. |
Indeed, very accurate, I seem to have missed that detail |
62dff1b
to
ea1d294
Compare
Signed-off-by: Fawzi E. Abdulfattah <iifawzie@gmail.com>
ea1d294
to
9503151
Compare
Awesome, thanks for your time reviewing this. |
I added 5e5733d because it did not work on my MariaDB 10.4 instance, using a lowercase compare is safer |
Signed-off-by: Fawzi E. Abdulfattah iifawzie@gmail.com
Description
It seems like the bug in #15994 is occurred ONLY in the following case:
CURRENT_TIMESTAMP
and anon update CURRENT_TIMESTAMP
is used, this leads to generate the following Extra field:DEFAULT_GENERATED ON UPDATE CURRENT_TIMESTAMP
as shown below (tested on the PMA demo with version 5.2.0-dev)which fails this check:
phpmyadmin/templates/columns_definitions/column_attribute.twig
Lines 4 to 5 in c1a66ad
i've changed it to check if the extra field contains
on update CURRENT_TIMESTAMP
or not.Fixes #15994