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

Hex value instead char in definition of view gives incorrect result

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9
    • 10.11
    • None

    Description

      Expected that "select" and "view" give the same result:
      Test:

      set collation_connection=ucs2_unicode_ci;
      select hex(weight_string(cast(_latin1 0x6368DF as char), 2, 4, 0xC0));
       
      create view vv as select hex(weight_string(cast(_latin1 0x6368DF as char), 2, 4, 0xC0));
      select * from vv;
      drop view vv;
      

      Actual result

      select hex(weight_string(cast(_latin1 0x6368DF as char), 2, 4, 0xC0));
      hex(weight_string(cast(_latin1 0x6368DF as char), 2, 4, 0xC0))
      0E60
      create view vv as select hex(weight_string(cast(_latin1 0x6368DF as char), 2, 4, 0xC0));
      select * from vv;
      hex(weight_string(cast(_latin1 0x6368DF as char), 2, 4, 0xC0))
      0043
      

      Expected result

      select hex(weight_string(cast(_latin1 0x6368DF as char), 2, 4, 0xC0));
      hex(weight_string(cast(_latin1 0x6368DF as char), 2, 4, 0xC0))
      0E60
      create view vv as select hex(weight_string(cast(_latin1 0x6368DF as char), 2, 4, 0xC0));
      select * from vv;
      hex(weight_string(cast(_latin1 0x6368DF as char), 2, 4, 0xC0))
      0E60
      

      SHOW CREATE VIEW vv;

      View	Create View	character_set_client	collation_connection
      vv	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `vv` AS select hex(weight_string(cast(_latin1'ch�' as char charset ucs2),2,4,193)) AS `hex(weight_string(cast(_latin1 0x6368DF as char), 2, 4, 0xC0))`	latin1	ucs2_unicode_ci
      

      Attachments

        Issue Links

          Activity

            People

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