File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -121,15 +121,16 @@ private function buildTmpTableSelectQuery($escapedData)
121121 ->getConnection ()
122122 ->getDriver ();
123123 $ schema = [];
124+ $ binds = [];
124125 foreach ($ escapedData as $ key => $ value ) {
125126 $ col = $ driver ->quoteIdentifier ($ key );
126127 if ($ value === 'NULL ' ) {
127128 $ schema [] = "{$ value } AS {$ col }" ;
128129 } else {
129- $ bindKey = strtolower (trim ($ key ));
130- $ schema [] = ": {$ bindKey } AS {$ col }" ;
130+ $ bindKey = ': ' . strtolower (trim ($ key ));
131+ $ binds [$ bindKey ] = $ value ;
132+ $ schema [] = "{$ bindKey } AS {$ col }" ;
131133 }
132-
133134 }
134135
135136 $ tmpTable = TableRegistry::getTableLocator ()->get ('tmp ' , [
@@ -141,14 +142,10 @@ private function buildTmpTableSelectQuery($escapedData)
141142 ->from (
142143 sprintf ('(SELECT %s) as tmp ' , implode (', ' , $ schema ))
143144 );
144- foreach ($ escapedData as $ key => $ value ) {
145- if ($ value !== 'NULL ' ) {
146- $ bindKey = strtolower (trim ($ key ));
147- $ query ->bind (": {$ bindKey }" , $ value );
148- }
145+ foreach ($ binds as $ key => $ value ) {
146+ $ query ->bind ($ key , $ value );
149147 }
150148
151-
152149 /** @var Query $selectQuery */
153150 $ selectQuery = $ query ;
154151
You can’t perform that action at this time.
0 commit comments