mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-26 03:38:47 +02:00
Explicitly convert the database size to an int to prevent type error
This commit is contained in:
parent
50708c6942
commit
afa17ca429
1 changed files with 2 additions and 2 deletions
|
@ -83,7 +83,7 @@ class DBInfoHelper
|
|||
{
|
||||
if ($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform) {
|
||||
try {
|
||||
return $this->connection->fetchOne('SELECT SUM(data_length + index_length) FROM information_schema.TABLES WHERE table_schema = DATABASE()');
|
||||
return (int) $this->connection->fetchOne('SELECT SUM(data_length + index_length) FROM information_schema.TABLES WHERE table_schema = DATABASE()');
|
||||
} catch (Exception) {
|
||||
return null;
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ class DBInfoHelper
|
|||
|
||||
if ($this->connection->getDatabasePlatform() instanceof SqlitePlatform) {
|
||||
try {
|
||||
return $this->connection->fetchOne('SELECT page_count * page_size as size FROM pragma_page_count(), pragma_page_size();');
|
||||
return (int) $this->connection->fetchOne('SELECT page_count * page_size as size FROM pragma_page_count(), pragma_page_size();');
|
||||
} catch (Exception) {
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue