aboutsummaryrefslogtreecommitdiffstats
path: root/main/pllua/fix-on-32bit.patch
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-11-04 23:39:13 +0100
committerJakub Jirutka <jakub@jirutka.cz>2017-11-04 23:39:27 +0100
commitb9d5d37b25be42c7d8023b584caab511f800df13 (patch)
tree396a9b7221d567876a10f6d8e83f38c7199ce13a /main/pllua/fix-on-32bit.patch
parentef609351a6b52c7edab28bd0b549e1170fbf1723 (diff)
downloadaports-b9d5d37b25be42c7d8023b584caab511f800df13.tar.bz2
aports-b9d5d37b25be42c7d8023b584caab511f800df13.tar.xz
main/pllua: add missing patches
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,