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

SQL: TIME and DATE types metadata attributes corrections #41086

Closed
bpintea opened this issue Apr 10, 2019 · 5 comments · Fixed by #55316
Closed

SQL: TIME and DATE types metadata attributes corrections #41086

bpintea opened this issue Apr 10, 2019 · 5 comments · Fixed by #55316
Assignees
Labels

Comments

@bpintea
Copy link
Contributor

bpintea commented Apr 10, 2019

The values returned by SYS TYPES for the time data types needs adjusting for the following attributes: MINIMUM_SCALE, MAXIMUM_SCALE and SQL_DATETIME_SUB as follows:

  • the DATE and TIME must have the values swapped for MINIMUM_SCALE and MAXIMUM_SCALE attributes (since DATE has no seconds component);
  • SQL_DATETIME_SUB must have these subcode values:
    • for DATE: 1;
    • for TIME: 2.

Current values (for convenience):

        TYPE_NAME        |   DATA_TYPE   |   PRECISION   |LITERAL_PREFIX |LITERAL_SUFFIX | CREATE_PARAMS |   NULLABLE    |CASE_SENSITIVE |  SEARCHABLE   |UNSIGNED_ATTRIBUTE|FIXED_PREC_SCALE|AUTO_INCREMENT |LOCAL_TYPE_NAME| MINIMUM_SCALE | MAXIMUM_SCALE | SQL_DATA_TYPE |SQL_DATETIME_SUB|NUM_PREC_RADIX |INTERVAL_PRECISION
-------------------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+------------------+----------------+---------------+---------------+---------------+---------------+---------------+----------------+---------------+------------------
DATE                     |91             |29             |'              |'              |null           |2              |false          |3              |true              |false           |false          |null           |3              |3              |91             |0               |null           |null              
TIME                     |92             |18             |'              |'              |null           |2              |false          |3              |true              |false           |false          |null           |null           |null           |92             |0               |null           |null              
DATETIME                 |93             |29             |'              |'              |null           |2              |false          |3              |true              |false           |false          |null           |3              |3              |9              |3               |null           |null              

@bpintea bpintea added the :Analytics/SQL SQL querying label Apr 10, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

@ithompson4
Copy link

Could I work on this? Thanks.

@matriv
Copy link
Contributor

matriv commented Apr 16, 2019

@matriv
Copy link
Contributor

matriv commented Apr 16, 2020

Fixed by #55316

@matriv matriv closed this as completed Apr 16, 2020
matriv added a commit that referenced this issue Apr 16, 2020
Fix MINIMUM_SCALE, MAXIMUM_SCALE and SQL_DATETIME_SUB
ODBC metadata for the DATE & TIME data types.

Fixes: #41086

(cherry picked from commit c23677c)
matriv added a commit that referenced this issue Apr 16, 2020
Fix MINIMUM_SCALE, MAXIMUM_SCALE and SQL_DATETIME_SUB
ODBC metadata for the DATE & TIME data types.

Fixes: #41086
(cherry picked from commit c23677c)
@matriv
Copy link
Contributor

matriv commented Apr 16, 2020

master : c23677c
7.x : 8abdf7c
7.7 : 736b8a8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants