HiNo I'm afraid that update didn't fix the problem though it doesn't crash the system now - just silently fails to insert anything into the table.int main()
{
Sql.Sql conn = Sql.Sql("sqlite://mydb.db");
conn->query("create table t(id int)");
array arr = ({ 14, 3, 7, 9, 100, 20, 5, 12 });
foreach (arr, int x) {
conn->query("insert into t(id) values(%d)", x);
//conn->query("insert into t(id) values(:a)", ([":a":x]));
}
array arr2 = conn->query("select * from t");
write("num rows=%d\n", sizeof(arr2));
return 0;
}The second of those query() calls (commented out) works but not the sprintf-style version.Regards, MatthewOn Sunday, 18 March 2018, 04:02:13 GMT, H. William Welliver III <william@welliver.org> wrote:Hey… sorry for the delay, the week got away from me. As I was looking into this, I noticed that grubba may have fixed the problem earlier today (not sure if he told you directly). If a current checkout doesn’t resolve the problem for you, let me know.BillOn Mar 11, 2018, at 1:37 PM, Matthew Clarke <pclar7@yahoo.co.uk> wrote:Hi BillI posted again but I'm not sure that went through either. So if I email you directly...Here's the example:int main()
{
Sql.Sql conn = Sql.Sql("sqlite://mydb.db");
conn->query("create table t(id int)");
array arr = ({ 14, 3, 7, 9, 100, 20, 5, 12 });
foreach (arr, int x) {
conn->query("insert into t(id) values(%d)", x);
}
return 0;
}Works on 8.0.498 but not on 8.1.12.On 8.1.12 you need to use the other version of the query() method:conn->query("insert into t(id) values(:var)", ([":var":x]));Thanks & regards, MatthewOn Sunday, 11 March 2018, 15:36:02 GMT, H. William Welliver III <william@welliver.org> wrote:Hi… I’m not sure if you meant to include code examples, but they didn’t come through, and I don’t see your post on nabble. Can you resend it?Some changes were made to the sqlite binding to bring them in line with the way the other database bindings wok. It’s possible the change broke something but I’ll have to see what you’re doing to know for sure :)Bill> On Mar 11, 2018, at 7:26 AM, larcky <pclar7@yahoo.co.uk> wrote:>> Hi> This works perfectly in stable 8.0.498 but crashes in 8.1.12.>>>> To get it to work in 8.1.12, you have to use the other version of the> 'query' method:>>> Would it be possible to get the 'sprintf' variant working again?> Thanks, larcky>>>>> -->