tiny_tds 0.4.5.rc2-x86-mingw32 → 0.4.5.rc3-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,5 +1,7 @@
1
1
 
2
- * 0.4.5.rc1 *
2
+ * 0.4.5.rc3 *
3
+
4
+ * Use same bigint ruby functions to return identity. Hopefully fixes #19.
3
5
 
4
6
  * Release static libs for Windows.
5
7
 
@@ -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.rc3'
3
3
  end
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
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tiny_tds
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15424121
4
+ hash: 15424123
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
9
  - 5
10
10
  - rc
11
- - 2
12
- version: 0.4.5.rc2
11
+ - 3
12
+ version: 0.4.5.rc3
13
13
  platform: x86-mingw32
14
14
  authors:
15
15
  - Ken Collins
@@ -18,7 +18,7 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2011-04-26 00:00:00 -04:00
21
+ date: 2011-04-29 00:00:00 -04:00
22
22
  default_executable:
23
23
  dependencies: []
24
24