aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Gageot <david@gageot.net>2012-10-08 10:19:52 +0200
committerDavid Gageot <david@gageot.net>2012-10-08 10:19:52 +0200
commit05878a9361d89e086c4ec3e2b2ebd0de0761f0a2 (patch)
treece3606bcc1c77ea5bc49bd33449914f75be2f7a2
parentc7773cfab68b32bcba0e9a129fdb04ce43cc5774 (diff)
downloadsonarqube-05878a9361d89e086c4ec3e2b2ebd0de0761f0a2.tar.gz
sonarqube-05878a9361d89e086c4ec3e2b2ebd0de0761f0a2.zip
SONAR-3765 Better fix
-rw-r--r--sonar-core/src/main/java/org/sonar/core/persistence/dialect/H2.java2
-rw-r--r--sonar-core/src/test/java/org/sonar/core/persistence/dialect/H2Test.java2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/config/initializers/better_quoting.rb14
3 files changed, 2 insertions, 16 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/persistence/dialect/H2.java b/sonar-core/src/main/java/org/sonar/core/persistence/dialect/H2.java
index 3e572aaae35..0c80c7dc445 100644
--- a/sonar-core/src/main/java/org/sonar/core/persistence/dialect/H2.java
+++ b/sonar-core/src/main/java/org/sonar/core/persistence/dialect/H2.java
@@ -30,7 +30,7 @@ public class H2 extends AbstractDialect {
public static final String ID = "h2";
public H2() {
- super(ID, "h2", "org.h2.Driver", "true", "false", "SELECT 1");
+ super(ID, ".h2.", "org.h2.Driver", "true", "false", "SELECT 1");
}
public Class<? extends org.hibernate.dialect.Dialect> getHibernateDialectClass() {
diff --git a/sonar-core/src/test/java/org/sonar/core/persistence/dialect/H2Test.java b/sonar-core/src/test/java/org/sonar/core/persistence/dialect/H2Test.java
index 6c4737514d1..15a519e70f1 100644
--- a/sonar-core/src/test/java/org/sonar/core/persistence/dialect/H2Test.java
+++ b/sonar-core/src/test/java/org/sonar/core/persistence/dialect/H2Test.java
@@ -42,7 +42,7 @@ public class H2Test {
@Test
public void should_configure() {
assertThat(h2.getId()).isEqualTo("h2");
- assertThat(h2.getActiveRecordDialectCode()).isEqualTo("h2");
+ assertThat(h2.getActiveRecordDialectCode()).isEqualTo(".h2.");
assertThat(h2.getDefaultDriverClassName()).isEqualTo("org.h2.Driver");
assertThat(h2.getValidationQuery()).isEqualTo("SELECT 1");
}
diff --git a/sonar-server/src/main/webapp/WEB-INF/config/initializers/better_quoting.rb b/sonar-server/src/main/webapp/WEB-INF/config/initializers/better_quoting.rb
deleted file mode 100644
index 60071f649ca..00000000000
--- a/sonar-server/src/main/webapp/WEB-INF/config/initializers/better_quoting.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# Override quoting for database without a specific jdbc adapter
-# for example, H2
-#
-# Default quoting leads to bugs, see SONAR-3765
-#
-module ActiveRecord
- module ConnectionAdapters # :nodoc:
- module Quoting
- def quote_string(s)
- s.gsub(/'/, "''") # ' (for ruby-mode)
- end
- end
- end
-end