[Zope] SybaseDA-2.0b2-src.tgz
Hung Jung Lu
hungjunglu@hotmail.com
Fri, 04 Feb 2000 11:16:11 PST
>From: Christopher Petrilli <petrilli@digicool.com>
>
>Can you please specify what the exact behaviour problem IS? We treat any
>NUMBER data type with DECIMAL(10,0) or greater as a python long because it
>can not be represented accurately in a 32-bit integer. The option (as was
>treated before) is to return a float, but this is losing accuracy.
----------------------------------------------------------------
:) Sure enough, the DECIMAL data type problem persists in
SybaseDA-2.0b2.
----------------------------------------------------------------
:) I nagged quite a bit in the zope mailing list about the
SybaseDA DECIMAL data type problem, even posted a patch for it.
Chris McDonough was kind enough to send everything to the
Collector, too. The relevant threads can be views at
Egroups.com under
http://www.egroups.com/group/zope/showthread.html?start=21025
http://www.egroups.com/group/zope/showthread.html?start=21108
----------------------------------------------------------------
It is very easy to cause the crash. Install your SybaseDAv2,
restart Zope, create (add) an instance of "Sybase DataBase
Connection", click on it, make sure that is it connected.
Now, go to the "Test" tab, issue the SQL command:
create table test (id decimal(10))
Hit "Submit Query". Good. The table is created. Now, go
to the "Test" tab again, issue the SQL command:
select * from test
Voila, crash.
Error Type: sy_occ.error
Error Value: Invalid buffer element type
...
File /usr/local/bs_zope/lib/python/Products/SybaseDAv2/db.py, line 239,
in query
sy_occ.error: (see above)
The error does not happen when you have 9 or fewer digits
in your DECIMAL data type declaration.
----------------------------------------------------------------
How to fix it? Simply follow the instructions given in my
posting (the message number 21108 with the URL provided
above.) Of course, I don't know what other data type problems
the adapter might have, nor whether my patch was done properly
or not. But at least for now, it works for me. :)
regards!
Hung Jung
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com