cvs: php-src /ext/interbase ibase_query.c
| From: | Ilia Alshanetsky | Date: | Thu, 30 Nov 2006 16:21:36 +0000 |
| Subject: | cvs: php-src /ext/interbase ibase_query.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-41792@lists.php.net to get a copy of this message | ||
iliaa Thu Nov 30 16:21:36 2006 UTC
Modified files:
/php-src/ext/interbase ibase_query.c
Log:
MFB: Thread safety fixes.
http://cvs.php.net/viewvc.cgi/php-src/ext/interbase/ibase_query.c?r1=1.25&r2=1.26&diff_format=u
Index: php-src/ext/interbase/ibase_query.c
diff -u php-src/ext/interbase/ibase_query.c:1.25 php-src/ext/interbase/ibase_query.c:1.26
--- php-src/ext/interbase/ibase_query.c:1.25 Wed Mar 8 00:43:28 2006
+++ php-src/ext/interbase/ibase_query.c Thu Nov 30 16:21:36 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: ibase_query.c,v 1.25 2006/03/08 00:43:28 pajoye Exp $ */
+/* $Id: ibase_query.c,v 1.26 2006/11/30 16:21:36 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -669,14 +669,13 @@
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 @@
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 @@
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;