Re: [sqlite] Crash when binding default column value

2014-09-24 Thread Nathaniel Trellice
Hi Richard, James, > > > * SQL injection attacks; > > > > > > > You are doing CREATE TABLE statements based on text from an untrusted > > user? Really? > My reaction exactly. I'm writing a library so the safety of the input is out of my hands and in that of the application writers who wor

Re: [sqlite] Crash when binding default column value

2014-09-24 Thread Nathaniel Trellice
Hi Simon, Thanks for the quick reply. Without the INSERT call, my test code runs through without crashing. Attempting the INSERT call in the shell tool crashes it too. Following your advice, the output of the .schema command looks dodgy: CREATE TABLE test_table (name TEXT DEFAULT ('joe'), in

[sqlite] Crash when binding default column value

2014-09-24 Thread Nathaniel Trellice
Dear list members, I'm trying to set a default value for a column in my "CREATE TABLE" statement. I really, really want to bind the default value (using sqlite3_bind_*) rather than expressing it in SQL text to avoid the following problems: * SQL injection attacks; * floating point value round

[sqlite] Avoiding content duplication when extracting results

2014-08-13 Thread Nathaniel Trellice
Dear list members, I'm trying to extract the results of a query that returns fairly large amounts of data (100-200Mb) as quickly as possible using the c/c++ api. Is there any way to avoid unnecessarily duplicating the data coming from the following functions?  const unsigned char *sqlite3_colu