Details
-
Bug
-
Resolution: Incomplete
-
Not Evaluated
-
None
-
4.6.3, 4.7.1
-
None
-
win7 64bit
Description
i'm using QSqlDatabase to open a sqlite3 db...however i must create my own custom function using sqlite3_create_function().
I used a snippet of code from Qt help to get sqlite3 handle, like below:
QSqlDatabase db = ...;
QVariant v = db.driver()->handle();
if (v.isValid() && qstrcmp(v.typeName(), "sqlite3*")==0) {
// v.data() returns a pointer to the handle
sqlite3 *handle = *static_cast<sqlite3 **>(v.data());
if (handle != 0) { // check that it is not NULL
...
}
}
that returns a valid sqlite3 handle, but when I use it with sqlite3_create_function() i get a segmentation fault;
if i open a database with native sqlite3 API (sqlite3_open), sqlite3_create_function works very well (both on simulator and on a device).