]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6884 enforce collation SQL_Latin1_General_CP1_CS_AS when creating
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Fri, 2 Oct 2015 19:49:35 +0000 (21:49 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Fri, 2 Oct 2015 19:49:35 +0000 (21:49 +0200)
  columns on MSSQL

server/sonar-web/src/main/webapp/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/mssql/adapter.rb

index 6513da01f9dcce6797c06b95a66245263f1ef138..7e269d7bc3a4394d4cbcbd500cbd5a7c22f728d7 100644 (file)
@@ -79,9 +79,15 @@ module ::ArJdbc
       #
       # See: http://msdn.microsoft.com/en-us/library/ms186939.aspx
       if type.to_s == 'string' and limit == 1073741823 and sqlserver_version != "2000"
-        'NVARCHAR(MAX)'
+        # SONAR-6884 collation added
+        'NVARCHAR(MAX) COLLATE SQL_Latin1_General_CP1_CS_AS'
+        # /SONAR-6884
       elsif %w( boolean date datetime ).include?(type.to_s)
         super(type)   # cannot specify limit/precision/scale with these types
+      elsif type.to_s == 'string'
+        # SONAR-6884
+        super + ' COLLATE SQL_Latin1_General_CP1_CS_AS'
+        # /SONAR-6884
       else
         super
       end