Skip to content

DML write sets sql_mode to STRICT ALL TABLES - #191

Merged
shlomi-noach merged 2 commits into
masterfrom
sql-mode-strict
Aug 25, 2016
Merged

shlomi-noach merged 2 commits into
masterfrom
sql-mode-strict

Conversation

@shlomi-noach

@shlomi-noach shlomi-noach commented Aug 23, 2016 •

Copy link
Copy Markdown
Contributor

Storyline: #164

Each DML write forces session sql_mode to STRICT_ALL_TABLES.

This serves as a safety net in case the server's sql_mode is not strict. gh-ost's mode should be strict because it just copies values around, so there should not be any case where data is truncated.

On interesting potential case is if the user reduces BIGINT to INT, or VARCHAR(128) to VARCHAR(64), for example, and some existing values do not fit in reduced column size.
This PR will assist the user in avoiding shooting herself in the foot.

  • contributed code is using same conventions as original code
  • code is formatted via gofmt (please avoid goimports)
  • code is built via ./build.sh
  • code is tested via ./test.sh

@shlomi-noach

Copy link
Copy Markdown
Contributor Author

Sent to testing

@shlomi-noach

Copy link
Copy Markdown
Contributor Author

Testing goes well. Merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant