Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Won't Fix
-
10.2.23, 10.1.40, 10.3.14, 10.4.6, 10.4.8
-
None
-
MacOS, Windows
Description
When printing the CREATE TABLE to reconstruct a table, the SHOW CREATE TABLE command does not wrap default expressions with parenthesis.
I'd enter this as 'trivial', except that it breaks the DDL parsers for a surprisingly large number of GUI-style management tools, including SQL Workbench, SEQUEL Pro, and a surprising number of others. Wrapping the expression with parens on output should be non-breaking, as parens are always permitted in this context. A widespread practical impact is that tables defined with a text-to-binary16 UUID initializer
Example from MariaDB 10.4.6: note the output for the guid column in:
| station | CREATE TABLE `station` (
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
`name` varchar(45) NOT NULL,
|
`where` varchar(45) NOT NULL,
|
`description` varchar(255) DEFAULT NULL,
|
`guid` binary(16) NOT NULL DEFAULT unhex(replace(uuid(),'-','')),
|
PRIMARY KEY (`id`,`where`),
|
UNIQUE KEY `name_UNIQUE` (`name`),
|
UNIQUE KEY `ID_UNIQUE` (`id`),
|
UNIQUE KEY `guid_UNIQUE` (`guid`)
|
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 |
|