dolthub / dolthub/dolt

Implement MBR functions

Open
#10,599 3 comments 0 reactions 0 assignees View on GitHub
customer issue enhancement good repro spatial types sql
Dominant language
Go
Stars
24.4k
Forks
873
Avg merge
1d 8h
Merged PRs (30d)
120

Description

# Summary

Dolt appears to be missing a MySQL spatial function, which common open-source GIS solutions (e.g., QGIS) rely on to render spatial data: [MBRIntersects(g1, g2)](https://dev.mysql.com/doc/refman/8.4/en/spatial-relation-functions-mbr.html#function_mbrintersects). You can find its usage in GDAL’s source code [here](https://github.com/OSGeo/gdal/blob/85a61677cb4922b770bd3bb90e0e436ddd91b060/ogr/ogrsf_frmts/mysql/ogrmysqltablelayer.cpp#L483).

# Environment

I am running Dolt version **1.83.0** on openSUSE Tumbleweed. My test database contains one spatial table with a single row of line geometry.

# Steps to Reproduce

1. Start Dolt SQL Server by running `dolt sql-server --loglevel debug`;
2. Open QGIS;
3. Load a spatial table from Dolt;
4. The following warning is displayed in the terminal: `error="function: 'mbrintersects' not found"`;

```
WARN[0154] error running query
connectTime="2026-02-28 23:17:10.005275025 -0300 -03 m=+94.094760374"
connectionDb=gis
connectionID=3
error="function: 'mbrintersects' not found"
query="SELECT `objectid`, `shape` `shape`, `globalid`, `created_at`, `created_by`, `updated_at`, `updated_by`, `diametro`, `material` FROM `waterline` WHERE MBRIntersects(ST_GeomFromText('POLYGON((2.75529587655338348 48.1440888125396143, 2.76698004683898757 48.1440888125396143, 2.76698004683898757 48.1528197319811895, 2.75529587655338348 48.1528197319811895, 2.75529587655338348 48.1440888125396143))', 32631), ST_SRID(`shape`,32631))" queryTime="2026-02-28 23:18:10.87323687 -0300 -03 m=+154.962722207"
```
5. No geometries are returned to the application, the rendering fails.

# Questions

1. Have the MySQL Spatial Analysis functions already been implemented? I’m not very familiar with Go, and I couldn't find any reference to them in the Dolt repository. If these functions are still on the roadmap, feel free to close this issue.

Thank you for your help!

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names no source files or tests. Start by reproducing the MBRIntersects failure through the Dolt SQL server with the provided spatial query, then trace how the missing function is handled. Done means the function is recognized and QGIS returns the expected geometries for the spatial table.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, mysql
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.