[Zope] ZMySQLDA returns truncated/corrupted data?

2001-01-15 Thread aasmund


I am running Zope from the CVS (from January 14th), MySQL 3.22.23 and
ZMySQLDA v2.0.1.

The install appears to be successfull, the Products appear in the Control
Panel, I can add, and open a database connection.

However, when I issue the following query:

SHOW TABLES;

I receive the following set:

Tables in la_eksempel

a

(la_eksempel the name of the database, naturally)

There is no table named 'a', however there is a table named "artikkel". If
I try to browse the database, I get a tree with 5 first-level nodes, all
named with the first letter of a table in my database.

If I try "SELECT * FROM ARTIKKEL;", I get 

Error Type: TypeError
Error Value: len() of unsized object

With the following traceback:


Traceback (innermost last):
  File /home/ahj/polar/zope/Zope2/lib/python/ZPublisher/Publish.py, line
222, in publish_module
  File /home/ahj/polar/zope/Zope2/lib/python/ZPublisher/Publish.py, line
187, in publish
  File /home/ahj/polar/zope/Zope2/lib/python/Zope/__init__.py, line 221,
in zpublisher_exception_hook
(Object: RoleManager)
  File /home/ahj/polar/zope/Zope2/lib/python/ZPublisher/Publish.py, line
171, in publish
  File /home/ahj/polar/zope/Zope2/lib/python/ZPublisher/mapply.py, line
160, in mapply
(Object: manage_test)
  File /home/ahj/polar/zope/Zope2/lib/python/ZPublisher/Publish.py, line
112, in call_object
(Object: manage_test)
  File /home/ahj/polar/zope/Zope2/lib/python/Shared/DC/ZRDB/Connection.py,
line 204, in manage_test
(Object: RoleManager)
  File
/home/ahj/polar/zope/Zope2/lib/python/DocumentTemplate/DT_String.py, line
538, in __call__
(Object: string)
  File /home/ahj/polar/zope/Zope2/lib/python/DocumentTemplate/DT_In.py,
line 605, in renderwb
(Object: db)
  File /home/ahj/polar/zope/Zope2/lib/python/Shared/DC/ZRDB/Results.py,
line 174, in __getitem__
TypeError: (see above)



Has anybody else experienced this?



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] MySQLDA and images beeing corrupted

2001-01-12 Thread aasmund


I am using Zope 2.3a2, and MySQLDA 1.1.3, with one patch installed (it was
supposed to fix problems with autoincrement fields)

Everything is installed, with no apparent problems.

I would like to store images as BLOBs in a MySQL database (version 3.22)

I am able to store the images in the database, but somehow, along the way,
they become corrupted, and show up in the browser as a corrupted image.
I can, howover, recognize some of the features of the original image. The
top part is mostly intact, and the colours seem right.

The image is retreived from the database like this: method named "image",
with everything *on one line*.

dtml-in hent_bilde
dtml-call "RESPONSE.setHeader('Content-Type', 'image/gif')"
dtml-call "RESPONSE.setHeader('Content-Length', _.len(bildefil))"
dtml-var bildefil
/dtml-in

With "hent-bilde" as follows:

select * from bilder
where
dtml-sqltest id type=int

The URL used is: "/image?id=10"


The image is stored in the database as follows:


insert into bilder 
(bildefil, kilde, kommentar, bildetype) 

values (

dtml-sqlvar "REQUEST['bildefil'].read()" type=string,

dtml-sqlvar kilde type=string,
dtml-sqlvar kommentar type=string,
dtml-sqlvar bildetype type=string
   );



Any ideas?

I feel like I am *so* close to making this work!


smund Hjulstad



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )