[BUG]: datetime field NULL value is wrong in compiled install.mysql.utf8.sql #1188
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#1188
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What Happened?
In my install.mysql.utf8.sql I see this invalid setting for a DATETIME field with default value set to None:
finish_timestamp
DATETIME NULL DEFAULT '',It should be:
finish_timestamp
DATETIME NULL,Steps to reproduce the Bug
Create a datetime field (calendar).
In the database tab, set datatype = datetime, data default = none, Null Switch = NULL
Which Joomla version are you compiling in?
v5.2.1
Which PHP version are you compiling in?
v8.1
Which Joomla versions are you targeting?
v5.2.1
Which PHP version are you targeting?
8.2
Which Web server is JCB running on?
Apache 2.4
Which Relational Database is JCB running on?
MariaDB 10.4.31
Which OS is JCB running on?
Ubuntu 20.0.4
Which JCB version are you using?
v5.0.4-beta1
Where in JCB did this issue occur?
Installation of a component
On which browsers did you encounter the issue?
Safari
Additional Comments
No response
Just checking in on this issue?
This normally worked for me:
As for the
finish_timestamp DATETIME NULL DEFAULT '',
to change this to showNULL
I will have to check... this might take a while :)0000-00-00 00:00:00 would require to disable strict mode on MySQL 5.7+. I think it's considered bad practice to do that. In MariaDB from 10.2.4 onwards STRICT_TRANS_TABLES is enabled by default. This mode prevents the use of invalid date values like 0000-00-00 00:00:00.
Yes, I am aware of this, and we did add this change to the core dates
To achieve this you can do the following:
That will produce:
This string
EMPTY
in the other value removes theDEFAULT ''
, we opt for that as the solution since we used the'none'
option to mean empty string... in most of our projects. So maybe we should rethink the whole design of that... for now just addEMPTY
string to the other value and it should work.This also works:
This will produce: