Hi Chris,
Agree. I seem to reckon this legacy issue is limited to the TCP/UDP
ports only and i'm thinking perhaps the best way to approach it is
to issue a true/false config switch, ie. sql_table_compat, for the
purpose. But for consistency with the rest, these fields should be
aligned to port_src and port_dst. Agree?
Cheers,
Paolo
On Mon, Sep 13, 2010 at 11:14:18AM +0200, Chris Wilson wrote:
Hi all,
We just had a bug report in pmGraph because it assumed that the source
port database column was called src_port always, as it is in MySQL. The
user is using a postgres database, and it appears that the column is
called port_src there instead:
if (!strcmp(config.type, mysql) || !strcmp(config.type, sqlite3))
{
strncat(insert_clause, src_port, SPACELEFT(insert_clause));
strncat(where[primitive].string, src_port=%u,
SPACELEFT(where[primitive].string));
}
else {
strncat(insert_clause, port_src, SPACELEFT(insert_clause));
strncat(where[primitive].string, port_src=%u,
SPACELEFT(where[primitive].string));
}
I would be much happier writing database-independent code around
pmacct if it didn't do things like this.
I understand that there is a backwards compatibility issue with changing
it, but perhaps it could be done in a new version of the mysql or postgres
schema?
Cheers, Chris.
--
Aptivate | http://www.aptivate.org | Phone: +44 1223 760887
The Humanitarian Centre, Fenner's, Gresham Road, Cambridge CB1 2ES
Aptivate is a not-for-profit company registered in England and Wales
with company number 04980791.
___
pmacct-discussion mailing list
http://www.pmacct.net/#mailinglists
___
pmacct-discussion mailing list
http://www.pmacct.net/#mailinglists