Render a single level of the graph that has iEqpId as its parent. Called ** recursively to render sublevels. */
| 17328 | ** recursively to render sublevels. |
| 17329 | */ |
| 17330 | static void eqp_render_level(ShellState *p, int iEqpId){ |
| 17331 | EQPGraphRow *pRow, *pNext; |
| 17332 | i64 n = strlen(p->sGraph.zPrefix); |
| 17333 | char *z; |
| 17334 | for(pRow = eqp_next_row(p, iEqpId, 0); pRow; pRow = pNext){ |
| 17335 | pNext = eqp_next_row(p, iEqpId, pRow); |
| 17336 | z = pRow->zText; |
| 17337 | utf8_printf(p->out, "%s%s%s\n", p->sGraph.zPrefix, |
| 17338 | pNext ? "|--" : "`--", z); |
| 17339 | if( n<(i64)sizeof(p->sGraph.zPrefix)-7 ){ |
| 17340 | memcpy(&p->sGraph.zPrefix[n], pNext ? "| " : " ", 4); |
| 17341 | eqp_render_level(p, pRow->iEqpId); |
| 17342 | p->sGraph.zPrefix[n] = 0; |
| 17343 | } |
| 17344 | } |
| 17345 | } |
| 17346 | |
| 17347 | /* |
| 17348 | ** Display and reset the EXPLAIN QUERY PLAN data |
no test coverage detected