| 1 |
# |
| 2 |
# Test for the example pre parse query rewrite plugin. The example |
| 3 |
# plugin rewrites queries to lowercase. |
| 4 |
# |
| 5 |
INSTALL PLUGIN rewrite_example SONAME 'rewrite_example.xxx'; |
| 6 |
SELECT PLUGIN_NAME, PLUGIN_TYPE |
| 7 |
FROM information_schema.plugins |
| 8 |
WHERE plugin_name LIKE 'rewrite%'; |
| 9 |
plugin_name plugin_type |
| 10 |
rewrite_example AUDIT |
| 11 |
Warnings: |
| 12 |
Note 1105 Query 'SELECT PLUGIN_NAME, PLUGIN_TYPE |
| 13 |
FROM information_schema.plugins |
| 14 |
WHERE plugin_name LIKE 'rewrite%'' rewritten to 'select plugin_name, plugin_type |
| 15 |
from information_schema.plugins |
| 16 |
where plugin_name like 'rewrite%'' by a query rewrite plugin |
| 17 |
Note 1105 Query 'SHOW WARNINGS' rewritten to 'show warnings' by a query rewrite plugin |
| 18 |
# We roll our own show warnings here. We try GET DIAGNOSTICS at the same |
| 19 |
# time, so automatic SHOW WARNINGS would just be confusing. |
| 20 |
SELECT 'LOWERCASE'; |
| 21 |
lowercase |
| 22 |
lowercase |
| 23 |
SHOW WARNINGS; |
| 24 |
Level Code Message |
| 25 |
Note 1105 Query 'SELECT 'LOWERCASE'' rewritten to 'select 'lowercase'' by a query rewrite plugin |
| 26 |
Note 1105 Query 'SHOW WARNINGS' rewritten to 'show warnings' by a query rewrite plugin |
| 27 |
SELECT 'LOWERCASE AGAIN'; |
| 28 |
lowercase again |
| 29 |
lowercase again |
| 30 |
GET DIAGNOSTICS CONDITION 1 @c1p1 = MESSAGE_TEXT; |
| 31 |
GET DIAGNOSTICS CONDITION 2 @c2p1 = MESSAGE_TEXT; |
| 32 |
SELECT @c1p1; |
| 33 |
@c1p1 |
| 34 |
Query 'SELECT 'LOWERCASE AGAIN'' rewritten to 'select 'lowercase again'' by a query rewrite plugin |
| 35 |
SELECT @c2p1; |
| 36 |
@c2p1 |
| 37 |
Query 'GET DIAGNOSTICS CONDITION 1 @c1p1 = MESSAGE_TEXT' rewritten to 'get diagnostics condition 1 @c1p1 = message_text' by a query rewrite plugin |
| 38 |
UNINSTALL PLUGIN rewrite_example; |
| 39 |
Warnings: |
| 40 |
Note 1105 Query 'UNINSTALL PLUGIN rewrite_example' rewritten to 'uninstall plugin rewrite_example' by a query rewrite plugin |
| 41 |
Warning 1620 Plugin is busy and will be uninstalled on shutdown |
| 42 |
Note 1105 Query 'SHOW WARNINGS' rewritten to 'show warnings' by a query rewrite plugin |
| 43 |
SELECT 'UPPERCASE'; |
| 44 |
UPPERCASE |
| 45 |
UPPERCASE |