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

'INSERT ST_GeomFromText(GEOMETRYCOLLECTION ' cause ERROR 1048 (23000): Column SHAPE cannot be null

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Confirmed (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.1, 10.2, 10.3, 10.3.9, 10.4.11, 10.4, 5.5
    • Fix Version/s: 10.1, 10.2, 10.3, 10.4
    • Component/s: GIS
    • Labels:
      None
    • Environment:
      Docker image: mariadb:10.3.9
      GDAL mysql driver

      Description

      When creating geospatial table, insert statement cause column is not null.

      mysql> CREATE TABLE `ogr_mysql_28_15`  ( OGR_FID int(11) UNIQUE NOT NULL AUTO_INCREMENT, SHAPE GEOMETRY NOT NULL);
      Query OK, 0 rows affected (0.05 sec)
       
      mysql> INSERT INTO `ogr_mysql_28_15` (`SHAPE` ) VALUES (ST_GeomFromText('GEOMETRYCOLLECTION (POINT (4 6),GEOMETRYCOLLECTION (POINT (4 6),LINESTRING (4 6,7 10)))',2) );
      ERROR 1048 (23000): Column 'SHAPE' cannot be null
      mysql> describe ogr_mysql_28_15;
      +---------+----------+------+-----+---------+----------------+
      | Field   | Type     | Null | Key | Default | Extra          |
      +---------+----------+------+-----+---------+----------------+
      | OGR_FID | int(11)  | NO   | PRI | NULL    | auto_increment |
      | SHAPE   | geometry | NO   | MUL | NULL    |                |
      +---------+----------+------+-----+---------+----------------+
      2 rows in set (0.00 sec)
      

      This is an issue in feature test case of GDAL project, which MariaDB fails.
      https://github.com/OSGeo/gdal/pull/2137

        Attachments

          Activity

            People

            Assignee:
            holyfoot Alexey Botchkov
            Reporter:
            miurahr Hiroshi Miura
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: