Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
None
-
None
-
None
Description
Create this table in Oracle:
[bar@home ~]$ sqlplus
|
SQL*Plus: Release 11.2.0.2.0 Production on Tue Nov 26 12:37:51 2013
|
Copyright (c) 1982, 2011, Oracle. All rights reserved.
|
Enter user-name: system
|
Enter password:
|
Connected to:
|
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
|
SQL> create table t1 (a int);
|
Table created.
|
SQL> insert into t1 values (10);
|
1 row created.
|
SQL> commit;
|
Commit complete.
|
Now create a ConnectSE ODBC table and try to SELECT from it.
It does not work:
mysql> drop table if exists t1; create table t1 engine=connect table_type=odbc connection='DSN=oraodbc;UID=system;PWD=manager' tabname='T1'; select * from t1;Query OK, 0 rows affected (0.00 sec)
|
|
Query OK, 0 rows affected (0.12 sec)
|
|
ERROR 1296 (HY000): Got error 122 '[Oracle][ODBC]SQL data type out of range <-25>.' from CONNECT
|
If the table structure is specified explicitly, it works fine:
mysql> drop table if exists t1; create table t1 (a int) engine=connect table_type=odbc connection='DSN=oraodbc;UID=system;PWD=manager' tabname='T1'; select * from t1;
|
Query OK, 0 rows affected (0.00 sec)
|
|
Query OK, 0 rows affected (0.06 sec)
|
|
+------+
|
| a |
|
+------+
|
| 10 |
|
+------+
|
1 row in set (0.05 sec)
|
Note, discovery works fine with VARCHAR columns.
Create this table on the Oracle side:
SQL> drop table t1;
|
Table dropped.
|
SQL> create table t1 (a varchar(10));
|
Table created.
|
SQL> insert into t1 values ('test');
|
1 row created.
|
SQL> commit;
|
Commit complete.
|
Now try to create an ODBC table on the Maria side and read from it:
mysql> drop table if exists t1; create table t1 engine=connect table_type=odbc connection='DSN=oraodbc;UID=system;PWD=manager' tabname='T1'; select * from t1;
|
Query OK, 0 rows affected (0.00 sec)
|
|
Query OK, 0 rows affected (0.13 sec)
|
|
+------+
|
| A |
|
+------+
|
| test |
|
+------+
|
1 row in set (0.06 sec)
|
Discovery should be fixed for the Oracle's INT data type.
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"
------
"", "SYSTEM", "T1", "A", 3, "DECIMAL", 38, 40, 0, 10, 1, "", "", 3, , 0, 1, "YES"
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.