You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ddlutils-dev@db.apache.org by "Vincent Siveton (JIRA)" <ji...@apache.org> on 2006/06/07 23:51:30 UTC

[jira] Created: (DDLUTILS-111) Handle Silent Column Specification Changes in the test cases

Handle Silent Column Specification Changes in the test cases
------------------------------------------------------------

         Key: DDLUTILS-111
         URL: http://issues.apache.org/jira/browse/DDLUTILS-111
     Project: DdlUtils
        Type: Bug

  Components: Tests  
 Environment: trunk + mysql 4.1
    Reporter: Vincent Siveton
 Assigned to: Thomas Dudziak 


In some cases, MySQL silently changes column specifications from those given in a CREATE TABLE or ALTER TABLE statement [1]

So TestAlteration.testAddColumns() failed with:
junit.framework.ComparisonFailure: Type not the same for column avalue4. expected:<...> but was:<VAR...>
	at junit.framework.Assert.assertEquals(Assert.java:81)
	at org.apache.ddlutils.io.RoundtripTestBase.assertEquals(RoundtripTestBase.java:441)
	at org.apache.ddlutils.io.RoundtripTestBase.assertEquals(RoundtripTestBase.java:369)
	at org.apache.ddlutils.io.RoundtripTestBase.assertEquals(RoundtripTestBase.java:315)
	at org.apache.ddlutils.io.TestAlteration.testAddColumns(TestAlteration.java:526)

[1] http://dev.mysql.com/doc/refman/5.0/en/silent-column-changes.html

-- 
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


[jira] Updated: (DDLUTILS-111) Handle Silent Column Specification Changes in the test cases

Posted by "Vincent Siveton (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DDLUTILS-111?page=all ]

Vincent Siveton updated DDLUTILS-111:
-------------------------------------

    Attachment: DDLUTILS-111.diff

A naive approach could be to catch the AssertionFailedError for mysql (see the patch). 
But, the best way is to change the API to include silent change...

It is a big patch due to a lot of trailing whitespaces. Maybe consider using anyedit Eclipse plugin (http://andrei.gmxhome.de/anyedit/index.html)

> Handle Silent Column Specification Changes in the test cases
> ------------------------------------------------------------
>
>          Key: DDLUTILS-111
>          URL: http://issues.apache.org/jira/browse/DDLUTILS-111
>      Project: DdlUtils
>         Type: Bug

>   Components: Tests
>  Environment: trunk + mysql 4.1
>     Reporter: Vincent Siveton
>     Assignee: Thomas Dudziak
>  Attachments: DDLUTILS-111.diff
>
> In some cases, MySQL silently changes column specifications from those given in a CREATE TABLE or ALTER TABLE statement [1]
> So TestAlteration.testAddColumns() failed with:
> junit.framework.ComparisonFailure: Type not the same for column avalue4. expected:<...> but was:<VAR...>
> 	at junit.framework.Assert.assertEquals(Assert.java:81)
> 	at org.apache.ddlutils.io.RoundtripTestBase.assertEquals(RoundtripTestBase.java:441)
> 	at org.apache.ddlutils.io.RoundtripTestBase.assertEquals(RoundtripTestBase.java:369)
> 	at org.apache.ddlutils.io.RoundtripTestBase.assertEquals(RoundtripTestBase.java:315)
> 	at org.apache.ddlutils.io.TestAlteration.testAddColumns(TestAlteration.java:526)
> [1] http://dev.mysql.com/doc/refman/5.0/en/silent-column-changes.html

-- 
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


[jira] Resolved: (DDLUTILS-111) Handle Silent Column Specification Changes in the test cases

Posted by "Thomas Dudziak (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DDLUTILS-111?page=all ]
     
Thomas Dudziak resolved DDLUTILS-111:
-------------------------------------

    Resolution: Fixed

I've simply changed the effected tests to use VARCHAR instead of CHAR (the type of that column was not important anyway).
In general, I won't go to great length just to work around such deficiencies in a database. Honestly, why on earth would I want the database to silently change the datatypes ? If a database does that, it just seems like a stupid thing to do IMHO. If I specify VARCHAR(4) then I *want* VARCHAR(4) and not CHAR(4), not to mention that even if I insert a single character now - because the semantics are changed - I always get four characters back.
So in short, I won't add a lot of code just to work around such a defect in a database. Rather, I change the tests as they are not intended to test the databases but rather DdlUtils' interaction with them.

> Handle Silent Column Specification Changes in the test cases
> ------------------------------------------------------------
>
>          Key: DDLUTILS-111
>          URL: http://issues.apache.org/jira/browse/DDLUTILS-111
>      Project: DdlUtils
>         Type: Bug

>   Components: Tests
>  Environment: trunk + mysql 4.1
>     Reporter: Vincent Siveton
>     Assignee: Thomas Dudziak
>  Attachments: DDLUTILS-111.diff
>
> In some cases, MySQL silently changes column specifications from those given in a CREATE TABLE or ALTER TABLE statement [1]
> So TestAlteration.testAddColumns() failed with:
> junit.framework.ComparisonFailure: Type not the same for column avalue4. expected:<...> but was:<VAR...>
> 	at junit.framework.Assert.assertEquals(Assert.java:81)
> 	at org.apache.ddlutils.io.RoundtripTestBase.assertEquals(RoundtripTestBase.java:441)
> 	at org.apache.ddlutils.io.RoundtripTestBase.assertEquals(RoundtripTestBase.java:369)
> 	at org.apache.ddlutils.io.RoundtripTestBase.assertEquals(RoundtripTestBase.java:315)
> 	at org.apache.ddlutils.io.TestAlteration.testAddColumns(TestAlteration.java:526)
> [1] http://dev.mysql.com/doc/refman/5.0/en/silent-column-changes.html

-- 
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