@@ -924,7 +924,7 @@ private function buildDocumentsInsert(string $name, array $documents, array $spa
924924 $ spatialMap = \array_fill_keys ($ spatialAttributes , true );
925925
926926 foreach ($ spatialAttributes as $ spatialColumn ) {
927- $ builder ->insertColumnExpression ($ spatialColumn , $ this ->getSpatialGeometryFromText ('? ' ));
927+ $ builder ->insertColumnExpression ($ this -> filter ( $ spatialColumn) , $ this ->getSpatialGeometryFromText ('? ' ));
928928 }
929929
930930 $ intBools = $ this ->supports (Capability::IntegerBooleans);
@@ -3912,6 +3912,9 @@ protected function executeUpsertBatch(
39123912 ): void {
39133913 $ builder = $ this ->dialectBuilder ()->into ($ this ->getTableRaw ($ name ));
39143914
3915+ $ spatialAttributes = \array_map ($ this ->filter (...), $ spatialAttributes );
3916+ $ operators = \array_combine (\array_map ($ this ->filter (...), \array_keys ($ operators )), $ operators );
3917+
39153918 foreach ($ spatialAttributes as $ spatialColumn ) {
39163919 $ builder ->insertColumnExpression ($ spatialColumn , $ this ->getSpatialGeometryFromText ('? ' ));
39173920 }
@@ -3956,11 +3959,14 @@ protected function executeUpsertBatch(
39563959
39573960 $ currentRegularAttributes = $ this ->decorateRow ($ currentRegularAttributes , $ document );
39583961
3959- foreach (\array_keys ($ currentRegularAttributes ) as $ column ) {
3962+ $ row = [];
3963+ foreach ($ currentRegularAttributes as $ column => $ value ) {
3964+ $ column = $ this ->filter ($ column );
3965+ $ row [$ column ] = $ value ;
39603966 $ allColumnNames [$ column ] = true ;
39613967 }
39623968
3963- $ documentsData [] = $ currentRegularAttributes ;
3969+ $ documentsData [] = $ row ;
39643970 }
39653971
39663972 foreach (\array_keys ($ operators ) as $ column ) {
@@ -6550,7 +6556,7 @@ protected function buildDocumentRow(Document $document, array $attributeKeys, ar
65506556 if ($ intBools && ! isset ($ spatialMap [$ key ])) {
65516557 $ value = (\is_bool ($ value )) ? (int ) $ value : $ value ;
65526558 }
6553- $ row [$ key ] = $ value ;
6559+ $ row [$ this -> filter ( $ key) ] = $ value ;
65546560 }
65556561
65566562 return $ row ;
0 commit comments