Skip to content

Commit bd14576

Browse files
Update getLimitForBigInt method to return 4294967295 for Mongo and SQL adapters
- Adjusted the getLimitForBigInt method in both Mongo and SQL classes to return 4294967295, reflecting the maximum value for a 32-bit unsigned integer. - Updated comments to clarify the handling of integer limits in PHP.
1 parent b5c7447 commit bd14576

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/Database/Adapter/Mongo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3014,7 +3014,7 @@ public function getLimitForInt(): int
30143014
public function getLimitForBigInt(): int
30153015
{
30163016
// Mongo does not handle integers directly, so using MariaDB limit for now
3017-
return 18446744073709551615;
3017+
return 4294967295;
30183018
}
30193019

30203020
/**

src/Database/Adapter/SQL.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,8 @@ public function getLimitForBigInt(): int
906906
// 2^64 - 1
907907
// 18446744073709551615 is the maximum value for a 64-bit unsigned integer
908908
// 9223372036854775807 is the maximum value for a 64-bit signed integer
909-
return 18446744073709551615;
909+
// in php we can't represent 64-bit integer, so greater than 4294967295 will be treated as bigint
910+
return 4294967295;
910911
}
911912

912913
/**

0 commit comments

Comments
 (0)