Skip to content

Commit 9aedbb9

Browse files
committed
Add an integer beyond 64 bit
1 parent 25bf14c commit 9aedbb9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

spec/mysql2/statement_spec.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,15 @@
6868
end
6969

7070
it "should handle bignum but beyond int64_t" do
71-
stmt = @client.prepare('SELECT ? AS max1, ? AS max2, ? AS min1, ? AS min2, ? AS min3')
71+
stmt = @client.prepare('SELECT ? AS max1, ? AS max2, ? AS max3, ? AS min1, ? AS min2, ? AS min3')
7272
int64_max1 = (1 << 63)
7373
int64_max2 = (1 << 64) - 1
74+
int64_max3 = 1 << 64
7475
int64_min1 = -(1 << 63) - 1
7576
int64_min2 = -(1 << 64) + 1
7677
int64_min3 = -0xC000000000000000
77-
result = stmt.execute(int64_max1, int64_max2, int64_min1, int64_min2, int64_min3)
78-
expect(result.to_a).to eq(['max1' => int64_max1.to_s, 'max2' => int64_max2.to_s, 'min1' => int64_min1.to_s, 'min2' => int64_min2.to_s, 'min3' => int64_min3.to_s])
78+
result = stmt.execute(int64_max1, int64_max2, int64_max3, int64_min1, int64_min2, int64_min3)
79+
expect(result.to_a).to eq(['max1' => int64_max1.to_s, 'max2' => int64_max2.to_s, 'max3' => int64_max3.to_s, 'min1' => int64_min1.to_s, 'min2' => int64_min2.to_s, 'min3' => int64_min3.to_s])
7980
end
8081

8182
it "should keep its result after other query" do

0 commit comments

Comments
 (0)