Lines Matching refs:p

65 	if ((size_t)(p - begin) > packet->header.size) { \
134 register zend_uchar *p= (zend_uchar *)*packet; in php_mysqlnd_net_field_length() local
136 if (*p < 251) { in php_mysqlnd_net_field_length()
138 return (unsigned long) *p; in php_mysqlnd_net_field_length()
141 switch (*p) { in php_mysqlnd_net_field_length()
147 return (unsigned long) uint2korr(p+1); in php_mysqlnd_net_field_length()
150 return (unsigned long) uint3korr(p+1); in php_mysqlnd_net_field_length()
153 return (unsigned long) uint4korr(p+1); in php_mysqlnd_net_field_length()
164 register zend_uchar *p= (zend_uchar *)*packet; in php_mysqlnd_net_field_length_ll() local
166 if (*p < 251) { in php_mysqlnd_net_field_length_ll()
168 return (uint64_t) *p; in php_mysqlnd_net_field_length_ll()
171 switch (*p) { in php_mysqlnd_net_field_length_ll()
177 return (uint64_t) uint2korr(p + 1); in php_mysqlnd_net_field_length_ll()
180 return (uint64_t) uint3korr(p + 1); in php_mysqlnd_net_field_length_ll()
183 return (uint64_t) uint8korr(p + 1); in php_mysqlnd_net_field_length_ll()
240 zend_uchar *p = buf; in php_mysqlnd_read_error_from_line() local
249 *error_no = uint2korr(p); in php_mysqlnd_read_error_from_line()
250 p+= 2; in php_mysqlnd_read_error_from_line()
255 if (*p == '#') { in php_mysqlnd_read_error_from_line()
256 ++p; in php_mysqlnd_read_error_from_line()
257 if ((buf_len - (p - buf)) >= MYSQLND_SQLSTATE_LENGTH) { in php_mysqlnd_read_error_from_line()
258 memcpy(sqlstate, p, MYSQLND_SQLSTATE_LENGTH); in php_mysqlnd_read_error_from_line()
259 p+= MYSQLND_SQLSTATE_LENGTH; in php_mysqlnd_read_error_from_line()
264 if ((buf_len - (p - buf)) > 0) { in php_mysqlnd_read_error_from_line()
265 error_msg_len = MIN((int)((buf_len - (p - buf))), (int) (error_buf_len - 1)); in php_mysqlnd_read_error_from_line()
266 memcpy(error, p, error_msg_len); in php_mysqlnd_read_error_from_line()
326 zend_uchar *p = buf; in php_mysqlnd_greet_read() local
347 packet->protocol_version = uint1korr(p); in php_mysqlnd_greet_read()
348 p++; in php_mysqlnd_greet_read()
352 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_greet_read()
367 packet->server_version = estrdup((char *)p); in php_mysqlnd_greet_read()
368 p+= strlen(packet->server_version) + 1; /* eat the '\0' */ in php_mysqlnd_greet_read()
371 packet->thread_id = uint4korr(p); in php_mysqlnd_greet_read()
372 p+=4; in php_mysqlnd_greet_read()
375 memcpy(packet->auth_plugin_data, p, SCRAMBLE_LENGTH_323); in php_mysqlnd_greet_read()
376 p+= SCRAMBLE_LENGTH_323; in php_mysqlnd_greet_read()
380 p++; in php_mysqlnd_greet_read()
383 packet->server_capabilities = uint2korr(p); in php_mysqlnd_greet_read()
384 p+= 2; in php_mysqlnd_greet_read()
387 packet->charset_no = uint1korr(p); in php_mysqlnd_greet_read()
388 p++; in php_mysqlnd_greet_read()
391 packet->server_status = uint2korr(p); in php_mysqlnd_greet_read()
392 p+= 2; in php_mysqlnd_greet_read()
396 pad_start = p; in php_mysqlnd_greet_read()
397 p+= 13; in php_mysqlnd_greet_read()
400 if ((size_t) (p - buf) < packet->header.size) { in php_mysqlnd_greet_read()
402 memcpy(packet->auth_plugin_data + SCRAMBLE_LENGTH_323, p, SCRAMBLE_LENGTH - SCRAMBLE_LENGTH_323); in php_mysqlnd_greet_read()
403 p+= SCRAMBLE_LENGTH - SCRAMBLE_LENGTH_323; in php_mysqlnd_greet_read()
404 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()
410 if ((size_t) (p - buf) < packet->header.size) { in php_mysqlnd_greet_read()
412 p--; in php_mysqlnd_greet_read()
427 … memcpy(new_auth_plugin_data + SCRAMBLE_LENGTH, p, packet->auth_plugin_data_len - SCRAMBLE_LENGTH); in php_mysqlnd_greet_read()
428 p+= (packet->auth_plugin_data_len - SCRAMBLE_LENGTH); in php_mysqlnd_greet_read()
436 packet->auth_protocol = estrdup((char *)p); in php_mysqlnd_greet_read()
437 p+= strlen(packet->auth_protocol) + 1; /* eat the '\0' */ in php_mysqlnd_greet_read()
449 DBG_ERR_FMT("GREET packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_greet_read()
451 p - begin - packet->header.size); in php_mysqlnd_greet_read()
461 MYSQLND_PACKET_GREET *p= (MYSQLND_PACKET_GREET *) _packet; in php_mysqlnd_greet_free_mem() local
462 if (p->server_version) { in php_mysqlnd_greet_free_mem()
463 efree(p->server_version); in php_mysqlnd_greet_free_mem()
464 p->server_version = NULL; in php_mysqlnd_greet_free_mem()
466 if (p->auth_plugin_data && p->auth_plugin_data != p->intern_auth_plugin_data) { in php_mysqlnd_greet_free_mem()
467 efree(p->auth_plugin_data); in php_mysqlnd_greet_free_mem()
468 p->auth_plugin_data = NULL; in php_mysqlnd_greet_free_mem()
470 if (p->auth_protocol) { in php_mysqlnd_greet_free_mem()
471 efree(p->auth_protocol); in php_mysqlnd_greet_free_mem()
472 p->auth_protocol = NULL; in php_mysqlnd_greet_free_mem()
475 mnd_pefree(p, p->header.persistent); in php_mysqlnd_greet_free_mem()
488 zend_uchar *p = buffer + MYSQLND_HEADER_SIZE; /* start after the header */ in php_mysqlnd_auth_write() local
495 int4store(p, packet->client_flags); in php_mysqlnd_auth_write()
496 p+= 4; in php_mysqlnd_auth_write()
498 int4store(p, packet->max_packet_size); in php_mysqlnd_auth_write()
499 p+= 4; in php_mysqlnd_auth_write()
501 int1store(p, packet->charset_no); in php_mysqlnd_auth_write()
502 p++; in php_mysqlnd_auth_write()
504 memset(p, 0, 23); /* filler */ in php_mysqlnd_auth_write()
505 p+= 23; in php_mysqlnd_auth_write()
510 memcpy(p, packet->user, len); in php_mysqlnd_auth_write()
511 p+= len; in php_mysqlnd_auth_write()
512 *p++ = '\0'; in php_mysqlnd_auth_write()
526 int1store(p, packet->auth_data_len); in php_mysqlnd_auth_write()
527 ++p; in php_mysqlnd_auth_write()
529 if ((sizeof(buffer) - (p - buffer)) < packet->auth_data_len) { in php_mysqlnd_auth_write()
534 memcpy(p, packet->auth_data, packet->auth_data_len); in php_mysqlnd_auth_write()
535 p+= packet->auth_data_len; in php_mysqlnd_auth_write()
541 memcpy(p, packet->db, real_db_len); in php_mysqlnd_auth_write()
542 p+= real_db_len; in php_mysqlnd_auth_write()
543 *p++= '\0'; in php_mysqlnd_auth_write()
545 *p++= '\0'; in php_mysqlnd_auth_write()
551 int2store(p, packet->charset_no); in php_mysqlnd_auth_write()
552 p+= 2; in php_mysqlnd_auth_write()
557 size_t len = MIN(strlen(packet->auth_plugin_name), sizeof(buffer) - (p - buffer) - 1); in php_mysqlnd_auth_write()
558 memcpy(p, packet->auth_plugin_name, len); in php_mysqlnd_auth_write()
559 p+= len; in php_mysqlnd_auth_write()
560 *p++= '\0'; in php_mysqlnd_auth_write()
583 …if ((sizeof(buffer) - (p - buffer)) >= (ca_payload_len + php_mysqlnd_net_store_length_size(ca_payl… in php_mysqlnd_auth_write()
584 p = php_mysqlnd_net_store_length(p, ca_payload_len); in php_mysqlnd_auth_write()
594 p = php_mysqlnd_net_store_length(p, s_len); in php_mysqlnd_auth_write()
595 memcpy(p, s_key, s_len); in php_mysqlnd_auth_write()
596 p+= s_len; in php_mysqlnd_auth_write()
598 p = php_mysqlnd_net_store_length(p, value_len); in php_mysqlnd_auth_write()
599 memcpy(p, *entry_value, value_len); in php_mysqlnd_auth_write()
600 p+= value_len; in php_mysqlnd_auth_write()
610 …if (PASS != conn->m->simple_command(conn, COM_CHANGE_USER, buffer + MYSQLND_HEADER_SIZE, p - buffe… in php_mysqlnd_auth_write()
615 DBG_RETURN(p - buffer - MYSQLND_HEADER_SIZE); in php_mysqlnd_auth_write()
617 …size_t sent = conn->net->data->m.send_ex(conn->net, buffer, p - buffer - MYSQLND_HEADER_SIZE, conn… in php_mysqlnd_auth_write()
632 MYSQLND_PACKET_AUTH * p = (MYSQLND_PACKET_AUTH *) _packet; in php_mysqlnd_auth_free_mem() local
633 mnd_pefree(p, p->header.persistent); in php_mysqlnd_auth_free_mem()
648 zend_uchar *p = buf; in php_mysqlnd_auth_response_read() local
667 packet->response_code = uint1korr(p); in php_mysqlnd_auth_response_read()
668 p++; in php_mysqlnd_auth_response_read()
672 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_auth_response_read()
680 if (packet->header.size > (size_t) (p - buf)) { in php_mysqlnd_auth_response_read()
681 packet->new_auth_protocol = mnd_pestrdup((char *)p, FALSE); in php_mysqlnd_auth_response_read()
683 p+= packet->new_auth_protocol_len + 1; /* +1 for the \0 */ in php_mysqlnd_auth_response_read()
685 packet->new_auth_protocol_data_len = packet->header.size - (size_t) (p - buf); in php_mysqlnd_auth_response_read()
688 memcpy(packet->new_auth_protocol_data, p, packet->new_auth_protocol_data_len); in php_mysqlnd_auth_response_read()
695 packet->affected_rows = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_auth_response_read()
698 packet->last_insert_id = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_auth_response_read()
701 packet->server_status = uint2korr(p); in php_mysqlnd_auth_response_read()
702 p+= 2; in php_mysqlnd_auth_response_read()
705 packet->warning_count = uint2korr(p); in php_mysqlnd_auth_response_read()
706 p+= 2; in php_mysqlnd_auth_response_read()
710 if (packet->header.size > (size_t) (p - buf) && (i = php_mysqlnd_net_field_length(&p))) { in php_mysqlnd_auth_response_read()
711 packet->message_len = MIN(i, buf_len - (p - begin)); in php_mysqlnd_auth_response_read()
712 packet->message = mnd_pestrndup((char *)p, packet->message_len, FALSE); in php_mysqlnd_auth_response_read()
725 DBG_ERR_FMT("OK packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_auth_response_read()
727 p - begin - packet->header.size); in php_mysqlnd_auth_response_read()
737 MYSQLND_PACKET_AUTH_RESPONSE * p = (MYSQLND_PACKET_AUTH_RESPONSE *) _packet; in php_mysqlnd_auth_response_free_mem() local
738 if (p->message) { in php_mysqlnd_auth_response_free_mem()
739 mnd_efree(p->message); in php_mysqlnd_auth_response_free_mem()
740 p->message = NULL; in php_mysqlnd_auth_response_free_mem()
742 if (p->new_auth_protocol) { in php_mysqlnd_auth_response_free_mem()
743 mnd_efree(p->new_auth_protocol); in php_mysqlnd_auth_response_free_mem()
744 p->new_auth_protocol = NULL; in php_mysqlnd_auth_response_free_mem()
746 p->new_auth_protocol_len = 0; in php_mysqlnd_auth_response_free_mem()
748 if (p->new_auth_protocol_data) { in php_mysqlnd_auth_response_free_mem()
749 mnd_efree(p->new_auth_protocol_data); in php_mysqlnd_auth_response_free_mem()
750 p->new_auth_protocol_data = NULL; in php_mysqlnd_auth_response_free_mem()
752 p->new_auth_protocol_data_len = 0; in php_mysqlnd_auth_response_free_mem()
755 mnd_pefree(p, p->header.persistent); in php_mysqlnd_auth_response_free_mem()
767 zend_uchar *p = buffer + MYSQLND_HEADER_SIZE; /* start after the header */ in php_mysqlnd_change_auth_response_write() local
772 memcpy(p, packet->auth_data, packet->auth_data_len); in php_mysqlnd_change_auth_response_write()
773 p+= packet->auth_data_len; in php_mysqlnd_change_auth_response_write()
777 …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()
795 MYSQLND_PACKET_CHANGE_AUTH_RESPONSE * p = (MYSQLND_PACKET_CHANGE_AUTH_RESPONSE *) _packet; in php_mysqlnd_change_auth_response_free_mem() local
796 mnd_pefree(p, p->header.persistent); in php_mysqlnd_change_auth_response_free_mem()
811 zend_uchar *p = buf; in php_mysqlnd_ok_read() local
822 packet->field_count = uint1korr(p); in php_mysqlnd_ok_read()
823 p++; in php_mysqlnd_ok_read()
827 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_ok_read()
835 packet->affected_rows = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_ok_read()
838 packet->last_insert_id = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_ok_read()
841 packet->server_status = uint2korr(p); in php_mysqlnd_ok_read()
842 p+= 2; in php_mysqlnd_ok_read()
845 packet->warning_count = uint2korr(p); in php_mysqlnd_ok_read()
846 p+= 2; in php_mysqlnd_ok_read()
850 if (packet->header.size > (size_t) (p - buf) && (i = php_mysqlnd_net_field_length(&p))) { in php_mysqlnd_ok_read()
851 packet->message_len = MIN(i, buf_len - (p - begin)); in php_mysqlnd_ok_read()
852 packet->message = mnd_pestrndup((char *)p, packet->message_len, FALSE); in php_mysqlnd_ok_read()
866 DBG_ERR_FMT("OK packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_ok_read()
868 p - begin - packet->header.size); in php_mysqlnd_ok_read()
878 MYSQLND_PACKET_OK *p= (MYSQLND_PACKET_OK *) _packet; in php_mysqlnd_ok_free_mem() local
879 if (p->message) { in php_mysqlnd_ok_free_mem()
880 mnd_efree(p->message); in php_mysqlnd_ok_free_mem()
881 p->message = NULL; in php_mysqlnd_ok_free_mem()
884 mnd_pefree(p, p->header.persistent); in php_mysqlnd_ok_free_mem()
903 zend_uchar *p = buf; in php_mysqlnd_eof_read() local
912 packet->field_count = uint1korr(p); in php_mysqlnd_eof_read()
913 p++; in php_mysqlnd_eof_read()
917 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_eof_read()
930 packet->warning_count = uint2korr(p); in php_mysqlnd_eof_read()
931 p+= 2; in php_mysqlnd_eof_read()
934 packet->server_status = uint2korr(p); in php_mysqlnd_eof_read()
935 p+= 2; in php_mysqlnd_eof_read()
949 DBG_ERR_FMT("EOF packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_eof_read()
951 p - begin - packet->header.size); in php_mysqlnd_eof_read()
1002 zend_uchar *tmp, *p; in php_mysqlnd_cmd_write() local
1007 p = tmp + MYSQLND_HEADER_SIZE; /* skip the header */ in php_mysqlnd_cmd_write()
1009 int1store(p, packet->command); in php_mysqlnd_cmd_write()
1010 p++; in php_mysqlnd_cmd_write()
1012 memcpy(p, packet->argument, packet->arg_len); in php_mysqlnd_cmd_write()
1038 MYSQLND_PACKET_COMMAND * p = (MYSQLND_PACKET_COMMAND *) _packet; in php_mysqlnd_cmd_free_mem() local
1039 mnd_pefree(p, p->header.persistent); in php_mysqlnd_cmd_free_mem()
1052 zend_uchar *p = buf; in php_mysqlnd_rset_header_read() local
1066 if (ERROR_MARKER == *p) { in php_mysqlnd_rset_header_read()
1068 p++; in php_mysqlnd_rset_header_read()
1070 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_rset_header_read()
1078 packet->field_count = php_mysqlnd_net_field_length(&p); in php_mysqlnd_rset_header_read()
1094 memcpy(packet->info_or_local_file, p, len); in php_mysqlnd_rset_header_read()
1104 packet->affected_rows = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_rset_header_read()
1107 packet->last_insert_id = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_rset_header_read()
1110 packet->server_status = uint2korr(p); in php_mysqlnd_rset_header_read()
1111 p+=2; in php_mysqlnd_rset_header_read()
1114 packet->warning_count = uint2korr(p); in php_mysqlnd_rset_header_read()
1115 p+=2; in php_mysqlnd_rset_header_read()
1118 if (packet->header.size > (size_t) (p - buf) && (len = php_mysqlnd_net_field_length(&p))) { in php_mysqlnd_rset_header_read()
1121 memcpy(packet->info_or_local_file, p, len); in php_mysqlnd_rset_header_read()
1142 DBG_ERR_FMT("RSET_HEADER packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_rset_header_read()
1144 p - begin - packet->header.size); in php_mysqlnd_rset_header_read()
1154 MYSQLND_PACKET_RSET_HEADER *p= (MYSQLND_PACKET_RSET_HEADER *) _packet; in php_mysqlnd_rset_header_free_mem() local
1156 if (p->info_or_local_file) { in php_mysqlnd_rset_header_free_mem()
1157 mnd_efree(p->info_or_local_file); in php_mysqlnd_rset_header_free_mem()
1158 p->info_or_local_file = NULL; in php_mysqlnd_rset_header_free_mem()
1161 mnd_pefree(p, p->header.persistent); in php_mysqlnd_rset_header_free_mem()
1192 zend_uchar *p = buf; in php_mysqlnd_rset_field_read() local
1208 if (ERROR_MARKER == *p) { in php_mysqlnd_rset_field_read()
1210 p++; in php_mysqlnd_rset_field_read()
1212 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_rset_field_read()
1218 } else if (EODATA_MARKER == *p && packet->header.size < 8) { in php_mysqlnd_rset_field_read()
1228 len = php_mysqlnd_net_field_length(&p); in php_mysqlnd_rset_field_read()
1238 *(const char **)(((char *)meta) + rset_field_offsets[i]) = (const char *)p; in php_mysqlnd_rset_field_read()
1240 p += len; in php_mysqlnd_rset_field_read()
1248 if (12 != *p) { in php_mysqlnd_rset_field_read()
1249 DBG_ERR_FMT("Protocol error. Server sent false length. Expected 12 got %d", (int) *p); in php_mysqlnd_rset_field_read()
1252 p++; in php_mysqlnd_rset_field_read()
1255 meta->charsetnr = uint2korr(p); in php_mysqlnd_rset_field_read()
1256 p += 2; in php_mysqlnd_rset_field_read()
1259 meta->length = uint4korr(p); in php_mysqlnd_rset_field_read()
1260 p += 4; in php_mysqlnd_rset_field_read()
1263 meta->type = uint1korr(p); in php_mysqlnd_rset_field_read()
1264 p += 1; in php_mysqlnd_rset_field_read()
1267 meta->flags = uint2korr(p); in php_mysqlnd_rset_field_read()
1268 p += 2; in php_mysqlnd_rset_field_read()
1271 meta->decimals = uint1korr(p); in php_mysqlnd_rset_field_read()
1272 p += 1; in php_mysqlnd_rset_field_read()
1276 p +=2; in php_mysqlnd_rset_field_read()
1294 if (packet->header.size > (size_t) (p - buf) && in php_mysqlnd_rset_field_read()
1295 (len = php_mysqlnd_net_field_length(&p)) && in php_mysqlnd_rset_field_read()
1305 memcpy(meta->def, p, len); in php_mysqlnd_rset_field_read()
1308 p += len; in php_mysqlnd_rset_field_read()
1373 DBG_ERR_FMT("RSET field packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_rset_field_read()
1375 "shorter than expected", p - begin - packet->header.size); in php_mysqlnd_rset_field_read()
1385 MYSQLND_PACKET_RES_FIELD *p= (MYSQLND_PACKET_RES_FIELD *) _packet; in php_mysqlnd_rset_field_free_mem() local
1388 mnd_pefree(p, p->header.persistent); in php_mysqlnd_rset_field_free_mem()
1403 zend_uchar * p = NULL; in php_mysqlnd_read_row_ex() local
1436 p = (*buffer)->ptr; in php_mysqlnd_read_row_ex()
1455 p = (*buffer)->ptr + (*data_size - header.size); in php_mysqlnd_read_row_ex()
1458 …if (PASS != (ret = conn->net->data->m.receive_ex(conn->net, p, header.size, conn->stats, conn->err… in php_mysqlnd_read_row_ex()
1485 zend_uchar * p = row_buffer->ptr; in php_mysqlnd_rowp_read_binary_protocol() local
1498 p++; in php_mysqlnd_rowp_read_binary_protocol()
1499 null_ptr= p; in php_mysqlnd_rowp_read_binary_protocol()
1500 p += (field_count + 9)/8; /* skip null bits */ in php_mysqlnd_rowp_read_binary_protocol()
1513 zend_uchar * orig_p = p; in php_mysqlnd_rowp_read_binary_protocol()
1525 mysqlnd_ps_fetch_functions[type].func(*current_field, &fields_metadata[i], 0, &p TSRMLS_CC); in php_mysqlnd_rowp_read_binary_protocol()
1563 Z_STRLEN_PP(current_field) : (p - orig_p)); in php_mysqlnd_rowp_read_binary_protocol()
1585 zend_uchar * p = row_buffer->ptr; in php_mysqlnd_rowp_read_text_protocol_aux() local
1608 zend_uchar *this_field_len_pos = p; in php_mysqlnd_rowp_read_text_protocol_aux()
1610 const unsigned long len = php_mysqlnd_net_field_length(&p); in php_mysqlnd_rowp_read_text_protocol_aux()
1612 if (len != MYSQLND_NULL_LENGTH && ((p + len) > packet_end)) { in php_mysqlnd_rowp_read_text_protocol_aux()
1614 " bytes after end of packet", (p + len) - packet_end - 1); in php_mysqlnd_rowp_read_text_protocol_aux()
1679 zend_uchar save = *(p + len); in php_mysqlnd_rowp_read_text_protocol_aux()
1681 *(p + len) = '\0'; in php_mysqlnd_rowp_read_text_protocol_aux()
1686 atoll((char *) p); in php_mysqlnd_rowp_read_text_protocol_aux()
1688 _atoi64((char *) p); in php_mysqlnd_rowp_read_text_protocol_aux()
1694 (uint64_t) atoll((char *) p); in php_mysqlnd_rowp_read_text_protocol_aux()
1696 (uint64_t) _atoi64((char *) p); in php_mysqlnd_rowp_read_text_protocol_aux()
1710 ZVAL_STRINGL(*current_field, (char *)p, len, 0); in php_mysqlnd_rowp_read_text_protocol_aux()
1715 *(p + len) = save; in php_mysqlnd_rowp_read_text_protocol_aux()
1717 zend_uchar save = *(p + len); in php_mysqlnd_rowp_read_text_protocol_aux()
1719 *(p + len) = '\0'; in php_mysqlnd_rowp_read_text_protocol_aux()
1720 ZVAL_DOUBLE(*current_field, atof((char *) p)); in php_mysqlnd_rowp_read_text_protocol_aux()
1721 *(p + len) = save; in php_mysqlnd_rowp_read_text_protocol_aux()
1735 ps_fetch_from_1_to_8_bytes(*current_field, &(fields_metadata[i]), 0, &p, len TSRMLS_CC); in php_mysqlnd_rowp_read_text_protocol_aux()
1740 p -= len; in php_mysqlnd_rowp_read_text_protocol_aux()
1752 ZVAL_STRINGL(*current_field, (char *)p, len, copy_data); in php_mysqlnd_rowp_read_text_protocol_aux()
1754 p += len; in php_mysqlnd_rowp_read_text_protocol_aux()
1806 zend_uchar *p; in php_mysqlnd_rowp_read() local
1834 if (ERROR_MARKER == (*(p = packet->row_buffer->ptr))) { in php_mysqlnd_rowp_read()
1841 php_mysqlnd_read_error_from_line(p + 1, data_size - 1, in php_mysqlnd_rowp_read()
1847 } else if (EODATA_MARKER == *p && data_size < 8) { /* EOF */ in php_mysqlnd_rowp_read()
1849 p++; in php_mysqlnd_rowp_read()
1851 packet->warning_count = uint2korr(p); in php_mysqlnd_rowp_read()
1852 p += 2; in php_mysqlnd_rowp_read()
1853 packet->server_status = uint2korr(p); in php_mysqlnd_rowp_read()
1898 MYSQLND_PACKET_ROW *p; in php_mysqlnd_rowp_free_mem() local
1901 p = (MYSQLND_PACKET_ROW *) _packet; in php_mysqlnd_rowp_free_mem()
1902 if (p->row_buffer) { in php_mysqlnd_rowp_free_mem()
1903 p->row_buffer->free_chunk(p->row_buffer TSRMLS_CC); in php_mysqlnd_rowp_free_mem()
1904 p->row_buffer = NULL; in php_mysqlnd_rowp_free_mem()
1906 DBG_INF_FMT("stack_allocation=%u persistent=%u", (int)stack_allocation, (int)p->header.persistent); in php_mysqlnd_rowp_free_mem()
1915 mnd_pefree(p, p->header.persistent); in php_mysqlnd_rowp_free_mem()
1948 MYSQLND_PACKET_STATS *p= (MYSQLND_PACKET_STATS *) _packet; in php_mysqlnd_stats_free_mem() local
1949 if (p->message) { in php_mysqlnd_stats_free_mem()
1950 mnd_efree(p->message); in php_mysqlnd_stats_free_mem()
1951 p->message = NULL; in php_mysqlnd_stats_free_mem()
1954 mnd_pefree(p, p->header.persistent); in php_mysqlnd_stats_free_mem()
1971 zend_uchar *p = buf; in php_mysqlnd_prepare_read() local
1982 packet->error_code = uint1korr(p); in php_mysqlnd_prepare_read()
1983 p++; in php_mysqlnd_prepare_read()
1987 php_mysqlnd_read_error_from_line(p, data_size - 1, in php_mysqlnd_prepare_read()
2004 packet->stmt_id = uint4korr(p); in php_mysqlnd_prepare_read()
2005 p += 4; in php_mysqlnd_prepare_read()
2009 packet->field_count = uint2korr(p); in php_mysqlnd_prepare_read()
2010 p += 2; in php_mysqlnd_prepare_read()
2013 packet->param_count = uint2korr(p); in php_mysqlnd_prepare_read()
2014 p += 2; in php_mysqlnd_prepare_read()
2019 p++; in php_mysqlnd_prepare_read()
2022 packet->warning_count = uint2korr(p); in php_mysqlnd_prepare_read()
2032 DBG_ERR_FMT("PREPARE packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_prepare_read()
2034 p - begin - packet->header.size); in php_mysqlnd_prepare_read()
2044 MYSQLND_PACKET_PREPARE_RESPONSE *p= (MYSQLND_PACKET_PREPARE_RESPONSE *) _packet; in php_mysqlnd_prepare_free_mem() local
2046 mnd_pefree(p, p->header.persistent); in php_mysqlnd_prepare_free_mem()
2059 zend_uchar *p = buf; in php_mysqlnd_chg_user_read() local
2074 packet->response_code = uint1korr(p); in php_mysqlnd_chg_user_read()
2075 p++; in php_mysqlnd_chg_user_read()
2084 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_chg_user_read()
2092 if (packet->response_code == 0xFE && packet->header.size > (size_t) (p - buf)) { in php_mysqlnd_chg_user_read()
2093 packet->new_auth_protocol = mnd_pestrdup((char *)p, FALSE); in php_mysqlnd_chg_user_read()
2095 p+= packet->new_auth_protocol_len + 1; /* +1 for the \0 */ in php_mysqlnd_chg_user_read()
2096 packet->new_auth_protocol_data_len = packet->header.size - (size_t) (p - buf); in php_mysqlnd_chg_user_read()
2099 memcpy(packet->new_auth_protocol_data, p, packet->new_auth_protocol_data_len); in php_mysqlnd_chg_user_read()
2107 DBG_ERR_FMT("CHANGE_USER packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_chg_user_read()
2109 p - begin - packet->header.size); in php_mysqlnd_chg_user_read()
2119 MYSQLND_PACKET_CHG_USER_RESPONSE * p = (MYSQLND_PACKET_CHG_USER_RESPONSE *) _packet; in php_mysqlnd_chg_user_free_mem() local
2121 if (p->new_auth_protocol) { in php_mysqlnd_chg_user_free_mem()
2122 mnd_efree(p->new_auth_protocol); in php_mysqlnd_chg_user_free_mem()
2123 p->new_auth_protocol = NULL; in php_mysqlnd_chg_user_free_mem()
2125 p->new_auth_protocol_len = 0; in php_mysqlnd_chg_user_free_mem()
2127 if (p->new_auth_protocol_data) { in php_mysqlnd_chg_user_free_mem()
2128 mnd_efree(p->new_auth_protocol_data); in php_mysqlnd_chg_user_free_mem()
2129 p->new_auth_protocol_data = NULL; in php_mysqlnd_chg_user_free_mem()
2131 p->new_auth_protocol_data_len = 0; in php_mysqlnd_chg_user_free_mem()
2134 mnd_pefree(p, p->header.persistent); in php_mysqlnd_chg_user_free_mem()
2162 MYSQLND_PACKET_SHA256_PK_REQUEST * p = (MYSQLND_PACKET_SHA256_PK_REQUEST *) _packet; in php_mysqlnd_sha256_pk_request_free_mem() local
2163 mnd_pefree(p, p->header.persistent); in php_mysqlnd_sha256_pk_request_free_mem()
2176 zend_uchar *p = buf; in php_mysqlnd_sha256_pk_request_response_read() local
2186 p++; in php_mysqlnd_sha256_pk_request_response_read()
2189 packet->public_key_len = packet->header.size - (p - buf); in php_mysqlnd_sha256_pk_request_response_read()
2191 memcpy(packet->public_key, p, packet->public_key_len); in php_mysqlnd_sha256_pk_request_response_read()
2197 DBG_ERR_FMT("OK packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_sha256_pk_request_response_read()
2199 p - begin - packet->header.size); in php_mysqlnd_sha256_pk_request_response_read()
2209 …MYSQLND_PACKET_SHA256_PK_REQUEST_RESPONSE * p = (MYSQLND_PACKET_SHA256_PK_REQUEST_RESPONSE *) _pac… in php_mysqlnd_sha256_pk_request_response_free_mem() local
2210 if (p->public_key) { in php_mysqlnd_sha256_pk_request_response_free_mem()
2211 mnd_efree(p->public_key); in php_mysqlnd_sha256_pk_request_response_free_mem()
2212 p->public_key = NULL; in php_mysqlnd_sha256_pk_request_response_free_mem()
2214 p->public_key_len = 0; in php_mysqlnd_sha256_pk_request_response_free_mem()
2217 mnd_pefree(p, p->header.persistent); in php_mysqlnd_sha256_pk_request_response_free_mem()