MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / speedtest1_execute

Function speedtest1_execute

test/sqlite/speedtest1.c:361–387  ·  view source on GitHub ↗

Run an SQL statement previously prepared */

Source from the content-addressed store, hash-verified

359
360/* Run an SQL statement previously prepared */
361void speedtest1_execute(void){
362 int i, n, len;
363 if( g.bSqlOnly ) return;
364 assert( g.pStmt );
365 g.nResult = 0;
366 while( sqlite3_step(g.pStmt)==SQLITE_ROW ){
367 n = sqlite3_column_count(g.pStmt);
368 for(i=0; i<n; i++){
369 const char *z = (const char*)sqlite3_column_text(g.pStmt, i);
370 if( z==0 ) z = "nil";
371 len = (int)strlen(z);
372 if( g.nResult+len<sizeof(g.zResult)-2 ){
373 if( g.nResult>0 ) g.zResult[g.nResult++] = ' ';
374 memcpy(g.zResult + g.nResult, z, len+1);
375 g.nResult += len;
376 }
377 }
378 }
379 if( g.bReprepare ){
380 sqlite3_stmt *pNew;
381 sqlite3_prepare_v2(g.db, sqlite3_sql(g.pStmt), -1, &pNew, 0);
382 sqlite3_finalize(g.pStmt);
383 g.pStmt = pNew;
384 }else{
385 sqlite3_reset(g.pStmt);
386 }
387}
388
389/* The sqlite3_trace() callback function */
390static void traceCallback(void *NotUsed, const char *zSql){

Callers 3

testset_mainFunction · 0.85
testset_cteFunction · 0.85
testset_rtreeFunction · 0.85

Calls 3

strlenFunction · 0.85
memcpyFunction · 0.85
assertFunction · 0.50

Tested by

no test coverage detected