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

Getting error ORA-12899: value too large for column inserting from MariaDB to Oracle

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: In Progress (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 10.0
    • Fix Version/s: 10.2, 10.3, 10.4, 10.5
    • Labels:
      None
    • Environment:
      10.0.20-MariaDB-log
      RedHat Linux
      Oracle Enterprise Edition 11.2.0.4

      Description

      From MariaDB inserting into Oracle table using linked table.
      No matter what, Oracle thinks source table in MariaDB has one more character than target in Oracle. Details below:
      Oracle:

      drop table simple;
      create table simple (col1 varchar2(5), col2 number);
      insert into simple values ('A', 199);
      select * from simple;
      commit;

      MariaDB:

      describe simple_link
      --------------
       
      Field   Type    Null    Key     Default Extra
      COL1    varchar(5)      YES             NULL
      COL2    double(40,0)    YES             NULL
       
      ERROR 1296 (HY000) at line 5 in file: 'simple.sql': Got error 122 'SQLExecute: [unixODBC][Oracle][ODBC][Ora]ORA-12899: value too large for column "SOE"."SIMPLE"."COL1" (actual: 6, maximum: 5)
      ' from CONNECT

      Fixed by redefining table simple in Oracle to length of 6:
      create table simple (col1 varchar2(6), col2 number);

      Able to insert from MariaDB to Oracle.

      --------------
      select * from simple_link
      --------------
       
      COL1    COL2
      A       199
      --------------
      insert into simple_link values ("B", 299)
      --------------
       
      --------------
      select * from simple_link
      --------------
       
      COL1    COL2
      B       299
      A       199

        Attachments

          Activity

            People

            Assignee:
            bertrandop Olivier Bertrand
            Reporter:
            aferrett Andy Ferretti
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:

                Git Integration

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