mirror of
https://github.com/php/php-src.git
synced 2025-08-18 06:58:55 +02:00
MFB: Thread safety fixes.
This commit is contained in:
parent
3fb8bece12
commit
204c32b760
1 changed files with 6 additions and 7 deletions
|
@ -669,14 +669,13 @@ static int _php_ibase_bind(XSQLDA *sqlda, zval ***b_vars, BIND_BUF *buf, /* {{{
|
|||
var->sqldata = (void*)&buf[i].val;
|
||||
|
||||
switch (var->sqltype & ~1) {
|
||||
struct tm t;
|
||||
struct tm *t, tmbuf;
|
||||
|
||||
case SQL_TIMESTAMP:
|
||||
case SQL_TYPE_DATE:
|
||||
case SQL_TYPE_TIME:
|
||||
if (Z_TYPE_P(b_var) == IS_LONG) {
|
||||
/* insert timestamp directly */
|
||||
t = *gmtime(&Z_LVAL_P(b_var));
|
||||
t = php_gmtime_r(&Z_LVAL_P(b_var), &tmbuf);
|
||||
} else {
|
||||
#ifdef HAVE_STRPTIME
|
||||
char *format = INI_STR("ibase.timestampformat");
|
||||
|
@ -690,7 +689,7 @@ static int _php_ibase_bind(XSQLDA *sqlda, zval ***b_vars, BIND_BUF *buf, /* {{{
|
|||
case SQL_TYPE_TIME:
|
||||
format = INI_STR("ibase.timeformat");
|
||||
}
|
||||
if (! strptime(Z_STRVAL_P(b_var), format, &t)) {
|
||||
if (!strptime(Z_STRVAL_P(b_var), format, t)) {
|
||||
/* strptime() cannot handle it, so let IB have a try */
|
||||
break;
|
||||
}
|
||||
|
@ -701,13 +700,13 @@ static int _php_ibase_bind(XSQLDA *sqlda, zval ***b_vars, BIND_BUF *buf, /* {{{
|
|||
|
||||
switch (var->sqltype & ~1) {
|
||||
default: /* == case SQL_TIMESTAMP */
|
||||
isc_encode_timestamp(&t, &buf[i].val.tsval);
|
||||
isc_encode_timestamp(t, &buf[i].val.tsval);
|
||||
break;
|
||||
case SQL_TYPE_DATE:
|
||||
isc_encode_sql_date(&t, &buf[i].val.dtval);
|
||||
isc_encode_sql_date(t, &buf[i].val.dtval);
|
||||
break;
|
||||
case SQL_TYPE_TIME:
|
||||
isc_encode_sql_time(&t, &buf[i].val.tmval);
|
||||
isc_encode_sql_time(t, &buf[i].val.tmval);
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue