From 532012d0d219b47c28d65f42302d335c52affb26 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Wed, 14 Aug 2013 18:13:42 +0200 Subject: [PATCH] Fix SQL for Oracle --- .../org/sonar/core/user/RoleMapper.xml | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sonar-core/src/main/resources/org/sonar/core/user/RoleMapper.xml b/sonar-core/src/main/resources/org/sonar/core/user/RoleMapper.xml index 10f52f8d5e0..7d7e9b075f7 100644 --- a/sonar-core/src/main/resources/org/sonar/core/user/RoleMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/user/RoleMapper.xml @@ -89,25 +89,25 @@ FROM group_roles WHERE resource_id=#{id} - SELECT COUNT(DISTINCT tmp.id) FROM ( SELECT u.id as id - FROM users AS u - INNER JOIN user_roles AS ur ON ur.user_id = u.id + FROM users u + INNER JOIN user_roles ur ON ur.user_id = u.id - AND (ur.role = #{permission} AND ur.resource_id IS NULL) - AND u.active = ${_true} + AND (ur.role=#{permission} AND ur.resource_id IS NULL) + AND u.active=${_true} UNION select u.id as id - FROM users as u - INNER JOIN groups_users AS gu ON gu.user_id = u.id - INNER JOIN group_roles AS gr ON gr.group_id = gu.group_id - INNER JOIN groups AS g ON g.id = gu.group_id + FROM users u + INNER JOIN groups_users gu ON gu.user_id = u.id + INNER JOIN group_roles gr ON gr.group_id = gu.group_id + INNER JOIN groups g ON g.id = gu.group_id - AND (gr.role = #{permission} AND gr.resource_id IS NULL) - AND u.active = ${_true} + AND (gr.role=#{permission} AND gr.resource_id IS NULL) + AND u.active=${_true} ) AS tmp -- 2.39.5