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.
Files changed (104) hide show
  1. checksums.yaml +7 -0
  2. data/.circleci/config.yml +407 -0
  3. data/.codeclimate.yml +20 -0
  4. data/.gitattributes +1 -0
  5. data/.gitignore +22 -0
  6. data/.rubocop.yml +31 -0
  7. data/CHANGELOG.md +280 -0
  8. data/CODE_OF_CONDUCT.md +31 -0
  9. data/Gemfile +2 -0
  10. data/ISSUE_TEMPLATE.md +38 -0
  11. data/MIT-LICENSE +23 -0
  12. data/README.md +504 -0
  13. data/Rakefile +62 -0
  14. data/VERSION +1 -0
  15. data/bin/defncopy-ttds +3 -0
  16. data/bin/tsql-ttds +3 -0
  17. data/docker-compose.yml +34 -0
  18. data/exe/.keep +0 -0
  19. data/ext/tiny_tds/client.c +499 -0
  20. data/ext/tiny_tds/client.h +53 -0
  21. data/ext/tiny_tds/extconf.rb +92 -0
  22. data/ext/tiny_tds/extconsts.rb +15 -0
  23. data/ext/tiny_tds/result.c +634 -0
  24. data/ext/tiny_tds/result.h +32 -0
  25. data/ext/tiny_tds/tiny_tds_ext.c +12 -0
  26. data/ext/tiny_tds/tiny_tds_ext.h +17 -0
  27. data/lib/tiny_tds/3.1/tiny_tds.so +0 -0
  28. data/lib/tiny_tds/3.2/tiny_tds.so +0 -0
  29. data/lib/tiny_tds/bin.rb +104 -0
  30. data/lib/tiny_tds/client.rb +136 -0
  31. data/lib/tiny_tds/error.rb +14 -0
  32. data/lib/tiny_tds/gem.rb +27 -0
  33. data/lib/tiny_tds/result.rb +7 -0
  34. data/lib/tiny_tds/version.rb +3 -0
  35. data/lib/tiny_tds.rb +61 -0
  36. data/patches/freetds/1.00.27/0001-mingw_missing_inet_pton.diff +34 -0
  37. data/patches/freetds/1.00.27/0002-Don-t-use-MSYS2-file-libws2_32.diff +28 -0
  38. data/patches/libiconv/1.14/1-avoid-gets-error.patch +17 -0
  39. data/ports/x64-mingw-ucrt/freetds/1.1.24/bin/bsqldb.exe +0 -0
  40. data/ports/x64-mingw-ucrt/freetds/1.1.24/bin/datacopy.exe +0 -0
  41. data/ports/x64-mingw-ucrt/freetds/1.1.24/bin/defncopy.exe +0 -0
  42. data/ports/x64-mingw-ucrt/freetds/1.1.24/bin/freebcp.exe +0 -0
  43. data/ports/x64-mingw-ucrt/freetds/1.1.24/bin/libct-4.dll +0 -0
  44. data/ports/x64-mingw-ucrt/freetds/1.1.24/bin/libsybdb-5.dll +0 -0
  45. data/ports/x64-mingw-ucrt/freetds/1.1.24/bin/osql +388 -0
  46. data/ports/x64-mingw-ucrt/freetds/1.1.24/bin/tdspool.exe +0 -0
  47. data/ports/x64-mingw-ucrt/freetds/1.1.24/bin/tsql.exe +0 -0
  48. data/ports/x64-mingw-ucrt/freetds/1.1.24/lib/libct.dll.a +0 -0
  49. data/ports/x64-mingw-ucrt/freetds/1.1.24/lib/libct.la +41 -0
  50. data/ports/x64-mingw-ucrt/freetds/1.1.24/lib/libsybdb.dll.a +0 -0
  51. data/ports/x64-mingw-ucrt/freetds/1.1.24/lib/libsybdb.la +41 -0
  52. data/ports/x64-mingw-ucrt/libiconv/1.15/bin/iconv.exe +0 -0
  53. data/ports/x64-mingw-ucrt/libiconv/1.15/bin/libcharset-1.dll +0 -0
  54. data/ports/x64-mingw-ucrt/libiconv/1.15/bin/libiconv-2.dll +0 -0
  55. data/ports/x64-mingw-ucrt/libiconv/1.15/lib/charset.alias +4 -0
  56. data/ports/x64-mingw-ucrt/libiconv/1.15/lib/libcharset.dll.a +0 -0
  57. data/ports/x64-mingw-ucrt/libiconv/1.15/lib/libcharset.la +41 -0
  58. data/ports/x64-mingw-ucrt/libiconv/1.15/lib/libiconv.dll.a +0 -0
  59. data/ports/x64-mingw-ucrt/libiconv/1.15/lib/libiconv.la +41 -0
  60. data/ports/x64-mingw-ucrt/openssl/1.1.1s/bin/c_rehash +251 -0
  61. data/ports/x64-mingw-ucrt/openssl/1.1.1s/bin/libcrypto-1_1-x64.dll +0 -0
  62. data/ports/x64-mingw-ucrt/openssl/1.1.1s/bin/libssl-1_1-x64.dll +0 -0
  63. data/ports/x64-mingw-ucrt/openssl/1.1.1s/bin/openssl.exe +0 -0
  64. data/ports/x64-mingw-ucrt/openssl/1.1.1s/lib/libcrypto.a +0 -0
  65. data/ports/x64-mingw-ucrt/openssl/1.1.1s/lib/libcrypto.dll.a +0 -0
  66. data/ports/x64-mingw-ucrt/openssl/1.1.1s/lib/libssl.a +0 -0
  67. data/ports/x64-mingw-ucrt/openssl/1.1.1s/lib/libssl.dll.a +0 -0
  68. data/setup_cimgruby_dev.sh +25 -0
  69. data/start_dev.sh +21 -0
  70. data/tasks/native_gem.rake +23 -0
  71. data/tasks/package.rake +8 -0
  72. data/tasks/ports/freetds.rb +37 -0
  73. data/tasks/ports/libiconv.rb +26 -0
  74. data/tasks/ports/openssl.rb +62 -0
  75. data/tasks/ports/recipe.rb +64 -0
  76. data/tasks/ports.rake +108 -0
  77. data/tasks/test.rake +9 -0
  78. data/test/benchmark/query.rb +77 -0
  79. data/test/benchmark/query_odbc.rb +106 -0
  80. data/test/benchmark/query_tinytds.rb +126 -0
  81. data/test/bin/install-freetds.sh +20 -0
  82. data/test/bin/install-mssql.ps1 +31 -0
  83. data/test/bin/install-mssqltools.sh +9 -0
  84. data/test/bin/install-openssl.sh +18 -0
  85. data/test/bin/setup_tinytds_db.sh +7 -0
  86. data/test/bin/setup_volume_permissions.sh +10 -0
  87. data/test/client_test.rb +275 -0
  88. data/test/gem_test.rb +177 -0
  89. data/test/result_test.rb +814 -0
  90. data/test/schema/1px.gif +0 -0
  91. data/test/schema/sqlserver_2000.sql +140 -0
  92. data/test/schema/sqlserver_2005.sql +140 -0
  93. data/test/schema/sqlserver_2008.sql +140 -0
  94. data/test/schema/sqlserver_2014.sql +140 -0
  95. data/test/schema/sqlserver_2016.sql +140 -0
  96. data/test/schema/sqlserver_azure.sql +140 -0
  97. data/test/schema/sybase_ase.sql +138 -0
  98. data/test/schema_test.rb +443 -0
  99. data/test/sql/db-create.sql +18 -0
  100. data/test/sql/db-login.sql +38 -0
  101. data/test/test_helper.rb +280 -0
  102. data/test/thread_test.rb +98 -0
  103. data/tiny_tds.gemspec +31 -0
  104. 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
+