[MDEV-28997] Drop TRIGGERs, FUNCTIONs and ROUTINEs from prepared statement Created: 2022-07-01  Updated: 2022-07-08  Resolved: 2022-07-08

Status: Closed
Project: MariaDB Server
Component/s: Prepared Statements
Fix Version/s: 10.6.2

Type: Task Priority: Minor
Reporter: Michaël de groot Assignee: Dmitry Shulga
Resolution: Duplicate Votes: 2
Labels: None

Issue Links:
Duplicate
duplicates MDEV-16708 Unsupported commands for prepared sta... Closed

 Description   

Hi,

In a Galera cluster it is not recommended to dml the MyISAM tables in the mysql schema. Therefore it is not possible to programatically drop triggers, stored procedures and functions by deleting it from the corresponding tables.

As a work-around, one can create a prepared statement to run the DDL. This works for ALTER TABLE statements. This way, from a stored procdure, one can programatically run alter tables.

Unfortunately, when using the same technique to drop a trigger, routine or function, this error appears:

MariaDB [dba]> set @bla='DROP TRIGGER `scehma`.`trigger_name`;';
Query OK, 0 rows affected (0.000 sec)
 
MariaDB [dba]> prepare smt from @bla;
ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet

Please implement this so we can do more DDL statements from stored procedures.

Thank you,
Michaël


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