Ticket #7065: oracle_regex_qsrf.diff
File oracle_regex_qsrf.diff, 1.6 KB (added by , 17 years ago) |
---|
-
django/db/models/sql/where.py
140 140 elif lookup_type == 'search': 141 141 return (connection.ops.fulltext_search_sql(field_sql), params) 142 142 elif lookup_type in ('regex', 'iregex'): 143 return connection.ops.regex_lookup % (field_sql, cast_sql), params143 return connection.ops.regex_lookup(lookup_type) % (field_sql, cast_sql), params 144 144 145 145 raise TypeError('Invalid lookup_type: %r' % lookup_type) 146 146 -
django/db/backends/oracle/base.py
119 119 120 120 def regex_lookup_10(self, lookup_type): 121 121 if lookup_type == 'regex': 122 match_option = 'c'122 match_option = "'c'" 123 123 else: 124 match_option = 'i'125 return 'REGEXP_LIKE(%%s %%s%s)' % match_option124 match_option = "'i'" 125 return 'REGEXP_LIKE(%%s, %%s, %s)' % match_option 126 126 127 def regex_lookup(self, lookup_type): 128 # If regex_lookup is called before it's been initialized, then create 129 # a cursor to initialize it and recur. 130 from django.db import connection 131 connection.cursor() 132 return connection.ops.regex_lookup(lookup_type) 133 127 134 def sql_flush(self, style, tables, sequences): 128 135 # Return a list of 'TRUNCATE x;', 'TRUNCATE y;', 129 136 # 'TRUNCATE z;'... style SQL statements