Skip to content

Commit a5ed589

Browse files
[6.0]sync pdo code and fix error (#5366)
* sync pdo code and fix error * fix test
1 parent d62d292 commit a5ed589

18 files changed

+5965
-18
lines changed

ext-src/php_swoole_call_stack.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@
1414
+----------------------------------------------------------------------+
1515
*/
1616

17-
#pragma once
18-
1917
#include "php_swoole.h"
2018

2119
#ifdef ZEND_CHECK_STACK_LIMIT
2220
#define HOOK_PHP_CALL_STACK(callback) \
23-
auto __stack_limit = EG(stack_limit); \
24-
auto __stack_base = EG(stack_base); \
21+
void *__stack_limit = EG(stack_limit); \
22+
void *__stack_base = EG(stack_base); \
2523
EG(stack_base) = (void *) 0; \
2624
EG(stack_limit) = (void *) 0; \
2725
callback EG(stack_limit) = __stack_limit; \

tests/swoole_runtime/file_hook/bug_4327.phpt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ Swoole\Runtime::enableCoroutine($flags = SWOOLE_HOOK_ALL);
1717

1818
function createDirectories($protocol = "")
1919
{
20-
if (defined('SWOOLE_THREAD')) {
21-
echo "SUCCESS".PHP_EOL;
22-
return;
23-
}
24-
2520
$barrier = Barrier::make();
2621
$first = "$protocol/".rand(0, 1000);
2722
$second = "/".rand(0, 1000);
@@ -49,9 +44,14 @@ run(function () {
4944
createDirectories("file://");
5045
});
5146

52-
Swoole\Runtime::enableCoroutine(false);
53-
createDirectories();
54-
createDirectories("file://");
47+
if (defined('SWOOLE_THREAD')) {
48+
echo "SUCCESS".PHP_EOL;
49+
} else {
50+
Swoole\Runtime::enableCoroutine(false);
51+
createDirectories();
52+
createDirectories("file://");
53+
}
54+
5555
?>
5656
--EXPECT--
5757
SUCCESS

thirdparty/php81/pdo_oci/oci_driver.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
#define SW_USE_ORACLE_HOOK
1818
#include "php_swoole_oracle.h"
1919

20-
#if PHP_VERSION_ID >= 80100
20+
#if PHP_VERSION_ID >= 80100 && PHP_VERSION_ID < 80300
21+
2122
#include "php.h"
2223
#include "php_ini.h"
2324
#include "ext/standard/info.h"

thirdparty/php81/pdo_oci/oci_statement.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
#define SW_USE_ORACLE_HOOK
1717
#include "php_swoole_oracle.h"
1818

19-
#if PHP_VERSION_ID >= 80100
19+
#if PHP_VERSION_ID >= 80100 && PHP_VERSION_ID < 80300
20+
2021
#include "php.h"
2122
#include "php_ini.h"
2223
#include "ext/standard/info.h"

thirdparty/php81/pdo_odbc/odbc_driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#define SW_USE_ODBC_HOOK
1818
#include "php_swoole_odbc.h"
1919

20-
#if PHP_VERSION_ID >= 80100
20+
#if PHP_VERSION_ID >= 80100 && PHP_VERSION_ID < 80300
2121

2222
#include "php.h"
2323
#include "php_ini.h"

thirdparty/php81/pdo_odbc/odbc_stmt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#define SW_USE_ODBC_HOOK
1818
#include "php_swoole_odbc.h"
1919

20-
#if PHP_VERSION_ID >= 80100
20+
#if PHP_VERSION_ID >= 80100 && PHP_VERSION_ID < 80300
2121

2222
#include "php.h"
2323
#include "php_ini.h"

thirdparty/php81/pdo_pgsql/pgsql_driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#define SW_USE_PGSQL_HOOK
2020
#include "php_swoole_pgsql.h"
2121

22-
#if PHP_VERSION_ID >= 80100
22+
#if PHP_VERSION_ID >= 80100 && PHP_VERSION_ID < 80300
2323

2424
#include "php.h"
2525
#include "php_ini.h"

thirdparty/php81/pdo_pgsql/pgsql_statement.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#define SW_USE_PGSQL_HOOK
2020
#include "php_swoole_pgsql.h"
2121

22-
#if PHP_VERSION_ID >= 80100
22+
#if PHP_VERSION_ID >= 80100 && PHP_VERSION_ID < 80300
2323

2424
#include "php.h"
2525
#include "php_ini.h"

0 commit comments

Comments
 (0)