Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-32091

SHOW CREATE VIEW does not show original view definition

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Duplicate
    • None
    • N/A
    • Views
    • None

    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;

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              monty Michael Widenius
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.