@@ -560,28 +560,21 @@ 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
+ uint16_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
+ uint16_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
+ uint16_t supports_placeholders:2 ;
577
+ uint16_t reserved: 12 ;
585
578
586
579
/* keep track of bound input parameters. Some drivers support
587
580
* input/output parameters, but you can't rely on that working */
@@ -592,24 +585,16 @@ struct _pdo_stmt_t {
592
585
* in the result set */
593
586
HashTable *bound_columns;
594
587
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;
588
+ struct pdo_column_data *columns;
589
+ /* the number of columns in the result set; not valid until after
590
+ * the statement has been executed at least once. In some cases, might
591
+ * not be valid until fetch (at the driver level) has been called at least once.
592
+ * */
593
+ int32_t column_count;
610
594
611
595
/* defaults for fetches */
612
596
enum pdo_fetch_type default_fetch_type;
597
+
613
598
union {
614
599
int column;
615
600
struct {
@@ -622,6 +607,23 @@ struct _pdo_stmt_t {
622
607
zend_object *into;
623
608
} fetch;
624
609
610
+ /* for lazy fetches, we always return the same lazy object handle.
611
+ * Let's keep it here. */
612
+ zval lazy_object_ref;
613
+
614
+ pdo_dbh_t *dbh;
615
+ /* we want to keep the dbh alive while we live, so we own a reference */
616
+ zend_object *database_object_handle;
617
+
618
+ /* not always meaningful */
619
+ zend_long row_count;
620
+
621
+ /* used to hold the statement's current query */
622
+ zend_string *query_string;
623
+
624
+ /* the copy of the query with expanded binds ONLY for emulated-prepare drivers */
625
+ zend_string *active_query_string;
626
+
625
627
/* used by the query parser for driver specific
626
628
* parameter naming (see pgsql driver for example) */
627
629
const char *named_rewrite_template;
@@ -634,6 +636,8 @@ struct _pdo_stmt_t {
634
636
zend_object std;
635
637
};
636
638
639
+
640
+
637
641
static inline pdo_stmt_t *php_pdo_stmt_fetch_object (zend_object *obj) {
638
642
return (pdo_stmt_t *)((char *)(obj) - XtOffsetOf (pdo_stmt_t , std));
639
643
}
0 commit comments