aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/sonar-cpd-plugin
diff options
context:
space:
mode:
authorEvgeny Mandrikov <mandrikov@gmail.com>2011-09-12 14:31:32 +0400
committerEvgeny Mandrikov <mandrikov@gmail.com>2011-09-12 14:34:41 +0400
commit1b3f6adab1dda10eedd8a001610ba48e3e7e531d (patch)
tree6de2d89be9d8697e19b8763e8ccfce81b7317b53 /plugins/sonar-cpd-plugin
parentaf240688287e22148916cb61d7a5a2071f1de4e6 (diff)
downloadsonarqube-1b3f6adab1dda10eedd8a001610ba48e3e7e531d.tar.gz
sonarqube-1b3f6adab1dda10eedd8a001610ba48e3e7e531d.zip
SONAR-1091 Fix SQL for Oracle
Don't use 'resource' as table alias, because it's reserved word.
Diffstat (limited to 'plugins/sonar-cpd-plugin')
-rw-r--r--plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/index/DbDuplicationsIndex.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/index/DbDuplicationsIndex.java b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/index/DbDuplicationsIndex.java
index a0a5529483b..9cff050f2ad 100644
--- a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/index/DbDuplicationsIndex.java
+++ b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/index/DbDuplicationsIndex.java
@@ -76,13 +76,13 @@ public class DbDuplicationsIndex {
int resourceSnapshotId = getSnapshotIdFor(resource);
// Order of columns is important - see code below!
- String sql = "SELECT to_blocks.hash, resource.kee, to_blocks.index_in_file, to_blocks.start_line, to_blocks.end_line" +
- " FROM duplications_index to_blocks, duplications_index from_blocks, snapshots snapshot, projects resource" +
+ String sql = "SELECT to_blocks.hash, res.kee, to_blocks.index_in_file, to_blocks.start_line, to_blocks.end_line" +
+ " FROM duplications_index to_blocks, duplications_index from_blocks, snapshots snapshot, projects res" +
" WHERE from_blocks.snapshot_id = :resource_snapshot_id" +
" AND to_blocks.hash = from_blocks.hash" +
" AND to_blocks.snapshot_id = snapshot.id" +
" AND snapshot.islast = :is_last" +
- " AND snapshot.project_id = resource.id";
+ " AND snapshot.project_id = res.id";
if (lastSnapshotId != null) {
// Filter for blocks from previous snapshot of current project
sql += " AND to_blocks.project_snapshot_id != :last_project_snapshot_id";