Skip to content

Commit b589b73

Browse files
committed
[ga-format-pr] Run ./format_repo.sh to fix formatting
1 parent b4abe36 commit b589b73

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

sql/rowexec/insert.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func (i *insertIter) Next(ctx *sql.Context) (returnRow sql.Row, returnErr error)
116116
// Add column name and row number to context for proper error messages
117117
ctxWithColumnInfo := context.WithValue(ctx, types.ColumnNameKey, col.Name)
118118
ctxWithColumnInfo = context.WithValue(ctxWithColumnInfo, types.RowNumberKey, i.rowNumber)
119-
119+
120120
converted, inRange, cErr := col.Type.Convert(ctxWithColumnInfo, row[idx])
121121
if cErr == nil && !inRange {
122122
cErr = sql.ErrValueOutOfRange.New(row[idx], col.Type)
@@ -478,4 +478,3 @@ func toInt64(x interface{}) int64 {
478478
panic(fmt.Sprintf("Expected a numeric auto increment value, but got %T", x))
479479
}
480480
}
481-

sql/types/strings.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -518,14 +518,14 @@ func ConvertToBytes(ctx context.Context, v interface{}, t sql.StringType, dest [
518518
func getColumnContext(ctx context.Context) (string, int64) {
519519
colName := "<unknown>"
520520
rowNum := int64(0)
521-
521+
522522
if name, ok := ctx.Value(ColumnNameKey).(string); ok {
523523
colName = name
524524
}
525525
if num, ok := ctx.Value(RowNumberKey).(int64); ok {
526526
rowNum = num
527527
}
528-
528+
529529
return colName, rowNum
530530
}
531531

@@ -546,7 +546,7 @@ func formatInvalidByteForError(bytesVal []byte) string {
546546
}
547547
}
548548

549-
// If no invalid bytes found, but we're here due to invalid UTF-8,
549+
// If no invalid bytes found, but we're here due to invalid UTF-8,
550550
// show the first byte (this handles edge cases)
551551
if firstInvalidPos == -1 {
552552
return fmt.Sprintf(invalidByteFormat, bytesVal[0])
@@ -556,13 +556,13 @@ func formatInvalidByteForError(bytesVal []byte) string {
556556
var result strings2.Builder
557557
maxBytesToShow := 6 // MySQL seems to show around 6 bytes before truncating
558558
remainingBytes := bytesVal[firstInvalidPos:]
559-
559+
560560
for i, b := range remainingBytes {
561561
if i >= maxBytesToShow {
562562
result.WriteString("...")
563563
break
564564
}
565-
565+
566566
// MySQL shows valid ASCII characters as their actual characters,
567567
// but invalid UTF-8 bytes (> 127) or control characters as hex
568568
if b >= 32 && b <= 126 {
@@ -577,7 +577,6 @@ func formatInvalidByteForError(bytesVal []byte) string {
577577
return result.String()
578578
}
579579

580-
581580
// convertToLongTextString safely converts a value to string using LongText.Convert with nil checking
582581
func convertToLongTextString(ctx context.Context, val interface{}) (string, error) {
583582
converted, _, err := LongText.Convert(ctx, val)

0 commit comments

Comments
 (0)