@@ -560,28 +560,20 @@ struct _pdo_stmt_t {
560
560
const struct pdo_stmt_methods *methods;
561
561
void *driver_data;
562
562
563
+ /* the cursor specific error code. */
564
+ pdo_error_type error_code;
565
+
563
566
/* if true, we've already successfully executed this statement at least
564
567
* 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 */
569
- unsigned supports_placeholders:2 ;
568
+ uint8_t executed:1 ;
570
569
571
570
/* If true we are in a do_fetch() call, and modification to the statement must be prevented */
572
- unsigned in_fetch:1 ;
573
- unsigned _reserved:28 ;
571
+ uint8_t in_fetch:1 ;
574
572
575
- /* the number of columns in the result set; not valid until after
576
- * the statement has been executed at least once. In some cases, might
577
- * not be valid until fetch (at the driver level) has been called at least once.
578
- * */
579
- int column_count;
580
- struct pdo_column_data *columns;
581
-
582
- /* we want to keep the dbh alive while we live, so we own a reference */
583
- zend_object *database_object_handle;
584
- pdo_dbh_t *dbh;
573
+ /* if true, the statement supports placeholders and can implement
574
+ * bindParam() for its prepared statements, if false, PDO should
575
+ * emulate prepare and bind on its behalf */
576
+ uint8_t supports_placeholders:2 ;
585
577
586
578
/* keep track of bound input parameters. Some drivers support
587
579
* input/output parameters, but you can't rely on that working */
@@ -592,24 +584,16 @@ struct _pdo_stmt_t {
592
584
* in the result set */
593
585
HashTable *bound_columns;
594
586
595
- /* not always meaningful */
596
- zend_long row_count;
597
-
598
- /* used to hold the statement's current query */
599
- zend_string *query_string;
600
-
601
- /* the copy of the query with expanded binds ONLY for emulated-prepare drivers */
602
- zend_string *active_query_string;
603
-
604
- /* the cursor specific error code. */
605
- pdo_error_type error_code;
606
-
607
- /* for lazy fetches, we always return the same lazy object handle.
608
- * Let's keep it here. */
609
- zval lazy_object_ref;
587
+ struct pdo_column_data *columns;
588
+ /* the number of columns in the result set; not valid until after
589
+ * the statement has been executed at least once. In some cases, might
590
+ * not be valid until fetch (at the driver level) has been called at least once.
591
+ * */
592
+ int32_t column_count;
610
593
611
594
/* defaults for fetches */
612
595
enum pdo_fetch_type default_fetch_type;
596
+
613
597
union {
614
598
int column;
615
599
struct {
@@ -622,6 +606,23 @@ struct _pdo_stmt_t {
622
606
zend_object *into;
623
607
} fetch;
624
608
609
+ /* for lazy fetches, we always return the same lazy object handle.
610
+ * Let's keep it here. */
611
+ zval lazy_object_ref;
612
+
613
+ /* we want to keep the dbh alive while we live, so we own a reference */
614
+ zend_object *database_object_handle;
615
+ pdo_dbh_t *dbh;
616
+
617
+ /* not always meaningful */
618
+ zend_long row_count;
619
+
620
+ /* used to hold the statement's current query */
621
+ zend_string *query_string;
622
+
623
+ /* the copy of the query with expanded binds ONLY for emulated-prepare drivers */
624
+ zend_string *active_query_string;
625
+
625
626
/* used by the query parser for driver specific
626
627
* parameter naming (see pgsql driver for example) */
627
628
const char *named_rewrite_template;
@@ -634,6 +635,8 @@ struct _pdo_stmt_t {
634
635
zend_object std;
635
636
};
636
637
638
+
639
+
637
640
static inline pdo_stmt_t *php_pdo_stmt_fetch_object (zend_object *obj) {
638
641
return (pdo_stmt_t *)((char *)(obj) - XtOffsetOf (pdo_stmt_t , std));
639
642
}
0 commit comments