[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master ae7dcba6c5: Make sqlite.c build with SQlite in Fedora 9
From: |
Po Lu |
Subject: |
master ae7dcba6c5: Make sqlite.c build with SQlite in Fedora 9 |
Date: |
Sat, 5 Nov 2022 07:43:45 -0400 (EDT) |
branch: master
commit ae7dcba6c5d9c2c19f4ee67793e164af3723f69f
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
Make sqlite.c build with SQlite in Fedora 9
* src/sqlite.c (sqlite_prepare_errdata): Use sqlite3_errmsg
instead of sqlite3_errstr.
---
src/sqlite.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/src/sqlite.c b/src/sqlite.c
index 08bf696b8c..906d064000 100644
--- a/src/sqlite.c
+++ b/src/sqlite.c
@@ -428,11 +428,23 @@ row_to_value (sqlite3_stmt *stmt)
static Lisp_Object
sqlite_prepare_errdata (int code, sqlite3 *sdb)
{
- Lisp_Object errstr = build_string (sqlite3_errstr (code));
- Lisp_Object errcode = make_fixnum (code);
+ Lisp_Object errstr, errcode, ext_errcode;
+ const char *errmsg;
+
+ /* The internet says this is identical to sqlite3_errstr (code),
+ which is too new to exist on Fedora 9. */
+ errmsg = sqlite3_errmsg (sdb);
+ errstr = errmsg ? build_string (errmsg) : Qnil;
+ errcode = make_fixnum (code);
+
/* More details about what went wrong. */
- Lisp_Object ext_errcode = make_fixnum (sqlite3_extended_errcode (sdb));
- const char *errmsg = sqlite3_errmsg (sdb);
+#if SQLITE_VERSION_NUMBER >= 3006005
+ ext_errcode = make_fixnum (sqlite3_extended_errcode (sdb));
+#else
+ /* What value to use here? */
+ ext_errcode = make_fixnum (0);
+#endif
+
return list4 (errstr, errmsg ? build_string (errmsg) : Qnil,
errcode, ext_errcode);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master ae7dcba6c5: Make sqlite.c build with SQlite in Fedora 9,
Po Lu <=