JTable checked_out_time #1809

Closed
artur-stepien opened this Issue Jan 23, 2013 · 5 comments

4 participants

@artur-stepien

There is one wrong thing with that column starting at least from Joomla! 1.5 . By default it is saved as null date. Now when you update table you will get error like this if you have data in it:

Executing SQL script in server
ERROR: Error 1292: Incorrect datetime value: '0000-00-00 00:00:00' for column 'checked_out_time' at row 1

Isn't it better to mark this column as null? Data will look as it should be, no more errors. Of course there can be made simple fall-back function that will check if column can be null. If no, null date will be set.

@AmyStephen

I think a little more info might be helpful.

Yes, since 1.5, Joomla has saved the checked_out_time field with null date (along with other date fields). Obviously, data has been updated in many tables using JTable since that time without any problem.

I can see you are getting an error, but how? What application are you using? How can we reproduce the error to see what might be happening?

@artur-stepien

Ok, here is more informations
0000-00-00 is not valid date
This error occur when I try to synchronize database model with Joomla Database using MySQL Workbench. I think that there is data checking before table update. And because that null date isn't correct date synchronization returns error. Also using just NULL will be more consistent with standards. INNODB has no performance issues when using NULL fields, and there will be DB space saved when user has a lot of such 0000-00-00 00:00:00

This also affects created and modified time columns.

@elkuku
Joomla! member

Oh yes, this is a common issue.. I can't remember the Workbench but in jdbc based tools you usually add a ?zeroDateTimeBehavior=convertToNull to the connection string ;)

The issue is more ugly when your actual database driver complains about those "invalid" dates (like PostgreSQL and SQLite does..)

@AmyStephen

Have been digging around, trying to figure out where that setting is in MySQLBench. I used to have that problem working but it's been a long time.

http://dev.mysql.com/doc/refman/5.1/en/connector-j-reference-configuration-properties.html

@malkowitch are you using a MySQLi driver? If not, try that (unless you know where to change your connection string.)

@eddieajau

I'm sorry but we aren't accepting issues for this repository any more. Please see http://developer.joomla.org/cms/report-an-issue.html for how to report and issue for the CMS Platform.

@eddieajau eddieajau closed this Apr 5, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment