- Fixed a bug occuring when a field was already escaped
This commit is contained in:
		
							parent
							
								
									1469d167c4
								
							
						
					
					
						commit
						4df9ececba
					
				| @ -193,7 +193,7 @@ class MsSQL implements AdapterInterface { | ||||
|             case static::IDENTIFIER_DATABASE: | ||||
|             case static::IDENTIFIER_TABLE: | ||||
|             case static::IDENTIFIER_FIELD: | ||||
|                 return "[" . str_replace(["[", "]"], [ "[[", "]]" ], $segment) . "]"; | ||||
|                 return "[" . trim(str_replace(["[", "]"], [ "[[", "]]" ], $segment), '[]') . "]"; | ||||
| 
 | ||||
|             case static::IDENTIFIER_VALUE: | ||||
|                 return "'$segment'"; | ||||
|  | ||||
| @ -130,7 +130,7 @@ class MySQL implements AdapterInterface { | ||||
|             case static::IDENTIFIER_DATABASE: | ||||
|             case static::IDENTIFIER_TABLE: | ||||
|             case static::IDENTIFIER_FIELD: | ||||
|                 return "`" . str_replace("`", "``", $segment) . "`"; | ||||
|                 return "`" . trim(str_replace("`", "``", $segment), '`') . "`"; | ||||
| 
 | ||||
|             case static::IDENTIFIER_VALUE: | ||||
|                 return "\"$segment\"";
 | ||||
|  | ||||
| @ -79,12 +79,12 @@ class Repository | ||||
|         return Ulmus::runSelectQuery($this->queryBuilder, $this->adapter)->fetchColumn(0); | ||||
|     } | ||||
| 
 | ||||
|     public function deleteOne() | ||||
|     protected function deleteOne() | ||||
|     { | ||||
|         return $this->limit(1)->deleteSqlQuery()->runQuery(); | ||||
|     } | ||||
| 
 | ||||
|     public function deleteAll() | ||||
|     protected function deleteAll() | ||||
|     { | ||||
|         return $this->deleteSqlQuery()->runQuery(); | ||||
|     } | ||||
| @ -161,7 +161,6 @@ class Repository | ||||
| 
 | ||||
|                 $entity->entityFillFromDataset($dataset); | ||||
| 
 | ||||
| 
 | ||||
|                 return $update ? (bool) $update->rowCount() : false; | ||||
|             } | ||||
|         } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user