@@ -1604,8 +1604,28 @@ php_mysqlnd_rowp_read_text_protocol_aux(MYSQLND_ROW_BUFFER * row_buffer, zval *
1604
1604
}
1605
1605
MYSQLND_INC_CONN_STATISTIC_W_VALUE2 (stats , statistic , 1 , STAT_BYTES_RECEIVED_PURE_DATA_TEXT , len );
1606
1606
}
1607
+ if (fields_metadata [i ].type == MYSQL_TYPE_BIT ) {
1608
+ /*
1609
+ BIT fields are specially handled. As they come as bit mask, they have
1610
+ to be converted to human-readable representation.
1611
+ */
1612
+ ps_fetch_from_1_to_8_bytes (current_field , & (fields_metadata [i ]), 0 , (const zend_uchar * * ) & p , len );
1613
+ /*
1614
+ We have advanced in ps_fetch_from_1_to_8_bytes. We should go back because
1615
+ later in this function there will be an advancement.
1616
+ */
1617
+ p -= len ;
1618
+ if (Z_TYPE_P (current_field ) == IS_LONG && !as_int_or_float ) {
1619
+ /* we are using the text protocol, so convert to string */
1620
+ char tmp [22 ];
1621
+ const size_t tmp_len = sprintf ((char * )& tmp , ZEND_ULONG_FMT , Z_LVAL_P (current_field ));
1622
+ ZVAL_STRINGL (current_field , tmp , tmp_len );
1623
+ } else if (Z_TYPE_P (current_field ) == IS_STRING ) {
1624
+ /* nothing to do here, as we want a string and ps_fetch_from_1_to_8_bytes() has given us one */
1625
+ }
1626
+ }
1607
1627
#ifdef MYSQLND_STRING_TO_INT_CONVERSION
1608
- if (as_int_or_float && perm_bind .php_type == IS_LONG ) {
1628
+ else if (as_int_or_float && perm_bind .php_type == IS_LONG ) {
1609
1629
zend_uchar save = * (p + len );
1610
1630
/* We have to make it ASCIIZ temporarily */
1611
1631
* (p + len ) = '\0' ;
@@ -1649,28 +1669,9 @@ php_mysqlnd_rowp_read_text_protocol_aux(MYSQLND_ROW_BUFFER * row_buffer, zval *
1649
1669
* (p + len ) = '\0' ;
1650
1670
ZVAL_DOUBLE (current_field , atof ((char * ) p ));
1651
1671
* (p + len ) = save ;
1652
- } else
1672
+ }
1653
1673
#endif /* MYSQLND_STRING_TO_INT_CONVERSION */
1654
- if (fields_metadata [i ].type == MYSQL_TYPE_BIT ) {
1655
- /*
1656
- BIT fields are specially handled. As they come as bit mask, they have
1657
- to be converted to human-readable representation.
1658
- */
1659
- ps_fetch_from_1_to_8_bytes (current_field , & (fields_metadata [i ]), 0 , (const zend_uchar * * ) & p , len );
1660
- /*
1661
- We have advanced in ps_fetch_from_1_to_8_bytes. We should go back because
1662
- later in this function there will be an advancement.
1663
- */
1664
- p -= len ;
1665
- if (Z_TYPE_P (current_field ) == IS_LONG && !as_int_or_float ) {
1666
- /* we are using the text protocol, so convert to string */
1667
- char tmp [22 ];
1668
- const size_t tmp_len = sprintf ((char * )& tmp , ZEND_ULONG_FMT , Z_LVAL_P (current_field ));
1669
- ZVAL_STRINGL (current_field , tmp , tmp_len );
1670
- } else if (Z_TYPE_P (current_field ) == IS_STRING ) {
1671
- /* nothing to do here, as we want a string and ps_fetch_from_1_to_8_bytes() has given us one */
1672
- }
1673
- } else {
1674
+ else {
1674
1675
ZVAL_STRINGL_FAST (current_field , (char * )p , len );
1675
1676
}
1676
1677
p += len ;
0 commit comments