Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 322972 - [DB] Various MySQL test failures
Summary: [DB] Various MySQL test failures
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.db (show other bugs)
Version: 4.10   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Eike Stepper CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-18 00:04 EDT by Caspar D. CLA
Modified: 2020-12-11 10:35 EST (History)
2 users (show)

See Also:


Attachments
Test failures (50.77 KB, text/plain)
2010-08-18 00:04 EDT, Caspar D. CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Caspar D. CLA 2010-08-18 00:04:08 EDT
I get 13 errors/failures when I run AllTestsDBMysql on my setup,
which is as follows: (Note that I had to patch for bug 322969 to make this 
test suite run in the first place.)

  MySQL 5.1.47
  Linux 2.6.34
  com.mysql.jdbc_5.1.7.201006111745.jar

I'll attach the full test results in a minute, but here's an
executive summary:

Data truncation: Data too long for column 'testField1' at row 1 (2 times)
Data truncation: Data too long for column 'testField1' at row 1
Data truncation: Out of range value for column 'testField0' at row 1
Error with type DOUBLE expected:<1.7976931348623157E308> but was:<Infinity>
Error with type DATE expected:<-62167503600000> but was:<-62072809200000>
Committing too long data did not result in an exception
Illegal operation on empty result set. (5 times)
Table 'test_repo1.PRODUCT1' doesn't exist (4 times)
Table 'test_repo1.CUSTOMER' doesn't exist
Comment 1 Caspar D. CLA 2010-08-18 00:04:55 EDT
Created attachment 176861 [details]
Test failures
Comment 2 Caspar D. CLA 2010-08-18 01:31:08 EDT
Subproblem A: Data truncations

A.1 Net4jDBTest.testBinary
  
  This method creates a BINARY(1) column in the MySQL database,
  which means a single byte, then attempts to write a 
  blob of 100 bytes into it. Doesn't make sense.. I wonder why
  it works on other databases.

A.2 Net4jDBTest.testBlob

  Here, test logic looks sane. It sets up a 1,000,000 byte array
  to be written into a BLOB field. I have no idea what the
  problem is.

A.3 Net4jDBTest.testFloat

  This method attempts to write java.lang.Float.MAX_VALUE into
  a FLOAT field in the database. The value is 3.4028235E+38, and,
  on my platform in any case, that doesn't fit. I think it's
  the precision (rather than the magnitude) that is the problem.
Comment 3 Caspar D. CLA 2010-08-18 01:42:25 EDT
Subproblem B: MySQLSyntaxErrorExceptions (missing tables PRODUCT1 and CUSTOMER)
 
  An issue of case sensitivity. The query is hardcoded all-caps in the test, 
  but MySQL on Linux treats table names as case sensitive.
Comment 4 Caspar D. CLA 2010-08-18 02:13:38 EDT
Subproblem C: Illegal operation on empty result set

  First-level problem is same as B. DBAnnotationsTest uses hard-coded
  all-caps table names 'CATEGORY', 'SUBJECT' and 'PRODUCT1'. This fails
  to identify a table with MySQL on Linux. (Although I am wondering why
  these tests worked in 3.0... I haven't changed my MySQL config.)

  Having "fixed" this temporarily by hard-coding case sensitive table
  names instead, the tests run but fail because several of the annotations
  are (apparently) not honored by the database.
Comment 5 Caspar D. CLA 2010-08-18 02:29:13 EDT
(In reply to comment #4)
>   (Although I am wondering why these tests worked in 3.0... 

I meant: in 2.0, cause in 3.0 they're broken just fine.

But I guess we didn't have these tests in 2.0, did we?
Comment 6 Caspar D. CLA 2010-08-18 04:23:04 EDT
Subproblem C, continued:

  The 'columnLength' annotation isn't honored because the MYSQLAdapter
  overrides getTypeName(IDBField) to substitute LONGTEXT for VARCHAR,
  and LONGTEXT is not a type that can be parameterized with a precision.
Comment 7 Caspar D. CLA 2010-08-18 04:36:32 EDT
Adding Kai Schlamp to the CC list, as I realized that much
of the code that is involved in these test errors/failures,
was developed by him.
Comment 8 Caspar D. CLA 2010-08-18 04:49:15 EDT
Subproblem C, continued:

  The 'type' annotation isn't honored because it's tested with value "CLOB"
  for the annotation; this too (like VARCHAR above) is replaced with LONGTEXT,
  by MYSQLAdapter's override of getTypeName. And so the test logic's
  assertion detects a diffence between the type requested through the
  annotation, and the actual type used.
Comment 9 Caspar D. CLA 2010-08-18 05:07:29 EDT
Subproblem C, recapped:

C.1 'columnLength' annotation not honored: due to type override in 
    MYSQLAdapter: VARCHAR(n) -> LONGTEXT, see above.

C.2 'columnType' annotation not honored: due to type override in
    MYSQLAdapter: CLOB -> LONGTEXT, see above.

C.3 'tableName' annotation not honored: case sensitivity problem
    in test assertion (table name hard-coded all-caps)
Comment 10 Caspar D. CLA 2010-08-18 05:29:44 EDT
A.1, A.2, A.3, see above.

A.4 Net4jDBTest.testDouble

  "Error with type DOUBLE". Writing Double.MAX_VALUE to MySQL through
  the JDBC driver is accepted; but when the same value is read back
  through JDBC, it is "Infinity" rather than the value originally passed.

A.5 Net4jDBTest.testDate

  The dates created in the Java code are 21-4-2010, 21-4-1950, 31-12-2030,
  and 00-00-0000 (whatever that means). But right before execution, the 
  INSERT statement is seen to contain values (2010-05-21, 1950-05-21, 
  2031-01-31, 0002-12-31). So something is amiss even before the database
  is accessed. The way the dates are constructed looks suspicious to me,
  using milliseconds taken from GregorianCalendar instances. Shouldn't
  we be using java.sql.Date instances?
Comment 11 Stefan Winkler CLA 2010-08-18 09:18:31 EDT
see my comment on Bug 322778
Comment 12 Eike Stepper CLA 2012-06-05 07:30:59 EDT
Moving all open bug reports to 4.1 because the release is very near and it's hghly unlikely that there will be spare time to address 4.0 problems.

Please make sure that your patches can be applied against the master branch and that your problem is not already fixed there!!!
Comment 13 Eike Stepper CLA 2012-08-14 22:58:09 EDT
Moving all open issues to 4.2. Open bugs can be ported to 4.1 maintenance after they've been fixed in master.
Comment 14 Eike Stepper CLA 2013-06-29 12:19:46 EDT
We'll try to address open problems in 4.3 (master) first and then port fixes back to 4.2.
Comment 15 Eike Stepper CLA 2015-07-14 02:22:23 EDT
Moving all open bugzillas to 4.5.
Comment 16 Eike Stepper CLA 2016-07-31 01:05:21 EDT
Moving all unaddressed bugzillas to 4.6.
Comment 17 Eike Stepper CLA 2017-12-28 01:10:33 EST
Moving all open bugs to 4.7
Comment 18 Eike Stepper CLA 2019-11-08 02:16:17 EST
Moving all unresolved issues to version 4.8-
Comment 19 Eike Stepper CLA 2019-12-13 12:42:49 EST
Moving all unresolved issues to version 4.9
Comment 20 Eike Stepper CLA 2020-04-03 04:06:36 EDT
I assume that this is fixed now with the changes of bug 546872.
Comment 21 Eike Stepper CLA 2020-12-11 10:31:57 EST
Closing.
Comment 22 Eike Stepper CLA 2020-12-11 10:35:26 EST
Closing.