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

Function net_store_length

sql-common/pack.c:98–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96*/
97
98uchar *net_store_length(uchar *packet, ulonglong length)
99{
100 if (length < (ulonglong) LL(251))
101 {
102 *packet=(uchar) length;
103 return packet+1;
104 }
105 /* 251 is reserved for NULL */
106 if (length < (ulonglong) LL(65536))
107 {
108 *packet++=252;
109 int2store(packet,(uint) length);
110 return packet+2;
111 }
112 if (length < (ulonglong) LL(16777216))
113 {
114 *packet++=253;
115 int3store(packet,(ulong) length);
116 return packet+3;
117 }
118 *packet++=254;
119 int8store(packet,length);
120 return packet+8;
121}
122

Callers 6

get_length_store_lengthFunction · 0.85
net_store_dataMethod · 0.85
net_send_okFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected