Changeset 7383 for trunk/psLib/src/db/psDB.c
- Timestamp:
- Jun 6, 2006, 5:30:45 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/db/psDB.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/db/psDB.c
r7305 r7383 12 12 * @author Joshua Hoblitt 13 13 * 14 * @version $Revision: 1.5 4$ $Name: not supported by cvs2svn $15 * @date $Date: 2006-06-0 2 23:22:17$14 * @version $Revision: 1.55 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2006-06-07 03:30:45 $ 16 16 * 17 17 * Copyright 2005 Joshua Hoblitt, University of Hawaii … … 1060 1060 // convert NaNs to NULL and set the buffer_length for strings 1061 1061 1062 bind[i].buffer_length = (unsigned long)strlen((char *)item->data.V); 1063 bind[i].length = &bind[i].buffer_length; 1064 bind[i].buffer = item->data.V; 1065 bind[i].is_null = *(char *)item->data.V == '\0' 1066 ? (my_bool *)&isNull 1067 : NULL; 1062 if ((char *)item->data.V) { 1063 // will handle the case of "" as a NULL database value 1064 bind[i].buffer_length = (unsigned long)strlen((char *)item->data.V); 1065 bind[i].length = &bind[i].buffer_length; 1066 bind[i].buffer = item->data.V; 1067 bind[i].is_null = *(char *)item->data.V == '\0' 1068 ? (my_bool *)&isNull 1069 : NULL; 1070 } else { 1071 // handles the case of NULL as a NULL database value 1072 bind[i].buffer_length = 0; 1073 bind[i].length = &bind[i].buffer_length; 1074 bind[i].buffer = NULL; 1075 bind[i].is_null = (my_bool *)&isNull; 1076 } 1068 1077 } else { 1069 1078 psError(PS_ERR_BAD_PARAMETER_TYPE , true,
Note:
See TracChangeset
for help on using the changeset viewer.
