Bug #74779 [Opn->Ver]: x() and y() truncating floats to integers

From: Date: Thu, 04 Feb 2021 13:47:32 +0000
Subject: Bug #74779 [Opn->Ver]: x() and y() truncating floats to integers
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-231947@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74779&edit=1 ID: 74779 Updated by: cmb@php.net Reported by: yunosh@php.net Summary: x() and y() truncating floats to integers -Status: Open +Status: Verified Type: Bug Package: MySQLi related Operating System: Linux PHP Version: 7.0Git-2017-06-19 (Git) -Assigned To: +Assigned To: cmb Block user comment: N Private report: N Previous Comments: ------------------------------------------------------------------------ [2017-09-22 18:57:46] seb35 at seb35 dot fr Related To: Bug #69348 ------------------------------------------------------------------------ [2017-06-19 08:54:31] yunosh@php.net Description: ------------ When retrieving spatial coordinates from a point column using the x() and y() sql functions, the mysqli fetch_array(MYSQLI_ASSOC) method return integers instead of floats if using the MYSQLI_OPT_INT_AND_FLOAT_NATIVE option and locale that don't have a fullstop as decimal separator. Test script: --------------- setlocale(LC_ALL, "de_DE.UTF-8"); $m = new mysqli(); $m->options(MYSQLI_OPT_INT_AND_FLOAT_NATIVE, true); $result = $m->query("SELECT Y(Point(56.7, 53.34))"); var_dump($result->fetch_array(MYSQLI_ASSOC)); Expected result: ---------------- array(1) { 'Y(Point(56.7, 53.34))' => double(53.34) } Actual result: -------------- array(1) { 'Y(Point(56.7, 53.34))' => double(53) } ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=74779&edit=1

« previous php.bugs (#231947) next »