def get_table_metadata(self, table, cursor):
        """
        Get the metadata for a table. Returns a list of tuples, one for
        each column. Each tuple consists of the following::

            (column_name, type_string, max_char_size, precision, scale, nullable)

        The tuple elements have the following meanings.

        column_name
            the name of the column
        type_string
            the column type, as a string
        max_char_size
            the maximum size for a character field, or ``None``
        precision
            the precision, for a numeric field; or ``None``
        scale
            the scale, for a numeric field; or ``None``
        nullable
            ``True`` if the column is nullable, ``False`` if it is not

        The tuples are named tuples, so the fields may be referenced by the
        names above or by position.

        The default implementation uses the DB API's ``cursor.description``
        field. Subclasses are free to override this method to produce their
        own version that uses other means.

        :Parameters:
            table : str
                the table name for which metadata is desired
            cursor : Cursor
                a ``Cursor`` object from a recent query

        :rtype: list
        :return: list of tuples, as described above

        :raise Warning: Non-fatal warning
        :raise Error:   Error
        """
        self._ensure_valid_table(cursor, table)
        dbi = self.get_import()
        cursor.execute('SELECT * FROM %s WHERE 1=0' % table)
        result = []
        for col in cursor.description:
            name = col[0]
            type = col[1]
            size = col[2]
            internalSize = col[3]
            precision = col[4]
            scale = col[5]
            nullable = col[6]

            sType = None
            try:
                if type == dbi.BINARY:
                    stype = 'blob'
                elif type == dbi.DATETIME:
                    stype = 'datetime'
                elif type == dbi.NUMBER:
                    stype = 'numeric'
                elif type == dbi.STRING:
                    sz = internalSize
                    if sz == None:
                        sz = size
                    elif sz <= 0:
                        sz = size

                    if sz == 1:
                        stype = 'char'
                    else:
                        stype = 'varchar'
                    size = sz
                elif type == dbi.ROWID:
                    stype = 'id'
            except AttributeError:
                stype = None

            if not sType:
                stype = str(type) % 'unknown (type code=%s)'

            data = TableMetadata(name, stype, size, precision, scale, nullable)
            result += [data]

        return result
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/grizzled/grizzled/db/base.py/DBDriver.get_table_metadata/swapped operands of `%`