tiny_tds 0.9.5.beta.2-x64-mingw32 → 0.9.5.beta.3-x64-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: 49778c850e7710ac88ac362ef0b1a45f172be4d4
4
- data.tar.gz: a3819af52d51bf7fad36226e995037424d27b5f6
3
+ metadata.gz: 871de125673889e7a992aa6751aab5f5e70687e9
4
+ data.tar.gz: 3b0042b17b747407bd561d7028d2decf5245e676
5
5
  SHA512:
6
- metadata.gz: e03034178e14835f7084cdb2f474a4a26e94310c174196e88b268d37d40eac1ee6ca52cf09467404cd43f27560e8d48315716c2edd11b82b950534ba5ddcbbf7
7
- data.tar.gz: 3c9aad459176af6e1a9795a98a4352d5653a0a993f0142036366c099e3c824b2f9a2630596c9b21187e61e7af5be54a120c4da485e11a44a5f90d4d082c38baf
6
+ metadata.gz: 869f254dae5a16b7fd2279f0482c94d73f1ffadd04777974c06c5e293220e56d292c3b3b02cd15de4015e0f4da702b8703f410dc4e4db1bcfa6ddcfafe4e1dd5
7
+ data.tar.gz: a0621533587951e783260366d132ef79d5329a969d8409bc2f72f7319b25313a576a41978167ba4c98405b8a8d6c5ee55b5445de537f4b7321c2e3ce77186bc8
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: x64-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,13 +133,14 @@ 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
136
140
  - lib/tiny_tds/version.rb
137
141
  - ports/patches/freetds/0.91.112/Makefile.in.diff
138
142
  - ports/patches/freetds/0.91.112/dblib-30-char-username.diff
139
- - ports/patches/freetds/0.95.75/0001-mingw_missing_inet_pton.diff
143
+ - ports/patches/freetds/0.95.76/0001-mingw_missing_inet_pton.diff
140
144
  - ports/x86_64-w64-mingw32/bin/libeay32-1.0.2e-x86_64-w64-mingw32.dll
141
145
  - ports/x86_64-w64-mingw32/bin/libiconv-2.dll
142
146
  - ports/x86_64-w64-mingw32/bin/libsybdb-5.dll