[MDEV-9756] CREATE TRIGGER: no database selected (determine trigger location automatically based on the table location) Created: 2016-03-17 Updated: 2016-03-18 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Triggers |
| Fix Version/s: | None |
| Type: | Task | Priority: | Minor |
| Reporter: | Federico Razzoli | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
I have an application that runs queries like this:
...and receives a "no database selected" error from MariaDB. The error is technically correct, because the query does not specify in which database the trigger must be created. However it specifies in which database the table is, so the trigger needs to be there. You may consider this as a funny feature request instead of a bug. However spending time to debug a query with a problem like this is not that funny... maybe this is easy to fix? NOTE: I found this problem on 10.0, didn't check 10.1 or MySQL |
| Comments |
| Comment by Elena Stepanova [ 2016-03-18 ] |
|
Something is missing or isn't right in your example – the trigger has a fully qualified name, it works regardless whether the current database is selected or not. Did you mean it to be just CREATE TRIGGER t_ai instead of CREATE TRIGGER test.t_ai? |
| Comment by Federico Razzoli [ 2016-03-18 ] |
|
Sorry , yes I'm fixing the test case above |