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

Unexpected `Data too long` error on subselect as a multiplication argument

    XMLWordPrintable

Details

    • Can result in unexpected behaviour
    • Q1/2026 Server Maintenance

    Description

      CREATE OR REPLACE TABLE t1 AS
      SELECT CONCAT((SELECT 9 FROM seq_1_to_1) * (SELECT 9 FROM seq_1_to_1)) AS c;
      

      ERROR 1406 (22001): Data too long for column 'c' at row 2
      

      Looks wrong. There should not be an error.

      A similar script:

      CREATE OR REPLACE TABLE t0 AS SELECT 1;
      CREATE OR REPLACE TABLE t1 AS
      SELECT CONCAT((SELECT 9 FROM t0) * (SELECT 9 FROM t0)) AS c;
      

      ERROR 1406 (22001): Data too long for column 'c' at row 2
      

      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:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 3.5h
                  3.5h

                  Git Integration

                    Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.