Skip to content

*begin(stmt) fails with single row results #1

Description

@xiptos

I believe trying to get a row from a single row query result will result in:

Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

when using begin(stmt) to retrieve the rowIterator.

Example:

    try {
        //Creates a SQLite connection object
        Sqlite::SqliteConnection connection("myProfile.db");

        // sqliteExecute(connectionOb, "query"); executes a SQLite query, in this case creates a table
        sqliteExecute(connection, "create table if not exists myResume (skills text, proficiency int DEFAULT 5)");

        sqliteExecute(connection, "insert into myResume(skills, proficiency ) values (?, ?)", "C++", 7);

        auto stmt = Sqlite::SqliteStatement(connection, "select skills, proficiency from myResume");
        stmt.execute();
        auto row = *begin(stmt);
        std::cout << typeid(row).name() << std::endl;
        std::cout << std::left << std::setw(8) << row.getString() << " : " << row.getInt(1) << std::endl;
    }
    catch (const Sqlite::exception &e) {
        std::cout << e.errorMessage_ << '(' << e.errorCode_ << ')';
    }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions