You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by "Thomas Fischer (JIRA)" <ji...@apache.org> on 2006/05/01 18:03:46 UTC
[jira] Created: (TORQUE-11) Torque Type Timestamp should be mapped
to datetime in Mysql
Torque Type Timestamp should be mapped to datetime in Mysql
-------------------------------------------------------------
Key: TORQUE-11
URL: http://issues.apache.org/jira/browse/TORQUE-11
Project: Torque
Type: Improvement
Components: Generator, Runtime
Environment: Mysql
Reporter: Thomas Fischer
Fix For: 3.1, 3.1.1, 3.2
Currently, the torque type timestamp is mapped to timestamp in mysql. However, timestamp in mysql has a range only from 1970 to 2037, whereas datetime has a range from 1000 to 9999. Both seem to have second precision. Thanks to Joerg Friedrich for suggesting this.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
[jira] Commented: (TORQUE-11) Torque Type Timestamp should be
mapped to datetime in Mysql
Posted by "Thomas Fischer (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/TORQUE-11?page=comments#action_12377244 ]
Thomas Fischer commented on TORQUE-11:
--------------------------------------
This is problematic because of the magic behaviour of the timestamp column.
See
http://dev.mysql.com/doc/refman/4.1/en/timestamp-pre-4-1.html
and
http://dev.mysql.com/doc/refman/5.0/en/datetime.html
The magic behaviour happens if a mysql timestamp column is set to null, then it is automatically set to the current date by mysql. Once this has happened, the magic behaviour is not seen any more because the timestamp column is set explicitly on every update.
For mysql datetime columns, if the column value is set to null and saved, it is retrieved as null again.
> Torque Type Timestamp should be mapped to datetime in Mysql
> ------------------------------------------------------------
>
> Key: TORQUE-11
> URL: http://issues.apache.org/jira/browse/TORQUE-11
> Project: Torque
> Type: Improvement
> Components: Generator, Runtime
> Environment: Mysql
> Reporter: Thomas Fischer
> Fix For: 3.1, 3.1.1, 3.2
>
> Currently, the torque type timestamp is mapped to timestamp in mysql. However, timestamp in mysql has a range only from 1970 to 2037, whereas datetime has a range from 1000 to 9999. Both seem to have second precision. Thanks to Joerg Friedrich for suggesting this.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
[jira] Updated: (TORQUE-11) Torque Type Timestamp should be mapped
to datetime in Mysql
Posted by "Thomas Vandahl (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/TORQUE-11?page=all ]
Thomas Vandahl updated TORQUE-11:
---------------------------------
Fix Version/s: (was: 3.1)
(was: 3.1.1)
(was: 3.2)
Affects Version/s: 3.3
> Torque Type Timestamp should be mapped to datetime in Mysql
> ------------------------------------------------------------
>
> Key: TORQUE-11
> URL: http://issues.apache.org/jira/browse/TORQUE-11
> Project: Torque
> Issue Type: Improvement
> Components: Runtime, Generator
> Affects Versions: 3.3
> Environment: Mysql
> Reporter: Thomas Fischer
>
> Currently, the torque type timestamp is mapped to timestamp in mysql. However, timestamp in mysql has a range only from 1970 to 2037, whereas datetime has a range from 1000 to 9999. Both seem to have second precision. Thanks to Joerg Friedrich for suggesting this.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
[jira] Commented: (TORQUE-11) Torque Type Timestamp should be
mapped to datetime in Mysql
Posted by "Declan Shanaghy (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/TORQUE-11?page=comments#action_12449529 ]
Declan Shanaghy commented on TORQUE-11:
---------------------------------------
Any progress on this issue?
I am having the same problem with this magic behavious in my application that i am converting over to turbine.
> Torque Type Timestamp should be mapped to datetime in Mysql
> ------------------------------------------------------------
>
> Key: TORQUE-11
> URL: http://issues.apache.org/jira/browse/TORQUE-11
> Project: Torque
> Issue Type: Improvement
> Components: Generator, Runtime
> Environment: Mysql
> Reporter: Thomas Fischer
> Fix For: 3.1, 3.1.1, 3.2
>
>
> Currently, the torque type timestamp is mapped to timestamp in mysql. However, timestamp in mysql has a range only from 1970 to 2037, whereas datetime has a range from 1000 to 9999. Both seem to have second precision. Thanks to Joerg Friedrich for suggesting this.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
[jira] Commented: (TORQUE-11) Torque Type Timestamp should be
mapped to datetime in Mysql
Posted by "Adrian Price (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/TORQUE-11?page=comments#action_12415754 ]
Adrian Price commented on TORQUE-11:
------------------------------------
Agreed: MySQL TIMESTAMP most emphatically is *not* the correct mapping for JDBC TIMESTAMP. The correct mapping is JDBC TIMESTAMP -> MySQL DATETIME.
This is a major issue because it breaks applications which rely on normal DATETIME nullability and behaviour; for example, my own Open Business Engine (http://obe.sourceforge.net), which I am currently attempting to convert to use Torque for DDL generation.
> Torque Type Timestamp should be mapped to datetime in Mysql
> ------------------------------------------------------------
>
> Key: TORQUE-11
> URL: http://issues.apache.org/jira/browse/TORQUE-11
> Project: Torque
> Type: Improvement
> Components: Generator, Runtime
> Environment: Mysql
> Reporter: Thomas Fischer
> Fix For: 3.2, 3.1.1, 3.1
>
> Currently, the torque type timestamp is mapped to timestamp in mysql. However, timestamp in mysql has a range only from 1970 to 2037, whereas datetime has a range from 1000 to 9999. Both seem to have second precision. Thanks to Joerg Friedrich for suggesting this.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
[jira] Commented: (TORQUE-11) Torque Type Timestamp should be
mapped to datetime in Mysql
Posted by "Thomas Fischer (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/TORQUE-11?page=comments#action_12449617 ]
Thomas Fischer commented on TORQUE-11:
--------------------------------------
The problem is not a technical one, resolving this would need to add one line of code in the class org.apache.torque.engine.platform.PlatformMysqlImpl in the method initialize():
setSchemaDomainMapping(new Domain(SchemaType.TIMESTAMP, "DATETIME"));
The problem is rather a compatibility issue. The Torque team has tried hard not to make any hidden incompatible changes between 3.2 and the next release (which is probably called 3.3), and I'd consider this change to be such an incompatibility (people might rely on the magic behaviour of the timestamp).
My personal idea would be to address this issue in 4.0-dev. In the meantime, if you have problems with this, you can get the sources, make the change above, and recompile the Torque generator.
> Torque Type Timestamp should be mapped to datetime in Mysql
> ------------------------------------------------------------
>
> Key: TORQUE-11
> URL: http://issues.apache.org/jira/browse/TORQUE-11
> Project: Torque
> Issue Type: Improvement
> Components: Generator, Runtime
> Environment: Mysql
> Reporter: Thomas Fischer
> Fix For: 3.2, 3.1.1, 3.1
>
>
> Currently, the torque type timestamp is mapped to timestamp in mysql. However, timestamp in mysql has a range only from 1970 to 2037, whereas datetime has a range from 1000 to 9999. Both seem to have second precision. Thanks to Joerg Friedrich for suggesting this.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org