Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
749167cf
Commit
749167cf
authored
17 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
Allow PL/PythonU to compile on Python 2.5. Change needed because of API
changes in Python. Marko Kreen
parent
9665dd92
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/pl/plpython/plpython.c
+27
-19
27 additions, 19 deletions
src/pl/plpython/plpython.c
with
27 additions
and
19 deletions
src/pl/plpython/plpython.c
+
27
−
19
View file @
749167cf
/**********************************************************************
* plpython.c - python as a procedural language for PostgreSQL
*
* $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.9
7
2007/04/0
2 03:49:42 tgl
Exp $
* $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.9
8
2007/04/0
3 13:37:22 momjian
Exp $
*
*********************************************************************
*/
...
...
@@ -23,6 +23,15 @@
#include
<Python.h>
#endif
/*
* Py_ssize_t compat for Python <= 2.4
*/
#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
typedef
int
Py_ssize_t
;
#define PY_SSIZE_T_MAX INT_MAX
#define PY_SSIZE_T_MIN INT_MIN
#endif
#include
"postgres.h"
/* system stuff */
...
...
@@ -1953,11 +1962,11 @@ static void PLy_result_dealloc(PyObject *);
static
PyObject
*
PLy_result_getattr
(
PyObject
*
,
char
*
);
static
PyObject
*
PLy_result_nrows
(
PyObject
*
,
PyObject
*
);
static
PyObject
*
PLy_result_status
(
PyObject
*
,
PyObject
*
);
static
int
PLy_result_length
(
PyObject
*
);
static
PyObject
*
PLy_result_item
(
PyObject
*
,
in
t
);
static
PyObject
*
PLy_result_slice
(
PyObject
*
,
int
,
in
t
);
static
int
PLy_result_ass_item
(
PyObject
*
,
in
t
,
PyObject
*
);
static
int
PLy_result_ass_slice
(
PyObject
*
,
int
,
in
t
,
PyObject
*
);
static
Py_ssize_t
PLy_result_length
(
PyObject
*
);
static
PyObject
*
PLy_result_item
(
PyObject
*
,
Py_ssize_
t
);
static
PyObject
*
PLy_result_slice
(
PyObject
*
,
Py_ssize_t
,
Py_ssize_
t
);
static
int
PLy_result_ass_item
(
PyObject
*
,
Py_ssize_
t
,
PyObject
*
);
static
int
PLy_result_ass_slice
(
PyObject
*
,
Py_ssize_t
,
Py_ssize_
t
,
PyObject
*
);
static
PyObject
*
PLy_spi_prepare
(
PyObject
*
,
PyObject
*
);
...
...
@@ -2001,15 +2010,14 @@ static PyMethodDef PLy_plan_methods[] = {
{
NULL
,
NULL
,
0
,
NULL
}
};
static
PySequenceMethods
PLy_result_as_sequence
=
{
(
inquiry
)
PLy_result_length
,
/* sq_length */
(
binaryfunc
)
0
,
/* sq_concat */
(
intargfunc
)
0
,
/* sq_repeat */
(
intargfunc
)
PLy_result_item
,
/* sq_item */
(
intintargfunc
)
PLy_result_slice
,
/* sq_slice */
(
intobjargproc
)
PLy_result_ass_item
,
/* sq_ass_item */
(
intintobjargproc
)
PLy_result_ass_slice
,
/* sq_ass_slice */
PLy_result_length
,
/* sq_length */
NULL
,
/* sq_concat */
NULL
,
/* sq_repeat */
PLy_result_item
,
/* sq_item */
PLy_result_slice
,
/* sq_slice */
PLy_result_ass_item
,
/* sq_ass_item */
PLy_result_ass_slice
,
/* sq_ass_slice */
};
static
PyTypeObject
PLy_ResultType
=
{
...
...
@@ -2190,7 +2198,7 @@ PLy_result_status(PyObject * self, PyObject * args)
return
ob
->
status
;
}
static
in
t
static
Py_ssize_
t
PLy_result_length
(
PyObject
*
arg
)
{
PLyResultObject
*
ob
=
(
PLyResultObject
*
)
arg
;
...
...
@@ -2199,7 +2207,7 @@ PLy_result_length(PyObject * arg)
}
static
PyObject
*
PLy_result_item
(
PyObject
*
arg
,
in
t
idx
)
PLy_result_item
(
PyObject
*
arg
,
Py_ssize_
t
idx
)
{
PyObject
*
rv
;
PLyResultObject
*
ob
=
(
PLyResultObject
*
)
arg
;
...
...
@@ -2211,7 +2219,7 @@ PLy_result_item(PyObject * arg, int idx)
}
static
int
PLy_result_ass_item
(
PyObject
*
arg
,
in
t
idx
,
PyObject
*
item
)
PLy_result_ass_item
(
PyObject
*
arg
,
Py_ssize_
t
idx
,
PyObject
*
item
)
{
int
rv
;
PLyResultObject
*
ob
=
(
PLyResultObject
*
)
arg
;
...
...
@@ -2222,7 +2230,7 @@ PLy_result_ass_item(PyObject * arg, int idx, PyObject * item)
}
static
PyObject
*
PLy_result_slice
(
PyObject
*
arg
,
int
lidx
,
in
t
hidx
)
PLy_result_slice
(
PyObject
*
arg
,
Py_ssize_t
lidx
,
Py_ssize_
t
hidx
)
{
PyObject
*
rv
;
PLyResultObject
*
ob
=
(
PLyResultObject
*
)
arg
;
...
...
@@ -2235,7 +2243,7 @@ PLy_result_slice(PyObject * arg, int lidx, int hidx)
}
static
int
PLy_result_ass_slice
(
PyObject
*
arg
,
int
lidx
,
in
t
hidx
,
PyObject
*
slice
)
PLy_result_ass_slice
(
PyObject
*
arg
,
Py_ssize_t
lidx
,
Py_ssize_
t
hidx
,
PyObject
*
slice
)
{
int
rv
;
PLyResultObject
*
ob
=
(
PLyResultObject
*
)
arg
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment