Skip to content

Commit

Permalink
new like process with collation
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Dec 30, 2014
1 parent 730de0b commit f38786d
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion data/src/entity_manager/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -4709,7 +4709,16 @@ def _process_filter_not_in(self, entity_class, table_name, filter, query_buffer)
# writes the in clause not in the query buffer
query_buffer.write("not " + field_name + " in " + filter_field_sql_value)

def _process_filter_like(self, entity_class, table_name, filter, query_buffer, left = True, right = True):
def _process_filter_like(
self,
entity_class,
table_name,
filter,
query_buffer,
left = True,
right = True,
collate = True
):
# retrieves the filter fields and
# like filter type
filter_fields = filter["fields"]
Expand Down Expand Up @@ -4820,6 +4829,10 @@ def _process_filter_like(self, entity_class, table_name, filter, query_buffer, l
# query buffer
query_buffer.write("'")

# in case the collate flat is enable the case insensitive collation
# mode is enabled so that a more broad search is enabled
if collate: query_buffer.write(" collate utf8_general_ci")

def _process_filter_rlike(self, entity_class, table_name, filter, query_buffer):
self._process_filter_like(entity_class, table_name, filter, query_buffer, left = False)

Expand Down

0 comments on commit f38786d

Please sign in to comment.