Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-16586

using sqlite3* (get from QSqlDatabase.QSqlDriver) gives segmentation fault with sqlite3_create_function

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • 4.6.3, 4.7.1
    • SQL Support
    • 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).

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            mgoddard Michael Goddard (closed Nokia identity) (Inactive)
            alterx Giovanni Romano
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes