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

SP variables of the SET data type erroneously allow values with comma

    XMLWordPrintable

Details

    Description

      Comma is not allowed in SET values in a field definition:

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (a SET('a','b','c','a,b'));
      

      ERROR 1367 (22007): Illegal set 'a,b' value found during parsing
      

      SP variables erroneously allow commas:

      DROP PROCEDURE IF EXISTS p1;
      DELIMITER $$
      CREATE PROCEDURE p1()
      BEGIN
        DECLARE a SET('a','b','c','a,b');
        SET a='a,b';
        SELECT a, a+0;
      END;
      $$
      DELIMITER ;
      CALL p1();
      

      Notice, the 'a,b' value is ignored.
      Inserting assigning 'a,b' to the variable a results in the numeric value 3, which is a bit combination of 1 for 'a' and 2 for 'b'.

      Commas should be disallowed in values for SP SET variables.

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.