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

SHOW TRIGGERS LIKE statement does not work as expected

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Not a Bug
    • Affects Version/s: 10.0.16
    • Fix Version/s: N/A
    • Component/s: Admin statements
    • Labels:
      None

      Description

      Given a trigger name containing underscores, for example:
      `users_before_ins_trig`

      the following happens:

      MariaDB [test]> show triggers like 'users%'\G
                   Trigger: users_before_ins_trig
      1 row in set (0.00 sec)
      
      MariaDB [test]> show triggers like 'users_%';
      Empty set (0.00 sec)
      
      MariaDB [test]> show triggers like 'users_before_ins_trig';
      Empty set (0.00 sec)
      

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            elenst Elena Stepanova added a comment -

            I assume the table which the trigger belongs is named users.

            See https://mariadb.com/kb/en/mariadb/show-triggers/ (or the corresponding section of MySQL manual):

            The LIKE clause, if present on its own, indicates which table names to match and causes the statement to display triggers for those tables.

            So, it's the table name that shoud match your 'users_%' pattern. If the table is called 'users', it doesn't match because doesn't have a symbol for '_'.

            Show
            elenst Elena Stepanova added a comment - I assume the table which the trigger belongs is named users . See https://mariadb.com/kb/en/mariadb/show-triggers/ (or the corresponding section of MySQL manual): The LIKE clause, if present on its own, indicates which table names to match and causes the statement to display triggers for those tables. So, it's the table name that shoud match your 'users_%' pattern. If the table is called 'users', it doesn't match because doesn't have a symbol for '_'.
            Hide
            tanj Guillaume Lefranc added a comment -

            Thanks Elena. Next time I should read the doc first, this option is terribly misleading (not the first time that happens in MySQL...)

            Show
            tanj Guillaume Lefranc added a comment - Thanks Elena. Next time I should read the doc first, this option is terribly misleading (not the first time that happens in MySQL...)

              People

              • Assignee:
                Unassigned
                Reporter:
                tanj Guillaume Lefranc
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: