Details
-
Bug
-
Resolution: Unresolved
-
Low
-
None
-
7.1.4
-
7.01
-
5
-
Severity 3 - Minor
-
1
-
Description
Summary
A Number custom field in JIRA has type Numeric(18,6) in table customfieldvalue in the database (MS SQL). That means, it supports a maximum of 18 digits only, 12 before and 6 after the decimal point e.g. 111222333444.555666
However, when trying to enter a very big value e.g. 111222333444555666777888999, the field says it supports the maximum value of 100000000000000, which is 15 digits before the decimal point.
This is incorrect, as it exceeds the number of digits before the decimal point and there will be not enough space for the decimal digits. And the fact is, the field doesn't accept a number which has more than 12 digits before the decimal point.
Steps to reproduce
- create a Number custom field
- create an issue and enter the following value for the field: 111222333444555666777888999
- the field will say the maximum value allowed is 100000000000000
- now enter a different value with more than 12 and less than 15 digits before the decimal point e.g. 1000000000000 (13 digits)
- click Create
Expected behavior
- JIRA should accept the value as it's less than the maximum value allowed
- The issue should be created with the Number value and indexed normally
Actual behavior
- JIRA throws an error:
- The following error is seen in JIRA_Home/log/atlassian-jira.log:
2016-04-29 03:01:20,269 http-nio-8714-exec-17 ERROR admin 181x2025x1 54hyjn 0:0:0:0:0:0:0:1 /secure/QuickCreateIssue.jspa [c.a.j.bc.issue.DefaultIssueService] Error creating issue: com.atlassian.jira.exception.CreateException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:CustomFieldValue][parentkey,null][customfield,10101][issue,10039][id,10042][numbervalue,1.0E12] (SQL Exception while executing the following:INSERT INTO dbo.customfieldvalue (ID, ISSUE, CUSTOMFIELD, PARENTKEY, STRINGVALUE, NUMBERVALUE, TEXTVALUE, DATEVALUE, VALUETYPE) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) (Data truncation)) at com.atlassian.jira.issue.managers.DefaultIssueManager.createIssue(DefaultIssueManager.java:588) at com.atlassian.jira.issue.managers.DefaultIssueManager.createIssue(DefaultIssueManager.java:494) at com.atlassian.jira.bc.issue.DefaultIssueService.create(DefaultIssueService.java:230) at com.atlassian.jira.bc.issue.DefaultIssueService.create(DefaultIssueService.java:199) at sun.reflect.GeneratedMethodAccessor1330.invoke(Unknown Source) ... 1 filtered ... Caused by: java.sql.DataTruncation: Data truncation at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:386) at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2421) at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:671) at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:613) at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:572) at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeUpdate(JtdsPreparedStatement.java:727) at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:98) at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:98) at org.ofbiz.core.entity.jdbc.SQLProcessor.executeUpdate(SQLProcessor.java:673) ... 259 more
- The issue is still created in JIRA without the Number value - this can be seen from the database:
in my test, 39 issues are created but only 15 Number values are accepted - However, the created issue is not indexed, so it's invisible from Issue Navigator and users might think it's not created at all:
only the issues whose Number value is accepted are indexed
Notes
- Re-indexing JIRA will make all the issues visible in Issue Navigator
- Only values up to 999999999999.999938 (12 digits before the decimal point) will be accepted and rounded up to 100000000000000 (13 digits), like the issue TEST-37 in index.png. It's however stored as 999999999999.999880 (12 digits before the decimal point) in the database like in database.png.
- More than 6 decimal digits can be accepted (which is expected as they can be rounded)
Suggestion
- The warning message about the maximum value allowed must be correct
- Values should be displayed exactly the same as they're stored in the database
Attachments
Issue Links
- relates to
-
JRASERVER-60798 Excel export converts text to number and fails to display the correct value
- Closed
- mentioned in
-
Page Loading...