[MDEV-7406] get from INFORMATION_SCHEMA original SQL code creating VIEW Created: 2015-01-03 Updated: 2023-12-22 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Views |
| Fix Version/s: | 11.5 |
| Type: | New Feature | Priority: | Critical |
| Reporter: | Mikhail Gavrilov | Assignee: | Sergei Golubchik |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | information_schema, upstream, verified, view | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Description |
|
I am use INFORMATION_SCHEMA for speedup getting database definition And I found yet another problem:
As you can see when I get SQL definition with "SHOW CREATE VIEW" I get body without database `test` as expected. When I get definition from INFORMATION SCHEMA I have definition with database `test`. If I will use this SQL code for create view in different database I would have problems. |
| Comments |
| Comment by Elena Stepanova [ 2015-01-04 ] | |
|
It's an upstream issue present in all active versions (5.1-5.7). Did you try to report it at bugs.mysql.com? It's our usual routine. Note: There are other problems which I suppose might not allow using I_S.VIEWS to re-create a view, e.g. there seems to be no ALGORITHM clause in there, does it not concern you? There used to be a bug about it http://bugs.mysql.com/bug.php?id=16832 which is said to be fixed in an ancient 5.0 version, but I still can't see ALGORITHM in current servers, so it might be broken again. | |
| Comment by Mikhail Gavrilov [ 2015-01-05 ] | |
|
I fill new bug at mysql bugtreaker | |
| Comment by Mikhail Gavrilov [ 2015-01-05 ] | |
|
> There used to be a bug about it http://bugs.mysql.com/bug.php?id=16832 which is said to be fixed in an ancient 5.0 version, but I still can't see ALGORITHM in current servers, so it might be broken again. And yes, it is still not fixed | |
| Comment by Sergei Golubchik [ 2015-01-06 ] | |
|
As far as ALGORITHM is concerned, it's | |
| Comment by Sergei Golubchik [ 2023-11-03 ] | |
|
we could implement view comments. preliminary syntax example:
By default, if no comment was specified, it'll be set to the create view query text. When reading from .frm it'll be read from the new comment field, if it exists, otherwise from the source field. It will be seen in SHOW CREATE VIEW and in the new INFORMATION_SCHEMA.VIEWS.COMMENT column. Open questions:
| |
| Comment by Michael Widenius [ 2023-11-04 ] | |
|
Charset utf8 is ok. | |
| Comment by Sergei Golubchik [ 2023-11-29 ] | |
|
on the other hand, COMMENT is clearly an inconsistent hack and the only answer to "why you did it" is "we couldn't come up with anything better". It'd be good to have a proper solution |