Skip to content

Commit e04720e

Browse files
committed
Update GenericDialect with update order by support
1 parent e26da29 commit e04720e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/dialect/generic.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ impl Dialect for GenericDialect {
133133
true
134134
}
135135

136+
fn supports_update_order_by(&self) -> bool {
137+
true
138+
}
139+
136140
fn supports_from_first_select(&self) -> bool {
137141
true
138142
}

tests/sqlparser_mysql.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2788,7 +2788,7 @@ fn parse_update_with_joins() {
27882788
#[test]
27892789
fn parse_update_with_order_by() {
27902790
let sql = "UPDATE foo SET bar = false WHERE foo = true ORDER BY foo ASC";
2791-
match mysql().verified_stmt(sql) {
2791+
match mysql_and_generic().verified_stmt(sql) {
27922792
Statement::Update(Update { order_by, .. }) => {
27932793
assert_eq!(
27942794
vec![OrderByExpr {
@@ -2813,7 +2813,7 @@ fn parse_update_with_order_by() {
28132813
#[test]
28142814
fn parse_update_with_order_by_and_limit() {
28152815
let sql = "UPDATE foo SET bar = false WHERE foo = true ORDER BY foo ASC LIMIT 10";
2816-
match mysql().verified_stmt(sql) {
2816+
match mysql_and_generic().verified_stmt(sql) {
28172817
Statement::Update(Update { order_by, limit, .. }) => {
28182818
assert_eq!(
28192819
vec![OrderByExpr {

0 commit comments

Comments
 (0)