|
200 | 200 | r.first['test'].class.should eql(klass)
|
201 | 201 | end
|
202 | 202 | elsif 1.size == 8 # 64bit
|
203 |
| - it "should return Time when timestamp is < 1901-12-13 20:45:52" do |
204 |
| - r = @client.query("SELECT CAST('1901-12-13 20:45:51' AS DATETIME) as test") |
205 |
| - r.first['test'].class.should eql(Time) |
206 |
| - end |
| 203 | + if RUBY_VERSION =~ /1.9/ |
| 204 | + it "should return Time when timestamp is < 1901-12-13 20:45:52" do |
| 205 | + r = @client.query("SELECT CAST('1901-12-13 20:45:51' AS DATETIME) as test") |
| 206 | + r.first['test'].class.should eql(Time) |
| 207 | + end |
207 | 208 |
|
208 |
| - it "should return Time when timestamp is > 2038-01-19T03:14:07" do |
209 |
| - r = @client.query("SELECT CAST('2038-01-19 03:14:08' AS DATETIME) as test") |
210 |
| - r.first['test'].class.should eql(Time) |
| 209 | + it "should return Time when timestamp is > 2038-01-19T03:14:07" do |
| 210 | + r = @client.query("SELECT CAST('2038-01-19 03:14:08' AS DATETIME) as test") |
| 211 | + r.first['test'].class.should eql(Time) |
| 212 | + end |
| 213 | + else |
| 214 | + it "should return Time when timestamp is > 0138-12-31 11:59:59" do |
| 215 | + r = @client.query("SELECT CAST('0139-1-1 00:00:00' AS DATETIME) as test") |
| 216 | + r.first['test'].class.should eql(Time) |
| 217 | + end |
| 218 | + |
| 219 | + it "should return DateTime when timestamp is < 0139-1-1T00:00:00" do |
| 220 | + r = @client.query("SELECT CAST('0138-12-31 11:59:59' AS DATETIME) as test") |
| 221 | + r.first['test'].class.should eql(DateTime) |
| 222 | + end |
| 223 | + |
| 224 | + it "should return Time when timestamp is > 2038-01-19T03:14:07" do |
| 225 | + r = @client.query("SELECT CAST('2038-01-19 03:14:08' AS DATETIME) as test") |
| 226 | + r.first['test'].class.should eql(Time) |
| 227 | + end |
211 | 228 | end
|
212 | 229 | end
|
213 | 230 |
|
|
0 commit comments