MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / net_store_data

Method net_store_data

sql/protocol.cc:46–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44bool Protocol::net_store_data(const uchar *from, size_t length)
45#else
46bool Protocol_binary::net_store_data(const uchar *from, size_t length)
47#endif
48{
49 ulong packet_length=packet->length();
50 /*
51 The +9 comes from that strings of length longer than 16M require
52 9 bytes to be stored (see net_store_length).
53 */
54 if (packet_length+9+length > packet->alloced_length() &&
55 packet->realloc(packet_length+9+length))
56 return 1;
57 uchar *to= net_store_length((uchar*) packet->ptr()+packet_length, length);
58 memcpy(to,from,length);
59 packet->length((uint) (to+length-(uchar*) packet->ptr()));
60 return 0;
61}
62
63
64

Callers

nothing calls this directly

Calls 8

net_store_lengthFunction · 0.85
net_store_dataFunction · 0.85
copy_and_convertFunction · 0.85
alloced_lengthMethod · 0.80
lengthMethod · 0.45
reallocMethod · 0.45
ptrMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected