MDEV-39914: Crash in ST_SIMPLIFY used in an IN list#5205
MDEV-39914: Crash in ST_SIMPLIFY used in an IN list#5205DaveGosselin-MariaDB wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
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.
7c0ead9 to
e47f2d5
Compare
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.