[freetds] Duplicate rows returned with one particular query
Luke Benstead
kazade at gmail.com
Wed May 16 10:11:37 EDT 2007
It looks as though I'm not the only one who has experienced this:
http://lists.ibiblio.org/pipermail/freetds/2006q1/019851.html
http://archives.devshed.com/forums/development-94/warning-return-as-copy-of-last-result-row-was-warning-1897372.html
Luke.
On 16/05/07, ZIGLIO, Frediano, VF-IT <Frediano.Ziglio at vodafone.com> wrote:
>
>
> > Dear all,
> >
> > I have been using PyODBC to write cross platform code that
> > connects to an
> > MS-SQL database which uses freetds. Earlier today we
> > discovered a strange
> > bug that only occurs on linux. We have a query which is the following:
> >
> > SELECT ID
> > FROM vwSomeView
> > WHERE (EmailAddress = 'someone at email.com')
> >
> > Besides the column name, view name and email address that is
> > the complete
> > query. There IS only 1 result in the database that matches that email
> > address. On Windows we get one result back. On linux we get
> > back 2 rows; the
> > same row twice.
> >
> > At first I suspected PyODBC but looking at the code it
> > doesn't seem to do
> > much except call SQLFetch() and there is no linux specific
> > code. So I turned
> > up the logging on freetds which gives me the following:
> >
> > 13:49:02.901895 processing result tokens. marker is fd(DONE)
> > 13:49:02.901933 tds_process_end: more_results = 1
> > was_cancelled = 0
> > error = 0
> > done_count_valid = 0
> > 13:49:02.901948 processing result tokens. marker is fd(DONE)
> > 13:49:02.901960 tds_process_end: more_results = 1
> > was_cancelled = 0
> > error = 0
> > done_count_valid = 0
> > 13:49:02.901971 processing result tokens. marker is fd(DONE)
> > 13:49:02.901983 tds_process_end: more_results = 0
> > was_cancelled = 0
> > error = 0
> > done_count_valid = 0
> >
>
> No, this is after SQLFetch loop.
>
> The strange thing is that report report an error "Warning: Null value is
> eliminated by an aggregate or other SET operation" just after the first
> row. Is vwOrganizationContact a view? Are there some triggers?
> I can confirm that server return a single row... perhaps if would be
> helpful to enable DM log.
>
> > which looks to me like it processes the row twice.
> >
> > What makes this bug even more odd is that if I replace:
> >
> > 'SELECT ID' with 'SELECT *' only one row is returned.
> >
> > I was using freetds version 0.63 (the one that comes with
> > Ubuntu Feisty) but
> > i downloaded and installed the latest CVS snapshot and that
> > does the same
> > thing. I have attached the log so that hopefully someone can
> > help with my
> > problem.
> >
> > Thanks,
> >
> > Luke.
> >
>
> freddy77
>
> _______________________________________________
> FreeTDS mailing list
> FreeTDS at lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
>
More information about the FreeTDS
mailing list