Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mysql: add sql mode ALLOW_INVALID_DATES #171

Merged
merged 3 commits into from
Jan 14, 2019
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions mysql/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,11 @@ func (m SQLMode) HasNoAutoCreateUserMode() bool {
return m&ModeNoAutoCreateUser == ModeNoAutoCreateUser
}

// HasAllowInvalidDatesMode detects if 'ALLOW_INVALID_DATES' mode is set in SQLMode
func (m SQLMode) HasAllowInvalidDatesMode() bool {
return m&ModeAllowInvalidDates == ModeAllowInvalidDates
}

// consts for sql modes.
const (
ModeNone SQLMode = 0
Expand Down Expand Up @@ -546,6 +551,7 @@ const (
ModeHighNotPrecedence
ModeNoEngineSubstitution
ModePadCharToFullLength
ModeAllowInvalidDates
)

// FormatSQLModeStr re-format 'SQL_MODE' variable.
Expand Down Expand Up @@ -623,6 +629,7 @@ var Str2SQLMode = map[string]SQLMode{
"HIGH_NOT_PRECEDENCE": ModeHighNotPrecedence,
"NO_ENGINE_SUBSTITUTION": ModeNoEngineSubstitution,
"PAD_CHAR_TO_FULL_LENGTH": ModePadCharToFullLength,
"ALLOW_INVALID_DATES": ModeAllowInvalidDates,
}

// CombinationSQLMode is the special modes that provided as shorthand for combinations of mode values.
Expand Down