summaryrefslogtreecommitdiff
path: root/ext/pgsql/pgsql.c
diff options
context:
space:
mode:
authorYasuo Ohgaki <yohgaki@php.net>2002-09-30 07:24:41 +0000
committerYasuo Ohgaki <yohgaki@php.net>2002-09-30 07:24:41 +0000
commit788e4070b64803601492b225be4670b5a6892cea (patch)
treefb28de233dcbbc9514937727c485f3a18ca1ad54 /ext/pgsql/pgsql.c
parent6a952f0856d6688139d944df034c3f0c586c23dc (diff)
downloadphp-git-788e4070b64803601492b225be4670b5a6892cea.tar.gz
Use of PGSQL_CONV_INGORE_NOT_NULL as it is supposed. Change comment a little.
Diffstat (limited to 'ext/pgsql/pgsql.c')
-rw-r--r--ext/pgsql/pgsql.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index c688ca9dfd..3cdb59a970 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -3040,14 +3040,14 @@ static int php_pgsql_add_quotes(zval *src, zend_bool should_free TSRMLS_DC)
#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; \
} \