Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: 10.5
Choose a base branch
from

Conversation

grooverdan
Copy link
Member

…ad of "true"

  • 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.
  • 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

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

@grooverdan grooverdan requested a review from holyfoot December 13, 2024 06:04
@grooverdan grooverdan added the MariaDB Foundation Pull requests created by MariaDB Foundation label Dec 13, 2024
…ad of "true"

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.

Rather than EXPLAIN=JSON display "true", because its
json, it doesn't need quotes. Adjust the json_write to identify
boolean Items and then just print directly using add_bool.
@grooverdan
Copy link
Member Author

grooverdan commented Dec 17, 2024

From @Olernov
MDEV-32866 #3708 task doesn't touch this part. It only removed some lines from EXPLAIN output due to real execution plan modification.
"true" looks much better than "1"

So there's minor test case result variants conflicts that everyone knows about that can be resolved by re-record by whoever merges last.

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