[ 
https://issues.apache.org/jira/browse/OFBIZ-9496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16092800#comment-16092800
 ] 

Jacopo Cappellato commented on OFBIZ-9496:
------------------------------------------

The warning message generated by OFBiz is a false positive caused by the fact 
that the way OFBiz performs the check is too simplistic: OFBiz parses for the 
content of the "()" in the fieldtype mapping and assumes that it is the column 
size.
However, in MySQL and possibly other database management systems, this is only 
true for varchar field definitions but not for datetime fields.
The column size for DATETIME(3) is not 3.
We should probably refactor the code in DatabaseUtil to compare the SQL field 
type from the JDBC driver, if possible to retrieve, (i.e. from the database) 
with the whole content (without any sting manipulation) of the attribute 
sql-type of the element field-type-def type (in fieldtype*.xml) i.e. 
"DATETIME(3)"; if they differ then a warning should be printed.
In this way we will have a more generic, simpler and more reliable tool to spot 
differences in the database


> MySql Database related warning related to DATETIME filed
> --------------------------------------------------------
>
>                 Key: OFBIZ-9496
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-9496
>             Project: OFBiz
>          Issue Type: Improvement
>            Reporter: Deepak Dixit
>            Priority: Minor
>
> Here are the following warnings that we are getting for all the datetime 
> related filed.
> this is due to incorrect handling of database filed type comparison in 
> DatabaseUtil.java
> {code}
> 2017-07-18 12:30:19,137 |OFBiz-batch-2        |DatabaseUtil                  
> |W| Column [LAST_UPDATED_TX_STAMP] of table [RUNTIME_DATA] of entity 
> [RuntimeData] has a column size of [19] in the database, but is defined to 
> have a column size of [3] in the entity definition.
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to