Skip to content

avoid using the fmt.Sprint to truncate the string #44542

Closed
@hawkingrei

Description

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

package main

import (
	"fmt"
)

func main() {
	len1 := int32(1000000)
	len2 := int32(1000001)
	sql := "test"
	fmt.Printf("%.*q", len1, sql)
	fmt.Printf("\n")
	fmt.Printf("%.*q", len2, sql)
}

2. What did you expect to see? (Required)

normal output

3. What did you see instead (Required)

has an error message

4. What is your TiDB version? (Required)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

affects-6.1This bug affects the 6.1.x(LTS) versions.affects-6.5This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.severity/majorsig/sql-infraSIG: SQL Infratype/bugThe issue is confirmed as a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions