Skip to content

Commit

Permalink
Fix unittests
Browse files Browse the repository at this point in the history
  • Loading branch information
EinKrebs committed Jan 11, 2024
1 parent f1a0ab4 commit feb561b
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions router/qrouter/proxy_routing.go
Original file line number Diff line number Diff line change
Expand Up @@ -438,28 +438,28 @@ func (qr *ProxyQrouter) getRelations(qstmt lyx.Node) (StatementRelation, error)
return &AnyRelation{}, ComplexQuery
}
case *lyx.Select:
if stmt.FromClause == nil {
return nil, nil
}
if len(stmt.FromClause) == 0 {

/* Step 1.4.8: select a_expr is routable to any shard in case when a_expr is some type of
data-independent expr */
any_routable := true
for _, expr := range stmt.TargetList {
switch expr.(type) {
case *lyx.AExprConst:
// ok
default:
any_routable = false
}
}
if any_routable {
return &AnyRelation{}, nil
}
}

// Get first relation name out of FROM clause
if stmt.FromClause == nil || len(stmt.FromClause) == 0 {
return &AnyRelation{}, nil
}
//if len(stmt.FromClause) == 0 {
//
// /* Step 1.4.8: select a_expr is routable to any shard in case when a_expr is some type of
// data-independent expr */
// any_routable := true
// for _, expr := range stmt.TargetList {
// switch expr.(type) {
// case *lyx.AExprConst:
// // ok
// default:
// any_routable = false
// }
// }
// if any_routable {
// return &AnyRelation{}, nil
// }
//}

// Get relation names out of FROM clause
return qr.getRelationFromNode(stmt.FromClause[0])
case *lyx.Delete:
return qr.getRelationFromNode(stmt.TableRef)
Expand Down

0 comments on commit feb561b

Please sign in to comment.