activerecord-jdbc-adapter
activerecord-jdbc-adapter copied to clipboard
activerecord-jdbcmssql-adapter:: The column 'id' was specified multiple times for 't'.
Attempting to use jdbcmssql with JRuby/Redmine.
Generated query:
SELECT t.* FROM ( SELECT ROW_NUMBER() OVER(ORDER BY t.id DESC) AS _row_num, t.*
FROM (SELECT DISTINCT [journals].id, journals.id FROM [journals]
LEFT OUTER JOIN [issues] ON [issues].[id] = [journals].[journalized_id]
LEFT OUTER JOIN [projects] ON [projects].[id] = [issues].[project_id]
LEFT OUTER JOIN [journal_details] ON [journal_details].[journal_id] = [journals].[id]
LEFT OUTER JOIN [users] ON [users].[id] = [journals].[user_id] AND [users].[type] IN (N'User', N'AnonymousUser')
WHERE (journals.user_id = N'12') AND (projects.status <> 9
AND projects.id IN (
SELECT em.project_id FROM enabled_modules em WHERE em.name='issue_tracking'))
AND ((journals.private_notes = 0 OR (projects.status <> 9
AND projects.id IN (
SELECT em.project_id FROM enabled_modules em WHERE em.name='issue_tracking'))))
AND (journals.journalized_type = 'Issue'
AND (journal_details.prop_key = 'status_id' OR journals.notes <> ''))) AS t) AS t
WHERE t._row_num BETWEEN 1 AND 10
Msg 8156, Level 16, State 1, Line 15 The column 'id' was specified multiple times for 't'.
Occurs at line 81 in https://github.com/redmine/redmine/blob/2.5-stable/lib/plugins/acts_as_activity_provider/lib/acts_as_activity_provider.rb
Thanks, I'm happy to help debug it. I'm much more a java guy, than a ruby guy.
you can support MS-SQL fixes at BountySource
thanks for the report, we're a bit low on MS-SQL maintainers, the code is quite "non-trivial" and seems that every time someone fixes something other pieces might get broken. so I personally am happy to review and merge but have no motivation to get into SQLServer hacking (at least currently) ... please look into it if you really need it, esp. if it works in MRI some parts can be re-used from the activerecord-sqlserver-adapter gem, also be aware that there's other issues open that a fix might involve
Understand. I'll look into it. Thanks!