cvs: php4 /ext/pgsql pgsql.c
| From: | Yasuo Ohgaki | Date: | Mon, 30 Sep 2002 07:24:42 +0000 |
| Subject: | cvs: php4 /ext/pgsql pgsql.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-14352@lists.php.net to get a copy of this message | ||
yohgaki Mon Sep 30 03:24:42 2002 EDT
Modified files:
/php4/ext/pgsql pgsql.c
Log:
Use of PGSQL_CONV_INGORE_NOT_NULL as it is supposed. Change comment a little.
Index: php4/ext/pgsql/pgsql.c
diff -u php4/ext/pgsql/pgsql.c:1.221 php4/ext/pgsql/pgsql.c:1.222
--- php4/ext/pgsql/pgsql.c:1.221 Mon Sep 30 00:15:39 2002
+++ php4/ext/pgsql/pgsql.c Mon Sep 30 03:24:41 2002
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pgsql.c,v 1.221 2002/09/30 04:15:39 yohgaki Exp $ */
+/* $Id: pgsql.c,v 1.222 2002/09/30 07:24:41 yohgaki Exp $ */
#include <stdlib.h>
@@ -3040,14 +3040,14 @@
#define PGSQL_CONV_CHECK_IGNORE() \
if (!err && Z_TYPE_P(new_val) == IS_STRING && !strcmp(Z_STRVAL_P(new_val),
"NULL")) { \
- /* if value is NULL and has default, remove entry to use default value*/ \
+ /* if new_value is string "NULL" and field has default value, remove element to use
default value */ \
if (!(opt & PGSQL_CONV_IGNORE_DEFAULT) && Z_BVAL_PP(has_default)) { \
zval_dtor(new_val); \
FREE_ZVAL(new_val); \
skip_field = 1; \
} \
- /* raise error if it's not null */ \
- else if (Z_BVAL_PP(not_null)) { \
+ /* raise error if it's not null and cannot be ignored */ \
+ else if (!(opt & PGSQL_CONV_IGNORE_NOT_NULL) && Z_BVAL_PP(not_null)) { \
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected NULL for 'NOT NULL' field
'%s'", field ); \
err = 1; \
} \