[DDC-1572] Allow LIKE pattern to be a function or path expression #245

Merged
merged 1 commit into from Dec 31, 2011

Conversation

Projects
None yet
3 participants
Contributor

milokmet commented Dec 29, 2011

I fix like expression parser as well as SqlWalker to allow the pattern to be a function or path expression (another column for example joined column), to allow such where conditions:

LOWER(u.field) LIKE LOWER(?1) or with joined tables - log.messages LIKE alert.pattern

I do not know if I fixed that in the correct way, because I am not familiar with Doctrine2 query parsers and lexers.
I've created also few test cases for that and it works.

Member

stof commented Dec 29, 2011

I'm wondering about the use of functions in the pattern of a LIKE clause. Is it supported by all RDBMS targeted by Doctrine ?

Contributor

milokmet commented Dec 29, 2011

Guilherme - I've fixed the docblock.

Stof - I think yes. I've tested it only on sqlite, mysql, postgresql and oracle, and I think, that mssql and db2 will support it too.
And I need this for oracle convert function that trims diacritics from the pattern.

Owner

guilhermeblanco commented Dec 31, 2011

@stof yes, it is supported.

guilhermeblanco added a commit that referenced this pull request Dec 31, 2011

Merge pull request #245 from milokmet/DDC-1572
[DDC-1572] Allow LIKE pattern to be a function or path expression

@guilhermeblanco guilhermeblanco merged commit 9f3967d into doctrine:master Dec 31, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment