I am pretty sure this code just needs to be thrown out, but before I do I'll
throw it here.
The problem is the user needs read access to the INFORMATION_SCHEMA db, which
they don't need to use SHOW COLUMNS or DESCRIBE. but I hear that is a
'standard' db across servers, so it might be good to put in the superclass as a
'use this if there isn't any other way'.
The error I got trying to hit the dabo demo server:
_mysql_exceptions.OperationalError: (1142, "SELECT command denied to user:
'[EMAIL PROTECTED]' for table 'COLUMNS'")
def getFields(self, tableName):
""" Returns the list of fields of the passed table
field: ( fieldname, dabo data type, key )
"""
tempCursor = self._connection.cursor()
# fairly standard way of getting column settings
# this may be standard enough to put in the super class
tempCursor.execute(
"select COLUMN_NAME, DATA_TYPE, COLUMN_KEY"
" from INFORMATION_SCHEMA.COLUMNS"
" where table_name = %(table)s"
" order by ORDINAL_POSITION"
% {'table':tableName} )
rs = tempCursor.fetchall()
fields = []
for r in rs:
name = r[0].strip()
ft = self._fieldTypeNativeToDabo(r[1])
pk = (r[2] == "PRI")
fields.append((name, ft, pk))
return tuple(fields)
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev