Quantcast
Channel: MySQL Forums - MySQL Workbench
Viewing all articles
Browse latest Browse all 3724

Bug in DEFAULT expr in column definition of Create table? (3 replies)

$
0
0
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?

Viewing all articles
Browse latest Browse all 3724

Trending Articles