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

INFORMATION_SCHEMA.COLUMNS's PRECISION value for different type #7396

Closed
lysu opened this issue Aug 14, 2018 · 0 comments · Fixed by #7463
Closed

INFORMATION_SCHEMA.COLUMNS's PRECISION value for different type #7396

lysu opened this issue Aug 14, 2018 · 0 comments · Fixed by #7463
Assignees

Comments

@lysu
Copy link
Contributor

lysu commented Aug 14, 2018

  1. What did you do?
create table testprec(x decimal, y time, z datetime, e timestamp, f bit);
select * from INFORMATION_SCHEMA.COLUMNS where TABLE_NAMe = 'testprec'\G;
  1. What did you expect to see?
*************************** 1. row ***************************
           TABLE_CATALOG: def
            TABLE_SCHEMA: test
              TABLE_NAME: testprec
             COLUMN_NAME: x
       NUMERIC_PRECISION: 10
      DATETIME_PRECISION: NULL
   GENERATION_EXPRESSION: 
*************************** 2. row ***************************
           TABLE_CATALOG: def
            TABLE_SCHEMA: test
              TABLE_NAME: testprec
             COLUMN_NAME: y
       NUMERIC_PRECISION: NULL
      DATETIME_PRECISION: 0
   GENERATION_EXPRESSION: 
*************************** 3. row ***************************
           TABLE_CATALOG: def
            TABLE_SCHEMA: test
              TABLE_NAME: testprec
             COLUMN_NAME: z
       NUMERIC_PRECISION: NULL
      DATETIME_PRECISION: 0
   GENERATION_EXPRESSION: 
*************************** 4. row ***************************
           TABLE_CATALOG: def
            TABLE_SCHEMA: test
              TABLE_NAME: testprec
             COLUMN_NAME: e
       NUMERIC_PRECISION: NULL
      DATETIME_PRECISION: 0
   GENERATION_EXPRESSION: 
*************************** 5. row ***************************
           TABLE_CATALOG: def
            TABLE_SCHEMA: test
              TABLE_NAME: testprec
             COLUMN_NAME: f
       NUMERIC_PRECISION: 1
      DATETIME_PRECISION: NULL
   GENERATION_EXPRESSION: 
5 rows in set (0.00 sec)

  1. What did you see instead?
*************************** 1. row ***************************
           TABLE_CATALOG: def
            TABLE_SCHEMA: test
              TABLE_NAME: testprec
       NUMERIC_PRECISION: 0
      DATETIME_PRECISION: 0
   GENERATION_EXPRESSION: 
*************************** 2. row ***************************
           TABLE_CATALOG: def
            TABLE_SCHEMA: test
              TABLE_NAME: testprec
             COLUMN_NAME: y
       NUMERIC_PRECISION: 0
      DATETIME_PRECISION: 0
   GENERATION_EXPRESSION: 
*************************** 3. row ***************************
           TABLE_CATALOG: def
            TABLE_SCHEMA: test
              TABLE_NAME: testprec
             COLUMN_NAME: z
       NUMERIC_PRECISION: 0
      DATETIME_PRECISION: 0
      CHARACTER_SET_NAME: NULL
   GENERATION_EXPRESSION: 
*************************** 4. row ***************************
           TABLE_CATALOG: def
            TABLE_SCHEMA: test
              TABLE_NAME: testprec
             COLUMN_NAME: e
       NUMERIC_PRECISION: 0
      DATETIME_PRECISION: 0
   GENERATION_EXPRESSION: 
*************************** 5. row ***************************
           TABLE_CATALOG: def
            TABLE_SCHEMA: test
              TABLE_NAME: testprec
             COLUMN_NAME: f
       NUMERIC_PRECISION: 0
      DATETIME_PRECISION: 0
   GENERATION_EXPRESSION: 
5 rows in set (0.03 sec)
  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
@shenli shenli added the good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. label Aug 15, 2018
@lysu lysu self-assigned this Aug 21, 2018
@lysu lysu removed the good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. label Aug 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants