Bug #27174 | Procssor dependent Sign Expansion Problem with BigDecimal / DECIMAL(24) | ||
---|---|---|---|
Submitted: | 15 Mar 2007 14:19 | Modified: | 3 Jan 2011 9:13 |
Reporter: | Klaus Halfmann | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / J | Severity: | S3 (Non-critical) |
Version: | 5.0.5-bin.jar | OS: | Windows (Windows-XP) |
Assigned to: | CPU Architecture: | Any | |
Tags: | BIGDECIMAL, Intel, sign |
[15 Mar 2007 14:19]
Klaus Halfmann
[15 Mar 2007 14:47]
Klaus Halfmann
OK, does not happen on Linux / Intel java.vm.version : 1.5.0_11-b03 java.vm.vendor : Sun Microsystems Inc. java.runtime.version : 1.5.0_11-b03 os.name : Linux os.version : null sun.management.compiler : HotSpot 64-Bit Server Compiler processor : 7 vendor_id : GenuineIntel cpu family : 6 model : 15 model name : Intel(R) Xeon(R) CPU E5310 @ 1.60GHz stepping : 7 cpu MHz : 1596.044 cache size : 4096 KB physical id : 1 siblings : 4 core id : 3 cpu cores : 4 fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx tm2 cx16 xtpr lahf_lm bogomips : 3192.20 clflush size : 64 cache_alignment : 64 address sizes : 36 bits physical, 48 bits virtual power management:
[29 Mar 2007 6:35]
Tonci Grgin
Hi Klaus and thanks for the nice report. What I am wondering about is this: - Where is MySQL server in your failed test and what is it's version? Please be specific. - Is JDK/JRE the same on laptop/desktop. What is the exact version (info provided only for Linux)? You must agree that, in light of your description, this info is crucial...
[29 Mar 2007 19:01]
Klaus Halfmann
We Cross Checked The Desktop/Laptop against the Databases and found that it does _not_ depend on the server (5.0.x latest GPL) We use JDK 5.0_R11 (I may not be accurate here as I'm actually on vacation and not in the office) I would guess this is a problem in the JDK. I'd suggest a) you reproduce this on the same processor. b) point me to the exact location in the driver where the binary differnce would be. I can debug than and return the results. c) Provide some sample-code, how the driver converts the BigDecimal to BCD (which I guess it does somewhere) I must confess this is one of the most obscure things, I've been stubling over for years ;-)
[30 Mar 2007 0:32]
Mark Matthews
There's no magic, server-side prepared statements use a String to represent the DECIMAL data type, so we use the BigDecimal(String) constructor to go from our internal representation to BigDecimal, and BigDecimal.toString() to go from a BigDecimal instance to our internal representation (which is a string). I do see perhaps one item I do want to check out that we're not using StringUtils.consistentToString(BigDecimal) with ServerPreparedStatements, which exists because Sun changed the output of BigDecimal.toString() between JDK-1.4 and JDK-5, but I don't think that is causing this issue, given that you're using JDK-5 and it works on one platform, and not the other.
[30 Mar 2007 12:02]
Tonci Grgin
Klaus, I was unable to repeat. Please review my results and test case. Both tests done on MySQL server 5.0.38BK on WinXP Pro SP2 localhost (marked as DESKTOP in results). DESKTOP: Genuine Intel, family 15 model 2 Connected to 5.0.38-log java.vm.version : 1.5.0_11-b03 java.vm.vendor : Sun Microsystems Inc. java.runtime.version : 1.5.0_11-b03 os.name : Windows XP os.version : null sun.management.compiler : HotSpot Client Compiler Time: 0,75 OK (1 test) LAPTOP: Genuine Intel, family 6 model 13 .Loading JDBC driver 'com.mysql.jdbc.Driver' Done. Done. Connected to 5.0.38-log java.vm.version : 1.5.0_07-b03 java.vm.vendor : Sun Microsystems Inc. java.runtime.version : 1.5.0_07-b03 os.name : Windows XP os.version : null sun.management.compiler : HotSpot Client Compiler Time: 0,719 OK (1 test)
[30 Mar 2007 12:03]
Tonci Grgin
Test case on latest c/J 5.0 sources
Attachment: TestBug27174.java (text/x-java), 3.58 KiB.
[2 Apr 2007 9:19]
Klaus Halfmann
Yes, your testcase did not trigger the bug. But using the MysqlConnectionPoolDataSource broke it. 8-? You should better try props.put("useServerPrepStmts" , "true"); in your second test ;-) But this did not trigger the bug. #-[ We are about to investigate further ...
[2 Apr 2007 9:59]
Tonci Grgin
My mistake, sorry. Putting "props.put("useServerPrepStmts" , "true");" into test case at appropriate place changed nothig. Outcome is still correct. If you discover any important info, please feel free to reopen the report.
[2 Apr 2007 10:03]
Klaus Halfmann
Please try using the MysqlConnectionPoolDataSource, as in my original Testcase. (Not Connection with Properties) this triggered the bug. Perhaps the pooling of the pooling of the Connection/PreparedStatement is the Problem ...
[22 Jun 2007 7:39]
Tonci Grgin
As new info is provided I'll retest.
[3 Jan 2011 9:13]
Klaus Halfmann
As I cannot remember what Laptop this originally was I consider you leave the Test as Regression-Test and wait if it will ever fail again. Perhaps it was silently fixed by Sun/Oracle or Intel meanwhile. So I will close this bug.