Files
lua-luasql/add_missing_cur_gc.patch
Ana Guerrero 99e2002019 Accepting request 1294895 from devel:languages:lua
- Update to 2.7.0:
  * LuaSQL is adapted to Lua version 5.4 and all the drivers are
    compatible with To-be-closed variables.
  * The :close() method now returns false and a string with
    appropriate message instead of raising an error when there
    are related open objects.
- Add add_missing_cur_gc.patch adding missing cur_gc symbol
  (gh#lunarmodules/luasql#178).

OBS-URL: https://build.opensuse.org/request/show/1294895
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/lua-luasql?expand=0&rev=7
2025-07-22 10:20:23 +00:00

31 lines
730 B
Diff

From 10ed75b36bf909f57b3c1a070dd87669c323cff0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1s=20Guisasola?= <tomas@puc-rio.br>
Date: Mon, 7 Jul 2025 20:59:39 -0300
Subject: [PATCH] Solving issue #178, missing cur_gc
---
src/ls_odbc.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/ls_odbc.c b/src/ls_odbc.c
index 1a7f768..565b216 100644
--- a/src/ls_odbc.c
+++ b/src/ls_odbc.c
@@ -483,6 +483,16 @@ static int cur_fetch (lua_State *L)
}
}
+/*
+** Cursor object collector function
+*/
+static int cur_gc (lua_State *L) {
+ cur_data *cur = (cur_data *) luaL_checkudata (L, 1, LUASQL_CURSOR_ODBC);
+ if (cur != NULL && !(cur->closed))
+ cur_shut(L, cur);
+ return 0;
+}
+
/*
** Closes a cursor.
*/