MySQL Forums
Forum List  »  MySQL Workbench

Bug in DEFAULT expr in column definition of Create table?
Posted by: Ken Gillett
Date: June 06, 2019 10:34AM

Running MySQL and WorkBench, both v8 on MacOS and trying to 'transfer' my model to the actual server (either Forward Engineer OR Synchronize) was causing an error due to my 'SQL syntax' which is odd considering the SQL code was actually created by WB. Anyway...

After much scratching of head I narrowed it down to the create table statement, where a column was to have a DEFAULT value set by an expression. As I said, all set up in WB. The problem is that an expression used as a DEFAULT must be surrounded by parentheses (to distinguish it from literals) and WB forgets to place those parentheses when it creates the SQL script. If I simply added them to the generated SQL script, it ran perfectly.

I cannot think there is any setting I've got wrong that would cause WB to malfunction in this way, so I can only assume this must be a bug. Or is there something I'm missing here?

Options: ReplyQuote

Written By
Bug in DEFAULT expr in column definition of Create table?
June 06, 2019 10:34AM

