Lines Matching refs:p

64 	if ((size_t)(p - begin) > packet->header.size) { \
131 register zend_uchar *p= (zend_uchar *)*packet; in php_mysqlnd_net_field_length() local
133 if (*p < 251) { in php_mysqlnd_net_field_length()
135 return (zend_ulong) *p; in php_mysqlnd_net_field_length()
138 switch (*p) { in php_mysqlnd_net_field_length()
144 return (zend_ulong) uint2korr(p+1); in php_mysqlnd_net_field_length()
147 return (zend_ulong) uint3korr(p+1); in php_mysqlnd_net_field_length()
150 return (zend_ulong) uint4korr(p+1); in php_mysqlnd_net_field_length()
161 register zend_uchar *p = (zend_uchar *)*packet; in php_mysqlnd_net_field_length_ll() local
163 if (*p < 251) { in php_mysqlnd_net_field_length_ll()
165 return (uint64_t) *p; in php_mysqlnd_net_field_length_ll()
168 switch (*p) { in php_mysqlnd_net_field_length_ll()
174 return (uint64_t) uint2korr(p + 1); in php_mysqlnd_net_field_length_ll()
177 return (uint64_t) uint3korr(p + 1); in php_mysqlnd_net_field_length_ll()
180 return (uint64_t) uint8korr(p + 1); in php_mysqlnd_net_field_length_ll()
237 zend_uchar *p = buf; in php_mysqlnd_read_error_from_line() local
246 *error_no = uint2korr(p); in php_mysqlnd_read_error_from_line()
247 p+= 2; in php_mysqlnd_read_error_from_line()
252 if (*p == '#') { in php_mysqlnd_read_error_from_line()
253 ++p; in php_mysqlnd_read_error_from_line()
254 if ((buf_len - (p - buf)) >= MYSQLND_SQLSTATE_LENGTH) { in php_mysqlnd_read_error_from_line()
255 memcpy(sqlstate, p, MYSQLND_SQLSTATE_LENGTH); in php_mysqlnd_read_error_from_line()
256 p+= MYSQLND_SQLSTATE_LENGTH; in php_mysqlnd_read_error_from_line()
261 if ((buf_len - (p - buf)) > 0) { in php_mysqlnd_read_error_from_line()
262 error_msg_len = MIN((int)((buf_len - (p - buf))), (int) (error_buf_len - 1)); in php_mysqlnd_read_error_from_line()
263 memcpy(error, p, error_msg_len); in php_mysqlnd_read_error_from_line()
323 zend_uchar *p = buf; in php_mysqlnd_greet_read() local
344 packet->protocol_version = uint1korr(p); in php_mysqlnd_greet_read()
345 p++; in php_mysqlnd_greet_read()
349 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_greet_read()
364 packet->server_version = estrdup((char *)p); in php_mysqlnd_greet_read()
365 p+= strlen(packet->server_version) + 1; /* eat the '\0' */ in php_mysqlnd_greet_read()
368 packet->thread_id = uint4korr(p); in php_mysqlnd_greet_read()
369 p+=4; in php_mysqlnd_greet_read()
372 memcpy(packet->auth_plugin_data, p, SCRAMBLE_LENGTH_323); in php_mysqlnd_greet_read()
373 p+= SCRAMBLE_LENGTH_323; in php_mysqlnd_greet_read()
377 p++; in php_mysqlnd_greet_read()
380 packet->server_capabilities = uint2korr(p); in php_mysqlnd_greet_read()
381 p+= 2; in php_mysqlnd_greet_read()
384 packet->charset_no = uint1korr(p); in php_mysqlnd_greet_read()
385 p++; in php_mysqlnd_greet_read()
388 packet->server_status = uint2korr(p); in php_mysqlnd_greet_read()
389 p+= 2; in php_mysqlnd_greet_read()
393 pad_start = p; in php_mysqlnd_greet_read()
394 p+= 13; in php_mysqlnd_greet_read()
397 if ((size_t) (p - buf) < packet->header.size) { in php_mysqlnd_greet_read()
399 memcpy(packet->auth_plugin_data + SCRAMBLE_LENGTH_323, p, SCRAMBLE_LENGTH - SCRAMBLE_LENGTH_323); in php_mysqlnd_greet_read()
400 p+= SCRAMBLE_LENGTH - SCRAMBLE_LENGTH_323; in php_mysqlnd_greet_read()
401 p++; /* 0x0 at the end of the scramble and thus last byte in the packet in 5.1 and previous */ in php_mysqlnd_greet_read()
407 if ((size_t) (p - buf) < packet->header.size) { in php_mysqlnd_greet_read()
409 p--; in php_mysqlnd_greet_read()
424 … memcpy(new_auth_plugin_data + SCRAMBLE_LENGTH, p, packet->auth_plugin_data_len - SCRAMBLE_LENGTH); in php_mysqlnd_greet_read()
425 p+= (packet->auth_plugin_data_len - SCRAMBLE_LENGTH); in php_mysqlnd_greet_read()
433 packet->auth_protocol = estrdup((char *)p); in php_mysqlnd_greet_read()
434 p+= strlen(packet->auth_protocol) + 1; /* eat the '\0' */ in php_mysqlnd_greet_read()
446 DBG_ERR_FMT("GREET packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_greet_read()
448 p - begin - packet->header.size); in php_mysqlnd_greet_read()
458 MYSQLND_PACKET_GREET *p= (MYSQLND_PACKET_GREET *) _packet; in php_mysqlnd_greet_free_mem() local
459 if (p->server_version) { in php_mysqlnd_greet_free_mem()
460 efree(p->server_version); in php_mysqlnd_greet_free_mem()
461 p->server_version = NULL; in php_mysqlnd_greet_free_mem()
463 if (p->auth_plugin_data && p->auth_plugin_data != p->intern_auth_plugin_data) { in php_mysqlnd_greet_free_mem()
464 efree(p->auth_plugin_data); in php_mysqlnd_greet_free_mem()
465 p->auth_plugin_data = NULL; in php_mysqlnd_greet_free_mem()
467 if (p->auth_protocol) { in php_mysqlnd_greet_free_mem()
468 efree(p->auth_protocol); in php_mysqlnd_greet_free_mem()
469 p->auth_protocol = NULL; in php_mysqlnd_greet_free_mem()
472 mnd_pefree(p, p->header.persistent); in php_mysqlnd_greet_free_mem()
485 zend_uchar *p = buffer + MYSQLND_HEADER_SIZE; /* start after the header */ in php_mysqlnd_auth_write() local
492 int4store(p, packet->client_flags); in php_mysqlnd_auth_write()
493 p+= 4; in php_mysqlnd_auth_write()
495 int4store(p, packet->max_packet_size); in php_mysqlnd_auth_write()
496 p+= 4; in php_mysqlnd_auth_write()
498 int1store(p, packet->charset_no); in php_mysqlnd_auth_write()
499 p++; in php_mysqlnd_auth_write()
501 memset(p, 0, 23); /* filler */ in php_mysqlnd_auth_write()
502 p+= 23; in php_mysqlnd_auth_write()
507 memcpy(p, packet->user, len); in php_mysqlnd_auth_write()
508 p+= len; in php_mysqlnd_auth_write()
509 *p++ = '\0'; in php_mysqlnd_auth_write()
523 int1store(p, packet->auth_data_len); in php_mysqlnd_auth_write()
524 ++p; in php_mysqlnd_auth_write()
526 if (sizeof(buffer) < (packet->auth_data_len + (p - buffer))) { in php_mysqlnd_auth_write()
531 memcpy(p, packet->auth_data, packet->auth_data_len); in php_mysqlnd_auth_write()
532 p+= packet->auth_data_len; in php_mysqlnd_auth_write()
538 memcpy(p, packet->db, real_db_len); in php_mysqlnd_auth_write()
539 p+= real_db_len; in php_mysqlnd_auth_write()
540 *p++= '\0'; in php_mysqlnd_auth_write()
542 *p++= '\0'; in php_mysqlnd_auth_write()
548 int2store(p, packet->charset_no); in php_mysqlnd_auth_write()
549 p+= 2; in php_mysqlnd_auth_write()
554 size_t len = MIN(strlen(packet->auth_plugin_name), sizeof(buffer) - (p - buffer) - 1); in php_mysqlnd_auth_write()
555 memcpy(p, packet->auth_plugin_name, len); in php_mysqlnd_auth_write()
556 p+= len; in php_mysqlnd_auth_write()
557 *p++= '\0'; in php_mysqlnd_auth_write()
597 …if (sizeof(buffer) >= (ca_payload_len + php_mysqlnd_net_store_length_size(ca_payload_len) + (p - b… in php_mysqlnd_auth_write()
598 p = php_mysqlnd_net_store_length(p, ca_payload_len); in php_mysqlnd_auth_write()
609 p = php_mysqlnd_net_store_length(p, s_len); in php_mysqlnd_auth_write()
610 memcpy(p, s_key, s_len); in php_mysqlnd_auth_write()
611 p+= s_len; in php_mysqlnd_auth_write()
613 p = php_mysqlnd_net_store_length(p, value_len); in php_mysqlnd_auth_write()
614 memcpy(p, *entry_value, value_len); in php_mysqlnd_auth_write()
615 p+= value_len; in php_mysqlnd_auth_write()
628 p = php_mysqlnd_net_store_length(p, ZSTR_LEN(key)); in php_mysqlnd_auth_write()
629 memcpy(p, ZSTR_VAL(key), ZSTR_LEN(key)); in php_mysqlnd_auth_write()
630 p+= ZSTR_LEN(key); in php_mysqlnd_auth_write()
632 p = php_mysqlnd_net_store_length(p, value_len); in php_mysqlnd_auth_write()
633 memcpy(p, Z_STRVAL_P(entry_value), value_len); in php_mysqlnd_auth_write()
634 p+= value_len; in php_mysqlnd_auth_write()
645 …if (PASS != conn->m->simple_command(conn, COM_CHANGE_USER, buffer + MYSQLND_HEADER_SIZE, p - buffe… in php_mysqlnd_auth_write()
650 DBG_RETURN(p - buffer - MYSQLND_HEADER_SIZE); in php_mysqlnd_auth_write()
652 …size_t sent = conn->net->data->m.send_ex(conn->net, buffer, p - buffer - MYSQLND_HEADER_SIZE, conn… in php_mysqlnd_auth_write()
667 MYSQLND_PACKET_AUTH * p = (MYSQLND_PACKET_AUTH *) _packet; in php_mysqlnd_auth_free_mem() local
668 mnd_pefree(p, p->header.persistent); in php_mysqlnd_auth_free_mem()
683 zend_uchar *p = buf; in php_mysqlnd_auth_response_read() local
702 packet->response_code = uint1korr(p); in php_mysqlnd_auth_response_read()
703 p++; in php_mysqlnd_auth_response_read()
707 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_auth_response_read()
715 if (packet->header.size > (size_t) (p - buf)) { in php_mysqlnd_auth_response_read()
716 packet->new_auth_protocol = mnd_pestrdup((char *)p, FALSE); in php_mysqlnd_auth_response_read()
718 p+= packet->new_auth_protocol_len + 1; /* +1 for the \0 */ in php_mysqlnd_auth_response_read()
720 packet->new_auth_protocol_data_len = packet->header.size - (size_t) (p - buf); in php_mysqlnd_auth_response_read()
723 memcpy(packet->new_auth_protocol_data, p, packet->new_auth_protocol_data_len); in php_mysqlnd_auth_response_read()
730 packet->affected_rows = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_auth_response_read()
733 packet->last_insert_id = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_auth_response_read()
736 packet->server_status = uint2korr(p); in php_mysqlnd_auth_response_read()
737 p+= 2; in php_mysqlnd_auth_response_read()
740 packet->warning_count = uint2korr(p); in php_mysqlnd_auth_response_read()
741 p+= 2; in php_mysqlnd_auth_response_read()
745 if (packet->header.size > (size_t) (p - buf) && (i = php_mysqlnd_net_field_length(&p))) { in php_mysqlnd_auth_response_read()
746 packet->message_len = MIN(i, buf_len - (p - begin)); in php_mysqlnd_auth_response_read()
747 packet->message = mnd_pestrndup((char *)p, packet->message_len, FALSE); in php_mysqlnd_auth_response_read()
760 DBG_ERR_FMT("OK packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_auth_response_read()
762 p - begin - packet->header.size); in php_mysqlnd_auth_response_read()
772 MYSQLND_PACKET_AUTH_RESPONSE * p = (MYSQLND_PACKET_AUTH_RESPONSE *) _packet; in php_mysqlnd_auth_response_free_mem() local
773 if (p->message) { in php_mysqlnd_auth_response_free_mem()
774 mnd_efree(p->message); in php_mysqlnd_auth_response_free_mem()
775 p->message = NULL; in php_mysqlnd_auth_response_free_mem()
777 if (p->new_auth_protocol) { in php_mysqlnd_auth_response_free_mem()
778 mnd_efree(p->new_auth_protocol); in php_mysqlnd_auth_response_free_mem()
779 p->new_auth_protocol = NULL; in php_mysqlnd_auth_response_free_mem()
781 p->new_auth_protocol_len = 0; in php_mysqlnd_auth_response_free_mem()
783 if (p->new_auth_protocol_data) { in php_mysqlnd_auth_response_free_mem()
784 mnd_efree(p->new_auth_protocol_data); in php_mysqlnd_auth_response_free_mem()
785 p->new_auth_protocol_data = NULL; in php_mysqlnd_auth_response_free_mem()
787 p->new_auth_protocol_data_len = 0; in php_mysqlnd_auth_response_free_mem()
790 mnd_pefree(p, p->header.persistent); in php_mysqlnd_auth_response_free_mem()
802 zend_uchar *p = buffer + MYSQLND_HEADER_SIZE; /* start after the header */ in php_mysqlnd_change_auth_response_write() local
807 memcpy(p, packet->auth_data, packet->auth_data_len); in php_mysqlnd_change_auth_response_write()
808 p+= packet->auth_data_len; in php_mysqlnd_change_auth_response_write()
812 …size_t sent = conn->net->data->m.send_ex(conn->net, buffer, p - buffer - MYSQLND_HEADER_SIZE, conn… in php_mysqlnd_change_auth_response_write()
830 MYSQLND_PACKET_CHANGE_AUTH_RESPONSE * p = (MYSQLND_PACKET_CHANGE_AUTH_RESPONSE *) _packet; in php_mysqlnd_change_auth_response_free_mem() local
831 mnd_pefree(p, p->header.persistent); in php_mysqlnd_change_auth_response_free_mem()
846 zend_uchar *p = buf; in php_mysqlnd_ok_read() local
857 packet->field_count = uint1korr(p); in php_mysqlnd_ok_read()
858 p++; in php_mysqlnd_ok_read()
862 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_ok_read()
870 packet->affected_rows = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_ok_read()
873 packet->last_insert_id = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_ok_read()
876 packet->server_status = uint2korr(p); in php_mysqlnd_ok_read()
877 p+= 2; in php_mysqlnd_ok_read()
880 packet->warning_count = uint2korr(p); in php_mysqlnd_ok_read()
881 p+= 2; in php_mysqlnd_ok_read()
885 if (packet->header.size > (size_t) (p - buf) && (i = php_mysqlnd_net_field_length(&p))) { in php_mysqlnd_ok_read()
886 packet->message_len = MIN(i, buf_len - (p - begin)); in php_mysqlnd_ok_read()
887 packet->message = mnd_pestrndup((char *)p, packet->message_len, FALSE); in php_mysqlnd_ok_read()
901 DBG_ERR_FMT("OK packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_ok_read()
903 p - begin - packet->header.size); in php_mysqlnd_ok_read()
913 MYSQLND_PACKET_OK *p= (MYSQLND_PACKET_OK *) _packet; in php_mysqlnd_ok_free_mem() local
914 if (p->message) { in php_mysqlnd_ok_free_mem()
915 mnd_efree(p->message); in php_mysqlnd_ok_free_mem()
916 p->message = NULL; in php_mysqlnd_ok_free_mem()
919 mnd_pefree(p, p->header.persistent); in php_mysqlnd_ok_free_mem()
938 zend_uchar *p = buf; in php_mysqlnd_eof_read() local
947 packet->field_count = uint1korr(p); in php_mysqlnd_eof_read()
948 p++; in php_mysqlnd_eof_read()
952 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_eof_read()
965 packet->warning_count = uint2korr(p); in php_mysqlnd_eof_read()
966 p+= 2; in php_mysqlnd_eof_read()
969 packet->server_status = uint2korr(p); in php_mysqlnd_eof_read()
970 p+= 2; in php_mysqlnd_eof_read()
984 DBG_ERR_FMT("EOF packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_eof_read()
986 p - begin - packet->header.size); in php_mysqlnd_eof_read()
1037 zend_uchar *tmp, *p; in php_mysqlnd_cmd_write() local
1042 p = tmp + MYSQLND_HEADER_SIZE; /* skip the header */ in php_mysqlnd_cmd_write()
1044 int1store(p, packet->command); in php_mysqlnd_cmd_write()
1045 p++; in php_mysqlnd_cmd_write()
1047 memcpy(p, packet->argument, packet->arg_len); in php_mysqlnd_cmd_write()
1073 MYSQLND_PACKET_COMMAND * p = (MYSQLND_PACKET_COMMAND *) _packet; in php_mysqlnd_cmd_free_mem() local
1074 mnd_pefree(p, p->header.persistent); in php_mysqlnd_cmd_free_mem()
1087 zend_uchar *p = buf; in php_mysqlnd_rset_header_read() local
1101 if (ERROR_MARKER == *p) { in php_mysqlnd_rset_header_read()
1103 p++; in php_mysqlnd_rset_header_read()
1105 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_rset_header_read()
1113 packet->field_count = php_mysqlnd_net_field_length(&p); in php_mysqlnd_rset_header_read()
1129 memcpy(packet->info_or_local_file, p, len); in php_mysqlnd_rset_header_read()
1139 packet->affected_rows = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_rset_header_read()
1142 packet->last_insert_id = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_rset_header_read()
1145 packet->server_status = uint2korr(p); in php_mysqlnd_rset_header_read()
1146 p+=2; in php_mysqlnd_rset_header_read()
1149 packet->warning_count = uint2korr(p); in php_mysqlnd_rset_header_read()
1150 p+=2; in php_mysqlnd_rset_header_read()
1153 if (packet->header.size > (size_t) (p - buf) && (len = php_mysqlnd_net_field_length(&p))) { in php_mysqlnd_rset_header_read()
1156 memcpy(packet->info_or_local_file, p, len); in php_mysqlnd_rset_header_read()
1177 DBG_ERR_FMT("RSET_HEADER packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_rset_header_read()
1179 p - begin - packet->header.size); in php_mysqlnd_rset_header_read()
1189 MYSQLND_PACKET_RSET_HEADER *p= (MYSQLND_PACKET_RSET_HEADER *) _packet; in php_mysqlnd_rset_header_free_mem() local
1191 if (p->info_or_local_file) { in php_mysqlnd_rset_header_free_mem()
1192 mnd_efree(p->info_or_local_file); in php_mysqlnd_rset_header_free_mem()
1193 p->info_or_local_file = NULL; in php_mysqlnd_rset_header_free_mem()
1196 mnd_pefree(p, p->header.persistent); in php_mysqlnd_rset_header_free_mem()
1227 zend_uchar *p = buf; in php_mysqlnd_rset_field_read() local
1243 if (ERROR_MARKER == *p) { in php_mysqlnd_rset_field_read()
1245 p++; in php_mysqlnd_rset_field_read()
1247 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_rset_field_read()
1253 } else if (EODATA_MARKER == *p && packet->header.size < 8) { in php_mysqlnd_rset_field_read()
1263 len = php_mysqlnd_net_field_length(&p); in php_mysqlnd_rset_field_read()
1273 *(const char **)(((char *)meta) + rset_field_offsets[i]) = (const char *)p; in php_mysqlnd_rset_field_read()
1275 p += len; in php_mysqlnd_rset_field_read()
1283 if (12 != *p) { in php_mysqlnd_rset_field_read()
1284 DBG_ERR_FMT("Protocol error. Server sent false length. Expected 12 got %d", (int) *p); in php_mysqlnd_rset_field_read()
1288 p++; in php_mysqlnd_rset_field_read()
1291 meta->charsetnr = uint2korr(p); in php_mysqlnd_rset_field_read()
1292 p += 2; in php_mysqlnd_rset_field_read()
1295 meta->length = uint4korr(p); in php_mysqlnd_rset_field_read()
1296 p += 4; in php_mysqlnd_rset_field_read()
1299 meta->type = uint1korr(p); in php_mysqlnd_rset_field_read()
1300 p += 1; in php_mysqlnd_rset_field_read()
1303 meta->flags = uint2korr(p); in php_mysqlnd_rset_field_read()
1304 p += 2; in php_mysqlnd_rset_field_read()
1307 meta->decimals = uint1korr(p); in php_mysqlnd_rset_field_read()
1308 p += 1; in php_mysqlnd_rset_field_read()
1312 p +=2; in php_mysqlnd_rset_field_read()
1330 if (packet->header.size > (size_t) (p - buf) && in php_mysqlnd_rset_field_read()
1331 (len = php_mysqlnd_net_field_length(&p)) && in php_mysqlnd_rset_field_read()
1341 memcpy(meta->def, p, len); in php_mysqlnd_rset_field_read()
1344 p += len; in php_mysqlnd_rset_field_read()
1412 DBG_ERR_FMT("RSET field packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_rset_field_read()
1414 "shorter than expected", p - begin - packet->header.size); in php_mysqlnd_rset_field_read()
1424 MYSQLND_PACKET_RES_FIELD *p = (MYSQLND_PACKET_RES_FIELD *) _packet; in php_mysqlnd_rset_field_free_mem() local
1427 mnd_pefree(p, p->header.persistent); in php_mysqlnd_rset_field_free_mem()
1442 zend_uchar * p = NULL; in php_mysqlnd_read_row_ex() local
1478 p = (*buffer)->ptr; in php_mysqlnd_read_row_ex()
1494 p = (*buffer)->ptr + (*data_size - header.size); in php_mysqlnd_read_row_ex()
1497 …if (PASS != (ret = conn->net->data->m.receive_ex(conn->net, p, header.size, conn->stats, conn->err… in php_mysqlnd_read_row_ex()
1523 zend_uchar *p = row_buffer->ptr; in php_mysqlnd_rowp_read_binary_protocol() local
1536 p++; in php_mysqlnd_rowp_read_binary_protocol()
1537 null_ptr= p; in php_mysqlnd_rowp_read_binary_protocol()
1538 p += (field_count + 9)/8; /* skip null bits */ in php_mysqlnd_rowp_read_binary_protocol()
1543 zend_uchar * orig_p = p; in php_mysqlnd_rowp_read_binary_protocol()
1555 mysqlnd_ps_fetch_functions[type].func(current_field, &fields_metadata[i], 0, &p); in php_mysqlnd_rowp_read_binary_protocol()
1593 Z_STRLEN_P(current_field) : (p - orig_p)); in php_mysqlnd_rowp_read_binary_protocol()
1614 zend_uchar * p = row_buffer->ptr; in php_mysqlnd_rowp_read_text_protocol_aux() local
1630 const zend_ulong len = php_mysqlnd_net_field_length(&p); in php_mysqlnd_rowp_read_text_protocol_aux()
1635 } else if ((p + len) > packet_end) { in php_mysqlnd_rowp_read_text_protocol_aux()
1637 " bytes after end of packet", (p + len) - packet_end - 1); in php_mysqlnd_rowp_read_text_protocol_aux()
1681 zend_uchar save = *(p + len); in php_mysqlnd_rowp_read_text_protocol_aux()
1683 *(p + len) = '\0'; in php_mysqlnd_rowp_read_text_protocol_aux()
1688 atoll((char *) p); in php_mysqlnd_rowp_read_text_protocol_aux()
1690 _atoi64((char *) p); in php_mysqlnd_rowp_read_text_protocol_aux()
1696 (uint64_t) atoll((char *) p); in php_mysqlnd_rowp_read_text_protocol_aux()
1698 (uint64_t) _atoi64((char *) p); in php_mysqlnd_rowp_read_text_protocol_aux()
1712 ZVAL_STRINGL(current_field, (char *)p, len); in php_mysqlnd_rowp_read_text_protocol_aux()
1717 *(p + len) = save; in php_mysqlnd_rowp_read_text_protocol_aux()
1719 zend_uchar save = *(p + len); in php_mysqlnd_rowp_read_text_protocol_aux()
1721 *(p + len) = '\0'; in php_mysqlnd_rowp_read_text_protocol_aux()
1722 ZVAL_DOUBLE(current_field, atof((char *) p)); in php_mysqlnd_rowp_read_text_protocol_aux()
1723 *(p + len) = save; in php_mysqlnd_rowp_read_text_protocol_aux()
1737 ps_fetch_from_1_to_8_bytes(current_field, &(fields_metadata[i]), 0, &p, len); in php_mysqlnd_rowp_read_text_protocol_aux()
1742 p -= len; in php_mysqlnd_rowp_read_text_protocol_aux()
1770 ZVAL_STRINGL(current_field, (char *)p, len); in php_mysqlnd_rowp_read_text_protocol_aux()
1772 p += len; in php_mysqlnd_rowp_read_text_protocol_aux()
1817 zend_uchar *p; in php_mysqlnd_rowp_read() local
1853 if (ERROR_MARKER == (*(p = packet->row_buffer->ptr))) { in php_mysqlnd_rowp_read()
1860 php_mysqlnd_read_error_from_line(p + 1, data_size - 1, in php_mysqlnd_rowp_read()
1866 } else if (EODATA_MARKER == *p && data_size < 8) { /* EOF */ in php_mysqlnd_rowp_read()
1868 p++; in php_mysqlnd_rowp_read()
1870 packet->warning_count = uint2korr(p); in php_mysqlnd_rowp_read()
1871 p += 2; in php_mysqlnd_rowp_read()
1872 packet->server_status = uint2korr(p); in php_mysqlnd_rowp_read()
1917 MYSQLND_PACKET_ROW *p; in php_mysqlnd_rowp_free_mem() local
1920 p = (MYSQLND_PACKET_ROW *) _packet; in php_mysqlnd_rowp_free_mem()
1921 if (p->row_buffer) { in php_mysqlnd_rowp_free_mem()
1922 p->row_buffer->free_chunk(p->row_buffer); in php_mysqlnd_rowp_free_mem()
1923 p->row_buffer = NULL; in php_mysqlnd_rowp_free_mem()
1925 DBG_INF_FMT("stack_allocation=%u persistent=%u", (int)stack_allocation, (int)p->header.persistent); in php_mysqlnd_rowp_free_mem()
1934 mnd_pefree(p, p->header.persistent); in php_mysqlnd_rowp_free_mem()
1967 MYSQLND_PACKET_STATS *p= (MYSQLND_PACKET_STATS *) _packet; in php_mysqlnd_stats_free_mem() local
1968 if (p->message) { in php_mysqlnd_stats_free_mem()
1969 mnd_efree(p->message); in php_mysqlnd_stats_free_mem()
1970 p->message = NULL; in php_mysqlnd_stats_free_mem()
1973 mnd_pefree(p, p->header.persistent); in php_mysqlnd_stats_free_mem()
1990 zend_uchar *p = buf; in php_mysqlnd_prepare_read() local
2001 packet->error_code = uint1korr(p); in php_mysqlnd_prepare_read()
2002 p++; in php_mysqlnd_prepare_read()
2006 php_mysqlnd_read_error_from_line(p, data_size - 1, in php_mysqlnd_prepare_read()
2023 packet->stmt_id = uint4korr(p); in php_mysqlnd_prepare_read()
2024 p += 4; in php_mysqlnd_prepare_read()
2028 packet->field_count = uint2korr(p); in php_mysqlnd_prepare_read()
2029 p += 2; in php_mysqlnd_prepare_read()
2032 packet->param_count = uint2korr(p); in php_mysqlnd_prepare_read()
2033 p += 2; in php_mysqlnd_prepare_read()
2038 p++; in php_mysqlnd_prepare_read()
2041 packet->warning_count = uint2korr(p); in php_mysqlnd_prepare_read()
2051 DBG_ERR_FMT("PREPARE packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_prepare_read()
2053 p - begin - packet->header.size); in php_mysqlnd_prepare_read()
2063 MYSQLND_PACKET_PREPARE_RESPONSE *p= (MYSQLND_PACKET_PREPARE_RESPONSE *) _packet; in php_mysqlnd_prepare_free_mem() local
2065 mnd_pefree(p, p->header.persistent); in php_mysqlnd_prepare_free_mem()
2078 zend_uchar *p = buf; in php_mysqlnd_chg_user_read() local
2093 packet->response_code = uint1korr(p); in php_mysqlnd_chg_user_read()
2094 p++; in php_mysqlnd_chg_user_read()
2103 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_chg_user_read()
2111 if (packet->response_code == 0xFE && packet->header.size > (size_t) (p - buf)) { in php_mysqlnd_chg_user_read()
2112 packet->new_auth_protocol = mnd_pestrdup((char *)p, FALSE); in php_mysqlnd_chg_user_read()
2114 p+= packet->new_auth_protocol_len + 1; /* +1 for the \0 */ in php_mysqlnd_chg_user_read()
2115 packet->new_auth_protocol_data_len = packet->header.size - (size_t) (p - buf); in php_mysqlnd_chg_user_read()
2118 memcpy(packet->new_auth_protocol_data, p, packet->new_auth_protocol_data_len); in php_mysqlnd_chg_user_read()
2126 DBG_ERR_FMT("CHANGE_USER packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_chg_user_read()
2128 p - begin - packet->header.size); in php_mysqlnd_chg_user_read()
2138 MYSQLND_PACKET_CHG_USER_RESPONSE * p = (MYSQLND_PACKET_CHG_USER_RESPONSE *) _packet; in php_mysqlnd_chg_user_free_mem() local
2140 if (p->new_auth_protocol) { in php_mysqlnd_chg_user_free_mem()
2141 mnd_efree(p->new_auth_protocol); in php_mysqlnd_chg_user_free_mem()
2142 p->new_auth_protocol = NULL; in php_mysqlnd_chg_user_free_mem()
2144 p->new_auth_protocol_len = 0; in php_mysqlnd_chg_user_free_mem()
2146 if (p->new_auth_protocol_data) { in php_mysqlnd_chg_user_free_mem()
2147 mnd_efree(p->new_auth_protocol_data); in php_mysqlnd_chg_user_free_mem()
2148 p->new_auth_protocol_data = NULL; in php_mysqlnd_chg_user_free_mem()
2150 p->new_auth_protocol_data_len = 0; in php_mysqlnd_chg_user_free_mem()
2153 mnd_pefree(p, p->header.persistent); in php_mysqlnd_chg_user_free_mem()
2181 MYSQLND_PACKET_SHA256_PK_REQUEST * p = (MYSQLND_PACKET_SHA256_PK_REQUEST *) _packet; in php_mysqlnd_sha256_pk_request_free_mem() local
2182 mnd_pefree(p, p->header.persistent); in php_mysqlnd_sha256_pk_request_free_mem()
2195 zend_uchar *p = buf; in php_mysqlnd_sha256_pk_request_response_read() local
2205 p++; in php_mysqlnd_sha256_pk_request_response_read()
2208 packet->public_key_len = packet->header.size - (p - buf); in php_mysqlnd_sha256_pk_request_response_read()
2210 memcpy(packet->public_key, p, packet->public_key_len); in php_mysqlnd_sha256_pk_request_response_read()
2216 DBG_ERR_FMT("OK packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_sha256_pk_request_response_read()
2218 p - begin - packet->header.size); in php_mysqlnd_sha256_pk_request_response_read()
2228 …MYSQLND_PACKET_SHA256_PK_REQUEST_RESPONSE * p = (MYSQLND_PACKET_SHA256_PK_REQUEST_RESPONSE *) _pac… in php_mysqlnd_sha256_pk_request_response_free_mem() local
2229 if (p->public_key) { in php_mysqlnd_sha256_pk_request_response_free_mem()
2230 mnd_efree(p->public_key); in php_mysqlnd_sha256_pk_request_response_free_mem()
2231 p->public_key = NULL; in php_mysqlnd_sha256_pk_request_response_free_mem()
2233 p->public_key_len = 0; in php_mysqlnd_sha256_pk_request_response_free_mem()
2236 mnd_pefree(p, p->header.persistent); in php_mysqlnd_sha256_pk_request_response_free_mem()