Skip to Content.
Sympa Menu

freetds - Re: Help Freetds 0.53 - removing messages printed to STDERR

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Michael Peppler <mpeppler AT peppler.org>
  • To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
  • Subject: Re: Help Freetds 0.53 - removing messages printed to STDERR
  • Date: Wed, 2 Jan 2002 16:53:37 -0800


Michael Horowitz writes:
> Hello again,
>
> I added an insert statement that violated a primary key constraint, and
> this is what I get:

> Violation of PRIMARY KEY constraint 'PK_names'. Cannot insert duplicate
> key in object 'names'.
> The statement has been terminated.

Right - this really looks like a bug in FreeTDS.

If I run a similar script with the Sybase libraries I get:

-> prepare for DBD::Sybase::db (DBI::db=HASH(0x81c5ac8)~0x81c5a68 'insert
dups values(1, 'testing too')')
New DBI::st (for DBD::Sybase::st, parent=DBI::db=HASH(0x81c5a68), id=)
dbih_setup_handle(DBI::st=HASH(0x81c5ae0)=>DBI::st=HASH(0x80f8930),
DBD::Sybase::st, 81c5af8, Null!)
dbih_make_com(DBI::db=HASH(0x81c5a68), DBD::Sybase::st, 396)
<- prepare= DBI::st=HASH(0x81c5ae0) at dups.pl line 8
-> execute for DBD::Sybase::st (DBI::st=HASH(0x81c5ae0)~0x80f8930)
syb_st_execute() -> ct_command() OK
syb_st_execute() -> ct_send() OK
st_next_result() -> ct_results(4048) == 1
st_next_result() -> ct_results(4046) == 1
ct_results() final retcode = -205
st_next_result() -> lasterr = 2601, lastsev = 14
st_next_result() -> restype is not data result, force failFlag
syb_st_execute() -> got CS_CMD_DONE: resetting ACTIVE, moreResults,
dyn_execed
!! ERROR: 2601 'Server message number=2601 severity=14 state=3 line=1
text=Attempt to insert duplicate key row in object 'dups' with unique index
'dups_i_16960090731'
Server message number=3621 severity=10 state=0 line=1 text=Command has been
aborted.
'
<- execute= undef at dups.pl line 9
DBD::Sybase::st execute failed: Server message number=2601 severity=14
state=3 line=1 text=Attempt to insert duplicate key row in object 'dups' with
unique index 'dups_i_16960090731'
Server message number=3621 severity=10 state=0 line=1 text=Command has been
aborted.
<> DESTROY ignored for outer handle DBI::st=HASH(0x81c5ae0) (inner
DBI::st=HASH(0x80f8930))
-> DESTROY for DBD::Sybase::st (DBI::st=HASH(0x80f8930)~INNER)


In your case the servermsg_cb() function in dbdimp.c gets an error
message structure that does not have the error number set, possibly
because of the endian fiddling.

I don't know how to get this fixed - I suspect that we'll have to wait
for Brian to get back...

Michael
--
Michael Peppler - Data Migrations Inc. - http://www.mbay.net/~mpeppler
mpeppler AT peppler.org - mpeppler AT mbay.net
International Sybase User Group - http://www.isug.com




Archive powered by MHonArc 2.6.24.

Top of Page