File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -102,14 +102,15 @@ impl Dialect for MySqlDialect {
102102 ) -> Option < Result < crate :: ast:: Expr , ParserError > > {
103103 // Parse DIV as an operator
104104 if parser. parse_keyword ( Keyword :: DIV ) {
105- let right = match parser. parse_expr ( ) {
106- Ok ( val) => val,
105+ let left = Box :: new ( expr. clone ( ) ) ;
106+ let right = Box :: new ( match parser. parse_expr ( ) {
107+ Ok ( expr) => expr,
107108 Err ( e) => return Some ( Err ( e) ) ,
108- } ;
109+ } ) ;
109110 Some ( Ok ( Expr :: BinaryOp {
110- left : Box :: new ( expr . clone ( ) ) ,
111+ left,
111112 op : BinaryOperator :: MyIntegerDivide ,
112- right : Box :: new ( right ) ,
113+ right,
113114 } ) )
114115 } else {
115116 None
Original file line number Diff line number Diff line change @@ -89,15 +89,11 @@ impl Dialect for SQLiteDialect {
8989 ] {
9090 if parser. parse_keyword ( keyword) {
9191 let left = Box :: new ( expr. clone ( ) ) ;
92- let right = match parser. parse_expr ( ) {
93- Ok ( val ) => val ,
92+ let right = Box :: new ( match parser. parse_expr ( ) {
93+ Ok ( expr ) => expr ,
9494 Err ( e) => return Some ( Err ( e) ) ,
95- } ;
96- return Some ( Ok ( Expr :: BinaryOp {
97- left,
98- op,
99- right : Box :: new ( right) ,
100- } ) ) ;
95+ } ) ;
96+ return Some ( Ok ( Expr :: BinaryOp { left, op, right } ) ) ;
10197 }
10298 }
10399 None
You can’t perform that action at this time.
0 commit comments