2626
2727namespace OC \Files \Cache ;
2828
29- use Doctrine \DBAL \Platforms \MySQLPlatform ;
3029use OC \DB \QueryBuilder \QueryBuilder ;
3130use OC \SystemConfig ;
3231use OCP \DB \QueryBuilder \IQueryBuilder ;
@@ -46,24 +45,12 @@ public function __construct(IDBConnection $connection, SystemConfig $systemConfi
4645 $ this ->cache = $ cache ;
4746 }
4847
49- public function selectFileCache (string $ alias = null , string $ mysqlIndexHint = '' ) {
48+ public function selectFileCache (string $ alias = null ) {
5049 $ name = $ alias ? $ alias : 'filecache ' ;
5150 $ this ->select ("$ name.fileid " , 'storage ' , 'path ' , 'path_hash ' , "$ name.parent " , 'name ' , 'mimetype ' , 'mimepart ' , 'size ' , 'mtime ' ,
5251 'storage_mtime ' , 'encrypted ' , 'etag ' , 'permissions ' , 'checksum ' , 'metadata_etag ' , 'creation_time ' , 'upload_time ' )
53- ->from ('filecache ' , $ name );
54- if ($ mysqlIndexHint !== '' && $ this ->getConnection ()->getDatabasePlatform () instanceof MySQLPlatform) {
55- $ this ->add ('join ' , [
56- $ this ->quoteAlias ($ name ) => [
57- // horrible query builder crimes to sneak in raw sql after the "FROM oc_filecache $name"
58- 'joinType ' => $ mysqlIndexHint . ' left ' ,
59- 'joinTable ' => $ this ->getTableName ('filecache_extended ' ),
60- 'joinAlias ' => $ this ->quoteAlias ('fe ' ),
61- 'joinCondition ' => $ this ->expr ()->eq ("$ name.fileid " , 'fe.fileid ' ),
62- ],
63- ], true );
64- } else {
65- $ this ->leftJoin ($ name , 'filecache_extended ' , 'fe ' , $ this ->expr ()->eq ("$ name.fileid " , 'fe.fileid ' ));
66- }
52+ ->from ('filecache ' , $ name )
53+ ->leftJoin ($ name , 'filecache_extended ' , 'fe ' , $ this ->expr ()->eq ("$ name.fileid " , 'fe.fileid ' ));
6754
6855 $ this ->alias = $ name ;
6956
0 commit comments