tiny_tds 2.1.6-x64-mingw-ucrt
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.circleci/config.yml +407 -0
- data/.codeclimate.yml +20 -0
- data/.gitattributes +1 -0
- data/.gitignore +22 -0
- data/.rubocop.yml +31 -0
- data/CHANGELOG.md +280 -0
- data/CODE_OF_CONDUCT.md +31 -0
- data/Gemfile +2 -0
- data/ISSUE_TEMPLATE.md +38 -0
- data/MIT-LICENSE +23 -0
- data/README.md +504 -0
- data/Rakefile +62 -0
- data/VERSION +1 -0
- data/bin/defncopy-ttds +3 -0
- data/bin/tsql-ttds +3 -0
- data/docker-compose.yml +34 -0
- data/exe/.keep +0 -0
- data/ext/tiny_tds/client.c +499 -0
- data/ext/tiny_tds/client.h +53 -0
- data/ext/tiny_tds/extconf.rb +92 -0
- data/ext/tiny_tds/extconsts.rb +15 -0
- data/ext/tiny_tds/result.c +634 -0
- data/ext/tiny_tds/result.h +32 -0
- data/ext/tiny_tds/tiny_tds_ext.c +12 -0
- data/ext/tiny_tds/tiny_tds_ext.h +17 -0
- data/lib/tiny_tds/3.1/tiny_tds.so +0 -0
- data/lib/tiny_tds/3.2/tiny_tds.so +0 -0
- data/lib/tiny_tds/bin.rb +104 -0
- data/lib/tiny_tds/client.rb +136 -0
- data/lib/tiny_tds/error.rb +14 -0
- data/lib/tiny_tds/gem.rb +27 -0
- data/lib/tiny_tds/result.rb +7 -0
- data/lib/tiny_tds/version.rb +3 -0
- data/lib/tiny_tds.rb +61 -0
- data/patches/freetds/1.00.27/0001-mingw_missing_inet_pton.diff +34 -0
- data/patches/freetds/1.00.27/0002-Don-t-use-MSYS2-file-libws2_32.diff +28 -0
- data/patches/libiconv/1.14/1-avoid-gets-error.patch +17 -0
- data/ports/x64-mingw-ucrt/freetds/1.1.24/bin/bsqldb.exe +0 -0
- data/ports/x64-mingw-ucrt/freetds/1.1.24/bin/datacopy.exe +0 -0
- data/ports/x64-mingw-ucrt/freetds/1.1.24/bin/defncopy.exe +0 -0
- data/ports/x64-mingw-ucrt/freetds/1.1.24/bin/freebcp.exe +0 -0
- data/ports/x64-mingw-ucrt/freetds/1.1.24/bin/libct-4.dll +0 -0
- data/ports/x64-mingw-ucrt/freetds/1.1.24/bin/libsybdb-5.dll +0 -0
- data/ports/x64-mingw-ucrt/freetds/1.1.24/bin/osql +388 -0
- data/ports/x64-mingw-ucrt/freetds/1.1.24/bin/tdspool.exe +0 -0
- data/ports/x64-mingw-ucrt/freetds/1.1.24/bin/tsql.exe +0 -0
- data/ports/x64-mingw-ucrt/freetds/1.1.24/lib/libct.dll.a +0 -0
- data/ports/x64-mingw-ucrt/freetds/1.1.24/lib/libct.la +41 -0
- data/ports/x64-mingw-ucrt/freetds/1.1.24/lib/libsybdb.dll.a +0 -0
- data/ports/x64-mingw-ucrt/freetds/1.1.24/lib/libsybdb.la +41 -0
- data/ports/x64-mingw-ucrt/libiconv/1.15/bin/iconv.exe +0 -0
- data/ports/x64-mingw-ucrt/libiconv/1.15/bin/libcharset-1.dll +0 -0
- data/ports/x64-mingw-ucrt/libiconv/1.15/bin/libiconv-2.dll +0 -0
- data/ports/x64-mingw-ucrt/libiconv/1.15/lib/charset.alias +4 -0
- data/ports/x64-mingw-ucrt/libiconv/1.15/lib/libcharset.dll.a +0 -0
- data/ports/x64-mingw-ucrt/libiconv/1.15/lib/libcharset.la +41 -0
- data/ports/x64-mingw-ucrt/libiconv/1.15/lib/libiconv.dll.a +0 -0
- data/ports/x64-mingw-ucrt/libiconv/1.15/lib/libiconv.la +41 -0
- data/ports/x64-mingw-ucrt/openssl/1.1.1s/bin/c_rehash +251 -0
- data/ports/x64-mingw-ucrt/openssl/1.1.1s/bin/libcrypto-1_1-x64.dll +0 -0
- data/ports/x64-mingw-ucrt/openssl/1.1.1s/bin/libssl-1_1-x64.dll +0 -0
- data/ports/x64-mingw-ucrt/openssl/1.1.1s/bin/openssl.exe +0 -0
- data/ports/x64-mingw-ucrt/openssl/1.1.1s/lib/libcrypto.a +0 -0
- data/ports/x64-mingw-ucrt/openssl/1.1.1s/lib/libcrypto.dll.a +0 -0
- data/ports/x64-mingw-ucrt/openssl/1.1.1s/lib/libssl.a +0 -0
- data/ports/x64-mingw-ucrt/openssl/1.1.1s/lib/libssl.dll.a +0 -0
- data/setup_cimgruby_dev.sh +25 -0
- data/start_dev.sh +21 -0
- data/tasks/native_gem.rake +23 -0
- data/tasks/package.rake +8 -0
- data/tasks/ports/freetds.rb +37 -0
- data/tasks/ports/libiconv.rb +26 -0
- data/tasks/ports/openssl.rb +62 -0
- data/tasks/ports/recipe.rb +64 -0
- data/tasks/ports.rake +108 -0
- data/tasks/test.rake +9 -0
- data/test/benchmark/query.rb +77 -0
- data/test/benchmark/query_odbc.rb +106 -0
- data/test/benchmark/query_tinytds.rb +126 -0
- data/test/bin/install-freetds.sh +20 -0
- data/test/bin/install-mssql.ps1 +31 -0
- data/test/bin/install-mssqltools.sh +9 -0
- data/test/bin/install-openssl.sh +18 -0
- data/test/bin/setup_tinytds_db.sh +7 -0
- data/test/bin/setup_volume_permissions.sh +10 -0
- data/test/client_test.rb +275 -0
- data/test/gem_test.rb +177 -0
- data/test/result_test.rb +814 -0
- data/test/schema/1px.gif +0 -0
- data/test/schema/sqlserver_2000.sql +140 -0
- data/test/schema/sqlserver_2005.sql +140 -0
- data/test/schema/sqlserver_2008.sql +140 -0
- data/test/schema/sqlserver_2014.sql +140 -0
- data/test/schema/sqlserver_2016.sql +140 -0
- data/test/schema/sqlserver_azure.sql +140 -0
- data/test/schema/sybase_ase.sql +138 -0
- data/test/schema_test.rb +443 -0
- data/test/sql/db-create.sql +18 -0
- data/test/sql/db-login.sql +38 -0
- data/test/test_helper.rb +280 -0
- data/test/thread_test.rb +98 -0
- data/tiny_tds.gemspec +31 -0
- metadata +267 -0
data/test/gem_test.rb
ADDED
@@ -0,0 +1,177 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'test_helper'
|
3
|
+
require 'tiny_tds/gem'
|
4
|
+
|
5
|
+
class GemTest < MiniTest::Spec
|
6
|
+
gem_root ||= File.expand_path '../..', __FILE__
|
7
|
+
|
8
|
+
describe TinyTds::Gem do
|
9
|
+
|
10
|
+
# We're going to muck with some system globals so lets make sure
|
11
|
+
# they get set back later
|
12
|
+
original_platform = RbConfig::CONFIG['arch']
|
13
|
+
original_pwd = Dir.pwd
|
14
|
+
|
15
|
+
after do
|
16
|
+
RbConfig::CONFIG['arch'] = original_platform
|
17
|
+
Dir.chdir original_pwd
|
18
|
+
end
|
19
|
+
|
20
|
+
describe '#root_path' do
|
21
|
+
let(:root_path) { TinyTds::Gem.root_path }
|
22
|
+
|
23
|
+
it 'should be the root path' do
|
24
|
+
_(root_path).must_equal gem_root
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'should be the root path no matter the cwd' do
|
28
|
+
Dir.chdir '/'
|
29
|
+
|
30
|
+
_(root_path).must_equal gem_root
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
describe '#ports_root_path' do
|
35
|
+
let(:ports_root_path) { TinyTds::Gem.ports_root_path }
|
36
|
+
|
37
|
+
it 'should be the ports path' do
|
38
|
+
_(ports_root_path).must_equal File.join(gem_root,'ports')
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'should be the ports path no matter the cwd' do
|
42
|
+
Dir.chdir '/'
|
43
|
+
|
44
|
+
_(ports_root_path).must_equal File.join(gem_root,'ports')
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
describe '#ports_bin_paths' do
|
49
|
+
let(:ports_bin_paths) { TinyTds::Gem.ports_bin_paths }
|
50
|
+
|
51
|
+
describe 'when the ports directories exist' do
|
52
|
+
let(:fake_bin_paths) do
|
53
|
+
ports_host_root = File.join(gem_root, 'ports', 'fake-host-with-dirs')
|
54
|
+
[
|
55
|
+
File.join('a','bin'),
|
56
|
+
File.join('a','inner','bin'),
|
57
|
+
File.join('b','bin')
|
58
|
+
].map do |p|
|
59
|
+
File.join(ports_host_root, p)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
before do
|
64
|
+
RbConfig::CONFIG['arch'] = 'fake-host-with-dirs'
|
65
|
+
fake_bin_paths.each do |path|
|
66
|
+
FileUtils.mkdir_p(path)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
after do
|
71
|
+
FileUtils.remove_entry_secure(
|
72
|
+
File.join(gem_root, 'ports', 'fake-host-with-dirs'), true
|
73
|
+
)
|
74
|
+
end
|
75
|
+
|
76
|
+
it 'should return all the bin directories' do
|
77
|
+
_(ports_bin_paths.sort).must_equal fake_bin_paths.sort
|
78
|
+
end
|
79
|
+
|
80
|
+
it 'should return all the bin directories regardless of cwd' do
|
81
|
+
Dir.chdir '/'
|
82
|
+
_(ports_bin_paths.sort).must_equal fake_bin_paths.sort
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
describe 'when the ports directories are missing' do
|
87
|
+
before do
|
88
|
+
RbConfig::CONFIG['arch'] = 'fake-host-without-dirs'
|
89
|
+
end
|
90
|
+
|
91
|
+
it 'should return no directories' do
|
92
|
+
_(ports_bin_paths).must_be_empty
|
93
|
+
end
|
94
|
+
|
95
|
+
it 'should return no directories regardless of cwd' do
|
96
|
+
Dir.chdir '/'
|
97
|
+
_(ports_bin_paths).must_be_empty
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
describe '#ports_lib_paths' do
|
103
|
+
let(:ports_lib_paths) { TinyTds::Gem.ports_lib_paths }
|
104
|
+
|
105
|
+
describe 'when the ports directories exist' do
|
106
|
+
let(:fake_lib_paths) do
|
107
|
+
ports_host_root = File.join(gem_root, 'ports', 'fake-host-with-dirs')
|
108
|
+
[
|
109
|
+
File.join('a','lib'),
|
110
|
+
File.join('a','inner','lib'),
|
111
|
+
File.join('b','lib')
|
112
|
+
].map do |p|
|
113
|
+
File.join(ports_host_root, p)
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
before do
|
118
|
+
RbConfig::CONFIG['arch'] = 'fake-host-with-dirs'
|
119
|
+
fake_lib_paths.each do |path|
|
120
|
+
FileUtils.mkdir_p(path)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
after do
|
125
|
+
FileUtils.remove_entry_secure(
|
126
|
+
File.join(gem_root, 'ports', 'fake-host-with-dirs'), true
|
127
|
+
)
|
128
|
+
end
|
129
|
+
|
130
|
+
it 'should return all the lib directories' do
|
131
|
+
_(ports_lib_paths.sort).must_equal fake_lib_paths.sort
|
132
|
+
end
|
133
|
+
|
134
|
+
it 'should return all the lib directories regardless of cwd' do
|
135
|
+
Dir.chdir '/'
|
136
|
+
_(ports_lib_paths.sort).must_equal fake_lib_paths.sort
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
describe 'when the ports directories are missing' do
|
141
|
+
before do
|
142
|
+
RbConfig::CONFIG['arch'] = 'fake-host-without-dirs'
|
143
|
+
end
|
144
|
+
|
145
|
+
|
146
|
+
it 'should return no directories' do
|
147
|
+
_(ports_lib_paths).must_be_empty
|
148
|
+
end
|
149
|
+
|
150
|
+
it 'should return no directories regardless of cwd' do
|
151
|
+
Dir.chdir '/'
|
152
|
+
_(ports_lib_paths).must_be_empty
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
describe '#ports_host' do
|
158
|
+
{
|
159
|
+
'x64-mingw-ucrt' => 'x64-mingw-ucrt',
|
160
|
+
'x64-mingw32' => 'x64-mingw32',
|
161
|
+
'x86-mingw32' => 'x86-mingw32',
|
162
|
+
'x86_64-linux' => 'x86_64-linux',
|
163
|
+
}.each do |host,expected|
|
164
|
+
describe "on a #{host} architecture" do
|
165
|
+
before do
|
166
|
+
RbConfig::CONFIG['arch'] = host
|
167
|
+
end
|
168
|
+
|
169
|
+
it "should return a #{expected} ports host" do
|
170
|
+
_(TinyTds::Gem.ports_host).must_equal expected
|
171
|
+
end
|
172
|
+
end
|
173
|
+
end
|
174
|
+
end
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|