tiny_tds 0.4.5.rc2 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +7 -1
- data/Gemfile +1 -1
- data/MIT-LICENSE +1 -1
- data/README.rdoc +1 -0
- data/ext/tiny_tds/result.c +1 -1
- data/lib/tiny_tds/version.rb +1 -1
- data/tasks/ports.rake +1 -1
- data/test/result_test.rb +20 -6
- metadata +8 -12
data/CHANGELOG
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
|
2
|
-
* 0.4.5
|
2
|
+
* 0.4.5 *
|
3
|
+
|
4
|
+
* Includes precompiled Windows binaries for FreeTDS 0.91rc2 & LibIconv. No precompiled OpenSSL yet for Windows to SQL Azure.
|
5
|
+
|
6
|
+
* Fixed symbolized unicode column names.
|
7
|
+
|
8
|
+
* Use same bigint ruby functions to return identity. Hopefully fixes #19.
|
3
9
|
|
4
10
|
* Release static libs for Windows.
|
5
11
|
|
data/Gemfile
CHANGED
data/MIT-LICENSE
CHANGED
data/README.rdoc
CHANGED
data/ext/tiny_tds/result.c
CHANGED
@@ -426,7 +426,7 @@ static VALUE rb_tinytds_result_insert(VALUE self) {
|
|
426
426
|
DBINT data_len = dbdatlen(rwrap->client, col);
|
427
427
|
int null_val = ((data == NULL) && (data_len == 0));
|
428
428
|
if (!null_val)
|
429
|
-
identity =
|
429
|
+
identity = LL2NUM(*(DBBIGINT *)data);
|
430
430
|
}
|
431
431
|
}
|
432
432
|
return identity;
|
data/lib/tiny_tds/version.rb
CHANGED
data/tasks/ports.rake
CHANGED
@@ -7,7 +7,7 @@ namespace :ports do
|
|
7
7
|
FREETDS_VERSION = ENV['TINYTDS_FREETDS_082'] ? "0.82" : "0.91"
|
8
8
|
FREETDS_VERSION_INFO = {
|
9
9
|
"0.82" => {:files => "http://ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz"},
|
10
|
-
"0.91" => {:files => "http://
|
10
|
+
"0.91" => {:files => "http://ibiblio.org/pub/Linux/ALPHA/freetds/stable/release_candidates/freetds-0.91RC2.tar.gz"} }
|
11
11
|
|
12
12
|
ORIGINAL_HOST = RbConfig::CONFIG["arch"]
|
13
13
|
|
data/test/result_test.rb
CHANGED
@@ -174,6 +174,20 @@ class ResultTest < TinyTds::TestCase
|
|
174
174
|
assert_equal sql_identity+1, native_identity
|
175
175
|
end
|
176
176
|
end
|
177
|
+
|
178
|
+
should 'return bigint for #insert when needed' do
|
179
|
+
rollback_transaction(@client) do
|
180
|
+
seed = 9223372036854775805
|
181
|
+
@client.execute("DELETE FROM [datatypes]").do
|
182
|
+
id_constraint_name = @client.execute("EXEC sp_helpindex [datatypes]").detect{ |row| row['index_keys'] == 'id' }['index_name']
|
183
|
+
@client.execute("ALTER TABLE [datatypes] DROP CONSTRAINT [#{id_constraint_name}]").do
|
184
|
+
@client.execute("ALTER TABLE [datatypes] DROP COLUMN [id]").do
|
185
|
+
@client.execute("ALTER TABLE [datatypes] ADD [id] [bigint] NOT NULL IDENTITY(1,1) PRIMARY KEY").do
|
186
|
+
@client.execute("DBCC CHECKIDENT ('datatypes', RESEED, #{seed})").do
|
187
|
+
identity = @client.execute("INSERT INTO [datatypes] ([varchar_50]) VALUES ('something')").insert
|
188
|
+
assert_equal seed, identity
|
189
|
+
end
|
190
|
+
end
|
177
191
|
|
178
192
|
should 'be able to begin/commit transactions with raw sql' do
|
179
193
|
rollback_transaction(@client) do
|
@@ -286,17 +300,17 @@ class ResultTest < TinyTds::TestCase
|
|
286
300
|
assert_equal data.first.keys.map{ |r| r.object_id }, data.last.keys.map{ |r| r.object_id }
|
287
301
|
end
|
288
302
|
|
289
|
-
should 'have properly encoded column names' do
|
303
|
+
should 'have properly encoded column names with symbol keys' do
|
290
304
|
col_name = "öäüß"
|
291
305
|
@client.execute("DROP TABLE [test_encoding]").do rescue nil
|
292
306
|
@client.execute("CREATE TABLE [dbo].[test_encoding] ( [#{col_name}] [nvarchar](10) NOT NULL )").do
|
293
307
|
@client.execute("INSERT INTO [test_encoding] ([#{col_name}]) VALUES (N'#{col_name}')").do
|
294
308
|
result = @client.execute("SELECT [#{col_name}] FROM [test_encoding]")
|
295
|
-
row = result.each.first
|
296
|
-
|
297
|
-
assert_equal col_name,
|
298
|
-
|
299
|
-
|
309
|
+
row = result.each(:as => :hash, :symbolize_keys => true).first
|
310
|
+
assert_instance_of Symbol, result.fields.first
|
311
|
+
assert_equal col_name.to_sym, result.fields.first
|
312
|
+
assert_instance_of Symbol, row.keys.first
|
313
|
+
assert_equal col_name.to_sym, row.keys.first
|
300
314
|
end unless sqlserver_azure?
|
301
315
|
|
302
316
|
should 'allow #return_code to work with stored procedures and reset per sql batch' do
|
metadata
CHANGED
@@ -1,15 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tiny_tds
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 5
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
9
|
- 5
|
10
|
-
|
11
|
-
- 2
|
12
|
-
version: 0.4.5.rc2
|
10
|
+
version: 0.4.5
|
13
11
|
platform: ruby
|
14
12
|
authors:
|
15
13
|
- Ken Collins
|
@@ -18,7 +16,7 @@ autorequire:
|
|
18
16
|
bindir: bin
|
19
17
|
cert_chain: []
|
20
18
|
|
21
|
-
date: 2011-
|
19
|
+
date: 2011-05-24 00:00:00 -04:00
|
22
20
|
default_executable:
|
23
21
|
dependencies: []
|
24
22
|
|
@@ -85,14 +83,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
85
83
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
86
84
|
none: false
|
87
85
|
requirements:
|
88
|
-
- - "
|
86
|
+
- - ">="
|
89
87
|
- !ruby/object:Gem::Version
|
90
|
-
hash:
|
88
|
+
hash: 3
|
91
89
|
segments:
|
92
|
-
-
|
93
|
-
|
94
|
-
- 1
|
95
|
-
version: 1.3.1
|
90
|
+
- 0
|
91
|
+
version: "0"
|
96
92
|
requirements: []
|
97
93
|
|
98
94
|
rubyforge_project:
|