| 320 | */ |
| 321 | |
| 322 | int 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; |
| 333 | handle_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 | |
| 364 | int ha_json_table::rnd_init(bool scan) |
no test coverage detected