activerecord-sqlserver-adapter 3.1.6 → 3.1.7

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,4 +1,17 @@
1
1
 
2
+ * 3.1.7 *
3
+
4
+ * Fix exists? with offset by patching visitor. Fixes #171 and Fixes #167
5
+
6
+ * Set default text size to 2147483647 for TinyTDS connections. Fixes #181
7
+
8
+ * Set @config ivar for 3rd party libs. Fixes #177
9
+
10
+ * Strengthen #query_requires_identity_insert? by looking for VALUES at the end. Fixes #178
11
+
12
+ * Make #sql_type_for_statement work for integers that may have empty parens or none at all. Fixes #175
13
+
14
+
2
15
  * 3.1.6 *
3
16
 
4
17
  * Add explicit order-by clause for windowed results. Fixes #161.
@@ -372,7 +372,7 @@ module ActiveRecord
372
372
  if insert_sql?(sql)
373
373
  table_name = get_table_name(sql)
374
374
  id_column = identity_column(table_name)
375
- id_column && sql =~ /^\s*(INSERT|EXEC sp_executesql N'INSERT)[^(]+\([^)]*\b(#{id_column.name})\b,?[^)]*\)/i ? quote_table_name(table_name) : false
375
+ id_column && sql =~ /^\s*(INSERT|EXEC sp_executesql N'INSERT)[^(]+\([^)]*\b(#{id_column.name})\b,?[^)]*\).*?VALUES/i ? quote_table_name(table_name) : false
376
376
  else
377
377
  false
378
378
  end
@@ -3,7 +3,7 @@ module ActiveRecord
3
3
  module Sqlserver
4
4
  module Version
5
5
 
6
- VERSION = '3.1.6'
6
+ VERSION = '3.1.7'
7
7
 
8
8
  end
9
9
  end
@@ -91,7 +91,7 @@ module ActiveRecord
91
91
 
92
92
  def sql_type_for_statement
93
93
  if is_integer? || is_real?
94
- sql_type.sub(/\(\d+\)/,'')
94
+ sql_type.sub(/\((\d+)?\)/,'')
95
95
  else
96
96
  sql_type
97
97
  end
@@ -197,6 +197,7 @@ module ActiveRecord
197
197
  @connection_options = config
198
198
  connect
199
199
  super(@connection, logger)
200
+ @config = config
200
201
  @database_version = info_schema_query { select_value('SELECT @@version') }
201
202
  @database_year = begin
202
203
  if @database_version =~ /Microsoft SQL Azure/i
@@ -423,6 +424,7 @@ module ActiveRecord
423
424
  client.execute("SET CURSOR_CLOSE_ON_COMMIT OFF").do
424
425
  client.execute("SET IMPLICIT_TRANSACTIONS OFF").do
425
426
  end
427
+ client.execute("SET TEXTSIZE 2147483647").do
426
428
  end
427
429
  when :odbc
428
430
  if config[:dsn].include?(';')
@@ -155,7 +155,7 @@ module Arel
155
155
  end
156
156
  [ ("SELECT" if !windowed),
157
157
  (visit(o.limit) if o.limit && !windowed),
158
- (projections.map{ |x| visit(x) }.join(', ')),
158
+ (projections.map{ |x| v = visit(x); v == "1" ? "1 AS [__wrp]" : v }.join(', ')),
159
159
  (source_with_lock_for_select_statement(o)),
160
160
  ("WHERE #{core.wheres.map{ |x| visit(x) }.join ' AND ' }" unless core.wheres.empty?),
161
161
  ("GROUP BY #{groups.map { |x| visit x }.join ', ' }" unless groups.empty?),
metadata CHANGED
@@ -1,15 +1,10 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: activerecord-sqlserver-adapter
3
- version: !ruby/object:Gem::Version
4
- hash: 15
3
+ version: !ruby/object:Gem::Version
4
+ version: 3.1.7
5
5
  prerelease:
6
- segments:
7
- - 3
8
- - 1
9
- - 6
10
- version: 3.1.6
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Ken Collins
14
9
  - Murray Steele
15
10
  - Shawn Balestracci
@@ -18,34 +13,25 @@ authors:
18
13
  autorequire:
19
14
  bindir: bin
20
15
  cert_chain: []
21
-
22
- date: 2012-02-08 00:00:00 Z
23
- dependencies:
24
- - !ruby/object:Gem::Dependency
16
+ date: 2012-04-13 00:00:00.000000000 Z
17
+ dependencies:
18
+ - !ruby/object:Gem::Dependency
25
19
  name: activerecord
26
- prerelease: false
27
- requirement: &id001 !ruby/object:Gem::Requirement
20
+ requirement: &70306769696760 !ruby/object:Gem::Requirement
28
21
  none: false
29
- requirements:
22
+ requirements:
30
23
  - - ~>
31
- - !ruby/object:Gem::Version
32
- hash: 3
33
- segments:
34
- - 3
35
- - 1
36
- - 0
24
+ - !ruby/object:Gem::Version
37
25
  version: 3.1.0
38
26
  type: :runtime
39
- version_requirements: *id001
27
+ prerelease: false
28
+ version_requirements: *70306769696760
40
29
  description: SQL Server 2005 and 2008 Adapter For ActiveRecord
41
30
  email: ken@metaskills.net
42
31
  executables: []
43
-
44
32
  extensions: []
45
-
46
33
  extra_rdoc_files: []
47
-
48
- files:
34
+ files:
49
35
  - CHANGELOG
50
36
  - MIT-LICENSE
51
37
  - lib/active_record/connection_adapters/sqlserver/core_ext/active_record.rb
@@ -62,36 +48,26 @@ files:
62
48
  - lib/arel/visitors/sqlserver.rb
63
49
  homepage: http://github.com/rails-sqlserver/activerecord-sqlserver-adapter
64
50
  licenses: []
65
-
66
51
  post_install_message:
67
52
  rdoc_options: []
68
-
69
- require_paths:
53
+ require_paths:
70
54
  - lib
71
- required_ruby_version: !ruby/object:Gem::Requirement
55
+ required_ruby_version: !ruby/object:Gem::Requirement
72
56
  none: false
73
- requirements:
74
- - - ">="
75
- - !ruby/object:Gem::Version
76
- hash: 3
77
- segments:
78
- - 0
79
- version: "0"
80
- required_rubygems_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ! '>='
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ required_rubygems_version: !ruby/object:Gem::Requirement
81
62
  none: false
82
- requirements:
83
- - - ">="
84
- - !ruby/object:Gem::Version
85
- hash: 3
86
- segments:
87
- - 0
88
- version: "0"
63
+ requirements:
64
+ - - ! '>='
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
89
67
  requirements: []
90
-
91
68
  rubyforge_project: activerecord-sqlserver-adapter
92
- rubygems_version: 1.8.15
69
+ rubygems_version: 1.8.17
93
70
  signing_key:
94
71
  specification_version: 3
95
72
  summary: SQL Server 2005 and 2008 Adapter For ActiveRecord.
96
73
  test_files: []
97
-