diff --git a/code/datums/_ndatabase/code/brsql_adapter.dm b/code/datums/_ndatabase/code/brsql_adapter.dm index 345ddfe005f3..a424b3fd6f9e 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]" @@ -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)