Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-10142 PL/SQL parser
  3. MDEV-10579

sql_mode=ORACLE: Triggers: Understand :NEW.c1 and :OLD.c1 instead of NEW.c1 and OLD.c1

    XMLWordPrintable

Details

    • 10.2.2-3, 10.2.2-1, 10.2.2-2, 10.2.2-4, 10.1.18

    Description

      When running in sql_mode=ORACLE, MariaDB should understand :NEW and :OLD as references to new and old row values in addition or instead of NEW and OLD without colon.

      DROP TABLE t1;
      CREATE TABLE t1 (a INT, b INT, c INT);
      DROP TRIGGER tr1;
      CREATE TRIGGER tr1 BEFORE INSERT ON t1
      FOR EACH ROW
      DECLARE
        cnt INT := 0;
      BEGIN
        IF :NEW.a IS NULL THEN cnt:=cnt+1; END IF;
        IF :NEW.b IS NULL THEN cnt:=cnt+1; END IF;
        IF :NEW.c IS NULL THEN :NEW.c:=cnt; END IF;
      END;
      /
      

      Attachments

        Activity

          People

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