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

*: add combination sql modes support(#4631) #4633

Merged
merged 4 commits into from Sep 28, 2017

Conversation

Projects
None yet
4 participants
@mccxj
Contributor

mccxj commented Sep 25, 2017

fixed issue #4631. add combination sql modes support.
see https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sql-mode-combo.

@sre-bot

This comment has been minimized.

Show comment
Hide comment
@sre-bot

sre-bot Sep 25, 2017

Hi contributor, thanks for your PR.

This patch needs to be approved by someone of admins. They should reply with "/ok-to-test" to accept this PR for running test automatically.

sre-bot commented Sep 25, 2017

Hi contributor, thanks for your PR.

This patch needs to be approved by someone of admins. They should reply with "/ok-to-test" to accept this PR for running test automatically.

@shenli

This comment has been minimized.

Show comment
Hide comment
@shenli

shenli Sep 25, 2017

Member

@mccxj Thanks for your PR!

Member

shenli commented Sep 25, 2017

@mccxj Thanks for your PR!

nonEmptyParts = append(nonEmptyParts, modePart)
existParts[modePart] = modePart
}
}

This comment has been minimized.

@shenli

shenli Sep 25, 2017

Member

Could we continue here?

@shenli

shenli Sep 25, 2017

Member

Could we continue here?

This comment has been minimized.

@coocood

coocood Sep 26, 2017

Member

No, the combination mode itself is added too.

@coocood

coocood Sep 26, 2017

Member

No, the combination mode itself is added too.

@coocood

This comment has been minimized.

Show comment
Hide comment
@coocood

coocood Sep 26, 2017

Member

@mccxj
Please fix CI.

Member

coocood commented Sep 26, 2017

@mccxj
Please fix CI.

@mccxj

This comment has been minimized.

Show comment
Hide comment
@mccxj

mccxj Sep 26, 2017

Contributor

A little change. fix SQLMode is set wrongly when sqlmode is invalid.

Origin:

tidb> insert into x2 select cast('999:44:33' as time);
ERROR 1292 (22007): Truncated incorrect time value: '999h44m33s'
tidb>set sql_mode=', ,';
ERROR 1105 (HY000): ERROR 1231 (42000): Variable 'sql_mode' can't be set to the value of ' '
tidb> insert into x2 select cast('999:44:33' as time);
Query OK, 1 row affected, 1 warning (0.00 sec)

Now:

tidb> insert into x2 select cast('999:44:33' as time);
ERROR 1292 (22007): Truncated incorrect time value: '999h44m33s'
tidb>set sql_mode=', ,';
ERROR 1105 (HY000): ERROR 1231 (42000): Variable 'sql_mode' can't be set to the value of ' '
tidb> insert into x2 select cast('999:44:33' as time);
ERROR 1292 (22007): Truncated incorrect time value: '999h44m33s'
Contributor

mccxj commented Sep 26, 2017

A little change. fix SQLMode is set wrongly when sqlmode is invalid.

Origin:

tidb> insert into x2 select cast('999:44:33' as time);
ERROR 1292 (22007): Truncated incorrect time value: '999h44m33s'
tidb>set sql_mode=', ,';
ERROR 1105 (HY000): ERROR 1231 (42000): Variable 'sql_mode' can't be set to the value of ' '
tidb> insert into x2 select cast('999:44:33' as time);
Query OK, 1 row affected, 1 warning (0.00 sec)

Now:

tidb> insert into x2 select cast('999:44:33' as time);
ERROR 1292 (22007): Truncated incorrect time value: '999h44m33s'
tidb>set sql_mode=', ,';
ERROR 1105 (HY000): ERROR 1231 (42000): Variable 'sql_mode' can't be set to the value of ' '
tidb> insert into x2 select cast('999:44:33' as time);
ERROR 1292 (22007): Truncated incorrect time value: '999h44m33s'
@coocood

This comment has been minimized.

Show comment
Hide comment
@coocood

coocood Sep 27, 2017

Member

@mccxj
Please add a test for invalid SQL mode.

Member

coocood commented Sep 27, 2017

@mccxj
Please add a test for invalid SQL mode.

@mccxj

This comment has been minimized.

Show comment
Hide comment
@mccxj

mccxj Sep 27, 2017

Contributor

@coocood testcase added. PTAL.

Contributor

mccxj commented Sep 27, 2017

@coocood testcase added. PTAL.

@coocood

This comment has been minimized.

Show comment
Hide comment
@coocood

coocood Sep 27, 2017

Member

LGTM
@mccxj
Thank you!

Member

coocood commented Sep 27, 2017

LGTM
@mccxj
Thank you!

@coocood coocood added the status/LGT1 label Sep 27, 2017

@shenli

This comment has been minimized.

Show comment
Hide comment
@shenli

shenli Sep 27, 2017

Member

LGTM

Member

shenli commented Sep 27, 2017

LGTM

@shenli

This comment has been minimized.

Show comment
Hide comment
@shenli

shenli Sep 27, 2017

Member

@mccxj Thanks!

Member

shenli commented Sep 27, 2017

@mccxj Thanks!

@shenli

This comment has been minimized.

Show comment
Hide comment
@shenli

shenli Sep 27, 2017

Member

/run-all-tests

Member

shenli commented Sep 27, 2017

/run-all-tests

@mccxj

This comment has been minimized.

Show comment
Hide comment
@mccxj

mccxj Sep 27, 2017

Contributor

@shenli Some test cases seem not very stable. eg. package "ddl".

Contributor

mccxj commented Sep 27, 2017

@shenli Some test cases seem not very stable. eg. package "ddl".

@mccxj mccxj changed the title from *: add combination sql modes support. fixed #4631 to *: add combination sql modes support(#4631) Sep 28, 2017

@shenli

This comment has been minimized.

Show comment
Hide comment
@shenli

shenli Sep 28, 2017

Member

@mccxj Yes, we will check it out. @zimulala

Member

shenli commented Sep 28, 2017

@mccxj Yes, we will check it out. @zimulala

@shenli shenli added status/LGT2 and removed status/LGT1 labels Sep 28, 2017

@shenli

shenli approved these changes Sep 28, 2017

@shenli shenli merged commit 2d0041e into pingcap:master Sep 28, 2017

5 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls First build on master at 72.64%
Details
jenkins-ci-tidb/build Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details

@mccxj mccxj deleted the mccxj:patch-issue-4631 branch Sep 28, 2017

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