Issue 19979 - database table column are shifted to the left after execute a special query
Summary: database table column are shifted to the left after execute a special query
Status: CLOSED FIXED
Alias: None
Product: Base
Classification: Application
Component: code (show other issues)
Version: OOo 1.1
Hardware: All All
: P3 Trivial with 1 vote (vote)
Target Milestone: OOo 2.0
Assignee: ocke.janssen
QA Contact: issues@dba
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-24 11:40 UTC by vytis
Modified: 2006-05-31 14:29 UTC (History)
1 user (show)

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


Attachments
screenshot for issue 19979 (56.49 KB, image/gif)
2003-09-25 13:17 UTC, vytis
no flags Details
simple example with oo 1.1.0 (19.10 KB, image/gif)
2003-10-03 12:03 UTC, vytis
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description vytis 2003-09-24 11:40:50 UTC
OO 1.1.0 RC4 spreadsheet.

I made query something like this:

SELECT DISTINCT(Table1.IDField), Table1.* FROM Table1

Expected result: 
---------------------------------------
IDField | IDField | Field1 | IDField2 |
---------------------------------------
    1   |    1    |   aaa  |   bbb    |
    2   |    2    |   ccc  |   ddd    |
---------------------------------------

But i got :
-----------------------------------------
IDField |  Field1 | IDField2 | IDField2 |
-----------------------------------------
    1   |    1    |   aaa    |   bbb    |
    2   |    2    |   ccc    |   ddd    |
-----------------------------------------

Data are beeing displayed corect, but all field names are shifted to the left.
Comment 1 marc.neumann 2003-09-24 12:34:57 UTC
hi,

my table look like this

IDField   Field1   IDField2
1         2        3

when I do this query 

SELECT DISTINCT Sheet1.IDField, Sheet1.* FROM Sheet1

I got this result

IDField   IDField1   Field1   IDField2
1         1          2        3

This is exactly what I expect. The second field get the sufix 1
because the fieldname 'IDField' is allready used.

Bye Marc
Comment 2 vytis 2003-09-25 13:17:45 UTC
Created attachment 9659 [details]
screenshot for issue 19979
Comment 3 vytis 2003-09-25 13:26:17 UTC
I tried many times, but result is the same - bad.

OO 1.1.0 RC4 spreadsheet.

I made query :

SELECT DISTINCT(Table1.IDField), Table1.* FROM Table1

SELECT DISTINCT ( "Bonus"."IDBonus" ), "Bonus".*,
"Receivers"."NickName" AS "Receiver_NickName", "Assigners"."NickName"
AS "Assigner_NickName", "Groups"."Name" AS "Group_Name",
FROM 
"Bonus", 
"Users" "Assigners", 
"Users" "Receivers", 
"Groups" 
WHERE ... <conditions for joining of tables>

Expected result - column titles in such order: 
IDBonus	
IDBonus	
Receiver	
Assigner	
Title	
...

But i got :

column tiles : values 
IDBonus	     : IDBonus	
Receiver     : IDBonus	
Assigner     : Receiver
Title	     : Assigner
...

Data are beeing displayed corect, but all field names are shifted to
the left.
Comment 4 vytis 2003-10-03 11:58:38 UTC
On OO 1.1.0 is the same

look to second attached document.

Comment 5 vytis 2003-10-03 12:02:06 UTC
On OO 1.1.0 is the same

look to second attached document.

Comment 6 vytis 2003-10-03 12:03:21 UTC
Created attachment 9953 [details]
simple example with oo 1.1.0
Comment 7 marc.neumann 2003-10-09 10:22:03 UTC
hi,

can you please tell us which kind of datasource you use. It can't be a
spreadsheet as you write.

Please describe or screenshot us the table structure.

Bye Marc
Comment 8 vytis 2003-10-20 13:06:10 UTC
DB     : MS SQL Server
Driver : SDBC:ODBC

Explanation for "screenshot for issue 19979"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I executed the same query on MS SQL and OO.
Data, i got using OO, is in the top. 
Correct data (I made copy from MS SQL server) is beeing show in the
bottom, as speadsheet.

Red circles shows problems: 
1.
MS SQL: two columns IDBonus - this is ok
OO : Only one column named IDBonus, second is named (wrongly) receiver
 - this is bug

2.
MS SQL: column Title contains text data - this is ok
OO : Title contains numbers - this is bug
 

Explanation for "simple example with oo 1.1.0"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I made simpler sample of bug.

I have two tables :
Bonus {IDBonus, IDGroup}
Groups {IDGroup, Name}

I made query:
SELECT 
   DISTINCT(Bonus.IDBonus),
   Bonus.IDBonus,
   Groups.Name
FROM Bonus
INNER JOIN Groups
   ON Groups.IDGroup = Bonus.IDGroup

BUG:
I got results
Columns' titles: IDBonus, Name   , Name   
Columns' data  : IDBonus, IDBonus, IDBonus

But it should be:
Columns' titles: IDBonus, IDBonus, Name   
Columns' data  : IDBonus, IDBonus, Name   



Comment 9 marc.neumann 2004-01-09 14:29:56 UTC
Hi,

I can reproduce this.

follow the instruction from "Oct 20 04:06:10".
The problem occurr also with hsqldb.

Bye Marc
Comment 10 marc.neumann 2004-01-09 15:04:37 UTC
reassign
Comment 11 hans_werner67 2004-02-02 12:38:15 UTC
change subcomponent to 'none'
Comment 12 ocke.janssen 2004-05-26 07:08:26 UTC
Fixed in cws insight01
Comment 13 marc.neumann 2004-06-16 08:56:10 UTC
verify in CWS insight01
Comment 14 ocke.janssen 2004-09-06 12:08:28 UTC
.