MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / eqp_append

Function eqp_append

modules/dasSQLITE/sqlite/shell.c:17283–17303  ·  view source on GitHub ↗

** Add a new entry to the EXPLAIN QUERY PLAN data */

Source from the content-addressed store, hash-verified

17281** Add a new entry to the EXPLAIN QUERY PLAN data
17282*/
17283static void eqp_append(ShellState *p, int iEqpId, int p2, const char *zText){
17284 EQPGraphRow *pNew;
17285 i64 nText;
17286 if( zText==0 ) return;
17287 nText = strlen(zText);
17288 if( p->autoEQPtest ){
17289 utf8_printf(p->out, "%d,%d,%s\n", iEqpId, p2, zText);
17290 }
17291 pNew = sqlite3_malloc64( sizeof(*pNew) + nText );
17292 shell_check_oom(pNew);
17293 pNew->iEqpId = iEqpId;
17294 pNew->iParentId = p2;
17295 memcpy(pNew->zText, zText, nText+1);
17296 pNew->pNext = 0;
17297 if( p->sGraph.pLast ){
17298 p->sGraph.pLast->pNext = pNew;
17299 }else{
17300 p->sGraph.pRow = pNew;
17301 }
17302 p->sGraph.pLast = pNew;
17303}
17304
17305/*
17306** Free and reset the EXPLAIN QUERY PLAN data that has been collected

Callers 3

shell_callbackFunction · 0.85
display_scanstatsFunction · 0.85
shell_execFunction · 0.85

Calls 2

utf8_printfFunction · 0.85
shell_check_oomFunction · 0.85

Tested by

no test coverage detected