[php-src] Issue #12834: mysqli_sql_exception: "DOUBLE value is out of range" in mysqli_stmt_get_result
| From: | WDGroll | Date: | Thu, 30 Nov 2023 11:28:54 +0000 |
| Subject: | [php-src] Issue #12834: mysqli_sql_exception: "DOUBLE value is out of range" in mysqli_stmt_get_result | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-245940@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/12834
Author: WDGroll
### Description
After adding a new record in the MySQL database, the error message appears when calling a
long-established PHP page:
`
Fatal error: Uncaught mysqli_sql_exception: DOUBLE value is out of range in
'((orcadcis.artikel.Part_Type +
orcadcis.artikel.Schematic_Part) +
orcadcis.artikel.Value)' in
D:\Server\htdocs\CIS\b7\CIS\Query.php:71 Stack trace: #0 D:\Server\htdocs\CIS\b7\CIS\Query.php(71):
mysqli_stmt_get_result(Object(mysqli_stmt)) #1 {main} thrown in
D:\Server\htdocs\CIS\b7\CIS\Query.php on line 71`
Line 71 consists only of
`$result = mysqli_stmt_get_result($Stmt);`
And this error only occurs if a specific data set is part of the result.
Namely the data record in which the string '88E1512' stands for the Marvell® Alaska
Ethernet Transciever in the VarChar(31) field 'Value'. If I change the name to
'_88E1512' for example, this error doesn't occur.
Apparently mysqli_stmt_get_result tries to interpret this string as a double, even though the type
is clearly VarChar! And 88*10^1215 goes beyond the limits of the incorrectly assumed number
Changing the value doesn't really help because this data comes from an external database and
will be overwritten with the next update. And who knows, maybe there will be another name in the
data sets that can be interpreted as a number...
Resulted in this output:
```
mysqli_sql_exception: DOUBLE value is out of range
```
But I expected this output instead:
```
Just give me the string '88E1512' without any interpretation...
```
### PHP Version
PHP 8.1.12
### Operating System
Win10