Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-10764 PL/SQL parser - Phase 2
  3. MDEV-10589

sql_mode=ORACLE: LOG ERRORS clause in INSERT, DELETE, UPDATE

Details

    • Technical task
    • Status: Stalled (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • None
    • OTHER

    Description

      When running in sql_mode=ORACLE, MariaDB will understand an optional LOG ERRORS clause with this syntax:

      LOG ERRORS
        [INTO [schema.]table]
        [('simple_expression')] 
        [REJECT LIMIT integer|UNLIMITED]
      

      Example:

      DELETE FROM t1
        LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1;
       
      INSERT INTO t1 (a,b,c) SELECT a,b,c FROM t2
        LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1
      

      LOG ERRORS is used for two purposes:
      1. For actual logging of errors
      2. To change transaction error handling behavior. By default, when a DML statement fails on some row (e.g. due to a CONSTRAINT check, the whole statement is rolled back, regardless of how many rows were processed successfully before the error was detected. The REJECT LIMIT clause specifies the maximum number of errors before the statement fails.

      If the INTO clause is omitted, then logging is done to the table ERR$_table, where table is the name of the subject table truncated to 25 characters.

      The log table must be created, either manually, or using a special stored procedure DBMS_ERRLOG.create_error_log. The log table have the following mandatory columns:

      CREATE TABLE ERR$_T1
      (
        ORA_ERR_NUMBER$ NUMBER,
        ORA_ERR_MESG$   VARCHAR2(2000),
        ORA_ERR_ROWID$  ROWID,
        ORA_ERR_OPTYP$  VARCHAR2(2),
        ORA_ERR_TAG$    VARCHAR2(2000)
      );
      

      If the REJECT clause is omitted, then LIMIT is set to 0 by default, which means the traditional transaction behavior, i.e. rollback on errors.

      Example:

      Preparations

      DROP TABLE err$_t1;
      BEGIN
        DBMS_ERRLOG.create_error_log (dml_table_name => 't1');
      END;
      /
      DROP TABLE t1;
      CREATE TABLE t1 (a INT PRIMARY KEY);
      INSERT INTO t1 VALUES (10);
      

      Testing LOG ERRORS REJECT LIMIT 1

      Now I insert a row which would normally raise a "err_dup_key" exception:

      INSERT INTO t1 VALUES (10) LOG ERRORS REJECT LIMIT 1;
      

      0 rows created.
      

      Notice, no exceptions were raised, and a record in err$_t1 was created instead:

      SELECT ORA_ERR_NUMBER$,ORA_ERR_MESG$ FROM err$_t1;
      

      ORA_ERR_NUMBER$
      ---------------
      ORA_ERR_MESG$
      --------------------------------------------------------------------------------
      	      1
      ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
      

      Testing LOG ERRORS with no REJECT LIMIT clause.

      DELETE FROM err$_t1;
      INSERT INTO t1 VALUES (10) LOG ERRORS;
      

      ERROR at line 1:
      ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
      

      SELECT ORA_ERR_NUMBER$,ORA_ERR_MESG$ FROM err$_t1;
      

      ORA_ERR_NUMBER$
      ---------------
      ORA_ERR_MESG$
      --------------------------------------------------------------------------------
      	      1
      ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
      

      Attachments

        Activity

          bar Alexander Barkov created issue -
          bar Alexander Barkov made changes -
          Field Original Value New Value
          Description When running in {{sql_mode=ORACLE}}, MariaDB will understand an optional {{LOG ERRORS}} clause with this syntax:
          {code:sql}
          LOG ERRORS [INTO [schema.]table] [('simple_expression')] [REJECT LIMIT integer|UNLIMITED]
          {code}

          Example:
          {code:sql}
          DELETE FROM t1
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1;

          INSERT INTO t1 (a,b,c) SELECT a,b,c FROM t2
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1
          {code}
          When running in {{sql_mode=ORACLE}}, MariaDB will understand an optional {{LOG ERRORS}} clause with this syntax:
          {code:sql}
          LOG ERRORS
            [INTO [schema.]table]
            [('simple_expression')]
            [REJECT LIMIT integer|UNLIMITED]
          {code}

          Example:
          {code:sql}
          DELETE FROM t1
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1;

          INSERT INTO t1 (a,b,c) SELECT a,b,c FROM t2
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1
          {code}
          bar Alexander Barkov made changes -
          Description When running in {{sql_mode=ORACLE}}, MariaDB will understand an optional {{LOG ERRORS}} clause with this syntax:
          {code:sql}
          LOG ERRORS
            [INTO [schema.]table]
            [('simple_expression')]
            [REJECT LIMIT integer|UNLIMITED]
          {code}

          Example:
          {code:sql}
          DELETE FROM t1
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1;

          INSERT INTO t1 (a,b,c) SELECT a,b,c FROM t2
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1
          {code}
          When running in {{sql_mode=ORACLE}}, MariaDB will understand an optional {{LOG ERRORS}} clause with this syntax:
          {code:sql}
          LOG ERRORS
            [INTO [schema.]table]
            [('simple_expression')]
            [REJECT LIMIT integer|UNLIMITED]
          {code}

          Example:
          {code:sql}
          DELETE FROM t1
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1;

          INSERT INTO t1 (a,b,c) SELECT a,b,c FROM t2
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1
          {code}

          {{LOG ERRORS}} is used for two purposes:
          1. For actual logging of errors
          2. To change transaction error handling behavior. By default, when a DML statement fails on some row (e.g. due to a {{CONSTRAINT}} check, the whole statement is rolled back, regardless of how many rows were processed successfully before the error was detected. The {{REJECT LIMIT}} clause specifies the maximum number of errors before the statement fails.
          monty Michael Widenius made changes -
          monty Michael Widenius made changes -
          monty Michael Widenius made changes -
          Parent MDEV-10142 [ 56873 ]
          Issue Type Task [ 3 ] Technical task [ 7 ]
          alvinr Alvin Richards (Inactive) made changes -
          Labels Compatibility
          alvinr Alvin Richards (Inactive) made changes -
          Labels Compatibility

          For the first version, lets concentrate on LIMIT 1.
          The reason for this is to not have to change all loops in the server to be able to handle more than one error.

          We can probably reuse the code that provides general logging to tables by installing a temporary error handler for the user.

          monty Michael Widenius added a comment - For the first version, lets concentrate on LIMIT 1. The reason for this is to not have to change all loops in the server to be able to handle more than one error. We can probably reuse the code that provides general logging to tables by installing a temporary error handler for the user.
          alvinr Alvin Richards (Inactive) made changes -
          Labels Compatibility
          alvinr Alvin Richards (Inactive) made changes -
          Labels Compatibility
          serg Sergei Golubchik made changes -
          Labels Compatibility
          alvinr Alvin Richards (Inactive) made changes -
          Labels Compatibility Compatibility NRE-307517
          bar Alexander Barkov made changes -
          Description When running in {{sql_mode=ORACLE}}, MariaDB will understand an optional {{LOG ERRORS}} clause with this syntax:
          {code:sql}
          LOG ERRORS
            [INTO [schema.]table]
            [('simple_expression')]
            [REJECT LIMIT integer|UNLIMITED]
          {code}

          Example:
          {code:sql}
          DELETE FROM t1
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1;

          INSERT INTO t1 (a,b,c) SELECT a,b,c FROM t2
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1
          {code}

          {{LOG ERRORS}} is used for two purposes:
          1. For actual logging of errors
          2. To change transaction error handling behavior. By default, when a DML statement fails on some row (e.g. due to a {{CONSTRAINT}} check, the whole statement is rolled back, regardless of how many rows were processed successfully before the error was detected. The {{REJECT LIMIT}} clause specifies the maximum number of errors before the statement fails.
          When running in {{sql_mode=ORACLE}}, MariaDB will understand an optional {{LOG ERRORS}} clause with this syntax:
          {code:sql}
          LOG ERRORS
            [INTO [schema.]table]
            [('simple_expression')]
            [REJECT LIMIT integer|UNLIMITED]
          {code}

          Example:
          {code:sql}
          DELETE FROM t1
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1;

          INSERT INTO t1 (a,b,c) SELECT a,b,c FROM t2
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1
          {code}

          {{LOG ERRORS}} is used for two purposes:
          1. For actual logging of errors
          2. To change transaction error handling behavior. By default, when a DML statement fails on some row (e.g. due to a {{CONSTRAINT}} check, the whole statement is rolled back, regardless of how many rows were processed successfully before the error was detected. The {{REJECT LIMIT}} clause specifies the maximum number of errors before the statement fails.

          Example:
          {code:sql}
          DROP TABLE err$_t1;
          BEGIN
            DBMS_ERRLOG.create_error_log (dml_table_name => 't1');
          END;
          /
          DROP TABLE t1;
          CREATE TABLE t1 (a INT PRIMARY KEY);
          INSERT INTO t1 VALUES (10);
          {code}

          Now I insert a row which would normally raise a "err_dup_key" exception:
          {code:sql}
          INSERT INTO t1 VALUES (10) LOG ERRORS REJECT LIMIT 1;
          {code}
          {noformat}
          0 rows created.
          {noformat}

          Notice, no exceptions were raised.
          bar Alexander Barkov made changes -
          Description When running in {{sql_mode=ORACLE}}, MariaDB will understand an optional {{LOG ERRORS}} clause with this syntax:
          {code:sql}
          LOG ERRORS
            [INTO [schema.]table]
            [('simple_expression')]
            [REJECT LIMIT integer|UNLIMITED]
          {code}

          Example:
          {code:sql}
          DELETE FROM t1
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1;

          INSERT INTO t1 (a,b,c) SELECT a,b,c FROM t2
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1
          {code}

          {{LOG ERRORS}} is used for two purposes:
          1. For actual logging of errors
          2. To change transaction error handling behavior. By default, when a DML statement fails on some row (e.g. due to a {{CONSTRAINT}} check, the whole statement is rolled back, regardless of how many rows were processed successfully before the error was detected. The {{REJECT LIMIT}} clause specifies the maximum number of errors before the statement fails.

          Example:
          {code:sql}
          DROP TABLE err$_t1;
          BEGIN
            DBMS_ERRLOG.create_error_log (dml_table_name => 't1');
          END;
          /
          DROP TABLE t1;
          CREATE TABLE t1 (a INT PRIMARY KEY);
          INSERT INTO t1 VALUES (10);
          {code}

          Now I insert a row which would normally raise a "err_dup_key" exception:
          {code:sql}
          INSERT INTO t1 VALUES (10) LOG ERRORS REJECT LIMIT 1;
          {code}
          {noformat}
          0 rows created.
          {noformat}

          Notice, no exceptions were raised.
          When running in {{sql_mode=ORACLE}}, MariaDB will understand an optional {{LOG ERRORS}} clause with this syntax:
          {code:sql}
          LOG ERRORS
            [INTO [schema.]table]
            [('simple_expression')]
            [REJECT LIMIT integer|UNLIMITED]
          {code}

          Example:
          {code:sql}
          DELETE FROM t1
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1;

          INSERT INTO t1 (a,b,c) SELECT a,b,c FROM t2
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1
          {code}

          {{LOG ERRORS}} is used for two purposes:
          1. For actual logging of errors
          2. To change transaction error handling behavior. By default, when a DML statement fails on some row (e.g. due to a {{CONSTRAINT}} check, the whole statement is rolled back, regardless of how many rows were processed successfully before the error was detected. The {{REJECT LIMIT}} clause specifies the maximum number of errors before the statement fails.

          Example:
          {code:sql}
          DROP TABLE err$_t1;
          BEGIN
            DBMS_ERRLOG.create_error_log (dml_table_name => 't1');
          END;
          /
          DROP TABLE t1;
          CREATE TABLE t1 (a INT PRIMARY KEY);
          INSERT INTO t1 VALUES (10);
          {code}

          Now I insert a row which would normally raise a "err_dup_key" exception:
          {code:sql}
          INSERT INTO t1 VALUES (10) LOG ERRORS REJECT LIMIT 1;
          {code}
          {noformat}
          0 rows created.
          {noformat}

          Notice, no exceptions were raised, and a recod in {{err$_t1}} was created instead:
          {code:sql}
          SELECT ORA_ERR_NUMBER$,ORA_ERR_MESG$ FROM err$_t1;
          {code}
          {noformat}
          ORA_ERR_NUMBER$
          ---------------
          ORA_ERR_MESG$
          --------------------------------------------------------------------------------
          1
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}


          bar Alexander Barkov made changes -
          Description When running in {{sql_mode=ORACLE}}, MariaDB will understand an optional {{LOG ERRORS}} clause with this syntax:
          {code:sql}
          LOG ERRORS
            [INTO [schema.]table]
            [('simple_expression')]
            [REJECT LIMIT integer|UNLIMITED]
          {code}

          Example:
          {code:sql}
          DELETE FROM t1
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1;

          INSERT INTO t1 (a,b,c) SELECT a,b,c FROM t2
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1
          {code}

          {{LOG ERRORS}} is used for two purposes:
          1. For actual logging of errors
          2. To change transaction error handling behavior. By default, when a DML statement fails on some row (e.g. due to a {{CONSTRAINT}} check, the whole statement is rolled back, regardless of how many rows were processed successfully before the error was detected. The {{REJECT LIMIT}} clause specifies the maximum number of errors before the statement fails.

          Example:
          {code:sql}
          DROP TABLE err$_t1;
          BEGIN
            DBMS_ERRLOG.create_error_log (dml_table_name => 't1');
          END;
          /
          DROP TABLE t1;
          CREATE TABLE t1 (a INT PRIMARY KEY);
          INSERT INTO t1 VALUES (10);
          {code}

          Now I insert a row which would normally raise a "err_dup_key" exception:
          {code:sql}
          INSERT INTO t1 VALUES (10) LOG ERRORS REJECT LIMIT 1;
          {code}
          {noformat}
          0 rows created.
          {noformat}

          Notice, no exceptions were raised, and a recod in {{err$_t1}} was created instead:
          {code:sql}
          SELECT ORA_ERR_NUMBER$,ORA_ERR_MESG$ FROM err$_t1;
          {code}
          {noformat}
          ORA_ERR_NUMBER$
          ---------------
          ORA_ERR_MESG$
          --------------------------------------------------------------------------------
          1
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}


          When running in {{sql_mode=ORACLE}}, MariaDB will understand an optional {{LOG ERRORS}} clause with this syntax:
          {code:sql}
          LOG ERRORS
            [INTO [schema.]table]
            [('simple_expression')]
            [REJECT LIMIT integer|UNLIMITED]
          {code}

          Example:
          {code:sql}
          DELETE FROM t1
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1;

          INSERT INTO t1 (a,b,c) SELECT a,b,c FROM t2
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1
          {code}

          {{LOG ERRORS}} is used for two purposes:
          1. For actual logging of errors
          2. To change transaction error handling behavior. By default, when a DML statement fails on some row (e.g. due to a {{CONSTRAINT}} check, the whole statement is rolled back, regardless of how many rows were processed successfully before the error was detected. The {{REJECT LIMIT}} clause specifies the maximum number of errors before the statement fails.

          h2 Example:
          {code:sql}
          DROP TABLE err$_t1;
          BEGIN
            DBMS_ERRLOG.create_error_log (dml_table_name => 't1');
          END;
          /
          DROP TABLE t1;
          CREATE TABLE t1 (a INT PRIMARY KEY);
          INSERT INTO t1 VALUES (10);
          {code}

          Now I insert a row which would normally raise a "err_dup_key" exception:
          {code:sql}
          INSERT INTO t1 VALUES (10) LOG ERRORS REJECT LIMIT 1;
          {code}
          {noformat}
          0 rows created.
          {noformat}

          Notice, no exceptions were raised, and a recod in {{err$_t1}} was created instead:
          {code:sql}
          SELECT ORA_ERR_NUMBER$,ORA_ERR_MESG$ FROM err$_t1;
          {code}
          {noformat}
          ORA_ERR_NUMBER$
          ---------------
          ORA_ERR_MESG$
          --------------------------------------------------------------------------------
          1
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}


          bar Alexander Barkov made changes -
          Description When running in {{sql_mode=ORACLE}}, MariaDB will understand an optional {{LOG ERRORS}} clause with this syntax:
          {code:sql}
          LOG ERRORS
            [INTO [schema.]table]
            [('simple_expression')]
            [REJECT LIMIT integer|UNLIMITED]
          {code}

          Example:
          {code:sql}
          DELETE FROM t1
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1;

          INSERT INTO t1 (a,b,c) SELECT a,b,c FROM t2
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1
          {code}

          {{LOG ERRORS}} is used for two purposes:
          1. For actual logging of errors
          2. To change transaction error handling behavior. By default, when a DML statement fails on some row (e.g. due to a {{CONSTRAINT}} check, the whole statement is rolled back, regardless of how many rows were processed successfully before the error was detected. The {{REJECT LIMIT}} clause specifies the maximum number of errors before the statement fails.

          h2 Example:
          {code:sql}
          DROP TABLE err$_t1;
          BEGIN
            DBMS_ERRLOG.create_error_log (dml_table_name => 't1');
          END;
          /
          DROP TABLE t1;
          CREATE TABLE t1 (a INT PRIMARY KEY);
          INSERT INTO t1 VALUES (10);
          {code}

          Now I insert a row which would normally raise a "err_dup_key" exception:
          {code:sql}
          INSERT INTO t1 VALUES (10) LOG ERRORS REJECT LIMIT 1;
          {code}
          {noformat}
          0 rows created.
          {noformat}

          Notice, no exceptions were raised, and a recod in {{err$_t1}} was created instead:
          {code:sql}
          SELECT ORA_ERR_NUMBER$,ORA_ERR_MESG$ FROM err$_t1;
          {code}
          {noformat}
          ORA_ERR_NUMBER$
          ---------------
          ORA_ERR_MESG$
          --------------------------------------------------------------------------------
          1
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}


          When running in {{sql_mode=ORACLE}}, MariaDB will understand an optional {{LOG ERRORS}} clause with this syntax:
          {code:sql}
          LOG ERRORS
            [INTO [schema.]table]
            [('simple_expression')]
            [REJECT LIMIT integer|UNLIMITED]
          {code}

          Example:
          {code:sql}
          DELETE FROM t1
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1;

          INSERT INTO t1 (a,b,c) SELECT a,b,c FROM t2
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1
          {code}

          {{LOG ERRORS}} is used for two purposes:
          1. For actual logging of errors
          2. To change transaction error handling behavior. By default, when a DML statement fails on some row (e.g. due to a {{CONSTRAINT}} check, the whole statement is rolled back, regardless of how many rows were processed successfully before the error was detected. The {{REJECT LIMIT}} clause specifies the maximum number of errors before the statement fails.

          .h2 Example:
          {code:sql}
          DROP TABLE err$_t1;
          BEGIN
            DBMS_ERRLOG.create_error_log (dml_table_name => 't1');
          END;
          /
          DROP TABLE t1;
          CREATE TABLE t1 (a INT PRIMARY KEY);
          INSERT INTO t1 VALUES (10);
          {code}

          Now I insert a row which would normally raise a "err_dup_key" exception:
          {code:sql}
          INSERT INTO t1 VALUES (10) LOG ERRORS REJECT LIMIT 1;
          {code}
          {noformat}
          0 rows created.
          {noformat}

          Notice, no exceptions were raised, and a recod in {{err$_t1}} was created instead:
          {code:sql}
          SELECT ORA_ERR_NUMBER$,ORA_ERR_MESG$ FROM err$_t1;
          {code}
          {noformat}
          ORA_ERR_NUMBER$
          ---------------
          ORA_ERR_MESG$
          --------------------------------------------------------------------------------
          1
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}


          bar Alexander Barkov made changes -
          Description When running in {{sql_mode=ORACLE}}, MariaDB will understand an optional {{LOG ERRORS}} clause with this syntax:
          {code:sql}
          LOG ERRORS
            [INTO [schema.]table]
            [('simple_expression')]
            [REJECT LIMIT integer|UNLIMITED]
          {code}

          Example:
          {code:sql}
          DELETE FROM t1
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1;

          INSERT INTO t1 (a,b,c) SELECT a,b,c FROM t2
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1
          {code}

          {{LOG ERRORS}} is used for two purposes:
          1. For actual logging of errors
          2. To change transaction error handling behavior. By default, when a DML statement fails on some row (e.g. due to a {{CONSTRAINT}} check, the whole statement is rolled back, regardless of how many rows were processed successfully before the error was detected. The {{REJECT LIMIT}} clause specifies the maximum number of errors before the statement fails.

          .h2 Example:
          {code:sql}
          DROP TABLE err$_t1;
          BEGIN
            DBMS_ERRLOG.create_error_log (dml_table_name => 't1');
          END;
          /
          DROP TABLE t1;
          CREATE TABLE t1 (a INT PRIMARY KEY);
          INSERT INTO t1 VALUES (10);
          {code}

          Now I insert a row which would normally raise a "err_dup_key" exception:
          {code:sql}
          INSERT INTO t1 VALUES (10) LOG ERRORS REJECT LIMIT 1;
          {code}
          {noformat}
          0 rows created.
          {noformat}

          Notice, no exceptions were raised, and a recod in {{err$_t1}} was created instead:
          {code:sql}
          SELECT ORA_ERR_NUMBER$,ORA_ERR_MESG$ FROM err$_t1;
          {code}
          {noformat}
          ORA_ERR_NUMBER$
          ---------------
          ORA_ERR_MESG$
          --------------------------------------------------------------------------------
          1
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}


          When running in {{sql_mode=ORACLE}}, MariaDB will understand an optional {{LOG ERRORS}} clause with this syntax:
          {code:sql}
          LOG ERRORS
            [INTO [schema.]table]
            [('simple_expression')]
            [REJECT LIMIT integer|UNLIMITED]
          {code}

          Example:
          {code:sql}
          DELETE FROM t1
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1;

          INSERT INTO t1 (a,b,c) SELECT a,b,c FROM t2
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1
          {code}

          {{LOG ERRORS}} is used for two purposes:
          1. For actual logging of errors
          2. To change transaction error handling behavior. By default, when a DML statement fails on some row (e.g. due to a {{CONSTRAINT}} check, the whole statement is rolled back, regardless of how many rows were processed successfully before the error was detected. The {{REJECT LIMIT}} clause specifies the maximum number of errors before the statement fails.

          h2. Example:
          {code:sql}
          DROP TABLE err$_t1;
          BEGIN
            DBMS_ERRLOG.create_error_log (dml_table_name => 't1');
          END;
          /
          DROP TABLE t1;
          CREATE TABLE t1 (a INT PRIMARY KEY);
          INSERT INTO t1 VALUES (10);
          {code}

          Now I insert a row which would normally raise a "err_dup_key" exception:
          {code:sql}
          INSERT INTO t1 VALUES (10) LOG ERRORS REJECT LIMIT 1;
          {code}
          {noformat}
          0 rows created.
          {noformat}

          Notice, no exceptions were raised, and a recod in {{err$_t1}} was created instead:
          {code:sql}
          SELECT ORA_ERR_NUMBER$,ORA_ERR_MESG$ FROM err$_t1;
          {code}
          {noformat}
          ORA_ERR_NUMBER$
          ---------------
          ORA_ERR_MESG$
          --------------------------------------------------------------------------------
          1
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}


          bar Alexander Barkov made changes -
          Description When running in {{sql_mode=ORACLE}}, MariaDB will understand an optional {{LOG ERRORS}} clause with this syntax:
          {code:sql}
          LOG ERRORS
            [INTO [schema.]table]
            [('simple_expression')]
            [REJECT LIMIT integer|UNLIMITED]
          {code}

          Example:
          {code:sql}
          DELETE FROM t1
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1;

          INSERT INTO t1 (a,b,c) SELECT a,b,c FROM t2
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1
          {code}

          {{LOG ERRORS}} is used for two purposes:
          1. For actual logging of errors
          2. To change transaction error handling behavior. By default, when a DML statement fails on some row (e.g. due to a {{CONSTRAINT}} check, the whole statement is rolled back, regardless of how many rows were processed successfully before the error was detected. The {{REJECT LIMIT}} clause specifies the maximum number of errors before the statement fails.

          h2. Example:
          {code:sql}
          DROP TABLE err$_t1;
          BEGIN
            DBMS_ERRLOG.create_error_log (dml_table_name => 't1');
          END;
          /
          DROP TABLE t1;
          CREATE TABLE t1 (a INT PRIMARY KEY);
          INSERT INTO t1 VALUES (10);
          {code}

          Now I insert a row which would normally raise a "err_dup_key" exception:
          {code:sql}
          INSERT INTO t1 VALUES (10) LOG ERRORS REJECT LIMIT 1;
          {code}
          {noformat}
          0 rows created.
          {noformat}

          Notice, no exceptions were raised, and a recod in {{err$_t1}} was created instead:
          {code:sql}
          SELECT ORA_ERR_NUMBER$,ORA_ERR_MESG$ FROM err$_t1;
          {code}
          {noformat}
          ORA_ERR_NUMBER$
          ---------------
          ORA_ERR_MESG$
          --------------------------------------------------------------------------------
          1
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}


          When running in {{sql_mode=ORACLE}}, MariaDB will understand an optional {{LOG ERRORS}} clause with this syntax:
          {code:sql}
          LOG ERRORS
            [INTO [schema.]table]
            [('simple_expression')]
            [REJECT LIMIT integer|UNLIMITED]
          {code}

          Example:
          {code:sql}
          DELETE FROM t1
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1;

          INSERT INTO t1 (a,b,c) SELECT a,b,c FROM t2
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1
          {code}

          {{LOG ERRORS}} is used for two purposes:
          1. For actual logging of errors
          2. To change transaction error handling behavior. By default, when a DML statement fails on some row (e.g. due to a {{CONSTRAINT}} check, the whole statement is rolled back, regardless of how many rows were processed successfully before the error was detected. The {{REJECT LIMIT}} clause specifies the maximum number of errors before the statement fails.

          If the {{INTO}} clause is omitted, then logging is done to the table {{ERR$_table}}, where {{table}} is the name of the subject table truncated to 25 characters.

          h2. Example:
          {code:sql}
          DROP TABLE err$_t1;
          BEGIN
            DBMS_ERRLOG.create_error_log (dml_table_name => 't1');
          END;
          /
          DROP TABLE t1;
          CREATE TABLE t1 (a INT PRIMARY KEY);
          INSERT INTO t1 VALUES (10);
          {code}

          Now I insert a row which would normally raise a "err_dup_key" exception:
          {code:sql}
          INSERT INTO t1 VALUES (10) LOG ERRORS REJECT LIMIT 1;
          {code}
          {noformat}
          0 rows created.
          {noformat}

          Notice, no exceptions were raised, and a recod in {{err$_t1}} was created instead:
          {code:sql}
          SELECT ORA_ERR_NUMBER$,ORA_ERR_MESG$ FROM err$_t1;
          {code}
          {noformat}
          ORA_ERR_NUMBER$
          ---------------
          ORA_ERR_MESG$
          --------------------------------------------------------------------------------
          1
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}


          bar Alexander Barkov made changes -
          Description When running in {{sql_mode=ORACLE}}, MariaDB will understand an optional {{LOG ERRORS}} clause with this syntax:
          {code:sql}
          LOG ERRORS
            [INTO [schema.]table]
            [('simple_expression')]
            [REJECT LIMIT integer|UNLIMITED]
          {code}

          Example:
          {code:sql}
          DELETE FROM t1
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1;

          INSERT INTO t1 (a,b,c) SELECT a,b,c FROM t2
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1
          {code}

          {{LOG ERRORS}} is used for two purposes:
          1. For actual logging of errors
          2. To change transaction error handling behavior. By default, when a DML statement fails on some row (e.g. due to a {{CONSTRAINT}} check, the whole statement is rolled back, regardless of how many rows were processed successfully before the error was detected. The {{REJECT LIMIT}} clause specifies the maximum number of errors before the statement fails.

          If the {{INTO}} clause is omitted, then logging is done to the table {{ERR$_table}}, where {{table}} is the name of the subject table truncated to 25 characters.

          h2. Example:
          {code:sql}
          DROP TABLE err$_t1;
          BEGIN
            DBMS_ERRLOG.create_error_log (dml_table_name => 't1');
          END;
          /
          DROP TABLE t1;
          CREATE TABLE t1 (a INT PRIMARY KEY);
          INSERT INTO t1 VALUES (10);
          {code}

          Now I insert a row which would normally raise a "err_dup_key" exception:
          {code:sql}
          INSERT INTO t1 VALUES (10) LOG ERRORS REJECT LIMIT 1;
          {code}
          {noformat}
          0 rows created.
          {noformat}

          Notice, no exceptions were raised, and a recod in {{err$_t1}} was created instead:
          {code:sql}
          SELECT ORA_ERR_NUMBER$,ORA_ERR_MESG$ FROM err$_t1;
          {code}
          {noformat}
          ORA_ERR_NUMBER$
          ---------------
          ORA_ERR_MESG$
          --------------------------------------------------------------------------------
          1
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}


          When running in {{sql_mode=ORACLE}}, MariaDB will understand an optional {{LOG ERRORS}} clause with this syntax:
          {code:sql}
          LOG ERRORS
            [INTO [schema.]table]
            [('simple_expression')]
            [REJECT LIMIT integer|UNLIMITED]
          {code}

          Example:
          {code:sql}
          DELETE FROM t1
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1;

          INSERT INTO t1 (a,b,c) SELECT a,b,c FROM t2
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1
          {code}

          {{LOG ERRORS}} is used for two purposes:
          1. For actual logging of errors
          2. To change transaction error handling behavior. By default, when a DML statement fails on some row (e.g. due to a {{CONSTRAINT}} check, the whole statement is rolled back, regardless of how many rows were processed successfully before the error was detected. The {{REJECT LIMIT}} clause specifies the maximum number of errors before the statement fails.

          If the {{INTO}} clause is omitted, then logging is done to the table {{ERR$_table}}, where {{table}} is the name of the subject table truncated to 25 characters.

          The log table must be created, either manually, or using a special stored procedure {{DBMS_ERRLOG.create_error_log}}.

          h2. Example:
          {code:sql}
          DROP TABLE err$_t1;
          BEGIN
            DBMS_ERRLOG.create_error_log (dml_table_name => 't1');
          END;
          /
          DROP TABLE t1;
          CREATE TABLE t1 (a INT PRIMARY KEY);
          INSERT INTO t1 VALUES (10);
          {code}

          Now I insert a row which would normally raise a "err_dup_key" exception:
          {code:sql}
          INSERT INTO t1 VALUES (10) LOG ERRORS REJECT LIMIT 1;
          {code}
          {noformat}
          0 rows created.
          {noformat}

          Notice, no exceptions were raised, and a recod in {{err$_t1}} was created instead:
          {code:sql}
          SELECT ORA_ERR_NUMBER$,ORA_ERR_MESG$ FROM err$_t1;
          {code}
          {noformat}
          ORA_ERR_NUMBER$
          ---------------
          ORA_ERR_MESG$
          --------------------------------------------------------------------------------
          1
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}


          bar Alexander Barkov made changes -
          Description When running in {{sql_mode=ORACLE}}, MariaDB will understand an optional {{LOG ERRORS}} clause with this syntax:
          {code:sql}
          LOG ERRORS
            [INTO [schema.]table]
            [('simple_expression')]
            [REJECT LIMIT integer|UNLIMITED]
          {code}

          Example:
          {code:sql}
          DELETE FROM t1
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1;

          INSERT INTO t1 (a,b,c) SELECT a,b,c FROM t2
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1
          {code}

          {{LOG ERRORS}} is used for two purposes:
          1. For actual logging of errors
          2. To change transaction error handling behavior. By default, when a DML statement fails on some row (e.g. due to a {{CONSTRAINT}} check, the whole statement is rolled back, regardless of how many rows were processed successfully before the error was detected. The {{REJECT LIMIT}} clause specifies the maximum number of errors before the statement fails.

          If the {{INTO}} clause is omitted, then logging is done to the table {{ERR$_table}}, where {{table}} is the name of the subject table truncated to 25 characters.

          The log table must be created, either manually, or using a special stored procedure {{DBMS_ERRLOG.create_error_log}}.

          h2. Example:
          {code:sql}
          DROP TABLE err$_t1;
          BEGIN
            DBMS_ERRLOG.create_error_log (dml_table_name => 't1');
          END;
          /
          DROP TABLE t1;
          CREATE TABLE t1 (a INT PRIMARY KEY);
          INSERT INTO t1 VALUES (10);
          {code}

          Now I insert a row which would normally raise a "err_dup_key" exception:
          {code:sql}
          INSERT INTO t1 VALUES (10) LOG ERRORS REJECT LIMIT 1;
          {code}
          {noformat}
          0 rows created.
          {noformat}

          Notice, no exceptions were raised, and a recod in {{err$_t1}} was created instead:
          {code:sql}
          SELECT ORA_ERR_NUMBER$,ORA_ERR_MESG$ FROM err$_t1;
          {code}
          {noformat}
          ORA_ERR_NUMBER$
          ---------------
          ORA_ERR_MESG$
          --------------------------------------------------------------------------------
          1
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}


          When running in {{sql_mode=ORACLE}}, MariaDB will understand an optional {{LOG ERRORS}} clause with this syntax:
          {code:sql}
          LOG ERRORS
            [INTO [schema.]table]
            [('simple_expression')]
            [REJECT LIMIT integer|UNLIMITED]
          {code}

          Example:
          {code:sql}
          DELETE FROM t1
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1;

          INSERT INTO t1 (a,b,c) SELECT a,b,c FROM t2
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1
          {code}

          {{LOG ERRORS}} is used for two purposes:
          1. For actual logging of errors
          2. To change transaction error handling behavior. By default, when a DML statement fails on some row (e.g. due to a {{CONSTRAINT}} check, the whole statement is rolled back, regardless of how many rows were processed successfully before the error was detected. The {{REJECT LIMIT}} clause specifies the maximum number of errors before the statement fails.

          If the {{INTO}} clause is omitted, then logging is done to the table {{ERR$_table}}, where {{table}} is the name of the subject table truncated to 25 characters.

          The log table must be created, either manually, or using a special stored procedure {{DBMS_ERRLOG.create_error_log}}.

          If the {{REJECT}} clause is omitted, then {{LIMIT}} is set to {{0}} by default, which means the traditional transaction behavior, i.e. rollback on errors.

          h2. Example:
          {code:sql}
          DROP TABLE err$_t1;
          BEGIN
            DBMS_ERRLOG.create_error_log (dml_table_name => 't1');
          END;
          /
          DROP TABLE t1;
          CREATE TABLE t1 (a INT PRIMARY KEY);
          INSERT INTO t1 VALUES (10);
          {code}

          Now I insert a row which would normally raise a "err_dup_key" exception:
          {code:sql}
          INSERT INTO t1 VALUES (10) LOG ERRORS REJECT LIMIT 1;
          {code}
          {noformat}
          0 rows created.
          {noformat}

          Notice, no exceptions were raised, and a recod in {{err$_t1}} was created instead:
          {code:sql}
          SELECT ORA_ERR_NUMBER$,ORA_ERR_MESG$ FROM err$_t1;
          {code}
          {noformat}
          ORA_ERR_NUMBER$
          ---------------
          ORA_ERR_MESG$
          --------------------------------------------------------------------------------
          1
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}


          bar Alexander Barkov made changes -
          Description When running in {{sql_mode=ORACLE}}, MariaDB will understand an optional {{LOG ERRORS}} clause with this syntax:
          {code:sql}
          LOG ERRORS
            [INTO [schema.]table]
            [('simple_expression')]
            [REJECT LIMIT integer|UNLIMITED]
          {code}

          Example:
          {code:sql}
          DELETE FROM t1
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1;

          INSERT INTO t1 (a,b,c) SELECT a,b,c FROM t2
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1
          {code}

          {{LOG ERRORS}} is used for two purposes:
          1. For actual logging of errors
          2. To change transaction error handling behavior. By default, when a DML statement fails on some row (e.g. due to a {{CONSTRAINT}} check, the whole statement is rolled back, regardless of how many rows were processed successfully before the error was detected. The {{REJECT LIMIT}} clause specifies the maximum number of errors before the statement fails.

          If the {{INTO}} clause is omitted, then logging is done to the table {{ERR$_table}}, where {{table}} is the name of the subject table truncated to 25 characters.

          The log table must be created, either manually, or using a special stored procedure {{DBMS_ERRLOG.create_error_log}}.

          If the {{REJECT}} clause is omitted, then {{LIMIT}} is set to {{0}} by default, which means the traditional transaction behavior, i.e. rollback on errors.

          h2. Example:
          {code:sql}
          DROP TABLE err$_t1;
          BEGIN
            DBMS_ERRLOG.create_error_log (dml_table_name => 't1');
          END;
          /
          DROP TABLE t1;
          CREATE TABLE t1 (a INT PRIMARY KEY);
          INSERT INTO t1 VALUES (10);
          {code}

          Now I insert a row which would normally raise a "err_dup_key" exception:
          {code:sql}
          INSERT INTO t1 VALUES (10) LOG ERRORS REJECT LIMIT 1;
          {code}
          {noformat}
          0 rows created.
          {noformat}

          Notice, no exceptions were raised, and a recod in {{err$_t1}} was created instead:
          {code:sql}
          SELECT ORA_ERR_NUMBER$,ORA_ERR_MESG$ FROM err$_t1;
          {code}
          {noformat}
          ORA_ERR_NUMBER$
          ---------------
          ORA_ERR_MESG$
          --------------------------------------------------------------------------------
          1
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}


          When running in {{sql_mode=ORACLE}}, MariaDB will understand an optional {{LOG ERRORS}} clause with this syntax:
          {code:sql}
          LOG ERRORS
            [INTO [schema.]table]
            [('simple_expression')]
            [REJECT LIMIT integer|UNLIMITED]
          {code}

          Example:
          {code:sql}
          DELETE FROM t1
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1;

          INSERT INTO t1 (a,b,c) SELECT a,b,c FROM t2
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1
          {code}

          {{LOG ERRORS}} is used for two purposes:
          1. For actual logging of errors
          2. To change transaction error handling behavior. By default, when a DML statement fails on some row (e.g. due to a {{CONSTRAINT}} check, the whole statement is rolled back, regardless of how many rows were processed successfully before the error was detected. The {{REJECT LIMIT}} clause specifies the maximum number of errors before the statement fails.

          If the {{INTO}} clause is omitted, then logging is done to the table {{ERR$_table}}, where {{table}} is the name of the subject table truncated to 25 characters.

          The log table must be created, either manually, or using a special stored procedure {{DBMS_ERRLOG.create_error_log}}.

          If the {{REJECT}} clause is omitted, then {{LIMIT}} is set to {{0}} by default, which means the traditional transaction behavior, i.e. rollback on errors.

          h2. Example:
          {code:sql}
          DROP TABLE err$_t1;
          BEGIN
            DBMS_ERRLOG.create_error_log (dml_table_name => 't1');
          END;
          /
          DROP TABLE t1;
          CREATE TABLE t1 (a INT PRIMARY KEY);
          INSERT INTO t1 VALUES (10);
          {code}

          Now I insert a row which would normally raise a "err_dup_key" exception:
          {code:sql}
          INSERT INTO t1 VALUES (10) LOG ERRORS REJECT LIMIT 1;
          {code}
          {noformat}
          0 rows created.
          {noformat}

          Notice, no exceptions were raised, and a recod in {{err$_t1}} was created instead:
          {code:sql}
          SELECT ORA_ERR_NUMBER$,ORA_ERR_MESG$ FROM err$_t1;
          {code}
          {noformat}
          ORA_ERR_NUMBER$
          ---------------
          ORA_ERR_MESG$
          --------------------------------------------------------------------------------
          1
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}

          Let's try {{LOG ERRORS}} with no {{REJECT LIMIT}} clause.
          {code:sql}
          DELETE FROM err$_t1;
          INSERT INTO t1 VALUES (10) LOG ERRORS;
          {code}
          {noformat}
          ERROR at line 1:
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}
          {code:sql}
          SELECT ORA_ERR_NUMBER$,ORA_ERR_MESG$ FROM err$_t1;
          {code}
          {noformat}
          ORA_ERR_NUMBER$
          ---------------
          ORA_ERR_MESG$
          --------------------------------------------------------------------------------
          1
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}
          bar Alexander Barkov made changes -
          Description When running in {{sql_mode=ORACLE}}, MariaDB will understand an optional {{LOG ERRORS}} clause with this syntax:
          {code:sql}
          LOG ERRORS
            [INTO [schema.]table]
            [('simple_expression')]
            [REJECT LIMIT integer|UNLIMITED]
          {code}

          Example:
          {code:sql}
          DELETE FROM t1
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1;

          INSERT INTO t1 (a,b,c) SELECT a,b,c FROM t2
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1
          {code}

          {{LOG ERRORS}} is used for two purposes:
          1. For actual logging of errors
          2. To change transaction error handling behavior. By default, when a DML statement fails on some row (e.g. due to a {{CONSTRAINT}} check, the whole statement is rolled back, regardless of how many rows were processed successfully before the error was detected. The {{REJECT LIMIT}} clause specifies the maximum number of errors before the statement fails.

          If the {{INTO}} clause is omitted, then logging is done to the table {{ERR$_table}}, where {{table}} is the name of the subject table truncated to 25 characters.

          The log table must be created, either manually, or using a special stored procedure {{DBMS_ERRLOG.create_error_log}}.

          If the {{REJECT}} clause is omitted, then {{LIMIT}} is set to {{0}} by default, which means the traditional transaction behavior, i.e. rollback on errors.

          h2. Example:
          {code:sql}
          DROP TABLE err$_t1;
          BEGIN
            DBMS_ERRLOG.create_error_log (dml_table_name => 't1');
          END;
          /
          DROP TABLE t1;
          CREATE TABLE t1 (a INT PRIMARY KEY);
          INSERT INTO t1 VALUES (10);
          {code}

          Now I insert a row which would normally raise a "err_dup_key" exception:
          {code:sql}
          INSERT INTO t1 VALUES (10) LOG ERRORS REJECT LIMIT 1;
          {code}
          {noformat}
          0 rows created.
          {noformat}

          Notice, no exceptions were raised, and a recod in {{err$_t1}} was created instead:
          {code:sql}
          SELECT ORA_ERR_NUMBER$,ORA_ERR_MESG$ FROM err$_t1;
          {code}
          {noformat}
          ORA_ERR_NUMBER$
          ---------------
          ORA_ERR_MESG$
          --------------------------------------------------------------------------------
          1
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}

          Let's try {{LOG ERRORS}} with no {{REJECT LIMIT}} clause.
          {code:sql}
          DELETE FROM err$_t1;
          INSERT INTO t1 VALUES (10) LOG ERRORS;
          {code}
          {noformat}
          ERROR at line 1:
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}
          {code:sql}
          SELECT ORA_ERR_NUMBER$,ORA_ERR_MESG$ FROM err$_t1;
          {code}
          {noformat}
          ORA_ERR_NUMBER$
          ---------------
          ORA_ERR_MESG$
          --------------------------------------------------------------------------------
          1
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}
          When running in {{sql_mode=ORACLE}}, MariaDB will understand an optional {{LOG ERRORS}} clause with this syntax:
          {code:sql}
          LOG ERRORS
            [INTO [schema.]table]
            [('simple_expression')]
            [REJECT LIMIT integer|UNLIMITED]
          {code}

          Example:
          {code:sql}
          DELETE FROM t1
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1;

          INSERT INTO t1 (a,b,c) SELECT a,b,c FROM t2
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1
          {code}

          {{LOG ERRORS}} is used for two purposes:
          1. For actual logging of errors
          2. To change transaction error handling behavior. By default, when a DML statement fails on some row (e.g. due to a {{CONSTRAINT}} check, the whole statement is rolled back, regardless of how many rows were processed successfully before the error was detected. The {{REJECT LIMIT}} clause specifies the maximum number of errors before the statement fails.

          If the {{INTO}} clause is omitted, then logging is done to the table {{ERR$_table}}, where {{table}} is the name of the subject table truncated to 25 characters.

          The log table must be created, either manually, or using a special stored procedure {{DBMS_ERRLOG.create_error_log}}.

          If the {{REJECT}} clause is omitted, then {{LIMIT}} is set to {{0}} by default, which means the traditional transaction behavior, i.e. rollback on errors.

          h2. Example:
          {code:sql}
          DROP TABLE err$_t1;
          BEGIN
            DBMS_ERRLOG.create_error_log (dml_table_name => 't1');
          END;
          /
          DROP TABLE t1;
          CREATE TABLE t1 (a INT PRIMARY KEY);
          INSERT INTO t1 VALUES (10);
          {code}

          Now I insert a row which would normally raise a "err_dup_key" exception:
          {code:sql}
          INSERT INTO t1 VALUES (10) LOG ERRORS REJECT LIMIT 1;
          {code}
          {noformat}
          0 rows created.
          {noformat}

          Notice, no exceptions were raised, and a record in {{err$_t1}} was created instead:
          {code:sql}
          SELECT ORA_ERR_NUMBER$,ORA_ERR_MESG$ FROM err$_t1;
          {code}
          {noformat}
          ORA_ERR_NUMBER$
          ---------------
          ORA_ERR_MESG$
          --------------------------------------------------------------------------------
          1
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}

          Let's try {{LOG ERRORS}} with no {{REJECT LIMIT}} clause.
          {code:sql}
          DELETE FROM err$_t1;
          INSERT INTO t1 VALUES (10) LOG ERRORS;
          {code}
          {noformat}
          ERROR at line 1:
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}
          {code:sql}
          SELECT ORA_ERR_NUMBER$,ORA_ERR_MESG$ FROM err$_t1;
          {code}
          {noformat}
          ORA_ERR_NUMBER$
          ---------------
          ORA_ERR_MESG$
          --------------------------------------------------------------------------------
          1
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}
          bar Alexander Barkov made changes -
          Description When running in {{sql_mode=ORACLE}}, MariaDB will understand an optional {{LOG ERRORS}} clause with this syntax:
          {code:sql}
          LOG ERRORS
            [INTO [schema.]table]
            [('simple_expression')]
            [REJECT LIMIT integer|UNLIMITED]
          {code}

          Example:
          {code:sql}
          DELETE FROM t1
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1;

          INSERT INTO t1 (a,b,c) SELECT a,b,c FROM t2
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1
          {code}

          {{LOG ERRORS}} is used for two purposes:
          1. For actual logging of errors
          2. To change transaction error handling behavior. By default, when a DML statement fails on some row (e.g. due to a {{CONSTRAINT}} check, the whole statement is rolled back, regardless of how many rows were processed successfully before the error was detected. The {{REJECT LIMIT}} clause specifies the maximum number of errors before the statement fails.

          If the {{INTO}} clause is omitted, then logging is done to the table {{ERR$_table}}, where {{table}} is the name of the subject table truncated to 25 characters.

          The log table must be created, either manually, or using a special stored procedure {{DBMS_ERRLOG.create_error_log}}.

          If the {{REJECT}} clause is omitted, then {{LIMIT}} is set to {{0}} by default, which means the traditional transaction behavior, i.e. rollback on errors.

          h2. Example:
          {code:sql}
          DROP TABLE err$_t1;
          BEGIN
            DBMS_ERRLOG.create_error_log (dml_table_name => 't1');
          END;
          /
          DROP TABLE t1;
          CREATE TABLE t1 (a INT PRIMARY KEY);
          INSERT INTO t1 VALUES (10);
          {code}

          Now I insert a row which would normally raise a "err_dup_key" exception:
          {code:sql}
          INSERT INTO t1 VALUES (10) LOG ERRORS REJECT LIMIT 1;
          {code}
          {noformat}
          0 rows created.
          {noformat}

          Notice, no exceptions were raised, and a record in {{err$_t1}} was created instead:
          {code:sql}
          SELECT ORA_ERR_NUMBER$,ORA_ERR_MESG$ FROM err$_t1;
          {code}
          {noformat}
          ORA_ERR_NUMBER$
          ---------------
          ORA_ERR_MESG$
          --------------------------------------------------------------------------------
          1
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}

          Let's try {{LOG ERRORS}} with no {{REJECT LIMIT}} clause.
          {code:sql}
          DELETE FROM err$_t1;
          INSERT INTO t1 VALUES (10) LOG ERRORS;
          {code}
          {noformat}
          ERROR at line 1:
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}
          {code:sql}
          SELECT ORA_ERR_NUMBER$,ORA_ERR_MESG$ FROM err$_t1;
          {code}
          {noformat}
          ORA_ERR_NUMBER$
          ---------------
          ORA_ERR_MESG$
          --------------------------------------------------------------------------------
          1
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}
          When running in {{sql_mode=ORACLE}}, MariaDB will understand an optional {{LOG ERRORS}} clause with this syntax:
          {code:sql}
          LOG ERRORS
            [INTO [schema.]table]
            [('simple_expression')]
            [REJECT LIMIT integer|UNLIMITED]
          {code}

          Example:
          {code:sql}
          DELETE FROM t1
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1;

          INSERT INTO t1 (a,b,c) SELECT a,b,c FROM t2
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1
          {code}

          {{LOG ERRORS}} is used for two purposes:
          1. For actual logging of errors
          2. To change transaction error handling behavior. By default, when a DML statement fails on some row (e.g. due to a {{CONSTRAINT}} check, the whole statement is rolled back, regardless of how many rows were processed successfully before the error was detected. The {{REJECT LIMIT}} clause specifies the maximum number of errors before the statement fails.

          If the {{INTO}} clause is omitted, then logging is done to the table {{ERR$_table}}, where {{table}} is the name of the subject table truncated to 25 characters.

          The log table must be created, either manually, or using a special stored procedure {{DBMS_ERRLOG.create_error_log}}.

          If the {{REJECT}} clause is omitted, then {{LIMIT}} is set to {{0}} by default, which means the traditional transaction behavior, i.e. rollback on errors.

          h2. Example:
          h3. Preparations
          {code:sql}
          DROP TABLE err$_t1;
          BEGIN
            DBMS_ERRLOG.create_error_log (dml_table_name => 't1');
          END;
          /
          DROP TABLE t1;
          CREATE TABLE t1 (a INT PRIMARY KEY);
          INSERT INTO t1 VALUES (10);
          {code}

          h3. Testing {{LOG ERRORS REJECT LIMIT 1}}
          Now I insert a row which would normally raise a "err_dup_key" exception:
          {code:sql}
          INSERT INTO t1 VALUES (10) LOG ERRORS REJECT LIMIT 1;
          {code}
          {noformat}
          0 rows created.
          {noformat}

          Notice, no exceptions were raised, and a record in {{err$_t1}} was created instead:
          {code:sql}
          SELECT ORA_ERR_NUMBER$,ORA_ERR_MESG$ FROM err$_t1;
          {code}
          {noformat}
          ORA_ERR_NUMBER$
          ---------------
          ORA_ERR_MESG$
          --------------------------------------------------------------------------------
          1
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}

          h3. Testing {{LOG ERRORS}} with no {{REJECT LIMIT}} clause.
          {code:sql}
          DELETE FROM err$_t1;
          INSERT INTO t1 VALUES (10) LOG ERRORS;
          {code}
          {noformat}
          ERROR at line 1:
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}
          {code:sql}
          SELECT ORA_ERR_NUMBER$,ORA_ERR_MESG$ FROM err$_t1;
          {code}
          {noformat}
          ORA_ERR_NUMBER$
          ---------------
          ORA_ERR_MESG$
          --------------------------------------------------------------------------------
          1
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}
          bar Alexander Barkov made changes -
          Description When running in {{sql_mode=ORACLE}}, MariaDB will understand an optional {{LOG ERRORS}} clause with this syntax:
          {code:sql}
          LOG ERRORS
            [INTO [schema.]table]
            [('simple_expression')]
            [REJECT LIMIT integer|UNLIMITED]
          {code}

          Example:
          {code:sql}
          DELETE FROM t1
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1;

          INSERT INTO t1 (a,b,c) SELECT a,b,c FROM t2
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1
          {code}

          {{LOG ERRORS}} is used for two purposes:
          1. For actual logging of errors
          2. To change transaction error handling behavior. By default, when a DML statement fails on some row (e.g. due to a {{CONSTRAINT}} check, the whole statement is rolled back, regardless of how many rows were processed successfully before the error was detected. The {{REJECT LIMIT}} clause specifies the maximum number of errors before the statement fails.

          If the {{INTO}} clause is omitted, then logging is done to the table {{ERR$_table}}, where {{table}} is the name of the subject table truncated to 25 characters.

          The log table must be created, either manually, or using a special stored procedure {{DBMS_ERRLOG.create_error_log}}.

          If the {{REJECT}} clause is omitted, then {{LIMIT}} is set to {{0}} by default, which means the traditional transaction behavior, i.e. rollback on errors.

          h2. Example:
          h3. Preparations
          {code:sql}
          DROP TABLE err$_t1;
          BEGIN
            DBMS_ERRLOG.create_error_log (dml_table_name => 't1');
          END;
          /
          DROP TABLE t1;
          CREATE TABLE t1 (a INT PRIMARY KEY);
          INSERT INTO t1 VALUES (10);
          {code}

          h3. Testing {{LOG ERRORS REJECT LIMIT 1}}
          Now I insert a row which would normally raise a "err_dup_key" exception:
          {code:sql}
          INSERT INTO t1 VALUES (10) LOG ERRORS REJECT LIMIT 1;
          {code}
          {noformat}
          0 rows created.
          {noformat}

          Notice, no exceptions were raised, and a record in {{err$_t1}} was created instead:
          {code:sql}
          SELECT ORA_ERR_NUMBER$,ORA_ERR_MESG$ FROM err$_t1;
          {code}
          {noformat}
          ORA_ERR_NUMBER$
          ---------------
          ORA_ERR_MESG$
          --------------------------------------------------------------------------------
          1
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}

          h3. Testing {{LOG ERRORS}} with no {{REJECT LIMIT}} clause.
          {code:sql}
          DELETE FROM err$_t1;
          INSERT INTO t1 VALUES (10) LOG ERRORS;
          {code}
          {noformat}
          ERROR at line 1:
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}
          {code:sql}
          SELECT ORA_ERR_NUMBER$,ORA_ERR_MESG$ FROM err$_t1;
          {code}
          {noformat}
          ORA_ERR_NUMBER$
          ---------------
          ORA_ERR_MESG$
          --------------------------------------------------------------------------------
          1
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}
          When running in {{sql_mode=ORACLE}}, MariaDB will understand an optional {{LOG ERRORS}} clause with this syntax:
          {code:sql}
          LOG ERRORS
            [INTO [schema.]table]
            [('simple_expression')]
            [REJECT LIMIT integer|UNLIMITED]
          {code}

          Example:
          {code:sql}
          DELETE FROM t1
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1;

          INSERT INTO t1 (a,b,c) SELECT a,b,c FROM t2
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1
          {code}

          {{LOG ERRORS}} is used for two purposes:
          1. For actual logging of errors
          2. To change transaction error handling behavior. By default, when a DML statement fails on some row (e.g. due to a {{CONSTRAINT}} check, the whole statement is rolled back, regardless of how many rows were processed successfully before the error was detected. The {{REJECT LIMIT}} clause specifies the maximum number of errors before the statement fails.

          If the {{INTO}} clause is omitted, then logging is done to the table {{ERR$_table}}, where {{table}} is the name of the subject table truncated to 25 characters.

          The log table must be created, either manually, or using a special stored procedure {{DBMS_ERRLOG.create_error_log}}.

          If the {{REJECT}} clause is omitted, then {{LIMIT}} is set to {{0}} by default, which means the traditional transaction behavior, i.e. rollback on errors.

          h1. Example:
          h2. Preparations
          {code:sql}
          DROP TABLE err$_t1;
          BEGIN
            DBMS_ERRLOG.create_error_log (dml_table_name => 't1');
          END;
          /
          DROP TABLE t1;
          CREATE TABLE t1 (a INT PRIMARY KEY);
          INSERT INTO t1 VALUES (10);
          {code}

          h2. Testing {{LOG ERRORS REJECT LIMIT 1}}
          Now I insert a row which would normally raise a "err_dup_key" exception:
          {code:sql}
          INSERT INTO t1 VALUES (10) LOG ERRORS REJECT LIMIT 1;
          {code}
          {noformat}
          0 rows created.
          {noformat}

          Notice, no exceptions were raised, and a record in {{err$_t1}} was created instead:
          {code:sql}
          SELECT ORA_ERR_NUMBER$,ORA_ERR_MESG$ FROM err$_t1;
          {code}
          {noformat}
          ORA_ERR_NUMBER$
          ---------------
          ORA_ERR_MESG$
          --------------------------------------------------------------------------------
          1
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}

          h2. Testing {{LOG ERRORS}} with no {{REJECT LIMIT}} clause.
          {code:sql}
          DELETE FROM err$_t1;
          INSERT INTO t1 VALUES (10) LOG ERRORS;
          {code}
          {noformat}
          ERROR at line 1:
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}
          {code:sql}
          SELECT ORA_ERR_NUMBER$,ORA_ERR_MESG$ FROM err$_t1;
          {code}
          {noformat}
          ORA_ERR_NUMBER$
          ---------------
          ORA_ERR_MESG$
          --------------------------------------------------------------------------------
          1
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}
          bar Alexander Barkov made changes -
          Description When running in {{sql_mode=ORACLE}}, MariaDB will understand an optional {{LOG ERRORS}} clause with this syntax:
          {code:sql}
          LOG ERRORS
            [INTO [schema.]table]
            [('simple_expression')]
            [REJECT LIMIT integer|UNLIMITED]
          {code}

          Example:
          {code:sql}
          DELETE FROM t1
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1;

          INSERT INTO t1 (a,b,c) SELECT a,b,c FROM t2
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1
          {code}

          {{LOG ERRORS}} is used for two purposes:
          1. For actual logging of errors
          2. To change transaction error handling behavior. By default, when a DML statement fails on some row (e.g. due to a {{CONSTRAINT}} check, the whole statement is rolled back, regardless of how many rows were processed successfully before the error was detected. The {{REJECT LIMIT}} clause specifies the maximum number of errors before the statement fails.

          If the {{INTO}} clause is omitted, then logging is done to the table {{ERR$_table}}, where {{table}} is the name of the subject table truncated to 25 characters.

          The log table must be created, either manually, or using a special stored procedure {{DBMS_ERRLOG.create_error_log}}.

          If the {{REJECT}} clause is omitted, then {{LIMIT}} is set to {{0}} by default, which means the traditional transaction behavior, i.e. rollback on errors.

          h1. Example:
          h2. Preparations
          {code:sql}
          DROP TABLE err$_t1;
          BEGIN
            DBMS_ERRLOG.create_error_log (dml_table_name => 't1');
          END;
          /
          DROP TABLE t1;
          CREATE TABLE t1 (a INT PRIMARY KEY);
          INSERT INTO t1 VALUES (10);
          {code}

          h2. Testing {{LOG ERRORS REJECT LIMIT 1}}
          Now I insert a row which would normally raise a "err_dup_key" exception:
          {code:sql}
          INSERT INTO t1 VALUES (10) LOG ERRORS REJECT LIMIT 1;
          {code}
          {noformat}
          0 rows created.
          {noformat}

          Notice, no exceptions were raised, and a record in {{err$_t1}} was created instead:
          {code:sql}
          SELECT ORA_ERR_NUMBER$,ORA_ERR_MESG$ FROM err$_t1;
          {code}
          {noformat}
          ORA_ERR_NUMBER$
          ---------------
          ORA_ERR_MESG$
          --------------------------------------------------------------------------------
          1
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}

          h2. Testing {{LOG ERRORS}} with no {{REJECT LIMIT}} clause.
          {code:sql}
          DELETE FROM err$_t1;
          INSERT INTO t1 VALUES (10) LOG ERRORS;
          {code}
          {noformat}
          ERROR at line 1:
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}
          {code:sql}
          SELECT ORA_ERR_NUMBER$,ORA_ERR_MESG$ FROM err$_t1;
          {code}
          {noformat}
          ORA_ERR_NUMBER$
          ---------------
          ORA_ERR_MESG$
          --------------------------------------------------------------------------------
          1
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}
          When running in {{sql_mode=ORACLE}}, MariaDB will understand an optional {{LOG ERRORS}} clause with this syntax:
          {code:sql}
          LOG ERRORS
            [INTO [schema.]table]
            [('simple_expression')]
            [REJECT LIMIT integer|UNLIMITED]
          {code}

          Example:
          {code:sql}
          DELETE FROM t1
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1;

          INSERT INTO t1 (a,b,c) SELECT a,b,c FROM t2
            LOG ERRORS INTO ERROR_LOG_DMLEL REJECT LIMIT 1
          {code}

          {{LOG ERRORS}} is used for two purposes:
          1. For actual logging of errors
          2. To change transaction error handling behavior. By default, when a DML statement fails on some row (e.g. due to a {{CONSTRAINT}} check, the whole statement is rolled back, regardless of how many rows were processed successfully before the error was detected. The {{REJECT LIMIT}} clause specifies the maximum number of errors before the statement fails.

          If the {{INTO}} clause is omitted, then logging is done to the table {{ERR$_table}}, where {{table}} is the name of the subject table truncated to 25 characters.

          The log table must be created, either manually, or using a special stored procedure {{DBMS_ERRLOG.create_error_log}}. The log table have the following mandatory columns:
          {code:sql}
          CREATE TABLE ERR$_T1
          (
            ORA_ERR_NUMBER$ NUMBER,
            ORA_ERR_MESG$ VARCHAR2(2000),
            ORA_ERR_ROWID$ ROWID,
            ORA_ERR_OPTYP$ VARCHAR2(2),
            ORA_ERR_TAG$ VARCHAR2(2000)
          );
          {code}

          If the {{REJECT}} clause is omitted, then {{LIMIT}} is set to {{0}} by default, which means the traditional transaction behavior, i.e. rollback on errors.

          h1. Example:
          h2. Preparations
          {code:sql}
          DROP TABLE err$_t1;
          BEGIN
            DBMS_ERRLOG.create_error_log (dml_table_name => 't1');
          END;
          /
          DROP TABLE t1;
          CREATE TABLE t1 (a INT PRIMARY KEY);
          INSERT INTO t1 VALUES (10);
          {code}

          h2. Testing {{LOG ERRORS REJECT LIMIT 1}}
          Now I insert a row which would normally raise a "err_dup_key" exception:
          {code:sql}
          INSERT INTO t1 VALUES (10) LOG ERRORS REJECT LIMIT 1;
          {code}
          {noformat}
          0 rows created.
          {noformat}

          Notice, no exceptions were raised, and a record in {{err$_t1}} was created instead:
          {code:sql}
          SELECT ORA_ERR_NUMBER$,ORA_ERR_MESG$ FROM err$_t1;
          {code}
          {noformat}
          ORA_ERR_NUMBER$
          ---------------
          ORA_ERR_MESG$
          --------------------------------------------------------------------------------
          1
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}

          h2. Testing {{LOG ERRORS}} with no {{REJECT LIMIT}} clause.
          {code:sql}
          DELETE FROM err$_t1;
          INSERT INTO t1 VALUES (10) LOG ERRORS;
          {code}
          {noformat}
          ERROR at line 1:
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}
          {code:sql}
          SELECT ORA_ERR_NUMBER$,ORA_ERR_MESG$ FROM err$_t1;
          {code}
          {noformat}
          ORA_ERR_NUMBER$
          ---------------
          ORA_ERR_MESG$
          --------------------------------------------------------------------------------
          1
          ORA-00001: unique constraint (SYSTEM.SYS_C0071433) violated
          {noformat}
          bar Alexander Barkov made changes -
          Assignee Alexander Barkov [ bar ]
          bar Alexander Barkov made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          alvinr Alvin Richards (Inactive) made changes -
          NRE Projects NRE-307517
          alvinr Alvin Richards (Inactive) made changes -
          Labels Compatibility NRE-307517 Compatibility
          bar Alexander Barkov made changes -
          Fix Version/s 10.3 [ 22126 ]
          Fix Version/s 10.2 [ 14601 ]
          bar Alexander Barkov made changes -
          Status In Progress [ 3 ] Stalled [ 10000 ]
          alvinr Alvin Richards (Inactive) made changes -
          Parent MDEV-10142 [ 56873 ] MDEV-10764 [ 57940 ]
          serg Sergei Golubchik made changes -
          Fix Version/s 10.3 [ 22126 ]
          ralf.gebhardt Ralf Gebhardt made changes -
          Support case ID not-26307
          ralf.gebhardt Ralf Gebhardt made changes -
          NRE Projects AC-2610/DEFERRED
          ralf.gebhardt Ralf Gebhardt made changes -
          Assignee Alexander Barkov [ bar ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 76695 ] MariaDB v4 [ 143483 ]

          People

            Unassigned Unassigned
            bar Alexander Barkov
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.