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

Bogus ER_TOO_BIG_ROWSIZE reported for SPATIAL INDEX

    XMLWordPrintable

Details

    • Can result in unexpected behaviour

    Description

      The following test case is based on the test innodb_gis.big_records in the fix of MySQL Bug#39433811:

      --source include/have_innodb.inc
      --source include/have_sequence.inc
       
      CREATE TABLE t1 (
        a VARCHAR(255) NOT NULL,
        b VARCHAR(255) NOT NULL,
        c VARCHAR(255) NOT NULL,
        d VARCHAR(175) NOT NULL,
        g GEOMETRY NOT NULL,
        PRIMARY KEY (a, b, c, d),
        SPATIAL KEY idx_g (g)
      ) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 CHARSET=latin1;
       
      # This one is a simple case where the row is very short
      INSERT INTO t1 (a,b,c,d,g)
        VALUES ('a', 'b', 'c', 'd', ST_GeomFromText('POINT(0 0)'));
       
      # This one is a more difficult case where the row is very long,
      # in particular its Primary Key columns have longest possible values.
      --echo --error ER_TOO_BIG_ROWSIZE
      INSERT INTO t1 (a,b,c,d,g) VALUES (
        REPEAT('a',255),
        REPEAT('b',255),
        REPEAT('c',255),
        REPEAT('d',175),
        ST_GeomFromText('POINT(1 1)')
      );
       
      # Now lets see what happens if the R-tree has some internal nodes
      INSERT INTO t1 (a,b,c,d,g)
        SELECT REPEAT(seq,50), REPEAT('b',255), REPEAT('c',255), 'd2', ST_GeomFromText(
          CONCAT('POINT(', MOD(seq,90), ' -122.4194)'),
          4326
        ) FROM seq_1_to_1024;
       
      --echo # Before DELETE:
      SELECT a,b,c,d,ST_AsText(g) FROM t1 WHERE g=ST_GeomFromText('POINT(40 -122.4194)');
      SELECT COUNT(*) FROM t1;
       
      # Now test navigation
      DELETE FROM t1 WHERE g=ST_GeomFromText('POINT(40 -122.4194)');
      --echo # After DELETE
      SELECT a,b,c,d,ST_AsText(g) FROM t1 WHERE g=ST_GeomFromText('POINT(40 -122.4194)');
      SELECT COUNT(*) FROM t1;
       
      DROP TABLE t1;
      

      Only one INSERT is failing on MariaDB. Maybe it is related to the fact that the original test made use of a particular spatial reference system, while only one is implemented in MariaDB.

      Attachments

        Issue Links

          Activity

            People

              thiru Thirunarayanan Balathandayuthapani
              marko Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.