php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #65690 PDO_Firebird should also support dialect 1
Submitted: 2013-09-17 13:14 UTC Modified: 2019-10-28 15:50 UTC
From: slavb18 at gmail dot com Assigned: cmb (profile)
Status: Closed Package: PDO Firebird
PHP Version: 5.4.19 OS: any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: slavb18 at gmail dot com
New email:
PHP Version: OS:

 

 [2013-09-17 13:14 UTC] slavb18 at gmail dot com
Description:
------------
PDO_Firebird  returns wrong results with numeric (15,2) and dialect 1
dialect 1 returns numeric (15,2) as  SQL_DOUBLE and sqlscale < 0,

I know this was reported before but this report is with patch 

Test script:
---------------
create or alter procedure testpdo
returns (
    res numeric(15,2),
    res2 numeric(5,2))
as
begin
  RES=123.45;
  RES2=123.45;
  suspend;
end

Expected result:
----------------
Array
(
    [RES] => 123.45
    [0] => 123.45
    [RES2] => 123.45
    [1] => 123.45
)


Actual result:
--------------
Array
(
    [RES] => 0.04
    [0] => 0.04
    [RES2] => 123.45
    [1] => 123.45
)


(or any other number istead of 0.04 as variable "n" is unitilized in case of SQL_DOUBLE)

Patches

php5-bug65690.patch (last revision 2013-09-17 13:15 UTC by slavb18 at gmail dot com)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-09-17 13:28 UTC] slavb18 at gmail dot com
forget to attach php script:

...
$sql="select * FROM TESTPDO";
$sth = $pdo->prepare($sql);
$sth->execute();
$obj = $sth->fetch();
print_r($obj);
 [2014-01-01 12:29 UTC] felipe@php.net
-Package: PDO related +Package: PDO Firebird
 [2014-04-08 11:20 UTC] mariuz@php.net
-Assigned To: +Assigned To: mariuz
 [2017-01-09 06:42 UTC] dorin dot marcoci at gmail dot com
Still anyone uses dialect 1? It is pending to be deprecated.
Is it worth to fix this bug? It will involve additional FB specific flag/parameter to PDO, in order to deal right with dialects.
 [2017-01-09 10:23 UTC] slavb18 at gmail dot com
dialect 1 is still used in legacy databases, why not fix, if patch exists for three years
 [2017-01-30 08:18 UTC] dorin dot marcoci at gmail dot com
Slavb18,

I found this patch not so viable across Firebird dialects.
It just check for SQL_DOUBLE and sqlscale, behavior that may change and/or be different across existing or next dialects.

Currently PDO driver connects by default using 3rd dialect and no other handling is done in terms of specifics.

A nice solution will be to read and take into account the database dialect when connecting to a FB database and on next operations like data fetches, parameters handling, etc...
 [2017-10-24 06:45 UTC] kalle@php.net
-Status: Assigned +Status: Open -Assigned To: mariuz +Assigned To:
 [2018-07-06 19:32 UTC] ab@php.net
-Status: Open +Status: Feedback
 [2018-07-06 19:32 UTC] ab@php.net
@slavb18, could you please check with the suggestion of @dorin? This might be a bigger piece, but Firebird needs maintanance. Otherwise, as only dialect 3 seems to be supported well and dialect 1 is mentioned as quasi deprecated in the doc, this ticket could be considered obsolete.

Thanks.
 [2018-07-15 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 [2019-10-28 15:38 UTC] cmb@php.net
-Summary: PDO_Firebird returns wrong results with numeric 15,2 and dialect 1 +Summary: PDO_Firebird should also support dialect 1 -Status: No Feedback +Status: Open -Type: Bug +Type: Feature/Change Request -Assigned To: +Assigned To: cmb
 [2019-10-28 15:38 UTC] cmb@php.net
Reclassifying as feature request.
 [2019-10-28 15:50 UTC] cmb@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 13:01:30 2024 UTC