You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "vimko (via GitHub)" <gi...@apache.org> on 2025/05/27 14:12:32 UTC
[I] mysql: `DROP INDEX` and an error occurs [datafusion-sqlparser-rs]
vimko opened a new issue, #1863:
URL: https://github.com/apache/datafusion-sqlparser-rs/issues/1863
With v0.56.0 using the mysql dialect, use the `parse_sql` function to parse `DROP INDEX idx_name ON table_demo;` or `ALTER TABLE tbl_name DROP INDEX idx_name;` and an error occurs.
```rust
use sqlparser::dialect::MySqlDialect;
use sqlparser::parser::Parser;
fn main() {
let sql = "DROP INDEX idx_name ON table_demo;";
let dialect = MySqlDialect {}; // or AnsiDialect, or your own dialect ...
let ast = Parser::parse_sql(&dialect, sql).unwrap();
println!("AST: {:?}", ast);
}
```
Report the following error:
```
called `Result::unwrap()` on an `Err` value: ParserError("Expected: end of statement, found: ON at Line: 1, Column: 21")
```
In the official documentation of MySQL, when deleting an index, you need to specify the table where the index is located.
```sql
DROP INDEX index_name ON tbl_name
[algorithm_option | lock_option] ...
algorithm_option:
ALGORITHM [=] {DEFAULT | INPLACE | COPY}
lock_option:
LOCK [=] {DEFAULT | NONE | SHARED | EXCLUSIVE}
```
https://dev.mysql.com/doc/refman/8.0/en/drop-index.html
Would you classify this as a bug?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] mysql: `DROP INDEX idx_xxx on t` and an error occurs [datafusion-sqlparser-rs]
Posted by "LucaCappelletti94 (via GitHub)" <gi...@apache.org>.
LucaCappelletti94 closed issue #1863: mysql: `DROP INDEX idx_xxx on t` and an error occurs
URL: https://github.com/apache/datafusion-sqlparser-rs/issues/1863
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] mysql: `DROP INDEX idx_xxx on t` and an error occurs [datafusion-sqlparser-rs]
Posted by "LucaCappelletti94 (via GitHub)" <gi...@apache.org>.
LucaCappelletti94 commented on issue #1863:
URL: https://github.com/apache/datafusion-sqlparser-rs/issues/1863#issuecomment-5779537947
Closing as resolved in https://github.com/apache/datafusion-sqlparser-rs/pull/1864
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org