'Find the name of the CLOB type, if any.'

def configure_clob_type(sql):

    long_str = ('x' * 10000)
    sql.drop_table_if_exists(('%stest_1' % sql.prefix))
    for val in ['CLOB', 'LONGTEXT', 'TEXT', 'LONG']:
        try:
            sql.ddl(('CREATE    TABLE    %stest_1    (a    %s)' % (sql.prefix, val)))
            sql.sql(('INSERT    INTO    %stest_1    (a)    VALUES    (?)' % sql.prefix), (sql.binin(long_str),))
            out = sql.selectrow(('SELECT    a    FROM    %stest_1' % sql.prefix))[0]
            if (sql.binout(out) == long_str):
                sql.config['clob_type'] = val
                sql.log.info('clob_type=%s', val)
                return
            else:
                sql.log.debug('out=%s', repr(out))
        except sql.module.DatabaseError as e:
            sql.rollback()
        except Exception as e:
            try:
                sql.rollback()
            except Exception:
                sql.reconnect()
                raise
        finally:
            sql.drop_table_if_exists(('%stest_1' % sql.prefix))
    sql.log.info('No    native    type    found    for    CLOB.')
    sql.config['clob_type'] = NO_CLOB
