From: Mauro Carvalho Chehab <mchehab@kernel.org>
To: Xiaofei Tan <tanxiaofei@huawei.com>
Cc: <linux-edac@vger.kernel.org>, <linuxarm@huawei.com>,
<shiju.jose@huawei.com>
Subject: Re: [PATCH 1/1] rasdaemon: fix the issue of sqlite3 integer bind parameter mismatch
Date: Thu, 10 Oct 2019 14:31:11 -0300 [thread overview]
Message-ID: <20191010143111.3a4911fc@coco.lan> (raw)
In-Reply-To: <1565230470-52916-1-git-send-email-tanxiaofei@huawei.com>
Em Thu, 8 Aug 2019 10:14:30 +0800
Xiaofei Tan <tanxiaofei@huawei.com> escreveu:
> Some interger fields of arm_event and mc_event are 8 bytes width,
> and sqlite3_bind_int64() should be used when restore the event to
> sqlite3. But we use sqlite3_bind_int() in current code. This will
> lead to an wrong value in sqlite3 DB.
>
> This patch is to fix the issue.
>
> Signed-off-by: Xiaofei Tan <tanxiaofei@huawei.com>
Applied, thanks!
> ---
> ras-record.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/ras-record.c b/ras-record.c
> index 4c8b55b..0bf0080 100644
> --- a/ras-record.c
> +++ b/ras-record.c
> @@ -94,9 +94,9 @@ int ras_store_mc_event(struct ras_events *ras, struct ras_mc_event *ev)
> sqlite3_bind_int (priv->stmt_mc_event, 7, ev->top_layer);
> sqlite3_bind_int (priv->stmt_mc_event, 8, ev->middle_layer);
> sqlite3_bind_int (priv->stmt_mc_event, 9, ev->lower_layer);
> - sqlite3_bind_int (priv->stmt_mc_event, 10, ev->address);
> - sqlite3_bind_int (priv->stmt_mc_event, 11, ev->grain);
> - sqlite3_bind_int (priv->stmt_mc_event, 12, ev->syndrome);
> + sqlite3_bind_int64 (priv->stmt_mc_event, 10, ev->address);
> + sqlite3_bind_int64 (priv->stmt_mc_event, 11, ev->grain);
> + sqlite3_bind_int64 (priv->stmt_mc_event, 12, ev->syndrome);
> sqlite3_bind_text(priv->stmt_mc_event, 13, ev->driver_detail, -1, NULL);
> rc = sqlite3_step(priv->stmt_mc_event);
> if (rc != SQLITE_OK && rc != SQLITE_DONE)
> @@ -242,7 +242,7 @@ int ras_store_arm_record(struct ras_events *ras, struct ras_arm_event *ev)
> sqlite3_bind_text (priv->stmt_arm_record, 1, ev->timestamp, -1, NULL);
> sqlite3_bind_int (priv->stmt_arm_record, 2, ev->error_count);
> sqlite3_bind_int (priv->stmt_arm_record, 3, ev->affinity);
> - sqlite3_bind_int (priv->stmt_arm_record, 4, ev->mpidr);
> + sqlite3_bind_int64 (priv->stmt_arm_record, 4, ev->mpidr);
> sqlite3_bind_int (priv->stmt_arm_record, 5, ev->running_state);
> sqlite3_bind_int (priv->stmt_arm_record, 6, ev->psci_state);
>
Thanks,
Mauro
next prev parent reply other threads:[~2019-10-10 17:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-08 2:14 [PATCH 1/1] rasdaemon: fix the issue of sqlite3 integer bind parameter mismatch Xiaofei Tan
2019-10-10 17:31 ` Mauro Carvalho Chehab [this message]
-- strict thread matches above, loose matches on Subject: below --
2019-09-02 8:38 tanxiaofei
2019-08-07 7:54 Xiaofei Tan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191010143111.3a4911fc@coco.lan \
--to=mchehab@kernel.org \
--cc=linux-edac@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=shiju.jose@huawei.com \
--cc=tanxiaofei@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.