Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-7624

Cannot query Oracle Table with VARCHAR2 data type

Details

    Description

      Hi,

      I managed to connect an Oracle Table using Connect and the following options:

      connect_work_size=2
      connect_type_conv=1
      optimizer_switch='engine_condition_pushdown=on' 

      Trying to do automatic discovery:

      MariaDB [daybreak_mariadb]> CREATE TABLE mytbl_oracle ENGINE=CONNECT TABLE_TYPE=ODBC tabname='mytbl' CONNECTION='DSN=db1;UID=user;PWD=pass';
      ERROR 1105 (HY000): Cannot get columns from mytbl
      MariaDB [daybreak_mariadb]> show errors;
      +-------+------+-------------------------------------------------------------------------------------+
      | Level | Code | Message |
      +-------+------+-------------------------------------------------------------------------------------+
      | Error | 1105 | Cannot get columns from mytbl                                                        |
      | Error | 1030 | Got error 122 "Internal (unspecified) error in handler" from storage engine CONNECT |
      +-------+------+-------------------------------------------------------------------------------------+
      2 rows in set (0.00 sec) 

      I know the columns, so I create the table manually (with varchar(xx))

      Then, SELECT * Doesn't work:

      ERROR 1296 (HY000): Got error 122 '[Oracle][ODBC]Error in assignment.' from CONNECT

      Manual select of non varchar2 columns works.

      I created a mapping table:

      MariaDB> create table mytbl_columns engine=connect table_type=ODBC tabname=mytbl
      catfunc=columns Connection='DSN=db1;UID=user;PWD=pass';

      Problematic column is on the following type:

      MariaDB [daybreak_mariadb]> select * from mytbl_columns where Column_Name='account';
      +-----------+--------------+------------+-------------+-----------+-----------+-------------+---------------+----------------+-------+---------- +---------+
      | Table_Cat | Table_Schema | Table_Name | Column_Name | Data_Type | Type_Name | Column_Size | Buffer_Length | Decimal_Digits | Radix | Nullable | Remarks | +-----------+--------------+------------+-------------+-----------+-----------+-------------+---------------+----------------+-------+---------- +---------+
      | |DB |mytbl |account 12|VARCHAR2 | 30| 30| 0| 0| 0| | +-----------+--------------+------------+-------------+-----------+-----------+-------------+---------------+----------------+-------+---------- +---------+

      Isn't there a mapping issue between varchar2 / oracle and varchar / mariadb ?

      Thanks,
      Joffrey

      Attachments

        Activity

          Transition Time In Source Status Execution Times
          Sergei Golubchik made transition -
          Open Closed
          2825d 23h 29m 1

          People

            bertrandop Olivier Bertrand
            joffrey Joffrey MICHAIE (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.