Bug #80592 [Ver->Csd]: all floats are the same in ODBC parameters

From: Date: Wed, 06 Jan 2021 12:56:40 +0000
Subject: Bug #80592 [Ver->Csd]: all floats are the same in ODBC parameters
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-231395@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80592&edit=1 ID: 80592 Updated by: cmb@php.net Reported by: a dot kasparas at gmc dot lt Summary: all floats are the same in ODBC parameters -Status: Verified +Status: Closed Type: Bug Package: ODBC related Operating System: Windows 10 Pro PHP Version: 8.0.0 Block user comment: N Private report: N New Comment: Automatic comment on behalf of cmbecker69@gmx.de Revision: http://git.php.net/?p=php-src.git;a=commit;h=f674a3343ce3ab349291bde795a4ad07220f42b8 Log: Fix #80592: all floats are the same in ODBC parameters Previous Comments: ------------------------------------------------------------------------ [2021-01-05 23:26:56] cmb@php.net The following pull request has been associated: Patch Name: Fix #80592: all floats are the same in ODBC parameters On GitHub: https://github.com/php/php-src/pull/6579 Patch: https://github.com/php/php-src/pull/6579.patch ------------------------------------------------------------------------ [2021-01-05 13:44:53] a dot kasparas at gmc dot lt Description: ------------ Floats submitted over prepared statement parameters are all set to the same (last?) value. Test script: --------------- On SQL server create table for tests: CREATE TABLE float_test( F1 float not null, F2 float not null, F3 float not null ); Create ODBC connection FLOAT_TEST using available driver for SQL server; Then execute: $o = odbc_connect('FLOAT_TEST', 'user', 'pass'); $st_txt = 'INSERT INTO float_test (f1, f2, f3) values (?, ?, ?)'; odbc_exec($o, 'DELETE FROM float_test'); $st = odbc_prepare($o, $st_txt); odbc_execute($st, array(1.0, 2.0, 3.0)); $st2 = odbc_prepare($o, 'SELECT f1, f2, f3 from float_test'); odbc_execute($st2); echo json_encode(odbc_fetch_object($st2)); Expected result: ---------------- {"f1":"1.0","f2":"2.0","f3":"3.0"} Actual result: -------------- {"f1":"3.0","f2":"3.0","f3":"3.0"} ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=80592&edit=1

« previous php.bugs (#231395) next »