Details
-
Technical task
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
10.2(EOL)
-
None
-
GNU/Linux
Description
Just when I thought that INFORMATION_SCHEMA returns proper default values which could be used across different MariaDB server versions....
- Numbers are now just fine (e.g. not quoted) on both 10.0 and 10.2
- But now textual columns (varchar, text...) are quoted and only IF they contain some default value (even empty string) on 10.2+ only
10.2:
+--------------+---------------+-------------+-------------+------------------+----------------+
|
| TABLE_SCHEMA | TABLE_NAME | COLUMN_NAME | COLUMN_TYPE | ORDINAL_POSITION | COLUMN_DEFAULT |
|
+--------------+---------------+-------------+-------------+------------------+----------------+
|
| erschema | partner_sites | er_order | varchar(4) | 70 | 'DESC' |
|
| erschema | partner_sites | er_limit | tinyint(4) | 71 | 10 |
|
+--------------+---------------+-------------+-------------+------------------+----------------+
|
10.0
+--------------+---------------+-------------+-------------+------------------+----------------+
|
| TABLE_SCHEMA | TABLE_NAME | COLUMN_NAME | COLUMN_TYPE | ORDINAL_POSITION | COLUMN_DEFAULT |
|
+--------------+---------------+-------------+-------------+------------------+----------------+
|
| erschema | partner_sites | er_order | varchar(4) | 70 | DESC |
|
| erschema | partner_sites | er_limit | tinyint(4) | 71 | 10 |
|
+--------------+---------------+-------------+-------------+------------------+----------------+
|
So we have different results depending on the context (INFORMATION_SCHEMA vs. SHOW CREATE TABLE...). What a mess.
Attachments
Issue Links
- includes
-
MDEV-15394 DEFAULT current_timestamp() discrepancy
-
- Closed
-
- relates to
-
MDEV-15407 DEFAULT NULL forced when no DEFAULT set on NULL-able column
-
- Closed
-
Yes. We started looking at this because of the new support for arbitrary expressions in DEFAULT. Like
Printing defaults without quotes in the INFORMATION_SCHEMA.COLUMNS is not able to distinguish between the two different defaults. So we looked at the SQL standard, and it turned out that it says that INFORMATION_SCHEMA.COLUMNS should print strings in default values quoted! Apparently when MySQL was implementing INFORMATION_SCHEMA.COLUMNS, someone misread the standard. We fixed that bug and it removed the ambiguity in UUID() vs 'UUID()'.