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 CHANGED
@@ -1,5 +1,11 @@
1
1
 
2
- * 0.4.5.rc1 *
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
@@ -2,7 +2,7 @@
2
2
  source :rubygems
3
3
 
4
4
  group :development do
5
- gem 'rake', '>= 0.8.7'
5
+ gem 'rake', '0.8.7'
6
6
  gem 'mini_portile', '0.2.2'
7
7
  gem 'rake-compiler', '0.7.8'
8
8
  end
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010 Ken Collins, <ken@metaskills.net>
1
+ Copyright (c) 2010-2011 Ken Collins, <ken@metaskills.net>
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person
4
4
  obtaining a copy of this software and associated documentation
@@ -258,6 +258,7 @@ For help and support.
258
258
 
259
259
  Current to do list.
260
260
 
261
+ * Include OpenSSL with Windows binaries for SQL Azure.
261
262
  * Install an interrupt handler.
262
263
  * Allow #escape to accept all ruby primitives.
263
264
  * Get bug reports!
@@ -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 = LONG2NUM(*(long *)data);
429
+ identity = LL2NUM(*(DBBIGINT *)data);
430
430
  }
431
431
  }
432
432
  return identity;
@@ -1,3 +1,3 @@
1
1
  module TinyTds
2
- VERSION = '0.4.5.rc2'
2
+ VERSION = '0.4.5'
3
3
  end
@@ -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://www.ibiblio.org/pub/Linux/ALPHA/freetds/current/freetds-current.tgz"} }
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
 
@@ -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
- assert_equal col_name, result.fields.first
297
- assert_equal col_name, row.keys.first
298
- assert_utf8_encoding result.fields.first
299
- assert_utf8_encoding row.keys.first
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: 15424121
5
- prerelease: 6
4
+ hash: 5
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
9
  - 5
10
- - rc
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-04-26 00:00:00 -04:00
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: 25
88
+ hash: 3
91
89
  segments:
92
- - 1
93
- - 3
94
- - 1
95
- version: 1.3.1
90
+ - 0
91
+ version: "0"
96
92
  requirements: []
97
93
 
98
94
  rubyforge_project: