Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Won't Fix
-
Affects Version/s: 1.0
-
Fix Version/s: 1.0.2
-
Component/s: None
-
Labels:None
-
Environment:Windows Server 2003 - JDK 1.5.0_13 with MySQL Connector 5.1.5
Description
In my test system I create a record and I include a URL to another site.
In this case I use:
new Book(title: "Grails",
url: new URL("http://www.amazon.co.uk/s/ref=nb_ss_w_h_?url=search-alias%3Dstripbooks&Go.x=5&Go.y=15&field-keywords=Grails"),
).save()
When I run it I get the following error:
2008-02-21 16:47:18.920::WARN: Failed startup of context org.mortbay.jetty.webapp.WebAppContext@7c4246{/URLTest,C:\steve\URLTest/web-app}
org.codehaus.groovy.runtime.InvokerInvocationException: org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not insert: [User]; uncategorized SQLException for SQL [insert into user (version, email, first_name, last_name, password, url) values (?, ?, ?, ?, ?, ?)]; SQL state [01004]; error code [0]; Data truncation: Data too long for column 'url' at row 1; nested exception
is com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'url' at row 1
If I reduce the size of the URL to be below 100 characters it works fine. In the MySQL database the field is of type "tinyblob".
You can change the hibernate type with:
or