server icon indicating copy to clipboard operation
server copied to clipboard

MDEV-28649 json_array(false) in the definition of view return 0 inste…

Open grooverdan opened this issue 11 months ago • 1 comments
trafficstars

…ad of "true"

  • [x] The Jira issue number for this PR is: MDEV-28649

Description

Using any boolean argument to a function in a view resulted in a view definition like:

select json_array(0) AS json_array(false)

This was imply the Item::print function used was from Item_int::print rather than a specific Item_bool::print function.

Simplification to STRING_WITH_LEN noted from Alexey Botchkov's patch after almost equivalent implementation. 6835d2ce268b001a9a4f85d92c132c58e33d490e

Explain FORMAT=JSON output to take boolean output rather than printing "true"/"false" in quotes.

Release Notes

View statements created with functions that take booleans now are accurately represented as booleans.

Also json output containing booleans are displayed as booleans.

How can this PR be tested?

test included

Basing the PR against the correct MariaDB version

  • [ ] This is a new feature or a refactoring, and the PR is based against the main branch.
  • [X] This is a bug fix, and the PR is based against the earliest maintained branch in which the bug can be reproduced.

PR quality check

  • [X] I checked the CODING_STANDARDS.md file and my PR conforms to this where appropriate.
  • [X] For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.

grooverdan avatar Dec 13 '24 06:12 grooverdan