Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanFreeman committed Aug 29, 2024
1 parent 913d153 commit d95cbf1
Show file tree
Hide file tree
Showing 23 changed files with 1,184 additions and 221 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PROJECT(libswoole)

ENABLE_LANGUAGE(ASM)
set(SWOOLE_VERSION 5.1.4)
set(SWOOLE_VERSION 5.1.5-dev)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -g")
Expand Down
6 changes: 4 additions & 2 deletions config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,8 @@ EOF
thirdparty/php83/pdo_pgsql/pgsql_driver.c \
thirdparty/php83/pdo_pgsql/pgsql_statement.c \
thirdparty/php84/pdo_pgsql/pgsql_driver.c \
thirdparty/php84/pdo_pgsql/pgsql_statement.c"
thirdparty/php84/pdo_pgsql/pgsql_statement.c \
thirdparty/php84/pdo_pgsql/pgsql_sql_parser.c"
fi

if test "$PHP_SWOOLE_ORACLE" != "no"; then
Expand Down Expand Up @@ -1092,7 +1093,8 @@ EOF
thirdparty/php83/pdo_sqlite/sqlite_driver.c \
thirdparty/php83/pdo_sqlite/sqlite_statement.c \
thirdparty/php84/pdo_sqlite/sqlite_driver.c \
thirdparty/php84/pdo_sqlite/sqlite_statement.c"
thirdparty/php84/pdo_sqlite/sqlite_statement.c \
thirdparty/php84/pdo_sqlite/sqlite_sql_parser.c"
fi

SW_ASM_DIR="thirdparty/boost/asm/"
Expand Down
10 changes: 8 additions & 2 deletions ext-src/php_swoole_odbc.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,16 @@ BEGIN_EXTERN_C()

#include "ext/pdo/php_pdo_driver.h"

#if PHP_VERSION_ID > 80100
#if PHP_VERSION_ID >= 80000 && PHP_VERSION_ID < 80100
#include "thirdparty/php80/pdo_odbc/php_pdo_odbc_int.h"
#elif PHP_VERSION_ID >= 80100 && PHP_VERSION_ID < 80200
#include "thirdparty/php81/pdo_odbc/php_pdo_odbc_int.h"
#elif PHP_VERSION_ID >= 80200 && PHP_VERSION_ID < 80300
#include "thirdparty/php81/pdo_odbc/php_pdo_odbc_int.h"
#elif PHP_VERSION_ID >= 80300 && PHP_VERSION_ID < 80400
#include "thirdparty/php83/pdo_odbc/php_pdo_odbc_int.h"
#else
#include "thirdparty/php80/pdo_odbc/php_pdo_odbc_int.h"
#include "thirdparty/php84/pdo_odbc/php_pdo_odbc_int.h"
#endif

extern const pdo_driver_t swoole_pdo_odbc_driver;
Expand Down
11 changes: 9 additions & 2 deletions ext-src/php_swoole_oracle.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,17 @@
BEGIN_EXTERN_C()

#include "ext/pdo/php_pdo_driver.h"
#if PHP_VERSION_ID >= 80100

#if PHP_VERSION_ID >= 80000 && PHP_VERSION_ID < 80100
#include "thirdparty/php80/pdo_oci/php_pdo_oci_int.h"
#elif PHP_VERSION_ID >= 80100 && PHP_VERSION_ID < 80200
#include "thirdparty/php81/pdo_oci/php_pdo_oci_int.h"
#elif PHP_VERSION_ID >= 80200 && PHP_VERSION_ID < 80300
#include "thirdparty/php81/pdo_oci/php_pdo_oci_int.h"
#elif PHP_VERSION_ID >= 80300 && PHP_VERSION_ID < 80400
#include "thirdparty/php83/pdo_oci/php_pdo_oci_int.h"
#else
#include "thirdparty/php80/pdo_oci/php_pdo_oci_int.h"
#include "thirdparty/php84/pdo_oci/php_pdo_oci_int.h"
#endif

extern const pdo_driver_t swoole_pdo_oci_driver;
Expand Down
11 changes: 9 additions & 2 deletions ext-src/php_swoole_sqlite.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,17 @@
BEGIN_EXTERN_C()

#include "ext/pdo/php_pdo_driver.h"
#if PHP_VERSION_ID >= 80100

#if PHP_VERSION_ID >= 80000 && PHP_VERSION_ID < 80100
#include "thirdparty/php80/pdo_sqlite/php_pdo_sqlite_int.h"
#elif PHP_VERSION_ID >= 80100 && PHP_VERSION_ID < 80200
#include "thirdparty/php81/pdo_sqlite/php_pdo_sqlite_int.h"
#elif PHP_VERSION_ID >= 80200 && PHP_VERSION_ID < 80300
#include "thirdparty/php81/pdo_sqlite/php_pdo_sqlite_int.h"
#elif PHP_VERSION_ID >= 80300 && PHP_VERSION_ID < 80400
#include "thirdparty/php83/pdo_sqlite/php_pdo_sqlite_int.h"
#else
#include "thirdparty/php80/pdo_sqlite/php_pdo_sqlite_int.h"
#include "thirdparty/php84/pdo_sqlite/php_pdo_sqlite_int.h"
#endif

extern const pdo_driver_t swoole_pdo_sqlite_driver;
Expand Down
11 changes: 9 additions & 2 deletions ext-src/swoole_pgsql.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,17 @@
#include "swoole_coroutine_system.h"

#ifdef SW_USE_PGSQL
#if PHP_VERSION_ID > 80100

#if PHP_VERSION_ID >= 80000 && PHP_VERSION_ID < 80100
#include "thirdparty/php80/pdo_pgsql/php_pdo_pgsql_int.h"
#elif PHP_VERSION_ID >= 80100 && PHP_VERSION_ID < 80200
#include "thirdparty/php81/pdo_pgsql/php_pdo_pgsql_int.h"
#elif PHP_VERSION_ID >= 80200 && PHP_VERSION_ID < 80300
#include "thirdparty/php81/pdo_pgsql/php_pdo_pgsql_int.h"
#elif PHP_VERSION_ID >= 80300 && PHP_VERSION_ID < 80400
#include "thirdparty/php83/pdo_pgsql/php_pdo_pgsql_int.h"
#else
#include "thirdparty/php80/pdo_pgsql/php_pdo_pgsql_int.h"
#include "thirdparty/php84/pdo_pgsql/php_pdo_pgsql_int.h"
#endif

using swoole::Reactor;
Expand Down
6 changes: 3 additions & 3 deletions include/swoole_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@

#define SWOOLE_MAJOR_VERSION 5
#define SWOOLE_MINOR_VERSION 1
#define SWOOLE_RELEASE_VERSION 4
#define SWOOLE_RELEASE_VERSION 5
#define SWOOLE_EXTRA_VERSION ""
#define SWOOLE_VERSION "5.1.4"
#define SWOOLE_VERSION_ID 50104
#define SWOOLE_VERSION "5.1.5-dev"
#define SWOOLE_VERSION_ID 50105
#define SWOOLE_API_VERSION_ID 0x202208a

#define SWOOLE_BUG_REPORT \
Expand Down
106 changes: 52 additions & 54 deletions thirdparty/php80/pdo_oci/php_pdo_oci_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,91 +17,89 @@
#include <oci.h>

typedef struct {
const char *file;
int line;
sb4 errcode;
char *errmsg;
const char *file;
int line;
sb4 errcode;
char *errmsg;
} pdo_oci_error_info;

/* stuff we use in an OCI database handle */
typedef struct {
OCIServer *server;
OCISession *session;
OCIEnv *env;
OCIError *err;
OCISvcCtx *svc;
/* OCI9; 0 == use NLS_LANG */
ub4 prefetch;
ub2 charset;
sword last_err;
sb4 max_char_width;

unsigned attached:1;
unsigned _reserved:31;

pdo_oci_error_info einfo;
OCIServer *server;
OCISession *session;
OCIEnv *env;
OCIError *err;
OCISvcCtx *svc;
/* OCI9; 0 == use NLS_LANG */
ub4 prefetch;
ub2 charset;
sword last_err;
sb4 max_char_width;

unsigned attached : 1;
unsigned _reserved : 31;

pdo_oci_error_info einfo;
} pdo_oci_db_handle;

typedef struct {
OCIDefine *def;
ub2 fetched_len;
ub2 retcode;
sb2 indicator;
OCIDefine *def;
ub2 fetched_len;
ub2 retcode;
sb2 indicator;

char *data;
ub4 datalen;
char *data;
ub4 datalen;

ub2 dtype;
ub2 dtype;

} pdo_oci_column;

typedef struct {
pdo_oci_db_handle *H;
OCIStmt *stmt;
OCIError *err;
sword last_err;
ub2 stmt_type;
ub4 exec_type;
pdo_oci_column *cols;
pdo_oci_error_info einfo;
unsigned int have_blobs:1;
pdo_oci_db_handle *H;
OCIStmt *stmt;
OCIError *err;
sword last_err;
ub2 stmt_type;
ub4 exec_type;
pdo_oci_column *cols;
pdo_oci_error_info einfo;
unsigned int have_blobs : 1;
} pdo_oci_stmt;

typedef struct {
OCIBind *bind; /* allocated by OCI */
sb2 oci_type;
sb2 indicator;
ub2 retcode;
OCIBind *bind; /* allocated by OCI */
sb2 oci_type;
sb2 indicator;
ub2 retcode;

ub4 actual_len;
ub4 actual_len;

dvoid *thing; /* for LOBS, REFCURSORS etc. */
dvoid *thing; /* for LOBS, REFCURSORS etc. */

unsigned used_for_output;
unsigned used_for_output;
} pdo_oci_bound_param;

extern const struct pdo_stmt_methods swoole_oci_stmt_methods;
extern const ub4 SWOOLE_PDO_OCI_INIT_MODE;
extern OCIEnv *swoole_pdo_oci_Env;

ub4 _oci_error(OCIError *err, pdo_dbh_t *dbh, pdo_stmt_t *stmt, char *what, sword status, int isinit, const char *file, int line);
#define oci_init_error(w) _oci_error(H->err, dbh, NULL, w, H->last_err, TRUE, __FILE__, __LINE__)
#define oci_drv_error(w) _oci_error(H->err, dbh, NULL, w, H->last_err, FALSE, __FILE__, __LINE__)
#define oci_stmt_error(w) _oci_error(S->err, stmt->dbh, stmt, w, S->last_err, FALSE, __FILE__, __LINE__)

extern const struct pdo_stmt_methods oci_stmt_methods;
ub4 _oci_error(
OCIError *err, pdo_dbh_t *dbh, pdo_stmt_t *stmt, char *what, sword status, int isinit, const char *file, int line);
#define oci_init_error(w) _oci_error(H->err, dbh, NULL, w, H->last_err, TRUE, __FILE__, __LINE__)
#define oci_drv_error(w) _oci_error(H->err, dbh, NULL, w, H->last_err, FALSE, __FILE__, __LINE__)
#define oci_stmt_error(w) _oci_error(S->err, stmt->dbh, stmt, w, S->last_err, FALSE, __FILE__, __LINE__)

/* Default prefetch size in number of rows */
#define PDO_OCI_PREFETCH_DEFAULT 100

/* Arbitrary assumed row length for prefetch memory limit calcuation */
#define PDO_OCI_PREFETCH_ROWSIZE 1024


enum {
PDO_OCI_ATTR_ACTION = PDO_ATTR_DRIVER_SPECIFIC,
PDO_OCI_ATTR_CLIENT_INFO,
PDO_OCI_ATTR_CLIENT_IDENTIFIER,
PDO_OCI_ATTR_MODULE,
PDO_OCI_ATTR_CALL_TIMEOUT
PDO_OCI_ATTR_ACTION = PDO_ATTR_DRIVER_SPECIFIC,
PDO_OCI_ATTR_CLIENT_INFO,
PDO_OCI_ATTR_CLIENT_IDENTIFIER,
PDO_OCI_ATTR_MODULE,
PDO_OCI_ATTR_CALL_TIMEOUT
};
Loading

0 comments on commit d95cbf1

Please sign in to comment.