Skip to content

Commit

Permalink
Possibly expensive SQL Query on determining files to process #144
Browse files Browse the repository at this point in the history
Fix cast for MySQL

(cherry picked from commit 7d8ae58)
  • Loading branch information
Philip Stadermann authored and lennartdohmann committed Oct 23, 2024
1 parent 66c672f commit db353f9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/Db/DbFileMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,11 @@ public function getFileIdsWithTags(array $includedTagIds, int $limit, int $offse
* @throws Exception if the database platform is not supported
*/
private function getStringTypeDeclarationSQL(): string {
$platform = $this->db->getDatabasePlatform()->getName();
if ($platform === 'mysql' || $platform === 'sqlite' || $platform === 'postgres') {
$platform = $this->db->getDatabaseProvider();
if ($platform === "mysql") {
$stringType = 'CHAR(64)';
}
else if ($platform === 'sqlite' || $platform === 'postgres') {
$stringType = 'VARCHAR(64)';
} else {
throw new Exception('Unsupported database platform: ' . $platform);
Expand Down

0 comments on commit db353f9

Please sign in to comment.