apr-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 53666] New: The Sybase/FreeTDS driver is broken -- misparses the queries
Date Mon, 06 Aug 2012 20:23:51 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=53666

          Priority: P2
            Bug ID: 53666
          Assignee: bugs@apr.apache.org
           Summary: The Sybase/FreeTDS driver is broken -- misparses the
                    queries
          Severity: critical
    Classification: Unclassified
                OS: All
          Reporter: mi+apache@aldan.algebra.com
          Hardware: All
            Status: NEW
           Version: 1.4.1
         Component: APR-util
           Product: APR

While trying to configure some Sybase DB-backed redirections, I noticed, that
ALL of my queries were failing, even when the reported keys were present in the
queried table.

Digging deep into the dbd/dbd_freetds, I noticed, that the specified query
never makes it to the freetds-driver's code. For example, the driver's
dbd_freetds_prepare() invoked by apr_dbd_prepare() sees the line, that was
already "munched" by the caller.

In the below output from gdb, notice the difference between query in frame #1
and #2:

#1  0x00002aaab11a866d in dbd_freetds_prepare (pool=0x2aaab32c3178,
sql=0x2aaab32c1260, 
    query=0x2aaab32c32e0 "SELECT seo_url FROM CT_SEO WHERE vgn_url = ''",
label=0x2aaaaae082f0 "map_v2s", nargs=1, nvals=1, types=0x2aaab32c3320, 
    statement=0x7fffffffe0f0) at dbd/apr_dbd_freetds.c:493
        stmt = 0x2aaab32c3328
#2  0x00002aaaab19a523 in apr_dbd_prepare (driver=0x2aaab13a97e0,
pool=0x2aaab32c3178, handle=0x2aaab32c1260, 
    query=0x2aaaaae08304 "SELECT seo_url FROM CT_SEO WHERE vgn_url = '%s'",
label=0x2aaaaae082f0 "map_v2s", statement=0x7fffffffe0f0)
    at dbd/apr_dbd.c:476
        qlen = 62
        i = 1
        nargs = 1
        nvals = 1
        p = 0x2aaab32c330d ""
        pq = 0x2aaab32c32e0 "SELECT seo_url FROM CT_SEO WHERE vgn_url = ''"
        q = 0x2aaaaae08333 ""
        t = 0x2aaab32c3320

Perhaps, the driver should not be counting the args (nargs) on its own, relying
on the apr_dbd_prepare to provide the count?..

Whatever it is, the current latest RELEASE of apr-util's dbd is broken in this
regard :-(

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


Mime
View raw message