- Added date_timezone_set() function to set the timezone that the date
functions will use. (Derick)
- Implemented feature request #33452 (Year belonging to ISO week). (Derick)
+- Fixed memory corruption in pg_copy_from() in case the as_null parameter was
+ passed. (Derick)
- Fixed bug #33562 (date("") crashes). (Derick)
- Fixed bug #33536 (strtotime() defaults to now even on non time string).
(Derick)
zval **tmp;
char *table_name, *pg_delim = NULL, *pg_null_as = NULL;
int table_name_len, pg_delim_len, pg_null_as_len;
+ int pg_null_as_free = 0;
char *query;
char *query_template = "COPY \"\" FROM STDIN DELIMITERS ':' WITH NULL AS ''";
HashPosition pos;
}
if (!pg_null_as) {
pg_null_as = safe_estrdup("\\\\N");
+ pg_null_as_free = 1;
}
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink);
}
pgsql_result = PQexec(pgsql, query);
- efree(pg_null_as);
+ if (pg_null_as_free) {
+ efree(pg_null_as);
+ }
efree(query);
if (pgsql_result) {