Re: [pmacct-discussion] Source port column name depends on database
Hi Paolo, On Wed, 6 Oct 2010, Paolo Lucente wrote: Yes, that's intended for a couple of reasons: 1) don't expect to release any more table versions: you see that already happening with recently introduced primitives; idea is to stick to a table version (or style nowadays) and then customize it from there, adding (or removing) fields to the base schema. 2) combinations of table type/version are internally mapped to a number greater than 8, ie. table type BGP, table version 1. OK, I didn't know that, thanks. No problem with the blog entry. I believe you can change the "Luckily he agreed" to simply "He agreed" - i'm not such of an un-cooperative beast, am i? Of course not, far from it :) I've changed it. Cheers, Chris. ___ pmacct-discussion mailing list http://www.pmacct.net/#mailinglists
Re: [pmacct-discussion] Source port column name depends on database
Hi Chris, Yes, that's intended for a couple of reasons: 1) don't expect to release any more table versions: you see that already happening with recently introduced primitives; idea is to stick to a table version (or style nowadays) and then customize it from there, adding (or removing) fields to the base schema. 2) combinations of table type/version are internally mapped to a number greater than 8, ie. table type BGP, table version 1. No problem with the blog entry. I believe you can change the "Luckily he agreed" to simply "He agreed" - i'm not such of an un-cooperative beast, am i? Cheers, Paolo On Wed, Oct 06, 2010 at 04:26:43PM +0200, Chris Wilson wrote: > Hi Paolo, > > On Wed, 6 Oct 2010, Paolo Lucente wrote: > >> 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. > > Thanks for this. I haven't compiled it yet, but I noticed this line: > > if ((!strcmp(config.type, "mysql") || !strcmp(config.type, > "sqlite3")) && config.sql_table_version != 8) { > > Doesn't this mean that it will revert to the old schema when we release a > schema version 9? Is that what you wanted? It seems surprising to me. I > would have expected "config.sql_table_version < 8" instead. > > By the way I've written this story up in a blog post, I hope that's OK, > but please let me know if you want me to edit it: > http://blog.aptivate.org/2010/10/06/consistency-portability-and-backwards-compatibility/ > > Cheers, Chris. ___ pmacct-discussion mailing list http://www.pmacct.net/#mailinglists
Re: [pmacct-discussion] Source port column name depends on database
Hi Paolo, On Wed, 6 Oct 2010, Paolo Lucente wrote: 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. Thanks for this. I haven't compiled it yet, but I noticed this line: if ((!strcmp(config.type, "mysql") || !strcmp(config.type, "sqlite3")) && config.sql_table_version != 8) { Doesn't this mean that it will revert to the old schema when we release a schema version 9? Is that what you wanted? It seems surprising to me. I would have expected "config.sql_table_version < 8" instead. By the way I've written this story up in a blog post, I hope that's OK, but please let me know if you want me to edit it: http://blog.aptivate.org/2010/10/06/consistency-portability-and-backwards-compatibility/ Cheers, Chris. ___ pmacct-discussion mailing list http://www.pmacct.net/#mailinglists
Re: [pmacct-discussion] Source port column name depends on database
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