[CONPY-42] Seg fault when printing rows containing POINT datatype Created: 2020-02-19  Updated: 2020-02-20  Resolved: 2020-02-20

Status: Closed
Project: MariaDB Connector/Python
Component/s: DBAPI 2.0
Affects Version/s: 0.9.54
Fix Version/s: 0.9.55

Type: Bug Priority: Major
Reporter: Karl Levik Assignee: Georg Richter
Resolution: Fixed Votes: 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)



 Comments   
Comment by Georg Richter [ 2020-02-20 ]

fixed. rev 3cfacf8aa20422010e789cdef2af83f473d2a4ab

Generated at Thu Feb 08 03:29:48 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.