Error in ct_options

Marcos Sánchez Provencio <[email protected]>
Newsgroups gmane.comp.python.sybase
Organization www.burke.es
Message-ID <1043339061.4845.19.camel@cynar>
Hello there.

I am getting Sybase.Error: ct_options when connecting to MSSQL or
Sybase. If I comment out the CS_OPT_CHAINXACTS line, it seems to work
for simple selects. tsql from freetds, today's version works fine, so I
suppose my freetds.conf file is right. What is the next place to look?


I get the following when connecting to MSSQL2000:

marcos@cynar:~/sybase-0.36pre3$ python -c "import
Sybase;Sybase._ctx.debug = 1;Sybase.connect('cazalla','sa','xxx')"
ct_con_alloc(ctx0, &conn) -> CS_SUCCEED, conn0
ct_con_props(conn0, CS_SET, CS_USERNAME, "sa", CS_NULLTERM, NULL) ->
CS_SUCCEED
ct_con_props(conn0, CS_SET, CS_PASSWORD, "xxx", CS_NULLTERM, NULL) ->
CS_SUCCEED
servermsg_cb
servermsg_cb
ct_connect(conn0, "cazalla", CS_NULLTERM) -> CS_SUCCEED
ct_options(conn0, CS_SET, CS_OPT_CHAINXACTS, 1, CS_UNUSED, NULL) ->
CS_FAIL
ct_cancel(conn0, NULL, CS_CANCEL_ALL) -> CS_SUCCEED
Traceback (most recent call last):
  File "<string>", line 1, in ?
  File "Sybase.py", line 768, in connect
    strip, auto_commit, delay_connect, locking)
  File "Sybase.py", line 608, in __init__
    self.connect()
  File "Sybase.py", line 633, in connect
    self._raise_error(Error, 'ct_options')
  File "Sybase.py", line 621, in _raise_error
    raise exc(text)
Sybase.Error: ct_options
ct_con_props(conn0, CS_GET, CS_CON_STATUS, &value, CS_UNUSED, NULL) ->
CS_SUCCEED, CS_CONSTAT_CONNECTED
ct_close(conn0, CS_OPT_STATS_IO) -> CS_SUCCEED
ct_con_drop(conn0) -> CS_SUCCEED

I have this freetds.log

Starting log file with debug level 99.
2003-01-23 17:20:51.977855 iconv will convert client-side data to the ""
character set
2003-01-23 17:20:52.000075 Connecting addr 192.168.222.235 port 1433
with TDS version 8.0
2003-01-23 17:20:52.062367 inside tds_process_login_tokens()
Received header @ 2003-01-23 17:20:52.067664
0000  04 01 01 8d 00 34 01 00                            |.....4..|


Received packet @ 2003-01-23 17:20:52.067873
0000  e3 1b 00 01 06 6d 00 61  00 73 00 74 00 65 00 72   |.....m.a
.s.t.e.r|
0010  00 06 6d 00 61 00 73 00  74 00 65 00 72 00 ab 7c   |..m.a.s.
t.e.r..||
0020  00 45 16 00 00 02 00 31  00 43 00 61 00 6d 00 62   |.E.....1
.C.a.m.b|
0030  00 69 00 61 00 64 00 6f  00 20 00 65 00 6c 00 20   |.i.a.d.o .
.e.l. |
0040  00 63 00 6f 00 6e 00 74  00 65 00 78 00 74 00 6f   |.c.o.n.t
.e.x.t.o|
0050  00 20 00 64 00 65 00 20  00 62 00 61 00 73 00 65   |. .d.e. 
.b.a.s.e|
0060  00 20 00 64 00 65 00 20  00 64 00 61 00 74 00 6f   |. .d.e. 
.d.a.t.o|
0070  00 73 00 20 00 61 00 20  00 27 00 6d 00 61 00 73   |.s. .a. 
.'.m.a.s|
0080  00 74 00 65 00 72 00 27  00 2e 00 07 43 00 41 00   |.t.e.r.'
....C.A.|
0090  5a 00 41 00 4c 00 4c 00  41 00 00 00 00 e3 08 00   |Z.A.L.L.
A.......|
00a0  07 05 0a 0c d0 00 00 00  e3 17 00 02 0a 75 00 73   |........
.....u.s|
00b0  00 5f 00 65 00 6e 00 67  00 6c 00 69 00 73 00 68   |._.e.n.g
.l.i.s.h|
00c0  00 00 ab 68 00 47 16 00  00 01 00 27 00 43 00 68   |...h.G..
...'.C.h|
00d0  00 61 00 6e 00 67 00 65  00 64 00 20 00 6c 00 61   |.a.n.g.e .d.
.l.a|
00e0  00 6e 00 67 00 75 00 61  00 67 00 65 00 20 00 73   |.n.g.u.a .g.e.
.s|
00f0  00 65 00 74 00 74 00 69  00 6e 00 67 00 20 00 74   |.e.t.t.i .n.g.
.t|
0100  00 6f 00 20 00 75 00 73  00 5f 00 65 00 6e 00 67   |.o. .u.s
._.e.n.g|
0110  00 6c 00 69 00 73 00 68  00 2e 00 07 43 00 41 00   |.l.i.s.h
....C.A.|
0120  5a 00 41 00 4c 00 4c 00  41 00 00 00 00 ad 36 00   |Z.A.L.L.
A.....6.|
0130  01 07 01 00 00 16 4d 00  69 00 63 00 72 00 6f 00   |......M.
i.c.r.o.|
0140  73 00 6f 00 66 00 74 00  20 00 53 00 51 00 4c 00   |s.o.f.t. 
.S.Q.L.|
0150  20 00 53 00 65 00 72 00  76 00 65 00 72 00 00 00   | .S.e.r.
v.e.r...|
0160  00 00 08 00 00 c2 e3 13  00 04 04 34 00 30 00 39   |........
...4.0.9|
0170  00 36 00 04 34 00 30 00  39 00 36 00 fd 00 00 00   |.6..4.0.
9.6.....|
0180  00 00 00 00 00                                     |.....|


2003-01-23 17:20:52.068976 inside tds_process_default_tokens() marker is
e3(ENVCHANGE)
2003-01-23 17:20:52.069084 inside tds_process_default_tokens() marker is
ab(INFO)
2003-01-23 17:20:52.069333 inside tds_process_default_tokens() marker is
e3(ENVCHANGE)
2003-01-23 17:20:52.069417 inside tds_process_default_tokens() marker is
e3(ENVCHANGE)
2003-01-23 17:20:52.069502 inside tds_process_default_tokens() marker is
ab(INFO)
2003-01-23 17:20:52.069796 inside tds_process_default_tokens() marker is
e3(ENVCHANGE)
2003-01-23 17:20:52.069890 increasing block size from 4096 to 4096
2003-01-23 17:20:52.069990 inside tds_process_default_tokens() marker is
fd(DONE)
2003-01-23 17:20:52.070071 inside tds_process_end() more_results = 0,
was_cancelled = 0 
2003-01-23 17:20:52.070156 inside tds_process_default_tokens() setting
state to COMPLETED
Sending packet @ 2003-01-23 17:20:52.070276
0000  01 01 00 22 00 00 01 00  73 00 65 00 6c 00 65 00   |..."....
s.e.l.e.|
0010  63 00 74 00 20 00 40 00  40 00 73 00 70 00 69 00   |c.t. .@.
@.s.p.i.|
0020  64 00                                              |d.|


Received header @ 2003-01-23 17:20:52.078838
0000  04 01 00 1d 00 34 01 00                            |.....4..|


Received packet @ 2003-01-23 17:20:52.079068
0000  81 01 00 00 00 00 00 34  00 d1 34 00 fd 10 00 c1   |.......4
..4.....|
0010  00 01 00 00 00                                     |.....|


2003-01-23 17:20:52.079179 processing result tokens.  marker is 
81(TDS7_RESULT)
2003-01-23 17:20:52.079291 tds7_get_data_info:1089: 
	type = 52 (smallint)
	column_varint_size = 0
	colname = 
	colnamelen = 0
2003-01-23 17:20:52.079407 processing row tokens.  marker is  d1(ROW)
2003-01-23 17:20:52.079478 processing row.  column is 0 varint size = 0
2003-01-23 17:20:52.079611 processing row.  column size is 2 
2003-01-23 17:20:52.079678 clearing column 0 NULL bit
2003-01-23 17:20:52.079738 processing row tokens.  marker is  fd(DONE)
2003-01-23 17:20:52.079808 inside tds_process_end() more_results = 0,
was_cancelled = 0 
2003-01-23 17:20:52.079976 inside tds_process_result_tokens() state is
COMPLETED
2003-01-23 17:20:52.080054 leaving tds_process_login_tokens() returning
1
2003-01-23 17:20:52.080143 leaving ct_connect() returning 1
2003-01-23 17:20:52.080385 inside ct_options() action = CS_GET option =
7
2003-01-23 17:20:52.080544 inside ct_cancel()
Sending packet @ 2003-01-23 17:20:52.080615
0000  06 01 00 08 00 00 01 00                            |........|


Received header @ 2003-01-23 17:20:52.082576
0000  04 01 00 11 00 34 01 00                            |.....4..|


Received packet @ 2003-01-23 17:20:52.082852
0000  fd 20 00 fd 00 00 00 00  00                        |. ...... .|


2003-01-23 17:20:52.082930 inside tds_process_end() more_results = 0,
was_cancelled = 1 
2003-01-23 17:20:52.088732 inside ct_con_props() action = CS_GET
property = 26
2003-01-23 17:20:52.088965 inside ct_close()
2003-01-23 17:20:52.089404 inside ct_con_drop()



-- 
gpg --recv-keys --keyserver wwwkeys.pgp.net B9AD9B1B
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQA+MBc1TwXdxLmtmxsRAlPpAJ0VBimawwUiWQP0w31mkPeaNotU1gCfaB+9
2JRu1JWDZh7Qs6irZUzEAZw=
=/D0U
-----END PGP SIGNATURE-----
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.