Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
cc40bc6
Update to 0.99995
snapvolumes Jan 17, 2014
4af7b48
Fix deadlock and performance issue
snapvolumes Jan 17, 2014
ad69cbf
Add gemspec
snapvolumes Jan 17, 2014
c9d500d
Switch to 0.99996.cv to make it clear this isnt' the "official" versi…
snapvolumes Jan 17, 2014
6dd0a9e
Remove these files because they cause problems
snapvolumes Jan 17, 2014
b63c6a6
Force encoding of all ruby strings in results to UTF8 if Encoding.def…
Feb 26, 2014
901ea1c
Fix some formatting on Readme
smlsml Feb 26, 2014
822903c
Increase login timeout
snapvolumes Apr 8, 2014
46ea308
Merge branch 'master' of https://github.com/cloudvolumes/ruby-odbc
snapvolumes Apr 8, 2014
109ab07
Version bump to 0.98 to increase connect timeout
snapvolumes Apr 8, 2014
7bc8d0e
Remove printf
snapvolumes Apr 12, 2014
9e3e740
Bump version and remove debug message
snapvolumes Apr 12, 2014
0c49a60
Support for Ruby 2.x
smlsml Aug 31, 2016
9867c13
Add .gitignore
smlsml Aug 31, 2016
49d3f04
Merge branch 'master' of https://github.com/cloudvolumes/ruby-odbc
smlsml Aug 31, 2016
cfb12eb
Version bump to 0.100.cv
smlsml Aug 31, 2016
efd4596
[AVM-8825] Fixing Reference errors by removing empty params from have…
Feb 12, 2019
bef5ef5
[AVM-8821] Fixing invalid operands to binary / (have 'int' and 'char …
Feb 12, 2019
669b8f8
Version bump to 0.101.cv to support Ruby 2.4.5
smlsml Feb 13, 2019
3a5fab3
Support for Ruby 3.x
raj-sharan Jul 3, 2023
7ba2e67
Merge pull request #4 from raj-sharan/sharan-ruby-odbc-ruby-3-2-support
raj-sharan Jul 10, 2023
050702c
Update gem version to 0.102.cv to support Ruby 3.x
raj-sharan Jul 10, 2023
8ff517c
Fix error 'tried to create Proc object without a block (ArgumentError)'
Aug 21, 2023
a613fa7
Merge pull request #5 from raj-sharan/sharan-ruby-odbc-proc-argument-…
raj-sharan Aug 21, 2023
6b82815
Update ChangeLog to support Ruby 3.0+
raj-sharan Aug 21, 2023
fd9193f
Correct release 0.102.cv date
raj-sharan Aug 21, 2023
28a02b4
Support for Ruby 3.3
Jun 25, 2024
d1e5869
Merge pull request #6 from cloudvolumes/topic/pandeyam/ruby-odbc-0.10…
sukeerthiadiga Jun 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file removed .gemtest
Empty file.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.gem
/tmp/
.idea/
54 changes: 49 additions & 5 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,8 +1,52 @@
ODBC binding for Ruby
---------------------
Thu Jun 27 2024 version 0.103.cv release <[email protected]>
* Argument data type fix to support Ruby 3.3 by replacing NULL with 0 in method rb_funcall
* Include ruby/thread.h to implicitly declare rb_thread_call_without_gvl
* Cast first argument of rb_thread_call_without_gvl to void * data type

HEAD
* migrated to hoe and rake-compiler for the build process
Mon Aug 21 2023 version 0.102.cv release <[email protected]>
* Syntax changes to support Ruby 3.2 by using native "rb_str_new" instead of "rb_tainted_str_new"
Remove tained usage (thanks @vhermecz)
Fix error 'tried to create Proc object without a block (ArgumentError)'

Tue Feb 12 2019 version 0.101.cv release <[email protected]>
* Minor syntax changes to support Ruby 2.4
Don't pass "" as the second parameter to has_library()
Ensure char* are passed to rb_scan_args()

Wed August 31 2016 version 0.100.cv release <[email protected]>
* Add support for Ruby 2.x by using native "rb_thread_call_without_gvl" directly (thanks @shreyasahir)

Wed April 12 2014 version 0.99 release <[email protected]>
* Remove debug log

Wed April 8 2014 version 0.98 release <[email protected]>
* Set login time to 30 seconds

Wed Feb 26 2014 version 0.97 release <[email protected]>
* Force encoding of all ruby strings in results to UTF8 if Encoding.default_external == 'UTF-8'
You must be saving and retrieving UTF8 compatible strings in the database.

Wed Jan 16 2014 version 0.99996 released

* Added call to rb_thread_blocking_region to release the global
interpreter lock during SQLExecute and SQLExecDirect and require it
afterwards.

This improves performance by not blocking all Ruby threads during long
running queries. This also fixes a deadlock which can occur in SQLExecute and
SQLExecDirect which can happen when trying to read (if isolation level is
"read committed", "repeatable read", "serializable", etc.) or when trying to
modify a dirty row that has been modified by an uncommitted transaction. If this
transaction was initiated by a ruby thread in the same process, all ruby threads
will hang and the ruby process will become unresponsive.

Wed Mar 13 2013 version 0.99995 released

* added ODBC::Database.use_sql_column_name= flag to switch
usage of SQLColAttributes(SQL_COLUMN_LABEL) to
SQLColAttributes(SQL_COLUMN_NAME) on per connection basis

Sat Jan 15 2011 version 0.99994 released

Expand Down Expand Up @@ -74,7 +118,7 @@ Fri Sep 15 2006 version 0.9993 released

* more tweaks in extconf.rb for --enable-dlopen'ed utf8 version
thanks Daigo Moriwaki for testing
* eliminated warnings for installer functions
* eliminated warnings for installer functions

Mon Sep 11 2006 version 0.9992 released

Expand All @@ -85,7 +129,7 @@ Mon Sep 11 2006 version 0.9992 released
by Neville Burnell
* handle SQL_NO_DATA for chunk-wise SQLGetData()
* determine dynamically which API (UNICODE or ANSI) to
use for ODBC installer functions
use for ODBC installer functions
* more 64 bit fixes
* added missing SQLEndTran() in init.c

Expand Down Expand Up @@ -143,7 +187,7 @@ Tue Sep 07 2004 version 0.995 released

Wed Jul 14 2004 version 0.994 released

* fixed ODBC::Database.new|connect so that
* fixed ODBC::Database.new|connect so that
ODBC::Database.new.drvconnect(string) works
* fixed SQLTCHAR detect for Win32 in extconf.rb,
thanks to Pedro Luis Castedo Cepeda
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ COPYING
ChangeLog
GPL
MANIFEST
README
README.rd
ruby-odbc.gemspec
ext/extconf.rb
ext/odbc.c
Expand Down
27 changes: 0 additions & 27 deletions Manifest.txt

This file was deleted.

21 changes: 21 additions & 0 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

* Homepage: http://www.ch-werner.de/rubyodbc/

== CloudVolumes Improvements:

This version releases the global interpreter lock during SQLExecute & SQLExecDirect.

It also forces the encoding of all ruby result strings to UTF-8 if Encoding.default_external is 'UTF-8'.

For example:
> Encoding.default_external = 'UTF-8'
> row = # some database query
> puts row[:some_string_column].encoding # UTF-8


Ensure you are saving UTF-8 encoded (or compatible) strings into the database.


== DESCRIPTION:

This is an ODBC binding for Ruby. So far it has been tested with
Expand All @@ -20,6 +35,12 @@ This is an ODBC binding for Ruby. So far it has been tested with

- Ruby 1.8.*, SQLite/ODBC >= 0.67, libiodbc 3.52.4 on Fedora Core 3 x86

- Ruby 2.0.0, SQLite/ODBC >= 0.93, unixODBC 2.2.14 on Ubuntu 12.04 x86

- Ruby 2.2.5, MSSQL/ODBC on Windows 2008R2 (AppVolumes)

- Ruby 2.4.5, MSSQL/ODBC on Windows 2012R2 (AppVolumes)

Michael Neumann <[email protected]> and
Will Merrell <[email protected]> reported successful compilation
with Cygwin on Win32.
Expand Down
8 changes: 7 additions & 1 deletion doc/odbc.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<body>
<h1><a name="reference">Ruby ODBC Reference</a></h1>
<div class = "lastmodifed">
Last update: Thu, 16 September 2010
Last update: Wed, 13 March 2013
</div>
<hr>
<div>
Expand Down Expand Up @@ -706,6 +706,12 @@ <h3>methods:</h3>
SQL_TIMESTAMP data types to Ruby objects. When true,
Ruby Date and Time objects are represented in UTC, when
false (default) in the local timezone.
<dt><a name="use_sql_column_name">
<code>use_sql_column_name[=<var>bool</var>]</code></a>
<dd>Sets or queries the flag controlling how column names are
read from the data source. When false (default), the ODBC
API <code>SQLColAttributes(SQL_COLUMN_LABEL)</code> is used,
otherwise <code>SQLColAttributes(SQL_COLUMN_NAME)</code> is used.
</dl>
<h3>singleton methods:</h3>
<dl>
Expand Down
19 changes: 11 additions & 8 deletions ext/extconf.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
require 'mkmf'

if enable_config('win32-cross-compilation')
PLATFORM = 'mingw32'
elsif ! defined? PLATFORM
if ! defined? PLATFORM
PLATFORM = RUBY_PLATFORM
end
# 2.0+
#adding this for backward compatible
have_header('ruby/thread.h') && have_func('rb_thread_call_without_gvl', 'ruby/thread.h')
# 1.9-only
have_func('rb_thread_blocking_region')

def have_library_ex(lib, func="main", headers=nil)
checking_for "#{func}() in -l#{lib}" do
Expand All @@ -19,7 +22,7 @@ def have_library_ex(lib, func="main", headers=nil)
end
end
end

dir_config("odbc")
have_header("version.h")
have_header("sql.h") || begin
Expand Down Expand Up @@ -92,9 +95,9 @@ def have_library_ex(lib, func="main", headers=nil)
have_func("SQLInstallerError", "odbcinst.h")
# mingw untested !!!
elsif PLATFORM =~ /(mingw|cygwin)/ then
have_library("odbc32", "")
have_library("odbccp32", "")
have_library("user32", "")
have_library("odbc32")
have_library("odbccp32")
have_library("user32")
elsif (testdlopen && PLATFORM !~ /(macos|darwin)/ && CONFIG["CC"] =~ /gcc/ && have_func("dlopen", "dlfcn.h") && have_library("dl", "dlopen")) then
$LDFLAGS+=" -Wl,-init -Wl,ruby_odbc_init -Wl,-fini -Wl,ruby_odbc_fini"
$CPPFLAGS+=" -DHAVE_SQLCONFIGDATASOURCE"
Expand All @@ -121,4 +124,4 @@ def have_library_ex(lib, func="main", headers=nil)
end
end

create_makefile("odbc_ext")
create_makefile("odbc")
Loading