** Add a new entry to the EXPLAIN QUERY PLAN data */
| 11995 | ** Add a new entry to the EXPLAIN QUERY PLAN data |
| 11996 | */ |
| 11997 | static void eqp_append(ShellState *p, int iEqpId, int p2, const char *zText){ |
| 11998 | EQPGraphRow *pNew; |
| 11999 | int nText = strlen30(zText); |
| 12000 | if( p->autoEQPtest ){ |
| 12001 | utf8_printf(p->out, "%d,%d,%s\n", iEqpId, p2, zText); |
| 12002 | } |
| 12003 | pNew = sqlite3_malloc64( sizeof(*pNew) + nText ); |
| 12004 | if( pNew==0 ) shell_out_of_memory(); |
| 12005 | pNew->iEqpId = iEqpId; |
| 12006 | pNew->iParentId = p2; |
| 12007 | memcpy(pNew->zText, zText, nText+1); |
| 12008 | pNew->pNext = 0; |
| 12009 | if( p->sGraph.pLast ){ |
| 12010 | p->sGraph.pLast->pNext = pNew; |
| 12011 | }else{ |
| 12012 | p->sGraph.pRow = pNew; |
| 12013 | } |
| 12014 | p->sGraph.pLast = pNew; |
| 12015 | } |
| 12016 | |
| 12017 | /* |
| 12018 | ** Free and reset the EXPLAIN QUERY PLAN data that has been collected |
no test coverage detected