Uploaded image for project: 'MariaDB Connector/Python'
  1. MariaDB Connector/Python
  2. CONPY-42

Seg fault when printing rows containing POINT datatype

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.54
    • Fix Version/s: 0.9.55
    • Component/s: DBAPI 2.0
    • Labels:
      None
    • Environment:
      Python 3.7.3
      pip install --user mariadb
      pip show mariadb | grep Version
      Version: 0.9.54
      Fedora release 30 (Thirty)

      Description

      I have the following table and data:

      CREATE DATBASE mytest;
      USE mytest;
       
      CREATE TABLE `gis_point` (
        `g` point NOT NULL,
        SPATIAL KEY `g` (`g`)
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
       
      INSERT INTO gis_point (g) VALUES (PointFromText('point(1 1)'));
      

      Then I have this Python code:

      import mariadb
       
      config = {
          'host': 'localhost',
          'user': 'root',
          'password': 'secret',
      }
       
      conn = mariadb.connect(**config, database='mytest')
      cur = conn.cursor()
      cur.execute(f"SELECT `g` FROM `gis_point`")
      for row in cur:
          print(row)
      conn.close()
      

      But running that crashes:
      $ python gispoint.py
      Segmentation fault (core dumped)

        Attachments

          Activity

            People

            Assignee:
            georg Georg Richter
            Reporter:
            karll Karl Levik
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: