Skip to Content.
Sympa Menu

freetds - Re: [freetds] RE : location of config parameter?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: <loic.cloatre AT orange.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] RE : location of config parameter?
  • Date: Mon, 19 Dec 2011 10:18:24 +0100

Hi,

I am interested to see your changes too, I can test it on our Sybase 15.0.1.

I am looking in my log file to see where I have to call dbsetlname: not easy
:-)

in tds_process_login_tokens(TDSSOCKET * tds) which "is called after sending
the login packet to the server"
Or before sending the login packet (maybe in tds_send_login)?

If I send bit 83 set to one: I need to change defaultcaps to add 2 bytes?
-->
static const unsigned char defaultcaps[] = {
/* type, len, data, data, data, data, data, data, data, data, data (9
bytes) */
0x01, 0x09, 0x00, 0x08, 0x0E, 0x6D, 0x7F, 0xFF, 0xFF, 0xFF, 0xFE,
0x02, 0x09, 0x00, 0x00, 0x00, 0x00, 0x02, 0x68, 0x00, 0x00, 0x00
//add 2 bytes with bit 83 set to one b(0001 0000)
, 0x00, 0x10
};


Loic


My log for info:

log.c:196:Starting log file for FreeTDS 0.91
on 2011-12-16 17:17:16 with debug flags 0x4fff.
config.c:714:Setting 'dump_file' to '/tmp/freetdsLoic.log' from $TDSDUMP.
iconv.c:330:tds_iconv_open(0x9299e0, ISO-8859-1)
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 "ISO-8859-1"
iconv.c:351:preparing iconv for "ISO-8859-1" <-> "UCS-2LE" conversion
iconv.c:391:preparing iconv for "ISO-8859-1" <-> "ISO-8859-1" conversion
iconv.c:394:tds_iconv_open: done
net.c:205:Connecting to 192.169.155.12 port 5000 (TDS version 5.0)
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-6d 73 70 66 74 2d 74 65 |........ mspft-te|
...

net.c:741:Sending packet
0000 02 01 00 61 00 00 00 00-00 00 00 00 00 00 0a 00 |...a.... ........|
0010 00 00 00 00 00 00 00 00-00 00 00 00 00 69 73 6f |........ .....iso|
0020 5f 31 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |_1...... ........|
...

token.c:328:tds_process_login_tokens()
net.c:555:Received header
0000 04 01 00 a1 00 00 00 00- |........|

net.c:609:Received packet
0000 04 01 00 a1 00 00 00 00-e3 0f 00 01 06 6d 61 73 |........ .....mas|
0010 74 65 72 06 6d 61 73 74-65 72 e5 42 00 45 16 00 |ter.mast er.B.E..|
0020 00 02 0a 05 5a 5a 5a 5a-5a 00 01 00 26 00 43 68 |....ZZZZ Z...&.Ch|
0030 61 6e 67 65 64 20 64 61-74 61 62 61 73 65 20 63 |anged da tabase c|
0040 6f 6e 74 65 78 74 20 74-6f 20 27 6d 61 73 74 65 |ontext t o 'maste|
0050 72 27 2e 0a 07 6d 73 70-69 64 5f 65 00 00 00 e3 |r'...msp id_e....|
0060 06 00 04 03 35 31 32 00-ad 14 00 05 05 00 00 00 |....512. ........|
0070 0a 73 71 6c 20 73 65 72-76 65 72 0f 00 00 00 e2 |.sql ser ver.....|
0080 16 00 01 09 00 08 0a 61-7f ff ff ff e6 02 09 00 |.......a ........|
0090 00 00 00 02 00 00 00 00-fd 00 00 02 00 56 01 00 |........ .....V..|
00a0 00 - |.|

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(0x9299e0, 1, master, master)
token.c:337:looking for login token, got e5(EED)
token.c:122:tds_process_default_tokens() marker is e5(EED)
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(0x6ce560, 0x9299e0, 0x7fbfffecb0)
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:2477:changing block size from to 512
dblib.c:327:db_env_chg(0x9299e0, 4, , 512)
token.c:337:looking for login token, got ad(LOGINACK)
token.c:373:server reports TDS version 5.0.0.0
token.c:375:Product name for 0x5000000 is unknown
token.c:337:looking for login token, got e2(CAPABILITY)
token.c:122:tds_process_default_tokens() marker is e2(CAPABILITY)
token.c:337:looking for login token, got fd(DONE)
token.c:122:tds_process_default_tokens() marker is fd(DONE)
token.c:2339:tds_process_end: more_results = 0
was_cancelled = 0
error = 0
done_count_valid = 0



> Correction: while the message comes from the server, Laco is
> right that it is a function of the capabilities sent after
> the login. See my message on this ML of 16 November 2011,
> and Ludo's reply wherein he confirms that modified
> capabilities solve the problem. Patches welcome! :-)
>
Hardcoding a new defaultcaps was the easy part and I have no problems
sharing the changes I made. To make a patch I need some more info:
- the questions around ENABLE_EXTRA_CHECKS I raised back in november (nov
16th). I re-read my message and it was actually a question without question
marks ;)
- since this is a sybase only extension, I assume the TDS_REQ_LARGEIDENT
capability request should be set only for recent Sybase servers, based on
the existence of the SYBECAPTYP error. What are the possibilities?
Add a freetds custom option for dbsetlname? LARGEIDENT (false or true) or,
for the brave hearted but more flexible, CUSTOMCAPS that would simply call
set_capabilities(login, values, TDS_MAX_CAPABILITY)?
- I have only a very limited number of server versions to test with. I'll
need some help there.

Ludo


_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds

_________________________________________________________________________________________________________________________

Ce message et ses pieces jointes peuvent contenir des informations
confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu
ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages
electroniques etant susceptibles d'alteration,
France Telecom - Orange decline toute responsabilite si ce message a ete
altere, deforme ou falsifie. Merci

This message and its attachments may contain confidential or privileged
information that may be protected by law;
they should not be distributed, used or copied without authorization.
If you have received this email in error, please notify the sender and delete
this message and its attachments.
As emails may be altered, France Telecom - Orange shall not be liable if this
message was modified, changed or falsified.
Thank you.





Archive powered by MHonArc 2.6.24.

Top of Page