From c13608d620bd8f09ffb21a64779c0a5642ab97b6 Mon Sep 17 00:00:00 2001 From: Morrow Date: Tue, 17 Oct 2023 15:58:19 -0400 Subject: [PATCH 1/2] take 1 --- code/datums/_ndatabase/code/brsql_adapter.dm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/code/datums/_ndatabase/code/brsql_adapter.dm b/code/datums/_ndatabase/code/brsql_adapter.dm index 345ddfe005..867edccccd 100644 --- a/code/datums/_ndatabase/code/brsql_adapter.dm +++ b/code/datums/_ndatabase/code/brsql_adapter.dm @@ -539,9 +539,7 @@ issue_log += "No ID passed to update query." return "" // AAAAAAAAAAAAAH FUCK DON'T JUST KILL THE ENTIRE FUCKING TABLE BRUH return {" - WITH __prep_update as ( - [calltext] - ) UPDATE `[connection.database]`.`[table_name]` INNER JOIN `__prep_update` ON `[table_name]`.id = `__prep_update`.id SET [update_items] + UPDATE `[connection.database]`.`[table_name]` JOIN (WITH `__prep_update` AS ( [calltext] ) SELECT * FROM `__prep_update`) subquery ON `[table_name]`.id = subquery.id SET [update_items] "} /datum/db/adapter/brsql_adapter/proc/getquery_delete_table(table_name, list/ids) From d6f013753fcd1d1ecbae01d2056f3616264e8923 Mon Sep 17 00:00:00 2001 From: Morrow Date: Tue, 17 Oct 2023 17:28:43 -0400 Subject: [PATCH 2/2] AND THAT --- code/datums/_ndatabase/code/brsql_adapter.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/datums/_ndatabase/code/brsql_adapter.dm b/code/datums/_ndatabase/code/brsql_adapter.dm index 867edccccd..a424b3fd6f 100644 --- a/code/datums/_ndatabase/code/brsql_adapter.dm +++ b/code/datums/_ndatabase/code/brsql_adapter.dm @@ -530,7 +530,7 @@ if(first && !is_id) if(!items_first) update_items+="," - update_items+="`[table_name]`.[esfield]=`__prep_update`.[esfield]" + update_items+="`[table_name]`.[esfield]=`subquery`.[esfield]" items_first = FALSE local_first = FALSE calltext += "SELECT [local_text]"