mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-07-08 01:15:00 +00:00
MySQL: Support index_name
in FK constraints (#1871)
This commit is contained in:
parent
5327f0ce13
commit
de2cc7b502
5 changed files with 31 additions and 7 deletions
|
@ -3988,6 +3988,13 @@ fn parse_straight_join() {
|
|||
.verified_stmt("SELECT a.*, b.* FROM table_a STRAIGHT_JOIN table_b AS b ON a.b_id = b.id");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn mysql_foreign_key_with_index_name() {
|
||||
mysql().verified_stmt(
|
||||
"CREATE TABLE orders (customer_id INT, INDEX idx_customer (customer_id), CONSTRAINT fk_customer FOREIGN KEY idx_customer (customer_id) REFERENCES customers(id))",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_drop_index() {
|
||||
let sql = "DROP INDEX idx_name ON table_name";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue