[MDEV-10825] Feature Request: Persist exact view definitions DDL Created: 2016-09-17 Updated: 2021-04-17 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Views |
| Fix Version/s: | None |
| Type: | Task | Priority: | Minor |
| Reporter: | Natan Vivo | Assignee: | Vicențiu Ciorbaru |
| Resolution: | Unresolved | Votes: | 2 |
| Labels: | None | ||
| Description |
|
I'd like to see mariadb persisting the exact view definition DDL. When defining a view, we usually format and set correct indentation for the query. But apparently, MariaDB doesn't store the text definition of the query, and after defined show create view shows a formatted version of the query. This makes very annoying to define complex views in MariaDB. For example, this definition:
After creation can only be retrieved as:
This not only has lost the comments and formatting, but added a lot of aliases and parentheses that even with some code fomatter makes it hard to understand and edit. Having worked with SQL Server (which stores the exact DDL of the view) for a long time and mariadb for the last few years, I miss this simple feature. Complex views a dozens or hundreds of lines may have comments per line, and formatting that helps understand the purpose and functionality of the view. Editing views in mysql/mariadb is painful. Storing the exact view definition shouldn't affect anything, and show create view could retrieve this text instead. A keyword could be added to allow retrieving the computed version of the view. |
| Comments |
| Comment by Sergei Golubchik [ 2017-05-27 ] |
|
Exact view definition is actually stored in the view's frm file, but there is no command to show it at the moment. It's a reasonable request to implement some way to show the original view definition. |