Weird query results -- freetds query results differ from native windows

Patrick Spinler <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Hi:

I'm attempting to invoke a ms-sql db procedure via freetds.  I'm  using
freetds 0.82 on SuSE enterprise linux 10.1.  For comparison, I'm also
running the same queries in native windows ms-sql client using the MS
SQL Service Management Studio.

With one set of arguments I receive identical results on both
freetds/linux and native windows.

  exec inv_search_api 4527

However, when I execute the following query, I get different results in
freetds from native windows.  Under freetds, the procedure returns an
interal code indicating a permission error (result code=1001), under
windows, it returns a large set of result data (the expected result).

  exec inv_search_api 5240

Would anyone have any clue why, or places to start investigating, please?

I've attached a debugging log of the odd freetds result to the end of
this message (debug flags=0xffff in freetds.conf).

Thanks!
- -- Pat


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (SunOS)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFI88C5NObCqA8uBswRAod+AJ42reCNULCoXyYVi3p1joZsxlW2AwCgmBXM
MWScX553skI6N6BxK12e230=
=lddj
-----END PGP SIGNATURE-----

_______________________________________________
FreeTDS mailing list
[email protected]
http://lists.ibiblio.org/mailman/listinfo/freetds
tdsdump.log (text/x-log, 11.2 KB)
16:40:52.850850 2581 (log.c:190):Starting log file for FreeTDS 0.82
	on 2008-10-13 16:40:52 with debug flags 0xffff.
16:40:52.860225 2581 (iconv.c:197):names for ISO-8859-1: ISO-8859-1
16:40:52.860246 2581 (iconv.c:197):names for UTF-8: UTF-8
16:40:52.860257 2581 (iconv.c:197):names for UCS-2LE: UCS-2LE
16:40:52.860267 2581 (iconv.c:197):names for UCS-2BE: UCS-2BE
16:40:52.860277 2581 (iconv.c:363):iconv to convert client-side data to the "ANSI_X3.4-1968" character set
16:40:52.860316 2581 (iconv.c:516):tds_iconv_info_init: converting "US-ASCII"->"UCS-2LE"
16:40:52.860353 2581 (iconv.c:516):tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE"
16:40:52.860368 2581 (net.c:210):Connecting to 129.176.250.142 port 1433 (TDS version 8.0)
16:40:52.867666 2581 (net.c:264):tds_open_socket: connect(2) returned "Operation now in progress"
16:40:52.870136 2581 (net.c:303):tds_open_socket() succeeded
16:40:52.870163 2581 (util.c:162):Changed query state from DEAD to IDLE
16:40:52.870179 2581 (login.c:735):quietly sending TDS 7+ login packet
16:40:52.870252 2581 (token.c:312):tds_process_login_tokens()
16:40:52.872479 2581 (net.c:592):Received header
0000 04 01 01 7d 00 a1 01 00-                        |...}....|

16:40:52.872520 2581 (net.c:671):Received packet
0000 e3 1d 00 01 07 69 00 6e-00 76 00 64 00 61 00 74 |.....i.n .v.d.a.t|
0010 00 61 00 06 6d 00 61 00-73 00 74 00 65 00 72 00 |.a..m.a. s.t.e.r.|
0020 ab 68 00 45 16 00 00 02-00 26 00 43 00 68 00 61 |.h.E.... .&.C.h.a|
0030 00 6e 00 67 00 65 00 64-00 20 00 64 00 61 00 74 |.n.g.e.d . .d.a.t|
0040 00 61 00 62 00 61 00 73-00 65 00 20 00 63 00 6f |.a.b.a.s .e. .c.o|
0050 00 6e 00 74 00 65 00 78-00 74 00 20 00 74 00 6f |.n.t.e.x .t. .t.o|
0060 00 20 00 27 00 69 00 6e-00 76 00 64 00 61 00 74 |. .'.i.n .v.d.a.t|
0070 00 61 00 27 00 2e 00 08-52 00 43 00 48 00 53 00 |.a.'.... R.C.H.S.|
0080 51 00 4c 00 35 00 32 00-00 00 00 e3 08 00 07 05 |Q.L.5.2. ........|
0090 09 04 d0 00 34 00 e3 17-00 02 0a 75 00 73 00 5f |....4... ...u.s._|
00a0 00 65 00 6e 00 67 00 6c-00 69 00 73 00 68 00 00 |.e.n.g.l .i.s.h..|
00b0 ab 6a 00 47 16 00 00 01-00 27 00 43 00 68 00 61 |.j.G.... .'.C.h.a|
00c0 00 6e 00 67 00 65 00 64-00 20 00 6c 00 61 00 6e |.n.g.e.d . .l.a.n|
00d0 00 67 00 75 00 61 00 67-00 65 00 20 00 73 00 65 |.g.u.a.g .e. .s.e|
00e0 00 74 00 74 00 69 00 6e-00 67 00 20 00 74 00 6f |.t.t.i.n .g. .t.o|
00f0 00 20 00 75 00 73 00 5f-00 65 00 6e 00 67 00 6c |. .u.s._ .e.n.g.l|
0100 00 69 00 73 00 68 00 2e-00 08 52 00 43 00 48 00 |.i.s.h.. ..R.C.H.|
0110 53 00 51 00 4c 00 35 00-32 00 00 00 00 ad 36 00 |S.Q.L.5. 2.....6.|
0120 01 71 00 00 01 16 4d 00-69 00 63 00 72 00 6f 00 |.q....M. i.c.r.o.|
0130 73 00 6f 00 66 00 74 00-20 00 53 00 51 00 4c 00 |s.o.f.t.  .S.Q.L.|
0140 20 00 53 00 65 00 72 00-76 00 65 00 72 00 00 00 | .S.e.r. v.e.r...|
0150 00 00 08 00 08 8b e3 13-00 04 04 34 00 30 00 39 |........ ...4.0.9|
0160 00 36 00 04 34 00 30 00-39 00 36 00 fd 00 00 00 |.6..4.0. 9.6.....|
0170 00 00 00 00 00         -                        |.....|

16:40:52.872906 2581 (token.c:316):looking for login token, got  e3(ENVCHANGE)
16:40:52.872919 2581 (token.c:108):tds_process_default_tokens() marker is e3(ENVCHANGE)
16:40:52.872942 2581 (token.c:316):looking for login token, got  ab(INFO)
16:40:52.872953 2581 (token.c:108):tds_process_default_tokens() marker is ab(INFO)
16:40:52.872966 2581 (token.c:2451):tds_process_msg() reading message from server
16:40:52.872986 2581 (token.c:2516):tds_process_msg() calling client msg handler
16:40:52.872997 2581 (token.c:2529):tds_process_msg() returning TDS_SUCCEED
16:40:52.873007 2581 (token.c:316):looking for login token, got  e3(ENVCHANGE)
16:40:52.873018 2581 (token.c:108):tds_process_default_tokens() marker is e3(ENVCHANGE)
16:40:52.873029 2581 (token.c:2281):tds_process_env_chg(): 5 bytes of collation data received
16:40:52.873039 2581 (token.c:2282):tds->collation was
0000 00 00 00 00 00         -                        |.....|

16:40:52.873058 2581 (iconv.c:985):setting server single-byte charset to "CP1252"
16:40:52.873182 2581 (iconv.c:516):tds_iconv_info_init: converting "US-ASCII"->"CP1252"
16:40:52.873206 2581 (token.c:2292):tds->collation now
0000 09 04 d0 00 34         -                        |....4|

16:40:52.873223 2581 (token.c:316):looking for login token, got  e3(ENVCHANGE)
16:40:52.873234 2581 (token.c:108):tds_process_default_tokens() marker is e3(ENVCHANGE)
16:40:52.873247 2581 (token.c:316):looking for login token, got  ab(INFO)
16:40:52.873258 2581 (token.c:108):tds_process_default_tokens() marker is ab(INFO)
16:40:52.873269 2581 (token.c:2451):tds_process_msg() reading message from server
16:40:52.873283 2581 (token.c:2516):tds_process_msg() calling client msg handler
16:40:52.873293 2581 (token.c:2529):tds_process_msg() returning TDS_SUCCEED
16:40:52.873304 2581 (token.c:316):looking for login token, got  ad(LOGINACK)
16:40:52.873316 2581 (token.c:316):looking for login token, got  e3(ENVCHANGE)
16:40:52.873327 2581 (token.c:108):tds_process_default_tokens() marker is e3(ENVCHANGE)
16:40:52.873340 2581 (token.c:316):looking for login token, got  fd(DONE)
16:40:52.873351 2581 (token.c:108):tds_process_default_tokens() marker is fd(DONE)
16:40:52.873362 2581 (token.c:2201):tds_process_end: more_results = 0
		was_cancelled = 0
		error = 0
		done_count_valid = 0
16:40:52.873374 2581 (token.c:2217):tds_process_end() state set to TDS_IDLE
16:40:52.873384 2581 (token.c:2232):                rows_affected = 0
16:40:52.873394 2581 (token.c:393):leaving tds_process_login_tokens() returning 1
16:40:52.873412 2581 (mem.c:563):tds_free_all_results()
16:40:52.873423 2581 (util.c:162):Changed query state from IDLE to QUERYING
16:40:52.873434 2581 (write.c:136):tds_put_string converting 19 bytes of "set textsize 64512 "
16:40:52.873446 2581 (write.c:164):tds_put_string wrote 38 bytes
16:40:52.873457 2581 (util.c:162):Changed query state from QUERYING to PENDING
16:40:52.873469 2581 (net.c:779):Sending packet
0000 01 01 00 2e 00 00 00 00-73 00 65 00 74 00 20 00 |........ s.e.t. .|
0010 74 00 65 00 78 00 74 00-73 00 69 00 7a 00 65 00 |t.e.x.t. s.i.z.e.|
0020 20 00 36 00 34 00 35 00-31 00 32 00 20 00       | .6.4.5. 1.2. .|

16:40:52.873559 2581 (token.c:495):tds_process_tokens(0x80041380, 0x3fffffea79c, 0x3fffffea798, 0x100)
16:40:52.873582 2581 (util.c:162):Changed query state from PENDING to READING
16:40:52.874063 2581 (net.c:592):Received header
0000 04 01 00 11 00 a1 01 00-                        |........|

16:40:52.874093 2581 (net.c:671):Received packet
0000 fd 00 00 be 00 00 00 00-00                      |........ .|

16:40:52.874114 2581 (token.c:510):processing result tokens.  marker is  fd(DONE)
16:40:52.874126 2581 (token.c:2201):tds_process_end: more_results = 0
		was_cancelled = 0
		error = 0
		done_count_valid = 0
16:40:52.874137 2581 (token.c:2217):tds_process_end() state set to TDS_IDLE
16:40:52.874148 2581 (util.c:162):Changed query state from READING to IDLE
16:40:52.874159 2581 (token.c:2232):                rows_affected = 0
16:40:52.874169 2581 (util.c:110):logic error: cannot change query state from IDLE to PENDING
16:40:52.874180 2581 (token.c:495):tds_process_tokens(0x80041380, 0x3fffffea79c, 0x3fffffea798, 0x100)
16:40:52.874192 2581 (token.c:498):tds_process_tokens() state is COMPLETED
16:40:59.910435 2581 (mem.c:563):tds_free_all_results()
16:40:59.910514 2581 (util.c:162):Changed query state from IDLE to QUERYING
16:40:59.910527 2581 (write.c:136):tds_put_string converting 25 bytes of "exec inv_search_api 5240
"
16:40:59.910547 2581 (write.c:164):tds_put_string wrote 50 bytes
16:40:59.910558 2581 (util.c:162):Changed query state from QUERYING to PENDING
16:40:59.910570 2581 (net.c:779):Sending packet
0000 01 01 00 3a 00 00 01 00-65 00 78 00 65 00 63 00 |...:.... e.x.e.c.|
0010 20 00 69 00 6e 00 76 00-5f 00 73 00 65 00 61 00 | .i.n.v. _.s.e.a.|
0020 72 00 63 00 68 00 5f 00-61 00 70 00 69 00 20 00 |r.c.h._. a.p.i. .|
0030 35 00 32 00 34 00 30 00-0a 00                   |5.2.4.0. ..|

16:40:59.910671 2581 (token.c:495):tds_process_tokens(0x80041380, 0x3fffffeabfc, (nil), 0x6914)
16:40:59.910686 2581 (util.c:162):Changed query state from PENDING to READING
16:41:00.100567 2581 (net.c:592):Received header
0000 04 01 00 31 00 a1 01 00-                        |...1....|

16:41:00.100615 2581 (net.c:671):Received packet
0000 ff 01 00 c1 00 00 00 00-00 ff 01 00 c1 00 00 00 |........ ........|
0010 00 00 ff 01 00 c1 00 00-00 00 00 79 e9 03 00 00 |........ ...y....|
0020 fe 00 00 e0 00 01 00 00-00                      |........ .|

16:41:00.100668 2581 (token.c:510):processing result tokens.  marker is  ff(DONEINPROC)
16:41:00.100681 2581 (token.c:2201):tds_process_end: more_results = 1
		was_cancelled = 0
		error = 0
		done_count_valid = 0
16:41:00.100693 2581 (token.c:2232):                rows_affected = 0
16:41:00.100704 2581 (util.c:162):Changed query state from READING to PENDING
16:41:00.100715 2581 (token.c:495):tds_process_tokens(0x80041380, 0x3fffffeabfc, (nil), 0x6914)
16:41:00.100727 2581 (util.c:162):Changed query state from PENDING to READING
16:41:00.100738 2581 (token.c:510):processing result tokens.  marker is  ff(DONEINPROC)
16:41:00.100748 2581 (token.c:2201):tds_process_end: more_results = 1
		was_cancelled = 0
		error = 0
		done_count_valid = 0
16:41:00.100760 2581 (token.c:2232):                rows_affected = 0
16:41:00.100770 2581 (util.c:162):Changed query state from READING to PENDING
16:41:00.100785 2581 (token.c:495):tds_process_tokens(0x80041380, 0x3fffffeabfc, (nil), 0x6914)
16:41:00.100796 2581 (util.c:162):Changed query state from PENDING to READING
16:41:00.100807 2581 (token.c:510):processing result tokens.  marker is  ff(DONEINPROC)
16:41:00.100818 2581 (token.c:2201):tds_process_end: more_results = 1
		was_cancelled = 0
		error = 0
		done_count_valid = 0
16:41:00.100829 2581 (token.c:2232):                rows_affected = 0
16:41:00.100840 2581 (util.c:162):Changed query state from READING to PENDING
16:41:00.100850 2581 (token.c:495):tds_process_tokens(0x80041380, 0x3fffffeabfc, (nil), 0x6914)
16:41:00.100862 2581 (util.c:162):Changed query state from PENDING to READING
16:41:00.100872 2581 (token.c:510):processing result tokens.  marker is  79(RETURNSTATUS)
16:41:00.100883 2581 (token.c:645):tds_process_tokens: return status is 1001
16:41:00.100894 2581 (util.c:162):Changed query state from READING to PENDING
16:41:00.100913 2581 (token.c:495):tds_process_tokens(0x80041380, 0x3fffffeabfc, (nil), 0x6914)
16:41:00.100925 2581 (util.c:162):Changed query state from PENDING to READING
16:41:00.100936 2581 (token.c:510):processing result tokens.  marker is  fe(DONEPROC)
16:41:00.100947 2581 (token.c:2201):tds_process_end: more_results = 0
		was_cancelled = 0
		error = 0
		done_count_valid = 0
16:41:00.100958 2581 (token.c:2217):tds_process_end() state set to TDS_IDLE
16:41:00.100968 2581 (util.c:162):Changed query state from READING to IDLE
16:41:00.100979 2581 (token.c:2232):                rows_affected = 1
16:41:00.100989 2581 (util.c:110):logic error: cannot change query state from IDLE to PENDING
16:41:00.101000 2581 (token.c:495):tds_process_tokens(0x80041380, 0x3fffffeabfc, (nil), 0x6914)
16:41:00.101011 2581 (token.c:498):tds_process_tokens() state is COMPLETED
16:41:01.486160 2581 (mem.c:563):tds_free_all_results()
16:41:01.486309 2581 (util.c:162):Changed query state from IDLE to DEAD
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.