[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-3440) 3.3.0 GA with MySQL 5.0 throws table validation exception

Strong Liu (JIRA) noreply at atlassian.com
Wed Oct 19 14:27:21 EDT 2011


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3440?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Strong Liu updated HHH-3440:
----------------------------

    Description: 
Hibernate immediately throws an exception at application startup, when it does the schema validation.

org.hibernate.HibernateException: Wrong column type in dpjw.assessment for column NOTES. Found: text, expected: longtext


Comparing the sources of 3.2.0 with 3.3.0 I can see that someone set two java statements into comment. The 3.2 version of MySQLDialect.java looks like this:
{code}
   protected void registerVarcharTypes() {
      registerColumnType( Types.VARCHAR, "longtext" );
      registerColumnType( Types.VARCHAR, 16777215, "mediumtext" );
      registerColumnType( Types.VARCHAR, 65535, "text" );
      registerColumnType( Types.VARCHAR, 255, "varchar($l)" );
   }

{code}
while the new 3.3.0 version is this:
{code}
   protected void registerVarcharTypes() {
      registerColumnType( Types.VARCHAR, "longtext" );
//      registerColumnType( Types.VARCHAR, 16777215, "mediumtext" );
//      registerColumnType( Types.VARCHAR, 65535, "text" );
      registerColumnType( Types.VARCHAR, 255, "varchar($l)" );
   } 
{code}
If I uncomment these (and others in the same Java file!), the validation process is ok.

Is there any reason why these statements (and others!) were commented out???

  was:
Hibernate immediately throws an exception at application startup, when it does the schema validation.

org.hibernate.HibernateException: Wrong column type in dpjw.assessment for column NOTES. Found: text, expected: longtext


Comparing the sources of 3.2.0 with 3.3.0 I can see that someone set two java statements into comment. The 3.2 version of MySQLDialect.java looks like this:

   protected void registerVarcharTypes() {
      registerColumnType( Types.VARCHAR, "longtext" );
      registerColumnType( Types.VARCHAR, 16777215, "mediumtext" );
      registerColumnType( Types.VARCHAR, 65535, "text" );
      registerColumnType( Types.VARCHAR, 255, "varchar($l)" );
   }


while the new 3.3.0 version is this:

   protected void registerVarcharTypes() {
      registerColumnType( Types.VARCHAR, "longtext" );
//      registerColumnType( Types.VARCHAR, 16777215, "mediumtext" );
//      registerColumnType( Types.VARCHAR, 65535, "text" );
      registerColumnType( Types.VARCHAR, 255, "varchar($l)" );
   } 

If I uncomment these (and others in the same Java file!), the validation process is ok.

Is there any reason why these statements (and others!) were commented out???


> 3.3.0 GA with MySQL 5.0 throws table validation exception
> ---------------------------------------------------------
>
>                 Key: HHH-3440
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3440
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.3.0.GA
>         Environment: Hibernate 3.3.0 GA
> MySQL 5.0
> JBoss 4.2.2
>            Reporter: Carlo Luib-Finetti
>
> Hibernate immediately throws an exception at application startup, when it does the schema validation.
> org.hibernate.HibernateException: Wrong column type in dpjw.assessment for column NOTES. Found: text, expected: longtext
> Comparing the sources of 3.2.0 with 3.3.0 I can see that someone set two java statements into comment. The 3.2 version of MySQLDialect.java looks like this:
> {code}
>    protected void registerVarcharTypes() {
>       registerColumnType( Types.VARCHAR, "longtext" );
>       registerColumnType( Types.VARCHAR, 16777215, "mediumtext" );
>       registerColumnType( Types.VARCHAR, 65535, "text" );
>       registerColumnType( Types.VARCHAR, 255, "varchar($l)" );
>    }
> {code}
> while the new 3.3.0 version is this:
> {code}
>    protected void registerVarcharTypes() {
>       registerColumnType( Types.VARCHAR, "longtext" );
> //      registerColumnType( Types.VARCHAR, 16777215, "mediumtext" );
> //      registerColumnType( Types.VARCHAR, 65535, "text" );
>       registerColumnType( Types.VARCHAR, 255, "varchar($l)" );
>    } 
> {code}
> If I uncomment these (and others in the same Java file!), the validation process is ok.
> Is there any reason why these statements (and others!) were commented out???

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list