tiny_tds 1.0.4 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. checksums.yaml +5 -5
  2. data/.codeclimate.yml +20 -0
  3. data/.gitattributes +1 -0
  4. data/.github/workflows/ci.yml +590 -0
  5. data/.gitignore +2 -0
  6. data/.rubocop.yml +31 -0
  7. data/{CHANGELOG → CHANGELOG.md} +133 -26
  8. data/Gemfile +1 -5
  9. data/ISSUE_TEMPLATE.md +36 -3
  10. data/README.md +147 -85
  11. data/Rakefile +51 -94
  12. data/VERSION +1 -1
  13. data/docker-compose.yml +34 -0
  14. data/ext/tiny_tds/client.c +149 -67
  15. data/ext/tiny_tds/client.h +11 -5
  16. data/ext/tiny_tds/extconf.rb +144 -283
  17. data/ext/tiny_tds/extconsts.rb +4 -11
  18. data/ext/tiny_tds/result.c +68 -50
  19. data/ext/tiny_tds/tiny_tds_ext.c +4 -1
  20. data/lib/tiny_tds/bin.rb +44 -40
  21. data/lib/tiny_tds/client.rb +63 -55
  22. data/lib/tiny_tds/error.rb +0 -3
  23. data/lib/tiny_tds/gem.rb +23 -0
  24. data/lib/tiny_tds/result.rb +0 -3
  25. data/lib/tiny_tds.rb +37 -32
  26. data/{ports/patches/freetds/1.00 → patches/freetds/1.00.27}/0001-mingw_missing_inet_pton.diff +4 -4
  27. data/patches/freetds/1.00.27/0002-Don-t-use-MSYS2-file-libws2_32.diff +28 -0
  28. data/patches/libiconv/1.14/1-avoid-gets-error.patch +17 -0
  29. data/setup_cimgruby_dev.sh +25 -0
  30. data/start_dev.sh +21 -0
  31. data/tasks/native_gem.rake +16 -0
  32. data/tasks/package.rake +6 -0
  33. data/tasks/ports.rake +24 -0
  34. data/tasks/test.rake +7 -0
  35. data/test/bin/install-freetds.sh +18 -0
  36. data/test/bin/install-mssql.ps1 +42 -0
  37. data/test/bin/install-mssqltools.sh +9 -0
  38. data/test/bin/install-openssl.sh +18 -0
  39. data/test/bin/restore-from-native-gem.ps1 +10 -0
  40. data/test/bin/setup_tinytds_db.sh +7 -0
  41. data/test/bin/setup_volume_permissions.sh +10 -0
  42. data/test/client_test.rb +161 -112
  43. data/test/gem_test.rb +100 -0
  44. data/test/result_test.rb +293 -313
  45. data/test/schema_test.rb +369 -395
  46. data/test/sql/db-create.sql +18 -0
  47. data/test/sql/db-login.sql +38 -0
  48. data/test/test_helper.rb +116 -85
  49. data/test/thread_test.rb +22 -31
  50. data/tiny_tds.gemspec +27 -24
  51. metadata +109 -56
  52. data/appveyor.yml +0 -51
  53. data/test/appveyor/dbsetup.ps1 +0 -27
  54. data/test/appveyor/dbsetup.sql +0 -9
  55. data/test/benchmark/query.rb +0 -77
  56. data/test/benchmark/query_odbc.rb +0 -106
  57. data/test/benchmark/query_tinytds.rb +0 -126
  58. data/test/schema/sqlserver_2000.sql +0 -140
  59. data/test/schema/sqlserver_2005.sql +0 -140
  60. data/test/schema/sqlserver_2014.sql +0 -140
  61. data/test/schema/sybase_ase.sql +0 -138
  62. /data/bin/{defncopy → defncopy-ttds} +0 -0
  63. /data/bin/{tsql → tsql-ttds} +0 -0
  64. /data/test/schema/{sqlserver_2008.sql → sqlserver_2017.sql} +0 -0
@@ -1,26 +1,132 @@
1
- * 1.0.4 *
1
+ ## 3.2.0
2
+
3
+ * Reduce number of files shipped with precompiled Windows gem
4
+ * Provide precompiled gem for Linux (GNU + MUSL / 64-bit x86 + ARM)
5
+ * Fix wrappers for `tsql` and `defncopy` utility.
6
+ * Use libiconv v1.18 and freetds v1.4.26 for Windows and Linux builds
7
+
8
+ ## 3.1.0
9
+
10
+ * Add Ruby 3.4 to the cross compile list
11
+
12
+ ## 3.0.0
13
+
14
+ * Drop support for Ruby < 2.7
15
+ * Drop support for SQL Server < 2017
16
+ * Drop support for FreeTDS < 1.0
17
+ * No longer provide a 32-bit Windows build
18
+ * Raise error if FreeTDS is unable to send command buffer to the server
19
+ * Use freetds v1.4.23, libiconv v1.17 and OpenSSL v3.4.0 for Windows builds
20
+ * Add `bigdecimal` to dependencies
21
+
22
+ ## 2.1.7
23
+
24
+ * Add Ruby 3.3 to the cross compile list
25
+
26
+ ## 2.1.6
27
+
28
+ * Add Ruby 3.0, 3.1, and 3.2 to the cross compile list
29
+ * Fix segfault when asking if client was dead after closing it. Fixes #519.
30
+ * Mark `alloc` function as undefined on `TinyTds::Result`. Fixes #515.
31
+ * Fix Gem installation on Windows by adding default freetds msys path. Fixes #522
32
+ * Search for `freetds` in `/opt/homebrew` when installing on Apple Silicon. Fixes #484, #492 and #508.
33
+
34
+ ## 2.1.5
35
+
36
+ * Fix compilation errors for Amazon Linux 1. Fixes #495.
37
+ * Fix segfault for login timeouts
38
+
39
+ ## 2.1.4
40
+
41
+ * Improve handling of network related timeouts
42
+ * Fix error reporting when preceded by info message
43
+
44
+ ## 2.1.3
45
+
46
+ * Removed old/unused appveyor config
47
+ * Remove old Rubies from CI & cross compile list
48
+ * Add Ruby 2.6 and 2.7 to the cross compile list
49
+
50
+ ## 2.1.2
51
+
52
+ * Use Kernel.BigDecimal vs BigDecimal.new. Fixes #409.
53
+ * Change `DBSETUTF16` abscence warning message. Fixes #410.
54
+ * Add Windows binary for Ruby-2.5. Fixes #408.
55
+
56
+ ## 2.1.1
57
+
58
+ * Move message_handler from a shared value to userdata.
59
+
60
+
61
+ ## 2.1.0
62
+
63
+ * Support RubyInstaller2 for Windows. Fixes #365.
64
+ * Support the FREETDS_DIR environment variable. Fixes #371.
65
+ * Rename binstubs to tsql-ttds and defncopy-ttds
66
+ * Support separate timeout values per connection Fixes #348.
67
+ * Allow client proc to capture INFO messages. Fixes #352.
68
+ * Use official HTTP mirrors instead of FTP. Fixes #384.
69
+
70
+
71
+ ## 2.0.0
72
+
73
+ * Stop building FreeTDS as a part of the extension build.
74
+
75
+
76
+ ## 1.3.0
77
+
78
+ * FreeTDS: Link libgcc statically for Windows. (#351) Fixes #349.
79
+
80
+
81
+ ## 1.2.0
82
+
83
+ * Use OpenSSL v1.1.0e & FreeTDS v1.00.27 for Windows builds.
84
+
85
+
86
+ ## 1.1.0
87
+
88
+ * Use rake-compiler-dock v0.6.0
89
+ * Handle SYBVARIANT types from SQL function. Fixes #317. Fixed #321.
90
+ * Fix `use_utf16` optoin for booleans. Fixes #314
91
+ * Add `-q` check for bin puts. Fixes #318
92
+ * Use FreeTDS 1.00.21.
93
+ * Appveyor tests only 2012, 2014 with one Ruby, 23-x64.
94
+ * CircleCI & TravisCI both test 2016.
95
+
96
+
97
+ ## 1.0.5
98
+
99
+ * Windows Static Builds - Use FreeTDS 1.00.15, OpenSSL 1.0.2j.
100
+ * Appveyor tests 2012, 2014, 2016.
101
+ * Error messages greater than 1024 chars generates a buffer overflow. Fixes #293.
102
+ * Ensures numeric options are treated numerically Fixes #303.
103
+ * New `:contained` login option. May deprecate `:azure`. Fixes #292.
104
+ * New `:use_utf16` login option. Toggle UCS-2 or UTF-16. Default true.
105
+
106
+
107
+ ## 1.0.4
2
108
 
3
109
  * Use FreeTDS 1.0 final
4
110
 
5
111
 
6
- * 1.0.3 *
112
+ ## 1.0.3
7
113
 
8
114
  * Use FreeTDS 1.0rc5 for cross compile windows gems.
9
115
  * Ensure we only work with latest FreeTDS v0.95.x or higher.
10
116
 
11
117
 
12
- * 1.0.2 *
118
+ ## 1.0.2
13
119
 
14
120
  * Cross compile w/2.3.0 using rake-compiler-dock ~> 0.5.1. Fixes #268 #270.
15
121
  * Use FreeTDS 1.0rc4 for cross compile windows gems.
16
122
 
17
123
 
18
- * 1.0.1 *
124
+ ## 1.0.1
19
125
 
20
126
  * Fix ruby exe's in non-platform gem.
21
127
 
22
128
 
23
- * 1.0.0 *
129
+ ## 1.0.0
24
130
 
25
131
  * Tested with FreeTDS 1.0.
26
132
  * Add emoji support by default using FreeTDS v1.0 in docs.
@@ -44,7 +150,7 @@
44
150
  * FreeTDS - Remove support for bad iconv.
45
151
 
46
152
 
47
- * 0.7.0 *
153
+ ## 0.7.0
48
154
 
49
155
  * Refactor build of FreeTDS & Iconv recipes. Add OpenSSL. Merged #207.
50
156
  * Ensure zero terminated strings, where C-str pointers are expected. Use StringValueCStr() Fixes #208.
@@ -56,7 +162,7 @@
56
162
  * Remove Ruby 1.8.6 support. We always use Time vs edge case DateTime.
57
163
 
58
164
 
59
- * 0.6.2 *
165
+ ## 0.6.2
60
166
 
61
167
  * Support an optional environment variable to find FreeTDS. Fixes #128.
62
168
  * Allow Support for 31+ Character Usernames/Passwords. Fixes #134. Thanks @wbond.
@@ -66,12 +172,12 @@
66
172
  as backups and restores. Fixes #150.
67
173
 
68
174
 
69
- * 0.6.1 *
175
+ ## 0.6.1
70
176
 
71
177
  Use both dbsetversion() vs. dbsetlversion. Partially reverts #62.
72
178
 
73
179
 
74
- * 0.6.0 *
180
+ ## 0.6.0
75
181
 
76
182
  * Use dbsetversion() vs. dbsetlversion. Fixes #62.
77
183
  * Remove Ruby 1.8 support.
@@ -88,12 +194,12 @@ Use both dbsetversion() vs. dbsetlversion. Partially reverts #62.
88
194
  * Raise and handle encoding errors on DB writes. Fixes #89.
89
195
 
90
196
 
91
- * 0.5.1 *
197
+ ## 0.5.1
92
198
 
93
199
  * Change how we configure with iconv, basically it is always needed. Fixes #11 & #69.
94
200
 
95
201
 
96
- * 0.5.0 *
202
+ ## 0.5.0
97
203
 
98
204
  * Copy mysql2s handling of Time and Datetime so 64bit systems are leveraged. Fixes #46 and #47. Thanks @lsylvester!
99
205
  * Add CFLAGS='-fPIC' for libtool. Fix TDS version configs in our ports file. Document. Fixes #45
@@ -107,7 +213,7 @@ Use both dbsetversion() vs. dbsetlversion. Partially reverts #62.
107
213
  * Do not raise a TinyTds::Error with our message handler unless the severity is greater than 10.
108
214
 
109
215
 
110
- * 0.4.5 *
216
+ ## 0.4.5
111
217
 
112
218
  * Includes precompiled Windows binaries for FreeTDS 0.91rc2 & LibIconv. No precompiled OpenSSL yet for Windows to SQL Azure.
113
219
  * Fixed symbolized unicode column names.
@@ -116,19 +222,19 @@ Use both dbsetversion() vs. dbsetlversion. Partially reverts #62.
116
222
  * Change how :host/:port are implemented. Now sending "host:port" to :dataserver.
117
223
 
118
224
 
119
- * 0.4.4 *
225
+ ## 0.4.4
120
226
 
121
227
  * New :host/:port connection options. Removes need for freetds.conf file.
122
228
 
123
229
 
124
- * 0.4.3 *
230
+ ## 0.4.3
125
231
 
126
232
  * New Client#active? method to check for good connection. Always use this abstract method.
127
233
  * Better SYBEWRIT "Write to SQL Server failed." error handling. New Client#dead? check.
128
234
  * Azure tested using latest FreeTDS with submitted patch. https://gist.github.com/889190
129
235
 
130
236
 
131
- * 0.4.2 *
237
+ ## 0.4.2
132
238
 
133
239
  * Iconv is a dep only when compiling locally. However, left in the ability to configure
134
240
  it for native gem installation but you must use
@@ -136,12 +242,12 @@ Use both dbsetversion() vs. dbsetlversion. Partially reverts #62.
136
242
  * Really fix what 0.4.1 was supposed to do, force SYBDBLIB compile.
137
243
 
138
244
 
139
- * 0.4.1 *
245
+ ## 0.4.1
140
246
 
141
247
  * Undefine MSDBLIB in case others have explicitly compiled FreeTDS with "MS db-lib source compatibility: yes".
142
248
 
143
249
 
144
- * 0.4.0 *
250
+ ## 0.4.0
145
251
 
146
252
  * Allow SYBEICONVI errors to pass thru so that bad data is converted to ? marks.
147
253
  * Build native deps using MiniPortile [Luis Lavena]
@@ -150,42 +256,44 @@ Use both dbsetversion() vs. dbsetlversion. Partially reverts #62.
150
256
  state of the client and the need to use Result#cancel to stop processing active results. It is also
151
257
  safe to call Result#cancel over and over again.
152
258
  * Look for the syb headers only.
259
+ * Fix minitest global matchers warnings.
260
+ * Fix test warnings.
153
261
 
154
262
 
155
- * 0.3.2 *
263
+ ## 0.3.2
156
264
 
157
265
  * Small changes while testing JRuby. Using options hash for connect vs many args.
158
266
 
159
267
 
160
- * 0.3.1 *
268
+ ## 0.3.1
161
269
 
162
270
  * Fix bad gem build.
163
271
 
164
272
 
165
- * 0.3.0 *
273
+ ## 0.3.0
166
274
 
167
275
  * Access stored procedure return codes.
168
276
  * Make sure dead or not enabled connections are handled.
169
277
  * Fix bad client after timeout & read from server errors.
170
278
 
171
279
 
172
- * 0.2.3 *
280
+ ## 0.2.3
173
281
 
174
282
  * Do not use development ruby/version, but simple memoize an eval check on init to find out, for 1.8.6 reflection.
175
283
 
176
284
 
177
- * 0.2.2 *
285
+ ## 0.2.2
178
286
 
179
287
  * Fixed failing test in Ruby 1.8.6. DateTime doesn't support fractional seconds greater than 59.
180
288
  See: http://redmine.ruby-lang.org/issues/show/1490 [Erik Bryn]
181
289
 
182
290
 
183
- * 0.2.1 *
291
+ ## 0.2.1
184
292
 
185
293
  * Compatibility with 32-bit systems. Better cross language testing. [Klaus Gundermann]
186
294
 
187
295
 
188
- * 0.2.0 *
296
+ ## 0.2.0
189
297
 
190
298
  * Convert GUID's in a more compatible way. [Klaus Gundermann]
191
299
  * Handle multiple result sets in command buffer or stored procs. [Ken Collins]
@@ -194,5 +302,4 @@ Use both dbsetversion() vs. dbsetlversion. Partially reverts #62.
194
302
  * Properly encode column names in 1.9. [Erik Bryn]
195
303
 
196
304
 
197
- * 0.1.0 Initial release!
198
-
305
+ ## 0.1.0 Initial release!
data/Gemfile CHANGED
@@ -1,6 +1,2 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
  gemspec
3
-
4
- group :development do
5
- gem 'byebug'
6
- end
data/ISSUE_TEMPLATE.md CHANGED
@@ -1,5 +1,38 @@
1
- Having problems? Have you checked these first:
1
+ ## Before submitting an issue please check these first!
2
2
 
3
- * Are you using FreeTDS 0.95.80 or later? Check `$ tsql -C` to find out.
3
+ * On Windows? If so, do you need devkit for your ruby install?
4
+ * Using Ubuntu? If so, you may have forgotten to install FreeTDS first.
5
+ * Are you using FreeTDS 1.0.0 or later? Check `$ tsql -C` to find out.
4
6
  * If not, please update then uninstall the TinyTDS gem and re-install it.
5
- * Are you using Ubuntu? If so, you may have forgotten to install FreeTDS first.
7
+ * Have you made sure to [enable SQL Server authentication](http://bit.ly/1Kw3set)?
8
+ * Doing work with threads and the raw client? Use the ConnectionPool gem?
9
+
10
+ If none of these help. Please fill out the following:
11
+
12
+ ## Environment
13
+
14
+ **Operating System**
15
+
16
+ Please describe your operating system and version here.
17
+ If unsure please try the following from the command line:
18
+
19
+ * For Windows: `systeminfo | findstr /C:OS`
20
+ * For Linux: `lsb_release -a; uname -a`
21
+ * For Mac OSX: `sw_vers`
22
+
23
+ **TinyTDS Version and Information**
24
+
25
+ ```
26
+ Please paste the full output of `ttds-tsql -C` (or `tsql -C` for older versions
27
+ of TinyTDS) here. If TinyTDS does not install, please provide the gem version.
28
+ ```
29
+
30
+
31
+ **FreeTDS Version**
32
+
33
+ Please provide your system's FreeTDS version. If you are using the pre-compiled
34
+ windows gem you may omit this section.
35
+
36
+ ## Description
37
+
38
+ Please describe the bug or feature request here.