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

View is created with wrong column name if column name > 64 symbols

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL)
    • None
    • Tests

    Description

      According standard "If a <view column list> is" not "specified ... the <column name>s of the view are the <column name>s of the table specified by the <query expression>"

      But:

      If column name less or equal 64 symbols is everything Ok:

      CREATE OR REPLACE VIEW v2 AS SELECT 111;
      

      TABLE_SCHEMA	TABLE_NAME	COLUMN_NAME
      test	                         v2	                111
      

      But if column name more than 64 symbols the column name changes to "Name_exp_1"

      CREATE OR REPLACE VIEW v1 AS SELECT 11111111111111111111111111111111111111111111111111111111111111111;
      

      TABLE_SCHEMA	TABLE_NAME	COLUMN_NAME
      test	                        v1	                Name_exp_1
      

      Also it is impossible to set column name more than 64 symbols:

      mysqltest: At line 6: query 'CREATE OR REPLACE VIEW v2 AS SELECT 111 as a2222222222222222222222222222222222222222222222222222222222222222' failed: 1166: Incorrect column name 'a2222222222222222222222222222222222222222222222222222222222222222'
      

      After fix this bug view-protocol should be enable in tests: main.ctype_ldml, main.date_formats, main.order_by (possible), main.alias

      Attachments

        Issue Links

          Activity

            Review for commit 3701b75aaea5e42d2dfd33fb4efb76b7157de9f2 done, OK to push after small fix:

            sanja, remove, plz, in main.func_json, main.func_time, main.gis-json string " #enable after fix MDEV-27871"
            in main.gis-json one waste " --disable_view_protocol"

            lstartseva Lena Startseva added a comment - Review for commit 3701b75aaea5e42d2dfd33fb4efb76b7157de9f2 done, OK to push after small fix: sanja , remove, plz, in main.func_json, main.func_time, main.gis-json string " #enable after fix MDEV-27871 " in main.gis-json one waste " --disable_view_protocol"

            So the task is finish fixing the tests and close this mdev as not a bug

            sanja Oleksandr Byelkin added a comment - So the task is finish fixing the tests and close this mdev as not a bug

            Branches with fix:
            10.5 - bb-10.5-MDEV-27871
            10.6 - bb-10.6-MDEV-27871
            10.11 - bb-10.11-MDEV-27871
            11.0 - bb-11.1-MDEV-27871
            11.1 - no changes needed
            11.2 - bb-11.2-MDEV-27871
            11.4 - no changes needed

            Before merge changes commit '0fc123c595cd0b61ec852800012b837858e2784f' must be present in the main branch

            lstartseva Lena Startseva added a comment - Branches with fix: 10.5 - bb-10.5- MDEV-27871 10.6 - bb-10.6- MDEV-27871 10.11 - bb-10.11- MDEV-27871 11.0 - bb-11.1- MDEV-27871 11.1 - no changes needed 11.2 - bb-11.2- MDEV-27871 11.4 - no changes needed Before merge changes commit '0fc123c595cd0b61ec852800012b837858e2784f' must be present in the main branch

            sanja, please review

            lstartseva Lena Startseva added a comment - sanja , please review
            sanja Oleksandr Byelkin added a comment - - edited

            OK to push (10.5)

            sanja Oleksandr Byelkin added a comment - - edited OK to push (10.5)
            lstartseva Lena Startseva added a comment - - edited

            Changes for 10.5 are pushed

            lstartseva Lena Startseva added a comment - - edited Changes for 10.5 are pushed

            People

              lstartseva Lena Startseva
              lstartseva Lena Startseva
              Votes:
              0 Vote for this issue
              Watchers:
              6 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.