Hi,

I think the documentation is wrong in the virtual table document found under
http://www.sqlite.org/vtab.html.
Under xCreate() it says:
"The xCreate method need not initialize the pModule, nRef, and zErrMsg
fields of the sqlite3_vtab <http://www.sqlite.org/c3ref/vtab.html> object."

In fact, I had a segfault occurring in vtabBestIndex(), at the line:
  sqlite3_free(pVtab->zErrMsg);

zErrMsg was uninitialized.

Doing a memset(vtab,0,size) in my xCreate() fixed the issue.

Therefore, documentation should say:
"The xCreate method should set to zero the pModule, nRef, and zErrMsg fields
of the sqlite3_vtab <http://www.sqlite.org/c3ref/vtab.html> object."

Thank you.

-- 
Martin
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to