FreeTDS/freetds

Embedded Sybase login failure

jdD77 opened this issue · 2 comments

Hi,

While trying to connect to embedded sybase database from (ibm's netcool omnibus), i am able to connect till freetds 1.3.21.
However i'm not able to connect to newer versions, due to introduced code not supported by our vendor in login.c:tds_setup_connection().

Would it be possible to get a fix for this issue ?

Thanks in advance.
Kr
Jean

NB: related to previously solved issue:

Error:
"Msg 20000 (severity 0, state 0) from OMNI1:
"ERROR=Parse failure on line 1 of statement 'SELECT CONVERT(NVARCHAR(3), 'abc') nvc...', at or near 'nvc'"
There was a problem connecting to the server"

Here some logs of the failure:

log.c:187:Starting log file for FreeTDS 1.4.22 with debug flags 0x4fff.
iconv.c:371:tds_iconv_open(0xa607c0, ISO-8859-1, 1)
iconv.c:202:local name for ISO-8859-1 is ISO-8859-1
iconv.c:202:local name for UTF-8 is UTF-8
iconv.c:202:local name for UCS-2LE is UCS-2LE
iconv.c:202:local name for UCS-2BE is UCS-2BE
iconv.c:390:setting up conversions for client charset "ISO-8859-1"
iconv.c:392:preparing iconv for "ISO-8859-1" <-> "UCS-2LE" conversion
iconv.c:431:tds_iconv_open: done
net.c:391:Connecting with protocol version 5.0
net.c:318:Connecting to 1.2.3.4 port 5678
net.c:340:tds_setup_socket: connect(2) returned "Operation now in progress"
net.c:528:tds_open_socket() succeeded
packet.c:852:Sending packet
...
01d0 00 0c 05 00 00 00 54 44-53 2d 4c 69 62 72 61 72 |......TD S-Librar|
01e0 0a 05 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...... ........|

packet.c:852:Sending packet
0000 02 01 00 6b 00 00 00 00-00 00 00 00 00 00 0a 00 |...k.... ........|
0010 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........|
0020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........|
0030 00 00 00 00 00 00 00 00-00 00 00 00 01 35 31 32 |........ .....512|
0040 00 00 00 03 00 00 00 00-e2 20 00 01 0e 00 00 60 |........ . .....`|
0050 08 81 81 e8 0f 6d 7f ff-ff ff fe 02 0e 00 00 00 |.....m.. ........|
0060 00 00 00 00 00 00 02 68-00 00 00 |.......h ...|

token.c:418:tds_process_login_tokens()
packet.c:410:Received packet
0000 0f 01 00 55 00 00 01 00-e3 07 00 04 04 38 31 39 |...U.... .....819|
0010 32 00 ad 14 00 05 05 00-00 00 0a 4f 70 65 6e 53 |2....... ...OpenS|
0020 65 72 76 65 72 0f 00 00-00 e2 20 00 01 0e 00 00 |erver... .. .....|
0030 00 08 81 81 e8 0a 61 7f-ff ff ff fe 02 0e 00 00 |......a. ........|
0040 00 00 00 01 fa a7 81 f2-68 00 00 00 fd 00 00 00 |........ h.......|
0050 00 00 00 00 00 - |.....|

token.c:422:looking for login token, got e3(ENVCHANGE)
token.c:131:tds_process_default_tokens() marker is e3(ENVCHANGE)
token.c:2289:changing block size from to 8192
token.c:422:looking for login token, got ad(LOGINACK)
token.c:348:server reports TDS version 5.0.0.0
token.c:350:Product name for 0x5000000 is unknown
token.c:384:Product version F000000
token.c:422:looking for login token, got e2(CAPABILITY)
token.c:131:tds_process_default_tokens() marker is e2(CAPABILITY)
token.c:422:looking for login token, got fd(DONE)
token.c:131:tds_process_default_tokens() marker is fd(DONE)
token.c:2100:tds_process_end: more_results = 0
was_cancelled = 0
error = 0
done_count_valid = 0
token.c:2119: rows_affected = 0
token.c:2122:tds_process_end() state set to TDS_IDLE
token.c:445:tds_process_login_tokens() returning TDS_SUCCESS
mem.c:665:tds_free_all_results()
util.c:179:Changed query state from IDLE to WRITING
packet.c:852:Sending packet
0000 0f 01 00 7f 00 00 00 00-21 72 00 00 00 00 53 45 |........ !r....SE|
0010 4c 45 43 54 20 40 40 73-70 69 64 20 73 70 69 64 |LECT @@s pid spid|
0020 0a 53 45 4c 45 43 54 20-43 4f 4e 56 45 52 54 28 |.SELECT CONVERT(|
0030 4e 56 41 52 43 48 41 52-28 33 29 2c 20 27 61 62 |NVARCHAR (3), 'ab|
0040 63 27 29 20 6e 76 63 0a-45 58 45 43 55 54 45 20 |c') nvc. EXECUTE |
0050 28 27 53 45 4c 45 43 54-20 43 4f 4e 56 45 52 54 |('SELECT CONVERT|
0060 28 55 4e 49 56 41 52 43-48 41 52 28 33 29 2c 20 |(UNIVARC HAR(3), |
0070 27 27 78 79 7a 27 27 29-20 75 76 63 27 29 0a |''xyz'') uvc').|

util.c:179:Changed query state from WRITING to PENDING
token.c:555:tds_process_tokens(0xa60b90, 0x7fff39aaa1c8, 0x7fff39aaa1cc, 0x500)
util.c:179:Changed query state from PENDING to READING
packet.c:410:Received packet
0000 0f 01 00 7f 00 00 01 00-e5 6b 00 20 4e 00 00 00 |........ .k. N...|
0010 00 00 00 00 00 52 00 45-52 52 4f 52 3d 50 61 72 |.....R.E RROR=Par|
0020 73 65 20 66 61 69 6c 75-72 65 20 6f 6e 20 6c 69 |se failu re on li|
0030 6e 65 20 31 20 6f 66 20-73 74 61 74 65 6d 65 6e |ne 1 of statemen|
0040 74 20 27 53 45 4c 45 43-54 20 40 40 73 70 69 64 |t 'SELEC T @@spid|
0050 20 73 70 69 64 2e 2e 2e-27 2c 20 61 74 20 6f 72 | spid... ', at or|
...

token.c:570:processing result tokens. marker is e5(EED)
token.c:131:tds_process_default_tokens() marker is e5(EED)
mem.c:665:tds_free_all_results()
token.c:2402:tds_process_info() reading message 20000 from server
token.c:2497:tds_process_info() calling client msg handler
token.c:2514:tds_process_info() returning TDS_SUCCESS
token.c:570:processing result tokens. marker is fd(DONE)
token.c:2100:tds_process_end: more_results = 0
was_cancelled = 0
error = 1
done_count_valid = 0
token.c:2119: rows_affected = 0
token.c:2122:tds_process_end() state set to TDS_IDLE
util.c:179:Changed query state from READING to IDLE
util.c:83:logic error: cannot change query state from IDLE to PENDING
util.c:179:Changed query state from IDLE to IDLE
mem.c:665:tds_free_all_results()
util.c:179:Changed query state from IDLE to WRITING
packet.c:852:Sending packet
0000 0f 01 00 6c 00 00 00 00-21 5f 00 00 00 00 53 45 |...l.... !_....SE|
0010 4c 45 43 54 20 43 4f 4e-56 45 52 54 28 4e 56 41 |LECT CON VERT(NVA|
0020 52 43 48 41 52 28 33 29-2c 20 27 61 62 63 27 29 |RCHAR(3) , 'abc')|
0030 20 6e 76 63 0a 45 58 45-43 55 54 45 20 28 27 53 | nvc.EXE CUTE ('S|
0040 45 4c 45 43 54 20 43 4f-4e 56 45 52 54 28 55 4e |ELECT CO NVERT(UN|
0050 49 56 41 52 43 48 41 52-28 33 29 2c 20 27 27 78 |IVARCHAR (3), ''x|
0060 79 7a 27 27 29 20 75 76-63 27 29 0a |yz'') uv c').|

util.c:179:Changed query state from WRITING to PENDING
token.c:555:tds_process_tokens(0xa60b90, 0x7fff39aaa1c8, 0x7fff39aaa1cc, 0x500)
util.c:179:Changed query state from PENDING to READING
packet.c:410:Received packet
0000 0f 01 00 95 00 00 01 00-e5 81 00 20 4e 00 00 00 |........ ... N...|
0010 00 00 00 00 00 68 00 45-52 52 4f 52 3d 50 61 72 |.....h.E RROR=Par|
0020 73 65 20 66 61 69 6c 75-72 65 20 6f 6e 20 6c 69 |se failu re on li|
0030 6e 65 20 31 20 6f 66 20-73 74 61 74 65 6d 65 6e |ne 1 of statemen|
0040 74 20 27 53 45 4c 45 43-54 20 43 4f 4e 56 45 52 |t 'SELEC T CONVER|
0050 54 28 4e 56 41 52 43 48-41 52 28 33 29 2c 20 27 |T(NVARCH AR(3), '|
0060 61 62 63 27 29 20 6e 76-63 2e 2e 2e 27 2c 20 61 |abc') nv c...', a|
0070 74 20 6f 72 20 6e 65 61-72 20 27 6e 76 63 27 09 |t or nea r 'nvc'.|
...

token.c:570:processing result tokens. marker is e5(EED)
token.c:131:tds_process_default_tokens() marker is e5(EED)
mem.c:665:tds_free_all_results()
token.c:2402:tds_process_info() reading message 20000 from server
token.c:2497:tds_process_info() calling client msg handler
token.c:2514:tds_process_info() returning TDS_SUCCESS
token.c:570:processing result tokens. marker is fd(DONE)
token.c:2100:tds_process_end: more_results = 0
was_cancelled = 0
error = 1
done_count_valid = 0
token.c:2119: rows_affected = 0
token.c:2122:tds_process_end() state set to TDS_IDLE
util.c:179:Changed query state from READING to IDLE
util.c:83:logic error: cannot change query state from IDLE to PENDING
util.c:179:Changed query state from IDLE to IDLE
mem.c:665:tds_free_all_results()

Fixed. Expect a 1.4.23 version tomorrow