tiny_tds 0.9.5.beta.2-x86-mingw32 → 0.9.5.beta.3-x86-mingw32

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: eea9590e94b62687d8612c50cb905cb5c2370b90
4
- data.tar.gz: f855b3d038f90e3be27e5ccc015a3eeee38d38a5
3
+ metadata.gz: 25e8c0cf08419ab6820e83d31d55104b21f3b0c8
4
+ data.tar.gz: 0745288de31f5db86491b9491fb591c88c2ec9f0
5
5
  SHA512:
6
- metadata.gz: 423f35babc39b2e57a244c9ef71d6bc68f1e0b0aacd3a322a981581a834629334b1ed2ef20ff0714f04a6d1ad719c55dbe9db13abe58e7ac7e5d9f9996859e02
7
- data.tar.gz: 99f492daf40108451d963d310bbebcdd320320090d301b9e175cba19f8dd759797a3a4a22256566ec3433dfa331e4e6b212b49172af93e99bd71147227a90057
6
+ metadata.gz: abde734d86fbfd13c6fa28dd116aa8776a8e76443284118810e2cd3d2d3424a7c714ccd378f9d0c2587e6f6f2ad6016ba77245f02cf90875ace687303cb22586
7
+ data.tar.gz: bfb57c88452e37e51bc66133270416c0f7539cbf4cfd8afdf2e9b5106150e2b2eaa75a0c0ee695893422064edc2bc230b8bf90f75155bf8756dfc6e546aacfd1
data/README.md CHANGED
@@ -285,6 +285,7 @@ TinyTDS takes an opinionated stance on how we handle encoding errors. First, we
285
285
  The TinyTDS gem uses binstub wrappers which mirror compiled [FreeTDS Utilities](http://www.freetds.org/userguide/usefreetds.htm) binaries. These native executables are usually installed at the system level when installing FreeTDS. However, when using MiniPortile to install TinyTDS as we do with Windows binaries, these binstubs will find and prefer local gem `exe` directory executables. These are the following binstubs we wrap.
286
286
 
287
287
  * tsql - Used to test connections and debug compile time settings.
288
+ * defncopy - Used to dump schema structures.
288
289
 
289
290
 
290
291
  ## Using TinyTDS With Rails & The ActiveRecord SQL Server adapter.
@@ -402,3 +403,4 @@ My name is Ken Collins and I currently maintain the SQL Server adapter for Activ
402
403
 
403
404
  TinyTDS is Copyright (c) 2010-2015 Ken Collins, <ken@metaskills.net> and Will Bond (Veracross LLC) <wbond@breuer.com>. It is distributed under the MIT license. Windows binaries contain pre-compiled versions of FreeTDS <http://www.freetds.org/> which is licensed under the GNU LGPL license at <http://www.gnu.org/licenses/lgpl-2.0.html>
404
405
 
406
+
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.5.beta.2
1
+ 0.9.5.beta.3
data/bin/defncopy ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require_relative '../lib/tiny_tds/bin'
4
+
5
+ bin = TinyTds::Bin.new 'defncopy'
6
+ Kernel.system bin.path, *ARGV
data/bin/tsql CHANGED
@@ -1,25 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- BIN = 'tsql'
4
- ROOT = File.expand_path(File.join File.dirname(File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__), '..')
5
- PATHS = ENV['PATH'].split(File::PATH_SEPARATOR)
6
- EXTS = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
7
- SELF = File.join ROOT, 'bin', BIN
8
- EXE = File.join ROOT, 'exe', BIN
3
+ require_relative '../lib/tiny_tds/bin'
9
4
 
10
- def which(cmd)
11
- PATHS.each do |path|
12
- EXTS.each do |ext|
13
- exe = File.expand_path File.join(path, "#{cmd}#{ext}"), ROOT
14
- next unless File.executable?(exe)
15
- next if exe == SELF
16
- return exe
17
- end
18
- end
19
- return nil
20
- end
21
-
22
- bin = File.exists?(EXE) ? EXE : which(BIN)
23
- puts "[TinyTds] #{BIN}: #{bin}"
24
-
25
- Kernel.system bin, *ARGV
5
+ bin = TinyTds::Bin.new 'tsql'
6
+ Kernel.system bin.path, *ARGV
data/exe/defncopy.exe ADDED
Binary file
data/exe/tsql.exe CHANGED
Binary file
@@ -227,7 +227,7 @@ def define_freetds_recipe(host, libiconv, libssl, gnutls)
227
227
  bin_path = File.expand_path File.join(path, 'bin')
228
228
  exe_path = File.expand_path File.join(target, '..', 'exe')
229
229
  return unless File.directory?(bin_path)
230
- ['tsql'].each do |bin|
230
+ ['tsql', 'defncopy'].each do |bin|
231
231
  ['.exe', ''].each do |ext|
232
232
  exe = File.join bin_path, "#{bin}#{ext}"
233
233
  next unless File.exists?(exe)
@@ -5,7 +5,7 @@ ICONV_SOURCE_URI = "http://ftp.gnu.org/pub/gnu/libiconv/libiconv-#{ICONV_VERSION
5
5
  OPENSSL_VERSION = ENV['TINYTDS_OPENSSL_VERSION'] || '1.0.2e'
6
6
  OPENSSL_SOURCE_URI = "http://www.openssl.org/source/openssl-#{OPENSSL_VERSION}.tar.gz"
7
7
 
8
- FREETDS_VERSION = ENV['TINYTDS_FREETDS_VERSION'] || "0.95.75"
8
+ FREETDS_VERSION = ENV['TINYTDS_FREETDS_VERSION'] || "0.95.76"
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
  }
@@ -489,7 +489,7 @@ static VALUE rb_tinytds_result_cancel(VALUE self) {
489
489
  GET_RESULT_WRAPPER(self);
490
490
  userdata = (tinytds_client_userdata *)dbgetuserdata(rwrap->client);
491
491
  if (rwrap->client && !userdata->dbcancel_sent) {
492
- RETCODE dbsqlok_rc = rb_tinytds_result_ok_helper(rwrap->client);
492
+ rb_tinytds_result_ok_helper(rwrap->client);
493
493
  dbcancel(rwrap->client);
494
494
  userdata->dbcancel_sent = 1;
495
495
  userdata->dbsql_sent = 0;
@@ -0,0 +1,57 @@
1
+ require_relative './version'
2
+
3
+ module TinyTds
4
+ class Bin
5
+
6
+ ROOT = File.expand_path '../..', __FILE__
7
+ PATHS = ENV['PATH'].split File::PATH_SEPARATOR
8
+ EXTS = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
9
+
10
+ attr_reader :name
11
+
12
+ def initialize(name, options = {})
13
+ @name = name
14
+ @binstub = File.join ROOT, 'bin', @name
15
+ @exefile = File.join ROOT, 'exe', @name
16
+ puts info unless options[:silent]
17
+ end
18
+
19
+ def path
20
+ return @path if defined?(@path)
21
+ @path = File.exists?(@exefile) ? @exefile : which
22
+ end
23
+
24
+ def info
25
+ "[TinyTds][v#{TinyTds::VERSION}][#{name}]: #{path}"
26
+ end
27
+
28
+
29
+ private
30
+
31
+ def which
32
+ PATHS.each do |path|
33
+ EXTS.each do |ext|
34
+ exe = File.expand_path File.join(path, "#{name}#{ext}"), ROOT
35
+ next if exe == @binstub
36
+ next if !File.executable?(exe)
37
+ next if !binary?(exe)
38
+ return exe
39
+ end
40
+ end
41
+ return nil
42
+ end
43
+
44
+ # Implementation directly copied from ptools.
45
+ # https://github.com/djberg96/ptools
46
+ # https://opensource.org/licenses/Artistic-2.0
47
+ #
48
+ def binary?(file)
49
+ bytes = File.stat(file).blksize
50
+ bytes = 4096 if bytes > 4096
51
+ s = (File.read(file, bytes) || "")
52
+ s = s.encode('US-ASCII', :undef => :replace).split(//)
53
+ ((s.size - s.grep(" ".."~").size) / s.size.to_f) > 0.30
54
+ end
55
+
56
+ end
57
+ end
data/test/result_test.rb CHANGED
@@ -313,7 +313,7 @@ class ResultTest < TinyTds::TestCase
313
313
  it 'has properly encoded column names with symbol keys' do
314
314
  col_name = "öäüß"
315
315
  @client.execute("DROP TABLE [test_encoding]").do rescue nil
316
- @client.execute("CREATE TABLE [dbo].[test_encoding] ( [#{col_name}] [nvarchar](10) NOT NULL )").do
316
+ @client.execute("CREATE TABLE [dbo].[test_encoding] ( [id] int NOT NULL IDENTITY(1,1) PRIMARY KEY, [#{col_name}] [nvarchar](10) NOT NULL )").do
317
317
  @client.execute("INSERT INTO [test_encoding] ([#{col_name}]) VALUES (N'#{col_name}')").do
318
318
  result = @client.execute("SELECT [#{col_name}] FROM [test_encoding]")
319
319
  row = result.each(:as => :hash, :symbolize_keys => true).first
@@ -321,7 +321,7 @@ class ResultTest < TinyTds::TestCase
321
321
  assert_equal col_name.to_sym, result.fields.first
322
322
  assert_instance_of Symbol, row.keys.first
323
323
  assert_equal col_name.to_sym, row.keys.first
324
- end unless sqlserver_azure?
324
+ end
325
325
 
326
326
  it 'allows #return_code to work with stored procedures and reset per sql batch' do
327
327
  assert_nil @client.return_code
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: 0.9.5.beta.2
4
+ version: 0.9.5.beta.3
5
5
  platform: x86-mingw32
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: 2015-12-18 00:00:00.000000000 Z
13
+ date: 2015-12-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: mini_portile2
@@ -102,6 +102,7 @@ email:
102
102
  - ken@metaskills.net
103
103
  - will@wbond.net
104
104
  executables:
105
+ - defncopy
105
106
  - tsql
106
107
  extensions: []
107
108
  extra_rdoc_files: []
@@ -115,8 +116,10 @@ files:
115
116
  - Rakefile
116
117
  - VERSION
117
118
  - appveyor.yml
119
+ - bin/defncopy
118
120
  - bin/tsql
119
121
  - exe/.keep
122
+ - exe/defncopy.exe
120
123
  - exe/tsql.exe
121
124
  - ext/tiny_tds/client.c
122
125
  - ext/tiny_tds/client.h
@@ -130,6 +133,7 @@ files:
130
133
  - lib/tiny_tds/2.0/tiny_tds.so
131
134
  - lib/tiny_tds/2.1/tiny_tds.so
132
135
  - lib/tiny_tds/2.2/tiny_tds.so
136
+ - lib/tiny_tds/bin.rb
133
137
  - lib/tiny_tds/client.rb
134
138
  - lib/tiny_tds/error.rb
135
139
  - lib/tiny_tds/result.rb
@@ -140,7 +144,7 @@ files:
140
144
  - ports/i686-w64-mingw32/bin/ssleay32-1.0.2e-i686-w64-mingw32.dll
141
145
  - ports/patches/freetds/0.91.112/Makefile.in.diff
142
146
  - ports/patches/freetds/0.91.112/dblib-30-char-username.diff
143
- - ports/patches/freetds/0.95.75/0001-mingw_missing_inet_pton.diff
147
+ - ports/patches/freetds/0.95.76/0001-mingw_missing_inet_pton.diff
144
148
  - test/appveyor/dbsetup.ps1
145
149
  - test/appveyor/dbsetup.sql
146
150
  - test/benchmark/query.rb