Skip to content

Commit

Permalink
FIX iss_1174
Browse files Browse the repository at this point in the history
Permanent fix for issue 1174 (nuxsmin#1174)
 - This commit fixes the `SQLSTATA[HY000]: General error: 1615 Prepared statment Needs to be re-prepared` error which occurs after a clean installation with a recent version of MariaDB.
  • Loading branch information
CodeNinja1337 authored Dec 7, 2020
1 parent 8f78ad5 commit ce984c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/SP/Storage/Database/MySQLHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function getConnection()

// Set prepared statement emulation depending on server version
$serverVersion = $this->db->getAttribute(PDO::ATTR_SERVER_VERSION);
$this->db->setAttribute(PDO::ATTR_EMULATE_PREPARES, version_compare($serverVersion, '5.1.17', '<'));
$this->db->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);

$this->dbStatus = self::STATUS_OK;
} catch (Exception $e) {
Expand Down Expand Up @@ -194,4 +194,4 @@ public function getDatabaseName()
{
return $this->connectionData->getDbName();
}
}
}

0 comments on commit ce984c3

Please sign in to comment.