Re: [sqlite] sqlite3_step causing Segmentation Fault

2011-09-01 Thread Black, Michael (IS)
users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of Rafael Toledo [rafaeldtol...@gmail.com] Sent: Wednesday, August 31, 2011 1:31 PM To: sqlite-users@sqlite.org Subject: EXT :[sqlite] sqlite3_step causing Segmentation Fault Hello! I'm coding a simple method in C++ to insert a t

Re: [sqlite] sqlite3_step causing Segmentation Fault

2011-09-01 Thread Igor Tandetnik
Rafael Toledo wrote: > rc = sqlite3_prepare_v2(mydb, "INSERT INTO users (name, isadmin, > photo) VALUES (?, 1, ?)", -1, , NULL); > if (rc != SQLITE_OK) { > sqlite3_finalize(statement); If prepare fails, statement is never updated. So you are passing garbage to

[sqlite] sqlite3_step causing Segmentation Fault

2011-09-01 Thread Rafael Toledo
Hello! I'm coding a simple method in C++ to insert a tuple in a small database. The database has a table called 'user', with 3 fields (id - the primary key, name, and a image). I mapped these fields in a class - id is an int, name is a std::string and image is a std::vector of unsigned char. In