Re: fix for spurious server not found in configuration file
Frediano Ziglio <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <[email protected]> |
2009/11/13 Christos Zoulas <[email protected]>: > > Hello, > > I really don't want to list > 50 servers in my freetds.conf file to avoid > seeing the message: > > Msg 20012, Level 2, State -1, Server OpenClient, Line -1 > Server name not found in configuration files. > > So, I added this to config.c (which was to actually do what the logging > comment promised but did not deliver): > > Index: src/tds/config.c > =================================================================== > RCS file: /src/twosigma/cvsroot/external/public/freetds/src/tds/config.c,v > retrieving revision 1.1.1.13 > retrieving revision 1.16 > diff -u -r1.1.1.13 -r1.16 > --- src/tds/config.c 13 Nov 2009 18:22:47 -0000 1.1.1.13 > +++ src/tds/config.c 13 Nov 2009 19:39:28 -0000 1.16 > @@ -195,7 +195,8 @@ > if (!tds_read_interfaces(tds_dstr_cstr(&login->server_name), connection)) { > tdsdump_log(TDS_DBG_INFO1, "Failed to find [%s] in configuration files; trying '%s' instead.\n", > tds_dstr_cstr(&login->server_name), tds_dstr_cstr(&connection->server_name)); > - tdserror(tds->tds_ctx, tds, TDSEINTF, 0); > + if (!tds_read_conf_file(connection, tds_dstr_cstr(&connection->server_name))) > + tdserror(tds->tds_ctx, tds, TDSEINTF, 0); > } > } > > > So adding > [SYBASE] > > to the bottom of your freetds.conf file will silence the nuisance. > > Best, > > christos Mumble mumble... is the log correct ?? tds_read_config_info create a TDSCONNECTION structure based on info from a TDSLOGIN which should have a valid server_name. IMO if this server_name is not found in either freetds.conf and interfaces an error should raise. If server_name is null the default ("SYBASE") should be used... actually the code does not work so :( freddy77 _______________________________________________ FreeTDS mailing list [email protected] http://lists.ibiblio.org/mailman/listinfo/freetds