From 2806825a7d2acfedc407c9d1fa6f190f54f5596b Mon Sep 17 00:00:00 2001 From: xiluoduyu Date: Wed, 1 Apr 2026 02:02:57 +0800 Subject: [PATCH] fix where condition priority 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 --- pkg/sql/queue_schema_adapter_mysql.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/sql/queue_schema_adapter_mysql.go b/pkg/sql/queue_schema_adapter_mysql.go index 4f9a000..1dfb666 100644 --- a/pkg/sql/queue_schema_adapter_mysql.go +++ b/pkg/sql/queue_schema_adapter_mysql.go @@ -98,7 +98,7 @@ func (s MySQLQueueSchema) SelectQuery(params SelectQueryParams) (Query, error) { if s.GenerateWhereClause != nil { where, args = s.GenerateWhereClause(whereParams) if where != "" { - where = "AND " + where + where = "AND (" + where + ")" } }