possible bug in MySQLdb?

Irene Barg ibarg at as.arizona.edu
Thu Oct 5 13:53:10 EDT 2000


Hello all,

This is related to G. David Kuhlman's '2000/08/21' response to
"Linux guy seeks help w/MS Access/Python" post reagarding 
output from 'cursor.description' (see below).  

.....from Khulman....
Then do something like the following:

>>> import dbi, odbc
>>> connection = odbc.odbc('People')
>>> cursor = connection.cursor()
>>> cursor.execute('select * from People')
0
>>> print cursor.description
[('id', 'NUMBER', 11, 10, 0, 0, 0), ('name', 'STRING', 50, 50, 0,
0, 1), ('phone
', 'STRING', 50, 50, 0, 0, 1), ('street', 'STRING', 50, 50, 0, 0,
1), ('city', '
STRING', 50, 50, 0, 0, 1), ('state', 'STRING', 50, 50, 0, 0, 1),
('zip', 'STRING
', 50, 50, 0, 0, 1)]
......end

Note, the first
index represents the column name, and the second the column type.
When I use 'cursor.description', my second index is a number,
not column type (see below):

>>> import MySQLdb 
>>> db = MySQLdb.Connect(host='localhost',user='myacct',passwd='secret',
db='adass')
>>> cursor = db.cursor()
>>> cursor.execute('select * from participant')
2369L
>>> print cursor.description
(('adassnum', 13, 4, 4, 4, 0, 0), ('name_l', 253, 21, 30, 30, 0, 0),
('name_f', 253, 13, 20, 20, 0, 1), ('name_m', 254, 1, 1, 1, 0, 1),
('affiliation', 253, 52, 60, 60, 0, 1))
>>> 

Is this a bug in MySQLdb?  Or is it something else?
I'm running Python 1.5.2, MySQLdb-0.2.1, MySQL 3.22.32 on RedHat
Linux 6.1.

Thanks,
-- irene

------------------------------------------------------------------
Irene Barg			Email:	ibarg at as.arizona.edu
Steward Observatory		Phone:  520-621-2602
933 N. Cherry Ave.
University of Arizona		FAX:    520-621-1891
Tucson, AZ  85721		http://nickel.as.arizona.edu/~barg
------------------------------------------------------------------



More information about the Python-list mailing list