Skip to content

Instantly share code, notes, and snippets.

@metaskills
Created June 2, 2011 11:07
Show Gist options
  • Save metaskills/1004252 to your computer and use it in GitHub Desktop.
Save metaskills/1004252 to your computer and use it in GitHub Desktop.
$ tsql -H host -p 1433 -U user -P '0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijk'
locale is "en_US.UTF-8"
locale charset is "UTF-8"
using default charset "UTF-8"
Msg 4064 (severity 11, state 1) from SQLSERVER08 Line 1:
"Cannot open user default database. Login failed."
Msg 18456 (severity 14, state 1) from SQLSERVER08 Line 1:
"Login failed for user 'tinytdslong'."
Error 20002 (severity 9):
Adaptive Server connection failed
There was a problem connecting to the server
log.c:196:Starting log file for FreeTDS 0.91RC2
on 2011-06-02 07:04:40 with debug flags 0x4fff.
iconv.c:330:tds_iconv_open(0x100200800, 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 10.0.1.55 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 02 4d 53 53 51-4c 53 65 72 76 65 72 00 |U...MSSQ LServer.|
0030 e5 97 00 00 - |å...|
net.c:555:Received header
0000 04 01 00 25 00 00 01 00- |...%....|
net.c:609:Received packet
0000 04 01 00 25 00 00 01 00-00 00 15 00 06 01 00 1b |...%.... ........|
0010 00 01 02 00 1c 00 01 03-00 1d 00 00 ff 0a 00 06 |........ ....ÿ...|
0020 40 00 00 02 00 - |@....|
login.c:1057:detected flag 2
login.c:782:quietly sending TDS 7+ login packet
token.c:328:tds_process_login_tokens()
net.c:555:Received header
0000 04 01 01 03 00 36 01 00- |.....6..|
net.c:609:Received packet
0000 04 01 01 03 00 36 01 00-aa 82 00 e0 0f 00 00 01 |.....6.. ª..à....|
0010 0b 30 00 43 00 61 00 6e-00 6e 00 6f 00 74 00 20 |.0.C.a.n .n.o.t. |
0020 00 6f 00 70 00 65 00 6e-00 20 00 75 00 73 00 65 |.o.p.e.n . .u.s.e|
0030 00 72 00 20 00 64 00 65-00 66 00 61 00 75 00 6c |.r. .d.e .f.a.u.l|
0040 00 74 00 20 00 64 00 61-00 74 00 61 00 62 00 61 |.t. .d.a .t.a.b.a|
0050 00 73 00 65 00 2e 00 20-00 4c 00 6f 00 67 00 69 |.s.e... .L.o.g.i|
0060 00 6e 00 20 00 66 00 61-00 69 00 6c 00 65 00 64 |.n. .f.a .i.l.e.d|
0070 00 2e 00 0b 53 00 51 00-4c 00 53 00 45 00 52 00 |....S.Q. L.S.E.R.|
0080 56 00 45 00 52 00 30 00-38 00 00 01 00 aa 6a 00 |V.E.R.0. 8....ªj.|
0090 18 48 00 00 01 0e 24 00-4c 00 6f 00 67 00 69 00 |.H....$. L.o.g.i.|
00a0 6e 00 20 00 66 00 61 00-69 00 6c 00 65 00 64 00 |n. .f.a. i.l.e.d.|
00b0 20 00 66 00 6f 00 72 00-20 00 75 00 73 00 65 00 | .f.o.r. .u.s.e.|
00c0 72 00 20 00 27 00 74 00-69 00 6e 00 79 00 74 00 |r. .'.t. i.n.y.t.|
00d0 64 00 73 00 6c 00 6f 00-6e 00 67 00 27 00 2e 00 |d.s.l.o. n.g.'...|
00e0 0b 53 00 51 00 4c 00 53-00 45 00 52 00 56 00 45 |.S.Q.L.S .E.R.V.E|
00f0 00 52 00 30 00 38 00 00-01 00 fd 02 00 00 00 00 |.R.0.8.. ..ý.....|
0100 00 00 00 - |...|
token.c:337:looking for login token, got aa(ERROR)
token.c:122:tds_process_default_tokens() marker is aa(ERROR)
token.c:2591:tds_process_msg() reading message 4064 from server
token.c:2664:tds_process_msg() calling client msg handler
token.c:2677:tds_process_msg() returning TDS_SUCCEED
token.c:337:looking for login token, got aa(ERROR)
token.c:122:tds_process_default_tokens() marker is aa(ERROR)
token.c:2591:tds_process_msg() reading message 18456 from server
token.c:2664:tds_process_msg() calling client msg handler
token.c:2677:tds_process_msg() returning TDS_SUCCEED
token.c:337:looking for login token, got fd(DONE)
token.c:122:tds_process_default_tokens() marker is fd(DONE)
token.c:2342:tds_process_end: more_results = 0
was_cancelled = 0
error = 1
done_count_valid = 0
token.c:2358:tds_process_end() state set to TDS_IDLE
token.c:2373: rows_affected = 0
token.c:441:tds_process_login_tokens() returning TDS_FAIL
login.c:466:login packet accepted
util.c:156:Changed query state from IDLE to DEAD
util.c:331:tdserror(0x1002006f0, 0x100200800, 20002, 0)
util.c:361:tdserror: client library returned TDS_INT_CANCEL(2)
util.c:384:tdserror: returning TDS_INT_CANCEL(2)
mem.c:615:tds_free_all_results()
@mleglise
Copy link

Not sure where to ask this question, but how do you get tsql to dump out that extra debug info? I assume there's a compile flag or similar?

@metaskills
Copy link
Author

Most FreeTDS installs have debug mode turned on. Unless you have explicitly given it --disable-debug as specified here. http://www.freetds.org/userguide/config.htm

For the extra info, you can either specify a TDSDUMP environment variable (http://www.freetds.org/userguide/logging.htm) or a dump flag in the conf file (http://www.freetds.org/userguide/freetdsconf.htm) if you use such a thing.

@mleglise
Copy link

Thanks Ken! Much appreciation for your work on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment