[MDEV-7632] SHOW TRIGGERS LIKE statement does not work as expected Created: 2015-02-25  Updated: 2015-02-25  Resolved: 2015-02-25

Status: Closed
Project: MariaDB Server
Component/s: Admin statements
Affects Version/s: 10.0.16
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Guillaume Lefranc Assignee: Unassigned
Resolution: Not a Bug Votes: 0
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)



 Comments   
Comment by Elena Stepanova [ 2015-02-25 ]

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 '_'.

Comment by Guillaume Lefranc [ 2015-02-25 ]

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

Generated at Thu Feb 08 07:21:05 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.