From: slavb18 at gmail dot com
Operating system:
PHP version: 5.4.15
Package: PDO related
Bug Type: Bug
Bug description:Unable to run firebird "execute block", containing :xxxx
Description:
------------
Unable to run firebird unparametrized "execute block", containing :xxxx
if query contains string like ":xxxx", pdo->query shows error
SQLSTATE[HY000]: General error: -901 Dynamic SQL Error SQL error code =
-901 undefined message number
if I remove "where 1=:test", then execute block works
And, also I cannot prepare and execute "paramerized" execute block if it
contains :xxxxx
Execute Block
(
test integer=:test
)
Returns(
result varchar(100)
)
as
Begin
select 'test' from rdb$database where 1=:test
into result;
Suspend;
End
I think solution is to ignore any parameters (:xxx) after Begin keyword
in case of firebird
Test script:
---------------
$q="Execute Block
Returns(
result varchar(100)
)
as
declare variable test integer=1;
Begin
select 'test' from rdb\$database where 1=:test
into result;
Suspend;
End
";
$sth=$pdo->query($q);
$row=$sth->fetch(PDO::FETCH_ASSOC);
Expected result:
----------------
Array
(
[RESULT] => test
)
Actual result:
--------------
SQLSTATE[HY000]: General error: -901 Dynamic SQL Error SQL error code =
-901 undefined message number
--
Edit bug report at https://bugs.php.net/bug.php?id=64937&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=64937&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=64937&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=64937&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=64937&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=64937&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=64937&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=64937&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=64937&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=64937&r=support
Expected behavior: https://bugs.php.net/fix.php?id=64937&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=64937&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=64937&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=64937&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64937&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=64937&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=64937&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=64937&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64937&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=64937&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=64937&r=mysqlcfg