Hi Chris,

To say this work (as agreed in the shape of sql table version 8) has
been just committed to the CVS. Please give it a try and let me know
if it seems to work to your eyes.

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

Reply via email to