From 972d3f3c6b41a6b93b41c1dc5aa46df8b25fcb8d Mon Sep 17 00:00:00 2001 From: harryob Date: Sat, 21 Oct 2023 23:08:20 +0100 Subject: [PATCH] backports mariadb compatibility (#4735) thanks morrow https://github.com/PvE-CMSS13/PvE-CMSS13/pull/9 :cl: Morrow server: the rustg mysql driver is now properly compatible with mariadb /:cl: Co-authored-by: morrowwolf --- code/datums/_ndatabase/code/brsql_adapter.dm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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)