Skip to content

Commit

Permalink
MariaDB compatability update (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
morrowwolf authored and harryob committed Oct 20, 2023
1 parent 1279c77 commit 7af7fbe
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 7af7fbe

Please sign in to comment.