From 390ee3113bd203cad89ff7d7cb0cf2da154c40c4 Mon Sep 17 00:00:00 2001 From: Lucas Abel <22837557+uael@users.noreply.github.com> Date: Thu, 28 Nov 2024 17:29:16 +0100 Subject: [PATCH] fix: invalid `null` comparison while inserting flow node (#4815) --- ...414271b96d251bcf54c153c45370d917eea9d.json | 27 +++++++++++++++++++ .../windmill-worker/src/worker_lockfiles.rs | 5 +++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 backend/.sqlx/query-dc32e9e81eab9cda88875020acc414271b96d251bcf54c153c45370d917eea9d.json diff --git a/backend/.sqlx/query-dc32e9e81eab9cda88875020acc414271b96d251bcf54c153c45370d917eea9d.json b/backend/.sqlx/query-dc32e9e81eab9cda88875020acc414271b96d251bcf54c153c45370d917eea9d.json new file mode 100644 index 0000000000..dc4d68cd63 --- /dev/null +++ b/backend/.sqlx/query-dc32e9e81eab9cda88875020acc414271b96d251bcf54c153c45370d917eea9d.json @@ -0,0 +1,27 @@ +{ + "db_name": "PostgreSQL", + "query": "\n WITH existing AS (\n SELECT id FROM flow_node\n WHERE hash = $1 AND path = $2 AND workspace_id = $3\n AND (code IS NOT DISTINCT FROM $4)\n AND (lock IS NOT DISTINCT FROM $5)\n AND (flow IS NOT DISTINCT FROM $6)\n LIMIT 1\n ),\n inserted AS (\n INSERT INTO flow_node (hash, path, workspace_id, code, lock, flow)\n VALUES ($1, $2, $3, $4, $5, $6)\n ON CONFLICT DO NOTHING\n RETURNING id\n )\n SELECT id FROM existing\n UNION ALL\n SELECT id FROM inserted\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int8" + } + ], + "parameters": { + "Left": [ + "Int8", + "Text", + "Text", + "Text", + "Text", + "Jsonb" + ] + }, + "nullable": [ + null + ] + }, + "hash": "dc32e9e81eab9cda88875020acc414271b96d251bcf54c153c45370d917eea9d" +} diff --git a/backend/windmill-worker/src/worker_lockfiles.rs b/backend/windmill-worker/src/worker_lockfiles.rs index d647381b42..552e15dce5 100644 --- a/backend/windmill-worker/src/worker_lockfiles.rs +++ b/backend/windmill-worker/src/worker_lockfiles.rs @@ -1023,7 +1023,10 @@ async fn insert_flow_node<'c>( r#" WITH existing AS ( SELECT id FROM flow_node - WHERE hash = $1 AND path = $2 AND workspace_id = $3 AND code = $4 AND lock = $5 AND (flow IS NOT DISTINCT FROM $6) + WHERE hash = $1 AND path = $2 AND workspace_id = $3 + AND (code IS NOT DISTINCT FROM $4) + AND (lock IS NOT DISTINCT FROM $5) + AND (flow IS NOT DISTINCT FROM $6) LIMIT 1 ), inserted AS (