Skip to content

Commit

Permalink
Support MySQL 8.x as well as my ancient version of MariaDB
Browse files Browse the repository at this point in the history
  • Loading branch information
payten committed Apr 1, 2021
1 parent a6750af commit 32be1a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/model/spreadsheet_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def calculate_max_subrecords
.filter(:archival_object_id => @ao_ids)
.filter(Sequel.like(:notes, '%"type":"'+note_type.to_s+'"%'))
.group(:archival_object_id)
.select(Sequel.lit("CAST(SUM(CAST(((LENGTH(`notes`) - LENGTH(REPLACE(`notes`, '#{text_string}', ''))) / #{text_string.length}) AS int)) AS int) AS count"))
.select(Sequel.lit("CAST(SUM(CAST(((LENGTH(`notes`) - LENGTH(REPLACE(`notes`, '#{text_string}', ''))) / #{text_string.length}) AS SIGNED)) AS SIGNED) AS count"))
.from_self
.select(Sequel.lit("MAX(count) AS max"))

Expand Down

0 comments on commit 32be1a4

Please sign in to comment.