Skip to content

Commit

Permalink
backports mariadb compatibility (#4735)
Browse files Browse the repository at this point in the history
thanks morrow cmss13-devs/cmss13-pve#9

🆑 Morrow
server: the rustg mysql driver is now properly compatible with mariadb
/🆑

Co-authored-by: morrowwolf <[email protected]>
  • Loading branch information
harryob and morrowwolf authored Oct 21, 2023
1 parent d6bdc12 commit 972d3f3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions code/datums/_ndatabase/code/brsql_adapter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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]"
Expand All @@ -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)
Expand Down

0 comments on commit 972d3f3

Please sign in to comment.