Skip to content

Loading…

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

Closed
doctrinebot opened this Issue · 2 comments

2 participants

@doctrinebot

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:
https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php#L848

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);
@doctrinebot

Comment created by shaneneuerburg:

Pull request:
#306

@doctrinebot

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.