You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
Start a TiDB playground with tiup, and run the following program.
package main
import (
"database/sql"
"fmt"
_ "github.com/go-sql-driver/mysql"
)
func main() {
b := []byte{0x41, 0xf6, 0xec, 0x9a}
db, _ := sql.Open("mysql", "root:@tcp(127.0.0.1:4000)/test")
defer db.Close()
db.Exec(`DROP TABLE IF EXISTS test`)
db.Exec(`CREATE TABLE IF NOT EXISTS test (a BINARY(4))`)
db.Exec(`SET SESSION tidb_general_log = 1`)
db.Exec(`INSERT INTO test VALUES (?)`, b)
db.Exec(fmt.Sprintf(`select * from test where a = _binary '%s'`, b))
}
2. What did you expect to see? (Required)
The sql field of the GENERAL_LOG message should include the original text, like,
sql="select * from test where a = _binary 'A\ufffd\ufffd\ufffd'"
3. What did you see instead (Required)
The GENERAL_LOG message is,
[2024/11/14 18:42:53.920 -08:00] [INFO] [session.go:3929] [GENERAL_LOG] [conn=1138753544] [session_alias=] [[email protected]] [schemaVersion=55] [txnStartTS=0] [forUpdateTS=0] [isReadConsistency=false] [currentDB=test] [isPessimistic=false] [sessionTxnMode=PESSIMISTIC] [sql="select * from test where a = _binary 'A???'"]
where the binary characters are replaced with ?.
4. What is your TiDB version? (Required)
I tried with the master version and v7.5.1.
The text was updated successfully, but these errors were encountered:
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
Start a TiDB playground with
tiup
, and run the following program.2. What did you expect to see? (Required)
The
sql
field of theGENERAL_LOG
message should include the original text, like,3. What did you see instead (Required)
The
GENERAL_LOG
message is,where the binary characters are replaced with
?
.4. What is your TiDB version? (Required)
I tried with the master version and v7.5.1.
The text was updated successfully, but these errors were encountered: