Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
* 1.0.6 *

* Handle SYBVARIANT types from SQL function. Fixes #317. Fixed #321.
* Fix `use_utf16` optoin for booleans. Fixes #314
* Add `-q` check for bin puts. Fixes #318
* Use FreeTDS 1.00.21.
Expand Down
9 changes: 9 additions & 0 deletions ext/tiny_tds/result.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,15 @@ static VALUE rb_tinytds_result_fetch_row(VALUE self, ID timezone, int symbolize_
case SYBTEXT:
val = ENCODED_STR_NEW(data, data_len);
break;
case 98: { // SYBVARIANT
if (data_len == 4) {
val = INT2NUM(*(DBINT *)data);
break;
} else {
val = ENCODED_STR_NEW(data, data_len);
break;
}
}
default:
val = ENCODED_STR_NEW(data, data_len);
break;
Expand Down
5 changes: 5 additions & 0 deletions test/result_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,11 @@ class ResultTest < TinyTds::TestCase
assert_nil result.return_code
end

it 'with LOGINPROPERTY function' do
v = @client.execute("SELECT LOGINPROPERTY('sa', 'IsLocked') as v").first['v']
v.must_equal 0
end

describe 'with multiple result sets' do

before do
Expand Down