Bug #71036 Error on changing varchar(5000) to text
Submitted: 29 Nov 2013 0:54 Modified: 13 Mar 2014 19:13
Reporter: Alfredo Suárez Romero Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Migration Severity:S2 (Serious)
Version:6.0 OS:Any
Assigned to: CPU Architecture:Any

[29 Nov 2013 0:54] Alfredo Suárez Romero
Description:
When I tried to migrate a varchar field from mssql to mysql, in the column mapping section I changed the target type to text, the database is created ok, but when I tried to migrate all the data I get an error saying that varchar exceds the maximum size(4000), because in the query its like this:

[ODBC SQL Server Driver][SQL Server]El tama�o (5000) concedido a especificaci�n de conversi�n 'nvarchar' supera el tama�o m�ximo permitido (4000).

This line is causing the error:

 CAST([Descripcion] as NVARCHAR(5000)) as [Descripcion]

Because i think this should be casted to TEXT.

How to repeat:
Try to migrate one fiel varchar(5000) to one on mysql type text.
Migrate some data.

Suggested fix:
This line is causing the error:

 CAST([Descripcion] as NVARCHAR(5000)) as [Descripcion]

Because i think this should be casted to TEXT.
[31 Jan 2014 17:40] Milosz Bodzek
confirm, i can repeat
[13 Feb 2014 12:49] Milosz Bodzek
Posted by developer:
 
Fixed
[13 Feb 2014 12:55] Milosz Bodzek
Patch whitch fixes this bug

Attachment: cast_to_nvarchar_max.diif (application/octet-stream, text), 1.27 KiB.

[13 Feb 2014 15:33] Alfredo Suárez Romero
Thanks for your help i will try it
[11 Mar 2014 21:18] Rafael Antonio Bedoy Torres
Posted by developer:
 
Fixed on 6.1.3.11725
[13 Mar 2014 19:13] Philip Olson
Fixed as of the upcoming MySQL Workbench 6.1.3 release, and here's the changelog entry:

When migrating from Microsoft SQL Server, mapping a VARCHAR field to TEXT
would still attempt to migrate it to VARCHAR, which could yield an error
if the VARCHAR exceeded the maximum size. It now properly maps to TEXT.

Thank you for the bug report.