Skip to content

Commit ba82ee1

Browse files
authored
fix where condition priority (#58)
When where is "delayed_until <= UTC_TIMESTAMP() OR delayed_until IS NULL", tasks with NULL delayed_until will be repeatly executed, acked=1 wont work: WHERE acked = false AND delayed_until <= UTC_TIMESTAMP() OR delayed_until IS NULL
1 parent 3dfe5f8 commit ba82ee1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pkg/sql/queue_schema_adapter_mysql.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func (s MySQLQueueSchema) SelectQuery(params SelectQueryParams) (Query, error) {
9898
if s.GenerateWhereClause != nil {
9999
where, args = s.GenerateWhereClause(whereParams)
100100
if where != "" {
101-
where = "AND " + where
101+
where = "AND (" + where + ")"
102102
}
103103
}
104104

0 commit comments

Comments
 (0)