Skip to content

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #54145

What problem does this PR solve?

Issue Number: close #54029, close #54044

Problem Summary:

For some json functions, the arg verification is not implemented correctly:

  1. For json_type, it didn't verify the type of args.
  2. For many other json functions, they didn't verify the charset of the args.

For PREPARE, the param marker is set to binary string type, which is not expected. This PR will give it a default collation. It will not affect the EXECUTE, because when it's executing a statement, it'll infer the collation according to the datum (whose collation is set according to the collation settings of the connection).

What changed and how does it work?

  1. Add a unified function to verify the args of json functions.
  2. Modify the collation of param marker from binary to default collation.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Release note

Fix the issue that `json_type` can accept non-JSON arguments.
Fix the issue that some json functions accept binary string arguments.
Fix the issue that `PREPARE` will fail if the statement contains some json related functions.

@ti-chi-bot ti-chi-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/cherry-pick-for-release-8.5 This PR is cherry-picked to release-8.5 from a source PR. labels Nov 20, 2024
Copy link

codecov bot commented Nov 20, 2024

Codecov Report

Attention: Patch coverage is 94.23077% with 3 lines in your changes missing coverage. Please review.

Please upload report for BASE (release-8.5@a568fdc). Learn more about missing BASE report.

Additional details and impacted files
@@               Coverage Diff                @@
##             release-8.5     #57567   +/-   ##
================================================
  Coverage               ?   57.0227%           
================================================
  Files                  ?       1770           
  Lines                  ?     627286           
  Branches               ?          0           
================================================
  Hits                   ?     357696           
  Misses                 ?     245567           
  Partials               ?      24023           
Flag Coverage Δ
integration 36.9248% <94.2307%> (?)
unit 72.6983% <80.7692%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 52.9478% <0.0000%> (?)
parser ∅ <0.0000%> (?)
br 52.3606% <0.0000%> (?)
---- 🚨 Try these New Features:

Copy link
Contributor

@windtalker windtalker left a comment

Choose a reason for hiding this comment

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

lgtm

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Nov 21, 2024
Copy link
Member

@bb7133 bb7133 left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot ti-chi-bot bot added approved lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Nov 21, 2024
Copy link

ti-chi-bot bot commented Nov 21, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-11-21 00:57:58.723012071 +0000 UTC m=+79666.342666572: ☑️ agreed by windtalker.
  • 2024-11-21 02:06:00.242302678 +0000 UTC m=+83747.861957178: ☑️ agreed by bb7133.

Copy link

ti-chi-bot bot commented Nov 21, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bb7133, tangenta, windtalker

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@YangKeao
Copy link
Member

/retest

@ti-chi-bot ti-chi-bot bot merged commit 2ed426a into pingcap:release-8.5 Nov 21, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved cherry-pick-approved Cherry pick PR approved by release team. lgtm release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/cherry-pick-for-release-8.5 This PR is cherry-picked to release-8.5 from a source PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants