Update of /cvsroot/modeling/ProjectModeling/Modeling
In directory sc8-pr-cvs1:/tmp/cvs-serv29656
Modified Files:
SQLExpression.py CHANGES
Log Message:
Fixed bug #776592: was impossible to add raw '*' and '?' characters in
a LIKE statement
Index: SQLExpression.py
===================================================================
RCS file: /cvsroot/modeling/ProjectModeling/Modeling/SQLExpression.py,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** SQLExpression.py 10 Jul 2003 11:57:54 -0000 1.18
--- SQLExpression.py 24 Jul 2003 12:07:25 -0000 1.19
***************
*** 65,68 ****
--- 65,80 ----
NumericType=3
+ # for use by SQLExpression.sqlPatternFromShellPatternWithEscapeCharacter
+ esc_question_tmp_replct='MDL_ESCAPED_QUESTION_MARK_MDL'
+ esc_star_tmp_replct='MDL_ESCAPED_STAR_MDL'
+ star=re.compile('\*')
+ escaped_star=re.compile(r'\\\*')
+ question_mark=re.compile('\?')
+ escaped_question_mark=re.compile(r'\\\?')
+ percent=re.compile('%')
+ underscore=re.compile('_')
+ anti_escaped_star=re.compile(esc_star_tmp_replct)
+ anti_esc_question_mark=re.compile(esc_question_tmp_replct)
+
class InvalidSQLTypeError(ValueError):
"""
***************
*** 910,924 ****
Details: '%' in 'pattern' becomes '\%', '_' becomes '\_',
! '*' becomes '%' and '?' becomes '_'.
"""
- star=re.compile('\*')
- question_mark=re.compile('\?')
- percent=re.compile('%')
- underscore=re.compile('_')
-
pattern=percent.sub('\\%', pattern)
pattern=underscore.sub('\_', pattern)
pattern=question_mark.sub('_', pattern)
pattern=star.sub('%', pattern)
return pattern
--- 922,936 ----
Details: '%' in 'pattern' becomes '\%', '_' becomes '\_',
! '\*' becomes '*', '*' becomes '%', '\?' becomes '?' and
! '?' becomes '_'.
"""
pattern=percent.sub('\\%', pattern)
pattern=underscore.sub('\_', pattern)
+ pattern=escaped_question_mark.sub(esc_question_tmp_replct, pattern)
pattern=question_mark.sub('_', pattern)
+ pattern=escaped_star.sub(esc_star_tmp_replct, pattern)
pattern=star.sub('%', pattern)
+ pattern=anti_escaped_star.sub('*', pattern)
+ pattern=anti_esc_question_mark.sub('?', pattern)
return pattern
Index: CHANGES
===================================================================
RCS file: /cvsroot/modeling/ProjectModeling/Modeling/CHANGES,v
retrieving revision 1.132
retrieving revision 1.133
diff -C2 -d -r1.132 -r1.133
*** CHANGES 23 Jul 2003 21:09:25 -0000 1.132
--- CHANGES 24 Jul 2003 12:07:25 -0000 1.133
***************
*** 8,11 ****
--- 8,14 ----
--------------------------------------------------------
+ * Fixed bug #776592: was impossible to add raw '*' and '?' characters in a
+ LIKE statement
+
* Simple methods for models, entities, attributes, relationships and
ClassDescriptions are now automatically cached. This speeds up operations
|