'PYTHON-413'

def test_non_alphanum_identifiers(self):

    s = self.session
    non_alphanum_name = 'test.field@#$%@%#!'
    type_name = 'type2'
    s.execute(('CREATE    TYPE    "%s"    ("%s"    text)' % (non_alphanum_name, non_alphanum_name)))
    s.execute(('CREATE    TYPE    %s    ("%s"    text)' % (type_name, non_alphanum_name)))
    s.execute(('CREATE    TABLE    %s    (k    int    PRIMARY    KEY,    non_alphanum_type_map    map<frozen<"%s">,    int>,    alphanum_type_map    map<frozen<%s>,    int>)' % (self.table_name, non_alphanum_name, type_name)))
    s.execute(('INSERT    INTO    %s    (k,    non_alphanum_type_map,    alphanum_type_map)    VALUES    (%s,    {{"%s":    \'nonalphanum\'}:    0},    {{"%s":    \'alphanum\'}:    1})' % (self.table_name, 0, non_alphanum_name, non_alphanum_name)))
    row = s.execute(('SELECT    *    FROM    %s' % (self.table_name,)))[0]
    (k, v) = row.non_alphanum_type_map.popitem()
    self.assertEqual(v, 0)
    self.assertEqual(k.__class__, tuple)
    self.assertEqual(k[0], 'nonalphanum')
    (k, v) = row.alphanum_type_map.popitem()
    self.assertEqual(v, 1)
    self.assertNotEqual(k.__class__, tuple)
    self.assertEqual(k[0], 'alphanum')
    self.assertEqual(k.field_0_, 'alphanum')
