MCPcopy Create free account
hub / github.com/MariaDB/server / get_next_row

Method get_next_row

plugin/handler_socket/libhsclient/hstcpcli.cpp:385–417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

383}
384
385const string_ref *
386hstcpcli::get_next_row()
387{
388 if (num_flds == 0) {
389 DBG(fprintf(stderr, "GNR NF 0\n"));
390 return 0;
391 }
392 if (flds.size() < num_flds) {
393 flds.resize(num_flds);
394 }
395 char *start = readbuf.begin() + cur_row_offset;
396 char *const finish = readbuf.begin() + response_end_offset - 1;
397 if (start >= finish) { /* start[0] == nl */
398 DBG(fprintf(stderr, "GNR FIN 0 %p %p\n", start, finish));
399 return 0;
400 }
401 for (size_t i = 0; i < num_flds; ++i) {
402 skip_one(start, finish);
403 char *const fld_begin = start;
404 read_token(start, finish);
405 char *const fld_end = start;
406 char *wp = fld_begin;
407 if (is_null_expression(fld_begin, fld_end)) {
408 /* null */
409 flds[i] = string_ref();
410 } else {
411 unescape_string(wp, fld_begin, fld_end); /* in-place */
412 flds[i] = string_ref(fld_begin, wp);
413 }
414 }
415 cur_row_offset = start - readbuf.begin();
416 return &flds[0];
417}
418
419void
420hstcpcli::response_buf_remove()

Callers 6

hstcpcli_mainFunction · 0.45
op_insertMethod · 0.45
op_deleteMethod · 0.45
op_updateMethod · 0.45
op_readMethod · 0.45
op_readnolockMethod · 0.45

Calls 8

skip_oneFunction · 0.85
is_null_expressionFunction · 0.85
string_refClass · 0.85
unescape_stringFunction · 0.85
read_tokenFunction · 0.70
sizeMethod · 0.45
resizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected