Skip to content

Commit

Permalink
fix(tidb-reserverd-word): groups, rank
Browse files Browse the repository at this point in the history
  • Loading branch information
wd0517 committed Feb 16, 2020
1 parent 8e0c474 commit cc1bb97
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/pretty_text.rb
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ def self.lookup_mentions(names, user_id: nil)
SELECT
:group_type AS type,
lower(name) AS name
FROM groups
FROM `groups`
WHERE lower(name) IN (:names) AND (#{Group.mentionable_sql_clause})
)
SQL
Expand Down
2 changes: 1 addition & 1 deletion lib/score_calculator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def update_posts_rank(opts)
SELECT posts.id, Y.percent_rank
FROM posts
JOIN (
SELECT id, case when c = 1 then 1 else (rank -1)/(c - 1) end as percent_rank
SELECT id, case when c = 1 then 1 else (`rank` -1)/(c - 1) end as percent_rank
FROM (select posts.id,posts.topic_id,
posts.score, count(lesser.id) + 1 as rank
from posts
Expand Down

0 comments on commit cc1bb97

Please sign in to comment.