Bug 56379 - Number of columns in the results returned from pgsql connection is zero
Summary: Number of columns in the results returned from pgsql connection is zero
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_lua (show other bugs)
Version: 2.4.9
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-09 18:29 UTC by zhou.lixin
Modified: 2014-04-09 18:29 UTC (History)
0 users



Attachments
httpd-2.4.9/modules/lua/lua_dbd.c patch (2.82 KB, text/plain)
2014-04-09 18:29 UTC, zhou.lixin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description zhou.lixin 2014-04-09 18:29:16 UTC
Created attachment 31502 [details]
httpd-2.4.9/modules/lua/lua_dbd.c patch

Mod_dbd, when coupled with mod_lua, works fine to return pgsql connections.  Mod_lua's "select" or "prepare / selection" can return the correct number of rows.  However, the number of columns is always zero.

Note that "cols" from Line 333 seems to return 0 regardless of the number of columns in the SELECT SQL statement.  Thus, the if statement at Line 335 always returns false.

The attached patch seems to fix this issue for the pgsql connections.  I've not tested if this fix causes issues in other database connections.