Skip to content

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #57496

What problem does this PR solve?

Issue Number: close #56293

Problem Summary:

The JSON_VALID function behavior is inconsistent between different types, between TiDB and TiKV.

What changed and how does it work?

This PR changes the behavior of returning 0 directly for "other" types. With this modification, the behavior is consistent for JSON, STRING and all other types. Also, it's compatible between TiDB and TiKV.

The strange behavior described in #56293 is caused by different behavior between the SELECTION pushed down to TiKV, and the PROJECTION in TiDB. This PR should fix it.

Please be careful that this behavior is not compatible with MySQL. Because the behavior of MySQL is not consistent to its document (https://dev.mysql.com/doc/refman/5.7/en/json-attribute-functions.html#function_json-valid) and is also not consistent between different types, columns and literals. I submitted a bug report to MySQL : https://bugs.mysql.com/bug.php?id=116703

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

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 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 19, 2024
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Nov 19, 2024
Copy link

codecov bot commented Nov 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

Additional details and impacted files
@@               Coverage Diff                @@
##             release-8.5     #57505   +/-   ##
================================================
  Coverage               ?   57.4830%           
================================================
  Files                  ?       1770           
  Lines                  ?     630226           
  Branches               ?          0           
================================================
  Hits                   ?     362273           
  Misses                 ?     243901           
  Partials               ?      24052           
Flag Coverage Δ
integration 37.5214% <100.0000%> (?)
unit 73.0962% <100.0000%> (?)

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 53.3498% <0.0000%> (?)
---- 🚨 Try these New Features:

@ti-chi-bot ti-chi-bot bot added cherry-pick-approved Cherry pick PR approved by release team. and removed do-not-merge/cherry-pick-not-approved labels Nov 20, 2024
Copy link

ti-chi-bot bot commented Nov 20, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Defined2014, XuHuaiyu

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

@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 20, 2024
Copy link

ti-chi-bot bot commented Nov 20, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-11-19 09:30:47.73614259 +0000 UTC m=+953409.927011573: ☑️ agreed by Defined2014.
  • 2024-11-20 05:56:10.445030732 +0000 UTC m=+11158.064685246: ☑️ agreed by XuHuaiyu.

@YangKeao
Copy link
Member

/retest

@ti-chi-bot ti-chi-bot bot merged commit 5cf2682 into pingcap:release-8.5 Nov 20, 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-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 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.

4 participants