def join_keys(keys,sep=','):
    """
    >>> join_keys(['key1'])
    'key1'
    >>> join_keys(['key1','key2'])
    'key1,key2'
    >>> join_keys(['key1','key2'],'.')
    'key1.key2'
    >>> join_keys(['key.1','key2'],'.')
    "'key.1','key2'"
    >>> join_keys(['key,1','key2'],'.')
    "'key,1','key2'"
    >>> join_keys([])
    'DEFAULT'
    """
    if not keys:
        return 'DEFAULT'
    mash = ''.join(keys)
    if '.' in mash or ',' in mash:
        quote = "'"
        sep = quote + ',' + quote
        return quote + sep.join(keys) + quote
    return sep.join(keys)