Re: [Zope] ZMySQLDA
On 9/1/05, michael [EMAIL PROTECTED] wrote: Hi, I am trying to set this up, following install instructions from zope.org/Members/Mike/ZMySQLDA make -f Makefile command works fine, but 'make' afterwards produces the following error: That page, which no longer exists, was extraordinarily out of date. I deduce this from the fact that your compiler output is for MySQLmodule.c. Look here for modern versions: http://sourceforge.net/projects/mysql-python -- Computer interfaces should never be made of meat. http://www.terrybisson.com/meat.html ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Problem with ZSQLMethods/MySQL after update
Greg's right: ZMySQLDA-2.0.8 definitely won't work properly with MySQL-python-1.2.0. You need ZMySQLDA-2.0.9b3. On 6/29/05, Greg Fischer [EMAIL PROTECTED] wrote: I could be totally wrong, but just a thought You might remove the Zmysqlda 2.0.8 you have and download and install the 2.0.9b3. Do some reading before, and maybe you can simply reinstall 2.0.8. I cant remember what it was that needed 2.0.9, maybe it was just having mysqlpython 1.2.0. (because of mysql 4.1.x or new python, cant remember) Ok I am just thinking outloud now, sorry. But heck, if it helps. :) Greg On 6/28/05, Dieter Maurer [EMAIL PROTECTED] wrote: Ragnar Beer wrote at 2005-6-27 18:50 +0200: After upgrading Zope from version 2.6.4 to 2.8.0 and mysqlpython from 0.9.2 to 1.2.0 I cannot add or edit ZSQLMethods anymore, although there is an open (MySQL)db-Connection that works just fine with the same ZSQLMethods that cannot be edited or with external methods. The error I'm getting is: There are no SQL database connections. You need to add a Zope SQL database connection before you can edit a Zope SQL Method. Almost surely, your ZMySQLDA instances are broken (and then do not behave as SQL database connection instances). Check your Zope logfile for messages of the form could not install product -- Dieter ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) -- Greg Fischer 1st Byte Solutions http://www.1stbyte.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) -- Computer interfaces should never be made of meat. http://www.terrybisson.com/meat.html ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] MySQL timestamp issue
On 6/3/05, Hugo Ramos [EMAIL PROTECTED] wrote: I already know what exactly makes Zope hang! The problem is located at times.py that was installed by MySQL-Python 1.2.0 (MySQL-python.exe-1.2.0.win32-py2.4.zip) This is a package for Python-2.4. Are you using Python-2.4 with Zope-2.7? If you are, the line of people prepared to yell at you is long and distinquished. What version of ZMySQLDA are you using? Only 2.0.9b3 will work properly with MySQLdb-1.2.0. -- Computer interfaces should never be made of meat. http://www.terrybisson.com/meat.html ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] MySQL timestamp issue
On 6/3/05, Hugo Ramos [EMAIL PROTECTED] wrote: Yellow, I wrote the wrong version. I'm using MySQL 4.0.24 + Zope 276 + mysql-python 1.0.0 + ZMySQLDA 2.0.9b3 Take a look at ZMySQLDA/db.py: http://cvs.sourceforge.net/viewcvs.py/mysql-python/ZMySQLDA/lib/python/Products/ZMySQLDA/db.py?rev=1.21view=auto You may need to add a line like this to the DB class: conv[FIELD_TYPE.TIMESTAMP] = _mysql_timestamp_converter Not sure why this is missing. -- Computer interfaces should never be made of meat. http://www.terrybisson.com/meat.html ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] dollars-and-cents display fails
On 5/14/05, David H [EMAIL PROTECTED] wrote: Greg, Have you contacted the mySQL product maintainer? This is not a Zope community issue. Which is to say, many of us have the instinct to help but simply do not use mySQL and therefore have nothing to suggest. Other than what is obvious: a) contact the maintainer b) consider changing to a well-maintained data adapater. Ouch. But I guess if you'd followed the thread, you'd know the answer to your question... -- Computer interfaces should never be made of meat. http://www.terrybisson.com/meat.html ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] dollars-and-cents display fails
On 5/12/05, Greg Fischer [EMAIL PROTECTED] wrote: Thanks Andy. I do have those versions. But Python is 2.3.5 because I didnt want to move to 2.4.x as I think I read something in the README for Zope stating it was not tested for compatibility. (right?) I guess my thought is... Does 2.3.5 have the same issue as 2.4 regarding the decimals? For now, I am just going to setup 2.3.4 and run with it. The Python decimal type is new in 2.4. I don't think you've actually said whether or not you are actually using a DECIMAL column. I had forgotten that ZMySQLDA-2.0.9b3 always returns DECIMAL columns as Python float. If you look in ZMySQLDA/db.py, you can see where it does this in the DB class. You could try commenting this line out, which will cause it to be returned as a string, and restarting Zope. It's something to try, at least. -- Computer interfaces should never be made of meat. http://www.terrybisson.com/meat.html ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Z SQL Methods and the SQL LIMIT clause
On 5/11/05, Asad Habib [EMAIL PROTECTED] wrote: Is there a reason why Z SQL methods do not allow the use of the LIMIT clause? I am absolutely certain that my query has the right syntax since I executed it against the MySQL server and it gave me the correct results. FYI, I have provided the query below: SELECT course_id FROM course WHERE course_id 991000 ORDER BY course_id DESC LIMIT 1 Furthermore, Zope throws the following error when I try to test this query via the ZMI and also when I use it in my application: (1064, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 1000' at line 3) LIMIT is not a standard SQL clause. ZMySQLDA uses it internally, based upon the max_row properties of the Z SQL Method. If you want to use it, get rid of the LIMIT clause in your query, and set the max_rows property accordingly. Also, you can trick ZMySQLDA into not adding a LIMIT by putting a comment before your SQL statement. http://www.zope.org/Members/adustman/Tips/no_limits -- Computer interfaces should never be made of meat. http://www.terrybisson.com/meat.html ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] MySQLdb and unicode
On 5/6/05, robert rottermann [EMAIL PROTECTED] wrote: Hi there, I have a problem using MySQLdb and unicode. with older version (0.92) I could set a parameter unicode to the connect() method to tell MySQLdb what charset to use. This parameter is not accepted anymore. The only way to deal with non ascii character I found was setting pythons default charset to utf-8. In 1.2, you can set use_unicode=True to tell it to return text-like columns as unicode objects. This uses whatever the current character set is on the connection. Prior to MySQL-4.1, there was no way to change the character set being used via the client without at least restarting the server. In 4.1 and newer, you can change this with a client configuration file or with SQL; I recommend using read_default_file. If you're not using ZMySQLDA, then this really isn't a Zope issue, and you should follow-up in the Help forum: https://sourceforge.net/forum/forum.php?forum_id=70461 -- Computer interfaces should never be made of meat. http://www.terrybisson.com/meat.html ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope-dev] Making a ZSQL.DA fully multi-threaded?
On Fri, 16 Jul 2004 10:36:27 -0400, Brad Clements [EMAIL PROTECTED] wrote: The SAP folks say their adapter is multi-thread capable, but I've come to believe that only means that it's ok to open a connection in one thread and use it in another, but NOT to have 2 threads make requests on the same connection at the same time. I would be surprised to find any database API that allowed that. Generally thread-safe means that there are no global state variables, i.e. all connection state is encapsulated in the connection object/struct. Generally I would not try to share connections between threads at all. To do it, you'd need to ensure that a thread performs a commit or rollback on the connection before another thread can use it, i.e. performs a complete transaction or none at all. Otherwise you will have all sorts of interesting problems. Also, two threads can' t open a connection at the same time because their connection table management isn't thread safe. That does suck, but it doesn't seem like an insurmountable problem for a DA. You just need a per-DA instance mutex which you acquire before opening a connection release afterwards. ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] where is Zope 2.5.1?
On Wed, 2002-03-13 at 12:04, Brian Lloyd wrote: - Absolutely eliminate SQL db access as a cause (it sounds like we have proof of this now) This sounds like it is not specific to any DA. Is that the case? -- Andy Dustman PGP: 0x930B8AB6 @ .net http://dustman.net/andy You can have my keys when you pry them from my dead, cold neurons. ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Zope 2.6 planning - call for contributors!
On Fri, 2002-03-01 at 04:16, Dario Lopez-Kästen wrote: I'd like to see ZSQL methods altered so that bind variables could be used in SQL queries. +1, even though MySQL doesn't bind variables (yet, apparently in the works for 4.0). Another thing I would like (and could probably write) is an additional skip_rows parameter (default 0) to Z SQL Methods to complement max_rows. Since this needs to be passed to the DA's query(), and no DA's currently accept this parameter, one of these things need to happen: 1) Trap the TypeError that results from calling a query() that doesn't recognize skip_rows (used as a keyword parameter). In that case, fall back to query(q, max_rows+skip_rows) and return result[skip_rows:] in the Z SQL Method. 2) Add a new DA method query_range(q, skip_rows, max_rows); if AttributeError, fall back like #1. 3) Simply require all DA's to implement it in query() as a keyword parameter to maintain backwards compatibility with older Zopes. Adding this would make Z SQL Methods work a bit more like dtml-in ... start=skip_rows size=max_rows. There may be issues with result caching, but I don't think it'll be too much of a problem. -- Andy Dustman PGP: 0x930B8AB6 @ .net http://dustman.net/andy You can have my keys when you pry them from my dead, cold neurons. ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: hooking up gdb (was Re: [Zope-dev] More signal 11 restarts....)
On Wed, 2001-12-05 at 15:41, Matthew T. Kromer wrote: Leonardo Rochael Almeida wrote: We aren't getting any core files, even after setting ulimit correctly (although we could be setting it uncorrectly. I'll look into that further). Anyway, someone else in this list said that core dumps for threaded apps in Linux were mostly useless, so we aren't investing much energy in it anyway. With the short restart times we have, I'd prever a solution that didn't involve keeping a dead site dead for too long (as in, debugging with gdb). We are working in a ZEO scheme that would switch over the accelerator to proxy another zeo client, but we are not there yet. It would be ideal if we could instruct python to grab the SIG11, invoke gdb, get a C stacktrace for all threads and let Zope die in peace. If it all happend in a few seconds, we will still keep the client happy. Well largely, ALL I want is the backtrace -- and I'm wondering if I could cobble something together that could get it. The problem is it needs to look at the symbol table, and I dont know how to get at that via C -- ie, gdb doesnt have an interface that I know of that you can link in to grab a stack trace and exit. If you don't think a core dump is going to be useful, gdb isn't going to be either. I know I have gotten Zope to dump core before, and I think I did this with -Z '', i.e. don't start a management process. Then you need some other way to start Zope when it dies. As for ZMySQLDA/MySQLdb, I do know that the MySQL client libraries will crash if you try use the same connection more than once simultaneously in two different threads. I have never quite been sure whether or not there is some kind of locking in Zope to prevent threads from simultaneously using two database connections, since I expect this would cause problems on virtually all implementations. -- Andy Dustman PGP: 0x930B8AB6 @ .net http://dustman.net/andy You can have my keys when you pry them from my dead, cold neurons. ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] general ZMySQL question-wierd results
On Thu, 12 Apr 2001 [EMAIL PROTECTED] wrote: Here is how I created the tables: CREATE TABLE farm ( owner_id int primary key not null auto_increment, farm_name char (40), discipline char (30), owner_fname char(30), owner_lname char(30), farm_address1 char(50), farm_address2 char(50), city char(30), state char(2), zip char(5), country char (20), phone_area_code char(3), phone_no_area char(10), fax char(13), url char(30), email char(15), nearest_city char(15), nearest_city_distance int, add_date date, edit_date date, details char (250)) Here is how I populate the first record: insert into horse101.farm (owner_id,farm_name,discipline,owner_fname,owner_lname,farm_address1,farm_addr ess2,city,state,zip,country,phone_area_code,phone_no_area,fax,url,email,nearest_cit y,nearest_city_distance,add_date,edit_date,details) values(0,'Riverbed Farm','dressage','Vicki','Wall-Kelley','Volkerts Rd.','','Sebastopol','CA','95472','USA','707','829-5824','425-123- 1234','http://www.dressage.to','[EMAIL PROTECTED]','San Francisco',60,2001-04- 10,2001-04-10,'Providing dressage instruction, training, judging as well as offering for sale imported and domestic dressage prospects.') Here is how I attempt to see the records: select * from farm Here are my results: Owner id= P Farm name=r Discipline=o Owner fname=v ,etc. You see, the last field is being inserted into the other fields one char at a time. Any help would be GREATLY appreciated. Owner id (owner_id) can't be 'P' because it is a numeric column. I suspect if you use the mysql client program, you will find that the correct values are in there. -- Andy Dustman PGP: 0xC72F3F1D @ .net http://dustman.net/andy "Normally with carbonara you use eggs, but I used lobster brains instead." -- Masahiko Kobe (Iron Chef Italian): 30-year-old Giant Lobster Battle ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] LONGing for normal inetegers...
On 12 Feb 2001, Morten W. Petersen wrote: [Jon Franz] | I had this problem in the past and hacked the mysql DA to fix it, then | dicovered to my dismay I was using an out-of-date mysqlDA and it had already | been fixed... Which DA are you using? Using Python 2.0 could solve this problem, as longs are no longer rendered with the L suffix. That's my preferred solution, but also see: http://www.zope.org/Members/adustman/Tips/no_el -- Andy Dustman PGP: 0xC72F3F1D @ .net http://dustman.net/andy "Normally with carbonara you use eggs, but I used lobster brains instead." -- Masahiko Kobe (Iron Chef Italian): 30-year-old Giant Lobster Battle ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope] MYSQL Problem
On Sun, 28 Jan 2001, Jens Grewen wrote: I installed mySQL-3.23.32 mySQLdb 0.3.1 ZmySQLDA 2.0.4 When I change to mediumint (database field description) I get the expected 233. How can I fix this. You just did. :) If a mediumint is big enough for you, use that. As Ron points out, INTEGER (particularly UNSIGNED) can overflow in Python, so they need to be returned as Python long integers. Python adds the L when doing str(), but Python 2.0+ does not do this (only on repr()). -- Andy Dustman PGP: 0xC72F3F1D @ .net http://dustman.net/andy "Normally with carbonara you use eggs, but I used lobster brains instead." -- Masahiko Kobe (Iron Chef Italian): 30-year-old Giant Lobster Battle ___ 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 )
RE: [Zope] ZMySQLDA problems after upgrade
On Fri, 26 Jan 2001, Ron Bickers wrote: How about excluding the automatic LIMIT clause if max_rows is set to 0? Would that confuse people? Oh! It already does that. So if you want to make your own LIMIT clause, just set max_rows to 0. Correct me, Andy, if this is a bad thing. That sounds very much like a good thing. I will have to add that to the tip I have (really, re-write it). I actually forgot that it did that. Randy, does setting max_rows to zero fix things for you? -- Andy Dustman PGP: 0xC72F3F1D @ .net http://dustman.net/andy "Normally with carbonara you use eggs, but I used lobster brains instead." -- Masahiko Kobe (Iron Chef Italian): 30-year-old Giant Lobster Battle ___ 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 )
RE: [Zope] ZMySQLDA problems after upgrade
On Fri, 26 Jan 2001, Randall F. Kern wrote: You will get 0 rows if you use max_rows=0. OK, I agree that this is a legit bug, and I am in the process of working up a new patch. I'll send it off-list when it's ready. -- Andy Dustman PGP: 0xC72F3F1D @ .net http://dustman.net/andy "Normally with carbonara you use eggs, but I used lobster brains instead." -- Masahiko Kobe (Iron Chef Italian): 30-year-old Giant Lobster Battle ___ 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 )
Re: [Zope] MySQL
On Fri, 26 Jan 2001, Piotr Kozbial wrote: I have upgraded to MySQL 3.23.28 and both ZMySQLDA and ZMySQLTDA were broken.Thus I have installed latest ZMySQLDA-2.0.4 and MySQLdb 0.3.1. MySQL-3.23.32 would be a good idea. It has at least one security fix, and a lot of bug fixes. Ufter upgrade it does not work. File /opt/www/zope/lib/python/DocumentTemplate/DT_In.py, line 711, in renderwob (Object: single_id_hasla2) KeyError: (see above) I have no idea for that one. I am unable to use TIMESTAMP from database ie.: File /opt/www/zope/lib/python/Products/ZMySQLDA/db.py, line 104, in _mysql_timestamp_converter ValueError: (see above) Can you find out what the value is that it doesn't like? What is wrong. Is is MySQL or ZOPE or ZMySQLDA problem? Possibly ZMySQLDA. I would need to see specifically what the error message is that comes with the ValueError exception. -- Andy Dustman PGP: 0xC72F3F1D @ .net http://dustman.net/andy "Normally with carbonara you use eggs, but I used lobster brains instead." -- Masahiko Kobe (Iron Chef Italian): 30-year-old Giant Lobster Battle ___ 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] Re: connecting mysql db from zope
On Fri, 19 Jan 2001, jacintha menezes wrote: hi, AS you said i installed MySQLbd-0.3.0 ZMySQLDA-2.0.2 . When i started Zope it gave the following error.What more do we have to do ?.Please help. File /zope/zope-linux/lib/python/Products/ZMySQLDA/db.py, line 89, in ? ImportError: No module named _mysql If you really have MySQLdb-0.3.0 installed, Zope can't find it. If you do a standard installation (python setup.py install), it should install it in /usr/lib/python1.5/site-packages (typically). File lib/python/Products/ZSolidDA/db.py, line 99, in ? ImportError: No module named sql See, you have the same problem for the ZSolidDA. I would suggest modifying z2.py to print sys.path shortly after importing sys. This will tell you where python is looking for modules. If MySQLdb is not installed in one of those directories, that is your problem. -- Andy Dustman PGP: 0xC72F3F1D @ .net http://dustman.net/andy ___ 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 )
Re: [zope] : installation of MySQL
On Wed, 17 Jan 2001, K H Subrahmanyan wrote: hi, I am using ZOPE in Linux. Now I want to install MySQL to that. I have installed MySQLDA and MySQLdb to that. but still that is giving the following error. kindly help me. ZMySQLDA Import Traceback Traceback (innermost last): File "/zope/zope-linux/lib/python/OFS/Application.py", line 397, in import_products product=__import__(pname, global_dict, global_dict, silly) File "/zope/zope-linux/lib/python/Products/ZMySQLDA/__init__.py", line 106, in ? import sys, os, Globals, DA File "/zope/zope-linux/lib/python/Products/ZMySQLDA/DA.py", line 108, in ? from db import DB File "/zope/zope-linux/lib/python/Products/ZMySQLDA/db.py", line 106, in ? import MySQL, regex, sys ImportError: Bad magic number in /zope/zope-linux/lib/python1.5/MySQL.pyc Well, for starters, there's no MySQL.py (or .pyc) in MySQLdb. SO: You are using an old ZMySQLDA. Judging from the traceback, you are using 1.1.3. Please read http://www.zope.org/Members/adustman/MySQL_Updates for more information. ZMySQLDA-2.0.2 is about to be pushed out the door (waiting on some user feedback). I'm going to send that to you off-list, along with MySQLdb-0.3.0. -- Andy Dustman PGP: 0xC72F3F1D @ .net http://dustman.net/andy ___ 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 )
Re: [Zope] Trouble installing ZMySQLTDA
On Wed, 17 Jan 2001, Vinny wrote: Ok, it's Vinny again, I am trying to get ZMySQLTDA up and running. After installation ZMySQLTDA appears in the Product folder but gives a 'broken' status instead of "installed" I have MySQL-python-0.3.0 installed. Has this worked OK for anyone else? It seems to work OK for me, though I just pushed out version 2.0.2. http://dustman.net/andy/python/ZMySQLDA/2.0.2 File "/usr/local/Zope-2.2.5-linux2-x86/lib/python/Products/ZMySQLTDA/db.py", line 4, in ? class DB(DB, TM): NameError: DB Is this line at the top of that file?: from Products.ZMySQLDA.db import * -- Andy Dustman PGP: 0xC72F3F1D @ .net http://dustman.net/andy ___ 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 )
Re: [Zope] ZMySQLDA returns truncated/corrupted data?
On Mon, 15 Jan 2001 [EMAIL PROTECTED] wrote: I am running Zope from the CVS (from January 14th), MySQL 3.22.23 and ZMySQLDA v2.0.1. Are you really running MySQL 3.22.23? This is a rather old version. 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. That's very odd, because it works for me. If I try "SELECT * FROM ARTIKKEL;", I get Error Type: TypeError Error Value: len() of unsized object I don't know if this is the problem, but ZMySQLDA-2.0.1 requires MySQLdb-0.3.0 (aka MySQL-python). These should both work with MySQL-3.22.23, though I would recommend an upgrade to at least 3.22.32 (or 3.23.30). -- andy dustman | programmer | comstar.net is part of the Globix network telephone: 770.485.6025 / 706.549.7689 | icq: 32922760 | pgp: 0xc72f3f1d "Therefore, sweet knights, if you may doubt your strength or courage, come no further, for death awaits you all, with nasty, big, pointy teeth!" ___ 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] Re: mysql connection string
On Mon, 15 Jan 2001, Olaf Zanger wrote: first: right now my setup uses a connection string db root which doesn't seam to give a lot of savety :-). at my provider i have a login, but sure no root access to the db. * how does the connection string look for user name peter-hauser and password test3-.2? * has the user to be set up in linux ? * how is the setup made in mysql? i tried with grant all privileges on *.* to peter-hauser@localhost; and set password for peter-hauser=password('test3-.2'); but wasn't successful. * has zope to be run by user peter-hauser? second? to set up a 3-tier application i should know how to connect mysql through MySQL-python 0.3.0 and ZMySQLDA 2.0.1 to my db-server. * i can browse from the zope server to the db-server pit and otherway round with the names pit and pitechon, so hosts file should be correct. * how has the connection string to look like? i tried db@pit 'peter-hauser' but it didn't work? * has mysql to be started with an special flag to open a port? * does it work with the ip-number? I thought what it printed when you created the connection would be sufficient: The connection string used for Z MySQL Database Connection is of the form: database[@host[:port]] [user [password [unix_socket]]] or typically: database user password to use a MySQL server on localhost via the standard UNIX socket. Only specify host if the server is on a remote system. You can use a non-standard port, if necessary. If the UNIX socket is in a non-standard location, you can specify the full path to it after the password. ...so you want something like: db@pit peter-hauser test3-.2 If pit is the local host: db peter-hauser test3-.2 ...will be faster and use the standard UNIX socket. You do not necessarily need a UNIX user by that name. Your GRANT statement looks basically correct, but check the MySQL documentation. -- Andy Dustman PGP: 0xC72F3F1D @ .net http://dustman.net/andy ___ 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 )
Re: [Zope] MySQLdb
On Thu, 11 Jan 2001, Martin Fekete wrote: sombody compiled MySQLdb under WIN32 ? Somebody has. Look for a link at: http://dustman.net/andy/python/MySQLdb/0.3.0 -- andy dustman | programmer | comstar.net is part of the Globix network telephone: 770.485.6025 / 706.549.7689 | icq: 32922760 | pgp: 0xc72f3f1d "Therefore, sweet knights, if you may doubt your strength or courage, come no further, for death awaits you all, with nasty, big, pointy teeth!" ___ 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 )
Re: [Zope] MySQLDA and MySQL-python - patch needed?
On Wed, 10 Jan 2001 [EMAIL PROTECTED] wrote: My Zope-MySQL connection is still not quite working. It appears that the request from Zope is reaching MySQL and it if is an UPDATE or INSERT query it executes properly on the MySQL side. However, SELECT queries and similar are not getting their information back to Zope from MySQL. Is there some patch I am missing here? Anybody know how to fix this? FYI: I installed from these rpms ftp://ftp.logicetc.com/pub/Zope/RPMS/MySQL-python-0.2.1-1.i386.rpm ftp://ftp.logicetc.com/pub/Zope/RPMS/Zope-ZMySQLDA-1.2.0-1.i386.rpm You might also try: http://www.zope.org/Members/adustman for MySQLdb-0.3.0 and ZMySQLDA-2.0.1, which includes a transactional DA for MySQL servers with BDB tables (3.23.30 recommended). -- andy dustman | programmer | comstar.net is part of the Globix network telephone: 770.485.6025 / 706.549.7689 | icq: 32922760 | pgp: 0xc72f3f1d "Therefore, sweet knights, if you may doubt your strength or courage, come no further, for death awaits you all, with nasty, big, pointy teeth!" ___ 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 )
Re: [Zope] duplicate column name
On Thu, 7 Dec 2000, Olaf Zanger wrote: Ivan Cornell schrieb: Olaf Zanger wrote: i work with postgreSQL 7.0.2, ZPyGreSQLDA-0-0-3 and zope 2.2.2 on suse 7.0 linux when i try the line - select adr.id,fac.id from fac, adr You probably need to alias the columns: select adr.id as adr_id, fac.id as fac_id from fac, adr and then refer to adr_id fac_id from zope. [can't remember why, but think it is due to the way columns are addressed in libpq] thanks, worked out fine, gets a bit tricky though :-) as visible further down it is not needed in "where" and "order by" clauses *ç%?! select fac.id as fac_id, adr.id as adr_id, fac.name as fac_name, adr.id as adr_id, owner_adr_id, from fac,adr where fac.name like '%' and adr.id=owner_adr_id and fac.mod_id=mod.id order by fac.name I suspect a lot of databases are like this, and it depends on implementation of the DA. As an example, the original ZMySQLDA (circa 1.1.3), using MySQLmodule-1.4, probably returned all column names as table.column. Versions of ZMySQLDA that use MySQLdb (i.e. the patched 1.1.3, 1.2, and 2.0.x) use just the column name. adr.id and fac.id have the same column name, of course. I'm a little surprised that some DAs would return column names with periods in them, since this would require using the special namespace object to get at them, i.e. _['adr.id']. The WHERE and ORDER BY clauses can use table.column references without any problem. The issue is the names of the columns returned by a SELECT. -- andy dustman | programmer | comstar.net is part of the Globix network telephone: 770.485.6025 / 706.549.7689 | icq: 32922760 | pgp: 0xc72f3f1d "Therefore, sweet knights, if you may doubt your strength or courage, come no further, for death awaits you all, with nasty, big, pointy teeth!" ___ 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 )
Re: [Zope] ANNOUNCE: Zope 2.2.1 released
Sadly, 2.2.1 seems to break all my ZClass objects. The Products themselves look fine, but any object made with them comes up as broken. The Class ID (in the HTML source) looked like it had a * in front of it. I retrograded to 2.2.0 and the problems went away. -- andy dustman | programmer/analyst | comstar.net, inc. telephone: 770.485.6025 / 706.549.7689 | icq: 32922760 | pgp: 0xc72f3f1d "Therefore, sweet knights, if you may doubt your strength or courage, come no further, for death awaits you all, with nasty, big, pointy teeth!" ___ 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 )
Re: [Zope] Zope culture (Was: [Zope] Simple DTML date-stamp)
On Mon, 14 Aug 2000, William BC Crandall wrote: Andy Dustman's documentation for what seems like a nice MySQL interface puts it clearly: PWindows is EMnot/EM a supported platform. Yeah, that's just me. I don't support Windows in any way. However, MySQLdb does work there, so I am told. If you can't get it to compile or something, I can't help you. -- andy dustman | programmer/analyst | comstar.net, inc. telephone: 770.485.6025 / 706.549.7689 | icq: 32922760 | pgp: 0xc72f3f1d "Therefore, sweet knights, if you may doubt your strength or courage, come no further, for death awaits you all, with nasty, big, pointy teeth!" ___ 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 )
RE: [Zope] MySQL transaction support (was: MySQL Select Statements)
On Mon, 3 Jul 2000, Monty Taylor wrote: Why not have one ZmySQLDA that attempts to determine whether it is transactional or not when the connect method is executed. That way you could have a DA connect to your 3.22 database, upgrade your database to 3.23.15 and not see any problems. A combination of try-except:ing an attempted "begin rollback" block and a test for database type should do the trick, no? If it's 3.22 or earlier, the begin-rollback should throw the synax error Andy mentioned. If that's ok, a test for database type (not sure about this one) to see if it's BDB? If all of this is wrapped in the connect method, we should be able to make it 'do the right thing' There are two factors which determine whether or not transactions can be supported. Actually, there's only one, but it can't be directly tested for: 1) If the server version (easily obtained upon establishing the connection) is 3.23.15, transactions are definitely not supported. 2) If the database in use employs BDB tables, transactions are definitely supported. The problem is: Support for the transaction manager is done with a MixIN class, so the decision on whether or not transactions should be supported in the DA comes before the connection object is created. Which raises an interesting possibility: On the connection object's Properties tab, add a checkbox which indicates that transactional semantics are required. The status of this checkbox determines which class is used for the database connection. This might be workable, not really sure. -- andy dustman | programmer/analyst | comstar.net, inc. telephone: 770.485.6025 / 706.549.7689 | icq: 32922760 | pgp: 0xc72f3f1d "Therefore, sweet knights, if you may doubt your strength or courage, come no further, for death awaits you all, with nasty, big, pointy teeth!" ___ 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 )
Re: [Zope] MySQL transaction support (was: MySQL Select Statements)
On Tue, 4 Jul 2000, Hannu Krosing wrote: AFAIK the transaction support is enabled on table-by-table basis, so there is no way to know for sure if transactions are supported/partially-supported/unsupported for a particular set of queries True enough. There are several problems here: 1) We must avoid using BEGIN/COMMIT/ROLLBACK on servers 3.23.15 because it will result in syntax errors. 2) We must raise exceptions whenever the DA attempts to use transacation semantics and the database cannot fulfill this. Silently allowing the transaction manager to believe ROLLBACK has succeeded when it is actually doing nothing is a bad thing. 3) Even though the server may support transactions, the tables may not. Calling ROLLBACK hopefully produces an error, which is a good thing. 4) Calling ROLLBACK in AUTOCOMMIT mode probably does not produce an error. This is bad, but easily avoided by using BEGIN to force a transaction. Does this cause MySQL to produce an error if the tables don't support it? I don't know. Probably not. IMHO, the only good way to avoid these problems is to effectively have two DAs: A transactional one and a non-transactional one, perhaps determined by a Zope property. The application designer will have to choose which DA to use for a given application. Note also: With non-transactional databases, you would expect to get better performance by having several open connections which are not shared. In the case of MySQL, each connection has it's own server thread, and this can exploit CPUs, if available. However, connections should not be shared on transactional databases, because transactions are tied to a connection, and not a cursor. Even if there is a mutex to keep multiple threads from executing queries simultaneously on the same connection, the transactions are going to be whacky. -- andy dustman | programmer/analyst | comstar.net, inc. telephone: 770.485.6025 / 706.549.7689 | icq: 32922760 | pgp: 0xc72f3f1d "Therefore, sweet knights, if you may doubt your strength or courage, come no further, for death awaits you all, with nasty, big, pointy teeth!" ___ 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 )
RE: [Zope] MySQL Select Statements
I should point out that 0.2.2 has not been fully released yet. There's a bug I have to iron out of it first. Probably next week. Also, for general MySQLdb questions, send them to [EMAIL PROTECTED] (mailing list). Or subscribe, it's low-volume and won't fatten your mailbox. On Fri, 30 Jun 2000, Michael Blewett wrote: It's funny that you say 0.2.2 is broken. Apart from this one glitch, it works fine for me (although from memory I think we had to do a little bit of fiddling at install time to get it to work). It's a matter of perspective. I prefer to think of it as 0.2.2 breaks ZMySQLDA. This is because ZMySQLDA uses _mysql, and _mysql prior to 0.2.2 implemented fetch_row(), fetch_rows(), fetch_all_rows(), and the ..._as_dict() variants. This was just too much code duplication to put up with, and the new interface is fetch([n[,how]]) where n is the maximum number of rows to fetch (default 1), and how is how to return the result (0: as tuple, 1: as dictionary, other codes may be added at some point). To fix ZMySQLDA, change fetch_all_rows() to fetch(maxrows) in the query routine. One other place (to get the tables) uses fetch_all_rows(). If you insist on using 0.2.2 at this point, change that as well. 0.2.2 is marked Alpha for a reason... And when I release it, I'll include a very small patch to make things right with ZMySQLDA again (I'm treating mordred's as the official one at this point). At 00:12 30/06/2000 -0400, Ron Bickers wrote: Why do you say you "must" use the AS statement? Do you get an error otherwise? MySQLdb 0.2.2 is broken when used with ZMySQLDA. But 0.2.1 works okay for me. Andy Dustman (author of the MySQLdb) said he will fix it and hinted that one should use the ZMySQLDA that is on Zope.org (v1.2.0 now I believe). Since that one now uses his MySQLdb, he will likely kill off his own DA. Quite true. Now for the AS statement: If you are joining tables with identically-named columns in common, you should use AS in your SQL to rename them. Otherwise it will return two columns with the same name to Zope, which is bad. You do not, however, need to do this: Just need someone to put me straight here. When I use Select statements in an SQL Method I cannot simply : Select Column1, Column2 etc from TableA. Instead I must use the AS statement ie Select Column1 AS Column1, Column2 AS Column2 from TableA. - Michael This is just gratuitious renaming to the original name, which is not renaming at all. Here's an example of what I'm talking about. SELECT TableA.Col, TableB.Col from TableA, TableB # bad SELECT TableA.Col AS ColA, TableB.Col AS ColB from TableA, TableB # good Note that the first SELECT returned two columns named Col, which will confuse Zope, and the second returns ColA (TableA.Col) and ColB (TableB.Col). Additional compatibility note: One of the 0.2.2 changes has been to synchronize with MySQL-3.23 evolution (now at 3.23.19-beta, and GPL'd), and the big feature here is: Transactions! Yes, as of 3.23.15, transactions are in MySQL, if you use BDB tables. And yes, BDB does mean Berkeley DB, specificially the Sleepycat DB v3, which supports transactions (but probably not columns, which I presume MySQL is imposing on the database). For ZMySQLDA developers out there; MySQL-3.23 defaults to autocommit. However, there is a BEGIN SQL statement which starts a transaction and similarly for COMMIT and ROLLBACK statements. But remember: All this transactional stuff ONLY works on BDB tables. If you try to BEGIN a transaction (or turn off autocommit) on another table type, well, I'm not sure what happens. Maybe you get an error, and maybe you don't. Not sure what the solution is for this. It may be necessary to have the ZMySQLDA package include another DA: ZMySQLTDA for transactions. The standard DA would not be based on TM, and the transactional one could simply subclass the other one: # ZMySQLTDA/db.py from Shared.DC.ZRDB.TM import TM class DB(ZMySQLDA.DB, TM): def _begin(self, *ignored): self.db.query("BEGIN") def _finish(self, *ignored): self.db.query("COMMIT") def _abort(self, *ignored): self.db.query("ROLLBACK") Obviously the application designer will have to use the right DA for the right table type... -- andy dustman | programmer/analyst | comstar.net, inc. telephone: 770.485.6025 / 706.549.7689 | icq: 32922760 | pgp: 0xc72f3f1d "Therefore, sweet knights, if you may doubt your strength or courage, come no further, for death awaits you all, with nasty, big, pointy teeth!" ___ 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 )