tiny_tds 2.1.1 → 2.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +5 -5
  2. data/.codeclimate.yml +0 -0
  3. data/.gitattributes +0 -0
  4. data/.gitignore +0 -0
  5. data/.rubocop.yml +0 -0
  6. data/.travis.yml +4 -3
  7. data/CHANGELOG.md +19 -0
  8. data/CODE_OF_CONDUCT.md +0 -0
  9. data/Gemfile +0 -0
  10. data/ISSUE_TEMPLATE.md +0 -0
  11. data/MIT-LICENSE +0 -0
  12. data/README.md +18 -13
  13. data/Rakefile +0 -0
  14. data/VERSION +1 -1
  15. data/appveyor.yml +13 -6
  16. data/ext/tiny_tds/client.c +1 -1
  17. data/ext/tiny_tds/client.h +0 -0
  18. data/ext/tiny_tds/extconf.rb +17 -13
  19. data/ext/tiny_tds/extconsts.rb +2 -2
  20. data/ext/tiny_tds/result.c +7 -6
  21. data/ext/tiny_tds/result.h +0 -0
  22. data/ext/tiny_tds/tiny_tds_ext.c +0 -0
  23. data/ext/tiny_tds/tiny_tds_ext.h +0 -0
  24. data/lib/tiny_tds.rb +0 -0
  25. data/lib/tiny_tds/bin.rb +0 -0
  26. data/lib/tiny_tds/client.rb +0 -0
  27. data/lib/tiny_tds/error.rb +0 -0
  28. data/lib/tiny_tds/gem.rb +0 -0
  29. data/lib/tiny_tds/result.rb +0 -0
  30. data/lib/tiny_tds/version.rb +0 -0
  31. data/patches/freetds/1.00.27/0001-mingw_missing_inet_pton.diff +0 -0
  32. data/patches/freetds/1.00.27/0002-Don-t-use-MSYS2-file-libws2_32.diff +0 -0
  33. data/patches/libiconv/1.14/1-avoid-gets-error.patch +0 -0
  34. data/tasks/native_gem.rake +1 -1
  35. data/tasks/package.rake +0 -0
  36. data/tasks/ports.rake +6 -8
  37. data/tasks/ports/freetds.rb +0 -0
  38. data/tasks/ports/libiconv.rb +0 -0
  39. data/tasks/ports/openssl.rb +2 -18
  40. data/tasks/ports/recipe.rb +0 -0
  41. data/tasks/test.rake +0 -0
  42. data/test/appveyor/dbsetup.ps1 +0 -0
  43. data/test/appveyor/dbsetup.sql +0 -0
  44. data/test/benchmark/query.rb +0 -0
  45. data/test/benchmark/query_odbc.rb +0 -0
  46. data/test/benchmark/query_tinytds.rb +0 -0
  47. data/test/client_test.rb +0 -0
  48. data/test/gem_test.rb +0 -0
  49. data/test/result_test.rb +0 -0
  50. data/test/schema/sqlserver_2000.sql +0 -0
  51. data/test/schema/sqlserver_2005.sql +0 -0
  52. data/test/schema/sqlserver_2008.sql +0 -0
  53. data/test/schema/sqlserver_2014.sql +0 -0
  54. data/test/schema/sqlserver_2016.sql +0 -0
  55. data/test/schema/sqlserver_azure.sql +0 -0
  56. data/test/schema/sybase_ase.sql +0 -0
  57. data/test/schema_test.rb +10 -10
  58. data/test/test_helper.rb +0 -0
  59. data/test/thread_test.rb +0 -0
  60. data/tiny_tds.gemspec +2 -2
  61. metadata +8 -33
  62. data/BACKERS.md +0 -32
  63. data/circle.yml +0 -31
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 240a1e41a65c669272527c2eb7476ba0bfdd1a21
4
- data.tar.gz: 0c1a875402d2b37b9adf7f7495ae27b57e7b4e88
2
+ SHA256:
3
+ metadata.gz: '009faf9814321046171c7dfe6a0cbf86b137f4295ae079c1b8ae47067a940d10'
4
+ data.tar.gz: 6a20fcde7f6863f3e876f3484c4c93ded56511d93ac76de355c43f365758539d
5
5
  SHA512:
6
- metadata.gz: e408a64c82001f7c895098295c761937e7ec77660a0e51b18fd30d74c1238bb3c399a9ce7ca644bd663f95fb163562a46678c8b120f01b9a39af02f59b06030a
7
- data.tar.gz: deccfd764dca1b7dbab5164a01393c32c25c8cd299de98194f11b08ac0c01c86170df1dc14f24a9ac294f6c33dfb6356add5cee4ab0067aa13f890b997c7fd02
6
+ metadata.gz: 6572f896cf1a4812b652417d1b353487d49998df7dac8518de7310123cce5c295d775e102a184355b8501a3fa3b1f9f66f892026a33fc97bfde56e3cb9912a36
7
+ data.tar.gz: d05b4c50dbbe86f920a34cc6a6fc9bd20b9b27564d75b2e05f214b1600504898e22f5935ba1183f82646095a95d8bbbcba3f1fcc2548920e35d87b11c7bf0cd4
File without changes
File without changes
data/.gitignore CHANGED
File without changes
File without changes
@@ -8,9 +8,10 @@ env:
8
8
  - TESTOPTS="-v"
9
9
  - TINYTDS_UNIT_HOST=localhost
10
10
  rvm:
11
- - 2.1.9
12
- - 2.2.5
13
- - 2.3.1
11
+ - 2.4.5
12
+ - 2.5.3
13
+ - 2.6.1
14
+ - 2.7.0
14
15
  before_install:
15
16
  - docker info
16
17
  - sudo ./test/bin/install-openssl.sh
@@ -1,3 +1,22 @@
1
+ ## (unreleased)
2
+
3
+ ## 2.1.3
4
+
5
+ * Removed old/unused appveyor config
6
+ * Remove old Rubies from CI & cross compile list
7
+ * Add Ruby 2.6 and 2.7 to the cross compile list
8
+
9
+ ## 2.1.2
10
+
11
+ * Use Kernel.BigDecimal vs BigDecimal.new. Fixes #409.
12
+ * Change `DBSETUTF16` abscence warning message. Fixes #410.
13
+ * Add Windows binary for Ruby-2.5. Fixes #408.
14
+
15
+ ## 2.1.1
16
+
17
+ * Move message_handler from a shared value to userdata.
18
+
19
+
1
20
  ## 2.1.0
2
21
 
3
22
  * Support RubyInstaller2 for Windows. Fixes #365.
File without changes
data/Gemfile CHANGED
File without changes
File without changes
File without changes
data/README.md CHANGED
@@ -1,17 +1,11 @@
1
1
  # TinyTDS - Simple and fast FreeTDS bindings for Ruby using DB-Library.
2
2
 
3
3
  * [![TravisCI](https://travis-ci.org/rails-sqlserver/tiny_tds.svg?branch=master)](https://travis-ci.org/rails-sqlserver/tiny_tds) - TravisCI
4
- * [![CircleCI](https://circleci.com/gh/rails-sqlserver/tiny_tds/tree/master.svg?style=svg)](https://circleci.com/gh/rails-sqlserver/tiny_tds/tree/master) - CircleCI
5
4
  * [![Build Status](https://ci.appveyor.com/api/projects/status/g2bhhbsdkx0mal55/branch/master?svg=true)](https://ci.appveyor.com/project/rails-sqlserver/tiny-tds/branch/master) - Appveyor
6
- * [![Code Climate](https://codeclimate.com/github/rails-sqlserver/tiny_tds/badges/gpa.svg)](https://codeclimate.com/github/rails-sqlserver/tiny_tds) - Code Climate
7
5
  * [![Gem Version](https://img.shields.io/gem/v/tiny_tds.svg)](https://rubygems.org/gems/tiny_tds) - Gem Version
8
6
  * [![Dependency Status](https://dependencyci.com/github/rails-sqlserver/tiny_tds/badge)](https://dependencyci.com/github/rails-sqlserver/tiny_tds) - Dependency Status
9
7
  * [![Gitter chat](https://img.shields.io/badge/%E2%8A%AA%20GITTER%20-JOIN%20CHAT%20%E2%86%92-brightgreen.svg?style=flat)](https://gitter.im/rails-sqlserver/activerecord-sqlserver-adapter) - Community
10
8
 
11
- ## Supporting TinyTDS/Adapter
12
-
13
- Both TinyTDS and the Rails SQL Server Adapter are MIT-licensed open source projects. Its ongoing development is made possible thanks to the support by these awesome [backers](https://github.com/rails-sqlserver/tiny_tds/blob/master/BACKERS.md). If you'd like to join them, check out our [Patreon Campaign](https://www.patreon.com/metaskills).
14
-
15
9
 
16
10
  ## About TinyTDS
17
11
 
@@ -44,15 +38,15 @@ $ apt-get install wget
44
38
  $ apt-get install build-essential
45
39
  $ apt-get install libc6-dev
46
40
 
47
- $ wget http://www.freetds.org/files/stable/freetds-1.00.21.tar.gz
48
- $ tar -xzf freetds-1.00.21.tar.gz
49
- $ cd freetds-1.00.21
41
+ $ wget http://www.freetds.org/files/stable/freetds-1.1.24.tar.gz
42
+ $ tar -xzf freetds-1.1.24.tar.gz
43
+ $ cd freetds-1.1.24
50
44
  $ ./configure --prefix=/usr/local --with-tdsver=7.3
51
45
  $ make
52
46
  $ make install
53
47
  ```
54
48
 
55
- If none exist, our native extension will use MiniPortile to install any missing dependencies listed above for your specific platform. These dependencies will be built and linked within the installed TinyTDS gem. Please read the MiniPortile and/or Windows sections at the end of this file for advanced configuration options past the following:
49
+ Please read the MiniPortile and/or Windows sections at the end of this file for advanced configuration options past the following:
56
50
 
57
51
  ```
58
52
  --with-freetds-dir=DIR
@@ -75,11 +69,11 @@ TinyTDS is developed against FreeTDS 0.95, 0.99, and 1.0 current. Our default an
75
69
 
76
70
  **NOTE:** Windows users of our pre-compiled native gems need not worry about installing FreeTDS and its dependencies.
77
71
 
78
- * **Do I need to install FreeTDS?** Yes! Somehow, someway, you are going to need FreeTDS for TinyTDS to compile against. You can avoid installing FreeTDS on your system by using our projects usage of rake-compiler and mini_portile to compile and package a native gem just for you. See the "Using MiniPortile" section below.
72
+ * **Do I need to install FreeTDS?** Yes! Somehow, someway, you are going to need FreeTDS for TinyTDS to compile against.
79
73
 
80
74
  * **OK, I am installing FreeTDS, how do I configure it?** Contrary to what most people think, you do not need to specially configure FreeTDS in any way for client libraries like TinyTDS to use it. About the only requirement is that you compile it with libiconv for proper encoding support. FreeTDS must also be compiled with OpenSSL (or the like) to use it with Azure. See the "Using TinyTDS with Azure" section below for more info.
81
75
 
82
- * **Do I need to configure `--with-tdsver` equal to anything?** Most likely! Technically you should not have too. This is only a default for clients/configs that do not specify what TDS version they want to use. We are currently having issues with passing down a TDS version with the login bit. Till we get that fixed, if you are not using a freetds.conf or a TDSVER environment variable, then make sure to use 7.1.
76
+ * **Do I need to configure `--with-tdsver` equal to anything?** Most likely! Technically you should not have to. This is only a default for clients/configs that do not specify what TDS version they want to use. We are currently having issues with passing down a TDS version with the login bit. Till we get that fixed, if you are not using a freetds.conf or a TDSVER environment variable, then make sure to use 7.1.
83
77
 
84
78
  * **But I want to use TDS version 7.2 for SQL Server 2005 and up!** TinyTDS uses TDS version 7.1 (previously named 8.0) and fully supports all the data types supported by FreeTDS, this includes `varchar(max)` and `nvarchar(max)`. Technically compiling and using TDS version 7.2 with FreeTDS is not supported. But this does not mean those data types will not work. I know, it's confusing If you want to learn more, read this thread. http://lists.ibiblio.org/pipermail/freetds/2011q3/027306.html
85
79
 
@@ -407,7 +401,7 @@ The default is true and since FreeTDS v1.0 would do this as well.
407
401
 
408
402
  ## Compiling Gems for Windows
409
403
 
410
- For the convenience of Windows users, TinyTDS ships pre-compiled gems for Ruby 2.0, 2.1, 2.2, and 2.3 on Windows. In order to generate these gems, [rake-compiler-dock](https://github.com/rake-compiler/rake-compiler-dock) is used. This project provides a [Docker image](https://registry.hub.docker.com/u/larskanis/rake-compiler-dock/) with rvm, cross-compilers and a number of different target versions of Ruby.
404
+ For the convenience of Windows users, TinyTDS ships pre-compiled gems for supported versions of Ruby on Windows. In order to generate these gems, [rake-compiler-dock](https://github.com/rake-compiler/rake-compiler-dock) is used. This project provides several [Docker images](https://registry.hub.docker.com/u/larskanis/) with rvm, cross-compilers and a number of different target versions of Ruby.
411
405
 
412
406
  Run the following rake task to compile the gems for Windows. This will check the availability of [Docker](https://www.docker.com/) (and boot2docker on Windows or OS-X) and will give some advice for download and installation. When docker is running, it will download the docker image (once-only) and start the build:
413
407
 
@@ -468,6 +462,17 @@ $ rake TINYTDS_UNIT_HOST=mydb.host.net TINYTDS_SCHEMA=sqlserver_azure
468
462
  $ rake TINYTDS_UNIT_HOST=mydb.host.net TINYTDS_UNIT_PORT=5000 TINYTDS_SCHEMA=sybase_ase
469
463
  ```
470
464
 
465
+ ## Docker Builds
466
+
467
+ If you use a [multi stage](https://docs.docker.com/develop/develop-images/multistage-build/) Docker build to assemble your gems in one phase and then copy your app and gems
468
+ into another, lighter, container without build tools you will need to make sure you tell the OS how to find dependencies for TinyTDS.
469
+
470
+ After you have built and installed FreeTDS it will normally place library files in `/usr/local/lib`. When TinyTDS builds native extensions,
471
+ it [already knows to look here](https://github.com/rails-sqlserver/tiny_tds/blob/master/ext/tiny_tds/extconf.rb#L31) but if you copy your app to a new container that link will be broken.
472
+
473
+ Set the LD_LIBRARY_PATH environment variable `export LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH}` and run `ldconfig`. If you run `ldd tiny_tds.so` you should not see any broken links. Make
474
+ sure you also copied in the library dependencies from your build container with a command like `COPY --from=builder /usr/local/lib /usr/local/lib`.
475
+
471
476
  ## Help & Support
472
477
 
473
478
  * Github Source: http://github.com/rails-sqlserver/tiny_tds
data/Rakefile CHANGED
File without changes
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.1.1
1
+ 2.1.3
@@ -1,21 +1,27 @@
1
1
  init:
2
2
  - SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
3
- - SET PATH=C:\MinGW\msys\1.0\bin;%PATH%
4
3
  - SET RAKEOPT=-rdevkit
5
4
  - SET TESTOPTS='-v'
6
- - SET MAKE=make V=1
5
+ - SET MAKE=make V=1 -j2
7
6
  clone_depth: 5
8
7
  skip_tags: true
9
8
  skip_branch_with_pr: true
10
9
  matrix:
11
- fast_finish: true
10
+ fast_finish: false
12
11
  install:
13
12
  # Output debugging info
14
13
  - ps: Update-AppveyorBuild -Version "$(Get-Content $env:appveyor_build_folder\VERSION).$env:appveyor_build_number"
14
+ - ps: |
15
+ if ($env:ruby_version -like "*head*") {
16
+ $(new-object net.webclient).DownloadFile("https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-$env:ruby_version.exe", "$pwd/ruby-setup.exe")
17
+ cmd /c ruby-setup.exe /verysilent /dir=C:/Ruby$env:ruby_version
18
+ }
15
19
  - perl --version
16
20
  - ruby --version
17
21
  - gem --version
18
22
 
23
+ # prevent freetds to link to wrong ws2_32 lib on i686-w64-mingw32
24
+ - c:/msys64/usr/bin/rm /usr/lib/w32api/libws2_32.a
19
25
  # Set up project prerequisits
20
26
  - bundle install
21
27
  - bundle exec rake ports
@@ -43,9 +49,10 @@ environment:
43
49
  TINYTDS_UNIT_AZURE_PASS:
44
50
  secure: fYKSKV4v+36OFQp2nZdX4DfUpgmy5cm0wuR73cgdmEk=
45
51
  matrix:
46
- - ruby_version: "24-x64"
47
52
  - ruby_version: "24"
48
- - ruby_version: "22-x64"
49
- - ruby_version: "22"
53
+ - ruby_version: "25-x64"
54
+ - ruby_version: "26"
55
+ - ruby_version: "head-x64"
50
56
  on_failure:
57
+ - find -name config.log | xargs cat
51
58
  - find -name compile.log | xargs cat
@@ -362,7 +362,7 @@ static VALUE rb_tinytds_connect(VALUE self, VALUE opts) {
362
362
  if (use_utf16 == Qfalse) { DBSETLUTF16(cwrap->login, 0); }
363
363
  #else
364
364
  if (use_utf16 == Qtrue || use_utf16 == Qfalse) {
365
- rb_warn("TinyTds: :use_utf16 option not supported in this version of FreeTDS.\n");
365
+ rb_warning("TinyTds: Please consider upgrading to FreeTDS 0.99 or higher for better unicode support.\n");
366
366
  }
367
367
  #endif
368
368
 
File without changes
@@ -22,35 +22,39 @@ do_help if arg_config('--help')
22
22
 
23
23
  # Make sure to check the ports path for the configured host
24
24
  host = RbConfig::CONFIG['host']
25
- project_dir = File.join(['..']*4)
25
+ project_dir = File.expand_path("../../..", __FILE__)
26
26
  freetds_ports_dir = File.join(project_dir, 'ports', host, 'freetds', FREETDS_VERSION)
27
27
  freetds_ports_dir = File.expand_path(freetds_ports_dir)
28
28
 
29
29
  # Add all the special path searching from the original tiny_tds build
30
- # order is important here! First in, last searched.
30
+ # order is important here! First in, first searched.
31
31
  DIRS = %w(
32
- /usr/local
33
32
  /opt/local
33
+ /usr/local
34
34
  )
35
35
 
36
+ # Add the ports directory if it exists for local developer builds
37
+ DIRS.unshift(freetds_ports_dir) if File.directory?(freetds_ports_dir)
38
+
36
39
  # Grab freetds environment variable for use by people on services like
37
40
  # Heroku who they can't easily use bundler config to set directories
38
- DIRS.push(ENV['FREETDS_DIR']) if ENV.has_key?('FREETDS_DIR')
39
-
40
- # Add the ports directory if it exists for local developer builds
41
- DIRS.push(freetds_ports_dir) if File.directory?(freetds_ports_dir)
41
+ DIRS.unshift(ENV['FREETDS_DIR']) if ENV.has_key?('FREETDS_DIR')
42
42
 
43
43
  # Add the search paths for freetds configured above
44
- DIRS.each do |path|
45
- idir = "#{path}/include"
44
+ ldirs = DIRS.flat_map do |path|
46
45
  ldir = "#{path}/lib"
46
+ [ldir, "#{ldir}/freetds"]
47
+ end
47
48
 
48
- dir_config('freetds',
49
- [idir, "#{idir}/freetds"],
50
- [ldir, "#{ldir}/freetds"]
51
- )
49
+ idirs = DIRS.flat_map do |path|
50
+ idir = "#{path}/include"
51
+ [idir, "#{idir}/freetds"]
52
52
  end
53
53
 
54
+ puts "looking for freetds headers in the following directories:\n#{idirs.map{|a| " - #{a}\n"}.join}"
55
+ puts "looking for freetds library in the following directories:\n#{ldirs.map{|a| " - #{a}\n"}.join}"
56
+ dir_config('freetds', idirs, ldirs)
57
+
54
58
  have_dependencies = [
55
59
  find_header('sybfront.h'),
56
60
  find_header('sybdb.h'),
@@ -2,10 +2,10 @@
2
2
  ICONV_VERSION = ENV['TINYTDS_ICONV_VERSION'] || "1.15"
3
3
  ICONV_SOURCE_URI = "http://ftp.gnu.org/pub/gnu/libiconv/libiconv-#{ICONV_VERSION}.tar.gz"
4
4
 
5
- OPENSSL_VERSION = ENV['TINYTDS_OPENSSL_VERSION'] || '1.1.0e'
5
+ OPENSSL_VERSION = ENV['TINYTDS_OPENSSL_VERSION'] || '1.1.1d'
6
6
  OPENSSL_SOURCE_URI = "https://www.openssl.org/source/openssl-#{OPENSSL_VERSION}.tar.gz"
7
7
 
8
- FREETDS_VERSION = ENV['TINYTDS_FREETDS_VERSION'] || "1.00.27"
8
+ FREETDS_VERSION = ENV['TINYTDS_FREETDS_VERSION'] || "1.1.24"
9
9
  FREETDS_VERSION_INFO = Hash.new { |h,k|
10
10
  h[k] = {files: "http://www.freetds.org/files/stable/freetds-#{k}.tar.bz2"}
11
11
  }
@@ -6,10 +6,10 @@
6
6
 
7
7
  VALUE cTinyTdsResult;
8
8
  extern VALUE mTinyTds, cTinyTdsClient, cTinyTdsError;
9
- VALUE cBigDecimal, cDate;
9
+ VALUE cKernel, cDate;
10
10
  VALUE opt_decimal_zero, opt_float_zero, opt_one, opt_zero, opt_four, opt_19hdr, opt_onek, opt_tenk, opt_onemil, opt_onebil;
11
11
  static ID intern_new, intern_utc, intern_local, intern_localtime, intern_merge,
12
- intern_civil, intern_new_offset, intern_plus, intern_divide;
12
+ intern_civil, intern_new_offset, intern_plus, intern_divide, intern_bigd;
13
13
  static ID sym_symbolize_keys, sym_as, sym_array, sym_cache_rows, sym_first, sym_timezone, sym_local, sym_utc, sym_empty_sets;
14
14
 
15
15
 
@@ -228,7 +228,7 @@ static VALUE rb_tinytds_result_fetch_row(VALUE self, ID timezone, int symbolize_
228
228
  int data_slength = (int)data_info->precision + (int)data_info->scale + 1;
229
229
  char converted_decimal[data_slength];
230
230
  dbconvert(rwrap->client, coltype, data, data_len, SYBVARCHAR, (BYTE *)converted_decimal, -1);
231
- val = rb_funcall(cBigDecimal, intern_new, 1, rb_str_new2((char *)converted_decimal));
231
+ val = rb_funcall(cKernel, intern_bigd, 1, rb_str_new2((char *)converted_decimal));
232
232
  break;
233
233
  }
234
234
  case SYBFLT8: {
@@ -246,7 +246,7 @@ static VALUE rb_tinytds_result_fetch_row(VALUE self, ID timezone, int symbolize_
246
246
  char converted_money[25];
247
247
  long long money_value = ((long long)money->mnyhigh << 32) | money->mnylow;
248
248
  sprintf(converted_money, "%" LONG_LONG_FORMAT, money_value);
249
- val = rb_funcall(cBigDecimal, intern_new, 2, rb_str_new2(converted_money), opt_four);
249
+ val = rb_funcall(cKernel, intern_bigd, 2, rb_str_new2(converted_money), opt_four);
250
250
  val = rb_funcall(val, intern_divide, 1, opt_tenk);
251
251
  break;
252
252
  }
@@ -254,7 +254,7 @@ static VALUE rb_tinytds_result_fetch_row(VALUE self, ID timezone, int symbolize_
254
254
  DBMONEY4 *money = (DBMONEY4 *)data;
255
255
  char converted_money[20];
256
256
  sprintf(converted_money, "%f", money->mny4 / 10000.0);
257
- val = rb_funcall(cBigDecimal, intern_new, 1, rb_str_new2(converted_money));
257
+ val = rb_funcall(cKernel, intern_bigd, 1, rb_str_new2(converted_money));
258
258
  break;
259
259
  }
260
260
  case SYBBINARY:
@@ -566,7 +566,7 @@ static VALUE rb_tinytds_result_insert(VALUE self) {
566
566
 
567
567
  void init_tinytds_result() {
568
568
  /* Data Classes */
569
- cBigDecimal = rb_const_get(rb_cObject, rb_intern("BigDecimal"));
569
+ cKernel = rb_const_get(rb_cObject, rb_intern("Kernel"));
570
570
  cDate = rb_const_get(rb_cObject, rb_intern("Date"));
571
571
  /* Define TinyTds::Result */
572
572
  cTinyTdsResult = rb_define_class_under(mTinyTds, "Result", rb_cObject);
@@ -588,6 +588,7 @@ void init_tinytds_result() {
588
588
  intern_new_offset = rb_intern("new_offset");
589
589
  intern_plus = rb_intern("+");
590
590
  intern_divide = rb_intern("/");
591
+ intern_bigd = rb_intern("BigDecimal");
591
592
  /* Symbol Helpers */
592
593
  sym_symbolize_keys = ID2SYM(rb_intern("symbolize_keys"));
593
594
  sym_as = ID2SYM(rb_intern("as"));
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -8,7 +8,7 @@ task 'gem:windows' => ['ports:cross'] do
8
8
  build = ['bundle']
9
9
 
10
10
  # and finally build the native gem
11
- build << 'rake cross native gem RUBY_CC_VERSION=2.4.0:2.3.0:2.2.2:2.1.6:2.0.0 CFLAGS="-Wall"'
11
+ build << 'rake cross native gem RUBY_CC_VERSION=2.7.0:2.6.0:2.5.0:2.4.0 CFLAGS="-Wall" MAKE="make -j`nproc`"'
12
12
 
13
13
  RakeCompilerDock.sh build.join(' && ')
14
14
  end
File without changes
@@ -6,14 +6,14 @@ require_relative 'ports/openssl'
6
6
  require_relative 'ports/freetds'
7
7
  require_relative '../ext/tiny_tds/extconsts'
8
8
 
9
- OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE if defined? OpenSSL
10
-
11
9
  namespace :ports do
12
10
  openssl = Ports::Openssl.new(OPENSSL_VERSION)
13
11
  libiconv = Ports::Libiconv.new(ICONV_VERSION)
14
12
  freetds = Ports::Freetds.new(FREETDS_VERSION)
15
13
 
16
14
  directory "ports"
15
+ CLEAN.include "ports/*mingw32*"
16
+ CLEAN.include "ports/*.installed"
17
17
 
18
18
  task :openssl, [:host] do |task, args|
19
19
  args.with_defaults(host: RbConfig::CONFIG['host'])
@@ -71,15 +71,13 @@ namespace :ports do
71
71
  task 'cross' do
72
72
  require 'rake_compiler_dock'
73
73
 
74
- # make sure to install our bundle
75
- build = ['bundle']
76
-
77
74
  # build the ports for all our cross compile hosts
78
75
  GEM_PLATFORM_HOSTS.each do |gem_platform, host|
79
- build << "rake ports:compile[#{host}]"
76
+ # make sure to install our bundle
77
+ build = ['bundle']
78
+ build << "rake ports:compile[#{host}] MAKE='make -j`nproc`'"
79
+ RakeCompilerDock.sh build.join(' && '), platform: gem_platform
80
80
  end
81
-
82
- RakeCompilerDock.sh build.join(' && ')
83
81
  end
84
82
  end
85
83
 
File without changes
File without changes
@@ -27,27 +27,11 @@ module Ports
27
27
 
28
28
  private
29
29
 
30
- def execute(action, command, options={})
31
- # OpenSSL Requires Perl >= 5.10, while the Ruby devkit uses MSYS1 with Perl 5.8.8.
32
- # To overcome this, prepend Git's usr/bin to the PATH.
33
- # It has MSYS2 with a recent version of perl.
34
- prev_path = ENV['PATH']
35
- if host =~ /mingw/ && IO.popen(["perl", "-e", "print($])"], &:read).to_f < 5.010
36
- git_perl = 'C:/Program Files/Git/usr/bin'
37
- if File.directory?(git_perl)
38
- ENV['PATH'] = "#{git_perl}#{File::PATH_SEPARATOR}#{ENV['PATH']}"
39
- ENV['PERL'] = 'perl'
40
- end
41
- end
42
-
43
- super
44
- ENV['PATH'] = prev_path
45
- end
46
-
47
30
  def configure_defaults
48
31
  opts = [
49
32
  'shared',
50
- target_arch
33
+ target_arch,
34
+ "--openssldir=#{path}",
51
35
  ]
52
36
 
53
37
  if cross_build?
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -76,10 +76,10 @@ class SchemaTest < TinyTds::TestCase
76
76
 
77
77
  it 'casts decimal' do
78
78
  assert_instance_of BigDecimal, find_value(91, :decimal_9_2)
79
- assert_equal BigDecimal.new('12345.01'), find_value(91, :decimal_9_2)
80
- assert_equal BigDecimal.new('1234567.89'), find_value(92, :decimal_9_2)
81
- assert_equal BigDecimal.new('0.0'), find_value(93, :decimal_16_4)
82
- assert_equal BigDecimal.new('123456789012.3456'), find_value(94, :decimal_16_4)
79
+ assert_equal BigDecimal('12345.01'), find_value(91, :decimal_9_2)
80
+ assert_equal BigDecimal('1234567.89'), find_value(92, :decimal_9_2)
81
+ assert_equal BigDecimal('0.0'), find_value(93, :decimal_16_4)
82
+ assert_equal BigDecimal('123456789012.3456'), find_value(94, :decimal_16_4)
83
83
  end
84
84
 
85
85
  it 'casts float' do
@@ -102,9 +102,9 @@ class SchemaTest < TinyTds::TestCase
102
102
 
103
103
  it 'casts money' do
104
104
  assert_instance_of BigDecimal, find_value(161, :money)
105
- assert_equal BigDecimal.new('4.20'), find_value(161, :money)
106
- assert_equal BigDecimal.new('922337203685477.5806'), find_value(163 ,:money)
107
- assert_equal BigDecimal.new('-922337203685477.5807'), find_value(162 ,:money)
105
+ assert_equal BigDecimal('4.20'), find_value(161, :money)
106
+ assert_equal BigDecimal('922337203685477.5806'), find_value(163 ,:money)
107
+ assert_equal BigDecimal('-922337203685477.5807'), find_value(162 ,:money)
108
108
  end
109
109
 
110
110
  it 'casts nchar' do
@@ -176,9 +176,9 @@ class SchemaTest < TinyTds::TestCase
176
176
 
177
177
  it 'casts smallmoney' do
178
178
  assert_instance_of BigDecimal, find_value(251, :smallmoney)
179
- assert_equal BigDecimal.new("4.20"), find_value(251, :smallmoney)
180
- assert_equal BigDecimal.new("-214748.3647"), find_value(252, :smallmoney)
181
- assert_equal BigDecimal.new("214748.3646"), find_value(253, :smallmoney)
179
+ assert_equal BigDecimal("4.20"), find_value(251, :smallmoney)
180
+ assert_equal BigDecimal("-214748.3647"), find_value(252, :smallmoney)
181
+ assert_equal BigDecimal("214748.3646"), find_value(253, :smallmoney)
182
182
  end
183
183
 
184
184
  it 'casts text' do
File without changes
File without changes
@@ -21,9 +21,9 @@ Gem::Specification.new do |s|
21
21
  s.required_ruby_version = '>= 2.0.0'
22
22
  s.metadata['msys2_mingw_dependencies'] = 'freetds'
23
23
  s.add_development_dependency 'mini_portile2', '~> 2.0'
24
- s.add_development_dependency 'rake', '~> 10.4'
24
+ s.add_development_dependency 'rake', '~> 13.0'
25
25
  s.add_development_dependency 'rake-compiler', '~> 1.0'
26
- s.add_development_dependency 'rake-compiler-dock', '~> 0.6.0'
26
+ s.add_development_dependency 'rake-compiler-dock', '~> 1.0'
27
27
  s.add_development_dependency 'minitest', '~> 5.6'
28
28
  s.add_development_dependency 'connection_pool', '~> 2.2'
29
29
  end
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: 2.1.1
4
+ version: 2.1.3
5
5
  platform: ruby
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: 2018-01-14 00:00:00.000000000 Z
13
+ date: 2020-09-28 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: mini_portile2
@@ -32,14 +32,14 @@ dependencies:
32
32
  requirements:
33
33
  - - "~>"
34
34
  - !ruby/object:Gem::Version
35
- version: '10.4'
35
+ version: '13.0'
36
36
  type: :development
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: '10.4'
42
+ version: '13.0'
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: rake-compiler
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -60,14 +60,14 @@ dependencies:
60
60
  requirements:
61
61
  - - "~>"
62
62
  - !ruby/object:Gem::Version
63
- version: 0.6.0
63
+ version: '1.0'
64
64
  type: :development
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - "~>"
69
69
  - !ruby/object:Gem::Version
70
- version: 0.6.0
70
+ version: '1.0'
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: minitest
73
73
  requirement: !ruby/object:Gem::Requirement
@@ -113,7 +113,6 @@ files:
113
113
  - ".gitignore"
114
114
  - ".rubocop.yml"
115
115
  - ".travis.yml"
116
- - BACKERS.md
117
116
  - CHANGELOG.md
118
117
  - CODE_OF_CONDUCT.md
119
118
  - Gemfile
@@ -125,7 +124,6 @@ files:
125
124
  - appveyor.yml
126
125
  - bin/defncopy-ttds
127
126
  - bin/tsql-ttds
128
- - circle.yml
129
127
  - exe/.keep
130
128
  - ext/tiny_tds/client.c
131
129
  - ext/tiny_tds/client.h
@@ -197,31 +195,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
197
195
  - !ruby/object:Gem::Version
198
196
  version: '0'
199
197
  requirements: []
200
- rubyforge_project:
201
- rubygems_version: 2.6.8
198
+ rubygems_version: 3.0.3
202
199
  signing_key:
203
200
  specification_version: 4
204
201
  summary: TinyTDS - A modern, simple and fast FreeTDS library for Ruby using DB-Library.
205
- test_files:
206
- - test/appveyor/dbsetup.ps1
207
- - test/appveyor/dbsetup.sql
208
- - test/benchmark/query.rb
209
- - test/benchmark/query_odbc.rb
210
- - test/benchmark/query_tinytds.rb
211
- - test/bin/install-freetds.sh
212
- - test/bin/install-openssl.sh
213
- - test/bin/setup.sh
214
- - test/client_test.rb
215
- - test/gem_test.rb
216
- - test/result_test.rb
217
- - test/schema/1px.gif
218
- - test/schema/sqlserver_2000.sql
219
- - test/schema/sqlserver_2005.sql
220
- - test/schema/sqlserver_2008.sql
221
- - test/schema/sqlserver_2014.sql
222
- - test/schema/sqlserver_2016.sql
223
- - test/schema/sqlserver_azure.sql
224
- - test/schema/sybase_ase.sql
225
- - test/schema_test.rb
226
- - test/test_helper.rb
227
- - test/thread_test.rb
202
+ test_files: []
data/BACKERS.md DELETED
@@ -1,32 +0,0 @@
1
- # Backers
2
-
3
- You can join in supporting TinyTDS and the Rails SQL Server Adapter development by [pledging on Patreon](https://www.patreon.com/metaskills)! Backers in the same pledge level appear in the order of pledge date.
4
-
5
- ### $2000
6
-
7
- [It could be you!](https://www.patreon.com/bePatron?c=765225&rid=1611218)
8
-
9
-
10
- ### $500
11
-
12
- [It could be you!](https://www.patreon.com/bePatron?c=765225&rid=1611209)
13
-
14
-
15
- ### $250
16
-
17
- [It could be you!](https://www.patreon.com/bePatron?c=765225&rid=1611199)
18
-
19
-
20
- ### $100
21
-
22
- [It could be you!](https://www.patreon.com/bePatron?c=765225&rid=1611196)
23
-
24
-
25
- ### $50+
26
-
27
- [It could be you!](https://www.patreon.com/bePatron?c=765225&rid=1611186)
28
-
29
-
30
- ### $10+
31
-
32
- [It could be you!](https://www.patreon.com/bePatron?c=765225&rid=1611149)
data/circle.yml DELETED
@@ -1,31 +0,0 @@
1
- general:
2
- branches:
3
- ignore:
4
- - /dev.*/
5
-
6
- machine:
7
- environment:
8
- PATH: /opt/local/bin:${PATH}
9
- TESTOPTS: -v
10
- TINYTDS_UNIT_HOST: localhost
11
- services:
12
- - docker
13
-
14
- dependencies:
15
- override:
16
- - sudo ./test/bin/install-openssl.sh
17
- - sudo ./test/bin/install-freetds.sh
18
- - rvm-exec 2.1.9 bundle install
19
- - rvm-exec 2.2.5 bundle install
20
- - rvm-exec 2.3.1 bundle install
21
-
22
- database:
23
- post:
24
- - docker info
25
- - ./test/bin/setup.sh
26
-
27
- test:
28
- override:
29
- - rvm-exec 2.1.9 bundle exec rake
30
- - rvm-exec 2.2.5 bundle exec rake
31
- - rvm-exec 2.3.1 bundle exec rake