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
@@ -23,6 +23,14 @@ import (
23
23
"gopkg.in/src-d/go-errors.v1"
24
24
)
25
25
26
+
// MySQL84 contains error definitions that match MySQL 8.4 behavior and formatting
27
+
varMySQL84=struct {
28
+
// ErrForeignKeyChildViolation is the MySQL 8.4 compatible error format for foreign key child violations
29
+
ErrForeignKeyChildViolation*errors.Kind
30
+
}{
31
+
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`))"),
32
+
}
33
+
26
34
var (
27
35
// ErrSyntaxError is returned when a syntax error in vitess is encountered.
28
36
ErrSyntaxError=errors.NewKind("%s")
@@ -420,7 +428,7 @@ var (
420
428
ErrInsertIntoNonNullableProvidedNull=errors.NewKind("column name '%v' is non-nullable but attempted to set a value of null")
421
429
422
430
// 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.
423
-
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`))")
431
+
ErrForeignKeyChildViolation=errors.NewKind("cannot add or update a child row - Foreign key violation on fk: `%s`, table: `%s`, referenced table: `%s`, key: `%s`")
424
432
425
433
// ErrForeignKeyParentViolation is called when a parent row that is deleted has children, and a foreign key constraint fails. Delete the children first.
426
434
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