Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/dialect/mysql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ use crate::{

use super::keywords;

const RESERVED_FOR_TABLE_ALIAS_MYSQL: &[Keyword] = &[Keyword::USE, Keyword::IGNORE, Keyword::FORCE];
const RESERVED_FOR_TABLE_ALIAS_MYSQL: &[Keyword] = &[
Keyword::USE,
Keyword::IGNORE,
Keyword::FORCE,
Keyword::STRAIGHT_JOIN,
];

/// A [`Dialect`] for [MySQL](https://www.mysql.com/)
#[derive(Debug)]
Expand Down
6 changes: 6 additions & 0 deletions tests/sqlparser_mysql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3716,3 +3716,9 @@ fn parse_straight_join() {
"SELECT a.*, b.* FROM table_a AS a STRAIGHT_JOIN table_b AS b ON a.b_id = b.id",
);
}

#[test]
fn parse_straight_join_without_alias() {
mysql()
.verified_stmt("SELECT a.*, b.* FROM table_a STRAIGHT_JOIN table_b AS b ON a.b_id = b.id");
}
Comment thread
killertux marked this conversation as resolved.