Skip to Content.
Sympa Menu

freetds - Re: [freetds] Duplicate rows returned with one particular query

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "ZIGLIO, Frediano, VF-IT" <Frediano.Ziglio AT vodafone.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Duplicate rows returned with one particular query
  • Date: Wed, 16 May 2007 16:00:58 +0200


> 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





Archive powered by MHonArc 2.6.24.

Top of Page