Skip to content


DBAL-497: SQLServerPlatform modifies limit query incorrectly when column names start with "from" #1699

doctrinebot opened this Issue · 2 comments

2 participants


Jira issue originally created by user shaneneuerburg:

I am working with a table that has columns that start with the word "from" (fromNumber, fromCity, etc). When SQLServerPlatform->doModifyLimitQuery is called, "from" in the names are incorrectly replaced. I suggest adding a whitespace requirement after FROM in the preg_replace on this line:

So this:

$query = preg*replace('/\sFROM/i', ", ROW_NUMBER() OVER ($over) AS doctrine*rownum FROM", $query);

Becomes this:

$query = preg*replace('/\sFROM\s/i', ", ROW_NUMBER() OVER ($over) AS doctrine*rownum FROM ", $query);

Comment created by shaneneuerburg:

Pull request:


Issue was closed with resolution "Fixed"

@doctrinebot doctrinebot added the Bug label
@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot added this to the 2.4 milestone
@doctrinebot doctrinebot closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.