Ticket #2763: mysql-timedate-null-value-inspectdb-2.patch
File mysql-timedate-null-value-inspectdb-2.patch, 924 bytes (added by , 18 years ago) |
---|
-
util.py
43 43 ############################################### 44 44 45 45 def typecast_date(s): 46 if s == "0000-00-00": 47 # workaround mysql issue. 48 # see http://code.djangoproject.com/ticket/2763 and 2369 49 return None 46 50 return s and datetime.date(*map(int, s.split('-'))) or None # returns None if s is null 47 51 48 52 def typecast_time(s): # does NOT store time zone information … … 57 61 def typecast_timestamp(s): # does NOT store time zone information 58 62 # "2005-07-29 15:48:00.590358-05" 59 63 # "2005-07-29 09:56:00-05" 64 if s == "0000-00-00 00:00:00": 65 # workaround mysql issue. 66 # see http://code.djangoproject.com/ticket/2763 and 2369 67 return None 60 68 if not s: return None 61 69 if not ' ' in s: return typecast_date(s) 62 70 d, t = s.split()