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

Add Type_handler::union_element_finalize()

    XMLWordPrintable

Details

    Description

      There is a code in sql_union.cc which checks that an Item is OK as a UNION field.

          while ((type= tp++))
          {
            if (type->cmp_type() == STRING_RESULT &&
                type->collation.derivation == DERIVATION_NONE)
            {
              my_error(ER_CANT_AGGREGATE_NCOLLATIONS, MYF(0), "UNION");
              goto err;
            }
          }

      Currently, this code has only one purpose: In case of character string data types it makes sure that the aggregated data type has a non-conflicting collation, to disallow this:

      mysql> (SELECT 'a' COLLATE utf8_general_ci) UNION (SELECT 'b' COLLATE utf8_unicode_ci);
      ERROR 1267 (HY000): Illegal mix of collations (utf8_general_ci,EXPLICIT) and (utf8_unicode_ci,EXPLICIT) for operation 'UNION'

      All other built-in data types have no additional requirements on the aggregated data type.
      But user defined data types may want to have their own requirements.

      This code should go into a new virtual method in Type_handler.

      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.