[MDEV-5340] ConnectSE: discovery does not work well for Oracle's INT data type Created: 2013-11-26 Updated: 2013-12-29 Resolved: 2013-12-20 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 10.0.7 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Alexander Barkov | Assignee: | Olivier Bertrand |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Create this table in Oracle:
Now create a ConnectSE ODBC table and try to SELECT from it.
If the table structure is specified explicitly, it works fine:
Note, discovery works fine with VARCHAR columns.
Now try to create an ODBC table on the Maria side and read from it:
Discovery should be fixed for the Oracle's INT data type. |
| Comments |
| Comment by Olivier Bertrand [ 2013-12-20 ] |
|
After the table is created by: create table t1 (a int); the SQLColumns function (used also by Discovery) returns: "TABLE_CAT", "TABLE_SCHEM", "TABLE_NAME", "COLUMN_NAME", "DATA_TYPE", "TYPE_NAME", "COLUMN_SIZE", "BUFFER_LENGTH", "DECIMAL_DIGITS", "NUM_PREC_RADIX", "NULLABLE", "REMARKS", "COLUMN_DEF", "SQL_DATA_TYPE", "SQL_DATETIME_SUB", "CHAR_OCTET_LENGTH", "ORDINAL_POSITION", "IS_NULLABLE" 38 is too much for an integer, therefore CONNECT discovery now tests the length and if too big automatically change the column type from int to bigint. |
| Comment by Olivier Bertrand [ 2013-12-20 ] |
|
Even if the CONNECT table specifies "A bigint(38)" the error described above still occur when doing the select statement. |
| Comment by Olivier Bertrand [ 2013-12-20 ] |
|
The issue is that Oracle consider "int" as its "number" data type. This is a proprietary type in which numbers are coded internally up to 38 characters. Precision and Scale can be specified but default to 38 and 0. |
| Comment by Olivier Bertrand [ 2013-12-20 ] |
|
As 38 is also too big for BIGINT, connect now translates numeric types as: |
| Comment by Olivier Bertrand [ 2013-12-29 ] |
|
The last version of CONNECT was added the DECIMAL (TYPE_DECIM) type. |