-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
json_quote
return different result
#37294
Labels
component/json
severity/minor
sig/sql-infra
SIG: SQL Infra
type/bug
The issue is confirmed as a bug.
Comments
xiongjiwei
added
type/bug
The issue is confirmed as a bug.
component/json
severity/moderate
labels
Aug 23, 2022
minimum reproduce:
|
it only occurs if string hex |
Another simple test case for this that doesn't reply on a table: SELECT JSON_QUOTE(CONVERT(0x10 USING utf8mb4)); |
Another test: WITH RECURSIVE nr(n) AS (
SELECT 1 n
UNION ALL
SELECT n+1 FROM nr WHERE n<25
)
SELECT JSON_QUOTE(CONVERT(UNHEX(n) USING utf8mb4)) FROM nr;
|
Are we using package main
import (
"encoding/json"
"fmt"
"strconv"
)
func main() {
for i := range 38 {
if i == 0 {
continue
}
j, _ := json.Marshal(string(i))
fmt.Printf(
"i=%d\tquote=%s\tj=%s\n",
i,
strconv.Quote(string(i)),
j,
)
}
}
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
component/json
severity/minor
sig/sql-infra
SIG: SQL Infra
type/bug
The issue is confirmed as a bug.
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: