Skip to content

Commit 2a00abf

Browse files
author
Shlomi Noach
authored
Merge pull request #191 from github/sql-mode-strict
DML write sets sql_mode to STRICT ALL TABLES
2 parents dfc4d65 + 4c97218 commit 2a00abf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

go/logic/applier.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,10 @@ func (this *Applier) ApplyDMLEventQuery(dmlEvent *binlog.BinlogDMLEvent) error {
871871
if err != nil {
872872
return err
873873
}
874-
if _, err := tx.Exec("SET SESSION time_zone = '+00:00'"); err != nil {
874+
if _, err := tx.Exec(`SET
875+
SESSION time_zone = '+00:00',
876+
sql_mode = CONCAT(@@session.sql_mode, ',STRICT_ALL_TABLES')
877+
`); err != nil {
875878
return err
876879
}
877880
if _, err := tx.Exec(query, args...); err != nil {

0 commit comments

Comments
 (0)