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.