tiny_tds 1.1.0 → 1.2.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6c6ebe14945fb3158078d43e1d5ddea21d796985
4
- data.tar.gz: f7d810a55c416e50a45ba9600f512d06c2d7cc90
3
+ metadata.gz: 73739198ed720ce62bb4155a3ff62fa57c2f253e
4
+ data.tar.gz: bd23c3eaf52c14526f74bbee4540f43694967c83
5
5
  SHA512:
6
- metadata.gz: d466970838b8a143d961a28ca553f0ef1c1cd7b152c4bd408e8cea2f811d1c59441debf2496413b418f320fba311eef215f981e4529abd31b84f837b0ff9725e
7
- data.tar.gz: f2b783a226c06af4eaac3a4f33d4462b5af0fbeb6d8e37ab6127b86c2fd6528bf927637505ff7d264a6fe8da5592c6e29dfaf39550db0d3505b47365ad083e86
6
+ metadata.gz: 7491d68d7a71c70882652b3898ea57d77e6e63eeddfcafb8e2a219017df99c8a3c9c099d097766769533dda4f5fa1219f0631d96be29990f08b9fb0cfbceaa79
7
+ data.tar.gz: bf3971e242f4054f9e8d27fc470f5992da70c0116b3a13136dee1e00bfdd7a42bbf7d73d4d6fcfa3432ad32a658b897818704e1b33792f59e3a45d16cad87199
@@ -0,0 +1 @@
1
+ *.diff eol=lf
data/README.md CHANGED
@@ -5,6 +5,7 @@
5
5
  * [![Build Status](https://ci.appveyor.com/api/projects/status/g2bhhbsdkx0mal55/branch/master?svg=true)](https://ci.appveyor.com/project/rails-sqlserver/tiny-tds/branch/master) - Appveyor
6
6
  * [![Code Climate](https://codeclimate.com/github/rails-sqlserver/tiny_tds/badges/gpa.svg)](https://codeclimate.com/github/rails-sqlserver/tiny_tds) - Code Climate
7
7
  * [![Gem Version](https://img.shields.io/gem/v/tiny_tds.svg)](https://rubygems.org/gems/tiny_tds) - Gem Version
8
+ * [![Dependency Status](https://dependencyci.com/github/rails-sqlserver/tiny_tds/badge)](https://dependencyci.com/github/rails-sqlserver/tiny_tds) - Dependency Status
8
9
  * [![Gitter chat](https://img.shields.io/badge/%E2%8A%AA%20GITTER%20-JOIN%20CHAT%20%E2%86%92-brightgreen.svg?style=flat)](https://gitter.im/rails-sqlserver/activerecord-sqlserver-adapter) - Community
9
10
 
10
11
  The TinyTDS gem is meant to serve the extremely common use-case of connecting, querying and iterating over results to Microsoft SQL Server or Sybase databases from Ruby using the FreeTDS's DB-Library API.
@@ -331,19 +332,38 @@ TinyTDS is fully tested with the Azure platform. You must set the `azure: true`
331
332
 
332
333
  **IMPORTANT**: Do not use `username@server.database.windows.net` for the username connection option! You must use the shorter `username@server` instead!
333
334
 
334
- We recommend the following settings when using TinyTDS with Azure. These are the same settings used in the ActiveRecord SQL Server adapter.
335
+ Also, please read the [Azure SQL Database General Guidelines and Limitations](https://msdn.microsoft.com/en-us/library/ee336245.aspx) MSDN article to understand the differences. Specifically, the connection constraints section!
336
+
337
+ ## Connection Settings
338
+
339
+ A DBLIB connection does not have the same default SET options for a standard SMS SQL Server connection. Hence, we recommend the following options post establishing your connection.
340
+
341
+ #### SQL Server
335
342
 
336
343
  ```sql
337
- SET ANSI_NULLS ON
344
+ SET ANSI_DEFAULTS ON
345
+
346
+ SET QUOTED_IDENTIFIER ON
338
347
  SET CURSOR_CLOSE_ON_COMMIT OFF
339
- SET ANSI_NULL_DFLT_ON ON
340
348
  SET IMPLICIT_TRANSACTIONS OFF
349
+ SET TEXTSIZE 2147483647
350
+ SET CONCAT_NULL_YIELDS_NULL ON
351
+ ```
352
+
353
+ #### Azure
354
+
355
+ ```sql
356
+ SET ANSI_NULLS ON
357
+ SET ANSI_NULL_DFLT_ON ON
341
358
  SET ANSI_PADDING ON
342
- SET QUOTED_IDENTIFIER ON
343
359
  SET ANSI_WARNINGS ON
344
- ```
345
360
 
346
- Also, please read the [Azure SQL Database General Guidelines and Limitations](https://msdn.microsoft.com/en-us/library/ee336245.aspx) MSDN article to understand the differences. Specifically, the connection constraints section!
361
+ SET QUOTED_IDENTIFIER ON
362
+ SET CURSOR_CLOSE_ON_COMMIT OFF
363
+ SET IMPLICIT_TRANSACTIONS OFF
364
+ SET TEXTSIZE 2147483647
365
+ SET CONCAT_NULL_YIELDS_NULL ON
366
+ ```
347
367
 
348
368
 
349
369
  ## Thread Safety
data/Rakefile CHANGED
@@ -68,8 +68,8 @@ Rake::ExtensionTask.new('tiny_tds', gemspec) do |ext|
68
68
  gemplat = spec.platform.to_s
69
69
  host = platform_host_map[gemplat]
70
70
  dlls = [
71
- "libeay32-#{OPENSSL_VERSION}-#{host}.dll",
72
- "ssleay32-#{OPENSSL_VERSION}-#{host}.dll",
71
+ "libcrypto32-#{OPENSSL_VERSION}-#{host}.dll",
72
+ "libssl32-#{OPENSSL_VERSION}-#{host}.dll",
73
73
  'libiconv-2.dll',
74
74
  'libsybdb-5.dll'
75
75
  ]
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.2.0.beta1
@@ -151,6 +151,19 @@ def define_libssl_recipe(host)
151
151
  end
152
152
  end
153
153
 
154
+ def execute(action, command, options={})
155
+ prev_path = ENV['PATH']
156
+ if host=~/mingw/
157
+ git_perl = 'C:/Program Files/Git/usr/bin'
158
+ if File.directory?(git_perl)
159
+ ENV['PATH'] = git_perl + ';' + ENV['PATH']
160
+ ENV['PERL'] = 'perl'
161
+ end
162
+ end
163
+ super
164
+ ENV['PATH'] = prev_path
165
+ end
166
+
154
167
  def configure
155
168
  config = if host=~/mingw/
156
169
  host=~/x86_64/ ? 'mingw64' : 'mingw'
@@ -181,20 +194,20 @@ def define_libssl_recipe(host)
181
194
 
182
195
  def compile
183
196
  super
184
- # OpenSSL DLLs are called "libeay32.dll" and "ssleay32.dll" per default,
197
+ # OpenSSL DLLs are called "libcrypto32.dll" and "libssl32.dll" per default,
185
198
  # regardless to the version. This is best suited to meet the Windows DLL hell.
186
199
  # To avoid any conflicts we do a static build and build DLLs afterwards,
187
200
  # with our own naming scheme.
188
- execute "mkdef-libeay32", "(perl util/mkdef.pl 32 libeay >libeay32.def)"
189
- execute "mkdef-ssleay32", "(perl util/mkdef.pl 32 ssleay >ssleay32.def)"
190
- dllwrap("libeay32-#{version}-#{host}", "libcrypto.dll.a", "libeay32.def", "libcrypto.a -lws2_32 -lgdi32 -lcrypt32")
191
- dllwrap("ssleay32-#{version}-#{host}", "libssl.dll.a", "ssleay32.def", "libssl.a libcrypto.dll.a")
201
+ execute "mkdef-crypto32", "(perl util/mkdef.pl crypto 32 >libcrypto32.def)"
202
+ execute "mkdef-ssl32", "(perl util/mkdef.pl ssl 32 >libssl32.def)"
203
+ dllwrap("libcrypto32-#{version}-#{host}", "libcrypto.dll.a", "libcrypto32.def", "libcrypto.a -lws2_32 -lgdi32 -lcrypt32")
204
+ dllwrap("libssl32-#{version}-#{host}", "libssl.dll.a", "libssl32.def", "libssl.a libcrypto.dll.a")
192
205
  end
193
206
 
194
207
  def install
195
208
  super
196
- FileUtils.cp "#{work_path}/libeay32-#{version}-#{host}.dll", "#{path}/bin/"
197
- FileUtils.cp "#{work_path}/ssleay32-#{version}-#{host}.dll", "#{path}/bin/"
209
+ FileUtils.cp "#{work_path}/libcrypto32-#{version}-#{host}.dll", "#{path}/bin/"
210
+ FileUtils.cp "#{work_path}/libssl32-#{version}-#{host}.dll", "#{path}/bin/"
198
211
  FileUtils.cp "#{work_path}/libcrypto.dll.a", "#{path}/lib/"
199
212
  FileUtils.cp "#{work_path}/libssl.dll.a", "#{path}/lib/"
200
213
  end
@@ -2,10 +2,10 @@
2
2
  ICONV_VERSION = ENV['TINYTDS_ICONV_VERSION'] || "1.14"
3
3
  ICONV_SOURCE_URI = "http://ftp.gnu.org/pub/gnu/libiconv/libiconv-#{ICONV_VERSION}.tar.gz"
4
4
 
5
- OPENSSL_VERSION = ENV['TINYTDS_OPENSSL_VERSION'] || '1.0.2j'
5
+ OPENSSL_VERSION = ENV['TINYTDS_OPENSSL_VERSION'] || '1.1.0e'
6
6
  OPENSSL_SOURCE_URI = "https://www.openssl.org/source/openssl-#{OPENSSL_VERSION}.tar.gz"
7
7
 
8
- FREETDS_VERSION = ENV['TINYTDS_FREETDS_VERSION'] || "1.00.21"
8
+ FREETDS_VERSION = ENV['TINYTDS_FREETDS_VERSION'] || "1.00.27"
9
9
  FREETDS_VERSION_INFO = Hash.new { |h,k|
10
10
  h[k] = {files: "ftp://ftp.freetds.org/pub/freetds/stable/freetds-#{k}.tar.bz2"}
11
11
  }
@@ -1,16 +1,16 @@
1
1
  diff --git a/src/tds/tls.c b/src/tds/tls.c
2
- index 0d11a33..b8ab2ba 100644
2
+ index 09e7fa0..1da18f6 100644
3
3
  --- a/src/tds/tls.c
4
4
  +++ b/src/tds/tls.c
5
- @@ -72,6 +72,29 @@
6
- #define SSL_PTR bio->ptr
5
+ @@ -101,6 +101,29 @@
6
+ #define SSL_PTR BIO_get_data(bio)
7
7
  #endif
8
8
 
9
9
  +/*
10
10
  + * Add a workaround for older Mingw versions without inet_pton().
11
11
  + * This means RubyInstallers DevKit-4.7.2 in particular.
12
12
  + */
13
- +#if defined(__MINGW64_VERSION_MAJOR) && !defined(InetPtonA)
13
+ +#if defined(__MINGW32__) && !defined(InetPtonA)
14
14
  + #include <windows.h>
15
15
  +
16
16
  + static HMODULE ws2_32 = NULL;
@@ -10,7 +10,7 @@ fi
10
10
  wget https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz
11
11
  tar -xzf openssl-$OPENSSL_VERSION.tar.gz
12
12
  cd openssl-$OPENSSL_VERSION
13
- ./config --prefix=/opt/local
13
+ ./config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl
14
14
  make
15
15
  make install
16
16
  cd ..
@@ -3,15 +3,17 @@
3
3
  set -x
4
4
  set -e
5
5
 
6
- docker pull metaskills/mssql-server-linux-tinytds
6
+ tag=1.3
7
7
 
8
- container=$(docker ps -a -q --filter ancestor=metaskills/mssql-server-linux-tinytds)
8
+ docker pull metaskills/mssql-server-linux-tinytds:$tag
9
+
10
+ container=$(docker ps -a -q --filter ancestor=metaskills/mssql-server-linux-tinytds:$tag)
9
11
  if [[ -z $container ]]; then
10
- docker run -p 1433:1433 -d metaskills/mssql-server-linux-tinytds && sleep 10
12
+ docker run -p 1433:1433 -d metaskills/mssql-server-linux-tinytds:$tag && sleep 10
11
13
  exit
12
14
  fi
13
15
 
14
- container=$(docker ps -q --filter ancestor=metaskills/mssql-server-linux-tinytds)
16
+ container=$(docker ps -q --filter ancestor=metaskills/mssql-server-linux-tinytds:$tag)
15
17
  if [[ -z $container ]]; then
16
18
  docker start $container && sleep 10
17
19
  fi
@@ -578,7 +578,7 @@ class ResultTest < TinyTds::TestCase
578
578
 
579
579
  it 'returns nil for NULL' do
580
580
  value = @client.execute('SELECT NULL AS [null]').each.first['null']
581
- assert_equal nil, value
581
+ assert_nil value
582
582
  end
583
583
 
584
584
  end
@@ -27,7 +27,7 @@ class SchemaTest < TinyTds::TestCase
27
27
  it 'casts bit' do
28
28
  assert_equal true, find_value(31, :bit)
29
29
  assert_equal false, find_value(32, :bit)
30
- assert_equal nil, find_value(21, :bit)
30
+ assert_nil find_value(21, :bit)
31
31
  end
32
32
 
33
33
  it 'casts char' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tiny_tds
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Collins
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-12-20 00:00:00.000000000 Z
13
+ date: 2017-03-06 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: mini_portile2
@@ -109,6 +109,7 @@ extensions:
109
109
  extra_rdoc_files: []
110
110
  files:
111
111
  - ".codeclimate.yml"
112
+ - ".gitattributes"
112
113
  - ".gitignore"
113
114
  - ".rubocop.yml"
114
115
  - ".travis.yml"
@@ -139,7 +140,7 @@ files:
139
140
  - lib/tiny_tds/error.rb
140
141
  - lib/tiny_tds/result.rb
141
142
  - lib/tiny_tds/version.rb
142
- - ports/patches/freetds/1.00.21/0001-mingw_missing_inet_pton.diff
143
+ - ports/patches/freetds/1.00.27/0001-mingw_missing_inet_pton.diff
143
144
  - test/appveyor/dbsetup.ps1
144
145
  - test/appveyor/dbsetup.sql
145
146
  - test/benchmark/query.rb
@@ -178,9 +179,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
178
179
  version: 2.0.0
179
180
  required_rubygems_version: !ruby/object:Gem::Requirement
180
181
  requirements:
181
- - - ">="
182
+ - - ">"
182
183
  - !ruby/object:Gem::Version
183
- version: '0'
184
+ version: 1.3.1
184
185
  requirements: []
185
186
  rubyforge_project:
186
187
  rubygems_version: 2.6.4