[MDEV-32091] SHOW CREATE VIEW does not show original view definition Created: 2023-09-04  Updated: 2023-11-23  Resolved: 2023-11-01

Status: Closed
Project: MariaDB Server
Component/s: Views
Affects Version/s: None
Fix Version/s: N/A

Type: Bug Priority: Critical
Reporter: Michael Widenius Assignee: Alexander Barkov
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates MDEV-7406 get from INFORMATION_SCHEMA original ... Open
duplicates MDEV-13805 SHOW CREATE VIEW don't provide format... Closed
Relates
relates to MDEV-32053 New features requested by customer on... Open

 Description   

drop table if exist t1;
drop view if exists v1;
create table t1 (a int);
set sql_mode=oracle;
create view v1 as
select concat(a,a)
from t1;
show create view v1;

| v1   | CREATE VIEW "v1" AS select concat_operator_oracle("t1"."a","t1"."a") AS "concat(a,a)" from "t1" | utf8mb3              | utf8mb3_general_ci   |

One problem is that we store the view text after conversion, when we should stored the original view definition.

Another problem is that we show the modified view definition, 'view_body_utf8', instead of 'query' (from v1.frm).

This should not be that hard to fix as v1.frm stores both the original view text and the modified one.

For this to work, we probably have to also store the sql mode for the view and show it in information_schema.views;


Generated at Thu Feb 08 10:28:45 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.