From 904a53bcc696a683f4a114d05400e5315e0ae70d Mon Sep 17 00:00:00 2001 From: eugwne Date: Mon, 10 Jul 2017 19:51:01 +0300 Subject: [PATCH] 64 lua -> pg 32bit system Patch-Source: https://github.com/pllua/pllua/commit/904a53bcc696a683f4a114d05400e5315e0ae70d --- plluaapi.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plluaapi.c b/plluaapi.c index f47a3b9..d0a1b4d 100644 --- a/plluaapi.c +++ b/plluaapi.c @@ -1095,8 +1095,18 @@ Datum luaP_todatum (lua_State *L, Oid type, int typmod, bool *isnull, int idx) { dat = Int32GetDatum(lua_tointeger(L, idx)); break; case INT8OID: +#ifdef USE_FLOAT8_BYVAL dat = Int64GetDatum(get64lua(L, idx)); break; +#else + { + int64* value = (int64*)SPI_palloc(sizeof(int64)); + *value = get64lua(L, idx); + dat = PointerGetDatum(value); + break; + } +#endif + case TEXTOID: { const char *s = lua_tostring(L, idx); if (s == NULL) elog(ERROR,