diff options
| author | Yasuo Ohgaki <yohgaki@php.net> | 2002-09-30 07:35:41 +0000 |
|---|---|---|
| committer | Yasuo Ohgaki <yohgaki@php.net> | 2002-09-30 07:35:41 +0000 |
| commit | 5a6703484d22fb5dfa6cf4cdf85473215f0102f4 (patch) | |
| tree | 381b41d3f090c9900531057f3a7ce57f29d0bde7 /ext/pgsql/pgsql.c | |
| parent | 788e4070b64803601492b225be4670b5a6892cea (diff) | |
| download | php-git-5a6703484d22fb5dfa6cf4cdf85473215f0102f4.tar.gz | |
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.
Diffstat (limited to 'ext/pgsql/pgsql.c')
| -rw-r--r-- | ext/pgsql/pgsql.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 3cdb59a970..e2000a617b 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -3269,7 +3269,12 @@ PHPAPI int php_pgsql_convert(PGconn *pg_link, const char *table_name, const zval 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; |
