php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
mysqli_priv.h
Go to the documentation of this file.
1/*
2 +----------------------------------------------------------------------+
3 | Copyright (c) The PHP Group |
4 +----------------------------------------------------------------------+
5 | This source file is subject to version 3.01 of the PHP license, |
6 | that is bundled with this package in the file LICENSE, and is |
7 | available through the world-wide-web at the following url: |
8 | https://www.php.net/license/3_01.txt |
9 | If you did not receive a copy of the PHP license and are unable to |
10 | obtain it through the world-wide-web, please send a note to |
11 | license@php.net so we can mail you a copy immediately. |
12 +----------------------------------------------------------------------+
13 | Author: Georg Richter <georg@php.net> |
14 +----------------------------------------------------------------------+
15*/
16
17#ifndef MYSQLI_PRIV_H
18#define MYSQLI_PRIV_H
19
20#ifdef PHP_MYSQL_UNIX_SOCK_ADDR
21#ifdef MYSQL_UNIX_ADDR
22#undef MYSQL_UNIX_ADDR
23#endif
24#define MYSQL_UNIX_ADDR PHP_MYSQL_UNIX_SOCK_ADDR
25#endif
26
34
40
46
47extern int php_le_pmysqli(void);
48extern void php_mysqli_dtor_p_elements(void *data);
49
50extern void php_mysqli_close(MY_MYSQL * mysql, int close_type, int resource_status);
51
52extern void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flag, int into_object);
53extern void php_clear_stmt_bind(MY_STMT *stmt);
54extern void php_clear_mysql(MY_MYSQL *);
56
59extern void php_mysqli_report_error(const char *sqlstate, int errorno, const char *error);
60extern void php_mysqli_report_index(const char *query, unsigned int status);
61extern void php_mysqli_throw_sql_exception(char *sqlstate, int errorno, char *format, ...);
62
63#define PHP_MYSQLI_EXPORT(__type) PHP_MYSQLI_API __type
64
65PHP_MYSQLI_EXPORT(zend_object *) mysqli_objects_new(zend_class_entry *);
66
67#define MYSQLI_DISABLE_MQ if (mysql->multi_query) { \
68 mysql_set_server_option(mysql->mysql, MYSQL_OPTION_MULTI_STATEMENTS_OFF); \
69 mysql->multi_query = 0; \
70}
71
72#define MYSQLI_ENABLE_MQ if (!mysql->multi_query) { \
73 mysql_set_server_option(mysql->mysql, MYSQL_OPTION_MULTI_STATEMENTS_ON); \
74 mysql->multi_query = 1; \
75}
76
77/* Numbers that cannot be represented as a signed int are converted to a string instead (affects 32-bit builds). */
78#define MYSQLI_RETURN_LONG_INT(__val) \
79{ \
80 if ((__val) < ZEND_LONG_MAX) { \
81 RETURN_LONG((zend_long) (__val)); \
82 } else { \
83 /* always used with my_ulonglong -> %llu */ \
84 RETURN_STR(strpprintf(0, MYSQLI_LLU_SPEC, (__val))); \
85 } \
86}
87
88#define MYSQLI_STORE_RESULT 0
89#define MYSQLI_USE_RESULT 1
90#define MYSQLI_ASYNC 8
91#define MYSQLI_STORE_RESULT_COPY_DATA 16
92
93/* for mysqli_fetch_assoc */
94#define MYSQLI_ASSOC 1
95#define MYSQLI_NUM 2
96#define MYSQLI_BOTH 3
97
98/* fetch types */
99#define FETCH_SIMPLE 1
100#define FETCH_RESULT 2
101
102/*** REPORT MODES ***/
103#define MYSQLI_REPORT_OFF 0
104#define MYSQLI_REPORT_ERROR 1
105#define MYSQLI_REPORT_STRICT 2
106#define MYSQLI_REPORT_INDEX 4
107#define MYSQLI_REPORT_CLOSE 8
108#define MYSQLI_REPORT_ALL 255
109
110#define MYSQLI_REPORT_MYSQL_ERROR(mysql) \
111if ((MyG(report_mode) & MYSQLI_REPORT_ERROR) && mysql_errno(mysql)) { \
112 php_mysqli_report_error(mysql_sqlstate(mysql), mysql_errno(mysql), mysql_error(mysql)); \
113}
114
115#define MYSQLI_REPORT_STMT_ERROR(stmt) \
116if ((MyG(report_mode) & MYSQLI_REPORT_ERROR) && mysql_stmt_errno(stmt)) { \
117 php_mysqli_report_error(mysql_stmt_sqlstate(stmt), mysql_stmt_errno(stmt), mysql_stmt_error(stmt)); \
118}
119
120void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, bool is_real_connect, bool in_ctor);
121
123
124#endif /* MYSQLI_PRIV_H */
DNS_STATUS status
Definition dns_win32.c:49
error($message)
Definition ext_skel.php:22
zend_ffi_type * type
Definition ffi.c:3812
const mysqli_property_entry mysqli_driver_property_entries[]
const mysqli_property_entry mysqli_stmt_property_entries[]
void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, bool is_real_connect, bool in_ctor)
const zend_function_entry mysqli_result_methods[]
const zend_function_entry mysqli_driver_methods[]
void php_free_stmt_bind_buffer(BIND_BUFFER bbuf, int type)
void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flag, int into_object)
Definition mysqli.c:746
#define PHP_MYSQLI_EXPORT(__type)
Definition mysqli_priv.h:63
const zend_function_entry mysqli_functions[]
const zend_function_entry mysqli_stmt_methods[]
void php_clear_warnings(MYSQLI_WARNING *w)
void php_clear_mysql(MY_MYSQL *)
Definition mysqli.c:135
void php_mysqli_report_error(const char *sqlstate, int errorno, const char *error)
void php_mysqli_init(INTERNAL_FUNCTION_PARAMETERS, bool is_method)
Definition mysqli_api.c:967
const zend_property_info mysqli_link_property_info_entries[]
void php_clear_stmt_bind(MY_STMT *stmt)
Definition mysqli.c:114
MYSQLI_WARNING * php_get_warnings(MYSQLND_CONN_DATA *mysql)
const mysqli_property_entry mysqli_result_property_entries[]
const mysqli_property_entry mysqli_warning_property_entries[]
const zend_function_entry mysqli_link_methods[]
const zend_function_entry mysqli_exception_methods[]
void php_mysqli_dtor_p_elements(void *data)
Definition mysqli.c:90
const zend_property_info mysqli_result_property_info_entries[]
const zend_property_info mysqli_warning_property_info_entries[]
void php_mysqli_report_index(const char *query, unsigned int status)
const zend_property_info mysqli_stmt_property_info_entries[]
const zend_property_info mysqli_driver_property_info_entries[]
void php_mysqli_close(MY_MYSQL *mysql, int close_type, int resource_status)
Definition mysqli_api.c:234
const zend_function_entry mysqli_warning_methods[]
const mysqli_property_entry mysqli_link_property_entries[]
void php_mysqli_throw_sql_exception(char *sqlstate, int errorno, char *format,...)
int php_le_pmysqli(void)
Definition mysqli.c:108
struct st_mysqlnd_connection_data MYSQLND_CONN_DATA
struct st_mysqli_warning MYSQLI_WARNING
struct _mysqli_property_entry mysqli_property_entry
char sqlstate[6]
zend_constant * data
#define INTERNAL_FUNCTION_PARAMETERS
Definition zend.h:49
struct _zend_function_entry zend_function_entry
struct _zend_property_info zend_property_info
struct _zend_class_entry zend_class_entry
struct _zend_object zend_object