From yavuz.gokirmak at infoowl.net Fri Oct 3 10:21:06 2014 From: yavuz.gokirmak at infoowl.net (=?UTF-8?B?WWF2dXogR8O2a8Sxcm1haw==?=) Date: Fri, 3 Oct 2014 17:21:06 +0300 Subject: [freetds] "SET FMTONLY ON select .." locks table Message-ID: Hi all, I am using freetds to do bulk load from linux to mssql, it is interesting that we get some problem during "SET FMTONLY ON.." query, it is just getting table columns but somehow it gets the table lock and blocks other bulk load operations.. do you have any idea, is it possible to disable this "set fmtonly" query and give table column names manually instead.. regards. dblib.c:1369:dbsqlexec(0xaba400) dblib.c:6862:dbsqlsend(0xaba400) mem.c:615:tds_free_all_results() util.c:156:Changed query state from IDLE to QUERYING write.c:139:tds_put_string converting 73 bytes of "SET FMTONLY ON select * from clickstream.dbo.clicks_t SET FMTONLY OFF" write.c:167:tds_put_string wrote 146 bytes util.c:156:Changed query state from QUERYING to PENDING net.c:743:Sending packet 0000 01 01 00 9a 00 00 01 00-53 00 45 00 54 00 20 00 |........ S.E.T. .| 0010 46 00 4d 00 54 00 4f 00-4e 00 4c 00 59 00 20 00 |F.M.T.O. N.L.Y. .| 0020 4f 00 4e 00 20 00 73 00-65 00 6c 00 65 00 63 00 |O.N. .s. e.l.e.c.| 0030 74 00 20 00 2a 00 20 00-66 00 72 00 6f 00 6d 00 |t. .*. . f.r.o.m.| 0040 20 00 65 00 76 00 61 00-6d 00 63 00 6c 00 69 00 | .......... ..c.l.i.| 0050 63 00 6b 00 73 00 74 00-72 00 65 00 61 00 6d 00 |c.k.s.t. r.e.a.m.| 0060 2e 00 64 00 62 00 6f 00-2e 00 63 00 6c 00 69 00 |..d.b.o. ..c.l.i.| 0070 63 00 6b 00 73 00 5f 00-74 00 20 00 53 00 45 00 |c.k.s._. t. .S.E.| 0080 54 00 20 00 46 00 4d 00-54 00 4f 00 4e 00 4c 00 |T. .F.M. T.O.N.L.| 0090 59 00 20 00 4f 00 46 00-46 00 |Y. .O.F. F.| dblib.c:4639:dbsqlok(0xaba400) dblib.c:4669:dbsqlok() not done, calling tds_process_tokens() token.c:540:tds_process_tokens(0xabaee0, 0x7ffff1375b30, 0x7ffff1375b34, 0x6914) util.c:156:Changed query state from PENDING to READING -- Yavuz G?k?rmak Co-Founder & Chief Data Architect Infoowl Software Solutions & Consultancy yavuz.gokirmak at infoowl.net +90 530 420 00 59 www.infoowl.net From freddy77 at gmail.com Fri Oct 3 10:28:27 2014 From: freddy77 at gmail.com (Frediano Ziglio) Date: Fri, 3 Oct 2014 15:28:27 +0100 Subject: [freetds] "SET FMTONLY ON select .." locks table In-Reply-To: References: Message-ID: 2014-10-03 15:21 GMT+01:00 Yavuz G?k?rmak : > Hi all, > > I am using freetds to do bulk load from linux to mssql, > it is interesting that we get some problem during "SET FMTONLY ON.." query, > it is just getting table columns but somehow it gets the table lock and > blocks other bulk load operations.. > > do you have any idea, > is it possible to disable this "set fmtonly" query and give table column > names manually instead.. > regards. > Hi, probably adding a (nolock) to the query like SET FMTONLY ON select * from clickstream.dbo.clicks_t(nolock) SET FMTONLY OFF can help. > dblib.c:1369:dbsqlexec(0xaba400) > dblib.c:6862:dbsqlsend(0xaba400) > mem.c:615:tds_free_all_results() > util.c:156:Changed query state from IDLE to QUERYING > write.c:139:tds_put_string converting 73 bytes of "SET FMTONLY ON select * > from clickstream.dbo.clicks_t SET FMTONLY OFF" > write.c:167:tds_put_string wrote 146 bytes > util.c:156:Changed query state from QUERYING to PENDING > net.c:743:Sending packet > 0000 01 01 00 9a 00 00 01 00-53 00 45 00 54 00 20 00 |........ S.E.T. .| > 0010 46 00 4d 00 54 00 4f 00-4e 00 4c 00 59 00 20 00 |F.M.T.O. N.L.Y. .| > 0020 4f 00 4e 00 20 00 73 00-65 00 6c 00 65 00 63 00 |O.N. .s. e.l.e.c.| > 0030 74 00 20 00 2a 00 20 00-66 00 72 00 6f 00 6d 00 |t. .*. . f.r.o.m.| > 0040 20 00 65 00 76 00 61 00-6d 00 63 00 6c 00 69 00 | .......... ..c.l.i.| > 0050 63 00 6b 00 73 00 74 00-72 00 65 00 61 00 6d 00 |c.k.s.t. r.e.a.m.| > 0060 2e 00 64 00 62 00 6f 00-2e 00 63 00 6c 00 69 00 |..d.b.o. ..c.l.i.| > 0070 63 00 6b 00 73 00 5f 00-74 00 20 00 53 00 45 00 |c.k.s._. t. .S.E.| > 0080 54 00 20 00 46 00 4d 00-54 00 4f 00 4e 00 4c 00 |T. .F.M. T.O.N.L.| > 0090 59 00 20 00 4f 00 46 00-46 00 |Y. .O.F. F.| > > dblib.c:4639:dbsqlok(0xaba400) > dblib.c:4669:dbsqlok() not done, calling tds_process_tokens() > token.c:540:tds_process_tokens(0xabaee0, 0x7ffff1375b30, 0x7ffff1375b34, > 0x6914) > util.c:156:Changed query state from PENDING to READING > Regards, Frediano From yavuz.gokirmak at infoowl.net Fri Oct 3 10:30:27 2014 From: yavuz.gokirmak at infoowl.net (=?UTF-8?B?WWF2dXogR8O2a8Sxcm1haw==?=) Date: Fri, 3 Oct 2014 17:30:27 +0300 Subject: [freetds] "SET FMTONLY ON select .." locks table In-Reply-To: References: Message-ID: Thanks Frediano, nolock may solve but this query ( or logic ) is hardcode implemented in freetds, is it configurable? 2014-10-03 17:28 GMT+03:00 Frediano Ziglio : > 2014-10-03 15:21 GMT+01:00 Yavuz G?k?rmak : > > Hi all, > > > > I am using freetds to do bulk load from linux to mssql, > > it is interesting that we get some problem during "SET FMTONLY ON.." > query, > > it is just getting table columns but somehow it gets the table lock and > > blocks other bulk load operations.. > > > > do you have any idea, > > is it possible to disable this "set fmtonly" query and give table column > > names manually instead.. > > regards. > > > > Hi, > probably adding a (nolock) to the query like > > SET FMTONLY ON select * from clickstream.dbo.clicks_t(nolock) SET FMTONLY > OFF > > can help. > > > dblib.c:1369:dbsqlexec(0xaba400) > > dblib.c:6862:dbsqlsend(0xaba400) > > mem.c:615:tds_free_all_results() > > util.c:156:Changed query state from IDLE to QUERYING > > write.c:139:tds_put_string converting 73 bytes of "SET FMTONLY ON select > * > > from clickstream.dbo.clicks_t SET FMTONLY OFF" > > write.c:167:tds_put_string wrote 146 bytes > > util.c:156:Changed query state from QUERYING to PENDING > > net.c:743:Sending packet > > 0000 01 01 00 9a 00 00 01 00-53 00 45 00 54 00 20 00 |........ S.E.T. .| > > 0010 46 00 4d 00 54 00 4f 00-4e 00 4c 00 59 00 20 00 |F.M.T.O. N.L.Y. .| > > 0020 4f 00 4e 00 20 00 73 00-65 00 6c 00 65 00 63 00 |O.N. .s. e.l.e.c.| > > 0030 74 00 20 00 2a 00 20 00-66 00 72 00 6f 00 6d 00 |t. .*. . f.r.o.m.| > > 0040 20 00 65 00 76 00 61 00-6d 00 63 00 6c 00 69 00 | .......... > ..c.l.i.| > > 0050 63 00 6b 00 73 00 74 00-72 00 65 00 61 00 6d 00 |c.k.s.t. r.e.a.m.| > > 0060 2e 00 64 00 62 00 6f 00-2e 00 63 00 6c 00 69 00 |..d.b.o. ..c.l.i.| > > 0070 63 00 6b 00 73 00 5f 00-74 00 20 00 53 00 45 00 |c.k.s._. t. .S.E.| > > 0080 54 00 20 00 46 00 4d 00-54 00 4f 00 4e 00 4c 00 |T. .F.M. T.O.N.L.| > > 0090 59 00 20 00 4f 00 46 00-46 00 |Y. .O.F. F.| > > > > dblib.c:4639:dbsqlok(0xaba400) > > dblib.c:4669:dbsqlok() not done, calling tds_process_tokens() > > token.c:540:tds_process_tokens(0xabaee0, 0x7ffff1375b30, 0x7ffff1375b34, > > 0x6914) > > util.c:156:Changed query state from PENDING to READING > > > > Regards, > Frediano > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > -- Yavuz G?k?rmak Co-Founder & Chief Data Architect Infoowl Software Solutions & Consultancy yavuz.gokirmak at infoowl.net +90 530 420 00 59 www.infoowl.net From freddy77 at gmail.com Fri Oct 3 10:41:20 2014 From: freddy77 at gmail.com (Frediano Ziglio) Date: Fri, 3 Oct 2014 15:41:20 +0100 Subject: [freetds] "SET FMTONLY ON select .." locks table In-Reply-To: References: Message-ID: Actually not but as this query is just used to get metadata and as lock last only the time to get this information I don't see the point of locking here. Frediano 2014-10-03 15:30 GMT+01:00 Yavuz G?k?rmak : > Thanks Frediano, > > nolock may solve but this query ( or logic ) > is hardcode implemented in freetds, > is it configurable? > > 2014-10-03 17:28 GMT+03:00 Frediano Ziglio : > >> 2014-10-03 15:21 GMT+01:00 Yavuz G?k?rmak : >> > Hi all, >> > >> > I am using freetds to do bulk load from linux to mssql, >> > it is interesting that we get some problem during "SET FMTONLY ON.." >> query, >> > it is just getting table columns but somehow it gets the table lock and >> > blocks other bulk load operations.. >> > >> > do you have any idea, >> > is it possible to disable this "set fmtonly" query and give table column >> > names manually instead.. >> > regards. >> > >> >> Hi, >> probably adding a (nolock) to the query like >> >> SET FMTONLY ON select * from clickstream.dbo.clicks_t(nolock) SET FMTONLY >> OFF >> >> can help. >> >> > dblib.c:1369:dbsqlexec(0xaba400) >> > dblib.c:6862:dbsqlsend(0xaba400) >> > mem.c:615:tds_free_all_results() >> > util.c:156:Changed query state from IDLE to QUERYING >> > write.c:139:tds_put_string converting 73 bytes of "SET FMTONLY ON select >> * >> > from clickstream.dbo.clicks_t SET FMTONLY OFF" >> > write.c:167:tds_put_string wrote 146 bytes >> > util.c:156:Changed query state from QUERYING to PENDING >> > net.c:743:Sending packet >> > 0000 01 01 00 9a 00 00 01 00-53 00 45 00 54 00 20 00 |........ S.E.T. .| >> > 0010 46 00 4d 00 54 00 4f 00-4e 00 4c 00 59 00 20 00 |F.M.T.O. N.L.Y. .| >> > 0020 4f 00 4e 00 20 00 73 00-65 00 6c 00 65 00 63 00 |O.N. .s. e.l.e.c.| >> > 0030 74 00 20 00 2a 00 20 00-66 00 72 00 6f 00 6d 00 |t. .*. . f.r.o.m.| >> > 0040 20 00 65 00 76 00 61 00-6d 00 63 00 6c 00 69 00 | .......... >> ..c.l.i.| >> > 0050 63 00 6b 00 73 00 74 00-72 00 65 00 61 00 6d 00 |c.k.s.t. r.e.a.m.| >> > 0060 2e 00 64 00 62 00 6f 00-2e 00 63 00 6c 00 69 00 |..d.b.o. ..c.l.i.| >> > 0070 63 00 6b 00 73 00 5f 00-74 00 20 00 53 00 45 00 |c.k.s._. t. .S.E.| >> > 0080 54 00 20 00 46 00 4d 00-54 00 4f 00 4e 00 4c 00 |T. .F.M. T.O.N.L.| >> > 0090 59 00 20 00 4f 00 46 00-46 00 |Y. .O.F. F.| >> > >> > dblib.c:4639:dbsqlok(0xaba400) >> > dblib.c:4669:dbsqlok() not done, calling tds_process_tokens() >> > token.c:540:tds_process_tokens(0xabaee0, 0x7ffff1375b30, 0x7ffff1375b34, >> > 0x6914) >> > util.c:156:Changed query state from PENDING to READING >> > >> >> Regards, >> Frediano >> _______________________________________________ >> FreeTDS mailing list >> FreeTDS at lists.ibiblio.org >> http://lists.ibiblio.org/mailman/listinfo/freetds >> > > > > -- > Yavuz G?k?rmak > Co-Founder & Chief Data Architect > Infoowl Software Solutions & Consultancy > > yavuz.gokirmak at infoowl.net > +90 530 420 00 59 > www.infoowl.net > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds From yavuz.gokirmak at infoowl.net Fri Oct 3 10:46:11 2014 From: yavuz.gokirmak at infoowl.net (=?UTF-8?B?WWF2dXogR8O2a8Sxcm1haw==?=) Date: Fri, 3 Oct 2014 17:46:11 +0300 Subject: [freetds] "SET FMTONLY ON select .." locks table In-Reply-To: References: Message-ID: I think this query may have some unexpected behaivours.. http://social.msdn.microsoft.com/Forums/sqlserver/en-US/395f333e-78f7-49a3-8220-f952368153f2/fmtonly-long-running-?forum=transactsql But actually I don't understand why it locks the table too.. 2014-10-03 17:41 GMT+03:00 Frediano Ziglio : > Actually not but as this query is just used to get metadata and as > lock last only the time to get this information I don't see the point > of locking here. > > Frediano > > > 2014-10-03 15:30 GMT+01:00 Yavuz G?k?rmak : > > Thanks Frediano, > > > > nolock may solve but this query ( or logic ) > > is hardcode implemented in freetds, > > is it configurable? > > > > 2014-10-03 17:28 GMT+03:00 Frediano Ziglio : > > > >> 2014-10-03 15:21 GMT+01:00 Yavuz G?k?rmak : > >> > Hi all, > >> > > >> > I am using freetds to do bulk load from linux to mssql, > >> > it is interesting that we get some problem during "SET FMTONLY ON.." > >> query, > >> > it is just getting table columns but somehow it gets the table lock > and > >> > blocks other bulk load operations.. > >> > > >> > do you have any idea, > >> > is it possible to disable this "set fmtonly" query and give table > column > >> > names manually instead.. > >> > regards. > >> > > >> > >> Hi, > >> probably adding a (nolock) to the query like > >> > >> SET FMTONLY ON select * from clickstream.dbo.clicks_t(nolock) SET > FMTONLY > >> OFF > >> > >> can help. > >> > >> > dblib.c:1369:dbsqlexec(0xaba400) > >> > dblib.c:6862:dbsqlsend(0xaba400) > >> > mem.c:615:tds_free_all_results() > >> > util.c:156:Changed query state from IDLE to QUERYING > >> > write.c:139:tds_put_string converting 73 bytes of "SET FMTONLY ON > select > >> * > >> > from clickstream.dbo.clicks_t SET FMTONLY OFF" > >> > write.c:167:tds_put_string wrote 146 bytes > >> > util.c:156:Changed query state from QUERYING to PENDING > >> > net.c:743:Sending packet > >> > 0000 01 01 00 9a 00 00 01 00-53 00 45 00 54 00 20 00 |........ S.E.T. > .| > >> > 0010 46 00 4d 00 54 00 4f 00-4e 00 4c 00 59 00 20 00 |F.M.T.O. N.L.Y. > .| > >> > 0020 4f 00 4e 00 20 00 73 00-65 00 6c 00 65 00 63 00 |O.N. .s. > e.l.e.c.| > >> > 0030 74 00 20 00 2a 00 20 00-66 00 72 00 6f 00 6d 00 |t. .*. . > f.r.o.m.| > >> > 0040 20 00 65 00 76 00 61 00-6d 00 63 00 6c 00 69 00 | .......... > >> ..c.l.i.| > >> > 0050 63 00 6b 00 73 00 74 00-72 00 65 00 61 00 6d 00 |c.k.s.t. > r.e.a.m.| > >> > 0060 2e 00 64 00 62 00 6f 00-2e 00 63 00 6c 00 69 00 |..d.b.o. > ..c.l.i.| > >> > 0070 63 00 6b 00 73 00 5f 00-74 00 20 00 53 00 45 00 |c.k.s._. t. > .S.E.| > >> > 0080 54 00 20 00 46 00 4d 00-54 00 4f 00 4e 00 4c 00 |T. .F.M. > T.O.N.L.| > >> > 0090 59 00 20 00 4f 00 46 00-46 00 |Y. .O.F. F.| > >> > > >> > dblib.c:4639:dbsqlok(0xaba400) > >> > dblib.c:4669:dbsqlok() not done, calling tds_process_tokens() > >> > token.c:540:tds_process_tokens(0xabaee0, 0x7ffff1375b30, > 0x7ffff1375b34, > >> > 0x6914) > >> > util.c:156:Changed query state from PENDING to READING > >> > > >> > >> Regards, > >> Frediano > >> _______________________________________________ > >> FreeTDS mailing list > >> FreeTDS at lists.ibiblio.org > >> http://lists.ibiblio.org/mailman/listinfo/freetds > >> > > > > > > > > -- > > Yavuz G?k?rmak > > Co-Founder & Chief Data Architect > > Infoowl Software Solutions & Consultancy > > > > yavuz.gokirmak at infoowl.net > > +90 530 420 00 59 > > www.infoowl.net > > _______________________________________________ > > FreeTDS mailing list > > FreeTDS at lists.ibiblio.org > > http://lists.ibiblio.org/mailman/listinfo/freetds > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > -- Yavuz G?k?rmak Co-Founder & Chief Data Architect Infoowl Software Solutions & Consultancy yavuz.gokirmak at infoowl.net +90 530 420 00 59 www.infoowl.net From freddy77 at gmail.com Sat Oct 4 03:55:56 2014 From: freddy77 at gmail.com (Frediano Ziglio) Date: Sat, 4 Oct 2014 08:55:56 +0100 Subject: [freetds] "SET FMTONLY ON select .." locks table In-Reply-To: References: Message-ID: This can be true for views or store procedure but when you do bulk inserts you use tables. Frediano 2014-10-03 15:46 GMT+01:00 Yavuz G?k?rmak : > I think this query may have some unexpected behaivours.. > > http://social.msdn.microsoft.com/Forums/sqlserver/en-US/395f333e-78f7-49a3-8220-f952368153f2/fmtonly-long-running-?forum=transactsql > > But actually I don't understand why it locks the table too.. > > 2014-10-03 17:41 GMT+03:00 Frediano Ziglio : > >> Actually not but as this query is just used to get metadata and as >> lock last only the time to get this information I don't see the point >> of locking here. >> >> Frediano >> >> >> 2014-10-03 15:30 GMT+01:00 Yavuz G?k?rmak : >> > Thanks Frediano, >> > >> > nolock may solve but this query ( or logic ) >> > is hardcode implemented in freetds, >> > is it configurable? >> > >> > 2014-10-03 17:28 GMT+03:00 Frediano Ziglio : >> > >> >> 2014-10-03 15:21 GMT+01:00 Yavuz G?k?rmak : >> >> > Hi all, >> >> > >> >> > I am using freetds to do bulk load from linux to mssql, >> >> > it is interesting that we get some problem during "SET FMTONLY ON.." >> >> query, >> >> > it is just getting table columns but somehow it gets the table lock >> and >> >> > blocks other bulk load operations.. >> >> > >> >> > do you have any idea, >> >> > is it possible to disable this "set fmtonly" query and give table >> column >> >> > names manually instead.. >> >> > regards. >> >> > >> >> >> >> Hi, >> >> probably adding a (nolock) to the query like >> >> >> >> SET FMTONLY ON select * from clickstream.dbo.clicks_t(nolock) SET >> FMTONLY >> >> OFF >> >> >> >> can help. >> >> >> >> > dblib.c:1369:dbsqlexec(0xaba400) >> >> > dblib.c:6862:dbsqlsend(0xaba400) >> >> > mem.c:615:tds_free_all_results() >> >> > util.c:156:Changed query state from IDLE to QUERYING >> >> > write.c:139:tds_put_string converting 73 bytes of "SET FMTONLY ON >> select >> >> * >> >> > from clickstream.dbo.clicks_t SET FMTONLY OFF" >> >> > write.c:167:tds_put_string wrote 146 bytes >> >> > util.c:156:Changed query state from QUERYING to PENDING >> >> > net.c:743:Sending packet >> >> > 0000 01 01 00 9a 00 00 01 00-53 00 45 00 54 00 20 00 |........ S.E.T. >> .| >> >> > 0010 46 00 4d 00 54 00 4f 00-4e 00 4c 00 59 00 20 00 |F.M.T.O. N.L.Y. >> .| >> >> > 0020 4f 00 4e 00 20 00 73 00-65 00 6c 00 65 00 63 00 |O.N. .s. >> e.l.e.c.| >> >> > 0030 74 00 20 00 2a 00 20 00-66 00 72 00 6f 00 6d 00 |t. .*. . >> f.r.o.m.| >> >> > 0040 20 00 65 00 76 00 61 00-6d 00 63 00 6c 00 69 00 | .......... >> >> ..c.l.i.| >> >> > 0050 63 00 6b 00 73 00 74 00-72 00 65 00 61 00 6d 00 |c.k.s.t. >> r.e.a.m.| >> >> > 0060 2e 00 64 00 62 00 6f 00-2e 00 63 00 6c 00 69 00 |..d.b.o. >> ..c.l.i.| >> >> > 0070 63 00 6b 00 73 00 5f 00-74 00 20 00 53 00 45 00 |c.k.s._. t. >> .S.E.| >> >> > 0080 54 00 20 00 46 00 4d 00-54 00 4f 00 4e 00 4c 00 |T. .F.M. >> T.O.N.L.| >> >> > 0090 59 00 20 00 4f 00 46 00-46 00 |Y. .O.F. F.| >> >> > >> >> > dblib.c:4639:dbsqlok(0xaba400) >> >> > dblib.c:4669:dbsqlok() not done, calling tds_process_tokens() >> >> > token.c:540:tds_process_tokens(0xabaee0, 0x7ffff1375b30, >> 0x7ffff1375b34, >> >> > 0x6914) >> >> > util.c:156:Changed query state from PENDING to READING >> >> > >> >> >> >> Regards, >> >> Frediano >> >> _______________________________________________ >> >> FreeTDS mailing list >> >> FreeTDS at lists.ibiblio.org >> >> http://lists.ibiblio.org/mailman/listinfo/freetds >> >> >> > >> > >> > >> > -- >> > Yavuz G?k?rmak >> > Co-Founder & Chief Data Architect >> > Infoowl Software Solutions & Consultancy >> > >> > yavuz.gokirmak at infoowl.net >> > +90 530 420 00 59 >> > www.infoowl.net >> > _______________________________________________ >> > FreeTDS mailing list >> > FreeTDS at lists.ibiblio.org >> > http://lists.ibiblio.org/mailman/listinfo/freetds >> _______________________________________________ >> FreeTDS mailing list >> FreeTDS at lists.ibiblio.org >> http://lists.ibiblio.org/mailman/listinfo/freetds >> > > > > -- > Yavuz G?k?rmak > Co-Founder & Chief Data Architect > Infoowl Software Solutions & Consultancy > > yavuz.gokirmak at infoowl.net > +90 530 420 00 59 > www.infoowl.net > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds From rhill at hillconsult.com Sat Oct 4 04:04:22 2014 From: rhill at hillconsult.com (Roger Hill) Date: Sat, 4 Oct 2014 09:04:22 +0100 Subject: [freetds] Netezza and named pipes Message-ID: <4a70daad12ba05d21702c65d3424cc3f.squirrel@hillconsult.cricalix.net> My first post to the list: please be gentle! I need to copy a large volume of data every day from a Netezza database to several other SQL server databases. I have a solution that works: I use isql to extract to a named pipe, pass the output through a couple of 'cut' steps to remove unwanted bits and pieces, and then land the data on disk into a temporary file. I then use freebcp to load it to the SQL server database. But it's convoluted, and I'm looking for a better way. Two questions come out of this: Firstly I know that freebcp did not support input from named pipes as recently as 2011; is there support for named pipes now? And secondly, something like 'datacopy' between heterogeneous databases (in my case Netezza to SQL server) would eliminate a lot of mucking about on the intermediate box. Any chance of something like that? Any other suggestions? Cheers Roger Hill **************************************** Roger Hill **************************************** From ganoopluslinux at gmail.com Mon Oct 6 14:57:51 2014 From: ganoopluslinux at gmail.com (James Fisher) Date: Mon, 6 Oct 2014 13:57:51 -0500 Subject: [freetds] SQL Anywhere 11 and FreeTDS Message-ID: OP: http://thread.gmane.org/gmane.comp.db.tds.freetds/11976 Hello, I am new to mailing lists, so sorry if it's bad that I am reviving this old thread - but I am having the same issue as this guy from several years back... I setup a few debian and ubuntu servers to talk to our database(Sybase SQL Anywhere 11) using sqsh and adodb(php) with FreeTDS. Once configured to use TDS v5.0, both sqsh and adodb can connect and execute queries on the database. However, when I began looking at the log on the server I found that each time either application disconnects, it shows a message like: >Connection terminated abnormally >Disconnected TCPIP client's AppInfo: HOST=debian-vm;PID=2605 The database doesn't *seem* affected - as far as I can tell... The statements return the rows or insert the data. I see no performance hit, etc... but it is concerning none the less. I have also tested with SQL Anywhere 10, 11, 12, & 16, all have the same issue(and so does their development versions). I have tried tsql/isql and both produce the same error. Sybase's dbisql/sa_php extension/native odbc client all work without the error. I have a FreeTDS log here: https://gist.github.com/anonymous/b9146103bb16d4eb94c9 I will be happy to do any other dump that might be helpful, including setting up an test environment on digitalocean for anyone who'd like to take a look. Thanks to anyone willing to help in any way. From ganoopluslinux at gmail.com Tue Oct 7 14:18:55 2014 From: ganoopluslinux at gmail.com (James Fisher) Date: Tue, 7 Oct 2014 13:18:55 -0500 Subject: [freetds] SQL Anywhere 11 and FreeTDS In-Reply-To: References: Message-ID: While reviewing the old thread I found that someone(Mr. James Lowden) requested a tcpdump in order to capture a 'proper' disconnect but I didn't see that the OP followed up. http://lists.ibiblio.org/pipermail/freetds/2009q4/025362.html I have attached mine here. If this isn't the right information, please let me know. Thanks again to anyone willing to help. On Mon, Oct 6, 2014 at 1:57 PM, James Fisher wrote: > OP: http://thread.gmane.org/gmane.comp.db.tds.freetds/11976 > > Hello, I am new to mailing lists, so sorry if it's bad that I am reviving > this old thread - but I am having the same issue as this guy from several > years back... > > I setup a few debian and ubuntu servers to talk to our database(Sybase SQL > Anywhere 11) using sqsh and adodb(php) with FreeTDS. Once configured to > use TDS v5.0, both sqsh and adodb can connect and execute queries on the > database. However, when I began looking at the log on the server I found > that each time either application disconnects, it shows a message like: > > >Connection terminated abnormally > >Disconnected TCPIP client's AppInfo: HOST=debian-vm;PID=2605 > > The database doesn't *seem* affected - as far as I can tell... > > The statements return the rows or insert the data. > > I see no performance hit, etc... but it is concerning none the less. > > I have also tested with SQL Anywhere 10, 11, 12, & 16, all have the same > issue(and so does their development versions). I have tried tsql/isql and > both produce the same error. > Sybase's dbisql/sa_php extension/native odbc client all work without the > error. > > I have a FreeTDS log here: > > https://gist.github.com/anonymous/b9146103bb16d4eb94c9 > > I will be happy to do any other dump that might be helpful, > including setting up an test environment on digitalocean > for anyone who'd like to take a look. > > Thanks to anyone willing to help in any way. > -------------- next part -------------- A non-text attachment was scrubbed... Name: tcpdump.log Type: application/octet-stream Size: 136 bytes Desc: not available URL: From Alinga.Yeung at nrc-cnrc.gc.ca Tue Oct 7 14:40:03 2014 From: Alinga.Yeung at nrc-cnrc.gc.ca (Yeung, Alinga) Date: Tue, 7 Oct 2014 11:40:03 -0700 Subject: [freetds] Request to map Sybase status code '3604' to SQLSTATE '01000' In-Reply-To: <4E52262B71749242AFB45D617BA3A8A0C09E853818@NRCWSTHCM1.NRC.CA> References: <4E52262B71749242AFB45D617BA3A8A0C09E853818@NRCWSTHCM1.NRC.CA> Message-ID: <4E52262B71749242AFB45D617BA3A8A0C09E853867@NRCWSTHCM1.NRC.CA> Hi, We have not received any response to our request below. We are wondering if our request has been accepted or rejected. A response would be much appreciated. In short, we are requesting that line 1469 in src/tds/mem.c (in freetds-0.91) be changed from: === 1469 SQLS_ENTRY(3604,"23000"); === to: === 1469 SQLS_ENTRY(3604,"01000"); === Thank you in advance for your help. Alinga ________________________________________ From: Yeung, Alinga Sent: Wednesday, September 10, 2014 10:16 AM To: freetds at lists.ibiblio.org Subject: Request to map Sybase status code '3604' to SQLSTATE '01000' Hi, We use Sybase. We are porting our software to use Freetds. We come across a status code mapping from Sybase to Freetds that results in a behavioural discrepancy in our software. In src/tds/mem.c, the Sybase status code '3604' is mapped to SQLSTATUS '23000'. This is causing our software to fail. Sybase status code '3604' does not require any action to be taken. Our software treats the status code as informational/warning and does not take any action. SQLSTATE '23000' indicates an error instead. Locally we have changed mem.c to map the Sybase status code '3604' to '01000' which is a general warning, and our software works fine. We would like to request that Sybase status code '3604' be mapped to an informational SQLSTATUS, e.g. '01000'. Thank you. Alinga From freddy77 at gmail.com Tue Oct 7 16:08:22 2014 From: freddy77 at gmail.com (Frediano Ziglio) Date: Tue, 7 Oct 2014 21:08:22 +0100 Subject: [freetds] SQL Anywhere 11 and FreeTDS In-Reply-To: References: Message-ID: Looks not correct. The capture contains a single UDP packet. Sql server use TCP connections. Frediano 2014-10-07 19:18 GMT+01:00 James Fisher : > While reviewing the old thread I found that someone(Mr. James Lowden) > requested a tcpdump in order to capture a 'proper' disconnect but I didn't > see that the OP followed up. > http://lists.ibiblio.org/pipermail/freetds/2009q4/025362.html > > I have attached mine here. If this isn't the right information, please let > me know. Thanks again to anyone willing to help. > > On Mon, Oct 6, 2014 at 1:57 PM, James Fisher > wrote: > >> OP: http://thread.gmane.org/gmane.comp.db.tds.freetds/11976 >> >> Hello, I am new to mailing lists, so sorry if it's bad that I am reviving >> this old thread - but I am having the same issue as this guy from several >> years back... >> >> I setup a few debian and ubuntu servers to talk to our database(Sybase SQL >> Anywhere 11) using sqsh and adodb(php) with FreeTDS. Once configured to >> use TDS v5.0, both sqsh and adodb can connect and execute queries on the >> database. However, when I began looking at the log on the server I found >> that each time either application disconnects, it shows a message like: >> >> >Connection terminated abnormally >> >Disconnected TCPIP client's AppInfo: HOST=debian-vm;PID=2605 >> >> The database doesn't *seem* affected - as far as I can tell... >> >> The statements return the rows or insert the data. >> >> I see no performance hit, etc... but it is concerning none the less. >> >> I have also tested with SQL Anywhere 10, 11, 12, & 16, all have the same >> issue(and so does their development versions). I have tried tsql/isql and >> both produce the same error. >> Sybase's dbisql/sa_php extension/native odbc client all work without the >> error. >> >> I have a FreeTDS log here: >> >> https://gist.github.com/anonymous/b9146103bb16d4eb94c9 >> >> I will be happy to do any other dump that might be helpful, >> including setting up an test environment on digitalocean >> for anyone who'd like to take a look. >> >> Thanks to anyone willing to help in any way. >> > > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > From freddy77 at gmail.com Tue Oct 7 16:10:19 2014 From: freddy77 at gmail.com (Frediano Ziglio) Date: Tue, 7 Oct 2014 21:10:19 +0100 Subject: [freetds] Request to map Sybase status code '3604' to SQLSTATE '01000' In-Reply-To: <4E52262B71749242AFB45D617BA3A8A0C09E853867@NRCWSTHCM1.NRC.CA> References: <4E52262B71749242AFB45D617BA3A8A0C09E853818@NRCWSTHCM1.NRC.CA> <4E52262B71749242AFB45D617BA3A8A0C09E853867@NRCWSTHCM1.NRC.CA> Message-ID: Hi, sorry for no reply. Personally I would like to see what other libraries does with this error. Frediano 2014-10-07 19:40 GMT+01:00 Yeung, Alinga : > Hi, > > We have not received any response to our request below. We are wondering if our request has been accepted or rejected. A response would be much appreciated. > > In short, we are requesting that line 1469 in src/tds/mem.c (in freetds-0.91) be changed > from: > === > 1469 SQLS_ENTRY(3604,"23000"); > === > to: > === > 1469 SQLS_ENTRY(3604,"01000"); > === > > Thank you in advance for your help. > > Alinga > ________________________________________ > From: Yeung, Alinga > Sent: Wednesday, September 10, 2014 10:16 AM > To: freetds at lists.ibiblio.org > Subject: Request to map Sybase status code '3604' to SQLSTATE '01000' > > Hi, > > We use Sybase. We are porting our software to use Freetds. We come across a status code mapping from Sybase to Freetds that results in a behavioural discrepancy in our software. > > In src/tds/mem.c, the Sybase status code '3604' is mapped to SQLSTATUS '23000'. This is causing our software to fail. > > Sybase status code '3604' does not require any action to be taken. Our software treats the status code as informational/warning and does not take any action. > > SQLSTATE '23000' indicates an error instead. > > Locally we have changed mem.c to map the Sybase status code '3604' to '01000' which is a general warning, and our software works fine. > > We would like to request that Sybase status code '3604' be mapped to an informational SQLSTATUS, e.g. '01000'. > > Thank you. > > Alinga > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds From ganoopluslinux at gmail.com Tue Oct 7 16:39:37 2014 From: ganoopluslinux at gmail.com (James Fisher) Date: Tue, 7 Oct 2014 15:39:37 -0500 Subject: [freetds] SQL Anywhere 11 and FreeTDS In-Reply-To: References: Message-ID: Frediano, Thank you so much for your response, I have attached here a new tcpdump. Sorry I am not too familiar with that tool. Please let me know if this is correct. I am running tcpdump on the client using this: tcpdump -i eth0 -w native.log -s0 host {client IP} Thanks again. On Tue, Oct 7, 2014 at 3:08 PM, Frediano Ziglio wrote: > Looks not correct. The capture contains a single UDP packet. Sql > server use TCP connections. > > Frediano > > > 2014-10-07 19:18 GMT+01:00 James Fisher : > > While reviewing the old thread I found that someone(Mr. James Lowden) > > requested a tcpdump in order to capture a 'proper' disconnect but I > didn't > > see that the OP followed up. > > http://lists.ibiblio.org/pipermail/freetds/2009q4/025362.html > > > > I have attached mine here. If this isn't the right information, please > let > > me know. Thanks again to anyone willing to help. > > > > On Mon, Oct 6, 2014 at 1:57 PM, James Fisher > > wrote: > > > >> OP: http://thread.gmane.org/gmane.comp.db.tds.freetds/11976 > >> > >> Hello, I am new to mailing lists, so sorry if it's bad that I am > reviving > >> this old thread - but I am having the same issue as this guy from > several > >> years back... > >> > >> I setup a few debian and ubuntu servers to talk to our database(Sybase > SQL > >> Anywhere 11) using sqsh and adodb(php) with FreeTDS. Once configured to > >> use TDS v5.0, both sqsh and adodb can connect and execute queries on the > >> database. However, when I began looking at the log on the server I found > >> that each time either application disconnects, it shows a message like: > >> > >> >Connection terminated abnormally > >> >Disconnected TCPIP client's AppInfo: HOST=debian-vm;PID=2605 > >> > >> The database doesn't *seem* affected - as far as I can tell... > >> > >> The statements return the rows or insert the data. > >> > >> I see no performance hit, etc... but it is concerning none the less. > >> > >> I have also tested with SQL Anywhere 10, 11, 12, & 16, all have the same > >> issue(and so does their development versions). I have tried tsql/isql > and > >> both produce the same error. > >> Sybase's dbisql/sa_php extension/native odbc client all work without the > >> error. > >> > >> I have a FreeTDS log here: > >> > >> https://gist.github.com/anonymous/b9146103bb16d4eb94c9 > >> > >> I will be happy to do any other dump that might be helpful, > >> including setting up an test environment on digitalocean > >> for anyone who'd like to take a look. > >> > >> Thanks to anyone willing to help in any way. > >> > > > > _______________________________________________ > > FreeTDS mailing list > > FreeTDS at lists.ibiblio.org > > http://lists.ibiblio.org/mailman/listinfo/freetds > > > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > -------------- next part -------------- A non-text attachment was scrubbed... Name: native.log Type: application/octet-stream Size: 22802 bytes Desc: not available URL: From randy at thesyrings.us Tue Oct 7 19:07:52 2014 From: randy at thesyrings.us (Randy Syring) Date: Tue, 07 Oct 2014 19:07:52 -0400 Subject: [freetds] help with "login packet rejected" Message-ID: <54347248.50206@thesyrings.us> I have a system that has been running against a QA MSSQL 2005 server (SQL7) without problems for a day or so. I switched it over to our production MSSQL 2005 server (SQL1) and I can't get connected. My TDSDUMP is: log.c:196:Starting log file for FreeTDS 0.91 on 2014-10-07 19:03:24 with debug flags 0x4fff. config.c:714:Setting 'dump_file' to '/tmp/freetds.log.2802' from $TDSDUMP. iconv.c:330:tds_iconv_open(0x2055d20, UTF-8) iconv.c:187:local name for ISO-8859-1 is ISO-8859-1 iconv.c:187:local name for UTF-8 is UTF-8 iconv.c:187:local name for UCS-2LE is UCS-2LE iconv.c:187:local name for UCS-2BE is UCS-2BE iconv.c:349:setting up conversions for client charset "UTF-8" iconv.c:351:preparing iconv for "UTF-8" <-> "UCS-2LE" conversion iconv.c:391:preparing iconv for "ISO-8859-1" <-> "UCS-2LE" conversion iconv.c:394:tds_iconv_open: done net.c:205:Connecting to 172.0.255.12 port 1433 (TDS version 7.1) net.c:270:tds_open_socket: connect(2) returned "Operation now in progress" net.c:310:tds_open_socket() succeeded util.c:156:Changed query state from DEAD to IDLE net.c:741:Sending packet 0000 12 01 00 34 00 00 00 00-00 00 15 00 06 01 00 1b |...4.... ........| 0010 00 01 02 00 1c 00 0c 03-00 28 00 04 ff 08 00 01 |........ .(......| 0020 55 00 00 00 4d 53 53 51-4c 53 65 72 76 65 72 00 |U...MSSQ LServer.| 0030 f2 0a 00 00 - |....| util.c:331:tdserror(0x1da8790, 0x2055d20, 20004, 104) dblib.c:7929:dbperror(0x260a6a0, 20004, 104) dblib.c:7981:20004: "Read from the server failed" dblib.c:8002:"Read from the server failed", client returns 2 (INT_CANCEL) util.c:361:tdserror: client library returned TDS_INT_CANCEL(2) util.c:384:tdserror: returning TDS_INT_CANCEL(2) util.c:156:Changed query state from IDLE to DEAD login.c:466:login packet rejected util.c:331:tdserror(0x1da8790, 0x2055d20, 20002, 0) dblib.c:7929:dbperror(0x260a6a0, 20002, 0) dblib.c:7981:20002: "Adaptive Server connection failed" dblib.c:8002:"Adaptive Server connection failed", client returns 2 (INT_CANCEL) util.c:361:tdserror: client library returned TDS_INT_CANCEL(2) util.c:384:tdserror: returning TDS_INT_CANCEL(2) dblib.c:1443:dbclose(0x260a6a0) dblib.c:258:dblib_del_connection(0x7f279cfc8840, 0x2055d20) mem.c:615:tds_free_all_results() dblib.c:305:dblib_release_tds_ctx(1) dblib.c:5882:dbfreebuf(0x260a6a0) dblib.c:739:dbloginfree(0x25beb40) Thoughts on where I can go from here? *Randy Syring* Husband | Father | Redeemed Sinner /"For what does it profit a man to gain the whole world and forfeit his soul?" (Mark 8:36 ESV)/ From randy at thesyrings.us Tue Oct 7 19:18:43 2014 From: randy at thesyrings.us (Randy Syring) Date: Tue, 07 Oct 2014 19:18:43 -0400 Subject: [freetds] help with "login packet rejected" In-Reply-To: <54347248.50206@thesyrings.us> References: <54347248.50206@thesyrings.us> Message-ID: <543474D3.3050906@thesyrings.us> Please disregard. Turns out I can't login from SQL Management Studio Error either. Screen shot: I'll report back for Google's sake once they figure out what is wrong. *Randy Syring* Husband | Father | Redeemed Sinner /"For what does it profit a man to gain the whole world and forfeit his soul?" (Mark 8:36 ESV)/ On 10/07/2014 07:07 PM, Randy Syring wrote: > I have a system that has been running against a QA MSSQL 2005 server > (SQL7) without problems for a day or so. I switched it over to our > production MSSQL 2005 server (SQL1) and I can't get connected. My > TDSDUMP is: > > log.c:196:Starting log file for FreeTDS 0.91 > on 2014-10-07 19:03:24 with debug flags 0x4fff. > config.c:714:Setting 'dump_file' to '/tmp/freetds.log.2802' from $TDSDUMP. > iconv.c:330:tds_iconv_open(0x2055d20, UTF-8) > iconv.c:187:local name for ISO-8859-1 is ISO-8859-1 > iconv.c:187:local name for UTF-8 is UTF-8 > iconv.c:187:local name for UCS-2LE is UCS-2LE > iconv.c:187:local name for UCS-2BE is UCS-2BE > iconv.c:349:setting up conversions for client charset "UTF-8" > iconv.c:351:preparing iconv for "UTF-8" <-> "UCS-2LE" conversion > iconv.c:391:preparing iconv for "ISO-8859-1" <-> "UCS-2LE" conversion > iconv.c:394:tds_iconv_open: done > net.c:205:Connecting to 172.0.255.12 port 1433 (TDS version 7.1) > net.c:270:tds_open_socket: connect(2) returned "Operation now in progress" > net.c:310:tds_open_socket() succeeded > util.c:156:Changed query state from DEAD to IDLE > net.c:741:Sending packet > 0000 12 01 00 34 00 00 00 00-00 00 15 00 06 01 00 1b |...4.... ........| > 0010 00 01 02 00 1c 00 0c 03-00 28 00 04 ff 08 00 01 |........ .(......| > 0020 55 00 00 00 4d 53 53 51-4c 53 65 72 76 65 72 00 |U...MSSQ LServer.| > 0030 f2 0a 00 00 - |....| > > util.c:331:tdserror(0x1da8790, 0x2055d20, 20004, 104) > dblib.c:7929:dbperror(0x260a6a0, 20004, 104) > dblib.c:7981:20004: "Read from the server failed" > dblib.c:8002:"Read from the server failed", client returns 2 (INT_CANCEL) > util.c:361:tdserror: client library returned TDS_INT_CANCEL(2) > util.c:384:tdserror: returning TDS_INT_CANCEL(2) > util.c:156:Changed query state from IDLE to DEAD > login.c:466:login packet rejected > util.c:331:tdserror(0x1da8790, 0x2055d20, 20002, 0) > dblib.c:7929:dbperror(0x260a6a0, 20002, 0) > dblib.c:7981:20002: "Adaptive Server connection failed" > dblib.c:8002:"Adaptive Server connection failed", client returns 2 > (INT_CANCEL) > util.c:361:tdserror: client library returned TDS_INT_CANCEL(2) > util.c:384:tdserror: returning TDS_INT_CANCEL(2) > dblib.c:1443:dbclose(0x260a6a0) > dblib.c:258:dblib_del_connection(0x7f279cfc8840, 0x2055d20) > mem.c:615:tds_free_all_results() > dblib.c:305:dblib_release_tds_ctx(1) > dblib.c:5882:dbfreebuf(0x260a6a0) > dblib.c:739:dbloginfree(0x25beb40) > > Thoughts on where I can go from here? > > *Randy Syring* > Husband | Father | Redeemed Sinner > > /"For what does it profit a man to gain the whole world > and forfeit his soul?" (Mark 8:36 ESV)/ > From freddy77 at gmail.com Sun Oct 12 04:18:19 2014 From: freddy77 at gmail.com (Frediano Ziglio) Date: Sun, 12 Oct 2014 09:18:19 +0100 Subject: [freetds] SQL Anywhere 11 and FreeTDS In-Reply-To: References: Message-ID: Yes, this is correct. However the protocol the client is using is quite different from the one we actually use. I can try adding a logout stream if this helps. Il 07/ott/2014 22:40 "James Fisher" ha scritto: > Frediano, > > Thank you so much for your response, I have attached here a new tcpdump. > Sorry I am not too familiar with that tool. Please let me know if this is > correct. > > I am running tcpdump on the client using this: > > tcpdump -i eth0 -w native.log -s0 host {client IP} > > Thanks again. > > On Tue, Oct 7, 2014 at 3:08 PM, Frediano Ziglio > wrote: > > > Looks not correct. The capture contains a single UDP packet. Sql > > server use TCP connections. > > > > Frediano > > > > > > 2014-10-07 19:18 GMT+01:00 James Fisher : > > > While reviewing the old thread I found that someone(Mr. James Lowden) > > > requested a tcpdump in order to capture a 'proper' disconnect but I > > didn't > > > see that the OP followed up. > > > http://lists.ibiblio.org/pipermail/freetds/2009q4/025362.html > > > > > > I have attached mine here. If this isn't the right information, please > > let > > > me know. Thanks again to anyone willing to help. > > > > > > On Mon, Oct 6, 2014 at 1:57 PM, James Fisher > > > > wrote: > > > > > >> OP: http://thread.gmane.org/gmane.comp.db.tds.freetds/11976 > > >> > > >> Hello, I am new to mailing lists, so sorry if it's bad that I am > > reviving > > >> this old thread - but I am having the same issue as this guy from > > several > > >> years back... > > >> > > >> I setup a few debian and ubuntu servers to talk to our database(Sybase > > SQL > > >> Anywhere 11) using sqsh and adodb(php) with FreeTDS. Once configured > to > > >> use TDS v5.0, both sqsh and adodb can connect and execute queries on > the > > >> database. However, when I began looking at the log on the server I > found > > >> that each time either application disconnects, it shows a message > like: > > >> > > >> >Connection terminated abnormally > > >> >Disconnected TCPIP client's AppInfo: HOST=debian-vm;PID=2605 > > >> > > >> The database doesn't *seem* affected - as far as I can tell... > > >> > > >> The statements return the rows or insert the data. > > >> > > >> I see no performance hit, etc... but it is concerning none the less. > > >> > > >> I have also tested with SQL Anywhere 10, 11, 12, & 16, all have the > same > > >> issue(and so does their development versions). I have tried tsql/isql > > and > > >> both produce the same error. > > >> Sybase's dbisql/sa_php extension/native odbc client all work without > the > > >> error. > > >> > > >> I have a FreeTDS log here: > > >> > > >> https://gist.github.com/anonymous/b9146103bb16d4eb94c9 > > >> > > >> I will be happy to do any other dump that might be helpful, > > >> including setting up an test environment on digitalocean > > >> for anyone who'd like to take a look. > > >> > > >> Thanks to anyone willing to help in any way. > > >> > > > > > > _______________________________________________ > > > FreeTDS mailing list > > > FreeTDS at lists.ibiblio.org > > > http://lists.ibiblio.org/mailman/listinfo/freetds > > > > > _______________________________________________ > > FreeTDS mailing list > > FreeTDS at lists.ibiblio.org > > http://lists.ibiblio.org/mailman/listinfo/freetds > > > > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > > From ganoopluslinux at gmail.com Sun Oct 12 04:26:24 2014 From: ganoopluslinux at gmail.com (James Fisher) Date: Sun, 12 Oct 2014 03:26:24 -0500 Subject: [freetds] SQL Anywhere 11 and FreeTDS In-Reply-To: References: Message-ID: I have just compiled sqsh and the sybase_ct php module against the native ct library, I assume that would be a better tcp dump to work with? I think the logout would be very helpful, it'd be wonderful to use freetds rather than the native library! I really appreciate your help. On Sunday, October 12, 2014, Frediano Ziglio wrote: > Yes, this is correct. However the protocol the client is using is quite > different from the one we actually use. I can try adding a logout stream if > this helps. > Il 07/ott/2014 22:40 "James Fisher" > ha scritto: > > > Frediano, > > > > Thank you so much for your response, I have attached here a new tcpdump. > > Sorry I am not too familiar with that tool. Please let me know if this is > > correct. > > > > I am running tcpdump on the client using this: > > > > tcpdump -i eth0 -w native.log -s0 host {client IP} > > > > Thanks again. > > > > On Tue, Oct 7, 2014 at 3:08 PM, Frediano Ziglio > > > wrote: > > > > > Looks not correct. The capture contains a single UDP packet. Sql > > > server use TCP connections. > > > > > > Frediano > > > > > > > > > 2014-10-07 19:18 GMT+01:00 James Fisher >: > > > > While reviewing the old thread I found that someone(Mr. James Lowden) > > > > requested a tcpdump in order to capture a 'proper' disconnect but I > > > didn't > > > > see that the OP followed up. > > > > http://lists.ibiblio.org/pipermail/freetds/2009q4/025362.html > > > > > > > > I have attached mine here. If this isn't the right information, > please > > > let > > > > me know. Thanks again to anyone willing to help. > > > > > > > > On Mon, Oct 6, 2014 at 1:57 PM, James Fisher < > ganoopluslinux at gmail.com > > > > > > > wrote: > > > > > > > >> OP: http://thread.gmane.org/gmane.comp.db.tds.freetds/11976 > > > >> > > > >> Hello, I am new to mailing lists, so sorry if it's bad that I am > > > reviving > > > >> this old thread - but I am having the same issue as this guy from > > > several > > > >> years back... > > > >> > > > >> I setup a few debian and ubuntu servers to talk to our > database(Sybase > > > SQL > > > >> Anywhere 11) using sqsh and adodb(php) with FreeTDS. Once configured > > to > > > >> use TDS v5.0, both sqsh and adodb can connect and execute queries on > > the > > > >> database. However, when I began looking at the log on the server I > > found > > > >> that each time either application disconnects, it shows a message > > like: > > > >> > > > >> >Connection terminated abnormally > > > >> >Disconnected TCPIP client's AppInfo: HOST=debian-vm;PID=2605 > > > >> > > > >> The database doesn't *seem* affected - as far as I can tell... > > > >> > > > >> The statements return the rows or insert the data. > > > >> > > > >> I see no performance hit, etc... but it is concerning none the less. > > > >> > > > >> I have also tested with SQL Anywhere 10, 11, 12, & 16, all have the > > same > > > >> issue(and so does their development versions). I have tried > tsql/isql > > > and > > > >> both produce the same error. > > > >> Sybase's dbisql/sa_php extension/native odbc client all work without > > the > > > >> error. > > > >> > > > >> I have a FreeTDS log here: > > > >> > > > >> https://gist.github.com/anonymous/b9146103bb16d4eb94c9 > > > >> > > > >> I will be happy to do any other dump that might be helpful, > > > >> including setting up an test environment on digitalocean > > > >> for anyone who'd like to take a look. > > > >> > > > >> Thanks to anyone willing to help in any way. > > > >> > > > > > > > > _______________________________________________ > > > > FreeTDS mailing list > > > > FreeTDS at lists.ibiblio.org > > > > http://lists.ibiblio.org/mailman/listinfo/freetds > > > > > > > _______________________________________________ > > > FreeTDS mailing list > > > FreeTDS at lists.ibiblio.org > > > http://lists.ibiblio.org/mailman/listinfo/freetds > > > > > > > _______________________________________________ > > FreeTDS mailing list > > FreeTDS at lists.ibiblio.org > > http://lists.ibiblio.org/mailman/listinfo/freetds > > > > > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > From freddy77 at gmail.com Sun Oct 12 04:27:59 2014 From: freddy77 at gmail.com (Frediano Ziglio) Date: Sun, 12 Oct 2014 09:27:59 +0100 Subject: [freetds] Netezza and named pipes In-Reply-To: <4a70daad12ba05d21702c65d3424cc3f.squirrel@hillconsult.cricalix.net> References: <4a70daad12ba05d21702c65d3424cc3f.squirrel@hillconsult.cricalix.net> Message-ID: Il 04/ott/2014 10:11 "Roger Hill" ha scritto: > > > My first post to the list: please be gentle! > > I need to copy a large volume of data every day from a Netezza database to > several other SQL server databases. > > I have a solution that works: I use isql to extract to a named pipe, pass the > output through a couple of 'cut' steps to remove unwanted bits and pieces, and > then land the data on disk into a temporary file. I then use freebcp to load > it to the SQL server database. But it's convoluted, and I'm looking for a > better way. > Well do you have any connector available? I don't know Netezza at all. Basically assuming there is a connector for Netezza for sql server you setup a new connection to Netezza in sql server that you can transfer data from Netezza to sql server using a sort of INSERT INTO TABLE SELECT ... FROM NETEZZA TABLE. > Two questions come out of this: Firstly I know that freebcp did not support > input from named pipes as recently as 2011; is there support for named pipes > now? > Head code does. But if I understood you are converting everything to characters and then back to database. Pay lot of attention to separators or you risk to corrupt data! > And secondly, something like 'datacopy' between heterogeneous databases (in my > case Netezza to SQL server) would eliminate a lot of mucking about on the > intermediate box. Any chance of something like that? > A tool that would use just ODBC would do. I don't know any such tool. Datacopy is written to transfer sql server to sql server only. And use dblib which is bound to sql server. > Any other suggestions? > > > Cheers > Roger Hill > Frediano From rhill at hillconsult.com Sun Oct 12 04:38:45 2014 From: rhill at hillconsult.com (Roger Hill) Date: Sun, 12 Oct 2014 09:38:45 +0100 Subject: [freetds] Netezza and named pipes In-Reply-To: References: <4a70daad12ba05d21702c65d3424cc3f.squirrel@hillconsult.cricalix.net> Message-ID: <1f69954be039c25aea5c358b24c2e377.squirrel@hillconsult.cricalix.net> Frediano: Thanks for the notes. I will investigate the SQL server connectors. I'm not a SQL server expert! My solution is working ok...just trying to improve it is all. Many thanks. Roger On Sun, October 12, 2014 09:27, Frediano Ziglio wrote: > Il 04/ott/2014 10:11 "Roger Hill" ha scritto: > >> >> >> My first post to the list: please be gentle! >> >> >> I need to copy a large volume of data every day from a Netezza database to >> several other SQL server databases. >> >> I have a solution that works: I use isql to extract to a named pipe, pass >> > the >> output through a couple of 'cut' steps to remove unwanted bits and > pieces, and >> then land the data on disk into a temporary file. I then use freebcp to > load >> it to the SQL server database. But it's convoluted, and I'm looking for a >> better way. >> > > Well do you have any connector available? I don't know Netezza at all. > Basically assuming there is a connector for Netezza for sql server you > setup a new connection to Netezza in sql server that you can transfer data from > Netezza to sql server using a sort of INSERT INTO TABLE SELECT ... > FROM NETEZZA TABLE. > > >> Two questions come out of this: Firstly I know that freebcp did not >> > support >> input from named pipes as recently as 2011; is there support for named > pipes >> now? >> > > Head code does. But if I understood you are converting everything to > characters and then back to database. Pay lot of attention to separators or you > risk to corrupt data! > >> And secondly, something like 'datacopy' between heterogeneous databases >> > (in my > >> case Netezza to SQL server) would eliminate a lot of mucking about on the >> intermediate box. Any chance of something like that? >> > > A tool that would use just ODBC would do. I don't know any such tool. > Datacopy is written to transfer sql server to sql server only. And use > dblib which is bound to sql server. > >> Any other suggestions? >> >> >> >> Cheers >> Roger Hill >> >> > > Frediano > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > > **************************************** Roger Hill **************************************** From ganoopluslinux at gmail.com Sun Oct 12 04:47:33 2014 From: ganoopluslinux at gmail.com (James Fisher) Date: Sun, 12 Oct 2014 03:47:33 -0500 Subject: [freetds] SQL Anywhere 11 and FreeTDS In-Reply-To: References: Message-ID: Frediano, I have attached two tcp dumps of a successful disconnect; one using sqsh, and another using php's sybase_ct. Both were compiled with the native CT libraries. Please let me know if you need anything else. I hope this helps, and thanks again. On Sun, Oct 12, 2014 at 3:26 AM, James Fisher wrote: > I have just compiled sqsh and the sybase_ct php module against the native > ct library, I assume that would be a better tcp dump to work with? I think > the logout would be very helpful, it'd be wonderful to use freetds rather > than the native library! I really appreciate your help. > > > On Sunday, October 12, 2014, Frediano Ziglio wrote: > >> Yes, this is correct. However the protocol the client is using is quite >> different from the one we actually use. I can try adding a logout stream >> if >> this helps. >> Il 07/ott/2014 22:40 "James Fisher" ha >> scritto: >> >> > Frediano, >> > >> > Thank you so much for your response, I have attached here a new tcpdump. >> > Sorry I am not too familiar with that tool. Please let me know if this >> is >> > correct. >> > >> > I am running tcpdump on the client using this: >> > >> > tcpdump -i eth0 -w native.log -s0 host {client IP} >> > >> > Thanks again. >> > >> > On Tue, Oct 7, 2014 at 3:08 PM, Frediano Ziglio >> > wrote: >> > >> > > Looks not correct. The capture contains a single UDP packet. Sql >> > > server use TCP connections. >> > > >> > > Frediano >> > > >> > > >> > > 2014-10-07 19:18 GMT+01:00 James Fisher : >> > > > While reviewing the old thread I found that someone(Mr. James >> Lowden) >> > > > requested a tcpdump in order to capture a 'proper' disconnect but I >> > > didn't >> > > > see that the OP followed up. >> > > > http://lists.ibiblio.org/pipermail/freetds/2009q4/025362.html >> > > > >> > > > I have attached mine here. If this isn't the right information, >> please >> > > let >> > > > me know. Thanks again to anyone willing to help. >> > > > >> > > > On Mon, Oct 6, 2014 at 1:57 PM, James Fisher < >> ganoopluslinux at gmail.com >> > > >> > > > wrote: >> > > > >> > > >> OP: http://thread.gmane.org/gmane.comp.db.tds.freetds/11976 >> > > >> >> > > >> Hello, I am new to mailing lists, so sorry if it's bad that I am >> > > reviving >> > > >> this old thread - but I am having the same issue as this guy from >> > > several >> > > >> years back... >> > > >> >> > > >> I setup a few debian and ubuntu servers to talk to our >> database(Sybase >> > > SQL >> > > >> Anywhere 11) using sqsh and adodb(php) with FreeTDS. Once >> configured >> > to >> > > >> use TDS v5.0, both sqsh and adodb can connect and execute queries >> on >> > the >> > > >> database. However, when I began looking at the log on the server I >> > found >> > > >> that each time either application disconnects, it shows a message >> > like: >> > > >> >> > > >> >Connection terminated abnormally >> > > >> >Disconnected TCPIP client's AppInfo: HOST=debian-vm;PID=2605 >> > > >> >> > > >> The database doesn't *seem* affected - as far as I can tell... >> > > >> >> > > >> The statements return the rows or insert the data. >> > > >> >> > > >> I see no performance hit, etc... but it is concerning none the >> less. >> > > >> >> > > >> I have also tested with SQL Anywhere 10, 11, 12, & 16, all have the >> > same >> > > >> issue(and so does their development versions). I have tried >> tsql/isql >> > > and >> > > >> both produce the same error. >> > > >> Sybase's dbisql/sa_php extension/native odbc client all work >> without >> > the >> > > >> error. >> > > >> >> > > >> I have a FreeTDS log here: >> > > >> >> > > >> https://gist.github.com/anonymous/b9146103bb16d4eb94c9 >> > > >> >> > > >> I will be happy to do any other dump that might be helpful, >> > > >> including setting up an test environment on digitalocean >> > > >> for anyone who'd like to take a look. >> > > >> >> > > >> Thanks to anyone willing to help in any way. >> > > >> >> > > > >> > > > _______________________________________________ >> > > > FreeTDS mailing list >> > > > FreeTDS at lists.ibiblio.org >> > > > http://lists.ibiblio.org/mailman/listinfo/freetds >> > > > >> > > _______________________________________________ >> > > FreeTDS mailing list >> > > FreeTDS at lists.ibiblio.org >> > > http://lists.ibiblio.org/mailman/listinfo/freetds >> > > >> > >> > _______________________________________________ >> > FreeTDS mailing list >> > FreeTDS at lists.ibiblio.org >> > http://lists.ibiblio.org/mailman/listinfo/freetds >> > >> > >> _______________________________________________ >> FreeTDS mailing list >> FreeTDS at lists.ibiblio.org >> http://lists.ibiblio.org/mailman/listinfo/freetds >> > -------------- next part -------------- A non-text attachment was scrubbed... Name: sybase_ct.tcpdump Type: application/octet-stream Size: 2853 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: sqsh-native.tcpdump Type: application/octet-stream Size: 7031 bytes Desc: not available URL: From rainkin1993 at gmail.com Thu Oct 23 10:14:14 2014 From: rainkin1993 at gmail.com (=?UTF-8?B?5ram6Z2S5p2o?=) Date: Thu, 23 Oct 2014 22:14:14 +0800 Subject: [freetds] freetds have some ssl security problems Message-ID: Hi guys, Recently, our group are trying to find ssl security problems by static anlysis. Now we have find some problems in freetds-bin and report this bugs to the launchpad, but we haven't receive any responses. Could you please take a look at this bug: https://bugs.launchpad.net/ubuntu/+source/freetds/+bug/1376592 Thanks, Rainkin From freddy77 at gmail.com Thu Oct 23 11:06:39 2014 From: freddy77 at gmail.com (Frediano Ziglio) Date: Thu, 23 Oct 2014 16:06:39 +0100 Subject: [freetds] freetds have some ssl security problems In-Reply-To: References: Message-ID: 2014-10-23 15:14 GMT+01:00 ??? : > Hi guys, > Recently, our group are trying to find ssl security problems by static > anlysis. Now we have find some problems in freetds-bin and report this bugs > to the launchpad, but we haven't receive any responses. > Could you please take a look at this bug: > https://bugs.launchpad.net/ubuntu/+source/freetds/+bug/1376592 > Thanks, > Rainkin Thank you, I think you are right. However there is mainly a problem in the default configuration. By default when you install a server it use quite silently a self-signed. This means mainly that a man in the middle is just behind the door. Frediano From freddy77 at gmail.com Thu Oct 23 12:12:07 2014 From: freddy77 at gmail.com (Frediano Ziglio) Date: Thu, 23 Oct 2014 17:12:07 +0100 Subject: [freetds] freetds have some ssl security problems In-Reply-To: References: Message-ID: 2014-10-23 16:06 GMT+01:00 Frediano Ziglio : > 2014-10-23 15:14 GMT+01:00 ??? : >> Hi guys, >> Recently, our group are trying to find ssl security problems by static >> anlysis. Now we have find some problems in freetds-bin and report this bugs >> to the launchpad, but we haven't receive any responses. >> Could you please take a look at this bug: >> https://bugs.launchpad.net/ubuntu/+source/freetds/+bug/1376592 >> Thanks, >> Rainkin > > > Thank you, > I think you are right. > > However there is mainly a problem in the default configuration. By > default when you install a server it use quite silently a self-signed. > This means mainly that a man in the middle is just behind the door. > > Frediano Yes, there should be some option. Specifically we should test everything having some options to disable some checks. Also location for root certificate should be required. Frediano From heboyuan at zju.edu.cn Fri Oct 24 07:07:32 2014 From: heboyuan at zju.edu.cn (=?utf-8?B?5L2V5Y2a6L+c?=) Date: Fri, 24 Oct 2014 19:07:32 +0800 Subject: [freetds] freetds have some ssl security problems In-Reply-To: References: Message-ID: IMO, for self-signed certificate, it's still necessary to do verification. For example, the client certificate in MS SQLserver is signed by a root certificate in server. User can also configure there own root certificate for SQLserver in order to secure the SSL connection. So I agree that there should be locations of root certificate in the clients and also there should at least an option for certificate verification, otherwise SSL is pointless.? Thanks. Roca ------------------ Original ------------------ From: "Frediano Ziglio";; Date: Fri, Oct 24, 2014 00:12 AM To: "FreeTDS Development Group"; Subject: Re: [freetds] freetds have some ssl security problems 2014-10-23 16:06 GMT+01:00 Frediano Ziglio : > 2014-10-23 15:14 GMT+01:00 ??? : >> Hi guys, >> Recently, our group are trying to find ssl security problems by static >> anlysis. Now we have find some problems in freetds-bin and report this bugs >> to the launchpad, but we haven't receive any responses. >> Could you please take a look at this bug: >> https://bugs.launchpad.net/ubuntu/+source/freetds/+bug/1376592 >> Thanks, >> Rainkin > > > Thank you, > I think you are right. > > However there is mainly a problem in the default configuration. By > default when you install a server it use quite silently a self-signed. > This means mainly that a man in the middle is just behind the door. > > Frediano Yes, there should be some option. Specifically we should test everything having some options to disable some checks. Also location for root certificate should be required. Frediano _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds From SATurk at MissouriState.edu Mon Oct 27 12:48:23 2014 From: SATurk at MissouriState.edu (Turk, Scott A) Date: Mon, 27 Oct 2014 11:48:23 -0500 Subject: [freetds] Output from SQL Server database Message-ID: Hi, we're having a problem with the output we're getting across an Oracle link to a SQL Server database. The column output appears to have inserted nulls in between each character. The data type of the column is nvarchar. Our application is SQL Developer. Any ideas on what may be going wrong? We also use FreeTDS to link to other SQL Server databases and have not seen this happen previously. Thanks! Scott Turk Database Analyst, DBA Computer Services - MIS Missouri State University SATurk at missouristate.edu (417) 836-6195 From freddy77 at gmail.com Mon Oct 27 13:12:31 2014 From: freddy77 at gmail.com (Frediano Ziglio) Date: Mon, 27 Oct 2014 17:12:31 +0000 Subject: [freetds] Output from SQL Server database In-Reply-To: References: Message-ID: 2014-10-27 16:48 GMT+00:00 Turk, Scott A : > Hi, we're having a problem with the output we're getting across an Oracle > link to a SQL Server database. The column output appears to have inserted > nulls in between each character. The data type of the column is nvarchar. > Our application is SQL Developer. > > Any ideas on what may be going wrong? We also use FreeTDS to link to > other SQL Server databases and have not seen this happen previously. > > Thanks! > > Scott Turk > Database Analyst, DBA > Computer Services - MIS > Missouri State University > SATurk at missouristate.edu > (417) 836-6195 > > Hi, any more details like FreeTDS version, possible dump, how did you upload data, tables definition. Frediano From SATurk at MissouriState.edu Mon Oct 27 14:44:52 2014 From: SATurk at MissouriState.edu (Turk, Scott A) Date: Mon, 27 Oct 2014 13:44:52 -0500 Subject: [freetds] Output from SQL Server database In-Reply-To: References: Message-ID: FreeTDS version is 7.2. The data type of the column in question is nvarchar on the SQL server side - would the rest of the table description help? We are accessing the data via an Oracle link in SQL Developer. The data is produced by user input. How can I produce a dump file? Thanks! SCOTT TURK DATABASE ANALYST, DBA COMPUTER SERVICES - MIS MISSOURI STATE UNIVERSITY SATURK at MISSOURISTATE.EDU (417) 836-6195 -----Original Message----- From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Frediano Ziglio Sent: Monday, October 27, 2014 12:13 PM To: FreeTDS Development Group Subject: Re: [freetds] Output from SQL Server database 2014-10-27 16:48 GMT+00:00 Turk, Scott A : > Hi, we're having a problem with the output we're getting across an > Oracle link to a SQL Server database. The column output appears to > have inserted nulls in between each character. The data type of the column is nvarchar. > Our application is SQL Developer. > > Any ideas on what may be going wrong? We also use FreeTDS to link to > other SQL Server databases and have not seen this happen previously. > > Thanks! > > Scott Turk > Database Analyst, DBA > Computer Services - MIS > Missouri State University > SATurk at missouristate.edu > (417) 836-6195 > > Hi, any more details like FreeTDS version, possible dump, how did you upload data, tables definition. Frediano _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds From m.grau at kcc.state.ks.us Mon Oct 27 15:43:10 2014 From: m.grau at kcc.state.ks.us (Mike Grau) Date: Mon, 27 Oct 2014 14:43:10 -0500 Subject: [freetds] Output from SQL Server database In-Reply-To: References: Message-ID: <544EA04E.8010606@kcc.state.ks.us> Someone told me this about this same setup: "They don't know what they have on their hands. Nvarchar & Oracle & "Sql server. Not a good combo. Pity them because it's the character "conversion. It'll be Thanksgiving before they solve this one." More than that I do not know. On 10/27/2014 01:44 PM, Turk, Scott A wrote: > FreeTDS version is 7.2. The data type of the column in question is nvarchar on the SQL server side - would the rest of the table description help? We are accessing the data via an Oracle link in SQL Developer. The data is produced by user input. > > How can I produce a dump file? > > Thanks! > > SCOTT TURK > DATABASE ANALYST, DBA > COMPUTER SERVICES - MIS > MISSOURI STATE UNIVERSITY > SATURK at MISSOURISTATE.EDU > (417) 836-6195 > > > -----Original Message----- > From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Frediano Ziglio > Sent: Monday, October 27, 2014 12:13 PM > To: FreeTDS Development Group > Subject: Re: [freetds] Output from SQL Server database > > 2014-10-27 16:48 GMT+00:00 Turk, Scott A : > >> Hi, we're having a problem with the output we're getting across an >> Oracle link to a SQL Server database. The column output appears to >> have inserted nulls in between each character. The data type of the column is nvarchar. >> Our application is SQL Developer. >> >> Any ideas on what may be going wrong? We also use FreeTDS to link to >> other SQL Server databases and have not seen this happen previously. >> >> Thanks! >> >> Scott Turk >> Database Analyst, DBA >> Computer Services - MIS >> Missouri State University >> SATurk at missouristate.edu >> (417) 836-6195 >> >> > Hi, > any more details like FreeTDS version, possible dump, how did you upload data, tables definition. > > Frediano > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > From freddy77 at gmail.com Tue Oct 28 05:25:44 2014 From: freddy77 at gmail.com (Frediano Ziglio) Date: Tue, 28 Oct 2014 09:25:44 +0000 Subject: [freetds] Output from SQL Server database In-Reply-To: <544EA04E.8010606@kcc.state.ks.us> References: <544EA04E.8010606@kcc.state.ks.us> Message-ID: Mike, mostly of the problems with characters conversion came from the fact that mostly of the people do not understand them and then when something odd happen they just start complaining. Mostly of them put some binary data to the database and expect they come out the same way! Technically speaking there are also some problems with some API/Protocols. For instance before SQL 2000 protocol does not support any details on columns so you should consider server settings. I never find any way to discover character encoding in ODBC. Frediano Frediano 2014-10-27 19:43 GMT+00:00 Mike Grau : > Someone told me this about this same setup: > > "They don't know what they have on their hands. Nvarchar & Oracle & > "Sql server. Not a good combo. Pity them because it's the character > "conversion. It'll be Thanksgiving before they solve this one." > > More than that I do not know. > > > On 10/27/2014 01:44 PM, Turk, Scott A wrote: > > FreeTDS version is 7.2. The data type of the column in question is > nvarchar on the SQL server side - would the rest of the table description > help? We are accessing the data via an Oracle link in SQL Developer. The > data is produced by user input. > > > > How can I produce a dump file? > > > > Thanks! > > > > SCOTT TURK > > DATABASE ANALYST, DBA > > COMPUTER SERVICES - MIS > > MISSOURI STATE UNIVERSITY > > SATURK at MISSOURISTATE.EDU > > (417) 836-6195 > > > > > > -----Original Message----- > > From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of > Frediano Ziglio > > Sent: Monday, October 27, 2014 12:13 PM > > To: FreeTDS Development Group > > Subject: Re: [freetds] Output from SQL Server database > > > > 2014-10-27 16:48 GMT+00:00 Turk, Scott A : > > > >> Hi, we're having a problem with the output we're getting across an > >> Oracle link to a SQL Server database. The column output appears to > >> have inserted nulls in between each character. The data type of the > column is nvarchar. > >> Our application is SQL Developer. > >> > >> Any ideas on what may be going wrong? We also use FreeTDS to link to > >> other SQL Server databases and have not seen this happen previously. > >> > >> Thanks! > >> > >> Scott Turk > >> Database Analyst, DBA > >> Computer Services - MIS > >> Missouri State University > >> SATurk at missouristate.edu > >> (417) 836-6195 > >> > >> > > Hi, > > any more details like FreeTDS version, possible dump, how did you > upload data, tables definition. > > > > Frediano > > _______________________________________________ > > FreeTDS mailing list > > FreeTDS at lists.ibiblio.org > > http://lists.ibiblio.org/mailman/listinfo/freetds > > _______________________________________________ > > FreeTDS mailing list > > FreeTDS at lists.ibiblio.org > > http://lists.ibiblio.org/mailman/listinfo/freetds > > > > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > From freddy77 at gmail.com Tue Oct 28 05:30:52 2014 From: freddy77 at gmail.com (Frediano Ziglio) Date: Tue, 28 Oct 2014 09:30:52 +0000 Subject: [freetds] Output from SQL Server database In-Reply-To: References: Message-ID: Hi, for the dump in this case the better way is to enable ODBC trace, refer to DM documentation. I understand that data came from user input but how does they reach the database? For instance web <-> PHP <-> PHP library <-> ODBC <-> Oracle <-> SQL connector <-> FreeTDS settings YYY <-> MSSQL version XXX or Windows GUI <-> MS OLE driver <-> MSSQL. How is FreeTDS configured? How is the connector configured? Which kind of characters are you trying to insert? Frediano Frediano 2014-10-27 18:44 GMT+00:00 Turk, Scott A : > FreeTDS version is 7.2. The data type of the column in question is > nvarchar on the SQL server side - would the rest of the table description > help? We are accessing the data via an Oracle link in SQL Developer. The > data is produced by user input. > > How can I produce a dump file? > > Thanks! > > SCOTT TURK > DATABASE ANALYST, DBA > COMPUTER SERVICES - MIS > MISSOURI STATE UNIVERSITY > SATURK at MISSOURISTATE.EDU > (417) 836-6195 > > > -----Original Message----- > From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of > Frediano Ziglio > Sent: Monday, October 27, 2014 12:13 PM > To: FreeTDS Development Group > Subject: Re: [freetds] Output from SQL Server database > > 2014-10-27 16:48 GMT+00:00 Turk, Scott A : > > > Hi, we're having a problem with the output we're getting across an > > Oracle link to a SQL Server database. The column output appears to > > have inserted nulls in between each character. The data type of the > column is nvarchar. > > Our application is SQL Developer. > > > > Any ideas on what may be going wrong? We also use FreeTDS to link to > > other SQL Server databases and have not seen this happen previously. > > > > Thanks! > > > > Scott Turk > > Database Analyst, DBA > > Computer Services - MIS > > Missouri State University > > SATurk at missouristate.edu > > (417) 836-6195 > > > > > Hi, > any more details like FreeTDS version, possible dump, how did you upload > data, tables definition. > > Frediano > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > From freddy77 at gmail.com Tue Oct 28 16:03:57 2014 From: freddy77 at gmail.com (Frediano Ziglio) Date: Tue, 28 Oct 2014 20:03:57 +0000 Subject: [freetds] Output from SQL Server database In-Reply-To: References: Message-ID: One possible solution if database is using nvarchar would be to enable odbc wide support. This way ODBC should present nvarchar as wide encoding ( either 2 bytes or 4 bytes characters depending on system settings). Frediano Frediano 2014-10-27 18:44 GMT+00:00 Turk, Scott A : > FreeTDS version is 7.2. The data type of the column in question is > nvarchar on the SQL server side - would the rest of the table description > help? We are accessing the data via an Oracle link in SQL Developer. The > data is produced by user input. > > How can I produce a dump file? > > Thanks! > > SCOTT TURK > DATABASE ANALYST, DBA > COMPUTER SERVICES - MIS > MISSOURI STATE UNIVERSITY > SATURK at MISSOURISTATE.EDU > (417) 836-6195 > > > -----Original Message----- > From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of > Frediano Ziglio > Sent: Monday, October 27, 2014 12:13 PM > To: FreeTDS Development Group > Subject: Re: [freetds] Output from SQL Server database > > 2014-10-27 16:48 GMT+00:00 Turk, Scott A : > > > Hi, we're having a problem with the output we're getting across an > > Oracle link to a SQL Server database. The column output appears to > > have inserted nulls in between each character. The data type of the > column is nvarchar. > > Our application is SQL Developer. > > > > Any ideas on what may be going wrong? We also use FreeTDS to link to > > other SQL Server databases and have not seen this happen previously. > > > > Thanks! > > > > Scott Turk > > Database Analyst, DBA > > Computer Services - MIS > > Missouri State University > > SATurk at missouristate.edu > > (417) 836-6195 > > > > > Hi, > any more details like FreeTDS version, possible dump, how did you upload > data, tables definition. > > Frediano > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > From freddy77 at gmail.com Wed Oct 29 12:53:39 2014 From: freddy77 at gmail.com (Frediano Ziglio) Date: Wed, 29 Oct 2014 16:53:39 +0000 Subject: [freetds] freetds have some ssl security problems In-Reply-To: References: Message-ID: Do you have any reference code for GnuTLS and/or OpenSSL ? Frediano Frediano 2014-10-24 12:07 GMT+01:00 ??? : > IMO, for self-signed certificate, it's still necessary to do verification. > For example, the client certificate in MS SQLserver is signed by a root > certificate in server. User can also configure there own root certificate > for SQLserver in order to secure the SSL connection. So I agree that there > should be locations of root certificate in the clients and also there > should at least an option for certificate verification, otherwise SSL is > pointless.? > > > Thanks. > Roca > ------------------ Original ------------------ > From: "Frediano Ziglio";; > Date: Fri, Oct 24, 2014 00:12 AM > To: "FreeTDS Development Group"; > > Subject: Re: [freetds] freetds have some ssl security problems > > > > 2014-10-23 16:06 GMT+01:00 Frediano Ziglio : > > 2014-10-23 15:14 GMT+01:00 ??? : > >> Hi guys, > >> Recently, our group are trying to find ssl security problems by static > >> anlysis. Now we have find some problems in freetds-bin and report this > bugs > >> to the launchpad, but we haven't receive any responses. > >> Could you please take a look at this bug: > >> https://bugs.launchpad.net/ubuntu/+source/freetds/+bug/1376592 > >> Thanks, > >> Rainkin > > > > > > Thank you, > > I think you are right. > > > > However there is mainly a problem in the default configuration. By > > default when you install a server it use quite silently a self-signed. > > This means mainly that a man in the middle is just behind the door. > > > > Frediano > > Yes, there should be some option. Specifically we should test > everything having some options to disable some checks. Also location > for root certificate should be required. > > Frediano > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > From tolga.ceylan at gmail.com Thu Oct 30 00:10:07 2014 From: tolga.ceylan at gmail.com (Tolga Ceylan) Date: Wed, 29 Oct 2014 21:10:07 -0700 Subject: [freetds] timeout handling and server msg callback Message-ID: Hi All, Recently, I've stumbled on a potential issue with the timeout handling in ct_lib. Given these two cases of SQL executing; DECLARE @counter int WHILE (@counter < 99999999) BEGIN PRINT @counter SET @counter = @counter + 1 END versus; DECLARE @counter int WHILE (@counter < 99999999) BEGIN SET @counter = @counter + 1 END (only difference is print or no-print basically) seems to affect timeout handling since this trips the ::select() (aka tds_select) based query timeout. In other words, continuously feeding such server messages back to the client bypasses the query timeout. The issue is tricky because there has to be enough 'print' executions to actually trigger this. (Probably due to Nagle or other buffering.) Has anybody seen this before? Any work around for it(*) ? (*) the fix probably is to consider beginning/end of the actual queries as opposed to blocking on select with query timeout. I'm using 0.82 on linux centos 6.5 although I couldn't see changes related to this in 0.91. Cheers, Tolga From freddy77 at gmail.com Thu Oct 30 06:02:50 2014 From: freddy77 at gmail.com (Frediano Ziglio) Date: Thu, 30 Oct 2014 10:02:50 +0000 Subject: [freetds] timeout handling and server msg callback In-Reply-To: References: Message-ID: 2014-10-30 4:10 GMT+00:00 Tolga Ceylan : > Hi All, > > Recently, I've stumbled on a potential issue with the timeout handling > in ct_lib. > > Given these two cases of SQL executing; > > DECLARE @counter int > WHILE (@counter < 99999999) > BEGIN > PRINT @counter > SET @counter = @counter + 1 > END > > versus; > > DECLARE @counter int > WHILE (@counter < 99999999) > BEGIN > SET @counter = @counter + 1 > END > > (only difference is print or no-print basically) > > seems to affect timeout handling since this trips the ::select() (aka > tds_select) based query timeout. > > In other words, continuously feeding such server messages back to the > client bypasses > the query timeout. The issue is tricky because there has to be enough > 'print' executions > to actually trigger this. (Probably due to Nagle or other buffering.) > > Has anybody seen this before? Any work around for it(*) ? > > (*) the fix probably is to consider beginning/end of the actual > queries as opposed to blocking on select > with query timeout. > > I'm using 0.82 on linux centos 6.5 although I couldn't see changes > related to this in 0.91. > > Cheers, > Tolga > Hi, It's not a bug, it's a feature :) Really, this is the intention. Also considering that you should handle results (print IS a result) the library should return so your timeout should be managed by application. Frediano From tolga.ceylan at gmail.com Thu Oct 30 13:56:47 2014 From: tolga.ceylan at gmail.com (Tolga Ceylan) Date: Thu, 30 Oct 2014 10:56:47 -0700 Subject: [freetds] timeout handling and server msg callback In-Reply-To: References: Message-ID: I mostly agree with this. I think app level timeouts is easy to add since callbacks are firing and the app code can keep track of the overall time there. However, 'query_timeout' is misleading. This really is a 'socket_activity_timeout' since it's based on arriving bits of data from the socket. Let say 'query_timeout' is 300 secs. If the TDS packet can be assembled after 5 calls to socket read, then this could get blown up to 5*300 secs. This means even if we rename 'query_timeout', it's not really meaningful. I also see that the TDS header (8 bytes) is expected to arrive in one read. If the header arrives in more than one read, then the connection gets closed. This is a bug. TCP code needs to handle tiny read cases even if this is rare. I think 'query_timeout' can be renamed to 'tds packet timeout.' Instead of tds_select(), the higher level goodread() function can keep track of this timer and decide if there is a packet timeout or not. I can put together a patch if you like. Cheers, Tolga On Thu, Oct 30, 2014 at 3:02 AM, Frediano Ziglio wrote: > 2014-10-30 4:10 GMT+00:00 Tolga Ceylan : > >> Hi All, >> >> Recently, I've stumbled on a potential issue with the timeout handling >> in ct_lib. >> >> Given these two cases of SQL executing; >> >> DECLARE @counter int >> WHILE (@counter < 99999999) >> BEGIN >> PRINT @counter >> SET @counter = @counter + 1 >> END >> >> versus; >> >> DECLARE @counter int >> WHILE (@counter < 99999999) >> BEGIN >> SET @counter = @counter + 1 >> END >> >> (only difference is print or no-print basically) >> >> seems to affect timeout handling since this trips the ::select() (aka >> tds_select) based query timeout. >> >> In other words, continuously feeding such server messages back to the >> client bypasses >> the query timeout. The issue is tricky because there has to be enough >> 'print' executions >> to actually trigger this. (Probably due to Nagle or other buffering.) >> >> Has anybody seen this before? Any work around for it(*) ? >> >> (*) the fix probably is to consider beginning/end of the actual >> queries as opposed to blocking on select >> with query timeout. >> >> I'm using 0.82 on linux centos 6.5 although I couldn't see changes >> related to this in 0.91. >> >> Cheers, >> Tolga >> > > > Hi, > It's not a bug, it's a feature :) > > Really, this is the intention. Also considering that you should handle > results (print IS a result) the library should return so your timeout > should be managed by application. > > Frediano > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds From freddy77 at gmail.com Thu Oct 30 15:01:54 2014 From: freddy77 at gmail.com (Frediano Ziglio) Date: Thu, 30 Oct 2014 19:01:54 +0000 Subject: [freetds] timeout handling and server msg callback In-Reply-To: References: Message-ID: 2014-10-30 17:56 GMT+00:00 Tolga Ceylan : > I mostly agree with this. I think app level timeouts is easy to add > since callbacks are firing > and the app code can keep track of the overall time there. > > However, 'query_timeout' is misleading. This really is a > 'socket_activity_timeout' > since it's based on arriving bits of data from the socket. > > Let say 'query_timeout' is 300 secs. If the TDS packet can be > assembled after 5 calls to socket > read, then this could get blown up to 5*300 secs. This means even if > we rename 'query_timeout', it's not > really meaningful. > > yes, probably query_timeout is quite misleading. > I also see that the TDS header (8 bytes) is expected to arrive in one > read. If the header > arrives in more than one read, then the connection gets closed. This > is a bug. TCP code > needs to handle tiny read cases even if this is rare. > > I don't think so. The only case tds_goodread returns < 8 is when user requested to close connection or on a socket error. Never for less bytes readed. And if crypted all packets are crypted so is impossible it does not return at least 8 bytes. > I think 'query_timeout' can be renamed to 'tds packet timeout.' > Instead of tds_select(), the higher > level goodread() function can keep track of this timer and decide if > there is a packet timeout or not. > > I can put together a patch if you like. > > Cheers, > Tolga > > Would be useful. I didn't actually understand what you want to achieve however. A kind of full packet timeout? Server tends to send packet together so you would catch some network delay or problem. If you remove the timeout from tds_select how can it return if server does not send data? Frediano > On Thu, Oct 30, 2014 at 3:02 AM, Frediano Ziglio > wrote: > > 2014-10-30 4:10 GMT+00:00 Tolga Ceylan : > > > >> Hi All, > >> > >> Recently, I've stumbled on a potential issue with the timeout handling > >> in ct_lib. > >> > >> Given these two cases of SQL executing; > >> > >> DECLARE @counter int > >> WHILE (@counter < 99999999) > >> BEGIN > >> PRINT @counter > >> SET @counter = @counter + 1 > >> END > >> > >> versus; > >> > >> DECLARE @counter int > >> WHILE (@counter < 99999999) > >> BEGIN > >> SET @counter = @counter + 1 > >> END > >> > >> (only difference is print or no-print basically) > >> > >> seems to affect timeout handling since this trips the ::select() (aka > >> tds_select) based query timeout. > >> > >> In other words, continuously feeding such server messages back to the > >> client bypasses > >> the query timeout. The issue is tricky because there has to be enough > >> 'print' executions > >> to actually trigger this. (Probably due to Nagle or other buffering.) > >> > >> Has anybody seen this before? Any work around for it(*) ? > >> > >> (*) the fix probably is to consider beginning/end of the actual > >> queries as opposed to blocking on select > >> with query timeout. > >> > >> I'm using 0.82 on linux centos 6.5 although I couldn't see changes > >> related to this in 0.91. > >> > >> Cheers, > >> Tolga > >> > > > > > > Hi, > > It's not a bug, it's a feature :) > > > > Really, this is the intention. Also considering that you should handle > > results (print IS a result) the library should return so your timeout > > should be managed by application. > > > > Frediano > > _______________________________________________ > > FreeTDS mailing list > > FreeTDS at lists.ibiblio.org > > http://lists.ibiblio.org/mailman/listinfo/freetds > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > From tolga.ceylan at gmail.com Thu Oct 30 15:23:54 2014 From: tolga.ceylan at gmail.com (Tolga Ceylan) Date: Thu, 30 Oct 2014 12:23:54 -0700 Subject: [freetds] timeout handling and server msg callback In-Reply-To: References: Message-ID: In other words, (except maybe in encrypted case), a TCP read can return 1 byte. The underlying call is recv(). There's no guarantee that arrivals will always be >= 8 bytes or whole packets. It's TCP which is a stream of data where application (freetds) is responsible with assembling application level data. These tiny reads could happen if the client slows down and adjusts its receive window size. For the 'tds packet timeout', yes, I was basically suggesting to move the timeout logic to higher level from tds_goodread() to tds_read_packet(). Full packet timeout basically... On Thu, Oct 30, 2014 at 12:01 PM, Frediano Ziglio wrote: > 2014-10-30 17:56 GMT+00:00 Tolga Ceylan : > >> I mostly agree with this. I think app level timeouts is easy to add >> since callbacks are firing >> and the app code can keep track of the overall time there. >> >> However, 'query_timeout' is misleading. This really is a >> 'socket_activity_timeout' >> since it's based on arriving bits of data from the socket. >> >> Let say 'query_timeout' is 300 secs. If the TDS packet can be >> assembled after 5 calls to socket >> read, then this could get blown up to 5*300 secs. This means even if >> we rename 'query_timeout', it's not >> really meaningful. >> >> > yes, probably query_timeout is quite misleading. > > >> I also see that the TDS header (8 bytes) is expected to arrive in one >> read. If the header >> arrives in more than one read, then the connection gets closed. This >> is a bug. TCP code >> needs to handle tiny read cases even if this is rare. >> >> > I don't think so. The only case tds_goodread returns < 8 is when user > requested to close connection or on a socket error. Never for less bytes > readed. And if crypted all packets are crypted so is impossible it does not > return at least 8 bytes. > > >> I think 'query_timeout' can be renamed to 'tds packet timeout.' >> Instead of tds_select(), the higher >> level goodread() function can keep track of this timer and decide if >> there is a packet timeout or not. >> >> I can put together a patch if you like. >> >> Cheers, >> Tolga >> >> > Would be useful. I didn't actually understand what you want to achieve > however. A kind of full packet timeout? Server tends to send packet > together so you would catch some network delay or problem. If you remove > the timeout from tds_select how can it return if server does not send data? > > Frediano > > >> On Thu, Oct 30, 2014 at 3:02 AM, Frediano Ziglio >> wrote: >> > 2014-10-30 4:10 GMT+00:00 Tolga Ceylan : >> > >> >> Hi All, >> >> >> >> Recently, I've stumbled on a potential issue with the timeout handling >> >> in ct_lib. >> >> >> >> Given these two cases of SQL executing; >> >> >> >> DECLARE @counter int >> >> WHILE (@counter < 99999999) >> >> BEGIN >> >> PRINT @counter >> >> SET @counter = @counter + 1 >> >> END >> >> >> >> versus; >> >> >> >> DECLARE @counter int >> >> WHILE (@counter < 99999999) >> >> BEGIN >> >> SET @counter = @counter + 1 >> >> END >> >> >> >> (only difference is print or no-print basically) >> >> >> >> seems to affect timeout handling since this trips the ::select() (aka >> >> tds_select) based query timeout. >> >> >> >> In other words, continuously feeding such server messages back to the >> >> client bypasses >> >> the query timeout. The issue is tricky because there has to be enough >> >> 'print' executions >> >> to actually trigger this. (Probably due to Nagle or other buffering.) >> >> >> >> Has anybody seen this before? Any work around for it(*) ? >> >> >> >> (*) the fix probably is to consider beginning/end of the actual >> >> queries as opposed to blocking on select >> >> with query timeout. >> >> >> >> I'm using 0.82 on linux centos 6.5 although I couldn't see changes >> >> related to this in 0.91. >> >> >> >> Cheers, >> >> Tolga >> >> >> > >> > >> > Hi, >> > It's not a bug, it's a feature :) >> > >> > Really, this is the intention. Also considering that you should handle >> > results (print IS a result) the library should return so your timeout >> > should be managed by application. >> > >> > Frediano >> > _______________________________________________ >> > FreeTDS mailing list >> > FreeTDS at lists.ibiblio.org >> > http://lists.ibiblio.org/mailman/listinfo/freetds >> _______________________________________________ >> FreeTDS mailing list >> FreeTDS at lists.ibiblio.org >> http://lists.ibiblio.org/mailman/listinfo/freetds >> > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds From freddy77 at gmail.com Thu Oct 30 15:39:25 2014 From: freddy77 at gmail.com (Frediano Ziglio) Date: Thu, 30 Oct 2014 19:39:25 +0000 Subject: [freetds] timeout handling and server msg callback In-Reply-To: References: Message-ID: 2014-10-30 19:23 GMT+00:00 Tolga Ceylan : > In other words, (except maybe in encrypted case), a TCP read can > return 1 byte. The underlying > call is recv(). There's no guarantee that arrivals will always be >= 8 > bytes or whole packets. It's TCP which > is a stream of data where application (freetds) is responsible with > assembling application level > data. These tiny reads could happen if the client slows down and > adjusts its receive window size. > > I know... but we don't just call recv, it's wrapped to handle such cases. > For the 'tds packet timeout', yes, I was basically suggesting to move > the timeout logic to higher level from > tds_goodread() to tds_read_packet(). Full packet timeout basically... > > Understood. Still the point remains, you are catching corner cases. We are trying to detect if server is not sending anything. I understood that in some situations packets could get a lot fragmented and every fragment can have different reasons to be delayed so the total timeout can be quite big but we are talking about packets that are mostly 4kb transmitted in network packets which are more than 1kb. Good code anyway is always welcome. Remember to use the master branch. Frediano > On Thu, Oct 30, 2014 at 12:01 PM, Frediano Ziglio > wrote: > > 2014-10-30 17:56 GMT+00:00 Tolga Ceylan : > > > >> I mostly agree with this. I think app level timeouts is easy to add > >> since callbacks are firing > >> and the app code can keep track of the overall time there. > >> > >> However, 'query_timeout' is misleading. This really is a > >> 'socket_activity_timeout' > >> since it's based on arriving bits of data from the socket. > >> > >> Let say 'query_timeout' is 300 secs. If the TDS packet can be > >> assembled after 5 calls to socket > >> read, then this could get blown up to 5*300 secs. This means even if > >> we rename 'query_timeout', it's not > >> really meaningful. > >> > >> > > yes, probably query_timeout is quite misleading. > > > > > >> I also see that the TDS header (8 bytes) is expected to arrive in one > >> read. If the header > >> arrives in more than one read, then the connection gets closed. This > >> is a bug. TCP code > >> needs to handle tiny read cases even if this is rare. > >> > >> > > I don't think so. The only case tds_goodread returns < 8 is when user > > requested to close connection or on a socket error. Never for less bytes > > readed. And if crypted all packets are crypted so is impossible it does > not > > return at least 8 bytes. > > > > > >> I think 'query_timeout' can be renamed to 'tds packet timeout.' > >> Instead of tds_select(), the higher > >> level goodread() function can keep track of this timer and decide if > >> there is a packet timeout or not. > >> > >> I can put together a patch if you like. > >> > >> Cheers, > >> Tolga > >> > >> > > Would be useful. I didn't actually understand what you want to achieve > > however. A kind of full packet timeout? Server tends to send packet > > together so you would catch some network delay or problem. If you remove > > the timeout from tds_select how can it return if server does not send > data? > > > > Frediano > > > > > >> On Thu, Oct 30, 2014 at 3:02 AM, Frediano Ziglio > >> wrote: > >> > 2014-10-30 4:10 GMT+00:00 Tolga Ceylan : > >> > > >> >> Hi All, > >> >> > >> >> Recently, I've stumbled on a potential issue with the timeout > handling > >> >> in ct_lib. > >> >> > >> >> Given these two cases of SQL executing; > >> >> > >> >> DECLARE @counter int > >> >> WHILE (@counter < 99999999) > >> >> BEGIN > >> >> PRINT @counter > >> >> SET @counter = @counter + 1 > >> >> END > >> >> > >> >> versus; > >> >> > >> >> DECLARE @counter int > >> >> WHILE (@counter < 99999999) > >> >> BEGIN > >> >> SET @counter = @counter + 1 > >> >> END > >> >> > >> >> (only difference is print or no-print basically) > >> >> > >> >> seems to affect timeout handling since this trips the ::select() (aka > >> >> tds_select) based query timeout. > >> >> > >> >> In other words, continuously feeding such server messages back to the > >> >> client bypasses > >> >> the query timeout. The issue is tricky because there has to be enough > >> >> 'print' executions > >> >> to actually trigger this. (Probably due to Nagle or other buffering.) > >> >> > >> >> Has anybody seen this before? Any work around for it(*) ? > >> >> > >> >> (*) the fix probably is to consider beginning/end of the actual > >> >> queries as opposed to blocking on select > >> >> with query timeout. > >> >> > >> >> I'm using 0.82 on linux centos 6.5 although I couldn't see changes > >> >> related to this in 0.91. > >> >> > >> >> Cheers, > >> >> Tolga > >> >> > >> > > >> > > >> > Hi, > >> > It's not a bug, it's a feature :) > >> > > >> > Really, this is the intention. Also considering that you should handle > >> > results (print IS a result) the library should return so your timeout > >> > should be managed by application. > >> > > >> > Frediano > >> > _______________________________________________ > >> > FreeTDS mailing list > >> > FreeTDS at lists.ibiblio.org > >> > http://lists.ibiblio.org/mailman/listinfo/freetds > >> _______________________________________________ > >> FreeTDS mailing list > >> FreeTDS at lists.ibiblio.org > >> http://lists.ibiblio.org/mailman/listinfo/freetds > >> > > _______________________________________________ > > FreeTDS mailing list > > FreeTDS at lists.ibiblio.org > > http://lists.ibiblio.org/mailman/listinfo/freetds > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > From tolga.ceylan at gmail.com Thu Oct 30 15:47:13 2014 From: tolga.ceylan at gmail.com (Tolga Ceylan) Date: Thu, 30 Oct 2014 12:47:13 -0700 Subject: [freetds] timeout handling and server msg callback In-Reply-To: References: Message-ID: It doesn't look wrapped unless I'm looking at the wrong files/code. READSOCKET is defined as recv() or read() depending on arch. It's called from tds_goodread() in tds/net.c. On Thu, Oct 30, 2014 at 12:39 PM, Frediano Ziglio wrote: > 2014-10-30 19:23 GMT+00:00 Tolga Ceylan : > >> In other words, (except maybe in encrypted case), a TCP read can >> return 1 byte. The underlying >> call is recv(). There's no guarantee that arrivals will always be >= 8 >> bytes or whole packets. It's TCP which >> is a stream of data where application (freetds) is responsible with >> assembling application level >> data. These tiny reads could happen if the client slows down and >> adjusts its receive window size. >> >> > I know... but we don't just call recv, it's wrapped to handle such cases. > > >> For the 'tds packet timeout', yes, I was basically suggesting to move >> the timeout logic to higher level from >> tds_goodread() to tds_read_packet(). Full packet timeout basically... >> >> > Understood. Still the point remains, you are catching corner cases. We are > trying to detect if server is not sending anything. I understood that in > some situations packets could get a lot fragmented and every fragment can > have different reasons to be delayed so the total timeout can be quite big > but we are talking about packets that are mostly 4kb transmitted in network > packets which are more than 1kb. > > Good code anyway is always welcome. Remember to use the master branch. > > Frediano > > > >> On Thu, Oct 30, 2014 at 12:01 PM, Frediano Ziglio >> wrote: >> > 2014-10-30 17:56 GMT+00:00 Tolga Ceylan : >> > >> >> I mostly agree with this. I think app level timeouts is easy to add >> >> since callbacks are firing >> >> and the app code can keep track of the overall time there. >> >> >> >> However, 'query_timeout' is misleading. This really is a >> >> 'socket_activity_timeout' >> >> since it's based on arriving bits of data from the socket. >> >> >> >> Let say 'query_timeout' is 300 secs. If the TDS packet can be >> >> assembled after 5 calls to socket >> >> read, then this could get blown up to 5*300 secs. This means even if >> >> we rename 'query_timeout', it's not >> >> really meaningful. >> >> >> >> >> > yes, probably query_timeout is quite misleading. >> > >> > >> >> I also see that the TDS header (8 bytes) is expected to arrive in one >> >> read. If the header >> >> arrives in more than one read, then the connection gets closed. This >> >> is a bug. TCP code >> >> needs to handle tiny read cases even if this is rare. >> >> >> >> >> > I don't think so. The only case tds_goodread returns < 8 is when user >> > requested to close connection or on a socket error. Never for less bytes >> > readed. And if crypted all packets are crypted so is impossible it does >> not >> > return at least 8 bytes. >> > >> > >> >> I think 'query_timeout' can be renamed to 'tds packet timeout.' >> >> Instead of tds_select(), the higher >> >> level goodread() function can keep track of this timer and decide if >> >> there is a packet timeout or not. >> >> >> >> I can put together a patch if you like. >> >> >> >> Cheers, >> >> Tolga >> >> >> >> >> > Would be useful. I didn't actually understand what you want to achieve >> > however. A kind of full packet timeout? Server tends to send packet >> > together so you would catch some network delay or problem. If you remove >> > the timeout from tds_select how can it return if server does not send >> data? >> > >> > Frediano >> > >> > >> >> On Thu, Oct 30, 2014 at 3:02 AM, Frediano Ziglio >> >> wrote: >> >> > 2014-10-30 4:10 GMT+00:00 Tolga Ceylan : >> >> > >> >> >> Hi All, >> >> >> >> >> >> Recently, I've stumbled on a potential issue with the timeout >> handling >> >> >> in ct_lib. >> >> >> >> >> >> Given these two cases of SQL executing; >> >> >> >> >> >> DECLARE @counter int >> >> >> WHILE (@counter < 99999999) >> >> >> BEGIN >> >> >> PRINT @counter >> >> >> SET @counter = @counter + 1 >> >> >> END >> >> >> >> >> >> versus; >> >> >> >> >> >> DECLARE @counter int >> >> >> WHILE (@counter < 99999999) >> >> >> BEGIN >> >> >> SET @counter = @counter + 1 >> >> >> END >> >> >> >> >> >> (only difference is print or no-print basically) >> >> >> >> >> >> seems to affect timeout handling since this trips the ::select() (aka >> >> >> tds_select) based query timeout. >> >> >> >> >> >> In other words, continuously feeding such server messages back to the >> >> >> client bypasses >> >> >> the query timeout. The issue is tricky because there has to be enough >> >> >> 'print' executions >> >> >> to actually trigger this. (Probably due to Nagle or other buffering.) >> >> >> >> >> >> Has anybody seen this before? Any work around for it(*) ? >> >> >> >> >> >> (*) the fix probably is to consider beginning/end of the actual >> >> >> queries as opposed to blocking on select >> >> >> with query timeout. >> >> >> >> >> >> I'm using 0.82 on linux centos 6.5 although I couldn't see changes >> >> >> related to this in 0.91. >> >> >> >> >> >> Cheers, >> >> >> Tolga >> >> >> >> >> > >> >> > >> >> > Hi, >> >> > It's not a bug, it's a feature :) >> >> > >> >> > Really, this is the intention. Also considering that you should handle >> >> > results (print IS a result) the library should return so your timeout >> >> > should be managed by application. >> >> > >> >> > Frediano >> >> > _______________________________________________ >> >> > FreeTDS mailing list >> >> > FreeTDS at lists.ibiblio.org >> >> > http://lists.ibiblio.org/mailman/listinfo/freetds >> >> _______________________________________________ >> >> FreeTDS mailing list >> >> FreeTDS at lists.ibiblio.org >> >> http://lists.ibiblio.org/mailman/listinfo/freetds >> >> >> > _______________________________________________ >> > FreeTDS mailing list >> > FreeTDS at lists.ibiblio.org >> > http://lists.ibiblio.org/mailman/listinfo/freetds >> _______________________________________________ >> FreeTDS mailing list >> FreeTDS at lists.ibiblio.org >> http://lists.ibiblio.org/mailman/listinfo/freetds >> > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds From freddy77 at gmail.com Thu Oct 30 16:04:00 2014 From: freddy77 at gmail.com (Frediano Ziglio) Date: Thu, 30 Oct 2014 20:04:00 +0000 Subject: [freetds] timeout handling and server msg callback In-Reply-To: References: Message-ID: 2014-10-30 19:47 GMT+00:00 Tolga Ceylan : > It doesn't look wrapped unless I'm looking at the wrong files/code. > > READSOCKET is defined as recv() or read() depending on arch. > > It's called from tds_goodread() in tds/net.c. > > I think you are referring to 0.91. Yes, read/recv is in a for which exit when you read all bytes expected, unless unfinished is true. Frediano > > On Thu, Oct 30, 2014 at 12:39 PM, Frediano Ziglio > wrote: > > 2014-10-30 19:23 GMT+00:00 Tolga Ceylan : > > > >> In other words, (except maybe in encrypted case), a TCP read can > >> return 1 byte. The underlying > >> call is recv(). There's no guarantee that arrivals will always be >= 8 > >> bytes or whole packets. It's TCP which > >> is a stream of data where application (freetds) is responsible with > >> assembling application level > >> data. These tiny reads could happen if the client slows down and > >> adjusts its receive window size. > >> > >> > > I know... but we don't just call recv, it's wrapped to handle such cases. > > > > > >> For the 'tds packet timeout', yes, I was basically suggesting to move > >> the timeout logic to higher level from > >> tds_goodread() to tds_read_packet(). Full packet timeout basically... > >> > >> > > Understood. Still the point remains, you are catching corner cases. We > are > > trying to detect if server is not sending anything. I understood that in > > some situations packets could get a lot fragmented and every fragment can > > have different reasons to be delayed so the total timeout can be quite > big > > but we are talking about packets that are mostly 4kb transmitted in > network > > packets which are more than 1kb. > > > > Good code anyway is always welcome. Remember to use the master branch. > > > > Frediano > > > > > > > >> On Thu, Oct 30, 2014 at 12:01 PM, Frediano Ziglio > >> wrote: > >> > 2014-10-30 17:56 GMT+00:00 Tolga Ceylan : > >> > > >> >> I mostly agree with this. I think app level timeouts is easy to add > >> >> since callbacks are firing > >> >> and the app code can keep track of the overall time there. > >> >> > >> >> However, 'query_timeout' is misleading. This really is a > >> >> 'socket_activity_timeout' > >> >> since it's based on arriving bits of data from the socket. > >> >> > >> >> Let say 'query_timeout' is 300 secs. If the TDS packet can be > >> >> assembled after 5 calls to socket > >> >> read, then this could get blown up to 5*300 secs. This means even if > >> >> we rename 'query_timeout', it's not > >> >> really meaningful. > >> >> > >> >> > >> > yes, probably query_timeout is quite misleading. > >> > > >> > > >> >> I also see that the TDS header (8 bytes) is expected to arrive in one > >> >> read. If the header > >> >> arrives in more than one read, then the connection gets closed. This > >> >> is a bug. TCP code > >> >> needs to handle tiny read cases even if this is rare. > >> >> > >> >> > >> > I don't think so. The only case tds_goodread returns < 8 is when user > >> > requested to close connection or on a socket error. Never for less > bytes > >> > readed. And if crypted all packets are crypted so is impossible it > does > >> not > >> > return at least 8 bytes. > >> > > >> > > >> >> I think 'query_timeout' can be renamed to 'tds packet timeout.' > >> >> Instead of tds_select(), the higher > >> >> level goodread() function can keep track of this timer and decide if > >> >> there is a packet timeout or not. > >> >> > >> >> I can put together a patch if you like. > >> >> > >> >> Cheers, > >> >> Tolga > >> >> > >> >> > >> > Would be useful. I didn't actually understand what you want to achieve > >> > however. A kind of full packet timeout? Server tends to send packet > >> > together so you would catch some network delay or problem. If you > remove > >> > the timeout from tds_select how can it return if server does not send > >> data? > >> > > >> > Frediano > >> > > >> > > >> >> On Thu, Oct 30, 2014 at 3:02 AM, Frediano Ziglio > > >> >> wrote: > >> >> > 2014-10-30 4:10 GMT+00:00 Tolga Ceylan : > >> >> > > >> >> >> Hi All, > >> >> >> > >> >> >> Recently, I've stumbled on a potential issue with the timeout > >> handling > >> >> >> in ct_lib. > >> >> >> > >> >> >> Given these two cases of SQL executing; > >> >> >> > >> >> >> DECLARE @counter int > >> >> >> WHILE (@counter < 99999999) > >> >> >> BEGIN > >> >> >> PRINT @counter > >> >> >> SET @counter = @counter + 1 > >> >> >> END > >> >> >> > >> >> >> versus; > >> >> >> > >> >> >> DECLARE @counter int > >> >> >> WHILE (@counter < 99999999) > >> >> >> BEGIN > >> >> >> SET @counter = @counter + 1 > >> >> >> END > >> >> >> > >> >> >> (only difference is print or no-print basically) > >> >> >> > >> >> >> seems to affect timeout handling since this trips the ::select() > (aka > >> >> >> tds_select) based query timeout. > >> >> >> > >> >> >> In other words, continuously feeding such server messages back to > the > >> >> >> client bypasses > >> >> >> the query timeout. The issue is tricky because there has to be > enough > >> >> >> 'print' executions > >> >> >> to actually trigger this. (Probably due to Nagle or other > buffering.) > >> >> >> > >> >> >> Has anybody seen this before? Any work around for it(*) ? > >> >> >> > >> >> >> (*) the fix probably is to consider beginning/end of the actual > >> >> >> queries as opposed to blocking on select > >> >> >> with query timeout. > >> >> >> > >> >> >> I'm using 0.82 on linux centos 6.5 although I couldn't see changes > >> >> >> related to this in 0.91. > >> >> >> > >> >> >> Cheers, > >> >> >> Tolga > >> >> >> > >> >> > > >> >> > > >> >> > Hi, > >> >> > It's not a bug, it's a feature :) > >> >> > > >> >> > Really, this is the intention. Also considering that you should > handle > >> >> > results (print IS a result) the library should return so your > timeout > >> >> > should be managed by application. > >> >> > > >> >> > Frediano > >> >> > _______________________________________________ > >> >> > FreeTDS mailing list > >> >> > FreeTDS at lists.ibiblio.org > >> >> > http://lists.ibiblio.org/mailman/listinfo/freetds > >> >> _______________________________________________ > >> >> FreeTDS mailing list > >> >> FreeTDS at lists.ibiblio.org > >> >> http://lists.ibiblio.org/mailman/listinfo/freetds > >> >> > >> > _______________________________________________ > >> > FreeTDS mailing list > >> > FreeTDS at lists.ibiblio.org > >> > http://lists.ibiblio.org/mailman/listinfo/freetds > >> _______________________________________________ > >> FreeTDS mailing list > >> FreeTDS at lists.ibiblio.org > >> http://lists.ibiblio.org/mailman/listinfo/freetds > >> > > _______________________________________________ > > FreeTDS mailing list > > FreeTDS at lists.ibiblio.org > > http://lists.ibiblio.org/mailman/listinfo/freetds > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > From Raila.Wayne at mgh.harvard.edu Fri Oct 31 16:24:54 2014 From: Raila.Wayne at mgh.harvard.edu (Raila, Wayne F.) Date: Fri, 31 Oct 2014 20:24:54 +0000 Subject: [freetds] kerberos credentials not detected by FreeTDS In-Reply-To: <3577DB6D-232A-4441-93A5-F6617E4EECE9@PARTNERS.ORG> References: <9F2CB01D8C30DD4E903CAFDFBFD71EC233BD0763@PHSX10MB11.partners.org>, <3577DB6D-232A-4441-93A5-F6617E4EECE9@PARTNERS.ORG> Message-ID: <9F2CB01D8C30DD4E903CAFDFBFD71EC233C9657E@PHSX10MB11.partners.org> I have confirmed that the issue was with the configuration of SQL Server SPN in the domain. Here are some details. There are two authorization schemes to connect to SQL Server using an active directory account. One is Kerberos, the other is NTLM. Which authorization scheme you get depends on the syntax used with the tsql command. When you use the -U parameter to supply the username, then tsql uses NTLM. When you do not supply the username, tsql uses Kerberos. Here are two examples, with a select statement that shows the authorization scheme. $ tsql -S ftdsdsn -U 'MYDOMAIN\myusername' Password: locale is "en_US.UTF-8" locale charset is "UTF-8" using default charset "UTF-8" 1> SELECT auth_scheme FROM sys.dm_exec_connections WHERE session_id = @@SPID; 2> go auth_scheme NTLM (1 row affected) $ tsql -S ftdsdsn locale is "en_US.UTF-8" locale charset is "UTF-8" using default charset "UTF-8" 1> SELECT auth_scheme FROM sys.dm_exec_connections WHERE session_id = @@SPID; 2> go auth_scheme KERBEROS (1 row affected) Why this is important: I had assumed, since I could connect to the database by supplying my domain username, that Kerberos was correctly configured. That was not the case. NTLM was properly configured, but not Kerberos. How to diagnose: I used the KRB5_TRACE setting to log kerberos activity. In this example I show a portion of the .freetds.conf file, the tsql command with its result, and a few lines from the log file: $ cat .freetds.conf ... [ftdsdsn] host = sqlservername.mydomain.org port = 2004 tds version = 7.1 $ KRB5_TRACE=krb5.log tsql -S lcsclientdevsql locale is "en_US.UTF-8" locale charset is "UTF-8" using default charset "UTF-8" Error 20002 (severity 9): Adaptive Server connection failed There was a problem connecting to the server $ cat krb5.log ... [17234] 1414783635.360320: Getting credentials myusername at MYDOMAIN.ORG -> MSSQLSvc/sqlservername.mydomain.org:2004 at MYDOMAIN.ORG using ccache FILE:/tmp/krb5cc_16777216_jBDqdj ... [17234] 1414783635.361240: Requesting tickets for MSSQLSvc/sqlservername.mydomain.org:2004 at MYDOMAIN.ORG, referrals on ... [17234] 1414783635.446168: TGS request result: -1765328377/Server not found in Kerberos database The key bit of information here is the string "MSSQLSvc/sqlservername.mydomain.org:2004 at MYDOMAIN.ORG". That is the Service Principle Name, SPN, of the SQL Server, and it must be registered in the domain for this to work. In my case, the SPN was not in the domain. Once I added the SPN to the domain then Kerberos worked fine. How to configure the SPN: Microsoft has this covered at http://msdn.microsoft.com/en-us/library/ms191153.aspx. Why was my SPN not in the domain? And why doesn't everybody run into this problem? The SPN maps to the Windows account that started the SQL Server instance service. By default, SQL Server uses a built-in account to start the service, and this build-in account has permission to add the SPN to the domain. When SQL Server starts up, that account adds the SPN. By using the default configuration, with a built-in account, this problem does not arise. In my case, I was using a domain account to start the service, and the domain account did not have permission to update the domain. When SQL Server started up, that account attempted to register the SPN, and failed due to lack of authorization. This problem can be fixed by authorizing the service account to make the domain change, or by manually adding the SPN as documented in the MS article above. I chose the latter approach. That is what I think I know. Never can be sure. I hope this helps someone in the future. Wayne -----Original Message----- From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Raila, Wayne F. Sent: Sunday, September 21, 2014 5:19 PM To: FreeTDS Development Group Subject: Re: [freetds] kerberos credentials not detected by FreeTDS Thanks for the tip, Frediano. At the moment I am working on the theory that the problem lies not with the Linux client but with the Service Principle Name, SPN, of the SQL Server. Our SQL Servers do not have the requisite SPNs configured in Active Directory. The Kerberos logs on the Linux client indicate this is where the failure happens. Now I am waiting for the domain admins to update Active Directory. I will post a follow-up once I've confirmed this works. Wayne > On Sep 20, 2014, at 8:19 AM, Frediano Ziglio wrote: > > 2014-09-16 15:31 GMT+01:00 Raila, Wayne F. : > >> I am having trouble getting FreeTDS to pick up my kerberos >> credentials when connecting to MS SQL Server. Client is a VirtualBox >> running CentOS. I have joined my virtual machine to the Windows >> domain, and I have logged in to the virtual machine with a domain >> account. I am able to connect to the sql server using my windows >> credentials, provided I specify username and password. >> >> What I am not able to do is have FreeTDS detect my current kerberos >> credentials and use those automatically. I am also not able to get >> FreeTDS to use a kerberos context that was loaded from a keytab file. >> >> I am able to connect using tsql as long as I supply the username. >> Using this command, I am prompted for my password, after which the >> connection succeeds. >> tsql -S ftdsdsn -U 'MYDOMAIN\myusername' >> Password: >> locale is "en_US.UTF-8" >> locale charset is "UTF-8" >> using default charset "UTF-8" >> 1> >> >> I would like to connect using just the dsn name, and have FreeTDS >> detect the existing kerberos credentials. When I try this I get Error >> 20002 (severity 9) Adaptive Server connection failed. >> tsql -S ftdsdsn >> locale is "en_US.UTF-8" >> locale charset is "UTF-8" >> using default charset "UTF-8" >> Error 20002 (severity 9): >> Adaptive Server connection failed There was a problem >> connecting to the server >> >> I can verify credentials using klist. >> klist >> Ticket cache: FILE:/tmp/krb5cc_16777216_A8R0lC Default principal: >> myusername at MYDOMAIN.ORG >> Valid starting Expires Service principal >> 09/12/14 15:51:59 09/13/14 01:51:58 krbtgt/MYDOMAIN.ORG at MYDOMAIN.ORG >> renew until 09/19/14 15:51:59 > Try to use > > tsql -S ftdsdsn -U '' -P '' > > Also try to enable TDSDUMP and TDSDUMPCONFIG and see if this helps > > Frediano > > >> I have also tried using kinit to load a user context from a keytab file. >> kinit succeeds, and klist shows the default principal, but tsql fails >> in same way. >> >> Ultimately I will be using kinit and a keytab file to provide >> credentials in pyodbc, but I presume I should get tsql working before >> I delve into pyodbc. >> >> Because I am able to login and execute queries, I believe the >> configuration of FreeTDS and unixODBC is correct as far as parameters >> for the SQL Server are concerned. The problem appears to be that tsql >> is not finding or sending the credentials to sql server. >> >> I've really hammered on this a lot. I could use some help. >> >> Wayne Raila >> MGH Lab of Computer Science >> >> >> Configuration info below. >> >> CentOS release 6.5 (Final) (i686) >> unixODBC-2.2.14-12.el6_3.i686 >> unixODBC-devel-2.2.14-12.el6_3.i686 >> freetds-0.91-2.el6.i686 >> krb5-libs-1.10.3-15.el6_5.1.i686 >> pam_krb5-2.3.11-9.el6.i686 >> krb5-devel-1.10.3-15.el6_5.1.i686 >> krb5-workstation-1.10.3-15.el6_5.1.i686 >> samba-common-3.6.9-169.el6_5.i686 >> samba-client-3.6.9-169.el6_5.i686 >> samba-winbind-clients-3.6.9-169.el6_5.i686 >> samba-3.6.9-169.el6_5.i686 >> samba-winbind-3.6.9-169.el6_5.i686 >> >> tsql -C >> Compile-time settings (established with the "configure" script) >> Version: freetds v0.91 >> freetds.conf directory: /etc >> MS db-lib source compatibility: yes >> Sybase binary compatibility: yes >> Thread safety: yes >> iconv library: yes >> TDS version: 4.2 >> iODBC: no >> unixodbc: yes >> SSPI "trusted" logins: no >> Kerberos: yes >> >> /etc/odbcinst.ini >> [ODBC] >> Trace = Yes >> TraceFile = /tmp/odbc.log >> >> [FreeTDS] >> Description = ODBC for SQL Server >> Driver = /usr/lib/libtdsodbc.so.0 >> Setup = /usr/lib/libtdsS.so >> FileUsage = 1 >> TDS Version = 7.1 >> >> /etc/odbc.ini >> [odbcdsn] >> Driver = FreeTDS >> Servername = ftdsdsn >> TDS_Version = 7.1 >> Trusted_Connection = Yes >> >> ~/.freetds.conf >> [global] >> tds version = 8.0 >> dump file = /tmp/freetds.log >> text size = 64512 >> >> [ftdsdsn] >> host = mysqlserver.mydomain.org >> port = 1433 >> tds version = 7.1 >> >> a portion of tdsdumpconfig >> config.c:301:Success: [ftdsdsn] defined in >> /home/MYDOMAIN/myusername/.freetds.conf. >> config.c:224:Final connection parameters: >> config.c:225: server_name = ftdsdsn >> config.c:226: server_host_name = mysqlserver.mydomain.org >> config.c:227: ip_addr = xxx.xxx.xxx.x >> config.c:228: instance_name = >> config.c:229: port = 1433 >> config.c:230: major_version = 7 >> config.c:231: minor_version = 1 >> config.c:232: block_size = 0 >> config.c:233: language = us_english >> config.c:234: server_charset = iso_1 >> config.c:235: connect_timeout = 0 >> config.c:236: client_host_name = xxxx.xxx.xxx.xxx >> config.c:237: client_charset = UTF-8 >> config.c:238: app_name = TSQL >> config.c:239: user_name = >> config.c:242: library = TDS-Library >> config.c:243: bulk_copy = 0 >> config.c:244: suppress_language = 0 >> config.c:245: encrypt level = 0 >> config.c:246: query_timeout = 0 >> config.c:249: database = >> config.c:250: dump_file = /tmp/freetds.log >> config.c:251: debug_flags = 0 >> config.c:252: text_size = 64512 >> config.c:253: broken_dates = 0 >> config.c:254: emul_little_endian = 0 >> config.c:255: server_realm_name = >> >> Microsoft SQL Server 2005 - 9.00.5000.00 (X64) >> Dec 10 2010 10:38:40 >> Copyright (c) 1988-2005 Microsoft Corporation >> Enterprise Edition (64-bit) on Windows NT 5.2 (Build 3790: >> Service Pack 2) >> >> >> >> >> The information in this e-mail is intended only for the person to >> whom it is addressed. If you believe this e-mail was sent to you in >> error and the e-mail contains patient information, please contact the >> Partners Compliance HelpLine at >> http://www.partners.org/complianceline . If the e-mail was sent to >> you in error but does not contain patient information, please contact >> the sender and properly dispose of the e-mail. > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds From SATurk at MissouriState.edu Fri Nov 7 12:05:08 2014 From: SATurk at MissouriState.edu (Turk, Scott A) Date: Fri, 7 Nov 2014 11:05:08 -0600 Subject: [freetds] Output from SQL Server database In-Reply-To: References: Message-ID: Hi, I've enabled the wide support and it didn't solve the issue. Is there a setting to change or add to the odbc.ini or the freetds.conf files? Thanks for your help! SCOTT TURK DATABASE ANALYST, DBA COMPUTER SERVICES - MIS MISSOURI STATE UNIVERSITY SATURK at MISSOURISTATE.EDU (417) 836-6195 -----Original Message----- From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Frediano Ziglio Sent: Tuesday, October 28, 2014 3:04 PM To: FreeTDS Development Group Subject: Re: [freetds] Output from SQL Server database One possible solution if database is using nvarchar would be to enable odbc wide support. This way ODBC should present nvarchar as wide encoding ( either 2 bytes or 4 bytes characters depending on system settings). Frediano Frediano 2014-10-27 18:44 GMT+00:00 Turk, Scott A : > FreeTDS version is 7.2. The data type of the column in question is > nvarchar on the SQL server side - would the rest of the table > description help? We are accessing the data via an Oracle link in SQL > Developer. The data is produced by user input. > > How can I produce a dump file? > > Thanks! > > SCOTT TURK > DATABASE ANALYST, DBA > COMPUTER SERVICES - MIS > MISSOURI STATE UNIVERSITY > SATURK at MISSOURISTATE.EDU > (417) 836-6195 > > > -----Original Message----- > From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of > Frediano Ziglio > Sent: Monday, October 27, 2014 12:13 PM > To: FreeTDS Development Group > Subject: Re: [freetds] Output from SQL Server database > > 2014-10-27 16:48 GMT+00:00 Turk, Scott A : > > > Hi, we're having a problem with the output we're getting across an > > Oracle link to a SQL Server database. The column output appears to > > have inserted nulls in between each character. The data type of the > column is nvarchar. > > Our application is SQL Developer. > > > > Any ideas on what may be going wrong? We also use FreeTDS to link > > to other SQL Server databases and have not seen this happen previously. > > > > Thanks! > > > > Scott Turk > > Database Analyst, DBA > > Computer Services - MIS > > Missouri State University > > SATurk at missouristate.edu > > (417) 836-6195 > > > > > Hi, > any more details like FreeTDS version, possible dump, how did you > upload data, tables definition. > > Frediano > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds From m.grau at kcc.state.ks.us Fri Nov 7 12:14:14 2014 From: m.grau at kcc.state.ks.us (Mike Grau) Date: Fri, 07 Nov 2014 11:14:14 -0600 Subject: [freetds] Output from SQL Server database In-Reply-To: References: Message-ID: <545CFDE6.9000007@kcc.state.ks.us> On 11/07/2014 11:05 AM, Turk, Scott A wrote: > Hi, I've enabled the wide support and it didn't solve the issue. Is there a setting to change or add to the odbc.ini or the freetds.conf files? In your freetds.conf have you tried client charset = CP1252 in the sqlserver stanza? From SATurk at MissouriState.edu Fri Nov 7 12:23:40 2014 From: SATurk at MissouriState.edu (Turk, Scott A) Date: Fri, 7 Nov 2014 11:23:40 -0600 Subject: [freetds] Output from SQL Server database In-Reply-To: <545CFDE6.9000007@kcc.state.ks.us> References: <545CFDE6.9000007@kcc.state.ks.us> Message-ID: Thanks for the suggestion, but after adding that it still has the same problem. Here is what is contained in that section. [CSI] host = xxx.xxx.xxx.xxx port = 1433 client charset = CP1252 tds version = 7.2 SCOTT TURK DATABASE ANALYST, DBA COMPUTER SERVICES - MIS MISSOURI STATE UNIVERSITY SATURK at MISSOURISTATE.EDU (417) 836-6195 -----Original Message----- From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Mike Grau Sent: Friday, November 07, 2014 11:14 AM To: FreeTDS Development Group Subject: Re: [freetds] Output from SQL Server database On 11/07/2014 11:05 AM, Turk, Scott A wrote: > Hi, I've enabled the wide support and it didn't solve the issue. Is there a setting to change or add to the odbc.ini or the freetds.conf files? In your freetds.conf have you tried client charset = CP1252 in the sqlserver stanza? _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds From tolga.ceylan at gmail.com Fri Nov 7 16:50:43 2014 From: tolga.ceylan at gmail.com (Tolga Ceylan) Date: Fri, 7 Nov 2014 13:50:43 -0800 Subject: [freetds] freetds async usage Message-ID: I know this is not possible with the current code, but I was wondering if anybody worked on this in the past. How hard would it be to add async support to freetds? For example, linux/epoll support? Cheers, Tolga Ceylan From freddy77 at gmail.com Mon Nov 10 04:57:36 2014 From: freddy77 at gmail.com (Frediano Ziglio) Date: Mon, 10 Nov 2014 09:57:36 +0000 Subject: [freetds] Output from SQL Server database In-Reply-To: References: <545CFDE6.9000007@kcc.state.ks.us> Message-ID: Could you please reply to my questions? Oracle connector support was developed by me and some people with an Oracle server which provided all necessary logs to fix all issues. There are different reasons why the result from query is that every character is followed by a NUL characters: - server inserted ucs2/utf16 on a single characters column; - server inserted ucs4 on a ucs2 column (this could happen for a mismatch, unfortunately *nix drivers came in two versions, one with sizeof(SQLWCHAR) == 2 and one with sizeof(SQLWCHAR) == 4 == sizeof(wchar_t) ); - data in the database are inserted correctly but client did not get results correctly. Regards, Frediano Frediano 2014-11-07 17:23 GMT+00:00 Turk, Scott A : > Thanks for the suggestion, but after adding that it still has the same > problem. Here is what is contained in that section. > > [CSI] > host = xxx.xxx.xxx.xxx > port = 1433 > client charset = CP1252 > tds version = 7.2 > > > SCOTT TURK > DATABASE ANALYST, DBA > COMPUTER SERVICES - MIS > MISSOURI STATE UNIVERSITY > SATURK at MISSOURISTATE.EDU > (417) 836-6195 > > > -----Original Message----- > From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of > Mike Grau > Sent: Friday, November 07, 2014 11:14 AM > To: FreeTDS Development Group > Subject: Re: [freetds] Output from SQL Server database > > On 11/07/2014 11:05 AM, Turk, Scott A wrote: > > Hi, I've enabled the wide support and it didn't solve the issue. Is > there a setting to change or add to the odbc.ini or the freetds.conf files? > > In your freetds.conf have you tried > > client charset = CP1252 > > in the sqlserver stanza? > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > From freddy77 at gmail.com Mon Nov 10 05:01:43 2014 From: freddy77 at gmail.com (Frediano Ziglio) Date: Mon, 10 Nov 2014 10:01:43 +0000 Subject: [freetds] freetds async usage In-Reply-To: References: Message-ID: 2014-11-07 21:50 GMT+00:00 Tolga Ceylan : > I know this is not possible with the current code, but I was wondering > if anybody worked on this in the past. > > How hard would it be to add async support to freetds? > > For example, linux/epoll support? > > Cheers, > Tolga Ceylan > Hi, different libraries have different ideas for async implementations. What do you mean by async with linux/epoll? Which library are you using? Regards, Frediano From tolga.ceylan at gmail.com Mon Nov 10 14:26:22 2014 From: tolga.ceylan at gmail.com (Tolga Ceylan) Date: Mon, 10 Nov 2014 11:26:22 -0800 Subject: [freetds] freetds async usage In-Reply-To: References: Message-ID: It's more of an open question, any approach/implementation is OK. This could be via ct_poll() sort of approach or freetds could expose sockets for the application to monitor via epoll/poll, etc. I've got no strict requirements or any dependencies to any specific library. In other words, I want to manage multiple connections in a single thread where freetds API should not block. On Mon, Nov 10, 2014 at 2:01 AM, Frediano Ziglio wrote: > 2014-11-07 21:50 GMT+00:00 Tolga Ceylan : > >> I know this is not possible with the current code, but I was wondering >> if anybody worked on this in the past. >> >> How hard would it be to add async support to freetds? >> >> For example, linux/epoll support? >> >> Cheers, >> Tolga Ceylan >> > > Hi, > different libraries have different ideas for async implementations. What > do you mean by async with linux/epoll? Which library are you using? > > Regards, > Frediano > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds From msabramo at gmail.com Mon Nov 10 17:46:33 2014 From: msabramo at gmail.com (Marc Abramowitz) Date: Mon, 10 Nov 2014 14:46:33 -0800 Subject: [freetds] freetds async usage In-Reply-To: References: Message-ID: <7D0198C2-AD2D-4A08-A51C-DA63EA57B397@gmail.com> In the specific case of Python, I happen to know that pymssql supports concurrency through gevent, because I added it. That was trivial to add, because FreeTDS gives the file descriptor it's waiting on and gevent can be told to run other greenlets until that file descriptor has data ready to read. That's Python but if you're using some other platform (which?), you might get some ideas by cribbing from pymssql. And perhaps I might get some ideas by looking at what you do - maybe you'll improve upon it - so let me know if you go that route. If you want more details, let me know. There was also a thread around that time about async where I inquired similarly to you and James K. Lowden responded with some thoughts. If you can't find it, let me know and I'll see if I have it in my notes. -Marc http://marc-abramowitz.com Sent from my iPhone 4S > On Nov 10, 2014, at 11:26 AM, Tolga Ceylan wrote: > > It's more of an open question, any approach/implementation is OK. > > This could be via ct_poll() sort of approach or freetds could expose sockets > for the application to monitor via epoll/poll, etc. > > I've got no strict requirements or any dependencies to any specific library. > > In other words, I want to manage multiple connections in a single thread > where freetds API should not block. > > > >> On Mon, Nov 10, 2014 at 2:01 AM, Frediano Ziglio wrote: >> 2014-11-07 21:50 GMT+00:00 Tolga Ceylan : >> >>> I know this is not possible with the current code, but I was wondering >>> if anybody worked on this in the past. >>> >>> How hard would it be to add async support to freetds? >>> >>> For example, linux/epoll support? >>> >>> Cheers, >>> Tolga Ceylan >> >> Hi, >> different libraries have different ideas for async implementations. What >> do you mean by async with linux/epoll? Which library are you using? >> >> Regards, >> Frediano >> _______________________________________________ >> FreeTDS mailing list >> FreeTDS at lists.ibiblio.org >> http://lists.ibiblio.org/mailman/listinfo/freetds > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds From tolga.ceylan at gmail.com Mon Nov 10 20:28:32 2014 From: tolga.ceylan at gmail.com (Tolga Ceylan) Date: Mon, 10 Nov 2014 17:28:32 -0800 Subject: [freetds] freetds async usage In-Reply-To: <7D0198C2-AD2D-4A08-A51C-DA63EA57B397@gmail.com> References: <7D0198C2-AD2D-4A08-A51C-DA63EA57B397@gmail.com> Message-ID: That's nice. Just looked at pymssql code. I'm using ct_lib interface, so I didn't notice dbiordesc() before. But this is still a bit tricky, TCP send can also block. There's also risk of blocking during partial reads. These are implemented as while/for loops in freetds until desired buffer size is filled in. To get around this, we'd have to guarantee that there's always enough data to read/write. In case of recv, we can use MSG_PEEK to determine the size, but with the extra cost of additional system call. In case of send, I'm not sure there's any way... And then there's SSL and DNS resolver if applicable (luckily not in my case.) I also saw this: http://lists.ibiblio.org/pipermail/freetds/2013q4/028606.html Conceptually, for me the ideal way would be to perform all network I/O somewhere else (different thread, different library, etc.) and just feed this stream of data in/out to freetds. Sounds like significant amount of work. :-( On Mon, Nov 10, 2014 at 2:46 PM, Marc Abramowitz wrote: > In the specific case of Python, I happen to know that pymssql supports concurrency through gevent, because I added it. That was trivial to add, because FreeTDS gives the file descriptor it's waiting on and gevent can be told to run other greenlets until that file descriptor has data ready to read. > > That's Python but if you're using some other platform (which?), you might get some ideas by cribbing from pymssql. And perhaps I might get some ideas by looking at what you do - maybe you'll improve upon it - so let me know if you go that route. > > If you want more details, let me know. There was also a thread around that time about async where I inquired similarly to you and James K. Lowden responded with some thoughts. If you can't find it, let me know and I'll see if I have it in my notes. > > -Marc > http://marc-abramowitz.com > Sent from my iPhone 4S > > >> On Nov 10, 2014, at 11:26 AM, Tolga Ceylan wrote: >> >> It's more of an open question, any approach/implementation is OK. >> >> This could be via ct_poll() sort of approach or freetds could expose sockets >> for the application to monitor via epoll/poll, etc. >> >> I've got no strict requirements or any dependencies to any specific library. >> >> In other words, I want to manage multiple connections in a single thread >> where freetds API should not block. >> >> >> >>> On Mon, Nov 10, 2014 at 2:01 AM, Frediano Ziglio wrote: >>> 2014-11-07 21:50 GMT+00:00 Tolga Ceylan : >>> >>>> I know this is not possible with the current code, but I was wondering >>>> if anybody worked on this in the past. >>>> >>>> How hard would it be to add async support to freetds? >>>> >>>> For example, linux/epoll support? >>>> >>>> Cheers, >>>> Tolga Ceylan >>> >>> Hi, >>> different libraries have different ideas for async implementations. What >>> do you mean by async with linux/epoll? Which library are you using? >>> >>> Regards, >>> Frediano >>> _______________________________________________ >>> FreeTDS mailing list >>> FreeTDS at lists.ibiblio.org >>> http://lists.ibiblio.org/mailman/listinfo/freetds >> _______________________________________________ >> FreeTDS mailing list >> FreeTDS at lists.ibiblio.org >> http://lists.ibiblio.org/mailman/listinfo/freetds > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds From freddy77 at gmail.com Tue Nov 11 05:06:38 2014 From: freddy77 at gmail.com (Frediano Ziglio) Date: Tue, 11 Nov 2014 10:06:38 +0000 Subject: [freetds] freetds async usage In-Reply-To: References: <7D0198C2-AD2D-4A08-A51C-DA63EA57B397@gmail.com> Message-ID: Now is much cleaner. libTDS and mainly FreeTDS have not the possibility of "returning instead of waiting". However it uses no blocking sockets and poll (select for compatibility only today). To implement green thread I would try to use coroutines. That is if we detect that there is not data available at socket level queue the socket for read/write select and switch the context to another thread (yes, look like what kernels do!). Actual code use two sockets, one is connected to mssql and another to signal cancellation. Frediano 2014-11-11 1:28 GMT+00:00 Tolga Ceylan : > > That's nice. Just looked at pymssql code. I'm using ct_lib interface, > so I didn't notice dbiordesc() before. > > But this is still a bit tricky, TCP send can also block. There's also > risk of blocking during partial reads. These are implemented as > while/for loops in freetds until desired buffer > size is filled in. > > To get around this, we'd have to guarantee that there's always enough > data to read/write. In case of recv, we can use MSG_PEEK to determine > the size, but with the extra cost of additional system call. In case > of send, I'm not sure there's any way... > > And then there's SSL and DNS resolver if applicable (luckily not in my case.) > > I also saw this: > > http://lists.ibiblio.org/pipermail/freetds/2013q4/028606.html > > Conceptually, for me the ideal way would be to perform all network I/O > somewhere else (different thread, different library, etc.) and just > feed this stream of data in/out to freetds. Sounds like significant > amount of work. :-( > > > > On Mon, Nov 10, 2014 at 2:46 PM, Marc Abramowitz wrote: > > In the specific case of Python, I happen to know that pymssql supports concurrency through gevent, because I added it. That was trivial to add, because FreeTDS gives the file descriptor it's waiting on and gevent can be told to run other greenlets until that file descriptor has data ready to read. > > > > That's Python but if you're using some other platform (which?), you might get some ideas by cribbing from pymssql. And perhaps I might get some ideas by looking at what you do - maybe you'll improve upon it - so let me know if you go that route. > > > > If you want more details, let me know. There was also a thread around that time about async where I inquired similarly to you and James K. Lowden responded with some thoughts. If you can't find it, let me know and I'll see if I have it in my notes. > > > > -Marc > > http://marc-abramowitz.com > > Sent from my iPhone 4S > > > > > >> On Nov 10, 2014, at 11:26 AM, Tolga Ceylan wrote: > >> > >> It's more of an open question, any approach/implementation is OK. > >> > >> This could be via ct_poll() sort of approach or freetds could expose sockets > >> for the application to monitor via epoll/poll, etc. > >> > >> I've got no strict requirements or any dependencies to any specific library. > >> > >> In other words, I want to manage multiple connections in a single thread > >> where freetds API should not block. > >> > >> > >> > >>> On Mon, Nov 10, 2014 at 2:01 AM, Frediano Ziglio wrote: > >>> 2014-11-07 21:50 GMT+00:00 Tolga Ceylan : > >>> > >>>> I know this is not possible with the current code, but I was wondering > >>>> if anybody worked on this in the past. > >>>> > >>>> How hard would it be to add async support to freetds? > >>>> > >>>> For example, linux/epoll support? > >>>> > >>>> Cheers, > >>>> Tolga Ceylan > >>> > >>> Hi, > >>> different libraries have different ideas for async implementations. What > >>> do you mean by async with linux/epoll? Which library are you using? > >>> > >>> Regards, > >>> Frediano From simone.magnaschi at rockol.it Wed Nov 12 06:40:09 2014 From: simone.magnaschi at rockol.it (Simone Magnaschi) Date: Wed, 12 Nov 2014 12:40:09 +0100 Subject: [freetds] FreeTds, Dblib, SQl server2000 and the strange case of drop queries Message-ID: <54634719.4030101@rockol.it> Good morning to all. I'm new to the mailing list, I subscribed since we're having issues on a new server deployment using FreeTDS. We were using FreeTDS before on a old server and everything was fine. So we've got a new server with * Debian Wheezy 32BIT * PHP 5.5.18 * FreeTDS 0.91 This PHP app needs to talk to an old SQL server 2000 server. We used the old code from our previous server (PHP 5.2 and older FreeTDS - can't get the version unfortunately). We connect to SQL server 2000 through PDO using dblib driver. We're experiencing weird behaviour with the fetch function. Basically if we issue a query during a fetch loop on the same pdo connection object, the main query gets reset and next fetch call will return false even if there are still records to be fetched. |// PSEUDO CODE // Here the main query $q = $sql7->query("SELECT TOP 5 * FROM News ORDER BY Data Desc"); while ($row = $q->fetch(PDO::FETCH_ASSOC)) { // Looping through the results echo "

Main query

"; print_r($row); // Issue a query on the same pdo connection $subq = $sql7->query("SELECT TOP 1 * FROM News WHERE IDNews = " . $row['IDNews'] . " "); while ($subResult = $subq->fetch(PDO::FETCH_ASSOC)) { echo "

Inner query

"; print_r($subResult); } // Here the main query $q->fetch(PDO::FETCH_ASSOC) will answer false on the next iteration // if we remove the subq, the main query loops just fine echo "
"; } | Same code on a Windows PHP with pdo_sqlserver driver works just fine. It doesn't matter the type of fetch that we pass as argument of fetch function. PHP doesn't throw any warning or error. I really don't know what's going on here, and I don't know if it's an issue of PHP / FreeTDS / DBlib. Any help would be great! Thanks in advance Simone Magnaschi From freddy77 at gmail.com Wed Nov 12 07:04:25 2014 From: freddy77 at gmail.com (Frediano Ziglio) Date: Wed, 12 Nov 2014 12:04:25 +0000 Subject: [freetds] FreeTds, Dblib, SQl server2000 and the strange case of drop queries In-Reply-To: <54634719.4030101@rockol.it> References: <54634719.4030101@rockol.it> Message-ID: 2014-11-12 11:40 GMT+00:00 Simone Magnaschi : > Good morning to all. > Hi Simone, > I'm new to the mailing list, I subscribed since we're having issues on a new > server deployment using FreeTDS. We were using FreeTDS before on a old > server and everything was fine. > > > So we've got a new server with > > * Debian Wheezy 32BIT > * PHP 5.5.18 > * FreeTDS 0.91 > > This PHP app needs to talk to an old SQL server 2000 server. We used the old > code from our previous server (PHP 5.2 and older FreeTDS - can't get the > version unfortunately). We connect to SQL server 2000 through PDO using > dblib driver. > > We're experiencing weird behaviour with the fetch function. Basically if we > issue a query during a fetch loop on the same pdo connection object, the > main query gets reset and next fetch call will return false even if there > are still records to be fetched. > > |// PSEUDO CODE > // Here the main query > $q = $sql7->query("SELECT TOP 5 * FROM News ORDER BY Data Desc"); > while ($row = $q->fetch(PDO::FETCH_ASSOC)) { > // Looping through the results > echo "

Main query

"; > print_r($row); > > // Issue a query on the same pdo connection > $subq = $sql7->query("SELECT TOP 1 * FROM News WHERE IDNews = " . > $row['IDNews'] . " "); > while ($subResult = $subq->fetch(PDO::FETCH_ASSOC)) { > echo "

Inner query

"; > print_r($subResult); > } > > // Here the main query $q->fetch(PDO::FETCH_ASSOC) will answer false on > the next iteration > // if we remove the subq, the main query loops just fine > echo "
"; > } > | With default configuration TDS protocol (defined by Microsoft, not by us) cannot do two queries at the same time. To do what your pseudo code do we have to either - case result of first query; - use cursors on first query to you free connection; - use MARS (I don't think actually you can do it and not with dblib for sure!). However as James always remember you are probably doing the wrong thing. Looking at your code I would say why not using a query like SELECT TOP 5 * FROM News ORDER BY Data DESC as IDNews should probably be unique? Or something like SELECT * FROM News WHERE IDNews IN (SELECT TOP 5 IDNews FROM News ORDER BY Data DESC) Filtering double IDs with client. Or using a store procedure that does all for you? Your code actually does 6 queries to server while mine single queries does only one. Also consider the query caching, locking, network round trips and so on usually there are better way to do it. > > Same code on a Windows PHP with pdo_sqlserver driver works just fine. > Which driver are you using? > It doesn't matter the type of fetch that we pass as argument of fetch > function. > > PHP doesn't throw any warning or error. > > I really don't know what's going on here, and I don't know if it's an issue > of PHP / FreeTDS / DBlib. > > Any help would be great! > > > Thanks in advance > Simone Magnaschi > Usually on way to understand what's going on is to enable TDSDUMP on FreeTDS. See http://www.freetds.org/userguide/logging.htm. Regards, Frediano From simone.magnaschi at rockol.it Wed Nov 12 07:41:14 2014 From: simone.magnaschi at rockol.it (Simone Magnaschi) Date: Wed, 12 Nov 2014 13:41:14 +0100 Subject: [freetds] FreeTds, Dblib, SQl server2000 and the strange case of drop queries In-Reply-To: References: <54634719.4030101@rockol.it> Message-ID: <5463556A.6000702@rockol.it> Hi Frediano, thanks for the extensive reply! > With default configuration TDS protocol (defined by Microsoft, not by > us) cannot do two queries at the same time. To do what your pseudo > code do we have to either Uh.. I didn't know that. I'm wondering why the same code was running fine on the old server. > However as James always remember you are probably doing the wrong > thing. Looking at your code I would say why not using a query like > Your code actually does 6 queries to server while mine single queries > does only one. Also consider the query caching, locking, network round > trips and so on usually there are better way to do it. I should have pointed out the fact that the code was there just to recreate the problem . The real code is actually different and involves different and nested function calls that from a PDO and database point of view translate in one or more query issued inside a fetch loop of a main query. The sub queries may vary based on the circumstances, so a single query is not always an option for me. In this particular case btw I could just use a fetchall function and save everything in a array and then loop through the array and do my thing on each element (that's what I did to solve the problem in a hurry). This works fine since - I imagine - there aren't overlapping queries. Code refactoring on the whole codebase is an option and, if I cannot get the problem solved, a necessity. My curiosity and head-scratching come from the fact that the old linux server (same client code, older os / freetds version / php version) worked without issues. I'll try to get the machine back up to see if I'm missing something on a conf point of view. >> Same code on a Windows PHP with pdo_sqlserver driver works just fine. >> > Which driver are you using? > On the windows workstation I'm using the php_pdo_sqlsrv_55_ts.dll against a SQL SERVER 2008. I also use a PHP 5.2 version on the same Windows machine with the php_pdo_sqlsrv_53_ts_vc6.dll extension and still no issues. > Usually on way to understand what's going on is to enable TDSDUMP on > FreeTDS. See http://www.freetds.org/userguide/logging.htm. Unfortunately the production box has a lot of traffic and I'm not able to isolate the log for my particular test script. I'm going to build a mirror server to being able to try with the loggin on Il 12/11/2014 13:04, Frediano Ziglio ha scritto: > 2014-11-12 11:40 GMT+00:00 Simone Magnaschi : >> Good morning to all. >> > Hi Simone, > >> I'm new to the mailing list, I subscribed since we're having issues on a new >> server deployment using FreeTDS. We were using FreeTDS before on a old >> server and everything was fine. >> >> >> So we've got a new server with >> >> * Debian Wheezy 32BIT >> * PHP 5.5.18 >> * FreeTDS 0.91 >> >> This PHP app needs to talk to an old SQL server 2000 server. We used the old >> code from our previous server (PHP 5.2 and older FreeTDS - can't get the >> version unfortunately). We connect to SQL server 2000 through PDO using >> dblib driver. >> >> We're experiencing weird behaviour with the fetch function. Basically if we >> issue a query during a fetch loop on the same pdo connection object, the >> main query gets reset and next fetch call will return false even if there >> are still records to be fetched. >> >> |// PSEUDO CODE >> // Here the main query >> $q = $sql7->query("SELECT TOP 5 * FROM News ORDER BY Data Desc"); >> while ($row = $q->fetch(PDO::FETCH_ASSOC)) { >> // Looping through the results >> echo "

Main query

"; >> print_r($row); >> >> // Issue a query on the same pdo connection >> $subq = $sql7->query("SELECT TOP 1 * FROM News WHERE IDNews = " . >> $row['IDNews'] . " "); >> while ($subResult = $subq->fetch(PDO::FETCH_ASSOC)) { >> echo "

Inner query

"; >> print_r($subResult); >> } >> >> // Here the main query $q->fetch(PDO::FETCH_ASSOC) will answer false on >> the next iteration >> // if we remove the subq, the main query loops just fine >> echo "
"; >> } >> | > With default configuration TDS protocol (defined by Microsoft, not by > us) cannot do two queries at the same time. To do what your pseudo > code do we have to either > - case result of first query; > - use cursors on first query to you free connection; > - use MARS (I don't think actually you can do it and not with dblib for sure!). > > However as James always remember you are probably doing the wrong > thing. Looking at your code I would say why not using a query like > > SELECT TOP 5 * FROM News ORDER BY Data DESC > > as IDNews should probably be unique? Or something like > > SELECT * FROM News WHERE IDNews IN (SELECT TOP 5 IDNews FROM News > ORDER BY Data DESC) > > Filtering double IDs with client. Or using a store procedure that does > all for you? > > Your code actually does 6 queries to server while mine single queries > does only one. Also consider the query caching, locking, network round > trips and so on usually there are better way to do it. > >> Same code on a Windows PHP with pdo_sqlserver driver works just fine. >> > Which driver are you using? > >> It doesn't matter the type of fetch that we pass as argument of fetch >> function. >> >> PHP doesn't throw any warning or error. >> >> I really don't know what's going on here, and I don't know if it's an issue >> of PHP / FreeTDS / DBlib. >> >> Any help would be great! >> >> >> Thanks in advance >> Simone Magnaschi >> > Usually on way to understand what's going on is to enable TDSDUMP on > FreeTDS. See http://www.freetds.org/userguide/logging.htm. > > Regards, > Frediano > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > > -- Simone Magnaschi Rockol s.r.l. - CTO Tel. +39 02.45490556 From simone.magnaschi at rockol.it Wed Nov 12 10:01:49 2014 From: simone.magnaschi at rockol.it (Simone Magnaschi) Date: Wed, 12 Nov 2014 16:01:49 +0100 Subject: [freetds] FreeTds, Dblib, SQl server2000 and the strange case of drop queries In-Reply-To: <5463556A.6000702@rockol.it> References: <54634719.4030101@rockol.it> <5463556A.6000702@rockol.it> Message-ID: <5463765D.8060204@rockol.it> Hi to all, with the help of Stack Overflow, this came up: https://bugs.php.net/bug.php?id=65945 So apparently it was the previous version of PHP (5.3 and before) that were not "compliant" with the actual MSSQL (TDS), DBLIB and FreeTDS behaviour. They buffered the entire recordset during a fetch call rather than fetch a row at a time. By doing this our code was completely valid and working (except for the fact that fetch was a sort of fetchAll behind the curtains). As a side note, now I understand completely why using fetch with large recordset were not a problem using the pdo_sqlserver driver on my windows machine, while triggered the out of memory on the Linux + PHP 5.2 box. Other drivers may behave differently (pdo mysql and pdo sqlserver don't use the one connection - one statement enforcement). So I think that we'll need to refactor all the code where necessary. Simone Il 12/11/2014 13:41, Simone Magnaschi ha scritto: > Hi Frediano, thanks for the extensive reply! >> With default configuration TDS protocol (defined by Microsoft, not by >> us) cannot do two queries at the same time. To do what your pseudo >> code do we have to either > > Uh.. I didn't know that. I'm wondering why the same code was running > fine on the old server. > >> However as James always remember you are probably doing the wrong >> thing. Looking at your code I would say why not using a query like >> Your code actually does 6 queries to server while mine single queries >> does only one. Also consider the query caching, locking, network round >> trips and so on usually there are better way to do it. > > I should have pointed out the fact that the code was there just to > recreate the problem . The real code is actually different and > involves different and nested function calls that from a PDO and > database point of view translate in one or more query issued inside a > fetch loop of a main query. The sub queries may vary based on the > circumstances, so a single query is not always an option for me. In > this particular case btw I could just use a fetchall function and save > everything in a array and then loop through the array and do my thing > on each element (that's what I did to solve the problem in a hurry). > This works fine since - I imagine - there aren't overlapping queries. > > Code refactoring on the whole codebase is an option and, if I cannot > get the problem solved, a necessity. My curiosity and head-scratching > come from the fact that the old linux server (same client code, older > os / freetds version / php version) worked without issues. > > I'll try to get the machine back up to see if I'm missing something on > a conf point of view. > >>> Same code on a Windows PHP with pdo_sqlserver driver works just fine. >>> >> Which driver are you using? >> > > On the windows workstation I'm using the php_pdo_sqlsrv_55_ts.dll > against a SQL SERVER 2008. > I also use a PHP 5.2 version on the same Windows machine with the > php_pdo_sqlsrv_53_ts_vc6.dll extension and still no issues. > >> Usually on way to understand what's going on is to enable TDSDUMP on >> FreeTDS. See http://www.freetds.org/userguide/logging.htm. > Unfortunately the production box has a lot of traffic and I'm not able > to isolate the log for my particular test script. I'm going to build a > mirror server to being able to try with the loggin on > > > > Il 12/11/2014 13:04, Frediano Ziglio ha scritto: >> 2014-11-12 11:40 GMT+00:00 Simone Magnaschi >> : >>> Good morning to all. >>> >> Hi Simone, >> >>> I'm new to the mailing list, I subscribed since we're having issues >>> on a new >>> server deployment using FreeTDS. We were using FreeTDS before on a old >>> server and everything was fine. >>> >>> >>> So we've got a new server with >>> >>> * Debian Wheezy 32BIT >>> * PHP 5.5.18 >>> * FreeTDS 0.91 >>> >>> This PHP app needs to talk to an old SQL server 2000 server. We used >>> the old >>> code from our previous server (PHP 5.2 and older FreeTDS - can't get >>> the >>> version unfortunately). We connect to SQL server 2000 through PDO using >>> dblib driver. >>> >>> We're experiencing weird behaviour with the fetch function. >>> Basically if we >>> issue a query during a fetch loop on the same pdo connection object, >>> the >>> main query gets reset and next fetch call will return false even if >>> there >>> are still records to be fetched. >>> >>> |// PSEUDO CODE >>> // Here the main query >>> $q = $sql7->query("SELECT TOP 5 * FROM News ORDER BY Data Desc"); >>> while ($row = $q->fetch(PDO::FETCH_ASSOC)) { >>> // Looping through the results >>> echo "

Main query

"; >>> print_r($row); >>> >>> // Issue a query on the same pdo connection >>> $subq = $sql7->query("SELECT TOP 1 * FROM News WHERE IDNews = " . >>> $row['IDNews'] . " "); >>> while ($subResult = $subq->fetch(PDO::FETCH_ASSOC)) { >>> echo "

Inner query

"; >>> print_r($subResult); >>> } >>> >>> // Here the main query $q->fetch(PDO::FETCH_ASSOC) will answer >>> false on >>> the next iteration >>> // if we remove the subq, the main query loops just fine >>> echo "
"; >>> } >>> | >> With default configuration TDS protocol (defined by Microsoft, not by >> us) cannot do two queries at the same time. To do what your pseudo >> code do we have to either >> - case result of first query; >> - use cursors on first query to you free connection; >> - use MARS (I don't think actually you can do it and not with dblib >> for sure!). >> >> However as James always remember you are probably doing the wrong >> thing. Looking at your code I would say why not using a query like >> >> SELECT TOP 5 * FROM News ORDER BY Data DESC >> >> as IDNews should probably be unique? Or something like >> >> SELECT * FROM News WHERE IDNews IN (SELECT TOP 5 IDNews FROM News >> ORDER BY Data DESC) >> >> Filtering double IDs with client. Or using a store procedure that does >> all for you? >> >> Your code actually does 6 queries to server while mine single queries >> does only one. Also consider the query caching, locking, network round >> trips and so on usually there are better way to do it. >> >>> Same code on a Windows PHP with pdo_sqlserver driver works just fine. >>> >> Which driver are you using? >> >>> It doesn't matter the type of fetch that we pass as argument of fetch >>> function. >>> >>> PHP doesn't throw any warning or error. >>> >>> I really don't know what's going on here, and I don't know if it's >>> an issue >>> of PHP / FreeTDS / DBlib. >>> >>> Any help would be great! >>> >>> >>> Thanks in advance >>> Simone Magnaschi >>> >> Usually on way to understand what's going on is to enable TDSDUMP on >> FreeTDS. See http://www.freetds.org/userguide/logging.htm. >> >> Regards, >> Frediano >> _______________________________________________ >> FreeTDS mailing list >> FreeTDS at lists.ibiblio.org >> http://lists.ibiblio.org/mailman/listinfo/freetds >> >> > -- Simone Magnaschi Rockol s.r.l. - CTO Tel. +39 02.45490556 From cwthomas at llu.edu Fri Nov 14 02:49:50 2014 From: cwthomas at llu.edu (Thomas, Christopher (LLU)) Date: Fri, 14 Nov 2014 07:49:50 +0000 Subject: [freetds] FreeTds, Dblib, SQl server2000 and the strange case of drop queries In-Reply-To: <5463765D.8060204@rockol.it> References: <54634719.4030101@rockol.it> <5463556A.6000702@rockol.it> <5463765D.8060204@rockol.it> Message-ID: I would prepare a statement and then call fetchAll on the statement. This way you don't have an open recordset that might go away. Since you are only getting the top 5, there shouldn't be too much overhead by fetching all. Chris -----Original Message----- From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Simone Magnaschi Sent: Wednesday, November 12, 2014 7:02 AM To: freetds at lists.ibiblio.org Subject: Re: [freetds] FreeTds, Dblib, SQl server2000 and the strange case of drop queries Hi to all, with the help of Stack Overflow, this came up: https://bugs.php.net/bug.php?id=65945 So apparently it was the previous version of PHP (5.3 and before) that were not "compliant" with the actual MSSQL (TDS), DBLIB and FreeTDS behaviour. They buffered the entire recordset during a fetch call rather than fetch a row at a time. By doing this our code was completely valid and working (except for the fact that fetch was a sort of fetchAll behind the curtains). As a side note, now I understand completely why using fetch with large recordset were not a problem using the pdo_sqlserver driver on my windows machine, while triggered the out of memory on the Linux + PHP 5.2 box. Other drivers may behave differently (pdo mysql and pdo sqlserver don't use the one connection - one statement enforcement). So I think that we'll need to refactor all the code where necessary. Simone Il 12/11/2014 13:41, Simone Magnaschi ha scritto: > Hi Frediano, thanks for the extensive reply! >> With default configuration TDS protocol (defined by Microsoft, not by >> us) cannot do two queries at the same time. To do what your pseudo >> code do we have to either > > Uh.. I didn't know that. I'm wondering why the same code was running > fine on the old server. > >> However as James always remember you are probably doing the wrong >> thing. Looking at your code I would say why not using a query like >> Your code actually does 6 queries to server while mine single queries >> does only one. Also consider the query caching, locking, network >> round trips and so on usually there are better way to do it. > > I should have pointed out the fact that the code was there just to > recreate the problem . The real code is actually different and > involves different and nested function calls that from a PDO and > database point of view translate in one or more query issued inside a > fetch loop of a main query. The sub queries may vary based on the > circumstances, so a single query is not always an option for me. In > this particular case btw I could just use a fetchall function and save > everything in a array and then loop through the array and do my thing > on each element (that's what I did to solve the problem in a hurry). > This works fine since - I imagine - there aren't overlapping queries. > > Code refactoring on the whole codebase is an option and, if I cannot > get the problem solved, a necessity. My curiosity and head-scratching > come from the fact that the old linux server (same client code, older > os / freetds version / php version) worked without issues. > > I'll try to get the machine back up to see if I'm missing something on > a conf point of view. > >>> Same code on a Windows PHP with pdo_sqlserver driver works just fine. >>> >> Which driver are you using? >> > > On the windows workstation I'm using the php_pdo_sqlsrv_55_ts.dll > against a SQL SERVER 2008. > I also use a PHP 5.2 version on the same Windows machine with the > php_pdo_sqlsrv_53_ts_vc6.dll extension and still no issues. > >> Usually on way to understand what's going on is to enable TDSDUMP on >> FreeTDS. See http://www.freetds.org/userguide/logging.htm. > Unfortunately the production box has a lot of traffic and I'm not able > to isolate the log for my particular test script. I'm going to build a > mirror server to being able to try with the loggin on > > > > Il 12/11/2014 13:04, Frediano Ziglio ha scritto: >> 2014-11-12 11:40 GMT+00:00 Simone Magnaschi >> : >>> Good morning to all. >>> >> Hi Simone, >> >>> I'm new to the mailing list, I subscribed since we're having issues >>> on a new server deployment using FreeTDS. We were using FreeTDS >>> before on a old server and everything was fine. >>> >>> >>> So we've got a new server with >>> >>> * Debian Wheezy 32BIT >>> * PHP 5.5.18 >>> * FreeTDS 0.91 >>> >>> This PHP app needs to talk to an old SQL server 2000 server. We used >>> the old code from our previous server (PHP 5.2 and older FreeTDS - >>> can't get the version unfortunately). We connect to SQL server 2000 >>> through PDO using dblib driver. >>> >>> We're experiencing weird behaviour with the fetch function. >>> Basically if we >>> issue a query during a fetch loop on the same pdo connection object, >>> the main query gets reset and next fetch call will return false even >>> if there are still records to be fetched. >>> >>> |// PSEUDO CODE >>> // Here the main query >>> $q = $sql7->query("SELECT TOP 5 * FROM News ORDER BY Data Desc"); >>> while ($row = $q->fetch(PDO::FETCH_ASSOC)) { >>> // Looping through the results >>> echo "

Main query

"; >>> print_r($row); >>> >>> // Issue a query on the same pdo connection >>> $subq = $sql7->query("SELECT TOP 1 * FROM News WHERE IDNews = " . >>> $row['IDNews'] . " "); >>> while ($subResult = $subq->fetch(PDO::FETCH_ASSOC)) { >>> echo "

Inner query

"; >>> print_r($subResult); >>> } >>> >>> // Here the main query $q->fetch(PDO::FETCH_ASSOC) will answer >>> false on the next iteration >>> // if we remove the subq, the main query loops just fine >>> echo "
"; >>> } >>> | >> With default configuration TDS protocol (defined by Microsoft, not by >> us) cannot do two queries at the same time. To do what your pseudo >> code do we have to either >> - case result of first query; >> - use cursors on first query to you free connection; >> - use MARS (I don't think actually you can do it and not with dblib >> for sure!). >> >> However as James always remember you are probably doing the wrong >> thing. Looking at your code I would say why not using a query like >> >> SELECT TOP 5 * FROM News ORDER BY Data DESC >> >> as IDNews should probably be unique? Or something like >> >> SELECT * FROM News WHERE IDNews IN (SELECT TOP 5 IDNews FROM News >> ORDER BY Data DESC) >> >> Filtering double IDs with client. Or using a store procedure that >> does all for you? >> >> Your code actually does 6 queries to server while mine single queries >> does only one. Also consider the query caching, locking, network >> round trips and so on usually there are better way to do it. >> >>> Same code on a Windows PHP with pdo_sqlserver driver works just fine. >>> >> Which driver are you using? >> >>> It doesn't matter the type of fetch that we pass as argument of >>> fetch function. >>> >>> PHP doesn't throw any warning or error. >>> >>> I really don't know what's going on here, and I don't know if it's >>> an issue of PHP / FreeTDS / DBlib. >>> >>> Any help would be great! >>> >>> >>> Thanks in advance >>> Simone Magnaschi >>> >> Usually on way to understand what's going on is to enable TDSDUMP on >> FreeTDS. See http://www.freetds.org/userguide/logging.htm. >> >> Regards, >> Frediano >> _______________________________________________ >> FreeTDS mailing list >> FreeTDS at lists.ibiblio.org >> http://lists.ibiblio.org/mailman/listinfo/freetds >> >> > -- Simone Magnaschi Rockol s.r.l. - CTO Tel. +39 02.45490556 _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds From Heiner.Schulz-Hildebrandt at ppimedia.de Fri Nov 14 08:27:56 2014 From: Heiner.Schulz-Hildebrandt at ppimedia.de (Schulz-Hildebrandt, Heiner) Date: Fri, 14 Nov 2014 14:27:56 +0100 Subject: [freetds] ct-lib bulkcopy rowlevel locking Message-ID: Hello, I am using freetds (0.91.102) ct-lib (64 Bit) on MAC OSX 10.8 and MAC OSX 10.6.8 with Sybase 15.x server and row-level-locking scheme (on table: my_table) When I try to insert data into this table with bulk copy, I received the message: ------------------------------------------- Msg 4845, Level 16, State 1 Server MY_SERVER,Bulk copy failed. Client does not have the capability to bulk copy into the data-only locked table 'my_table'. ------------------------------------------- and the command is aborted. What can I do? Thanks to anyone willing to help in any way. ________________________________ +++ ?ber 5.000 Ausgaben t?glich +++ Mehr als 100 Medienh?user weltweit produzieren t?glich Zeitungen und digitale Angebote mit ppi Media L?sungen +++ Over 5,000 editions daily +++ More than 100 media companies worldwide produce newspapers and digital products with ppi Media's solutions. From manus at eiffel.com Sat Nov 15 04:33:12 2014 From: manus at eiffel.com (Emmanuel Stapf) Date: Sat, 15 Nov 2014 10:33:12 +0100 Subject: [freetds] Issue with SQLDescribeCol Message-ID: <003901d000b7$2e4874e0$8ad95ea0$@eiffel.com> Hi, I've recently been testing the EiffelStore binding to ODBC against a MSSQL database. For that I'm using unixODBC and freetds. However our code does not work due to the fact that when calling SQLDescribeCol with almost no arguments to get the length of the column name it does not return anything. The code we have looks like: rc = SQLDescribeCol(hstmt, (SQLSMALLINT) index, NULL, 0, &indColName, NULL, NULL, NULL, NULL); I looked at the code of SQLDescribeCol and found that in very old versions it would update indColName and in the latest version although there is a comment at line 2009 of odbc.c that says: /* cbColNameMax can be 0 (to retrieve name length) */ but nothing to that effect. Actually if you look at the following diff: https://gitorious.org/freetds/freetds/commit/5508af66b79f1c6dee70d86f9c673e8b9b1b24ed you see that the code that used to update pcbColName has disappeared from the current version. Am I missing something? Thanks, Manu ------------------------------------------------------------------------ Eiffel Software 805-685-1006 http://www.eiffel.com Customer support: http://support.eiffel.com User group: http://groups.eiffel.com/join ------------------------------------------------------------------------ From freddy77 at gmail.com Sun Nov 16 04:33:15 2014 From: freddy77 at gmail.com (Frediano Ziglio) Date: Sun, 16 Nov 2014 09:33:15 +0000 Subject: [freetds] Issue with SQLDescribeCol In-Reply-To: <003901d000b7$2e4874e0$8ad95ea0$@eiffel.com> References: <003901d000b7$2e4874e0$8ad95ea0$@eiffel.com> Message-ID: 2014-11-15 9:33 GMT+00:00 Emmanuel Stapf : > Hi, > > I've recently been testing the EiffelStore binding to ODBC against a MSSQL database. For > that I'm using unixODBC and freetds. However our code does not work due to the fact that > when calling SQLDescribeCol with almost no arguments to get the length of the column name > it does not return anything. > > The code we have looks like: > > rc = SQLDescribeCol(hstmt, (SQLSMALLINT) index, NULL, 0, &indColName, NULL, NULL, NULL, > NULL); > > I looked at the code of SQLDescribeCol and found that in very old versions it would update > indColName and in the latest version although there is a comment at line 2009 of odbc.c > that says: > > /* cbColNameMax can be 0 (to retrieve name length) */ > > but nothing to that effect. Actually if you look at the following diff: > > https://gitorious.org/freetds/freetds/commit/5508af66b79f1c6dee70d86f9c673e8b9b1b24ed > > you see that the code that used to update pcbColName has disappeared from the current > version. > > Am I missing something? > > Thanks, > Manu > Was not tested/implemented correctly Test: https://gitorious.org/freetds/freetds/commit/a3639342271313e32dca198e1fe065d534f67b61 Fix: https://gitorious.org/freetds/freetds/commit/167db70e5183ab7fd25ad1916d669ca49b62199b Backported to branch 0.91 too. Regards, Frediano From manus at eiffel.com Mon Nov 17 03:07:43 2014 From: manus at eiffel.com (Emmanuel Stapf) Date: Mon, 17 Nov 2014 09:07:43 +0100 Subject: [freetds] Issue with SQLDescribeCol In-Reply-To: References: <003901d000b7$2e4874e0$8ad95ea0$@eiffel.com> Message-ID: <000001d0023d$919eabe0$b4dc03a0$@eiffel.com> Great. Thanks, Manu > -----Original Message----- > From: Frediano Ziglio [mailto:freddy77 at gmail.com] > Sent: Sunday, November 16, 2014 10:33 > To: manus at eiffel.com; FreeTDS Development Group > Subject: Re: [freetds] Issue with SQLDescribeCol > > 2014-11-15 9:33 GMT+00:00 Emmanuel Stapf : > > Hi, > > > > I've recently been testing the EiffelStore binding to ODBC against a > > MSSQL database. For that I'm using unixODBC and freetds. However our > > code does not work due to the fact that when calling SQLDescribeCol > > with almost no arguments to get the length of the column name it does not > return anything. > > > > The code we have looks like: > > > > rc = SQLDescribeCol(hstmt, (SQLSMALLINT) index, NULL, 0, > > &indColName, NULL, NULL, NULL, NULL); > > > > I looked at the code of SQLDescribeCol and found that in very old > > versions it would update indColName and in the latest version although > > there is a comment at line 2009 of odbc.c that says: > > > > /* cbColNameMax can be 0 (to retrieve name length) */ > > > > but nothing to that effect. Actually if you look at the following diff: > > > > https://gitorious.org/freetds/freetds/commit/5508af66b79f1c6dee70d86f9 > > c673e8b9b1b24ed > > > > you see that the code that used to update pcbColName has disappeared > > from the current version. > > > > Am I missing something? > > > > Thanks, > > Manu > > > > Was not tested/implemented correctly > > Test: > https://gitorious.org/freetds/freetds/commit/a3639342271313e32dca198e1fe065d534f > 67b61 > Fix: > https://gitorious.org/freetds/freetds/commit/167db70e5183ab7fd25ad1916d669ca49b6 > 2199b > > Backported to branch 0.91 too. > > Regards, > Frediano From craigberry at mac.com Thu Nov 20 14:53:40 2014 From: craigberry at mac.com (Craig A. Berry) Date: Thu, 20 Nov 2014 13:53:40 -0600 Subject: [freetds] bp with empty char/varchar column broken Message-ID: <2D7AEB19-038B-427C-B5F6-40BB7A389CE7@mac.com> The following worked in 0.91 but is broken as of branch-0_92-839-gd788046. If we bulk out a table with an empty (but not NULL) char or varchar column that is less than 256 bytes long, 256 spaces get written to the output file for that column. Which then causes an overflow error if you try to bulk it back in. I think it was e30a807 that broke it because in src/dblib/bcp.c:_bcp_exec_out we now pass a minimum of 256 as the destlen argument to dbconvert. We used to pass -2, instructing dbconvert to null terminate without copying anything. I'm not sure what the correct fix is. We could possibly pass the lesser of source length and destination length to dbconvert in _bcp_exec_out. Here's a reproducer: $ ./fisql/fisql -Smyserver -Utest Password: Changed database context to 'master'. Changed language setting to us_english. 1>> use tempdb 2>> go Changed database context to 'tempdb'. 1>> create table testbcp (tmpval varchar(10)) 2>> go 1>> insert into testbcp values ('abc') 2>> go (1 rows affected) 1>> insert into testbcp values ('') 2>> go (1 rows affected) 1>> exit $ ./freebcp tempdb.dbo.testbcp out tmp.bcp -Smyserver -Utest -P***** -c Starting copy... 2 rows copied. $ perl -nle 'print length($_);' < tmp.bcp 3 256 $ ./freebcp tempdb.dbo.testbcp in tmp.bcp -Smyserver -Utest -P***** -c Starting copy... Msg 20049, Level 4 Data conversion resulted in overflow 1 rows copied. ________________________________________ Craig A. Berry mailto:craigberry at mac.com "... getting out of a sonnet is much more difficult than getting in." Brad Leithauser From craigberry at mac.com Thu Nov 20 21:20:31 2014 From: craigberry at mac.com (Craig A. Berry) Date: Thu, 20 Nov 2014 20:20:31 -0600 Subject: [freetds] bcp with empty char/varchar column broken In-Reply-To: <2D7AEB19-038B-427C-B5F6-40BB7A389CE7@mac.com> References: <2D7AEB19-038B-427C-B5F6-40BB7A389CE7@mac.com> Message-ID: I've here attached a patch that fixes this and causes no new test failures. Also inline below for readability. It isn't exactly pretty but it at least highlights exactly where the problem is. From f53104f5264416bee462fd05b9a1e683da0133b8 Mon Sep 17 00:00:00 2001 From: "Craig A. Berry" Date: Thu, 20 Nov 2014 14:54:59 -0600 Subject: [PATCH] Avoid padding to 256 bytes on bcp out of char/varchar. Since e30a807 we're not tracking lengths column by column when we bulk out but are instead using at least the full length of the 256-byte buffer. For char and varchar columns less that 256 bytes long, they get too much padding which then can't be bulked back in without overflow error. This commit changes that so the maximum amount of padding we'll do is the declared size of the column on the server. --- src/dblib/bcp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/dblib/bcp.c b/src/dblib/bcp.c index dadffea..49c4a7e 100644 --- a/src/dblib/bcp.c +++ b/src/dblib/bcp.c @@ -892,6 +892,12 @@ _bcp_exec_out(DBPROCESS * dbproc, DBINT * rows_copied) buflen = (int)tds_strftime((TDS_CHAR *)data, 256, bcpdatefmt, &when, 3); } else { + TDS_INT destlen = datalen; + if (datalen > curcol->on_server.column_size + && (curcol->column_type == SYBVARCHAR + || curcol->column_type == SYBCHAR)) { + destlen = curcol->on_server.column_size; + } /* * For null columns, the above work to determine the output buffer size is moot, * because bcpcol->data_size is zero, so dbconvert() won't write anything, @@ -899,7 +905,7 @@ _bcp_exec_out(DBPROCESS * dbproc, DBINT * rows_copied) */ /* TODO check for text !!! */ buflen = dbconvert(dbproc, srctype, src, srclen, hostcol->datatype, - data, datalen); + data, destlen); /* * Special case: When outputting database varchar data * (either varchar or nullable char) dbconvert may have -- 1.8.4.2 > On Nov 20, 2014, at 1:53 PM, Craig A. Berry wrote: > > The following worked in 0.91 but is broken as of branch-0_92-839-gd788046. If we bulk out a table with an empty (but not NULL) char or varchar column that is less than 256 bytes long, 256 spaces get written to the output file for that column. Which then causes an overflow error if you try to bulk it back in. > > I think it was e30a807 that broke it because in src/dblib/bcp.c:_bcp_exec_out we now pass a minimum of 256 as the destlen argument to dbconvert. We used to pass -2, instructing dbconvert to null terminate without copying anything. > > I'm not sure what the correct fix is. We could possibly pass the lesser of source length and destination length to dbconvert in _bcp_exec_out. > > Here's a reproducer: > > $ ./fisql/fisql -Smyserver -Utest > Password: > Changed database context to 'master'. > Changed language setting to us_english. > 1>> use tempdb > 2>> go > Changed database context to 'tempdb'. > 1>> create table testbcp (tmpval varchar(10)) > 2>> go > 1>> insert into testbcp values ('abc') > 2>> go > (1 rows affected) > 1>> insert into testbcp values ('') > 2>> go > (1 rows affected) > 1>> exit > $ ./freebcp tempdb.dbo.testbcp out tmp.bcp -Smyserver -Utest -P***** -c > > Starting copy... > 2 rows copied. > $ perl -nle 'print length($_);' < tmp.bcp > 3 > 256 > $ ./freebcp tempdb.dbo.testbcp in tmp.bcp -Smyserver -Utest -P***** -c > > Starting copy... > Msg 20049, Level 4 > Data conversion resulted in overflow > > 1 rows copied. > > ________________________________________ > Craig A. Berry > mailto:craigberry at mac.com > > "... getting out of a sonnet is much more > difficult than getting in." > Brad Leithauser > ________________________________________ Craig A. Berry mailto:craigberry at mac.com "... getting out of a sonnet is much more difficult than getting in." Brad Leithauser -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Avoid-padding-to-256-bytes-on-bcp-out-of-char-varcha.patch Type: application/octet-stream Size: 1828 bytes Desc: not available URL: From freddy77 at gmail.com Fri Nov 21 06:58:07 2014 From: freddy77 at gmail.com (Frediano Ziglio) Date: Fri, 21 Nov 2014 11:58:07 +0000 Subject: [freetds] bp with empty char/varchar column broken In-Reply-To: <2D7AEB19-038B-427C-B5F6-40BB7A389CE7@mac.com> References: <2D7AEB19-038B-427C-B5F6-40BB7A389CE7@mac.com> Message-ID: 2014-11-20 19:53 GMT+00:00 Craig A. Berry : > The following worked in 0.91 but is broken as of branch-0_92-839-gd788046. If we bulk out a table with an empty (but not NULL) char or varchar column that is less than 256 bytes long, 256 spaces get written to the output file for that column. Which then causes an overflow error if you try to bulk it back in. > > I think it was e30a807 that broke it because in src/dblib/bcp.c:_bcp_exec_out we now pass a minimum of 256 as the destlen argument to dbconvert. We used to pass -2, instructing dbconvert to null terminate without copying anything. > > I'm not sure what the correct fix is. We could possibly pass the lesser of source length and destination length to dbconvert in _bcp_exec_out. > Quite strange. Why does it happen only for empty strings? Should even happen with small ones. The function has to pad or not based on type. Actually is not clear to me what an empty column should look like in the text bcp file. Frediano > Here's a reproducer: > > $ ./fisql/fisql -Smyserver -Utest > Password: > Changed database context to 'master'. > Changed language setting to us_english. > 1>> use tempdb > 2>> go > Changed database context to 'tempdb'. > 1>> create table testbcp (tmpval varchar(10)) > 2>> go > 1>> insert into testbcp values ('abc') > 2>> go > (1 rows affected) > 1>> insert into testbcp values ('') > 2>> go > (1 rows affected) > 1>> exit > $ ./freebcp tempdb.dbo.testbcp out tmp.bcp -Smyserver -Utest -P***** -c > > Starting copy... > 2 rows copied. > $ perl -nle 'print length($_);' < tmp.bcp > 3 > 256 > $ ./freebcp tempdb.dbo.testbcp in tmp.bcp -Smyserver -Utest -P***** -c > > Starting copy... > Msg 20049, Level 4 > Data conversion resulted in overflow > > 1 rows copied. > > ________________________________________ > Craig A. Berry > mailto:craigberry at mac.com > > "... getting out of a sonnet is much more > difficult than getting in." > Brad Leithauser > > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds From craigberry at mac.com Fri Nov 21 10:43:43 2014 From: craigberry at mac.com (Craig A. Berry) Date: Fri, 21 Nov 2014 09:43:43 -0600 Subject: [freetds] bp with empty char/varchar column broken In-Reply-To: References: <2D7AEB19-038B-427C-B5F6-40BB7A389CE7@mac.com> Message-ID: <2FE95B42-7EA0-47EB-9D65-056C16C470CC@mac.com> > On Nov 21, 2014, at 5:58 AM, Frediano Ziglio wrote: > > 2014-11-20 19:53 GMT+00:00 Craig A. Berry : >> The following worked in 0.91 but is broken as of branch-0_92-839-gd788046. If we bulk out a table with an empty (but not NULL) char or varchar column that is less than 256 bytes long, 256 spaces get written to the output file for that column. Which then causes an overflow error if you try to bulk it back in. > > Quite strange. Why does it happen only for empty strings? Should even > happen with small ones. The function has to pad or not based on type. The actual length of the string received on the wire is passed as the source length to dbconvert, and dbconvert (usually) uses that as its return value, and that return value is passed to fwrite for moving data to the file. But if the source length is zero, dbconvert uses the destination length as its return value as long as the destination length is greater than zero. Since it's now always 256, we get 256 spaces. > Actually is not clear to me what an empty column should look like in > the text bcp file. I'm pretty sure a zero-length column in a bcp file indicates NULL, and one or more spaces indicates empty string and will be trimmed on bulk in. ________________________________________ Craig A. Berry mailto:craigberry at mac.com "... getting out of a sonnet is much more difficult than getting in." Brad Leithauser From ACoccimiglio at OLG.CA Wed Dec 3 11:30:55 2014 From: ACoccimiglio at OLG.CA (Angelo Coccimiglio) Date: Wed, 3 Dec 2014 11:30:55 -0500 Subject: [freetds] bcp_done always returns error if no data was inserted Message-ID: Hello, I'm new to freetds... running version FREETDS-0_91 Whenever an attempt to bcp data within a C program and there are no records the bcp_done routine returns -1 indicating an error... If there are records available to bcp works fine.. Is there anything I should be looking for or setting up.. Here is part of the log wher bcp_done is called 1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.TDS]UTIL.C;1:156:Changed query state from PENDING to DEAD $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:326:dblib_release_tds_ctx(1) $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:6321:dbfreebuf(5DD490) $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:4984:dberrhandle(0) $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:4984:dberrhandle(0) $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:5003:dbmsghandle(0) $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:5003:dbmsghandle(180298) $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:1689:dbresults(5B9F40) $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:1695:dbresults: dbresults_state is 3 (_DB_RES_NEXT_RESULT) $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.TDS]TOKEN.C;1:540:tds_process_tokens(5BA7A0, 7ACFBA58, 7ACFBA50, 0x6914) $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.TDS]TOKEN.C;1:543:tds_process_tokens() state is COMPLETED $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:1716:dbresults() tds_process_tokens returned 2 (TDS_NO_MORE_RE? result_type TDS_DONE_RESULT $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:1678:dbresults returning 2 (NO_MORE_RESULTS) $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]BCP.C;3:2251:bcp_done(5C5E00) $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.TDS]BULK.C;1:886:tds_bcp_done(5C6620, 7ACFBA50) $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.TDS]NET.C;1:741:Sending packet 0000 0f 01 00 08 00 00 00 00- |........| thanks Angelo Coccimiglio From cramm0 at gmail.com Sun Nov 23 13:31:23 2014 From: cramm0 at gmail.com (Ramiro Morales) Date: Sun, 23 Nov 2014 15:31:23 -0300 Subject: [freetds] VARCHAR(max) in SP output params with TDS>=7.2 and rpc API Message-ID: Hi all, I've found FreeTDS master can't handle the new in TDS 7.2 ability to handle values longer than 8000 chars. I've opened a merge request which adds tests that show the failure: https://gitorious.org/freetds/freetds/merge_requests/32 I tried to modify the RPC parameter handling rpc API code to get this working by following what can be read at http://www.freetds.org/tds.html#login7 ('Types' sub-section): There is a call-out in that table for the XSYBVARBINARY, XSYBVARCHAR and XSYBNVARCHAR data types that reads: "* Under TDS 7.2+ these types allow size to be -1, representing varchar(max), varbinary(max) and nvarchar(max)." Unfortuately my attemps were unsuccessful. I suspect what is described there doesn't apply to the RPC SP API. Any hints on how these data types need to be represented on the wire are welcome. I'd be willing to try to implement the required changes. Regards, PS: My use case is about output parameters, but it's possible input ones also need work. See https://github.com/pymssql/pymssql/issues/275 -- Ramiro Morales @ramiromorales From sf at 4js.com Wed Dec 3 07:00:23 2014 From: sf at 4js.com (Sebastien FLAESCH) Date: Wed, 03 Dec 2014 13:00:23 +0100 Subject: [freetds] Memory leak with 0.92.556 in SQLDescribeCol() Message-ID: <547EFB57.5090005@4js.com> Hi, I experience a memory with SQLDescribeCol() or SQLNumResultCols(), when using 0.92.556. Wanted to test a more recent version... Can someone point me to the instructions to download FreeTDS dev version? When I take the sources from https://gitorious.org/freetds/freetds, there is no configure script. The INSTALL file contains instructions to use configure... what am I doing wrong? Why is the www.freetds.org still showing an old "current" download link (0.92.377)? Seb From freddy77 at gmail.com Thu Dec 4 05:19:37 2014 From: freddy77 at gmail.com (Frediano Ziglio) Date: Thu, 4 Dec 2014 10:19:37 +0000 Subject: [freetds] VARCHAR(max) in SP output params with TDS>=7.2 and rpc API In-Reply-To: References: Message-ID: 2014-11-23 18:31 GMT+00:00 Ramiro Morales : > Hi all, > > I've found FreeTDS master can't handle the new in TDS 7.2 ability to > handle values longer than 8000 chars. > > I've opened a merge request which adds tests that show the failure: > > https://gitorious.org/freetds/freetds/merge_requests/32 > I saw the request. However tests should work with every version of Sybase/MSSQL > I tried to modify the RPC parameter handling rpc API code to get this > working by following what can be read at > http://www.freetds.org/tds.html#login7 ('Types' sub-section): > > There is a call-out in that table for the XSYBVARBINARY, XSYBVARCHAR > and XSYBNVARCHAR data types that reads: > > "* Under TDS 7.2+ these types allow size to be -1, representing > varchar(max), varbinary(max) and nvarchar(max)." > This is true for protocol however I wouldn't use -1 as maxlen in dbrpcparam call. maxlen define the buffer length for the pointer too. I personally would pass the buffer byte length and if does not fit into a normal (N)VARCHAR a (N)VARCHAR(MAX) should be used automatically. > Unfortuately my attemps were unsuccessful. I suspect what is described > there doesn't apply to the RPC SP API. > > Any hints on how these data types need to be represented on the wire > are welcome. I'd be willing to try to implement the required changes. > > Regards, > > PS: My use case is about output parameters, but it's possible input > ones also need work. See https://github.com/pymssql/pymssql/issues/275 > > -- > Ramiro Morales > @ramiromorales Frediano From craigberry at mac.com Thu Dec 4 09:35:39 2014 From: craigberry at mac.com (Craig A. Berry) Date: Thu, 04 Dec 2014 08:35:39 -0600 Subject: [freetds] Memory leak with 0.92.556 in SQLDescribeCol() In-Reply-To: <547EFB57.5090005@4js.com> References: <547EFB57.5090005@4js.com> Message-ID: > On Dec 3, 2014, at 6:00 AM, Sebastien FLAESCH wrote: > > Can someone point me to the instructions to download FreeTDS dev version? > > When I take the sources from https://gitorious.org/freetds/freetds, there is no configure script. > > The INSTALL file contains instructions to use configure... what am I doing wrong? You have to be on a Unix or Unix-like system with recent autotools installed and run autogen.sh in a git checkout of the current source. If all goes well, you should get a configure script. If all does not go well, you may be building autotools from scratch, which is a rather unpleasant bare knuckle experience for those of us unaccustomed to such things. Actually you don't have to be using git as you can get a tarball of the latest source at any time from this link: However, you do have to have autotools. > Why is the www.freetds.org still showing an old "current" download link (0.92.377)? The nightly snapshots have not worked reliably for years and there is an aversion to putting generated files under version control. The script for generating snapshots was posted to the list once with suggestions for improvement solicited but I don't think there were any takers. ________________________________________ Craig A. Berry mailto:craigberry at mac.com "... getting out of a sonnet is much more difficult than getting in." Brad Leithauser From sf at 4js.com Thu Dec 4 11:05:07 2014 From: sf at 4js.com (Sebastien FLAESCH) Date: Thu, 04 Dec 2014 17:05:07 +0100 Subject: [freetds] Memory leak with 0.92.556 in SQLDescribeCol() In-Reply-To: References: <547EFB57.5090005@4js.com> Message-ID: <54808633.4050907@4js.com> Thanks a lot Craig for your answer. 2 simple remarks: A) Why is there no instruction in the INSTALL file about autogen.sh? "Brief Instructions" just shows: $ ./configure --help $ ./configure $ make $ make install Everyone new to freetds will run these commands and face the same probs as me. B) Regarding the "current" version available on www.freetds.org, why is this left as is? Can anyone modify these pages? Just point to the git repository! I must be missing something, because all of this sounds obvious and I would wonder that nobody changed it already if it was so simple. Seb On 12/04/2014 03:35 PM, Craig A. Berry wrote: > >> On Dec 3, 2014, at 6:00 AM, Sebastien FLAESCH wrote: >> >> Can someone point me to the instructions to download FreeTDS dev version? >> >> When I take the sources from https://gitorious.org/freetds/freetds, there is no configure script. >> >> The INSTALL file contains instructions to use configure... what am I doing wrong? > > You have to be on a Unix or Unix-like system with recent autotools installed and run autogen.sh in a git checkout of the current source. If all goes well, you should get a configure script. If all does not go well, you may be building autotools from scratch, which is a rather unpleasant bare knuckle experience for those of us unaccustomed to such things. > > Actually you don't have to be using git as you can get a tarball of the latest source at any time from this link: > > > > However, you do have to have autotools. > >> Why is the www.freetds.org still showing an old "current" download link (0.92.377)? > > The nightly snapshots have not worked reliably for years and there is an aversion to putting generated files under version control. The script for generating snapshots was posted to the list once with suggestions for improvement solicited but I don't think there were any takers. > > ________________________________________ > Craig A. Berry > mailto:craigberry at mac.com > > "... getting out of a sonnet is much more > difficult than getting in." > Brad Leithauser > > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > From craigberry at mac.com Thu Dec 4 23:14:47 2014 From: craigberry at mac.com (Craig A. Berry) Date: Thu, 04 Dec 2014 22:14:47 -0600 Subject: [freetds] bcp_done always returns error if no data was inserted In-Reply-To: References: Message-ID: <33309037-860A-4368-8AE7-059BE6B23518@mac.com> > On Dec 3, 2014, at 10:30 AM, Angelo Coccimiglio wrote: > > Hello, > > I'm new to freetds... running version FREETDS-0_91 Try 0.92 and see if there's any difference. > Whenever an attempt to bcp data within a C program and there are no > records > the bcp_done routine returns -1 indicating an error... If there are > records > available to bcp works fine.. I haven't been able to find any documentation indicating what bcp_done should do if there are no records. There's quite likely an oversight for that case in the FreeTDS library but if there's any chance you could try your code with a Microsoft or Sybase library and confirm it works there that would help. Or post a small reproducer. > > Is there anything I should be looking for or setting up.. > Here is part of the log wher bcp_done is called > > 1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.TDS]UTIL.C;1:156:Changed > query state from PENDING to DEAD > $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:326:dblib_release_tds_ctx(1) > $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:6321:dbfreebuf(5DD490) > $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:4984:dberrhandle(0) > $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:4984:dberrhandle(0) > $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:5003:dbmsghandle(0) > $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:5003:dbmsghandle(180298) > $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:1689:dbresults(5B9F40) > $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:1695:dbresults: > dbresults_state is 3 (_DB_RES_NEXT_RESULT) > $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.TDS]TOKEN.C;1:540:tds_process_tokens(5BA7A0, > 7ACFBA58, 7ACFBA50, 0x6914) > $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.TDS]TOKEN.C;1:543:tds_process_tokens() > state is COMPLETED > $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:1716:dbresults() > tds_process_tokens returned 2 (TDS_NO_MORE_RE? > result_type TDS_DONE_RESULT > $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:1678:dbresults > returning 2 (NO_MORE_RESULTS) > $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]BCP.C;3:2251:bcp_done(5C5E00) > $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.TDS]BULK.C;1:886:tds_bcp_done(5C6620, > 7ACFBA50) > $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.TDS]NET.C;1:741:Sending > packet > 0000 0f 01 00 08 00 00 00 00- |........| > > > thanks > > Angelo Coccimiglio > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds ________________________________________ Craig A. Berry mailto:craigberry at mac.com "... getting out of a sonnet is much more difficult than getting in." Brad Leithauser From sf at 4js.com Fri Dec 5 03:58:39 2014 From: sf at 4js.com (Sebastien FLAESCH) Date: Fri, 05 Dec 2014 09:58:39 +0100 Subject: [freetds] Memory leak with 0.92.556 in SQLDescribeCol() In-Reply-To: References: <547EFB57.5090005@4js.com> Message-ID: <548173BF.3010902@4js.com> Hello, $ uname -a Linux orion 3.14-1-amd64 #1 SMP Debian 3.14.4-1 (2014-05-13) x86_64 GNU/Linux $ cat /etc/debian_version jessie/sid $ tar xvzf freetds-freetds-d78804636aef4562966e89a8d57aec7bea98cc3b.tar.gz freetds-freetds/.. ... $ autoconf --version autoconf (GNU Autoconf) 2.69 Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+/Autoconf: GNU GPL version 3 or later , This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by David J. MacKenzie and Akim Demaille. $ ./autogen.sh running /usr/bin/autoreconf in /opt3/dbs/tds/freetds-freetds: src/ctlib/Makefile.am:5: error: Libtool library used but 'LIBTOOL' is undefined src/ctlib/Makefile.am:5: The usual way to define 'LIBTOOL' is to add 'LT_INIT' src/ctlib/Makefile.am:5: to 'configure.ac' and run 'aclocal' and 'autoconf' again. src/ctlib/Makefile.am:5: If 'LT_INIT' is in 'configure.ac', make sure src/ctlib/Makefile.am:5: its definition is in aclocal's search path. src/ctlib/Makefile.am:9: warning: source file '../../win32/initnet.c' is in a subdirectory, src/ctlib/Makefile.am:9: but option 'subdir-objects' is disabled automake: warning: possible forward-incompatibility. automake: At least a source file is in a subdirectory, but the 'subdir-objects' automake: automake option hasn't been enabled. For now, the corresponding output automake: object file(s) will be placed in the top-level directory. However, automake: this behaviour will change in future Automake versions: they will automake: unconditionally cause object files to be placed in the same subdirectory automake: of the corresponding sources. ... What I am doing wrong? Seb On 12/04/2014 03:35 PM, Craig A. Berry wrote: > >> On Dec 3, 2014, at 6:00 AM, Sebastien FLAESCH wrote: >> >> Can someone point me to the instructions to download FreeTDS dev version? >> >> When I take the sources from https://gitorious.org/freetds/freetds, there is no configure script. >> >> The INSTALL file contains instructions to use configure... what am I doing wrong? > > You have to be on a Unix or Unix-like system with recent autotools installed and run autogen.sh in a git checkout of the current source. If all goes well, you should get a configure script. If all does not go well, you may be building autotools from scratch, which is a rather unpleasant bare knuckle experience for those of us unaccustomed to such things. > > Actually you don't have to be using git as you can get a tarball of the latest source at any time from this link: > > > > However, you do have to have autotools. > >> Why is the www.freetds.org still showing an old "current" download link (0.92.377)? > > The nightly snapshots have not worked reliably for years and there is an aversion to putting generated files under version control. The script for generating snapshots was posted to the list once with suggestions for improvement solicited but I don't think there were any takers. > > ________________________________________ > Craig A. Berry > mailto:craigberry at mac.com > > "... getting out of a sonnet is much more > difficult than getting in." > Brad Leithauser > > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > From ACoccimiglio at OLG.CA Fri Dec 5 08:37:46 2014 From: ACoccimiglio at OLG.CA (Angelo Coccimiglio) Date: Fri, 5 Dec 2014 08:37:46 -0500 Subject: [freetds] bcp_done always returns error if no data was inserted In-Reply-To: <33309037-860A-4368-8AE7-059BE6B23518@mac.com> References: <33309037-860A-4368-8AE7-059BE6B23518@mac.com> Message-ID: Further investigation I found an example in the distribution of FreeTDS that shows the way to handle no records being bcp'd Before calling bcp_done you determine if any rows were processed if none do not execute the bcp_done command Forgot to mention that we are using SYBASE.and it does work with no records being processed.. I will look into version 0.92 Thanks Example Found: $1$DGA1802:[FREETDS-0_91.SRC.APPS]DATACOPY.C if (rows_read) { gettimeofday(&batch_start, 0); ret = bcp_done(dbdest); gettimeofday(&batch_end, 0); elapsed_batch = elapsed_batch + ((double) (batch_end.tv_sec - batch_start.tv_sec) + ((double) (batch_end.tv_usec - batch_start.tv_usec) / 1000000.00) ); if (ret == -1) { fprintf(stderr, "bcp_done failed. \n"); return FALSE; } else { rows_done += ret; } } Angelo Coccimiglio From: "Craig A. Berry" To: FreeTDS Development Group , Date: 12/05/2014 04:17 AM Subject: Re: [freetds] bcp_done always returns error if no data was inserted Sent by: "FreeTDS" > On Dec 3, 2014, at 10:30 AM, Angelo Coccimiglio wrote: > > Hello, > > I'm new to freetds... running version FREETDS-0_91 Try 0.92 and see if there's any difference. > Whenever an attempt to bcp data within a C program and there are no > records > the bcp_done routine returns -1 indicating an error... If there are > records > available to bcp works fine.. I haven't been able to find any documentation indicating what bcp_done should do if there are no records. There's quite likely an oversight for that case in the FreeTDS library but if there's any chance you could try your code with a Microsoft or Sybase library and confirm it works there that would help. Or post a small reproducer. > > Is there anything I should be looking for or setting up.. > Here is part of the log wher bcp_done is called > > 1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.TDS]UTIL.C;1:156:Changed > query state from PENDING to DEAD > $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:326:dblib_release_tds_ctx(1) > $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:6321:dbfreebuf(5DD490) > $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:4984:dberrhandle(0) > $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:4984:dberrhandle(0) > $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:5003:dbmsghandle(0) > $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:5003:dbmsghandle(180298) > $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:1689:dbresults(5B9F40) > $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:1695:dbresults: > dbresults_state is 3 (_DB_RES_NEXT_RESULT) > $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.TDS]TOKEN.C;1:540:tds_process_tokens(5BA7A0, > 7ACFBA58, 7ACFBA50, 0x6914) > $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.TDS]TOKEN.C;1:543:tds_process_tokens() > state is COMPLETED > $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:1716:dbresults() > tds_process_tokens returned 2 (TDS_NO_MORE_RE? > result_type TDS_DONE_RESULT > $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]DBLIB.C;46:1678:dbresults > returning 2 (NO_MORE_RESULTS) > $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.DBLIB]BCP.C;3:2251:bcp_done(5C5E00) > $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.TDS]BULK.C;1:886:tds_bcp_done(5C6620, > 7ACFBA50) > $1$DGA1808:[TSG.ACOCCIMIGLIO.VMS_1.FREETDS-0_91.SRC.TDS]NET.C;1:741:Sending > packet > 0000 0f 01 00 08 00 00 00 00- |........| > > > thanks > > Angelo Coccimiglio > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds ________________________________________ Craig A. Berry mailto:craigberry at mac.com "... getting out of a sonnet is much more difficult than getting in." Brad Leithauser _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds From craigberry at mac.com Fri Dec 5 09:39:09 2014 From: craigberry at mac.com (Craig A. Berry) Date: Fri, 05 Dec 2014 08:39:09 -0600 Subject: [freetds] Memory leak with 0.92.556 in SQLDescribeCol() In-Reply-To: <54808633.4050907@4js.com> References: <547EFB57.5090005@4js.com> <54808633.4050907@4js.com> Message-ID: > On Dec 4, 2014, at 10:05 AM, Sebastien FLAESCH wrote: > > Thanks a lot Craig for your answer. > > 2 simple remarks: > > A) Why is there no instruction in the INSTALL file about autogen.sh? > > "Brief Instructions" just shows: > > $ ./configure --help > $ ./configure > $ make > $ make install I believe the intention is that people can get snapshots and shouldn't have to use autogen.sh so there's no reason to document it. Although documentation for producing a release wouldn't hurt. However, I did a bit of digging on the ftp server and it turns out snapshots are working -- sort of. You can find a snapshot generated on 17 November (the date of the last commit) at: ftp://ftp.freetds.org/pub/freetds/current/freetds-dev.0.92.839.tar.gz So what's broken is the last step that copies that to freetds-current.tgz. Until and unless that gets fixed, I think the current workaround is to go to ftp://ftp.freetds.org/pub/freetds/ and dig around in the "current" directory for whatever looks latest. > > Everyone new to freetds will run these commands and face the same probs as me. > > B) Regarding the "current" version available on www.freetds.org, why is this > left as is? Can anyone modify these pages? Just point to the git repository! > > I must be missing something, because all of this sounds obvious and I would > wonder that nobody changed it already if it was so simple. > Snapshots have gotten broken and been fixed multiple times. Freddy and James are busy and probably have more fun things to work on when they do have time to do things. It is frustrating, though. > On 12/04/2014 03:35 PM, Craig A. Berry wrote: >> >>> On Dec 3, 2014, at 6:00 AM, Sebastien FLAESCH wrote: >>> >>> Can someone point me to the instructions to download FreeTDS dev version? >>> >>> When I take the sources from https://gitorious.org/freetds/freetds, there is no configure script. >>> >>> The INSTALL file contains instructions to use configure... what am I doing wrong? >> >> You have to be on a Unix or Unix-like system with recent autotools installed and run autogen.sh in a git checkout of the current source. If all goes well, you should get a configure script. If all does not go well, you may be building autotools from scratch, which is a rather unpleasant bare knuckle experience for those of us unaccustomed to such things. >> >> Actually you don't have to be using git as you can get a tarball of the latest source at any time from this link: >> >> >> >> However, you do have to have autotools. >> >>> Why is the www.freetds.org still showing an old "current" download link (0.92.377)? >> >> The nightly snapshots have not worked reliably for years and there is an aversion to putting generated files under version control. The script for generating snapshots was posted to the list once with suggestions for improvement solicited but I don't think there were any takers. >> >> ________________________________________ >> Craig A. Berry >> mailto:craigberry at mac.com >> >> "... getting out of a sonnet is much more >> difficult than getting in." >> Brad Leithauser >> >> _______________________________________________ >> FreeTDS mailing list >> FreeTDS at lists.ibiblio.org >> http://lists.ibiblio.org/mailman/listinfo/freetds >> > > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds ________________________________________ Craig A. Berry mailto:craigberry at mac.com "... getting out of a sonnet is much more difficult than getting in." Brad Leithauser From dervish at gmail.com Fri Dec 5 10:03:43 2014 From: dervish at gmail.com (Alex Derbes) Date: Fri, 5 Dec 2014 10:03:43 -0500 Subject: [freetds] Fwd: FreeTDS on OSX 10.10 losing precision In-Reply-To: References: Message-ID: I have FreeTDS 0.91 installed on Mac OSX 10.10. When Querying a SQLServer 2012 database, columns defined with double precision numbers are truncated to single precision. I've checked the query with both sqsh and with the python pymssql driver and get the same result. Is it possible that I need to set something in my freetds.conf file to enable double precision math? Or is it possible that the column definition in the SQL Server database is being incorrectly marshaled to a single precision number? Thanks, --Alex Derbes The version of FreeTDS came from brew, here is the version information: freetds: stable 0.91, HEAD http://www.freetds.org/ /usr/local/Cellar/freetds/0.91_2 (600 files, 10.0M) * Built from source From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/freetds.rb From sf at 4js.com Fri Dec 5 10:06:31 2014 From: sf at 4js.com (Sebastien FLAESCH) Date: Fri, 05 Dec 2014 16:06:31 +0100 Subject: [freetds] Memory leak with 0.92.556 in SQLDescribeCol() In-Reply-To: References: <547EFB57.5090005@4js.com> <54808633.4050907@4js.com> Message-ID: <5481C9F7.9080001@4js.com> Thanks a lot Craig, the snapshot worked for me. Will keep you informed if I still get the memory leak. Seb On 12/05/2014 03:39 PM, Craig A. Berry wrote: > >> On Dec 4, 2014, at 10:05 AM, Sebastien FLAESCH wrote: >> >> Thanks a lot Craig for your answer. >> >> 2 simple remarks: >> >> A) Why is there no instruction in the INSTALL file about autogen.sh? >> >> "Brief Instructions" just shows: >> >> $ ./configure --help >> $ ./configure >> $ make >> $ make install > > I believe the intention is that people can get snapshots and shouldn't have to use autogen.sh so there's no reason to document it. Although documentation for producing a release wouldn't hurt. > > However, I did a bit of digging on the ftp server and it turns out snapshots are working -- sort of. You can find a snapshot generated on 17 November (the date of the last commit) at: > > ftp://ftp.freetds.org/pub/freetds/current/freetds-dev.0.92.839.tar.gz > > So what's broken is the last step that copies that to freetds-current.tgz. Until and unless that gets fixed, I think the current workaround is to go to > > ftp://ftp.freetds.org/pub/freetds/ > > and dig around in the "current" directory for whatever looks latest. > >> >> Everyone new to freetds will run these commands and face the same probs as me. >> >> B) Regarding the "current" version available on www.freetds.org, why is this >> left as is? Can anyone modify these pages? Just point to the git repository! >> >> I must be missing something, because all of this sounds obvious and I would >> wonder that nobody changed it already if it was so simple. >> > > Snapshots have gotten broken and been fixed multiple times. Freddy and James are busy and probably have more fun things to work on when they do have time to do things. It is frustrating, though. > >> On 12/04/2014 03:35 PM, Craig A. Berry wrote: >>> >>>> On Dec 3, 2014, at 6:00 AM, Sebastien FLAESCH wrote: >>>> >>>> Can someone point me to the instructions to download FreeTDS dev version? >>>> >>>> When I take the sources from https://gitorious.org/freetds/freetds, there is no configure script. >>>> >>>> The INSTALL file contains instructions to use configure... what am I doing wrong? >>> >>> You have to be on a Unix or Unix-like system with recent autotools installed and run autogen.sh in a git checkout of the current source. If all goes well, you should get a configure script. If all does not go well, you may be building autotools from scratch, which is a rather unpleasant bare knuckle experience for those of us unaccustomed to such things. >>> >>> Actually you don't have to be using git as you can get a tarball of the latest source at any time from this link: >>> >>> >>> >>> However, you do have to have autotools. >>> >>>> Why is the www.freetds.org still showing an old "current" download link (0.92.377)? >>> >>> The nightly snapshots have not worked reliably for years and there is an aversion to putting generated files under version control. The script for generating snapshots was posted to the list once with suggestions for improvement solicited but I don't think there were any takers. >>> >>> ________________________________________ >>> Craig A. Berry >>> mailto:craigberry at mac.com >>> >>> "... getting out of a sonnet is much more >>> difficult than getting in." >>> Brad Leithauser >>> >>> _______________________________________________ >>> FreeTDS mailing list >>> FreeTDS at lists.ibiblio.org >>> http://lists.ibiblio.org/mailman/listinfo/freetds >>> >> >> _______________________________________________ >> FreeTDS mailing list >> FreeTDS at lists.ibiblio.org >> http://lists.ibiblio.org/mailman/listinfo/freetds > > ________________________________________ > Craig A. Berry > mailto:craigberry at mac.com > > "... getting out of a sonnet is much more > difficult than getting in." > Brad Leithauser > > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > From dl.soluz at gmx.net Sun Dec 7 09:45:52 2014 From: dl.soluz at gmx.net (Dennis Luehring) Date: Sun, 07 Dec 2014 15:45:52 +0100 Subject: [freetds] try to build freetds git with VS2010/nmake Message-ID: <54846820.8020605@gmx.net> follwing the guide:http://www.freetds.org/userguide/osissues.htm#WINDOWS changed Nmakefile from !IF 0 == [dir /b /ad CVS 2>NUL:] to !IF 0 == [dir /b /ad .git 2>NUL:] that works but then i've got a problem with perl src\tds\types.pl misc\types.csv > $@.err gives error - and every run gives different error? im using current activeperl >perl --version This is perl 5, version 20, subversion 1 (v5.20.1) built for MSWin32-x64-multi-thread (with 1 registered patch, see perl -V for more detail) 1. run >perl src\tds\types.pl misc\types.csv > $@.err no value for type SYBDATE at src\tds\types.pl line 65. 2.run no value for type SYBMSDATE at src\tds\types.pl line 65. 3.run no value for type SYBDATETIMN at src\tds\types.pl line 65. 4.run no value for type SYBVARBINARY at src\tds\types.pl line 65. 5.run no value for type SYBUINT1 at src\tds\types.pl line 65. etc. any solution? From michael at michsoft.de Mon Dec 8 08:04:31 2014 From: michael at michsoft.de (Michael Koch) Date: Mon, 08 Dec 2014 14:04:31 +0100 Subject: [freetds] Problem with SQLPrepare and Sybase ASA 9 Message-ID: <5485A1DF.2030203@michsoft.de> Hello all, In a table which has 3 varchar(...) fields I try to INSERT the following statement with the released FreeTDS 0.92: INSERT INTO dba.michaelstest (dNummer, DateinameBild, Unterschrift) VALUES ('00002', 'lalala.bmp', 'abc') We use: retcode = SQLPrepare(stmt, "INSERT INTO dba.michaelstest (dNummer, DateinameBild, Unterschrift) VALUES ('00002', 'lalala.bmp', 'abc')", SQL_NTS); recode is here SQL_SUCCESS! then we use: recode = SQLExecute(stmt); The recode here is 100 (SQL_NO_DATA). We also use a Statement with one ? for testing and SQLBindParameter, SQLPrepare, SQLExecute, SQLParam, SQLPutData << it always all returned SUCCESFULL return code, the right code that is needed. Form the 1. example (without ?) we geht on Sybase ASA 9.0.2 the following Debuglog: 08 12:22:02.394 ** DONE conn: 1 CONNECT Conn=1 12/08 12:22:02.394 ** REQUEST conn: 1 DO_NOTHING 12/08 12:22:02.427 ** REQUEST conn: 1 STMT_EXECUTE_ANY_IMM "set textsize 64512 " 12/08 12:22:02.427 ** DONE conn: 1 STMT_EXECUTE_ANY_IMM 12/08 12:22:02.459 ** REQUEST conn: 1 STMT_EXECUTE_ANY_IMM "WHILE @@TRANCOUNT > 0 COMMIT" 12/08 12:22:02.459 ** WARNING conn: 1 code: 105 "Prozedur ist abgeschlossen" 12/08 12:22:02.460 ** DONE conn: 1 STMT_EXECUTE_ANY_IMM 12/08 12:22:02.497 ** REQUEST conn: 1 STMT_PREPARE "create proc u6f1706000 as INSERT INTO dba.michaelstest (dNummer, DateinameBild, Unterschrift) VALUES ('00002', 'lalala.bmp', 'abc')" 12/08 12:22:02.497 ** DONE conn: 1 STMT_PREPARE Stmt=65536 12/08 12:22:02.497 ** REQUEST conn: 1 STMT_DESCRIBE_OUTPUT Stmt=65536 12/08 12:22:02.497 ** DONE conn: 1 STMT_DESCRIBE_OUTPUT 12/08 12:22:02.497 ** REQUEST conn: 1 STMT_DESCRIBE_INPUT Stmt=65536 12/08 12:22:02.497 ** DONE conn: 1 STMT_DESCRIBE_INPUT 12/08 12:22:02.529 ** REQUEST conn: 1 STMT_EXECUTE_ANY Stmt=65536 12/08 12:22:02.529 ** PLAN conn: 1 SYSPROCEDURE 12/08 12:22:02.531 ** PLAN conn: 1 SYSATTRIBUTE 12/08 12:22:02.531 ** PLAN conn: 1 SYSCOLSTAT 12/08 12:22:02.532 ** PLAN conn: 1 SYSCOLSTAT 12/08 12:22:02.532 ** PLAN conn: 1 SYSCOLSTAT 12/08 12:22:02.532 ** PLAN conn: 1 SYSCOLSTAT 12/08 12:22:02.532 ** PLAN conn: 1 SYSCOLSTAT 12/08 12:22:02.532 ** PLAN conn: 1 SYSCOLUMN 12/08 12:22:02.532 ** PLAN conn: 1 SYSTABLE 12/08 12:22:02.533 ** PLAN conn: 1 SYSPROCEDURE 12/08 12:22:02.536 ** PLAN conn: 1 SYSPROCPARM 12/08 12:22:02.536 ** PLAN conn: 1 SYSPROCEDURE 12/08 12:22:02.536 ** PLAN conn: 1 SYSPROCEDURE 12/08 12:22:02.537 ** DONE conn: 1 STMT_EXECUTE_ANY 12/08 12:22:02.570 ** REQUEST conn: 1 STMT_DROP Stmt=65536 12/08 12:22:02.570 ** DONE conn: 1 STMT_DROP For all testings we use the dba-user so rights schould not be the problem. And also after a commit and trying without commit NO data is inserted into the target table. Any help would be very nice! Thanks in advance, Michael Koch From m.jablonski at poczta.fm Sat Dec 13 03:25:22 2014 From: m.jablonski at poczta.fm (m.jablonski at poczta.fm) Date: Sat, 13 Dec 2014 09:25:22 +0100 Subject: [freetds] problems with UTF-8 Message-ID: Hi everyone, I have problem with UTF-8. in config client charset is set to utf-8 Why charset is changed to cp1250 by freetds ? My sql is send with utf-8. this is log: net.c:1057:instance port is 49618 net.c:205:Connecting to 10.5.2.2 port 49618 (TDS version 4.2) net.c:270:tds_open_socket: connect(2) returned "Operation now in progress" net.c:310:tds_open_socket() succeeded util.c:156:Changed query state from DEAD to IDLE net.c:741:Sending packet 0000 02 00 02 00 00 00 00 00-62 61 63 6b 75 70 00 00 |........ backup..| 0010 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0020 00 00 00 00 00 00 06 73-61 00 00 00 00 00 00 00 |.......s a.......| 0030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0040 00 00 00 00 00 02 54 72-75 64 6e 65 68 61 73 6c |......********| 0050 6f 31 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |o1...... ........| 0060 00 00 00 00 0c 39 36 37-00 00 00 00 00 00 00 00 |.....967 ........| 0070 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0080 00 00 00 03 03 01 06 0a-09 01 00 00 00 00 02 00 |........ ........| 0090 00 00 00 00 50 48 50 20-35 00 00 00 00 00 00 00 |....PHP 5.......| 00a0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 00b0 00 00 05 31 30 2e 35 2e-32 2e 32 5c 4f 50 54 49 |...10.5. 2.2\OPTI| 00c0 4d 41 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |MA...... ........| 00d0 00 0f 54 72 75 64 6e 65-68 61 73 6c 6f 31 00 00 |..*******..| 00e0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 00f0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0100 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0110 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0120 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0130 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0140 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0150 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0160 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0170 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0180 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0190 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 01a0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 01b0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 01c0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 01d0 00 0c 04 02 00 00 44 42-2d 4c 69 62 72 61 72 79 |......DB -Library| 01e0 0a 00 00 00 00 00 0d 11-75 73 5f 65 6e 67 6c 69 |........ us_engli| 01f0 73 68 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |sh...... ........| net.c:741:Sending packet 0000 02 01 00 4c 00 00 00 00-00 00 00 00 00 00 0a 00 |...L.... ........| 0010 00 00 00 00 00 00 00 00-00 00 00 00 00 55 54 46 |........ .....UTF| 0020 2d 38 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |-8...... ........| 0030 00 00 00 00 00 00 00 00-00 00 00 05 01 35 31 32 |........ .....512| 0040 00 00 00 03 00 00 00 00-00 00 00 00 |........ ....| token.c:328:tds_process_login_tokens() net.c:555:Received header 0000 04 01 00 a0 00 33 01 00- |.....3..| net.c:609:Received packet 0000 04 01 00 a0 00 33 01 00-e3 0f 00 01 06 6d 61 73 |.....3.. .....mas| 0010 74 65 72 06 6d 61 73 74-65 72 ab 3e 00 45 16 00 |ter.mast er.>.E..| 0020 00 02 00 25 00 43 68 61-6e 67 65 64 20 64 61 74 |...%.Cha nged dat| 0030 61 62 61 73 65 20 63 6f-6e 74 65 78 74 20 74 6f |abase co ntext to| 0040 20 27 6d 61 73 74 65 72-27 2e 0d 53 45 52 57 45 | 'master '..SERWE| 0050 52 5c 4f 50 54 49 4d 41-00 01 00 e3 0a 00 03 06 |R\OPTIMA ........| 0060 63 70 31 32 35 30 01 00-ad 20 00 01 04 02 00 00 |cp1250.. . ......| <----- what is this ??? why mssql server sending that information. how to change it ? 0070 16 4d 69 63 72 6f 73 6f-66 74 20 53 51 4c 20 53 |.Microso ft SQL S| 0080 65 72 76 65 72 00 00 5f-0a 32 ff e3 09 00 04 03 |erver.._ .2......| 0090 35 31 32 03 35 31 32 fd-00 00 00 00 00 00 00 00 |512.512. ........| token.c:337:looking for login token, got e3(ENVCHANGE) token.c:122:tds_process_default_tokens() marker is e3(ENVCHANGE) dblib.c:327:db_env_chg(0xb9577d58, 1, master, master) token.c:337:looking for login token, got ab(INFO) token.c:122:tds_process_default_tokens() marker is ab(INFO) token.c:2588:tds_process_msg() reading message 5701 from server token.c:2661:tds_process_msg() calling client msg handler dbutil.c:85:_dblib_handle_info_message(0xb956ab88, 0xb9577d58, 0xbf8250f0) dbutil.c:86:msgno 5701: "Changed database context to 'master'." token.c:2674:tds_process_msg() returning TDS_SUCCEED token.c:337:looking for login token, got e3(ENVCHANGE) token.c:122:tds_process_default_tokens() marker is e3(ENVCHANGE) token.c:2493:server indicated charset change to "cp1250" <---- here is change to cp1250 iconv.c:988:setting server single-byte charset to "CP1250" thax for any help Marcin From freddy77 at gmail.com Sun Dec 14 12:36:08 2014 From: freddy77 at gmail.com (Frediano Ziglio) Date: Sun, 14 Dec 2014 17:36:08 +0000 Subject: [freetds] problems with UTF-8 In-Reply-To: References: Message-ID: 2014-12-13 8:25 GMT+00:00 : > > Hi everyone, > > I have problem with UTF-8. > in config client charset is set to utf-8 > > Why charset is changed to cp1250 by freetds ? My sql is send with utf-8. > > > this is log: > > > net.c:1057:instance port is 49618 > net.c:205:Connecting to 10.5.2.2 port 49618 (TDS version 4.2) > net.c:270:tds_open_socket: connect(2) returned "Operation now in > progress" Please use a newer protocol, 4.2 is just for compatibility. > net.c:310:tds_open_socket() succeeded > util.c:156:Changed query state from DEAD to IDLE > net.c:741:Sending packet > 0000 02 00 02 00 00 00 00 00-62 61 63 6b 75 70 00 00 |........ backup..| > 0010 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| > 0020 00 00 00 00 00 00 06 73-61 00 00 00 00 00 00 00 |.......s a.......| > 0030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| > 0040 00 00 00 00 00 02 54 72-75 64 6e 65 68 61 73 6c |......********| > 0050 6f 31 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |o1...... ........| > 0060 00 00 00 00 0c 39 36 37-00 00 00 00 00 00 00 00 |.....967 ........| > 0070 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| > 0080 00 00 00 03 03 01 06 0a-09 01 00 00 00 00 02 00 |........ ........| > 0090 00 00 00 00 50 48 50 20-35 00 00 00 00 00 00 00 |....PHP 5.......| > 00a0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| > 00b0 00 00 05 31 30 2e 35 2e-32 2e 32 5c 4f 50 54 49 |...10.5. 2.2\OPTI| > 00c0 4d 41 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |MA...... ........| > 00d0 00 0f 54 72 75 64 6e 65-68 61 73 6c 6f 31 00 00 |..*******..| > 00e0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| > 00f0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| > 0100 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| > 0110 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| > 0120 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| > 0130 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| > 0140 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| > 0150 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| > 0160 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| > 0170 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| > 0180 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| > 0190 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| > 01a0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| > 01b0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| > 01c0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| > 01d0 00 0c 04 02 00 00 44 42-2d 4c 69 62 72 61 72 79 |......DB -Library| > 01e0 0a 00 00 00 00 00 0d 11-75 73 5f 65 6e 67 6c 69 |........ us_engli| > 01f0 73 68 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |sh...... ........| > > net.c:741:Sending packet > 0000 02 01 00 4c 00 00 00 00-00 00 00 00 00 00 0a 00 |...L.... ........| > 0010 00 00 00 00 00 00 00 00-00 00 00 00 00 55 54 46 |........ .....UTF| > 0020 2d 38 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |-8...... ........| > 0030 00 00 00 00 00 00 00 00-00 00 00 05 01 35 31 32 |........ .....512| > 0040 00 00 00 03 00 00 00 00-00 00 00 00 |........ ....| > > token.c:328:tds_process_login_tokens() > net.c:555:Received header > 0000 04 01 00 a0 00 33 01 00- |.....3..| > > net.c:609:Received packet > 0000 04 01 00 a0 00 33 01 00-e3 0f 00 01 06 6d 61 73 |.....3.. .....mas| > 0010 74 65 72 06 6d 61 73 74-65 72 ab 3e 00 45 16 00 |ter.mast er.>.E..| > 0020 00 02 00 25 00 43 68 61-6e 67 65 64 20 64 61 74 |...%.Cha nged dat| > 0030 61 62 61 73 65 20 63 6f-6e 74 65 78 74 20 74 6f |abase co ntext to| > 0040 20 27 6d 61 73 74 65 72-27 2e 0d 53 45 52 57 45 | 'master > '..SERWE| > 0050 52 5c 4f 50 54 49 4d 41-00 01 00 e3 0a 00 03 06 |R\OPTIMA ........| > 0060 63 70 31 32 35 30 01 00-ad 20 00 01 04 02 00 00 |cp1250.. . ......| > <----- what is this ??? why mssql server sending that information. how > to change it ? > 0070 16 4d 69 63 72 6f 73 6f-66 74 20 53 51 4c 20 53 |.Microso ft SQL S| > 0080 65 72 76 65 72 00 00 5f-0a 32 ff e3 09 00 04 03 |erver.._ .2......| > 0090 35 31 32 03 35 31 32 fd-00 00 00 00 00 00 00 00 |512.512. ........| > > token.c:337:looking for login token, got e3(ENVCHANGE) > token.c:122:tds_process_default_tokens() marker is e3(ENVCHANGE) > dblib.c:327:db_env_chg(0xb9577d58, 1, master, master) > token.c:337:looking for login token, got ab(INFO) > token.c:122:tds_process_default_tokens() marker is ab(INFO) > token.c:2588:tds_process_msg() reading message 5701 from server > token.c:2661:tds_process_msg() calling client msg handler > dbutil.c:85:_dblib_handle_info_message(0xb956ab88, 0xb9577d58, 0xbf8250f0) > dbutil.c:86:msgno 5701: "Changed database context to > 'master'." > token.c:2674:tds_process_msg() returning TDS_SUCCEED > token.c:337:looking for login token, got e3(ENVCHANGE) > token.c:122:tds_process_default_tokens() marker is e3(ENVCHANGE) > token.c:2493:server indicated charset change to "cp1250" > <---- here is change to cp1250 > iconv.c:988:setting server single-byte charset to "CP1250" > Server has its encoding, FreeTDS try to use this encoding (in your case cp1250) converting to the encoding you want (in your case utf-8). > > > thax for any help > > Marcin Frediano From michael at michsoft.de Mon Dec 15 12:59:23 2014 From: michael at michsoft.de (Michael Koch) Date: Mon, 15 Dec 2014 18:59:23 +0100 Subject: [freetds] Problem with FreeTDS 0.91 and Sybase ASA 9 Message-ID: <548F217B.4050905@michsoft.de> Hello List, in addition to my last post I have made much more tests. At least under Gentoo with FreeTDS 0.91 und unixODBX 2.3.2-r1 I could confirm my problems with SQLPrepare. I turned on trace logging for FreeTDS and unixODBC and take isql todo a simple SELECT-Query. isql tries to build the query with SQLPrepare and the Sybase ASA9 gives a error value back, that the procedur that it tries to create is already existing. I've made the following log files. I hope anyone has an ideas? Thanks in advance! Best regards Michael --------------------------------------------------------------------------------------------------------------------------------------------------------- [ODBC][27626][1418664265.425550][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/__handles.c][460] Exit:[SQL_SUCCESS] Environment = 0x60d830 [ODBC][27626][1418664265.425623][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLAllocHandle.c][375] Entry: Handle Type = 2 Input Handle = 0x60d830 [ODBC][27626][1418664265.425664][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLAllocHandle.c][493] Exit:[SQL_SUCCESS] Output Handle = 0x60e130 [ODBC][27626][1418664265.425708][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLConnect.c][3727] Entry: Connection = 0x60e130 Server Name = [TTT][length = 3 (SQL_NTS)] User Name = [dba][length = 3 (SQL_NTS)] Authentication = [*********][length = 9 (SQL_NTS)] UNICODE Using encoding ASCII 'UTF8' and UNICODE 'UTF16LE' [ODBC][27626][1418664265.555692][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLConnect.c][4305] Exit:[SQL_SUCCESS] [ODBC][27626][1418664265.555758][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLGetFunctions.c][151] Entry: Connection = 0x60e130 Id = SQLMoreResults Supported = 0x607210 [ODBC][27626][1418664265.555798][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLGetFunctions.c][186] Exit:[SQL_SUCCESS] Supported = 0x607210 -> 1 [ODBC][27626][1418664285.390773][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLAllocHandle.c][540] Entry: Handle Type = 3 Input Handle = 0x60e130 [ODBC][27626][1418664285.391278][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLAllocHandle.c][1081] Exit:[SQL_SUCCESS] Output Handle = 0x666f40 [ODBC][27626][1418664285.391351][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLPrepare.c][196] Entry: Statement = 0x666f40 SQL = [SELECT * FROM michaelstest;][length = 27] [ODBC][27626][1418664285.425662][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLPrepare.c][371] Exit:[SQL_SUCCESS] [ODBC][27626][1418664285.425869][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLExecute.c][187] Entry: Statement = 0x666f40 [ODBC][27626][1418664285.461657][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLExecute.c][348] Exit:[SQL_ERROR] DIAG [52010] [FreeTDS][SQL Server]ASA Fehler -110: Element 'emub506000' ist bereits vorhanden [ODBC][27626][1418664285.467520][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLFreeStmt.c][144] Entry: Statement = 0x666f40 Option = 1 [ODBC][27626][1418664285.467571][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLFreeHandle.c][381] Entry: Handle Type = 3 Input Handle = 0x666f40 [ODBC][27626][1418664285.500579][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLFreeHandle.c][491] Exit:[SQL_SUCCESS] [ODBC][27626][1418664294.782804][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLAllocHandle.c][540] Entry: Handle Type = 3 Input Handle = 0x60e130 [ODBC][27626][1418664294.783007][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLAllocHandle.c][1081] Exit:[SQL_SUCCESS] Output Handle = 0x666f40 [ODBC][27626][1418664294.783051][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLPrepare.c][196] Entry: Statement = 0x666f40 SQL = [SELECT MdNummer FROM michaelstest;][length = 34] [ODBC][27626][1418664294.817761][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLPrepare.c][371] Exit:[SQL_SUCCESS] [ODBC][27626][1418664294.817949][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLExecute.c][187] Entry: Statement = 0x666f40 [ODBC][27626][1418664294.850989][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLExecute.c][348] Exit:[SQL_ERROR] DIAG [52010] [FreeTDS][SQL Server]ASA Fehler -110: Element 'emub509000' ist bereits vorhanden [ODBC][27626][1418664294.857425][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLFreeStmt.c][144] Entry: Statement = 0x666f40 Option = 1 [ODBC][27626][1418664294.857513][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLFreeHandle.c][381] Entry: Handle Type = 3 Input Handle = 0x666f40 [ODBC][27626][1418664294.901716][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLFreeHandle.c][491] Exit:[SQL_SUCCESS] [ODBC][27626][1418664302.446326][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLAllocHandle.c][540] Entry: Handle Type = 3 Input Handle = 0x60e130 [ODBC][27626][1418664302.446567][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLAllocHandle.c][1081] Exit:[SQL_SUCCESS] Output Handle = 0x666f40 [ODBC][27626][1418664302.446616][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLPrepare.c][196] Entry: Statement = 0x666f40 SQL = [SELECT MdNummer FROM dba.michaelstest;][length = 38] [ODBC][27626][1418664302.480416][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLPrepare.c][371] Exit:[SQL_SUCCESS] [ODBC][27626][1418664302.480601][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLExecute.c][187] Entry: Statement = 0x666f40 [ODBC][27626][1418664302.517267][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLExecute.c][348] Exit:[SQL_ERROR] DIAG [52010] [FreeTDS][SQL Server]ASA Fehler -110: Element 'emub50c000' ist bereits vorhanden [ODBC][27626][1418664302.523983][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLFreeStmt.c][144] Entry: Statement = 0x666f40 Option = 1 [ODBC][27626][1418664302.524032][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLFreeHandle.c][381] Entry: Handle Type = 3 Input Handle = 0x666f40 [ODBC][27626][1418664302.568442][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLFreeHandle.c][491] Exit:[SQL_SUCCESS] [ODBC][27626][1418664304.734147][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLDisconnect.c][208] Entry: Connection = 0x60e130 [ODBC][27626][1418664304.734453][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLDisconnect.c][364] Exit:[SQL_SUCCESS] [ODBC][27626][1418664304.734536][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLFreeHandle.c][284] Entry: Handle Type = 2 Input Handle = 0x60e130 [ODBC][27626][1418664304.734576][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLFreeHandle.c][333] Exit:[SQL_SUCCESS] [ODBC][27626][1418664304.734614][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLFreeHandle.c][219] Entry: Handle Type = 1 Input Handle = 0x60d830 --------------------------------------------------------------------------------------------------------------------------------------------------------- 18:24:25.518958 27626 (net.c:609):Received packet 0000 04 01 00 59 00 00 00 00-e3 07 00 03 04 75 74 66 |...Y.... .....utf| 0010 38 00 ad 22 00 05 05 00-00 00 18 41 64 61 70 74 |8..".... ...Adapt| 0020 69 76 65 20 53 65 72 76-65 72 20 41 6e 79 77 68 |ive Serv er Anywh| 0030 65 72 65 09 00 00 00 e2-16 00 01 09 00 00 0e 61 |ere..... .......a| 0040 01 ff ff fe e6 02 09 01-fe 7f fe e6 68 00 00 0a |........ ....h...| 0050 fd 00 00 01 00 00 00 00-00 |........ .| 18:24:25.519008 27626 (token.c:337):looking for login token, got e3(ENVCHANGE) 18:24:25.519027 27626 (token.c:122):tds_process_default_tokens() marker is e3(ENVCHANGE) 18:24:25.519048 27626 (token.c:2493):server indicated charset change to "utf8" 18:24:25.519069 27626 (iconv.c:988):setting server single-byte charset to "UTF-8" 18:24:25.519083 27626 (token.c:337):looking for login token, got ad(LOGINACK) 18:24:25.519134 27626 (token.c:373):server reports TDS version 5.0.0.0 18:24:25.519147 27626 (token.c:375):Product name for 0x5000000 is unknown 18:24:25.519161 27626 (token.c:337):looking for login token, got e2(CAPABILITY) 18:24:25.519173 27626 (token.c:122):tds_process_default_tokens() marker is e2(CAPABILITY) 18:24:25.519186 27626 (token.c:337):looking for login token, got fd(DONE) 18:24:25.519198 27626 (token.c:122):tds_process_default_tokens() marker is fd(DONE) 18:24:25.519213 27626 (token.c:2339):tds_process_end: more_results = 0 was_cancelled = 0 error = 0 done_count_valid = 0 18:24:25.519227 27626 (token.c:2355):tds_process_end() state set to TDS_IDLE 18:24:25.519239 27626 (token.c:2370): rows_affected = 0 18:24:25.519251 27626 (token.c:438):tds_process_login_tokens() returning TDS_SUCCEED 18:24:25.519269 27626 (mem.c:615):tds_free_all_results() 18:24:25.519284 27626 (util.c:156):Changed query state from IDLE to QUERYING 18:24:25.519298 27626 (util.c:156):Changed query state from QUERYING to PENDING 18:24:25.519310 27626 (net.c:741):Sending packet 0000 0f 01 00 21 00 00 00 00-21 14 00 00 00 00 73 65 |...!.... !.....se| 0010 74 20 74 65 78 74 73 69-7a 65 20 36 34 35 31 32 |t textsi ze 64512| 0020 20 - | | 18:24:25.519476 27626 (token.c:540):tds_process_tokens(0x62a450, 0x7fff488b9148, 0x7fff488b914c, 0x100) 18:24:25.519505 27626 (util.c:156):Changed query state from PENDING to READING 18:24:25.555428 27626 (net.c:555):Received header 0000 04 01 00 11 00 00 00 00- |........| 18:24:25.555477 27626 (net.c:609):Received packet 0000 04 01 00 11 00 00 00 00-fd 00 00 01 00 00 00 00 |........ ........| 0010 00 - |.| 18:24:25.555498 27626 (token.c:555):processing result tokens. marker is fd(DONE) 18:24:25.555512 27626 (token.c:2339):tds_process_end: more_results = 0 was_cancelled = 0 error = 0 done_count_valid = 0 18:24:25.555525 27626 (token.c:2355):tds_process_end() state set to TDS_IDLE 18:24:25.555566 27626 (util.c:156):Changed query state from READING to IDLE 18:24:25.555580 27626 (token.c:2370): rows_affected = 0 18:24:25.555592 27626 (util.c:104):logic error: cannot change query state from IDLE to PENDING 18:24:25.555605 27626 (token.c:540):tds_process_tokens(0x62a450, 0x7fff488b9148, 0x7fff488b914c, 0x100) 18:24:25.555617 27626 (token.c:543):tds_process_tokens() state is COMPLETED 18:24:25.555639 27626 (odbc.c:4916):SQLGetFunctions: fFunction is 999 18:24:45.390848 27626 (odbc.c:1716):SQLAllocStmt(0x628ff0, 0x667360) 18:24:45.390879 27626 (odbc.c:1615):_SQLAllocStmt(0x628ff0, 0x667360) 18:24:45.390902 27626 (odbc.c:4388):SQLGetStmtAttr(0x650aa0, 10010, 0x7fff488ba6f8, 8, (nil)) 18:24:45.390922 27626 (odbc.c:4388):SQLGetStmtAttr(0x650aa0, 10011, 0x7fff488ba6f8, 8, (nil)) 18:24:45.390941 27626 (odbc.c:4388):SQLGetStmtAttr(0x650aa0, 10012, 0x7fff488ba6f8, 8, (nil)) 18:24:45.390955 27626 (odbc.c:4388):SQLGetStmtAttr(0x650aa0, 10013, 0x7fff488ba6f8, 8, (nil)) 18:24:45.391382 27626 (odbc.c:4445):SQLPrepare(0x650aa0, SELECT * FROM michaelstest;, 27) 18:24:45.391410 27626 (odbc.c:4490):Creating prepared statement 18:24:45.391429 27626 (mem.c:615):tds_free_all_results() 18:24:45.391443 27626 (util.c:156):Changed query state from IDLE to QUERYING 18:24:45.391458 27626 (util.c:156):Changed query state from QUERYING to PENDING 18:24:45.391471 27626 (net.c:741):Sending packet 0000 0f 01 00 4f 00 00 00 00-e7 44 00 01 00 0a 65 6d |...O.... .D....em| 0010 75 62 35 30 36 30 30 30-35 00 63 72 65 61 74 65 |ub506000 5.create| 0020 20 70 72 6f 63 20 65 6d-75 62 35 30 36 30 30 30 | proc em ub506000| 0030 20 61 73 20 53 45 4c 45-43 54 20 2a 20 46 52 4f | as SELE CT * FRO| 0040 4d 20 6d 69 63 68 61 65-6c 73 74 65 73 74 3b |M michae lstest;| 18:24:45.391622 27626 (token.c:540):tds_process_tokens(0x62a450, 0x7fff488ba668, 0x7fff488ba66c, 0x104) 18:24:45.391645 27626 (util.c:156):Changed query state from PENDING to READING 18:24:45.425306 27626 (net.c:555):Received header 0000 04 01 00 21 00 00 00 00- |...!....| 18:24:45.425366 27626 (net.c:609):Received packet 0000 04 01 00 21 00 00 00 00-e7 0d 00 20 00 0a 65 6d |...!.... ... ..em| 0010 75 62 35 30 36 30 30 30-fd 00 00 01 00 00 00 00 |ub506000 ........| 0020 00 - |.| 18:24:45.425401 27626 (token.c:555):processing result tokens. marker is e7(TDS5_DYNAMIC) 18:24:45.425424 27626 (token.c:555):processing result tokens. marker is fd(DONE) 18:24:45.425443 27626 (token.c:2339):tds_process_end: more_results = 0 was_cancelled = 0 error = 0 done_count_valid = 0 18:24:45.425462 27626 (token.c:2355):tds_process_end() state set to TDS_IDLE 18:24:45.425480 27626 (util.c:156):Changed query state from READING to IDLE 18:24:45.425497 27626 (token.c:2370): rows_affected = 0 18:24:45.425542 27626 (util.c:104):logic error: cannot change query state from IDLE to PENDING 18:24:45.425576 27626 (token.c:540):tds_process_tokens(0x62a450, 0x7fff488ba668, 0x7fff488ba66c, 0x104) 18:24:45.425619 27626 (token.c:543):tds_process_tokens() state is COMPLETED 18:24:45.425903 27626 (odbc.c:3496):SQLExecute(0x650aa0) 18:24:45.425923 27626 (prepare_query.c:203):parsing 0 parameters 18:24:45.425940 27626 (odbc.c:3211):_SQLExecute(0x650aa0) 18:24:45.425953 27626 (odbc.c:3216):_SQLExecute() starting with state 0 18:24:45.425966 27626 (odbc.c:3334):End prepare, execute 18:24:45.425978 27626 (query.c:1818):tds_submit_execute() 18:24:45.425990 27626 (mem.c:615):tds_free_all_results() 18:24:45.426002 27626 (util.c:156):Changed query state from IDLE to QUERYING 18:24:45.426015 27626 (util.c:156):Changed query state from QUERYING to PENDING 18:24:45.426027 27626 (net.c:741):Sending packet 0000 0f 01 00 1a 00 00 00 00-e7 0f 00 02 00 0a 65 6d |........ ......em| 0010 75 62 35 30 36 30 30 30-00 00 |ub506000 ..| 18:24:45.426210 27626 (token.c:540):tds_process_tokens(0x62a450, 0x7fff488ba5d8, 0x7fff488ba5dc, 0x6914) 18:24:45.426239 27626 (util.c:156):Changed query state from PENDING to READING 18:24:45.461263 27626 (net.c:555):Received header 0000 04 01 00 74 00 00 00 00- |...t....| 18:24:45.461313 27626 (net.c:609):Received packet 0000 04 01 00 74 00 00 00 00-e7 0d 00 20 00 0a 65 6d |...t.... ... ..em| 0010 75 62 35 30 36 30 30 30-e5 50 00 e6 2e 00 00 00 |ub506000 .P......| 0020 10 05 35 32 30 31 30 00-01 00 3b 00 41 53 41 20 |..52010. ..;.ASA | 0030 46 65 68 6c 65 72 20 2d-31 31 30 3a 20 45 6c 65 |Fehler - 110: Ele| 0040 6d 65 6e 74 20 27 65 6d-75 62 35 30 36 30 30 30 |ment 'em ub506000| 0050 27 20 69 73 74 20 62 65-72 65 69 74 73 20 76 6f |' ist be reits vo| 0060 72 68 61 6e 64 65 6e 00-00 00 00 fd 02 00 01 00 |rhanden. ........| 0070 00 00 00 00 - |....| 18:24:45.461365 27626 (token.c:555):processing result tokens. marker is e7(TDS5_DYNAMIC) 18:24:45.461382 27626 (token.c:2588):tds_process_msg() reading message 12006 from server 18:24:45.461396 27626 (token.c:2661):tds_process_msg() calling client msg handler 18:24:45.461421 27626 (odbc.c:2270):msgno 12006 20003 18:24:45.461450 27626 (token.c:2674):tds_process_msg() returning TDS_SUCCEED 18:24:45.461494 27626 (token.c:555):processing result tokens. marker is fd(DONE) 18:24:45.461508 27626 (token.c:2339):tds_process_end: more_results = 0 was_cancelled = 0 error = 1 done_count_valid = 0 18:24:45.461521 27626 (token.c:2355):tds_process_end() state set to TDS_IDLE 18:24:45.461533 27626 (util.c:156):Changed query state from READING to IDLE 18:24:45.461545 27626 (token.c:2370): rows_affected = 0 18:24:45.461558 27626 (util.c:104):logic error: cannot change query state from IDLE to PENDING 18:24:45.461570 27626 (odbc.c:3534):odbc_process_tokens: tds_process_tokens returned 1 18:24:45.461582 27626 (odbc.c:3535): result_type=4052, TDS_DONE_COUNT=0, TDS_DONE_ERROR=2 18:24:45.461595 27626 (odbc.c:3575):odbc_process_tokens: row_count=-1 18:24:45.461607 27626 (odbc.c:3374):_SQLExecute: odbc_process_tokens returned result_type 4052 18:24:45.461623 27626 (odbc.c:3519):SQLExecute returns SQL_ERROR 18:24:45.461694 27626 (error.c:517):SQLGetDiagRec(3, 0x650aa0, 1, 0x7fff488ba220, 0x7fff488ba214, 0x7fff488ba230, 512, 0x7fff488ba218) 18:24:45.461728 27626 (error.c:566):SQLGetDiagRec: "[FreeTDS][SQL Server]ASA Fehler -110: Element 'emub506000' ist bereits vorhanden" 18:24:45.461793 27626 (error.c:517):SQLGetDiagRec(3, 0x650aa0, 2, 0x7fff488ba220, 0x7fff488ba214, 0x7fff488ba230, 512, 0x7fff488ba218) 18:24:45.467599 27626 (odbc.c:3980):SQLFreeHandle(3, 0x650aa0) 18:24:45.467620 27626 (odbc.c:4075):_SQLFreeStmt(0x650aa0, 1, 0) 18:24:45.467633 27626 (query.c:1935):tds_submit_unprepare() emub506000 18:24:45.467646 27626 (mem.c:615):tds_free_all_results() 18:24:45.467658 27626 (util.c:156):Changed query state from IDLE to QUERYING 18:24:45.467671 27626 (util.c:156):Changed query state from QUERYING to PENDING 18:24:45.467683 27626 (net.c:741):Sending packet 0000 0f 01 00 1a 00 00 00 00-e7 0f 00 04 00 0a 65 6d |........ ......em| 0010 75 62 35 30 36 30 30 30-00 00 |ub506000 ..| 18:24:45.467839 27626 (token.c:540):tds_process_tokens(0x62a450, 0x7fff488ba5d8, 0x7fff488ba5dc, 0x100) 18:24:45.467869 27626 (util.c:156):Changed query state from PENDING to READING 18:24:45.500245 27626 (net.c:555):Received header 0000 04 01 00 21 00 00 00 00- |...!....| 18:24:45.500311 27626 (net.c:609):Received packet 0000 04 01 00 21 00 00 00 00-e7 0d 00 20 00 0a 65 6d |...!.... ... ..em| 0010 75 62 35 30 36 30 30 30-fd 00 00 01 00 00 00 00 |ub506000 ........| 0020 00 - |.| 18:24:45.500349 27626 (token.c:555):processing result tokens. marker is e7(TDS5_DYNAMIC) 18:24:45.500373 27626 (token.c:555):processing result tokens. marker is fd(DONE) 18:24:45.500394 27626 (token.c:2339):tds_process_end: more_results = 0 was_cancelled = 0 error = 0 done_count_valid = 0 18:24:45.500414 27626 (token.c:2355):tds_process_end() state set to TDS_IDLE 18:24:45.500432 27626 (util.c:156):Changed query state from READING to IDLE 18:24:45.500450 27626 (token.c:2370): rows_affected = 0 18:24:45.500468 27626 (util.c:104):logic error: cannot change query state from IDLE to PENDING 18:24:45.500485 27626 (token.c:540):tds_process_tokens(0x62a450, 0x7fff488ba5d8, 0x7fff488ba5dc, 0x100) 18:24:45.500502 27626 (token.c:543):tds_process_tokens() state is COMPLETED 18:24:54.782885 27626 (odbc.c:1716):SQLAllocStmt(0x628ff0, 0x667360) 18:24:54.782915 27626 (odbc.c:1615):_SQLAllocStmt(0x628ff0, 0x667360) 18:24:54.782933 27626 (odbc.c:4388):SQLGetStmtAttr(0x650aa0, 10010, 0x7fff488ba6f8, 8, (nil)) 18:24:54.782949 27626 (odbc.c:4388):SQLGetStmtAttr(0x650aa0, 10011, 0x7fff488ba6f8, 8, (nil)) 18:24:54.782963 27626 (odbc.c:4388):SQLGetStmtAttr(0x650aa0, 10012, 0x7fff488ba6f8, 8, (nil)) 18:24:54.782976 27626 (odbc.c:4388):SQLGetStmtAttr(0x650aa0, 10013, 0x7fff488ba6f8, 8, (nil)) 18:24:54.783078 27626 (odbc.c:4445):SQLPrepare(0x650aa0, SELECT MdNummer FROM michaelstest;, 34) 18:24:54.783099 27626 (odbc.c:4490):Creating prepared statement 18:24:54.783128 27626 (mem.c:615):tds_free_all_results() 18:24:54.783141 27626 (util.c:156):Changed query state from IDLE to QUERYING 18:24:54.783155 27626 (util.c:156):Changed query state from QUERYING to PENDING 18:24:54.783167 27626 (net.c:741):Sending packet 0000 0f 01 00 56 00 00 00 00-e7 4b 00 01 00 0a 65 6d |...V.... .K....em| 0010 75 62 35 30 39 30 30 30-3c 00 63 72 65 61 74 65 |ub509000 <.create| 0020 20 70 72 6f 63 20 65 6d-75 62 35 30 39 30 30 30 | proc em ub509000| 0030 20 61 73 20 53 45 4c 45-43 54 20 4d 64 4e 75 6d | as SELE CT MdNum| 0040 6d 65 72 20 46 52 4f 4d-20 6d 69 63 68 61 65 6c |mer FROM michael| 0050 73 74 65 73 74 3b - |stest;| 18:24:54.783280 27626 (token.c:540):tds_process_tokens(0x62a450, 0x7fff488ba668, 0x7fff488ba66c, 0x104) 18:24:54.783301 27626 (util.c:156):Changed query state from PENDING to READING 18:24:54.817466 27626 (net.c:555):Received header 0000 04 01 00 21 00 00 00 00- |...!....| 18:24:54.817521 27626 (net.c:609):Received packet 0000 04 01 00 21 00 00 00 00-e7 0d 00 20 00 0a 65 6d |...!.... ... ..em| 0010 75 62 35 30 39 30 30 30-fd 00 00 01 00 00 00 00 |ub509000 ........| 0020 00 - |.| 18:24:54.817549 27626 (token.c:555):processing result tokens. marker is e7(TDS5_DYNAMIC) 18:24:54.817566 27626 (token.c:555):processing result tokens. marker is fd(DONE) 18:24:54.817579 27626 (token.c:2339):tds_process_end: more_results = 0 was_cancelled = 0 error = 0 done_count_valid = 0 18:24:54.817592 27626 (token.c:2355):tds_process_end() state set to TDS_IDLE 18:24:54.817604 27626 (util.c:156):Changed query state from READING to IDLE 18:24:54.817617 27626 (token.c:2370): rows_affected = 0 18:24:54.817629 27626 (util.c:104):logic error: cannot change query state from IDLE to PENDING 18:24:54.817642 27626 (token.c:540):tds_process_tokens(0x62a450, 0x7fff488ba668, 0x7fff488ba66c, 0x104) 18:24:54.817655 27626 (token.c:543):tds_process_tokens() state is COMPLETED 18:24:54.817984 27626 (odbc.c:3496):SQLExecute(0x650aa0) 18:24:54.818005 27626 (prepare_query.c:203):parsing 0 parameters 18:24:54.818018 27626 (odbc.c:3211):_SQLExecute(0x650aa0) 18:24:54.818030 27626 (odbc.c:3216):_SQLExecute() starting with state 0 18:24:54.818042 27626 (odbc.c:3334):End prepare, execute 18:24:54.818055 27626 (query.c:1818):tds_submit_execute() 18:24:54.818067 27626 (mem.c:615):tds_free_all_results() 18:24:54.818079 27626 (util.c:156):Changed query state from IDLE to QUERYING 18:24:54.818092 27626 (util.c:156):Changed query state from QUERYING to PENDING 18:24:54.818104 27626 (net.c:741):Sending packet 0000 0f 01 00 1a 00 00 00 00-e7 0f 00 02 00 0a 65 6d |........ ......em| 0010 75 62 35 30 39 30 30 30-00 00 |ub509000 ..| 18:24:54.818256 27626 (token.c:540):tds_process_tokens(0x62a450, 0x7fff488ba5d8, 0x7fff488ba5dc, 0x6914) 18:24:54.818285 27626 (util.c:156):Changed query state from PENDING to READING 18:24:54.850534 27626 (net.c:555):Received header 0000 04 01 00 74 00 00 00 00- |...t....| 18:24:54.850577 27626 (net.c:609):Received packet 0000 04 01 00 74 00 00 00 00-e7 0d 00 20 00 0a 65 6d |...t.... ... ..em| 0010 75 62 35 30 39 30 30 30-e5 50 00 e6 2e 00 00 00 |ub509000 .P......| 0020 10 05 35 32 30 31 30 00-01 00 3b 00 41 53 41 20 |..52010. ..;.ASA | 0030 46 65 68 6c 65 72 20 2d-31 31 30 3a 20 45 6c 65 |Fehler - 110: Ele| 0040 6d 65 6e 74 20 27 65 6d-75 62 35 30 39 30 30 30 |ment 'em ub509000| 0050 27 20 69 73 74 20 62 65-72 65 69 74 73 20 76 6f |' ist be reits vo| 0060 72 68 61 6e 64 65 6e 00-00 00 00 fd 02 00 01 00 |rhanden. ........| 0070 00 00 00 00 - |....| 18:24:54.850627 27626 (token.c:555):processing result tokens. marker is e7(TDS5_DYNAMIC) 18:24:54.850644 27626 (token.c:2588):tds_process_msg() reading message 12006 from server 18:24:54.850659 27626 (token.c:2661):tds_process_msg() calling client msg handler 18:24:54.850672 27626 (odbc.c:2270):msgno 12006 20003 18:24:54.850689 27626 (token.c:2674):tds_process_msg() returning TDS_SUCCEED 18:24:54.850716 27626 (token.c:555):processing result tokens. marker is fd(DONE) 18:24:54.850729 27626 (token.c:2339):tds_process_end: more_results = 0 was_cancelled = 0 error = 1 done_count_valid = 0 18:24:54.850742 27626 (token.c:2355):tds_process_end() state set to TDS_IDLE 18:24:54.850754 27626 (util.c:156):Changed query state from READING to IDLE 18:24:54.850766 27626 (token.c:2370): rows_affected = 0 18:24:54.850769 27626 (util.c:104):logic error: cannot change query state from IDLE to PENDING 18:24:54.850812 27626 (odbc.c:3534):odbc_process_tokens: tds_process_tokens returned 1 18:24:54.850825 27626 (odbc.c:3535): result_type=4052, TDS_DONE_COUNT=0, TDS_DONE_ERROR=2 18:24:54.850838 27626 (odbc.c:3575):odbc_process_tokens: row_count=-1 18:24:54.850851 27626 (odbc.c:3374):_SQLExecute: odbc_process_tokens returned result_type 4052 18:24:54.850864 27626 (odbc.c:3519):SQLExecute returns SQL_ERROR 18:24:54.851125 27626 (error.c:517):SQLGetDiagRec(3, 0x650aa0, 1, 0x7fff488ba220, 0x7fff488ba214, 0x7fff488ba230, 512, 0x7fff488ba218) 18:24:54.851159 27626 (error.c:566):SQLGetDiagRec: "[FreeTDS][SQL Server]ASA Fehler -110: Element 'emub509000' ist bereits vorhanden" 18:24:54.851220 27626 (error.c:517):SQLGetDiagRec(3, 0x650aa0, 2, 0x7fff488ba220, 0x7fff488ba214, 0x7fff488ba230, 512, 0x7fff488ba218) 18:24:54.857553 27626 (odbc.c:3980):SQLFreeHandle(3, 0x650aa0) 18:24:54.857574 27626 (odbc.c:4075):_SQLFreeStmt(0x650aa0, 1, 0) 18:24:54.857588 27626 (query.c:1935):tds_submit_unprepare() emub509000 18:24:54.857601 27626 (mem.c:615):tds_free_all_results() 18:24:54.857613 27626 (util.c:156):Changed query state from IDLE to QUERYING 18:24:54.857626 27626 (util.c:156):Changed query state from QUERYING to PENDING 18:24:54.857638 27626 (net.c:741):Sending packet 0000 0f 01 00 1a 00 00 00 00-e7 0f 00 04 00 0a 65 6d |........ ......em| 0010 75 62 35 30 39 30 30 30-00 00 |ub509000 ..| 18:24:54.857794 27626 (token.c:540):tds_process_tokens(0x62a450, 0x7fff488ba5d8, 0x7fff488ba5dc, 0x100) 18:24:54.857823 27626 (util.c:156):Changed query state from PENDING to READING 18:24:54.901500 27626 (net.c:555):Received header 0000 04 01 00 21 00 00 00 00- |...!....| 18:24:54.901548 27626 (net.c:609):Received packet 0000 04 01 00 21 00 00 00 00-e7 0d 00 20 00 0a 65 6d |...!.... ... ..em| 0010 75 62 35 30 39 30 30 30-fd 00 00 01 00 00 00 00 |ub509000 ........| 0020 00 - |.| 18:24:54.901575 27626 (token.c:555):processing result tokens. marker is e7(TDS5_DYNAMIC) 18:24:54.901590 27626 (token.c:555):processing result tokens. marker is fd(DONE) 18:24:54.901603 27626 (token.c:2339):tds_process_end: more_results = 0 was_cancelled = 0 error = 0 done_count_valid = 0 18:24:54.901616 27626 (token.c:2355):tds_process_end() state set to TDS_IDLE 18:24:54.901627 27626 (util.c:156):Changed query state from READING to IDLE 18:24:54.901640 27626 (token.c:2370): rows_affected = 0 18:24:54.901652 27626 (util.c:104):logic error: cannot change query state from IDLE to PENDING 18:24:54.901664 27626 (token.c:540):tds_process_tokens(0x62a450, 0x7fff488ba5d8, 0x7fff488ba5dc, 0x100) 18:24:54.901677 27626 (token.c:543):tds_process_tokens() state is COMPLETED 18:25:02.446402 27626 (odbc.c:1716):SQLAllocStmt(0x628ff0, 0x667360) 18:25:02.446436 27626 (odbc.c:1615):_SQLAllocStmt(0x628ff0, 0x667360) 18:25:02.446455 27626 (odbc.c:4388):SQLGetStmtAttr(0x650aa0, 10010, 0x7fff488ba6f8, 8, (nil)) 18:25:02.446503 27626 (odbc.c:4388):SQLGetStmtAttr(0x650aa0, 10011, 0x7fff488ba6f8, 8, (nil)) 18:25:02.446522 27626 (odbc.c:4388):SQLGetStmtAttr(0x650aa0, 10012, 0x7fff488ba6f8, 8, (nil)) 18:25:02.446536 27626 (odbc.c:4388):SQLGetStmtAttr(0x650aa0, 10013, 0x7fff488ba6f8, 8, (nil)) 18:25:02.446647 27626 (odbc.c:4445):SQLPrepare(0x650aa0, SELECT MdNummer FROM dba.michaelstest;, 38) 18:25:02.446669 27626 (odbc.c:4490):Creating prepared statement 18:25:02.446685 27626 (mem.c:615):tds_free_all_results() 18:25:02.446698 27626 (util.c:156):Changed query state from IDLE to QUERYING 18:25:02.446729 27626 (util.c:156):Changed query state from QUERYING to PENDING 18:25:02.446743 27626 (net.c:741):Sending packet 0000 0f 01 00 5a 00 00 00 00-e7 4f 00 01 00 0a 65 6d |...Z.... .O....em| 0010 75 62 35 30 63 30 30 30-40 00 63 72 65 61 74 65 |ub50c000 @.create| 0020 20 70 72 6f 63 20 65 6d-75 62 35 30 63 30 30 30 | proc em ub50c000| 0030 20 61 73 20 53 45 4c 45-43 54 20 4d 64 4e 75 6d | as SELE CT MdNum| 0040 6d 65 72 20 46 52 4f 4d-20 64 62 61 2e 6d 69 63 |mer FROM dba.mic| 0050 68 61 65 6c 73 74 65 73-74 3b |haelstes t;| 18:25:02.446893 27626 (token.c:540):tds_process_tokens(0x62a450, 0x7fff488ba668, 0x7fff488ba66c, 0x104) 18:25:02.446923 27626 (util.c:156):Changed query state from PENDING to READING 18:25:02.480110 27626 (net.c:555):Received header 0000 04 01 00 21 00 00 00 00- |...!....| 18:25:02.480162 27626 (net.c:609):Received packet 0000 04 01 00 21 00 00 00 00-e7 0d 00 20 00 0a 65 6d |...!.... ... ..em| 0010 75 62 35 30 63 30 30 30-fd 00 00 01 00 00 00 00 |ub50c000 ........| 0020 00 - |.| 18:25:02.480190 27626 (token.c:555):processing result tokens. marker is e7(TDS5_DYNAMIC) 18:25:02.480206 27626 (token.c:555):processing result tokens. marker is fd(DONE) 18:25:02.480219 27626 (token.c:2339):tds_process_end: more_results = 0 was_cancelled = 0 error = 0 done_count_valid = 0 18:25:02.480232 27626 (token.c:2355):tds_process_end() state set to TDS_IDLE 18:25:02.480244 27626 (util.c:156):Changed query state from READING to IDLE 18:25:02.480257 27626 (token.c:2370): rows_affected = 0 18:25:02.480302 27626 (util.c:104):logic error: cannot change query state from IDLE to PENDING 18:25:02.480348 27626 (token.c:540):tds_process_tokens(0x62a450, 0x7fff488ba668, 0x7fff488ba66c, 0x104) 18:25:02.480368 27626 (token.c:543):tds_process_tokens() state is COMPLETED 18:25:02.480636 27626 (odbc.c:3496):SQLExecute(0x650aa0) 18:25:02.480656 27626 (prepare_query.c:203):parsing 0 parameters 18:25:02.480669 27626 (odbc.c:3211):_SQLExecute(0x650aa0) 18:25:02.480681 27626 (odbc.c:3216):_SQLExecute() starting with state 0 18:25:02.480693 27626 (odbc.c:3334):End prepare, execute 18:25:02.480706 27626 (query.c:1818):tds_submit_execute() 18:25:02.480718 27626 (mem.c:615):tds_free_all_results() 18:25:02.480730 27626 (util.c:156):Changed query state from IDLE to QUERYING 18:25:02.480743 27626 (util.c:156):Changed query state from QUERYING to PENDING 18:25:02.480755 27626 (net.c:741):Sending packet 0000 0f 01 00 1a 00 00 00 00-e7 0f 00 02 00 0a 65 6d |........ ......em| 0010 75 62 35 30 63 30 30 30-00 00 |ub50c000 ..| 18:25:02.480948 27626 (token.c:540):tds_process_tokens(0x62a450, 0x7fff488ba5d8, 0x7fff488ba5dc, 0x6914) 18:25:02.480977 27626 (util.c:156):Changed query state from PENDING to READING 18:25:02.516938 27626 (net.c:555):Received header 0000 04 01 00 74 00 00 00 00- |...t....| 18:25:02.516979 27626 (net.c:609):Received packet 0000 04 01 00 74 00 00 00 00-e7 0d 00 20 00 0a 65 6d |...t.... ... ..em| 0010 75 62 35 30 63 30 30 30-e5 50 00 e6 2e 00 00 00 |ub50c000 .P......| 0020 10 05 35 32 30 31 30 00-01 00 3b 00 41 53 41 20 |..52010. ..;.ASA | 0030 46 65 68 6c 65 72 20 2d-31 31 30 3a 20 45 6c 65 |Fehler - 110: Ele| 0040 6d 65 6e 74 20 27 65 6d-75 62 35 30 63 30 30 30 |ment 'em ub50c000| 0050 27 20 69 73 74 20 62 65-72 65 69 74 73 20 76 6f |' ist be reits vo| 0060 72 68 61 6e 64 65 6e 00-00 00 00 fd 02 00 01 00 |rhanden. ........| 0070 00 00 00 00 - |....| 18:25:02.517028 27626 (token.c:555):processing result tokens. marker is e7(TDS5_DYNAMIC) 18:25:02.517044 27626 (token.c:2588):tds_process_msg() reading message 12006 from server 18:25:02.517059 27626 (token.c:2661):tds_process_msg() calling client msg handler 18:25:02.517071 27626 (odbc.c:2270):msgno 12006 20003 18:25:02.517089 27626 (token.c:2674):tds_process_msg() returning TDS_SUCCEED 18:25:02.517101 27626 (token.c:555):processing result tokens. marker is fd(DONE) 18:25:02.517126 27626 (token.c:2339):tds_process_end: more_results = 0 was_cancelled = 0 error = 1 done_count_valid = 0 18:25:02.517140 27626 (token.c:2355):tds_process_end() state set to TDS_IDLE 18:25:02.517152 27626 (util.c:156):Changed query state from READING to IDLE 18:25:02.517164 27626 (token.c:2370): rows_affected = 0 18:25:02.517176 27626 (util.c:104):logic error: cannot change query state from IDLE to PENDING 18:25:02.517188 27626 (odbc.c:3534):odbc_process_tokens: tds_process_tokens returned 1 18:25:02.517200 27626 (odbc.c:3535): result_type=4052, TDS_DONE_COUNT=0, TDS_DONE_ERROR=2 18:25:02.517212 27626 (odbc.c:3575):odbc_process_tokens: row_count=-1 18:25:02.517224 27626 (odbc.c:3374):_SQLExecute: odbc_process_tokens returned result_type 4052 18:25:02.517237 27626 (odbc.c:3519):SQLExecute returns SQL_ERROR 18:25:02.517336 27626 (error.c:517):SQLGetDiagRec(3, 0x650aa0, 1, 0x7fff488ba220, 0x7fff488ba214, 0x7fff488ba230, 512, 0x7fff488ba218) 18:25:02.517360 27626 (error.c:566):SQLGetDiagRec: "[FreeTDS][SQL Server]ASA Fehler -110: Element 'emub50c000' ist bereits vorhanden" 18:25:02.517415 27626 (error.c:517):SQLGetDiagRec(3, 0x650aa0, 2, 0x7fff488ba220, 0x7fff488ba214, 0x7fff488ba230, 512, 0x7fff488ba218) 18:25:02.524060 27626 (odbc.c:3980):SQLFreeHandle(3, 0x650aa0) 18:25:02.524082 27626 (odbc.c:4075):_SQLFreeStmt(0x650aa0, 1, 0) 18:25:02.524095 27626 (query.c:1935):tds_submit_unprepare() emub50c000 18:25:02.524108 27626 (mem.c:615):tds_free_all_results() 18:25:02.524120 27626 (util.c:156):Changed query state from IDLE to QUERYING 18:25:02.524133 27626 (util.c:156):Changed query state from QUERYING to PENDING 18:25:02.524145 27626 (net.c:741):Sending packet 0000 0f 01 00 1a 00 00 00 00-e7 0f 00 04 00 0a 65 6d |........ ......em| 0010 75 62 35 30 63 30 30 30-00 00 |ub50c000 ..| 18:25:02.524292 27626 (token.c:540):tds_process_tokens(0x62a450, 0x7fff488ba5d8, 0x7fff488ba5dc, 0x100) 18:25:02.524322 27626 (util.c:156):Changed query state from PENDING to READING 18:25:02.568188 27626 (net.c:555):Received header 0000 04 01 00 21 00 00 00 00- |...!....| 18:25:02.568240 27626 (net.c:609):Received packet 0000 04 01 00 21 00 00 00 00-e7 0d 00 20 00 0a 65 6d |...!.... ... ..em| 0010 75 62 35 30 63 30 30 30-fd 00 00 01 00 00 00 00 |ub50c000 ........| 0020 00 - |.| 18:25:02.568266 27626 (token.c:555):processing result tokens. marker is e7(TDS5_DYNAMIC) 18:25:02.568311 27626 (token.c:555):processing result tokens. marker is fd(DONE) 18:25:02.568326 27626 (token.c:2339):tds_process_end: more_results = 0 was_cancelled = 0 error = 0 done_count_valid = 0 18:25:02.568339 27626 (token.c:2355):tds_process_end() state set to TDS_IDLE 18:25:02.568351 27626 (util.c:156):Changed query state from READING to IDLE 18:25:02.568364 27626 (token.c:2370): rows_affected = 0 18:25:02.568376 27626 (util.c:104):logic error: cannot change query state from IDLE to PENDING 18:25:02.568388 27626 (token.c:540):tds_process_tokens(0x62a450, 0x7fff488ba5d8, 0x7fff488ba5dc, 0x100) 18:25:02.568401 27626 (token.c:543):tds_process_tokens() state is COMPLETED 18:25:04.734217 27626 (odbc.c:2240):SQLDisconnect(0x628ff0) 18:25:04.734247 27626 (mem.c:615):tds_free_all_results() 18:25:04.734343 27626 (util.c:156):Changed query state from IDLE to DEAD 18:25:04.734371 27626 (odbc.c:4040):SQLFreeConnect(0x628ff0) 18:25:04.734385 27626 (odbc.c:4006):_SQLFreeConnect(0x628ff0) 18:25:04.734400 27626 (odbc.c:4063):SQLFreeEnv(0x625470) 18:25:04.734413 27626 (odbc.c:4050):_SQLFreeEnv(0x625470) From venkatakrishnat1 at gmail.com Fri Dec 26 11:37:33 2014 From: venkatakrishnat1 at gmail.com (venkata krishna Thaluru) Date: Fri, 26 Dec 2014 22:07:33 +0530 Subject: [freetds] Only one between SERVER, SERVERNAME and DSN Message-ID: Hi All, I am getting the below exception ,when i try to connect to MSSQL Server. Only one between SERVER, SERVERNAME and DSN I have checked the code ,we are thowing the below exception . Please see the details below. if (CHK_PARAM(Server)) { /* error if servername or DSN specified */ if ((cfgs & (CFG_DSN|CFG_SERVERNAME)) != 0) { tds_dstr_free(&value); odbc_errs_add(errs, "HY000", "Only one between SERVER, SERVERNAME and DSN can be specified"); return 0; } } else if (CHK_PARAM(Servername)) { if ((cfgs & (CFG_DSN|CFG_SERVER)) != 0) { tds_dstr_free(&value); odbc_errs_add(errs, "HY000", "Only one between SERVER, SERVERNAME and DSN can be specified"); return 0; } else if (CHK_PARAM(DSN)) { if ((cfgs & (CFG_SERVER|CFG_SERVERNAME)) != 0) { tds_dstr_free(&value); odbc_errs_add(errs, "HY000", "Only one between SERVER, SERVERNAME and DSN can be specified"); return 0; } I have downloaded the freetds-0.92.812 from site and i have run the following commands (./configure,make,make install) and copied those binaries ,When i try to connect to MSSQL server , I am getting the above exception. Could you please let us know ,if i am missed any configurations or compilation ? Thanks in advance . Thanks Venkata Krishna From venkatakrishnat1 at gmail.com Fri Dec 26 12:17:49 2014 From: venkatakrishnat1 at gmail.com (venkata krishna Thaluru) Date: Fri, 26 Dec 2014 22:47:49 +0530 Subject: [freetds] Regarding 32 bit and 64 bit RPMS Message-ID: Hi All, We are using 32 bit CentOS 5.8 and 64 bit for Redhat linux 5 . Could you please share the name of the rpms for 32 bit and 64 bit . Thanks in advance . Thanks Venkata Krishna