]> uap-core.de Git - note.git/commitdiff
fix SQL_ATTACHMENT_NEW query parameters
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Mon, 7 Apr 2025 20:28:08 +0000 (22:28 +0200)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Mon, 7 Apr 2025 20:28:08 +0000 (22:28 +0200)
application/store.c

index e26a93db69d798068c24d8bb3f8183208efc88b4..0c1aff707ff7e99b75e296bd586a5eb84aba926b 100644 (file)
@@ -637,9 +637,9 @@ static int qthr_save_attachment(SaveAttachmentJob *job) {
                 q = connection->createQuery(connection, NULL);
                 dbuQuerySetSQL(q, SQL_ATTACHMENT_NEW);
                 dbuQuerySetParamInt64(q, 1, job->resource_id);
-                dbuQuerySetParamInt64(q, 1, job->resource_id);
-                dbuQuerySetParamInt64(q, 1, job->type);
-                dbuQuerySetParamBytes(q, 3, job->content.ptr, job->content.length);
+                dbuQuerySetParamInt64(q, 2, job->resource_id);
+                dbuQuerySetParamInt64(q, 3, job->type);
+                dbuQuerySetParamBytes(q, 4, job->content.ptr, job->content.length);
                 if(dbuQueryExec(q)) {
                     job->error = 3;
                 } else {