cmoran92-activerecord-jdbc-adapter 1.2.1 → 1.2.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
12
12
  s.summary = %q{JDBC adapter for ActiveRecord, for use within JRuby on Rails.}
13
13
  s.description = %q{activerecord-jdbc-adapter is a database adapter for Rails\' ActiveRecord
14
14
  component that can be used with JRuby[http://www.jruby.org/]. It allows use of
15
- virtually any JDBC-compliant database with your JRuby on Rails application. Includes patch by cmoran92 to eliminate duplicates when SELECTing DISTING with JOINS on MS SQL Server. }
15
+ virtually any JDBC-compliant database with your JRuby on Rails application. Includes patch by cmoran92 to eliminate duplicates when SELECTing DISTINCT with JOINS on MS SQL Server. }
16
16
  s.files = `git ls-files`.split("\n").reject {|v| v =~ /^(activerecord-jdbc[^-]|jdbc-)/}
17
17
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
18
  s.executables = `git ls-files -- bin/*`.split("\n").map{|f| File.basename(f) }
@@ -81,9 +81,14 @@ module ::ArJdbc
81
81
  end
82
82
  # We might want to add the condition that rest_of_query has at least one JOIN outside of signle quotes
83
83
  if select =~ /DISTINCT/
84
- order.gsub!(/([a-z0-9_])+\./, 't.')
85
- new_sql = "SELECT t.* FROM (SELECT ROW_NUMBER() OVER(#{order}) AS _row_num, t.* FROM (#{select} #{rest_of_query}"
86
- new_sql << ") AS t) AS t WHERE t._row_num BETWEEN #{start_row.to_s} AND #{end_row.to_s}"
84
+ t_cols = rest_of_query.sub(/ FROM .*/, '').gsub(/\[?[A-Za-z0-9_]+\]?\./, 't.')
85
+ new_sql = "SELECT #{t_cols} FROM (
86
+ SELECT ROW_NUMBER() OVER (ORDER BY (SELECT 1)) AS _row_num, #{t_cols} FROM (
87
+ SELECT DISTINCT #{t_cols} FROM (
88
+ SELECT ROW_NUMBER() OVER(#{order}) AS _row_num, #{rest_of_query}
89
+ ) AS t
90
+ ) AS t
91
+ ) AS t WHERE t._row_num BETWEEN #{start_row.to_s} AND #{end_row.to_s}"
87
92
  else
88
93
  new_sql = "#{select} t.* FROM (SELECT ROW_NUMBER() OVER(#{order}) AS _row_num, #{rest_of_query}"
89
94
  new_sql << ") AS t WHERE t._row_num BETWEEN #{start_row.to_s} AND #{end_row.to_s}"
@@ -1,6 +1,6 @@
1
1
  module ArJdbc
2
2
  module Version
3
- VERSION = "1.2.1"
3
+ VERSION = "1.2.1.1"
4
4
  end
5
5
  end
6
6
  # Compatibility with older versions of ar-jdbc for other extensions out there
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: cmoran92-activerecord-jdbc-adapter
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.2.1
5
+ version: 1.2.1.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Nick Sieger, Ola Bini and JRuby contributors
@@ -10,12 +10,13 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-01-25 00:00:00 Z
13
+ date: 2012-04-20 00:00:00 -04:00
14
+ default_executable:
14
15
  dependencies: []
15
16
 
16
17
  description: "activerecord-jdbc-adapter is a database adapter for Rails\\' ActiveRecord\n\
17
18
  component that can be used with JRuby[http://www.jruby.org/]. It allows use of\n\
18
- virtually any JDBC-compliant database with your JRuby on Rails application. Includes patch by cmoran92 to eliminate duplicates when SELECTing DISTING with JOINS on MS SQL Server. "
19
+ virtually any JDBC-compliant database with your JRuby on Rails application. Includes patch by cmoran92 to eliminate duplicates when SELECTing DISTINCT with JOINS on MS SQL Server. "
19
20
  email: nick@nicksieger.com, ola.bini@gmail.com
20
21
  executables: []
21
22
 
@@ -226,6 +227,7 @@ files:
226
227
  - test/simple.rb
227
228
  - test/sqlite3_simple_test.rb
228
229
  - test/sybase_jtds_simple_test.rb
230
+ has_rdoc: true
229
231
  homepage: https://github.com/jruby/activerecord-jdbc-adapter
230
232
  licenses: []
231
233
 
@@ -253,9 +255,78 @@ required_rubygems_version: !ruby/object:Gem::Requirement
253
255
  requirements: []
254
256
 
255
257
  rubyforge_project: jruby-extras
256
- rubygems_version: 1.8.15
258
+ rubygems_version: 1.5.1
257
259
  signing_key:
258
260
  specification_version: 3
259
261
  summary: JDBC adapter for ActiveRecord, for use within JRuby on Rails.
260
- test_files: []
261
-
262
+ test_files:
263
+ - test/abstract_db_create.rb
264
+ - test/activerecord/connection_adapters/type_conversion_test.rb
265
+ - test/activerecord/connections/native_jdbc_mysql/connection.rb
266
+ - test/activerecord/jall.sh
267
+ - test/activerecord/jtest.sh
268
+ - test/db/db2.rb
269
+ - test/db/derby.rb
270
+ - test/db/h2.rb
271
+ - test/db/hsqldb.rb
272
+ - test/db/informix.rb
273
+ - test/db/jdbc.rb
274
+ - test/db/jndi_config.rb
275
+ - test/db/logger.rb
276
+ - test/db/mssql.rb
277
+ - test/db/mysql.rb
278
+ - test/db/oracle.rb
279
+ - test/db/postgres.rb
280
+ - test/db/sqlite3.rb
281
+ - test/db2_simple_test.rb
282
+ - test/derby_migration_test.rb
283
+ - test/derby_multibyte_test.rb
284
+ - test/derby_simple_test.rb
285
+ - test/generic_jdbc_connection_test.rb
286
+ - test/h2_change_column_test.rb
287
+ - test/h2_simple_test.rb
288
+ - test/has_many_through.rb
289
+ - test/helper.rb
290
+ - test/hsqldb_simple_test.rb
291
+ - test/informix_simple_test.rb
292
+ - test/jdbc_common.rb
293
+ - test/jndi_callbacks_test.rb
294
+ - test/jndi_test.rb
295
+ - test/manualTestDatabase.rb
296
+ - test/models/add_not_null_column_to_table.rb
297
+ - test/models/auto_id.rb
298
+ - test/models/data_types.rb
299
+ - test/models/entry.rb
300
+ - test/models/mixed_case.rb
301
+ - test/models/reserved_word.rb
302
+ - test/models/string_id.rb
303
+ - test/models/thing.rb
304
+ - test/models/validates_uniqueness_of_string.rb
305
+ - test/mssql_db_create_test.rb
306
+ - test/mssql_identity_insert_test.rb
307
+ - test/mssql_legacy_types_test.rb
308
+ - test/mssql_limit_offset_test.rb
309
+ - test/mssql_multibyte_test.rb
310
+ - test/mssql_simple_test.rb
311
+ - test/mysql_db_create_test.rb
312
+ - test/mysql_index_length_test.rb
313
+ - test/mysql_info_test.rb
314
+ - test/mysql_multibyte_test.rb
315
+ - test/mysql_nonstandard_primary_key_test.rb
316
+ - test/mysql_simple_test.rb
317
+ - test/oracle_simple_test.rb
318
+ - test/oracle_specific_test.rb
319
+ - test/postgres_db_create_test.rb
320
+ - test/postgres_drop_db_test.rb
321
+ - test/postgres_information_schema_leak_test.rb
322
+ - test/postgres_mixed_case_test.rb
323
+ - test/postgres_native_type_mapping_test.rb
324
+ - test/postgres_nonseq_pkey_test.rb
325
+ - test/postgres_reserved_test.rb
326
+ - test/postgres_schema_search_path_test.rb
327
+ - test/postgres_simple_test.rb
328
+ - test/postgres_table_alias_length_test.rb
329
+ - test/postgres_type_conversion_test.rb
330
+ - test/simple.rb
331
+ - test/sqlite3_simple_test.rb
332
+ - test/sybase_jtds_simple_test.rb