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
Copy file name to clipboardExpand all lines: sql/errors.go
+11-1Lines changed: 11 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,14 @@ import (
22
22
"gopkg.in/src-d/go-errors.v1"
23
23
)
24
24
25
+
// MySQL84 contains error definitions that match MySQL 8.4 behavior and formatting
26
+
varMySQL84=struct {
27
+
// ErrForeignKeyChildViolation is the MySQL 8.4 compatible error format for foreign key child violations
28
+
ErrForeignKeyChildViolation*errors.Kind
29
+
}{
30
+
ErrForeignKeyChildViolation: errors.NewKind("cannot add or update a child row: a foreign key constraint fails (`%s`.`%s`, CONSTRAINT `%s` FOREIGN KEY (`%s`) REFERENCES `%s` (`%s`))"),
31
+
}
32
+
25
33
var (
26
34
// ErrSyntaxError is returned when a syntax error in vitess is encountered.
27
35
ErrSyntaxError=errors.NewKind("%s")
@@ -419,7 +427,7 @@ var (
419
427
ErrInsertIntoNonNullableProvidedNull=errors.NewKind("column name '%v' is non-nullable but attempted to set a value of null")
420
428
421
429
// ErrForeignKeyChildViolation is called when a rows is added but there is no parent row, and a foreign key constraint fails. Add the parent row first.
422
-
ErrForeignKeyChildViolation=errors.NewKind("cannot add or update a child row: a foreign key constraint fails (`%s`.`%s`, CONSTRAINT `%s` FOREIGN KEY (`%s`) REFERENCES `%s` (`%s`))")
430
+
ErrForeignKeyChildViolation=errors.NewKind("cannot add or update a child row - Foreign key violation on fk: `%s`, table: `%s`, referenced table: `%s`, key: `%s`")
423
431
424
432
// ErrForeignKeyParentViolation is called when a parent row that is deleted has children, and a foreign key constraint fails. Delete the children first.
425
433
ErrForeignKeyParentViolation=errors.NewKind("cannot delete or update a parent row - Foreign key violation on fk: `%s`, table: `%s`, referenced table: `%s`, key: `%s`")
0 commit comments