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

Number of an invalid row is not calculated for table value constructor

Details

    Description

      Maybe it should just go to documentation as a limitation. It is unfortunate however if it keeps returning "1" rather than some non-natural number.

      CREATE OR REPLACE TABLE t (a CHAR(1)) VALUES ('a'),('b'),('foo');
      

      10.4 69bd2c88

      CREATE OR REPLACE TABLE t (a CHAR(1)) VALUES ('a'),('b'),('foo');
      Warnings:
      Warning	1406	Data too long for column 'a' at row 1
      

      Consequently, ERROR_INDEX from MDEV-10075 is not calculated for table value constructors, either.

      I"ve set affected versions to 10.3+ because that's where table value constructors were introduced, and surely the number is not calculated in 10.3 either; but the test case above is only applicable to 10.4+, 10.3 doesn't seem to allow to create table from a table value constructor.

      Attachments

        Issue Links

          Activity

            elenst Elena Stepanova created issue -
            elenst Elena Stepanova made changes -
            Field Original Value New Value
            elenst Elena Stepanova made changes -
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            Fix Version/s 10.6 [ 24028 ]
            Description _Maybe it should go to documentation as a limitation_

            {code:sql}
            values (1),(2),(3,'foo');
            set @n= null, @m= null;
            get diagnostics condition 1 @n = error_index, @m = message_text;
            select @n, @m;
            {code}
            {code:sql|title=10.7 d552e092c9}
            +------+-------------------------------------------------------------------+
            | @n | @m |
            +------+-------------------------------------------------------------------+
            | 1 | The used table value constructor has a different number of values |
            +------+-------------------------------------------------------------------+
            1 row in set (0.000 sec)
            {code}

            Same for
            {code:sql}
            create or replace table t values (1),(2),(3,'foo');
            {code}
            _Maybe it should go to documentation as a limitation_

            {code:sql}
            CREATE OR REPLACE TABLE t (a CHAR(1)) VALUES ('a'),('b'),('foo');
            {code}

            {code:sql|title=10.4 69bd2c88}
            CREATE OR REPLACE TABLE t (a CHAR(1)) VALUES ('a'),('b'),('foo');
            Warnings:
            Warning 1406 Data too long for column 'a' at row 1
            {code}

            Consequently, ERROR_INDEX from MDEV-10075 is not calculated for table value constructors, either.
            elenst Elena Stepanova made changes -
            Description _Maybe it should go to documentation as a limitation_

            {code:sql}
            CREATE OR REPLACE TABLE t (a CHAR(1)) VALUES ('a'),('b'),('foo');
            {code}

            {code:sql|title=10.4 69bd2c88}
            CREATE OR REPLACE TABLE t (a CHAR(1)) VALUES ('a'),('b'),('foo');
            Warnings:
            Warning 1406 Data too long for column 'a' at row 1
            {code}

            Consequently, ERROR_INDEX from MDEV-10075 is not calculated for table value constructors, either.
            _Maybe it should go to documentation as a limitation_

            {code:sql}
            CREATE OR REPLACE TABLE t (a CHAR(1)) VALUES ('a'),('b'),('foo');
            {code}

            {code:sql|title=10.4 69bd2c88}
            CREATE OR REPLACE TABLE t (a CHAR(1)) VALUES ('a'),('b'),('foo');
            Warnings:
            Warning 1406 Data too long for column 'a' at row 1
            {code}

            Consequently, ERROR_INDEX from MDEV-10075 is not calculated for table value constructors, either.

            I"ve set affected versions to 10.3+ because that's where table value constructors were introduced, and surely the number is not calculated in 10.3 either; but the test case above is only applicable to 10.4+, 10.3 doesn't seem to allow to create table from a table value constructor.
            elenst Elena Stepanova made changes -
            Summary Number of an invalid value row is not calculated for table value constructor Number of an invalid row is not calculated for table value constructor
            elenst Elena Stepanova made changes -
            Fix Version/s 10.7 [ 24805 ]
            elenst Elena Stepanova made changes -
            Description _Maybe it should go to documentation as a limitation_

            {code:sql}
            CREATE OR REPLACE TABLE t (a CHAR(1)) VALUES ('a'),('b'),('foo');
            {code}

            {code:sql|title=10.4 69bd2c88}
            CREATE OR REPLACE TABLE t (a CHAR(1)) VALUES ('a'),('b'),('foo');
            Warnings:
            Warning 1406 Data too long for column 'a' at row 1
            {code}

            Consequently, ERROR_INDEX from MDEV-10075 is not calculated for table value constructors, either.

            I"ve set affected versions to 10.3+ because that's where table value constructors were introduced, and surely the number is not calculated in 10.3 either; but the test case above is only applicable to 10.4+, 10.3 doesn't seem to allow to create table from a table value constructor.
            _Maybe it should just go to documentation as a limitation. It is unfortunate however if it keeps returning "1" rather than some non-natural number._

            {code:sql}
            CREATE OR REPLACE TABLE t (a CHAR(1)) VALUES ('a'),('b'),('foo');
            {code}

            {code:sql|title=10.4 69bd2c88}
            CREATE OR REPLACE TABLE t (a CHAR(1)) VALUES ('a'),('b'),('foo');
            Warnings:
            Warning 1406 Data too long for column 'a' at row 1
            {code}

            Consequently, ERROR_INDEX from MDEV-10075 is not calculated for table value constructors, either.

            I"ve set affected versions to 10.3+ because that's where table value constructors were introduced, and surely the number is not calculated in 10.3 either; but the test case above is only applicable to 10.4+, 10.3 doesn't seem to allow to create table from a table value constructor.
            rucha174 Rucha Deodhar made changes -
            Assignee Rucha Deodhar [ rucha174 ] Sergei Golubchik [ serg ]
            rucha174 Rucha Deodhar made changes -
            Assignee Sergei Golubchik [ serg ] Rucha Deodhar [ rucha174 ]
            serg Sergei Golubchik made changes -
            serg Sergei Golubchik made changes -
            rucha174 Rucha Deodhar made changes -
            rucha174 Rucha Deodhar made changes -
            Status Open [ 1 ] Confirmed [ 10101 ]
            rucha174 Rucha Deodhar made changes -
            Status Confirmed [ 10101 ] Open [ 1 ]
            rucha174 Rucha Deodhar made changes -
            Status Open [ 1 ] Confirmed [ 10101 ]
            rucha174 Rucha Deodhar added a comment - - edited Patch for 10.4: https://github.com/MariaDB/server/commit/d45841b9be6fe069383cc05405f747ae36d08362 Patch for 10.7 (added test for row_number and create...select) : https://github.com/MariaDB/server/commit/ee5966c75404fd4e35dde52f1ebb78e3e20ebf77
            rucha174 Rucha Deodhar made changes -
            Assignee Rucha Deodhar [ rucha174 ] Sergei Golubchik [ serg ]
            Status Confirmed [ 10101 ] In Review [ 10002 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 125533 ] MariaDB v4 [ 143803 ]
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Rucha Deodhar [ rucha174 ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            rucha174 Rucha Deodhar made changes -
            Assignee Rucha Deodhar [ rucha174 ] Sergei Golubchik [ serg ]
            Status Stalled [ 10000 ] In Review [ 10002 ]
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Rucha Deodhar [ rucha174 ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            rucha174 Rucha Deodhar made changes -
            Assignee Rucha Deodhar [ rucha174 ] Sergei Golubchik [ serg ]
            Status Stalled [ 10000 ] In Review [ 10002 ]
            rucha174 Rucha Deodhar made changes -
            Assignee Sergei Golubchik [ serg ] Rucha Deodhar [ rucha174 ]
            rucha174 Rucha Deodhar added a comment -

            Reassigned to myself because discussed done on slack about adding one more test and then pushing.

            rucha174 Rucha Deodhar added a comment - Reassigned to myself because discussed done on slack about adding one more test and then pushing.
            rucha174 Rucha Deodhar made changes -
            Status In Review [ 10002 ] Stalled [ 10000 ]
            rucha174 Rucha Deodhar made changes -
            Fix Version/s 10.3.35 [ 27512 ]
            Fix Version/s 10.4.25 [ 27510 ]
            Fix Version/s 10.5.16 [ 27508 ]
            Fix Version/s 10.6.8 [ 27506 ]
            Fix Version/s 10.7.4 [ 27504 ]
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            Fix Version/s 10.6 [ 24028 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]

            People

              rucha174 Rucha Deodhar
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.