Skip to content

MDEV-31554 Cursor protocol cuts off json boolean#5287

Open
grooverdan wants to merge 1 commit into
MariaDB:10.11from
grooverdan:MDEV-31554
Open

MDEV-31554 Cursor protocol cuts off json boolean#5287
grooverdan wants to merge 1 commit into
MariaDB:10.11from
grooverdan:MDEV-31554

Conversation

@grooverdan

Copy link
Copy Markdown
Member

In Item_func_json_array_append::fix_length_and_dec, Item_bool::max_char_length() was being used to
calculate the length that is required to fit a boolean.

Previously it was returning 1, which doesn't fit "false".

Change Item_bool to return strlen("false"), 5.

@grooverdan grooverdan added the MariaDB Foundation Pull requests created by MariaDB Foundation label Jun 28, 2026

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

Copy link
Copy Markdown
Contributor

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 enables cursor protocol tests in func_json.test and increases the length parameter from 1 to 5 in one of the Item_bool constructors in sql/item.h to prevent truncation. The reviewer recommends updating the other Item_bool constructors to consistently use a length of 5 to avoid similar truncation issues when those constructors are used.

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.

Comment thread sql/item.h Outdated
In Item_func_json_array_append::fix_length_and_dec,
Item_bool::max_char_length() was being used to
calculate the length that is required to fit a boolean.

Previously it was returning 1, which doesn't fit
"false".

Change Item_bool to return strlen("false"), 5.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

MariaDB Foundation Pull requests created by MariaDB Foundation

Development

Successfully merging this pull request may close these issues.

2 participants