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

plan: refine return type, charset and collation for 'get variable' expression #4550

Merged
merged 9 commits into from Sep 19, 2017

Conversation

Projects
None yet
5 participants
@spongedu
Contributor

spongedu commented Sep 18, 2017

TiDB do not correctly set return-type, charset and collation when executin sql like select @@xxx.
For example:
In MySQL:

mysql> select @@sql_mode;
Field   1:  `@@sql_mode`
Catalog:    `def`
Database:   ``
Table:      ``
Org_table:  ``
Type:       VAR_STRING
Collation:  utf8_general_ci (33)
Length:     45
Max_length: 15
Decimals:   31
Flags:


+-----------------+
| @@sql_mode      |
+-----------------+
| NO_ZERO_IN_DATE |
+-----------------+
1 row in set (0.01 sec)

In TiDB:

tidb> select @@sql_mode;
Field   1:  `@@sql_mode`
Catalog:    `def`
Database:   ``
Table:      ``
Org_table:  ``
Type:       STRING
Collation:  ? (0)
Length:     0
Max_length: 42
Decimals:   31
Flags:


+--------------------------------------------+
| @@sql_mode                                 |
+--------------------------------------------+
| STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION |
+--------------------------------------------+
1 row in set (0.00 sec)
@sre-bot

This comment has been minimized.

Show comment
Hide comment
@sre-bot

sre-bot Sep 18, 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 18, 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.

@coocood

LGTM

coocood and others added some commits Sep 19, 2017

@zz-jason zz-jason added status/LGT2 and removed status/LGT1 labels Sep 19, 2017

@coocood coocood merged commit 8794374 into pingcap:master Sep 19, 2017

3 of 4 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
ci/circleci Your tests passed on CircleCI!
Details
jenkins-ci-tidb/build Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment