Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复bindValue绑定长整型参数失精度,导致where无法正确匹配数据问题!!!该问题影响了thinkphp目前全部版本 #505

Open
wants to merge 1 commit into
base: 3.0
Choose a base branch
from

Conversation

slongzhang
Copy link

修复php转换浮点数导致的精度问题,如

<?php

$a = '99999999999999';
echo (float)$a; // 99999999999999
$b = '999999999999999';
echo (float)$b; // 999999999999991.0E+15

而self::PARAM_FLOAT = 18已经超过了php的15位的长度了,会导致无法where匹配不上长整型的数据
该问题影响了thinkphp目前全部版本

修复php转换浮点数导致的精度问题,如 
```php
<?php

$a = '99999999999999';
echo (float)$a; // 99999999999999
$b = '999999999999999';
echo (float)$b; // 999999999999991.0E+15
```
而self::PARAM_FLOAT = 18已经超过了php的15位的长度了,会导致无法where匹配不上长整型的数据
@slongzhang slongzhang changed the title Update PDOConnection.php 修复bindValue绑定长整型参数失精度,导致where无法正确匹配数据问题!!!该问题影响了thinkphp目前全部版本 Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant