473,698 Members | 2,432 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

BUG: compiling PL/Python - Semi-SOLVED

Hi all.

OS: Tru64 UNIX 4.0d
PG: PostgreSQL v7.4.1
PY: Python v2.3.3

I just ran into a minor bug while compiling PL/Python module. It bombed outon lines 153 and 160 of ./src/pl/plpython/plpython.c complaining on incomplete type "PyObject_HEAD" .

The source of the problem were these two typedefs:

typedef struct PLyPlanObject
{
PyObject_HEAD;
void *plan; /* return of an SPI_saveplan */
int nargs;
Oid *types;
Datum *values;
PLyTypeInfo *args;
} PLyPlanObject;

typedef struct PLyResultObject
{
PyObject_HEAD;
/* HeapTuple *tuples; */
PyObject *nrows; /* number of rows returned by query */
PyObject *rows; /* data rows, or None if nodata returned */
PyObject *status; /* query status, SPI_OK_*, or SPI_ERR_* */
} PLyResultObject ;

The problem is in ";" following "PyObject_HEAD" . "PyObject_H EAD" is a macrodefined as:

#define PyObject_HEAD \
_PyObject_HEAD_ EXTRA \
int ob_refcnt; \
struct _typeobject *ob_type;

So, that in turn expanded to this:

typedef struct PLyResultObject
{
int ob_refcnt ; struct _typeobject * ob_type ; ;
PyObject *nrows;
PyObject *rows;
PyObject *status;
} PLyResultObject ;

The problem is in that extra semicolon - it is an excess and when removed everything compiles OK. Using this in a regular local variable declaration will not cause problems, since an extra ";" will just be swallowed as an NoOp.

Nix.
Nov 12 '05 #1
0 1180

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
2400
by: The Tao of Spike | last post by:
I've recentlty been getting into programming. I was wondering what language to learn first and after asking around I decided on Python. I'm about half way through "Non-Programmers Tutorial For Python" By Josh Cogliati (http://www.honors.montana.edu/~jjc/easytut/easytut/) and I'm wondering where I should go after this. Any help is appreciated, thanks.
3
2014
by: Edward K. Ream | last post by:
Hi, I am trying to run the following docstring using docutils.DocTestSuite: """ >>> s = "a\n \t\n\t\t \t\nb" etc... """ However, docutils complains about "inconsistent leading whitespace". Well,
44
2519
by: Iwan van der Kleyn | last post by:
Please ignore if you are allergic to ramblings :-) Despite a puritan streak I've always tried to refrain from language wars or syntax bickering; call it enforced pragmatism. That's the main reason why I've liked Python: it's elegant and simple and still dynamic and flexible. You could do worse for a clean and pragmatic language. I do know my Smaltalk from my Common Lisp and my Ruby from my C#, so I think I'm quite capable of escaping...
40
2971
by: Xah Lee | last post by:
is it possible in Python to create a function that maintains a variable value? something like this: globe=0; def myFun(): globe=globe+1 return globe
0
361
by: Kurt B. Kaiser | last post by:
Patch / Bug Summary ___________________ Patches : 378 open ( +3) / 3298 closed (+34) / 3676 total (+37) Bugs : 886 open (-24) / 5926 closed (+75) / 6812 total (+51) RFE : 224 open ( +7) / 227 closed ( +7) / 451 total (+14) New / Reopened Patches ______________________
38
2279
by: Mark Dickinson | last post by:
I get the following behaviour on Python 2.5 (OS X 10.4.8 on PowerPC, in case it's relevant.) (0.0, 0.0) (-0.0, -0.0) I would have expected y to be -0.0 in the first case, and 0.0 in the second. Should the above be considered a bug, or is Python not expected to honour signs of zeros? I'm working in a situation involving complex arithmetic where branch cuts, and hence signed
11
4096
by: raylopez99 | last post by:
Keep in mind this is my first compiled SQL program Stored Procedure (SP), copied from a book by Frasier Visual C++.NET in Visual Studio 2005 (Chap12). So far, so theory, except for one bug (feature?) below. At some point I'm sure I'll be able to laugh about this, akin to forgeting a semi-colon in C/C++, but right now it's frustrating (time to sleep on it for a while). Problem-- For some reason I get the error when trying to save files...
0
1432
by: No.23 | last post by:
#!/usr/bin/env python import libgmail from time import gmtime, strftime fp = open('/tmp/python.list', 'w') ga = libgmail.GmailAccount("No.0023@gmail.com", "mypass") ga.login() result = self.ga.getMessagesByLabel('python.list', True)
4
1999
by: aine_canby | last post by:
Hi, Do the Python Paths come in the form of a dictionary where I can access a particular path my its key in the registry? For example, in PythonWin Tools>>Edit Python Paths shows the name as well of the address of each path Thanks,
9
1229
by: MartinRinehart | last post by:
I'm working on a website that nests framesets within other framesets. I want a click in one top-level frame to show/hide a menu in a second level frame. Hete's a code fragment: var cousin2_doc = brother_frameset.document var d = cousin2_doc d.wp = function( obj ) { this.write( obj + '<p>' ) } alert( d + ', ' + d.wp )
0
8678
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8609
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9166
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9030
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6525
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4371
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2333
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.