mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-12-25 11:22:30 +01:00
Add patch to make sqlite pragmas work https://github.com/keplerproject/luasql/pull/8/files
27 lines
779 B
Diff
27 lines
779 B
Diff
--- a/src/ls_sqlite3.c
|
|
+++ b/src/ls_sqlite3.c
|
|
@@ -382,7 +382,11 @@ static int conn_execute(lua_State *L)
|
|
int numcols;
|
|
const char *tail;
|
|
|
|
+#if SQLITE_VERSION_NUMBER > 3006013
|
|
+ res = sqlite3_prepare_v2(conn->sql_conn, statement, -1, &vm, &tail);
|
|
+#else
|
|
res = sqlite3_prepare(conn->sql_conn, statement, -1, &vm, &tail);
|
|
+#endif
|
|
if (res != SQLITE_OK)
|
|
{
|
|
errmsg = sqlite3_errmsg(conn->sql_conn);
|
|
@@ -544,7 +548,11 @@ static int env_connect(lua_State *L)
|
|
|
|
sourcename = luaL_checkstring(L, 2);
|
|
|
|
+#if SQLITE_VERSION_NUMBER > 3006013
|
|
+ res = sqlite3_open_v2(sourcename, &conn, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
|
|
+#else
|
|
res = sqlite3_open(sourcename, &conn);
|
|
+#endif
|
|
if (res != SQLITE_OK)
|
|
{
|
|
errmsg = sqlite3_errmsg(conn);
|