Bug #81589 Migration From Sybase using FreeTDS: CREATE TABLEs are not properly converted
Submitted: 25 May 2016 9:59 Modified: 25 May 2016 11:39
Reporter: Kenny Gryp Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Workbench: Migration Severity:S3 (Non-critical)
Version:6.3.6 OS:Any
Assigned to: CPU Architecture:Any

[25 May 2016 9:59] Kenny Gryp
Description:
The CREATE TABLE statements are not converted to MySQL Syntax.

How to repeat:
- Create a Sybase table with a DATETIME column and a default value of GETDATE()
- Workbench will converted it into:

CREATE TABLE IF NOT EXISTS `schema`.`TAB_CMD_CLI_INTERNET` (
 ...
 `DT_MOD` DATETIME NULL DEFAULT   GETDATE(),
 `USR_MOD` VARCHAR(15) NULL DEFAULT   HOST_NAME());

Then you get an error (Apologies for the MariaDB error, but it will be the same error in MySQL):

ERROR 1064 (42000) at line 2023: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'GETDATE(),
 `USR_MOD` VARCHAR(15) NULL DEFAULT   HOST_NAME())' at line 36

Suggested fix:

- GETDATE() is no valid MySQL function and need to be converted to NOW() and 
- HOST_NAME() will be another problem, but getting the client hostname is not a specific function in MySQL (Yes, we might go creative, but not sure you want to do that during conversion). Maybe a warning can be sent for this type so the user can handle appropriately.
[25 May 2016 11:39] MySQL Verification Team
Hello Kenny Gryp,

Thank you for the report and feedback!

Thanks,
Umesh