|
54 | 54 | #include <winsock.h>
|
55 | 55 | #endif
|
56 | 56 |
|
| 57 | +#ifdef ZTS |
| 58 | +#define IFX_THRD_ID tsrm_thread_id() |
| 59 | +#else |
| 60 | +#define IFX_THRD_ID 0 |
| 61 | +#endif |
| 62 | + |
57 | 63 | #if HAVE_SYS_TYPES_H
|
58 | 64 | #include <sys/types.h>
|
59 | 65 | #endif
|
@@ -542,7 +548,7 @@ EXEC SQL END DECLARE SECTION;
|
542 | 548 | /* create the link */
|
543 | 549 | ifx = (char *) malloc(sizeof(IFX));
|
544 | 550 | IFXG(connectionid)++;
|
545 |
| - sprintf(ifx, "%s%x", SAFE_STRING(user), IFXG(connectionid)); |
| 551 | + sprintf(ifx, "%s%x_%x", SAFE_STRING(user), IFX_THRD_ID,IFXG(connectionid)); |
546 | 552 |
|
547 | 553 | EXEC SQL CONNECT TO :host AS :ifx USER :user USING :passwd WITH CONCURRENT TRANSACTION;
|
548 | 554 |
|
@@ -645,7 +651,7 @@ EXEC SQL END DECLARE SECTION;
|
645 | 651 |
|
646 | 652 | ifx = (char *) emalloc(sizeof(IFX));
|
647 | 653 | IFXG(connectionid)++;
|
648 |
| - sprintf(ifx, "connec%x", IFXG(connectionid)); |
| 654 | + sprintf(ifx, "connec%x_%x", IFX_THRD_ID, IFXG(connectionid)); |
649 | 655 |
|
650 | 656 | EXEC SQL CONNECT TO :host AS :ifx USER :user USING :passwd WITH CONCURRENT TRANSACTION;
|
651 | 657 |
|
@@ -818,10 +824,10 @@ EXEC SQL END DECLARE SECTION;
|
818 | 824 | statement = Z_STRVAL_PP(query);
|
819 | 825 |
|
820 | 826 | IFXG(cursorid)++;
|
821 |
| - sprintf(statemid, "statem%x", IFXG(cursorid)); |
822 |
| - sprintf(cursorid, "cursor%x", IFXG(cursorid)); |
823 |
| - sprintf(descrpid, "descrp%x", IFXG(cursorid)); |
824 |
| - sprintf(i_descrpid, "i_descrp%x", IFXG(cursorid)); |
| 827 | + sprintf(statemid, "statem%x_%x", IFX_THRD_ID, IFXG(cursorid)); |
| 828 | + sprintf(cursorid, "cursor%x_%x", IFX_THRD_ID, IFXG(cursorid)); |
| 829 | + sprintf(descrpid, "descrp%x_%x", IFX_THRD_ID, IFXG(cursorid)); |
| 830 | + sprintf(i_descrpid, "i_descrp%x_%x", IFX_THRD_ID,IFXG(cursorid)); |
825 | 831 |
|
826 | 832 | EXEC SQL set connection :ifx;
|
827 | 833 | PHP_IFX_CHECK_CONNECTION(ifx);
|
@@ -1242,10 +1248,10 @@ EXEC SQL END DECLARE SECTION;
|
1242 | 1248 | statement = Z_STRVAL_PP(query);
|
1243 | 1249 |
|
1244 | 1250 | IFXG(cursorid)++;
|
1245 |
| - sprintf(statemid, "statem%x", IFXG(cursorid)); |
1246 |
| - sprintf(cursorid, "cursor%x", IFXG(cursorid)); |
1247 |
| - sprintf(descrpid, "descrp%x", IFXG(cursorid)); |
1248 |
| - sprintf(i_descrpid, "i_descrp%x", IFXG(cursorid)); |
| 1251 | + sprintf(statemid, "statem%x_%x", IFX_THRD_ID, IFXG(cursorid)); |
| 1252 | + sprintf(cursorid, "cursor%x_%x", IFX_THRD_ID, IFXG(cursorid)); |
| 1253 | + sprintf(descrpid, "descrp%x_%x", IFX_THRD_ID, IFXG(cursorid)); |
| 1254 | + sprintf(i_descrpid, "i_descrp%x_%x", IFX_THRD_ID,IFXG(cursorid)); |
1249 | 1255 |
|
1250 | 1256 | EXEC SQL set connection :ifx;
|
1251 | 1257 | PHP_IFX_CHECK_CONNECTION(ifx);
|
|
0 commit comments