From: Jason Kirtland Date: Thu, 27 Sep 2007 17:23:41 +0000 (+0000) Subject: - The IdentifierPreprarer's _requires_quotes test is now regex based. X-Git-Tag: rel_0_4_0~95 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c1221b7cd3392104a2ad0b183a4b44485d3166c4;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - The IdentifierPreprarer's _requires_quotes test is now regex based. Any out-of-tree dialects that provide custom sets of legal_characters or illegal_initial_characters will need to move to regexes or override _requires_quotes. --- diff --git a/CHANGES b/CHANGES index 35baf8da67..81f98617b5 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,14 @@ CHANGES ======= +0.4.0beta7 +---------- + +- The IdentifierPreprarer's _requires_quotes test is now regex based. Any + out-of-tree dialects that provide custom sets of legal_characters or + illegal_initial_characters will need to move to regexes or override + _requires_quotes. + 0.4.0beta6 ---------- diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 4fca6b2ecc..6d22da1ded 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -36,10 +36,8 @@ RESERVED_WORDS = util.Set([ 'then', 'to', 'trailing', 'true', 'union', 'unique', 'user', 'using', 'verbose', 'when', 'where']) -LEGAL_CHARACTERS = util.Set(string.ascii_lowercase + - string.ascii_uppercase + - string.digits + '_$') -ILLEGAL_INITIAL_CHARACTERS = util.Set(string.digits + '$') +LEGAL_CHARACTERS = re.compile(r'^[A-Z0-9_$]+$', re.I) +ILLEGAL_INITIAL_CHARACTERS = re.compile(r'[0-9$]') BIND_PARAMS = re.compile(r'(?