SQLite Forum

warning: function may return address of local variable [-Wreturn-local-addr]
Thank you for the explanation. I can see that the current version (using pAllocated) in this case is the most easiest fix to silence the eager compiler.

Looking closely into the details, it seems that the whole `sqlite3SelectNew()` function is executed under an active mutex, since it calls [`sqlite3DbMallocRawNN()`](https://www.sqlite.org/src/file?udc=1&ln=588-635&ci=1cb248a3fc4c35c5&name=src%2Fmalloc.c) which expects `assert( sqlite3_mutex_held(db->mutex) );`.

Does this mean the whole function is effectively single-threaded?