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

Local hints inside view following after QB_NAME are not displayed

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 12.2
    • 12.2
    • Optimizer
    • None

    Description

      If a QB_NAME hint is specified inside CREATE VIEW, subsequent SHOW CREATE VIEW does not display hints that follow QB_NAME.

      create table t1 (a int);
       
      create view v1 as select /*+ qb_name(view1) no_bnl()*/ t1.* from t1, t1 as t2
        where t1.a > t2.a;
       
      show create view v1;
      

      Output:

      View	Create View	character_set_client	collation_connection
      v1	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select /*+ QB_NAME(`view1`) */ `t1`.`a` AS `a` from (`t1` join `t1` `t2`) where `t1`.`a` > `t2`.`a`	latin1	latin1_swedish_ci
      

      Only QB_NAME() hint is displayed.

      In contrast, if there is no QB_NAME hint inside view definition, all hints are displayed

      create view v2 as select /*+ no_bnl() no_index(t1) */ t1.* from t1, t1 as t2
        where t1.a > t2.a;
       
      show create view v2;
      

      Output:

      View	Create View	character_set_client	collation_connection
      v2	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select /*+ NO_BNL() NO_INDEX(`t1`) */ `t1`.`a` AS `a` from (`t1` join `t1` `t2`) where `t1`.`a` > `t2`.`a`	latin1	latin1_swedish_ci
      

      Attachments

        Issue Links

          Activity

            People

              Gosselin Dave Gosselin
              oleg.smirnov Oleg Smirnov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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