From 2eb655d5fd1863124c31d7fba6dd0a9a65dd9d7c Mon Sep 17 00:00:00 2001 From: sarahkemp Date: Fri, 15 Feb 2019 11:21:33 -0800 Subject: [PATCH] move order bindings to select after compileOver --- src/Query/Grammars/DB2Grammar.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Query/Grammars/DB2Grammar.php b/src/Query/Grammars/DB2Grammar.php index b21e7e9..b81c028 100644 --- a/src/Query/Grammars/DB2Grammar.php +++ b/src/Query/Grammars/DB2Grammar.php @@ -104,6 +104,13 @@ class DB2Grammar extends Grammar } $components['columns'] = $this->compileOver($orderings, $columns); + + // if there are bindings in the order, we need to move them to the select since we are moving the parameter + // markers there with the OVER statement + if(isset($query->getRawBindings()['order'])){ + $query->addBinding($query->getRawBindings()['order'], 'select'); + $query->setBindings([], 'order'); + } unset($components['orders']);