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

View defined with table value constructor does not preserve given column names

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 10.3
    • Fix Version/s: 10.3, 10.4
    • Component/s: Optimizer
    • Labels:
      None

      Description

      The following demonstrates the problem:

      MariaDB [test]> create view v1(a) as  values (3), (7), (1);                                                                                                                                                
                                                                                                                              
      MariaDB [test]> show create view v1;                                                                                    
      +------+--------------------------------------------------------------------------------------------+----------------------+----------------------+
      | View | Create View                                                                                | character_set_client | collation_connection |
      +------+--------------------------------------------------------------------------------------------+----------------------+----------------------+
      | v1   | CREATE ALGORITHM=UNDEFINED DEFINER=`` SQL SECURITY DEFINER VIEW `v1` AS values (3),(7),(1) | utf8                 | utf8_general_ci      |
      +------+--------------------------------------------------------------------------------------------+----------------------+----------------------+
       
      MariaDB [test]> select * from v1;
      +---+
      | 3 |
      +---+
      | 3 |
      | 7 |
      | 1 |
      +---+
      

        Attachments

          Activity

            People

            • Assignee:
              igor Igor Babaev
              Reporter:
              igor Igor Babaev
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: