Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-8179

Default value of ('SYS_CONTEXT('TMCTX', 'column')') is not correctly emitted in Oracle change event

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • Backlog
    • 2.7.1.Final
    • oracle-connector
    • None
    • False
    • None
    • False

      Bug report

      • Oracle flow:

      Example oracle table: 
      With default column a function: SYS_CONTEXT('TMCTX', 'CONTEXT_VALUE')

      //create table
      CREATE TABLE oracle_table {
         COL1 NUMBER
         COL2 DEFAULT 'SYS_CONTEXT('TMCTX', 'CONTEXT_VALUE')'
      }
      //set context
      begin TMProc('CONTEXT_VALUE', 'test_value'); end;
      //insert into table that will take default value
      INSERT INTO oracle_table (COL1) VALUES (1);
      

      //select value

      SELECT * FROM oracle_table;
      COL1 COL2
          1 test_value

      What behavior do you see?

      • Debezium and Kafka:

      In debezium it looks like this in payload for COL2
         

      "schema": {
              "type": "struct",
              "fields": [
                  {
                      "type": "string",
                      "optional": false,
                      "field": "COL1"
                  },
                  {
                      "type": "string",
                      "optional": true,
                      "default": "sys_context('TMCtx', 'CONTEXT_VALUE')",
                      "field": "COL2"
                  }
          "payload": {
              "COL1": "1",
              "COL2": "sys_context('TMCtx', 'CONTEXT_VALUE')",
              "__deleted": "false",
              "__op": "c",
              "__table": "ORACLE_TABLE"
          }
      }
      

      In debezium it looks like this in payload for COL2
      **

      What behavior do you expect?

      **
         Expected in payload to have the actual value: test_value

          "payload": {
              "COL1": "1",
              "COL2": "test_value",
              "__deleted": "false",
              "__op": "c",
              "__table": "ORACLE_TABLE"
          }
      

      What Debezium connector do you use and what version?

       * "class"*: "io.debezium.connector.oracle.OracleConnector",

       * "type"*: "source",

       * "version"*: "2.7.1.Final"

              Unassigned Unassigned
              bogdan.risco Bogdan Risco
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: