php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
php_pdo_driver.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: Wez Furlong <wez@php.net> |
14 +----------------------------------------------------------------------+
15*/
16
17#ifndef PHP_PDO_DRIVER_H
18#define PHP_PDO_DRIVER_H
19
20#include "php_pdo.h"
21
22/* forward declarations */
23typedef struct _pdo_dbh_t pdo_dbh_t;
25typedef struct _pdo_stmt_t pdo_stmt_t;
26typedef struct _pdo_row_t pdo_row_t;
29
30#ifndef TRUE
31# define TRUE 1
32#endif
33#ifndef FALSE
34# define FALSE 0
35#endif
36
37#define PDO_DRIVER_API 20240423
38
39/* Doctrine hardcodes these constants, avoid changing their values. */
46
47 /* get_col: Not supported (yet?) */
48 PDO_PARAM_STMT = 4, /* hierarchical result set */
49
50 /* magic flag to denote a parameter as being input/output */
52
53 /* magic flag to denote a string that uses the national character set
54 see section 4.2.1 of SQL-92: http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt
55 */
56 PDO_PARAM_STR_NATL = 0x40000000,
57
58 /* magic flag to denote a string that uses the regular character set */
59 PDO_PARAM_STR_CHAR = 0x20000000,
60};
61
62#define PDO_PARAM_FLAGS 0xFFFF0000
63
64#define PDO_PARAM_TYPE(x) ((x) & ~PDO_PARAM_FLAGS)
65
73 PDO_FETCH_BOUND, /* return true/false only; rely on bound columns */
74 PDO_FETCH_COLUMN, /* fetch a numbered column only */
75 PDO_FETCH_CLASS, /* create an instance of named class, call ctor and set properties */
76 PDO_FETCH_INTO, /* fetch row into an existing object */
77 PDO_FETCH_FUNC, /* fetch into function and return its result */
78 PDO_FETCH_NAMED, /* like PDO_FETCH_ASSOC, but can handle duplicate names */
79 PDO_FETCH_KEY_PAIR, /* fetch into an array where the 1st column is a key and all subsequent columns are values */
80 PDO_FETCH__MAX /* must be last */
81};
82
83#define PDO_FETCH_FLAGS 0xFFFF0000 /* fetchAll() modes or'd to PDO_FETCH_XYZ */
84#define PDO_FETCH_GROUP 0x00010000 /* fetch into groups */
85#define PDO_FETCH_UNIQUE 0x00030000 /* fetch into groups assuming first col is unique */
86#define PDO_FETCH_CLASSTYPE 0x00040000 /* fetch class gets its class name from 1st column */
87#define PDO_FETCH_SERIALIZE 0x00080000 /* fetch class instances by calling serialize */
88#define PDO_FETCH_PROPS_LATE 0x00100000 /* fetch props after calling ctor */
89
90/* fetch orientation for scrollable cursors */
92 PDO_FETCH_ORI_NEXT, /* default: fetch the next available row */
93 PDO_FETCH_ORI_PRIOR, /* scroll back to prior row and fetch that */
94 PDO_FETCH_ORI_FIRST, /* scroll to the first row and fetch that */
95 PDO_FETCH_ORI_LAST, /* scroll to the last row and fetch that */
96 PDO_FETCH_ORI_ABS, /* scroll to an absolute numbered row and fetch that */
97 PDO_FETCH_ORI_REL /* scroll relative to the current row, and fetch that */
98};
99
101 PDO_ATTR_AUTOCOMMIT, /* use to turn on or off auto-commit mode */
102 PDO_ATTR_PREFETCH, /* configure the prefetch size for drivers that support it. Size is in KB */
103 PDO_ATTR_TIMEOUT, /* connection timeout in seconds */
104 PDO_ATTR_ERRMODE, /* control how errors are handled */
105 PDO_ATTR_SERVER_VERSION, /* database server version */
106 PDO_ATTR_CLIENT_VERSION, /* client library version */
107 PDO_ATTR_SERVER_INFO, /* server information */
108 PDO_ATTR_CONNECTION_STATUS, /* connection status */
109 PDO_ATTR_CASE, /* control case folding for portability */
110 PDO_ATTR_CURSOR_NAME, /* name a cursor for use in "WHERE CURRENT OF <name>" */
111 PDO_ATTR_CURSOR, /* cursor type */
112 PDO_ATTR_ORACLE_NULLS, /* convert empty strings to NULL */
113 PDO_ATTR_PERSISTENT, /* pconnect style connection */
114 PDO_ATTR_STATEMENT_CLASS, /* array(classname, array(ctor_args)) to specify the class of the constructed statement */
115 PDO_ATTR_FETCH_TABLE_NAMES, /* include table names in the column names, where available */
116 PDO_ATTR_FETCH_CATALOG_NAMES, /* include the catalog/db name names in the column names, where available */
117 PDO_ATTR_DRIVER_NAME, /* name of the driver (as used in the constructor) */
118 PDO_ATTR_STRINGIFY_FETCHES, /* converts integer/float types to strings during fetch */
119 PDO_ATTR_MAX_COLUMN_LEN, /* make database calculate maximum length of data found in a column */
120 PDO_ATTR_DEFAULT_FETCH_MODE, /* Set the default fetch mode */
121 PDO_ATTR_EMULATE_PREPARES, /* use query emulation rather than native */
122 PDO_ATTR_DEFAULT_STR_PARAM, /* set the default string parameter type (see the PDO::PARAM_STR_* magic flags) */
123
124 /* this defines the start of the range for driver specific options.
125 * Drivers should define their own attribute constants beginning with this
126 * value. */
128};
129
131 PDO_CURSOR_FWDONLY, /* forward only cursor (default) */
132 PDO_CURSOR_SCROLL /* scrollable cursor */
133};
134
135/* SQL-92 SQLSTATE error codes.
136
137The character string value returned for an SQLSTATE consists of a two-character
138class value followed by a three-character subclass value. A class value of 01
139indicates a warning and is accompanied by a return code of
140SQL_SUCCESS_WITH_INFO.
141
142Class values other than '01', except for the class 'IM',
143indicate an error and are accompanied by a return code of SQL_ERROR. The class
144'IM' is specific to warnings and errors that derive from the implementation of
145ODBC itself.
146
147The subclass value '000' in any class indicates that there is no
148subclass for that SQLSTATE. The assignment of class and subclass values is
149defined by SQL-92.
150*/
151
152typedef char pdo_error_type[6]; /* SQLSTATE */
153
154
155#define PDO_ERR_NONE "00000"
156
158 PDO_ERRMODE_SILENT, /* just set error codes */
159 PDO_ERRMODE_WARNING, /* raise E_WARNING */
160 PDO_ERRMODE_EXCEPTION /* throw exceptions */
161};
162
168
169/* oracle interop settings */
175
176/* {{{ utils for reading attributes set as driver_options */
177static inline zend_long pdo_attr_lval(zval *options, unsigned option_name, zend_long defval)
178{
179 zval *v;
180
181 if (options && (v = zend_hash_index_find(Z_ARRVAL_P(options), option_name))) {
182 return zval_get_long(v);
183 }
184 return defval;
185}
186static inline zend_string *pdo_attr_strval(zval *options, unsigned option_name, zend_string *defval)
187{
188 zval *v;
189
190 if (options && (v = zend_hash_index_find(Z_ARRVAL_P(options), option_name))) {
191 return zval_try_get_string(v);
192 }
193 return defval ? zend_string_copy(defval) : NULL;
194}
195/* }}} */
196
197/* This structure is registered with PDO when a PDO driver extension is
198 * initialized */
199typedef struct {
200 const char *driver_name;
202 zend_ulong api_version; /* needs to be compatible with PDO */
203
204#define PDO_DRIVER_HEADER(name) \
205 #name, sizeof(#name)-1, \
206 PDO_DRIVER_API
207
208 /* create driver specific portion of the database handle and stash it into
209 * the dbh. dbh contains the data source string and flags for this
210 * instance. You MUST respect dbh->is_persistent and pass that flag to
211 * pemalloc() for all allocations that are stored in the dbh or your instance
212 * data in the db, otherwise you will crash PHP when persistent connections
213 * are used.
214 */
215 int (*db_handle_factory)(pdo_dbh_t *dbh, zval *driver_options);
216
218
219/* {{{ methods for a database handle */
220
221/* close or otherwise disconnect the database */
223
224/* prepare a statement and stash driver specific portion into stmt
225 * return true on success, false otherwise */
226typedef bool (*pdo_dbh_prepare_func)(pdo_dbh_t *dbh, zend_string *sql, pdo_stmt_t *stmt, zval *driver_options);
227
228/* execute a statement (that does not return a result set)
229 * Return -1 on failure, otherwise the number of affected rows */
230typedef zend_long (*pdo_dbh_do_func)(pdo_dbh_t *dbh, const zend_string *sql);
231
232/* quote a string */
233typedef zend_string* (*pdo_dbh_quote_func)(pdo_dbh_t *dbh, const zend_string *unquoted, enum pdo_param_type paramtype);
234
235/* transaction related (beingTransaction(), commit, rollBack, inTransaction)
236 * Return true if currently inside a transaction, false otherwise. */
237typedef bool (*pdo_dbh_txn_func)(pdo_dbh_t *dbh);
238
239/* setting of attributes
240 * Return true on success and false in case of failure */
242
243/* return last insert id. NULL indicates error condition.
244 * name MIGHT be NULL */
245typedef zend_string *(*pdo_dbh_last_id_func)(pdo_dbh_t *dbh, const zend_string *name);
246
247/* Fetch error information.
248 * If stmt is not null, fetch information pertaining to the statement,
249 * otherwise fetch global error information.
250 * info is an initialized PHP array, if there are no messages leave it empty.
251 * The driver should add the following information to the array "info" in this order:
252 * - native error code
253 * - string representation of the error code ... any other optional driver
254 * specific data ...
255 * PDO takes care of normalizing the array. */
257
258/* fetching of attributes
259 * There are 3 return states:
260 * * -1 for errors while retrieving a valid attribute
261 * * 0 for attempting to retrieve an attribute which is not supported by the driver
262 * * any other value for success, *val must be set to the attribute value */
264
265/* checking/pinging persistent connections; return SUCCESS if the connection
266 * is still alive and ready to be used, FAILURE otherwise.
267 * You may set this handler to NULL, which is equivalent to returning SUCCESS. */
269
270/* called at request end for each persistent dbh; this gives the driver
271 * the opportunity to safely release resources that only have per-request
272 * scope */
274
275/* Called when the PDO handle is scanned for GC. Should populate the get_gc buffer
276 * with any zvals in the driver_data that would be freed if the handle is destroyed. */
278
279/* driver specific re2s sql parser, overrides the default one if present */
281
282/* for adding methods to the dbh or stmt objects
283pointer to a list of driver specific functions. The convention is
284to prefix the function names using the PDO driver name; this will
285reduce the chance of collisions with future functionality in the
286PDO class or in user code (they can extend the PDO object).
287*/
288enum {
292};
293
294typedef const zend_function_entry *(*pdo_dbh_get_driver_methods_func)(pdo_dbh_t *dbh, int kind);
295
316
317/* }}} */
318
319/* {{{ methods for a statement handle */
320
321/* free the statement handle */
322typedef int (*pdo_stmt_dtor_func)(pdo_stmt_t *stmt);
323
324/* start the query */
325typedef int (*pdo_stmt_execute_func)(pdo_stmt_t *stmt);
326
327/* causes the next row in the set to be fetched; indicates if there are no
328 * more rows. The ori and offset params modify which row should be returned,
329 * if the stmt represents a scrollable cursor */
330typedef int (*pdo_stmt_fetch_func)(pdo_stmt_t *stmt,
332
333/* queries information about the type of a column, by index (0 based).
334 * Driver should populate stmt->columns[colno] with appropriate info */
335typedef int (*pdo_stmt_describe_col_func)(pdo_stmt_t *stmt, int colno);
336
337/* Retrieves zval value of a column. If type is non-NULL, then this specifies the type which
338 * the user requested through bindColumn(). The driver does not need to check this argument,
339 * as PDO will perform any necessary conversions itself. However, it might be used to fetch
340 * a value more efficiently into the final type, or make the behavior dependent on the requested
341 * type. */
343 pdo_stmt_t *stmt, int colno, zval *result, enum pdo_param_type *type);
344
345/* hook for bound params */
355
356typedef int (*pdo_stmt_param_hook_func)(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, enum pdo_param_event event_type);
357
358/* setting of attributes */
360
361/* fetching of attributes */
363
364/* retrieves meta data for a numbered column.
365 * Returns SUCCESS/FAILURE.
366 * On SUCCESS, fill in return_value with an array with the following fields.
367 * If a particular field is not supported, then the driver simply does not add it to
368 * the array, so that scripts can use isset() to check for it.
369 *
370 * ### this is just a rough first cut, and subject to change ###
371 *
372 * these are added by PDO itself, based on data from the describe handler:
373 * name => the column name
374 * len => the length/size of the column
375 * precision => precision of the column
376 *
377 * pdo_type => an integer, one of the PDO_PARAM_XXX values
378 * scale => the floating point scale
379 * table => the table for that column
380 * type => a string representation of the type, mapped to the PHP equivalent type name
381 * native_type => a string representation of the type, native style, if different from
382 * the mapped name.
383 * flags => an array of flags including zero or more of the following:
384 * primary_key, not_null, unique_key, multiple_key, unsigned, auto_increment, blob
385 *
386 * Any driver specific data should be returned using a prefixed key or value.
387 * Eg: custom data for the mysql driver would use either
388 * 'mysql:foobar' => 'some data' // to add a new key to the array
389 * or
390 * 'flags' => array('not_null', 'mysql:some_flag'); // to add data to an existing key
391 */
393
394/* advances the statement to the next rowset of the batch.
395 * If it returns 1, PDO will tear down its idea of columns
396 * and meta data. If it returns 0, PDO will indicate an error
397 * to the caller. */
399
400/* closes the active cursor on a statement, leaving the prepared
401 * statement ready for re-execution. Useful to explicitly state
402 * that you are done with a given rowset, without having to explicitly
403 * fetch all the rows. */
405
419
420/* }}} */
421
427
429 /* driver specific methods */
431 /* driver specific data */
433
434 /* credentials */
436
437 /* if true, then data stored and pointed at by this handle must all be
438 * persistently allocated */
439 unsigned is_persistent:1;
440
441 /* if true, driver should act as though a COMMIT were executed between
442 * each executed statement; otherwise, COMMIT must be carried out manually
443 * */
444 unsigned auto_commit:1;
445
446 /* if true, the handle has been closed and will not function anymore */
447 unsigned is_closed:1;
448
449 /* if true, the driver requires that memory be allocated explicitly for
450 * the columns that are returned */
452
453 /* if true, commit or rollBack is allowed to be called */
454 bool in_txn:1;
455
456 /* max length a single character can become after correct quoting */
458
459 /* oracle compat; see enum pdo_null_handling */
460 unsigned oracle_nulls:2;
461
462 /* when set, convert int/floats to strings */
463 unsigned stringify:1;
464
465 /* bitmap for pdo_param_event(s) to skip in dispatch_param_event */
466 unsigned skip_param_evt:7;
467
468 /* the sum of the number of bits here and the bit fields preceding should
469 * equal 32 */
470 unsigned _reserved_flags:14;
471
472 /* data source string used to open this handle */
473 const char *data_source;
475
476 /* the global error code. */
478
480
482
483 /* persistent hash key associated with this handle */
484 const char *persistent_id;
486 unsigned int refcount;
487
488 /* driver specific "class" methods for the dbh and stmt */
490
492
494
496
497 /* when calling PDO::query(), we need to keep the error
498 * context from the statement around until we next clear it.
499 * This will allow us to report the correct error message
500 * when PDO::query() fails */
503
504 /* defaults for fetches */
506};
507
508/* represents a connection to a database */
511 /* these items must appear in this order at the beginning of the
512 struct so that this can be cast as a zend_object. we need this
513 to allow the extending class to escape all the custom handlers
514 that PDO declares.
515 */
517};
518
519static inline pdo_dbh_t *php_pdo_dbh_fetch_inner(zend_object *obj) {
520 return (pdo_dbh_t *)(((pdo_dbh_object_t *)((char*)(obj) - XtOffsetOf(pdo_dbh_object_t, std)))->inner);
521}
522
523static inline pdo_dbh_object_t *php_pdo_dbh_fetch_object(zend_object *obj) {
524 return (pdo_dbh_object_t *)((char*)(obj) - XtOffsetOf(pdo_dbh_object_t, std));
525}
526
527#define Z_PDO_DBH_P(zv) php_pdo_dbh_fetch_inner(Z_OBJ_P((zv)))
528#define Z_PDO_OBJECT_P(zv) php_pdo_dbh_fetch_object(Z_OBJ_P((zv)))
529
530/* describes a column */
536
537/* describes a bound parameter */
539 zval parameter; /* the variable itself */
540
541 zval driver_params; /* optional parameter(s) for the driver */
542
543 zend_long paramno; /* if -1, then it has a name, and we don't know the index *yet* */
545
546 zend_long max_value_len; /* as a hint for pre-allocation */
547
549
550 pdo_stmt_t *stmt; /* for convenience in dtor */
551
552 enum pdo_param_type param_type; /* desired or suggested variable type */
553
554 int is_param; /* parameter or column ? */
555};
556
557/* represents a prepared statement */
559 /* driver specifics */
562
563 /* if true, we've already successfully executed this statement at least
564 * once */
565 unsigned executed:1;
566 /* if true, the statement supports placeholders and can implement
567 * bindParam() for its prepared statements, if false, PDO should
568 * emulate prepare and bind on its behalf */
570
571 unsigned _reserved:29;
572
573 /* the number of columns in the result set; not valid until after
574 * the statement has been executed at least once. In some cases, might
575 * not be valid until fetch (at the driver level) has been called at least once.
576 * */
579
580 /* we want to keep the dbh alive while we live, so we own a reference */
583
584 /* keep track of bound input parameters. Some drivers support
585 * input/output parameters, but you can't rely on that working */
587 /* When rewriting from named to positional, this maps positions to names */
589 /* keep track of PHP variables bound to named (or positional) columns
590 * in the result set */
592
593 /* not always meaningful */
595
596 /* used to hold the statement's current query */
598
599 /* the copy of the query with expanded binds ONLY for emulated-prepare drivers */
601
602 /* the cursor specific error code. */
604
605 /* for lazy fetches, we always return the same lazy object handle.
606 * Let's keep it here. */
609
610 /* defaults for fetches */
612 union {
614 struct {
615 zval ctor_args; /* freed */
620 } cls;
621 struct {
622 zval fetch_args; /* freed */
627 zval *values; /* freed */
631
632 /* used by the query parser for driver specific
633 * parameter naming (see pgsql driver for example) */
635
636 /* these items must appear in this order at the beginning of the
637 struct so that this can be cast as a zend_object. we need this
638 to allow the extending class to escape all the custom handlers
639 that PDO declares.
640 */
642};
643
644static inline pdo_stmt_t *php_pdo_stmt_fetch_object(zend_object *obj) {
645 return (pdo_stmt_t *)((char*)(obj) - XtOffsetOf(pdo_stmt_t, std));
646}
647
648#define Z_PDO_STMT_P(zv) php_pdo_stmt_fetch_object(Z_OBJ_P((zv)))
649
654
656 const char *ptr, *cur, *tok, *end;
657};
658
659/* Call this in MINIT to register the PDO driver.
660 * Registering the driver might fail and should be reported accordingly in MINIT. */
662/* call this in MSHUTDOWN to unregister your PDO driver */
664
665/* Call this in MINIT to register the PDO driver specific class entry.
666 * Registering the driver specific class entry might fail and should be reported accordingly in MINIT.
667 * Unregistering the class entry is not necessary, since php_pdo_unregister_driver() takes care of it. */
669
670/* For the convenience of drivers, this function will parse a data source
671 * string, of the form "name=value; name2=value2" and populate variables
672 * according to the data you pass in and array of pdo_data_src_parser structures */
674 const char *optname;
675 char *optval;
677};
678
679PDO_API int php_pdo_parse_data_source(const char *data_source,
680 zend_ulong data_source_len, struct pdo_data_src_parser *parsed,
681 int nparams);
682
685
687
689 pdo_error_type sqlstate, const char *supp);
690
693
695PDO_API void php_pdo_stmt_set_column_count(pdo_stmt_t *stmt, int new_count);
696
697PDO_API void php_pdo_internal_construct_driver(INTERNAL_FUNCTION_PARAMETERS, zend_object *current_object, zend_class_entry *called_scope, zval *new_zval_object);
698
699/* Normalization for fetching long param for driver attributes */
701PDO_API bool pdo_get_bool_param(bool *bval, zval *value);
702
703PDO_API void pdo_throw_exception(unsigned int driver_errcode, char *driver_errmsg, pdo_error_type *pdo_error);
704#endif /* PHP_PDO_DRIVER_H */
char s[4]
Definition cdf.c:77
uint32_t v
Definition cdf.c:1237
zend_ffi_type * type
Definition ffi.c:3812
new_type kind
Definition ffi.c:4363
new_type attr
Definition ffi.c:4364
zval * val
Definition ffi.c:4262
zend_long offset
#define NULL
Definition gdcache.h:45
PHP_JSON_API size_t int options
Definition php_json.h:102
#define PDO_API
Definition php_pdo.h:42
char sqlstate[6]
int(* pdo_stmt_set_attr_func)(pdo_stmt_t *stmt, zend_long attr, zval *val)
PDO_API int pdo_parse_params(pdo_stmt_t *stmt, zend_string *inquery, zend_string **outquery)
bool(* pdo_dbh_prepare_func)(pdo_dbh_t *dbh, zend_string *sql, pdo_stmt_t *stmt, zval *driver_options)
struct _pdo_dbh_t pdo_dbh_t
pdo_error_mode
@ PDO_ERRMODE_SILENT
@ PDO_ERRMODE_WARNING
@ PDO_ERRMODE_EXCEPTION
PDO_API void pdo_throw_exception(unsigned int driver_errcode, char *driver_errmsg, pdo_error_type *pdo_error)
Definition pdo_dbh.c:41
PDO_API int php_pdo_parse_data_source(const char *data_source, zend_ulong data_source_len, struct pdo_data_src_parser *parsed, int nparams)
Definition pdo.c:157
void(* pdo_dbh_request_shutdown)(pdo_dbh_t *dbh)
PDO_API void php_pdo_unregister_driver(const pdo_driver_t *driver)
Definition pdo.c:129
int(* pdo_dbh_get_attr_func)(pdo_dbh_t *dbh, zend_long attr, zval *val)
pdo_cursor_type
@ PDO_CURSOR_FWDONLY
@ PDO_CURSOR_SCROLL
struct _pdo_stmt_t pdo_stmt_t
const zend_function_entry *(* pdo_dbh_get_driver_methods_func)(pdo_dbh_t *dbh, int kind)
PDO_API zend_result php_pdo_register_driver(const pdo_driver_t *driver)
Definition pdo.c:113
PDO_API void php_pdo_dbh_addref(pdo_dbh_t *dbh)
zend_long(* pdo_dbh_do_func)(pdo_dbh_t *dbh, const zend_string *sql)
zend_string *(* pdo_dbh_quote_func)(pdo_dbh_t *dbh, const zend_string *unquoted, enum pdo_param_type paramtype)
pdo_param_type
@ PDO_PARAM_LOB
@ PDO_PARAM_STR_NATL
@ PDO_PARAM_INPUT_OUTPUT
@ PDO_PARAM_BOOL
@ PDO_PARAM_INT
@ PDO_PARAM_STMT
@ PDO_PARAM_NULL
@ PDO_PARAM_STR_CHAR
@ PDO_PARAM_STR
PDO_API zend_result php_pdo_register_driver_specific_ce(const pdo_driver_t *driver, zend_class_entry *ce)
Definition pdo.c:140
pdo_case_conversion
@ PDO_CASE_UPPER
@ PDO_CASE_LOWER
@ PDO_CASE_NATURAL
bool(* pdo_dbh_set_attr_func)(pdo_dbh_t *dbh, zend_long attr, zval *val)
struct _pdo_row_t pdo_row_t
bool(* pdo_dbh_txn_func)(pdo_dbh_t *dbh)
void(* pdo_dbh_get_gc_func)(pdo_dbh_t *dbh, zend_get_gc_buffer *buffer)
int(* pdo_stmt_get_attr_func)(pdo_stmt_t *stmt, zend_long attr, zval *val)
pdo_param_event
@ PDO_PARAM_EVT_ALLOC
@ PDO_PARAM_EVT_EXEC_PRE
@ PDO_PARAM_EVT_FETCH_POST
@ PDO_PARAM_EVT_NORMALIZE
@ PDO_PARAM_EVT_FETCH_PRE
@ PDO_PARAM_EVT_EXEC_POST
@ PDO_PARAM_EVT_FREE
pdo_null_handling
@ PDO_NULL_NATURAL
@ PDO_NULL_TO_STRING
@ PDO_NULL_EMPTY_STRING
PDO_API zend_class_entry * php_pdo_get_dbh_ce(void)
Definition pdo.c:56
char pdo_error_type[6]
pdo_fetch_type
@ PDO_FETCH_BOTH
@ PDO_FETCH_FUNC
@ PDO_FETCH_OBJ
@ PDO_FETCH_KEY_PAIR
@ PDO_FETCH_NUM
@ PDO_FETCH_USE_DEFAULT
@ PDO_FETCH_LAZY
@ PDO_FETCH_CLASS
@ PDO_FETCH_NAMED
@ PDO_FETCH_COLUMN
@ PDO_FETCH__MAX
@ PDO_FETCH_INTO
@ PDO_FETCH_BOUND
@ PDO_FETCH_ASSOC
PDO_API bool pdo_get_long_param(zend_long *lval, zval *value)
Definition pdo_dbh.c:774
zend_result(* pdo_dbh_check_liveness_func)(pdo_dbh_t *dbh)
struct _pdo_scanner_t pdo_scanner_t
int(* pdo_stmt_fetch_func)(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori, zend_long offset)
pdo_fetch_orientation
@ PDO_FETCH_ORI_ABS
@ PDO_FETCH_ORI_LAST
@ PDO_FETCH_ORI_PRIOR
@ PDO_FETCH_ORI_FIRST
@ PDO_FETCH_ORI_REL
@ PDO_FETCH_ORI_NEXT
@ PDO_DBH_DRIVER_METHOD_KIND_DBH
@ PDO_DBH_DRIVER_METHOD_KIND_STMT
@ PDO_DBH_DRIVER_METHOD_KIND__MAX
pdo_placeholder_support
@ PDO_PLACEHOLDER_NONE
@ PDO_PLACEHOLDER_NAMED
@ PDO_PLACEHOLDER_POSITIONAL
int(* pdo_stmt_execute_func)(pdo_stmt_t *stmt)
void(* pdo_dbh_close_func)(pdo_dbh_t *dbh)
void(* pdo_dbh_fetch_error_func)(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info)
int(* pdo_stmt_next_rowset_func)(pdo_stmt_t *stmt)
PDO_API void php_pdo_stmt_set_column_count(pdo_stmt_t *stmt, int new_count)
Definition pdo_stmt.c:195
PDO_API bool pdo_get_bool_param(bool *bval, zval *value)
Definition pdo_dbh.c:792
int(* pdo_stmt_dtor_func)(pdo_stmt_t *stmt)
int(* pdo_stmt_get_col_data_func)(pdo_stmt_t *stmt, int colno, zval *result, enum pdo_param_type *type)
PDO_API zend_class_entry * php_pdo_get_exception(void)
Definition pdo.c:62
PDO_API void php_pdo_dbh_delref(pdo_dbh_t *dbh)
PDO_API void php_pdo_free_statement(pdo_stmt_t *stmt)
Definition pdo_stmt.c:2115
PDO_API void pdo_raise_impl_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, pdo_error_type sqlstate, const char *supp)
Definition pdo_dbh.c:68
int(* pdo_dbh_sql_scanner)(pdo_scanner_t *s)
int(* pdo_stmt_cursor_closer_func)(pdo_stmt_t *stmt)
PDO_API void php_pdo_internal_construct_driver(INTERNAL_FUNCTION_PARAMETERS, zend_object *current_object, zend_class_entry *called_scope, zval *new_zval_object)
Definition pdo_dbh.c:301
int(* pdo_stmt_param_hook_func)(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, enum pdo_param_event event_type)
int(* pdo_stmt_describe_col_func)(pdo_stmt_t *stmt, int colno)
struct _pdo_dbh_object_t pdo_dbh_object_t
int(* pdo_stmt_get_column_meta_func)(pdo_stmt_t *stmt, zend_long colno, zval *return_value)
pdo_attribute_type
@ PDO_ATTR_CURSOR_NAME
@ PDO_ATTR_STATEMENT_CLASS
@ PDO_ATTR_EMULATE_PREPARES
@ PDO_ATTR_DEFAULT_STR_PARAM
@ PDO_ATTR_MAX_COLUMN_LEN
@ PDO_ATTR_CASE
@ PDO_ATTR_DRIVER_NAME
@ PDO_ATTR_FETCH_CATALOG_NAMES
@ PDO_ATTR_CONNECTION_STATUS
@ PDO_ATTR_ERRMODE
@ PDO_ATTR_SERVER_VERSION
@ PDO_ATTR_SERVER_INFO
@ PDO_ATTR_DRIVER_SPECIFIC
@ PDO_ATTR_PERSISTENT
@ PDO_ATTR_AUTOCOMMIT
@ PDO_ATTR_PREFETCH
@ PDO_ATTR_ORACLE_NULLS
@ PDO_ATTR_STRINGIFY_FETCHES
@ PDO_ATTR_DEFAULT_FETCH_MODE
@ PDO_ATTR_CURSOR
@ PDO_ATTR_FETCH_TABLE_NAMES
@ PDO_ATTR_TIMEOUT
@ PDO_ATTR_CLIENT_VERSION
zend_string *(* pdo_dbh_last_id_func)(pdo_dbh_t *dbh, const zend_string *name)
const char * data_source
unsigned max_escaped_char_length
unsigned int refcount
HashTable * cls_methods[PDO_DBH_DRIVER_METHOD_KIND__MAX]
unsigned is_persistent
const char * persistent_id
enum pdo_case_conversion native_case desired_case
enum pdo_fetch_type default_fetch_type
size_t persistent_id_len
size_t data_source_len
void * driver_data
pdo_driver_t * driver
unsigned stringify
pdo_error_type error_code
enum pdo_error_mode error_mode
pdo_stmt_t * query_stmt
unsigned alloc_own_columns
zend_class_entry * def_stmt_ce
unsigned _reserved_flags
unsigned auto_commit
zval def_stmt_ctor_args
const struct pdo_dbh_methods * methods
unsigned skip_param_evt
unsigned oracle_nulls
unsigned is_closed
zend_object std
pdo_stmt_t * stmt
const char * tok
const char * ptr
const char * end
const char * cur
const char * named_rewrite_template
zend_string * active_query_string
zend_string * query_string
zend_object std
unsigned executed
unsigned supports_placeholders
zend_fcall_info fci
unsigned _reserved
zend_class_entry * ce
pdo_error_type error_code
HashTable * bound_params
const struct pdo_stmt_methods * methods
struct pdo_column_data * columns
zend_fcall_info_cache fcc
enum pdo_fetch_type default_fetch_type
zval database_object_handle
union _pdo_stmt_t::@000166265162112000164105002261207304326156154222 fetch
HashTable * bound_param_map
zend_long row_count
pdo_dbh_t * dbh
HashTable * bound_columns
zend_ulong refcount
Definition file.h:177
enum pdo_param_type param_type
zend_ulong precision
zend_string * name
pdo_dbh_txn_func rollback
pdo_dbh_fetch_error_func fetch_err
pdo_dbh_get_driver_methods_func get_driver_methods
pdo_dbh_do_func doer
pdo_dbh_check_liveness_func check_liveness
pdo_dbh_get_gc_func get_gc
pdo_dbh_quote_func quoter
pdo_dbh_get_attr_func get_attribute
pdo_dbh_last_id_func last_id
pdo_dbh_close_func closer
pdo_dbh_set_attr_func set_attribute
pdo_dbh_sql_scanner scanner
pdo_dbh_prepare_func preparer
pdo_dbh_txn_func commit
pdo_dbh_request_shutdown persistent_shutdown
pdo_dbh_txn_func in_transaction
pdo_dbh_txn_func begin
int(* db_handle_factory)(pdo_dbh_t *dbh, zval *driver_options)
zend_ulong api_version
size_t driver_name_len
const char * driver_name
pdo_stmt_param_hook_func param_hook
pdo_stmt_fetch_func fetcher
pdo_stmt_dtor_func dtor
pdo_stmt_cursor_closer_func cursor_closer
pdo_stmt_next_rowset_func next_rowset
pdo_stmt_get_col_data_func get_col
pdo_stmt_get_attr_func get_attribute
pdo_stmt_execute_func executer
pdo_stmt_describe_col_func describer
pdo_stmt_get_column_meta_func get_column_meta
pdo_stmt_set_attr_func set_attribute
#define INTERNAL_FUNCTION_PARAMETERS
Definition zend.h:49
struct _zend_fcall_info_cache zend_fcall_info_cache
struct _zend_function_entry zend_function_entry
struct _zend_fcall_info zend_fcall_info
struct _zval_struct zval
execute_data func
ZEND_API void(ZEND_FASTCALL *zend_touch_vm_stack_data)(void *vm_stack_data)
ZEND_API zval *ZEND_FASTCALL zend_hash_index_find(const HashTable *ht, zend_ulong h)
Definition zend_hash.c:2701
int32_t zend_long
Definition zend_long.h:42
uint32_t zend_ulong
Definition zend_long.h:43
struct _zend_string zend_string
#define XtOffsetOf(s_type, field)
struct _zend_class_entry zend_class_entry
struct _zend_object zend_object
#define Z_ARRVAL_P(zval_p)
Definition zend_types.h:987
struct _zend_array HashTable
Definition zend_types.h:386
ZEND_RESULT_CODE zend_result
Definition zend_types.h:64
zval * return_value
zend_string * name
bool result
value