[MDEV-13805] SHOW CREATE VIEW don't provide formating in .frm file Created: 2017-09-14 Updated: 2023-11-01 Resolved: 2023-11-01 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Views |
| Fix Version/s: | N/A |
| Type: | Task | Priority: | Major |
| Reporter: | Richard Stracke | Assignee: | Vicențiu Ciorbaru |
| Resolution: | Duplicate | Votes: | 1 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||
| Description |
|
SHOW CREATE VIEW don't reflect the formating information from the original create statement, For really huge view create bodys it is heavily readable. to reproduce.
SHOW CREATE VIEW `view_t1`; give the following output
But the formating information with \n are available in the .frm file Output of more view_t1.frm
|
| Comments |
| Comment by Sergei Golubchik [ 2017-11-13 ] |
|
The original view source is not always safe to reapply. That's why SHOW CREATE VIEW shows normalized view definition. We can add another column to INFORMATION_SCHEMA.VIEWS with the original view source, it should be used purely for information purposes, not for reapplying. Optionally we can make SHOW CREATE VIEW to return the original view depending on some system setting, but the risk of unintentionally using the wrong view definition will be higher. |
| Comment by Richard Stracke [ 2017-12-28 ] |
|
An additional column would be the best way to solve this, even for user with huge create statements. |
| Comment by Ralf Gebhardt [ 2018-01-11 ] |
|
serg what about an extended show create statement, like show full create as done for the processlist? For create statements it would show both, the modified and original statement. Could also be used for show create table, view, .... |
| Comment by Sergei Golubchik [ 2018-01-11 ] |
|
it wouldn't work for tables, because we don't store the original `create table` statement. |