cvs: php4 /ext/pgsql pgsql.c
| From: | Yasuo Ohgaki | Date: | Mon, 30 Sep 2002 07:35:41 +0000 |
| Subject: | cvs: php4 /ext/pgsql pgsql.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-14353@lists.php.net to get a copy of this message | ||
yohgaki Mon Sep 30 03:35:41 2002 EDT
Modified files:
/php4/ext/pgsql pgsql.c
Log:
Use PGSQL_CONV_FORCE_NULL as it is supposed.
PGSQL_CONV_FORCE_NULL inserts NULL to field instead of
NULL string for string type tuples.
Index: php4/ext/pgsql/pgsql.c
diff -u php4/ext/pgsql/pgsql.c:1.222 php4/ext/pgsql/pgsql.c:1.223
--- php4/ext/pgsql/pgsql.c:1.222 Mon Sep 30 03:24:41 2002
+++ php4/ext/pgsql/pgsql.c Mon Sep 30 03:35:41 2002
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pgsql.c,v 1.222 2002/09/30 07:24:41 yohgaki Exp $ */
+/* $Id: pgsql.c,v 1.223 2002/09/30 07:35:41 yohgaki Exp $ */
#include <stdlib.h>
@@ -3269,7 +3269,12 @@
switch (Z_TYPE_PP(val)) {
case IS_STRING:
if (Z_STRLEN_PP(val) == 0) {
- ZVAL_STRING(new_val, empty_string, 1);
+ if (opt & PGSQL_CONV_FORCE_NULL) {
+ ZVAL_STRING(new_val, "NULL", 1);
+ }
+ else {
+ ZVAL_STRING(new_val, empty_string, 1);
+ }
}
else {
Z_TYPE_P(new_val) = IS_STRING;