Issue 116509 - first records ignored with a certain connection types
Summary: first records ignored with a certain connection types
Status: CLOSED FIXED
Alias: None
Product: Base
Classification: Application
Component: code (show other issues)
Version: OOO330m19
Hardware: All Windows XP
: P3 Trivial (vote)
Target Milestone: 3.4.0
Assignee: marc.neumann
QA Contact: issues@dba
URL:
Keywords: needmoreinfo, oooqa
Depends on:
Blocks:
 
Reported: 2011-01-19 07:33 UTC by fdany
Modified: 2011-04-02 07:49 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description fdany 2011-01-19 07:33:02 UTC
A request in SQL mode Using a view on SQL Server with an outer join on a table
which is not the main table gives a resultset with the first result is ignored.

Example
LEFT OUTER JOIN tache_programmee AS tp ON
tp.TAPR_CODE_INTERNE=e.TAPR_CODE_INTERNE AND
p.ID_SERVICE_ORIGINE=e.ID_SERVICE_ORIGINE_TACHE
	LEFT OUTER JOIN activite_dg AS a ON a.ACDG_CODE_INTERNE=tp.ACDG_CODE_INTERNE
E is the main table (FROM table)

tested with order by and order by desc => the first row is ignored
Comment 1 r4zoli 2011-01-19 08:36:34 UTC
What type of connection you used ODBC or JDBC, ADO etc.?
What SQL server version.
Which Driver?

Without ORDER BY the query works correctly?
Comment 2 fdany 2011-01-20 07:05:39 UTC
What type of connection you used ODBC or JDBC, ADO etc.?
ADO
What SQL server version.
8.0.927
Which Driver?
Microsoft Ole Db provider for SQL Server

No problem with 3.21
More tests tomorrow
Comment 3 fdany 2011-01-21 07:44:30 UTC
No problem with ODBC
Same problem with ADO and driver Native SQL
Comment 4 r4zoli 2011-01-21 09:35:12 UTC
>Without ORDER BY the query works correctly?
Comment 5 fdany 2011-01-21 14:23:12 UTC
Without ORDER BY the query works correctly?

No, it dont. 
Order by was used to find out that's the first row of the resultset which was
ignored.

Same problem with RC10
Comment 6 fdany 2011-01-26 09:11:51 UTC
After further tests the problem comes with a request on a vue who contains
sub-requests.
exemple:
		ef.id_annee AS id_annee_fact,
		ef.id_facture,
		(	
			SELECT COUNT(*) 
			FROM ech_tracesuppression
			WHERE unfct_ident=e.unfct_ident AND annee=e.annee AND numlabo=e.numlabo AND
tacheprogrammee='1'
		) AS nbModification,
	CAST(NULL AS integer) AS id_anatype
	FROM echantillon AS e etc...
Comment 7 r4zoli 2011-01-27 12:19:53 UTC
If you run subquery alone it gives good results?
Comment 8 fdany 2011-01-28 09:02:02 UTC
All subqueries give good results.

the query

	SELECT
		e.unfct_ident,
		e.annee,
		e.numlabo,
		tp.TAPR_LIB_TACHE,

		tp.TAPR_CODE_TACHE,
		a.ACDG_CODE_ACTION


	FROM echantillon AS e
	LEFT OUTER JOIN tache_programmee AS tp ON
tp.TAPR_CODE_INTERNE=e.TAPR_CODE_INTERNE AND
tp.ID_SERVICE_ORIGINE=e.ID_SERVICE_ORIGINE_TACHE
	LEFT OUTER JOIN activite_dg AS a ON a.ACDG_CODE_INTERNE=tp.ACDG_CODE_INTERNE
WHERE e.annee=2010 and e.numlabo<3

has as result the row 
170 2010 2 0 0 32
with
WHERE e.annee=2010 and e.numlabo=2
no result was found

Comment 9 r4zoli 2011-02-03 15:17:09 UTC
I confirm it I found similar or same problem with different MS drivers to MS
accees files fails with ADO, and mdb driwer works with ODBC.

I investigated with other MS connected product and find that the mdb driver for
msaccess nwind.mdb example file has a same problem, with first records.

Download Northwind example file, unpack it:
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=C6661372-8DBE-422B-8676-C632D66C529C&displaylang=EN

Create connection to this nwind.mdb file through New>database>connect to
existing database>Microsoft Access, open Product table -> Missing record to
ProductID=1. The mdb driver recognize ProductID as  Integer[long]and shows as PK.
Same with ADO/JET connection.
Create ODBC connection to same nwind.mdb file, Shows all records. The ODBC
driver recognize ProductID as  Integer[Counter] and not PK.

This happens with latest DEV300m99 version, too. I found it when checked issue
115384, on win7. (where I copied table with two records, shows only one in mdb
connected file).

@fdany in your tables which ID types shows in OOo table edit mode with different
drivers.

 
Comment 10 r4zoli 2011-02-03 15:18:16 UTC
Changed summary.
Comment 11 fdany 2011-02-04 07:22:26 UTC
ID types

ADO                           ODBC
texte [nchar]                 texte [varchar]
texte (fixe) [text]           texte (fixe) [char] 
SQL Null []                   Memo [Text]
Date/Heure [DateTime]         Date/Heure [SmallDateTime]

The values with ODBC are the right ones.
With ODBC, the types as defined in SQLServer are mentionned. With ADO, it's not
the case
Comment 12 fdany 2011-02-04 07:30:53 UTC
But type differencies are the same in OO 4.2.1
Comment 13 r4zoli 2011-02-04 08:44:35 UTC
Create new Access mdb connection to mdb file attached to issue 115384, 
http://www.openoffice.org/nonav/issues/showattachment.cgi/72843/testbit.mdb

Open Table1 in OOo 3.2.1 the table shows 2 records.
Open Table1 in OOo 3.3 or later including DEV300m99 the table shows 1 records.
The record ID=1 record is missing.

Create ADO or ODBC connection, 2 records in all OOo version.
Comment 14 ocke.janssen 2011-03-10 11:55:07 UTC
Fixed in cws dba34d
Comment 15 ocke.janssen 2011-03-16 13:44:43 UTC
Please verify. Thanks.

See http://openoffice.org/bugzilla/show_bug.cgi?id=116509#c13 for reproduce.
Comment 16 fdany 2011-03-21 09:26:49 UTC
Same problem with dev300m103, not fixed
Comment 17 r4zoli 2011-03-21 09:54:08 UTC
Set back to fixed, because cws dba34d not integrated into DEV300m103.

Please check when it is integrated into DEV300.
Comment 18 marc.neumann 2011-03-23 10:33:03 UTC
verified in cws dba34d
Comment 19 fdany 2011-04-01 07:23:29 UTC
fixed in DEV300m105
Thanks
Comment 20 r4zoli 2011-04-02 07:49:31 UTC
Checked in DEV300m105, OK.