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

Function cli_fetch_lengths

sql-common/client.c:1363–1383  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1361**************************************************************************/
1362
1363static void cli_fetch_lengths(ulong *to, MYSQL_ROW column,
1364 unsigned int field_count)
1365{
1366 ulong *prev_length;
1367 char *start=0;
1368 MYSQL_ROW end;
1369
1370 prev_length=0; /* Keep gcc happy */
1371 for (end=column + field_count + 1 ; column != end ; column++, to++)
1372 {
1373 if (!*column)
1374 {
1375 *to= 0; /* Null */
1376 continue;
1377 }
1378 if (start) /* Found end of prev string */
1379 *prev_length= (ulong) (*column-start-1);
1380 start= *column;
1381 prev_length= to;
1382 }
1383}
1384
1385/***************************************************************************
1386 Change field rows to field structs

Callers 1

unpack_fieldsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected