php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58438 Query fails if no chars before "SELECT"
Submitted: 2008-11-29 21:25 UTC Modified: 2008-12-02 04:04 UTC
From: a dot collins at qub dot ac dot uk Assigned: grant (profile)
Status: Closed Package: ingres (PECL)
PHP Version: 5.2.6 OS: RHEL 5.2
Private report: No CVE-ID: None
 [2008-11-29 21:25 UTC] a dot collins at qub dot ac dot uk
Description:
------------
If a query has no characters preceding the word 'SELECT' at the start, the query will fail.  Introducing a space or new line character befor 'SELECT' clears the fault.

Apache 2.2.10
PHP 5.2.6
./configure \
--prefix=/usr/local/apache/php \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-config-file-path=/usr/local/apache/conf
else
./configure \
--disable-cgi \
--disable-debug \
--enable-magic-quotes \
--enable-bcmath \
--enable-mbstring \
--enable-mbstr-enc-trans \
--enable-ingres \
--prefix=/usr/local/apache/php \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-config-file-path=/usr/local/apache/conf \
--with-gdbm \
--with-gettext \
--with-ldap \
--with-mssql=/usr/local/freetds \
--with-mysql=/usr/local/mysql \
--with-oci8=instantclient,/usr/local/oci8 \
--with-zlib-dir=/usr/lib \
--with-pear


php.ini modfications to default ------------------------
error_reporting  =  E_ALL
display_errors = On
user_dir = /www/infoserve
include_path = ".:/usr/local/apache/php/lib/php"
extension_dir = "/usr/local/lib/php/extensions/"
extension=dbg-php-5.2.so
extension=ingres.so
extension=pdf.so
session_name = QUBSESSID
session.cookie_domain = ".qub.ac.uk"
session.hash_bits_per_character = 5
[debugger]
; added by Alan Collins (see extension=dbg above)
debugger.enabled=on
debugger.profiler_enabled=on
debugger.hosts_allow=localhost, 127.0.0.1, 143.117.14.72, 143.117.17. 143.117.3.66
debugger.hosts_deny=ALL
debugger.ports=7869 10000/16




Reproduce code:
---------------
<?php
$database='strule::sislive'; $user=''; $password='';
$conn = ingres_connect($database,$user,$password);
if ($conn) {
    echo "Connection succeeded.";
        // following query fails
           $sql = "select relowner from iirelation where relid='iirelation'";
        // this works
        // $sql = " select relowner from iirelation where relid='iirelation'";
        $rc=ingres_query($conn,$sql);
        if ($rc) {
                echo "Query succeeded.";
                while ($row=ingres_fetch_row($rc)) {
                        echo $row[1];
                }
        } else {
                echo "Query failed.";
        }
    ingres_close($conn);
} else {
    echo "Connection failed.";
}


Expected result:
----------------
Connection succeeded.Query succeeded.$ingres

Actual result:
--------------
Connection succeeded.Query failed.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-30 02:26 UTC] a dot collins at qub dot ac dot uk
corrected summary and PHP version
 [2008-12-01 09:10 UTC] grant dot croker at ingres dot com
Hi,

Which version of the extension do you have?

thanks

grant
 [2008-12-01 09:44 UTC] a dot collins at qub dot ac dot uk
Ingres extenstion and API versions are:

INGRES_EXT_VERSION = 2.0.0 INGRES_API_VERSION = 6
 [2008-12-01 11:08 UTC] grant dot croker at ingres dot com
I have tried the test case out on a SuSE 11 machine with the code for 2.0.0 and the CVS code but cannot reproduce the problem. Which release(s) of Ingres are you using on the client and server?

regards

grant
 [2008-12-01 12:08 UTC] a dot collins at qub dot ac dot uk
Grant,

on the 32 bit x86 client server I am using II 9.3.0-137

and on the 64 bit Itanium2 server I am using II 9.0.4 (i64.lnx/105)NPTL NB this server will only work satisfactorily with this release of Ingres
 [2008-12-02 04:03 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.


 [2008-12-02 04:04 UTC] grant dot croker at ingres dot com
For anyone reading this bug report - this bug is a duplicate of 15174, issues with differing Ingres releases.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 15:01:32 2024 UTC