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

Method scan_next

sql/json_table.cc:322–361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

320*/
321
322int Json_table_nested_path::scan_next()
323{
324 bool no_records_found= false;
325 if (m_cur_nested)
326 {
327 for (;;)
328 {
329 if (m_cur_nested->scan_next() == 0)
330 return 0;
331 if (!(m_cur_nested= m_cur_nested->m_next_nested))
332 break;
333handle_new_nested:
334 m_cur_nested->scan_start(m_engine.s.cs, m_engine.value_begin,
335 m_engine.s.str_end);
336 }
337 if (no_records_found)
338 return 0;
339 }
340
341 DBUG_ASSERT(!m_cur_nested);
342
343 while (!json_get_path_next(&m_engine, &m_cur_path))
344 {
345 if (json_path_compare(&m_path, &m_cur_path, m_engine.value_type,
346 NULL))
347 continue;
348 /* path found. */
349 ++m_ordinality_counter;
350
351 if (!m_nested)
352 return 0;
353
354 m_cur_nested= m_nested;
355 no_records_found= true;
356 goto handle_new_nested;
357 }
358
359 m_null= true;
360 return 1;
361}
362
363
364int ha_json_table::rnd_init(bool scan)

Callers 1

rnd_nextMethod · 0.45

Calls 3

json_get_path_nextFunction · 0.85
json_path_compareFunction · 0.85
scan_startMethod · 0.80

Tested by

no test coverage detected