|
From: Michael N. <mne...@us...> - 2003-04-27 17:37:07
|
Update of /cvsroot/ruby-dbi/src/lib/dbi
In directory sc8-pr-cvs1:/tmp/cvs-serv23497
Modified Files:
sql.rb
Log Message:
Fixed bug in DBI::SQL::BasicQuote::Coerce#as_time
Mysql time columns (like "13:32:33") could not be converted into DBI::Time objects
(thanks to Tim Bates)
Index: sql.rb
===================================================================
RCS file: /cvsroot/ruby-dbi/src/lib/dbi/sql.rb,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- sql.rb 1 Feb 2003 13:45:23 -0000 1.13
+++ sql.rb 27 Apr 2003 17:37:02 -0000 1.14
@@ -47,9 +47,9 @@
end
def as_time(str)
- return nil if str.nil?
- t = as_timestamp(str)
- DBI::Time.new(t.hour, t.min, t.sec)
+ return nil if str.nil? or str.empty?
+ t = ParseDate.parsedate(str)
+ DBI::Time.new(*t[3,3])
end
|