Skip to content
代码片段 群组 项目
提交 e6e69c5c 编辑于 作者: Roy Zwambag's avatar Roy Zwambag
浏览文件

Merge branch '398772-json-serialization-of-bigdecimal-values-in-postgres-14' into 'master'

Casts EXTRACT result as double precision in preparation for PG 14

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/117150



Merged-by: default avatarRoy Zwambag <rzwambag@gitlab.com>
Approved-by: default avatarRoy Zwambag <rzwambag@gitlab.com>
Approved-by: default avatarAdam Hegyi <ahegyi@gitlab.com>
Approved-by: default avatarAaron Huntsman <ahuntsman@gitlab.com>
Co-authored-by: default avatarLeonardo Rosa <ldarosa@gitlab.com>
无相关合并请求
......@@ -74,7 +74,7 @@ def upsert_data(data)
query = <<~SQL
INSERT INTO #{quoted_table_name}
(
stage_event_hash_id,
stage_event_hash_id,
#{connection.quote_column_name(issuable_id_column)},
group_id,
project_id,
......
......@@ -41,7 +41,7 @@ def average
end
def average_in_seconds
Arel::Nodes::Extract.new(average, :epoch)
Arel::Nodes::NamedFunction.new('CAST', [Arel::Nodes::Extract.new(average, :epoch).as('double precision')])
end
end
end
......
......@@ -38,7 +38,8 @@ def percentile_cont
end
def median_duration_in_seconds
Arel::Nodes::Extract.new(percentile_cont, :epoch)
Arel::Nodes::NamedFunction.new('CAST',
[Arel::Nodes::Extract.new(percentile_cont, :epoch).as('double precision')])
end
end
end
......
......@@ -13,7 +13,9 @@ def zero_interval
end
def round_duration_to_seconds
Arel::Nodes::NamedFunction.new('ROUND', [Arel::Nodes::Extract.new(duration, :epoch)])
Arel::Nodes::NamedFunction.new('ROUND', [
Arel::Nodes::NamedFunction.new('CAST', [Arel::Nodes::Extract.new(duration, :epoch).as('double precision')])
])
end
def duration
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册