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

ERROR 1054 (42S22): Unknown column 'X' in 'NEW' in trigger

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.4.26, 10.6.9, 10.9.2, 10.4.32
    • 10.4, 10.5, 10.6, 10.11
    • Triggers
    • None

    Description

      From https://stackoverflow.com/questions/76985048/triggers-not-working-as-expected-for-set-columns-in-mariadb:

      Simplified version:

      CREATE TABLE t1 ( m set('sms') NOT NULL);
      CREATE TABLE t2 (i int);
      CREATE TABLE u (i int);
       create or replace trigger t1 AFTER INSERT ON t1 FOR EACH ROW INSERT IGNORE INTO t2 SELECT u.i from u JOIN (SELECT 'sms' AS method) m ON FIND_IN_SET(m.method, NEW.m);
      insert into t1 values ('sms');
      ERROR 1054 (42S22): Unknown column 'm' in 'field list'
      

      Requires the NEW.m reference to be in the JOIN ON criteria.

      Attachments

        Issue Links

          Activity

            People

              igor Igor Babaev
              danblack Daniel Black
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.