Changeset 816 for pg8000/trunk/pg8000.py
- Timestamp:
- 03/08/07 23:12:42 (2 years ago)
- Files:
-
- pg8000/trunk/pg8000.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
pg8000/trunk/pg8000.py
r812 r816 417 417 val = val + struct.pack("!h", len(self.params)) 418 418 for param in self.params: 419 val = val + struct.pack("!i", len(param)) + param 419 if param == None: 420 # special case, NULL value 421 val = val + struct.pack("!i", -1) 422 else: 423 val = val + struct.pack("!i", len(param)) + param 420 424 val = val + struct.pack("!h", len(self.out_fc)) 421 425 for fc in self.out_fc: … … 976 980 if data == None: 977 981 raise NotSupportedError("type %r not mapped to pg type" % typ) 982 elif data.get("tid") == -1: 983 # special case: NULL values 984 return None 978 985 if fc == 0: 979 986 func = data.get("txt_out") … … 1016 1023 1017 1024 def py_value(v, description, **kwargs): 1025 if v == None: 1026 # special case - NULL value 1027 return None 1018 1028 type_oid = description['type_oid'] 1019 1029 format = description['format'] … … 1134 1144 str: {"tid": 25, "txt_out": textout}, 1135 1145 unicode: {"tid": 25, "txt_out": textout}, 1146 type(None): {"tid": -1}, 1136 1147 } 1137 1148
