@@ -3405,6 +3405,9 @@ pub enum Statement {
34053405 purge : bool ,
34063406 /// MySQL-specific "TEMPORARY" keyword
34073407 temporary : bool ,
3408+ /// MySQL-specific drop index syntax, which requires table specification
3409+ /// See <https://dev.mysql.com/doc/refman/8.4/en/drop-index.html>
3410+ table : Option < ObjectName > ,
34083411 } ,
34093412 /// ```sql
34103413 /// DROP FUNCTION
@@ -5242,17 +5245,24 @@ impl fmt::Display for Statement {
52425245 restrict,
52435246 purge,
52445247 temporary,
5245- } => write ! (
5246- f,
5247- "DROP {}{}{} {}{}{}{}" ,
5248- if * temporary { "TEMPORARY " } else { "" } ,
5249- object_type,
5250- if * if_exists { " IF EXISTS" } else { "" } ,
5251- display_comma_separated( names) ,
5252- if * cascade { " CASCADE" } else { "" } ,
5253- if * restrict { " RESTRICT" } else { "" } ,
5254- if * purge { " PURGE" } else { "" }
5255- ) ,
5248+ table,
5249+ } => {
5250+ write ! (
5251+ f,
5252+ "DROP {}{}{} {}{}{}{}" ,
5253+ if * temporary { "TEMPORARY " } else { "" } ,
5254+ object_type,
5255+ if * if_exists { " IF EXISTS" } else { "" } ,
5256+ display_comma_separated( names) ,
5257+ if * cascade { " CASCADE" } else { "" } ,
5258+ if * restrict { " RESTRICT" } else { "" } ,
5259+ if * purge { " PURGE" } else { "" } ,
5260+ ) ?;
5261+ if let Some ( table_name) = table. as_ref ( ) {
5262+ write ! ( f, " ON {}" , table_name) ?;
5263+ } ;
5264+ Ok ( ( ) )
5265+ }
52565266 Statement :: DropFunction {
52575267 if_exists,
52585268 func_desc,
0 commit comments