[Zope-dev] ZOracleDA and select LONGs, for more than one row.

Anthony Baxter anthony@ekorp.com
Wed, 03 Nov 1999 17:26:42 +1100


(wah. www.zope.org/Collector gone away)

Can someone verify that I'm not going insane? Doing a select on a
table with a column of type LONG works, but only where the select
returns a single row. Any that returns more than one row breaks with
an IndexError (exception included below).

given the following table:

SQL> desc testlongs ; 
 Name                            Null?    Type
 ------------------------------- -------- ----
 ID                                       NUMBER(38)
 DATA                                     LONG

And the following SQL method:

    select * from testlongs 

It works when there's only one row in the result.

SQL> insert into testlongs values ( 1, 
	'helllohelllohellllhelllohelllohelllohehellohello' ) ; 
SQL> insert into testlongs values ( 2, 
	'helllohelllohellllhelllohelllohelllohehellohello' ) ; 

    select * from testlongs where id = 1
works.
    select * from testlongs where id = 2
works.

    select * from testlongs where id < 3
fails, with 
exceptions.IndexError: 1 

Traceback (innermost last):
  File /export/zope/zope2/lib/python/ZPublisher/Publish.py, 
					    line 214, 
					    in publish_module
  File /export/zope/zope2/lib/python/ZPublisher/Publish.py, 
					    line 176, 
					    in publish
  File /export/zope/zope2/lib/python/Zope/__init__.py, 
					    line 201, 
					    in zpublisher_exception_hook
    (Object: testlong)
  File /export/zope/zope2/lib/python/ZPublisher/Publish.py, 
					    line 161, 
					    in publish
  File /export/zope/zope2/lib/python/ZPublisher/mapply.py, 
					    line 160, 
					    in mapply
    (Object: manage_test)
  File /export/zope/zope2/lib/python/ZPublisher/Publish.py, 
					    line 102, 
					    in call_object
    (Object: manage_test)
  File /export/zope/zope2/lib/python/Shared/DC/ZRDB/DA.py, 
					    line 316, 
					    in manage_test
    (Object: testlong)
  File /export/zope/zope2/lib/python/Shared/DC/ZRDB/DA.py, 
					    line 297, 
					    in manage_test
    (Object: testlong)
  File /export/zope/zope2/lib/python/Shared/DC/ZRDB/DA.py, 
					    line 401, 
					    in __call__
    (Object: testlong)
  File /export/zope/zope2/lib/python/Products/ZOracleDA/db.py, 
					    line 202, 
					    in query
  File /opt/zope/zope2/lib/python/Products/ZOracleDA/DCOracle/ociCurs.py, 
					    line 340, 
					    in fetchmany
  File /opt/zope/zope2/lib/python/Products/ZOracleDA/DCOracle/ociCurs.py, 
					    line 311, 
					    in fetchone
IndexError: (see above)


I've had a look at the code, and I really really can't see what's going
on here.

Anyone? 

Anthony