php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58732 Error Executing a database procedure
Submitted: 2009-06-22 05:02 UTC Modified: 2009-06-24 06:33 UTC
From: m dot sijmons at nibble dot nl Assigned: grantc@php.net (profile)
Status: Closed Package: ingres (PECL)
PHP Version: 5.2.8 OS: All
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: m dot sijmons at nibble dot nl
New email:
PHP Version: OS:

 

 [2009-06-22 05:02 UTC] m dot sijmons at nibble dot nl
Description:
------------
Executing a database procedure gives errors.
Database procedures with or without parameters, gives problems

Reproduce code:
---------------
CREATE PROCEDURE p_proc_noparam
result row (integer, integer, varchar(256), char(1), integer, integer) AS
  DECLARE 
   RetOK           integer     NOT NULL WITH DEFAULT;     /* return status OK */
   dbError         integer     NOT NULL WITH DEFAULT;     /* return status Error */   
   dbErrortext     varchar(256) NOT NULL WITH DEFAULT;   
   dbSeverity      char(1) NOT NULL WITH DEFAULT; 
   dbRowcount      integer     NOT NULL WITH DEFAULT;
   id              integer     NOT NULL WITH DEFAULT;
BEGIN
  RetOK       = 1;
  dbError     = 0;
  dbErrortext = 'No error';
  dbSeverity  = 'S';
  dbRowcount  = 0;
  id          = 1045;
  RETURN row (:RetOK,:dbError,:dbErrortext,:dbSeverity,:dbRowcount, :id);
END;

<?php
$database="databasename";
$user="username";
$password="dummy";
$link = ingres_connect($database, $user, $password);
$result = ingres_query($link, "execute procedure p_proc_noparam");
if ( ingres_errno() != 0 )
{
    $error_text = ingres_error();
    echo($error_text);
}
else
{
$dbRow = ingres_fetch_row($result);
echo "return value - " . ingres_fetch_proc_return($result) . "</BR>";
print_r($dbRow);
}
ingres_close($link);
?>


Expected result:
----------------
Succesful execution and a result row with some status
information that can be fetched. 

Actual result:
--------------
Warning: ingres_query() [function.ingres-query]: Unable to execute OpenAPI query type, 8 in F:\applications\xampp\htdocs\phpMVC\test_html\ingres_test1.php on line 9

 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-06-22 05:04 UTC] grant dot croker at ingres dot com
this is the complete patch, also prevents procedures from being "described":

Index: ingres.c
===================================================================
RCS file: /repository/pecl/ingres/ingres.c,v
retrieving revision 1.28
diff -u -w -r1.28 ingres.c
--- ingres.c	18 Jun 2009 17:41:54 -0000	1.28
+++ ingres.c	22 Jun 2009 09:03:12 -0000
@@ -2207,7 +2207,7 @@
 #if defined(IIAPI_VERSION_5)
         else
         {
-            if ((ii_link->apiLevel > IIAPI_LEVEL_3) && INGRESG(describe))
+            if (((ii_link->apiLevel > IIAPI_LEVEL_3) && INGRESG(describe)) && (ii_result->queryType != IIAPI_QT_EXEC_PROCEDURE))
             {
                 /* We can use DESCRIBE INPUT to work out the types that Ingres is expecting */
                 if (_ii_prepare(ii_result, query TSRMLS_CC) == II_FAIL)
@@ -2294,6 +2294,7 @@
         case IIAPI_QT_EXEC_PROCEDURE:
             queryParm.qy_parameters = TRUE;
             queryParm.qy_queryText  = NULL;
+            break;
         default:
             php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to execute OpenAPI query type, %d", ii_result->queryType);
             RETURN_FALSE;
 [2009-06-24 06:33 UTC] grant dot croker at ingres dot com
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jan 05 07:01:27 2025 UTC