aboutsummaryrefslogtreecommitdiffstats
path: root/main/pllua/fix-on-32bit.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/pllua/fix-on-32bit.patch')
-rw-r--r--main/pllua/fix-on-32bit.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/main/pllua/fix-on-32bit.patch b/main/pllua/fix-on-32bit.patch
new file mode 100644
index 0000000000..fda3f78052
--- /dev/null
+++ b/main/pllua/fix-on-32bit.patch
@@ -0,0 +1,33 @@
+From 904a53bcc696a683f4a114d05400e5315e0ae70d Mon Sep 17 00:00:00 2001
+From: eugwne <eugeney.sergeev@gmail.com>
+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,