I'm having some problems using the callproc() in
MySQLdb 1.2.1_p2. Actually I'm not able to get it
going unless i make a minor change in cursors.py.
I'm using this simple script:
Con = MySQLdb.Connect(host="localhost", port=3306,
user="root", passwd="[your_pwd_here", db="test")
Cursor = Con.cursor()
Results = Cursor.fetchall()
As you can see it has some prerequisites regarding
the MySQL, so I've attached a script creating the
database 'Test' complete with the needed table, sproc
and 3 lines of data.
If I run the script on a local MySQL (beware: It will
overwrite any database called 'Test') and run the .py-
script I get: ProgrammingError "execute() first".
I think it might be a problem with the setting of
self._executed in cursors.py - but I'm far from sure.
My guess is that the _executed should be set to the
query just executed and this just isn't in the
current cursors.py as far as I can see.
Two ways of fixing it (and maybe causing mayhem
1) change the only occurence of '_last_executed'
to '_executed' in cursors.py(_do_query)
2) insert 'self._executed = q' before
the 'self._warning_check()' in cursors.py(callproc)
As far as I can tell we have to possibilites here -
either I'm missing something important and the
MySQLdb 1.2.1_p2 has a fully functional callproc()
method, OR it's a bug. Which one is it? :)
Thx for your effort so far (creating MySQLdb - and
reading this ;))
Log in to post a comment.