Skip to content

MDEV-39914: Crash in ST_SIMPLIFY used in an IN list#5205

Open
DaveGosselin-MariaDB wants to merge 1 commit into
12.3from
12.3-mdev-39914-gis-info-schema-crash
Open

MDEV-39914: Crash in ST_SIMPLIFY used in an IN list#5205
DaveGosselin-MariaDB wants to merge 1 commit into
12.3from
12.3-mdev-39914-gis-info-schema-crash

Conversation

@DaveGosselin-MariaDB

Copy link
Copy Markdown
Member

A geometry function writes its binary result into a buffer given by the caller. ST_SIMPLIFY did not set the charset of that buffer. A constant value in an IN list, though, is stored into the array that IN builds for its comparisons, and that array has no charset. Appending the geometry then read an invalid charset and crashed the server.

Set the result buffer to the binary charset before writing the geometry, matching what the other geometry functions already do.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses a crash (MDEV-39914) triggered when ST_SIMPLIFY is used as a constant element in an IN list. The fix ensures that the output buffer's charset is explicitly set to binary (&my_charset_bin) before appending the simplified geometry, preventing a null charset read. Additionally, relevant test cases have been added to verify the fix. There are no review comments, and I have no further feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

A geometry function writes its binary result into a buffer given by
the caller.  ST_SIMPLIFY did not set the charset of that buffer.  A
constant value in an IN list, though, is stored into the array that IN
builds for its comparisons, and that array has no charset.  Appending
the geometry then read an invalid charset and crashed the server.

Set the result buffer to the binary charset before writing the
geometry, matching what the other geometry functions already do.
@DaveGosselin-MariaDB DaveGosselin-MariaDB force-pushed the 12.3-mdev-39914-gis-info-schema-crash branch from 7c0ead9 to e47f2d5 Compare June 12, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant