Skip to Content.
Sympa Menu

freetds - Re: compute row bug: tds/token.c:527: assigns to nu ll pointer (tds->res_info)

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Thompson, Bill D (London)" <ThompBil AT exchange.uk.ml.com>
  • To: "'TDS Development Group'" <freetds AT franklin.oit.unc.edu>
  • Subject: Re: compute row bug: tds/token.c:527: assigns to nu ll pointer (tds->res_info)
  • Date: Sun, 27 Oct 2002 08:32:54 -0000


OK, I've reproduced this.

1> if 0 = 1 select 1
2>
3> go
Segmentation Fault

You were using tsql, right ?
I notice Freddy's put a fix in to stop the segfault happening (thanks), but
I was puzzled by the root cause...

It's actually caused by the fact that tds_process_row_tokens was called when
there were neither results or rows to process.

Really in this case, tds_process_row_tokens need only be called if there are
data rows to process.
tds_process_result_tokens will return (in the result_type) a value of
TDS_ROW_RESULT or TDS_COMPUTE_RESULT , which indicates that there is data to
process.

Bill
> -----Original Message-----
> From: Frediano Ziglio [SMTP:freddyz77 AT tin.it]
> Sent: Saturday, October 26, 2002 8:38 AM
> To: TDS Development Group
> Subject: [freetds] Re: compute row bug: tds/token.c:527: assigns to
> null pointer (tds->res_info)
>
> Il sab, 2002-10-26 alle 02:04, James K. Lowden ha scritto:
> > TDS 7.0, current CVS, updated minutes ago.
> >
> > Query is:
> >
> > while (select max(sat) from sat) < getdate()
> > insert sat
> > select dateadd(week, 1, max(sat))
> > from sat
> >
> > Initial contents of table "sat":
> >
> > 1> select * from sat
> > 2> go
> > sat
> > May 11 2002 12:00AM
> >
> > Problem: Segfault when query completes (26 rows are added).
> >
>
> Same problem for "if 0 = 1 select 1", if empty result (not row) and done
> return it cored...
>
> freddy77
>
>
>
> ---
> You are currently subscribed to freetds as: [thompbil AT exchange.uk.ml.com]
> To unsubscribe, forward this message to
> $subst('Email.Unsub')





Archive powered by MHonArc 2.6.24.

Top of Page