From: <no...@so...> - 2002-08-03 06:05:37
|
Bugs item #589370, was opened at 2002-07-31 23:03 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=116528&aid=589370&group_id=16528 Category: PgSQL Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Gerhard Häring (ghaering) Summary: PgSQL.py hangs on empty result Initial Comment: PACKAGE: pyPgSQL 2.1 (and in 2.0 too) Win32 USING: python 2.2 (Win32) Server 7.1.2 Mandrake Linux 8.1 ERROR: PgSQL.py hangs on line 2142 on empty result. SEE DETAILS IN ATTACHED FILE! select b.Bitrate,b.DauerTxt,b.Dauer,b.OID,b.Artist,a.Name,a.OI D,b.Track,b.Genre, a.PlayList,a.Kommentar,b.Jahr,b.ImportStamp,a.Item,b. Album,a.Entry,b.Title,b.Filename from PlayLists as a,AlleTitel as b where a.Entry=b.OID and (a.PlayList=1 and a.Item>=0) order by a.Item ############################################### ######## This results in the following error (Notice: There are the OIDs of both files selected!) Traceback (most recent call last): File "jukebox.py", line 476, in ? main() File "jukebox.py", line 472, in main myApp = App() File "jukebox.py", line 27, in __init__ wxApp.__init__(self,0) File "C:\Programme\python22\lib\site- packages\wxPython\wx.py", line 1587, in __init__ _wxStart(self.OnInit) File "jukebox.py", line 38, in OnInit self.readPlaylist() File "jukebox.py", line 296, in readPlaylist self.tbPtitles.readTitles(playlist) File "jukedb.py", line 271, in readTitles return self.readMore(where=wcls, order="a.Item") File "sqldb.py", line 228, in readMore cursor.execute(query) File "C:\PROGRA~1\Python22\Lib\site- packages\pyPgSQL\PgSQL.py", line 2415, in execute self.__makedesc__() File "C:\PROGRA~1\Python22\Lib\site- packages\pyPgSQL\PgSQL.py", line 2142, in __makedesc__ _p = _res.getvalue(0, _i) ValueError: result does not contain any tuples. ---------------------------------------------------------------------- >Comment By: Gerhard Häring (ghaering) Date: 2002-08-03 08:05 Message: Logged In: YES user_id=163326 Fixed in revision 1.13 of PgSQL.py. ---------------------------------------------------------------------- Comment By: Gerhard Häring (ghaering) Date: 2002-08-02 10:52 Message: Logged In: YES user_id=163326 I'm uploading a patch that is most likely all that's required to fix this bug (and it wasn't PostgreSQL's fault, which I was too quick to blame). ---------------------------------------------------------------------- Comment By: Gerhard Häring (ghaering) Date: 2002-08-02 10:27 Message: Logged In: YES user_id=163326 I could produce a very minimal test case (see upload). Looks like a PostgreSQL bug that we have to work around: if OID is in the select statement, and the query doesn't produce any rows (_res.ntuples == 0), then _res.nfields != 0 because PostgreSQL says that it has returned an OID value, which it hasn't :-/ That's at least my interpretation for now. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2002-08-01 22:34 Message: Logged In: NO ERROR REPORT 31.07.2002 22:15 By Frank H. Raschke fr...@nk... Hello! I have some problems with pyPgSQL i'd like to mention: PACKAGE: pyPgSQL 2.1 (and in 2.0 too) Win32 USING: python 2.2 (Win32) Server 7.1.2 Mandrake Linux 8.1 ERROR: PgSQL.py hangs on line 2142 on empty result. ################################################### #### DETAILS: The following Tables where created by a script using pgsql: CREATE TABLE "alletitel" ( "dauer" double precision NOT NULL, "dauertxt" character varying(10) NOT NULL, "title" character varying(150) NOT NULL, "genre" character varying(40) NOT NULL, "artist" character varying(150) NOT NULL, "album" character varying(150) NOT NULL, "bitrate" double precision NOT NULL, "jahr" character(4) NOT NULL, "track" integer NOT NULL, "filename" character varying(250) NOT NULL, "importstamp" timestamp with time zone NOT NULL ); CREATE INDEX alletitel_artist ON alletitel (artist); CREATE INDEX alletitel_artisttitle ON alletitel (artist,title); CREATE INDEX alletitel_title ON alletitel (title); CREATE TABLE "playlists" ( "playlist" integer NOT NULL, "item" integer NOT NULL, "name" character varying(40) NOT NULL, "kommentar" character varying(250) NOT NULL, "entry" integer NOT NULL ); CREATE INDEX playlists_playlistitem ON playlists (playlist,item); ################################################### #### The following statement was executed by "cursor.execute (statement)" where "alletitel" contained some rows but "playlists" was empty and so the result was of course empty too (important!) select b.Bitrate,b.DauerTxt,b.Dauer,b.OID,b.Artist,a.Name,a.OID,b.Tr ack,b.Genre, a.PlayList,a.Kommentar,b.Jahr,b.ImportStamp,a.Item,b.Album ,a.Entry,b.Title,b.Filename from PlayLists as a,AlleTitel as b where a.Entry=b.OID and (a.PlayList=1 and a.Item>=0) order by a.Item The real Source won't help you much, I think, because this statement is generated by the wrapper sqldb.py. The thing above is taken from a "print" of the query string. Identical query wors fine with mySQL... But if it helps, I can send you the little jukebox-app, but how can I do so ? Should I submit new ? Here I can't upload anymore.... ################################################### #### This results in the following error (Notice: There are the OIDs of both tables selected!) Traceback (most recent call last): File "jukebox.py", line 476, in ? main() File "jukebox.py", line 472, in main myApp = App() File "jukebox.py", line 27, in __init__ wxApp.__init__(self,0) File "C:\Programme\python22\lib\site- packages\wxPython\wx.py", line 1587, in __init__ _wxStart(self.OnInit) File "jukebox.py", line 38, in OnInit self.readPlaylist() File "jukebox.py", line 296, in readPlaylist self.tbPtitles.readTitles(playlist) File "jukedb.py", line 271, in readTitles return self.readMore(where=wcls, order="a.Item") File "sqldb.py", line 228, in readMore cursor.execute(query) File "C:\PROGRA~1\Python22\Lib\site- packages\pyPgSQL\PgSQL.py", line 2415, in execute self.__makedesc__() File "C:\PROGRA~1\Python22\Lib\site- packages\pyPgSQL\PgSQL.py", line 2142, in __makedesc__ _p = _res.getvalue(0, _i) ValueError: result does not contain any tuples. ################################################### #### Thank You Bye ---------------------------------------------------------------------- Comment By: Gerhard Häring (ghaering) Date: 2002-08-01 09:08 Message: Logged In: YES user_id=163326 I can't reproduce the problem here with PostgreSQL 7.2.1, but will try later with a 7.1.3 at home. It'd still be ueful if you could upload your schema and code. ---------------------------------------------------------------------- Comment By: Gerhard Häring (ghaering) Date: 2002-08-01 08:55 Message: Logged In: YES user_id=163326 Thanks for your submission. Your attachment wasn't uploaded. Most probably you forgot to activate the checkbox titled "Check to Upload and Attach a File". This is a Sourceforge annoyance that we can do nothing about. Would you please upload your file again? Thanks. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=116528&aid=589370&group_id=16528 |