Issue 119642 - Wrong Where clause generated
Summary: Wrong Where clause generated
Status: UNCONFIRMED
Alias: None
Product: Base
Classification: Application
Component: code (show other issues)
Version: recent-trunk
Hardware: PC Windows XP
: P3 Normal (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-31 15:23 UTC by Jens611
Modified: 2013-01-29 21:47 UTC (History)
2 users (show)

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


Attachments
Wizard's screen (39.90 KB, image/jpeg)
2012-06-07 07:14 UTC, Jens611
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Jens611 2012-05-31 15:23:49 UTC
When creating a query with the wizard and omitting a value in the equations area the where clause is not generated at all. Instead of the table name appears.
Comment 1 r4zoli 2012-06-02 16:18:31 UTC
Query wizards work this way, where clause created when value added in 3rd step.
Without the value the WHERE caluse is meaningless, for that reason not added. 
The Table name alias created any way. 

You can edit your query in SQL mode and add WHERE clause.
Comment 2 r4zoli 2012-06-02 16:19:04 UTC
Invalid -> Closing.
Comment 3 Jens611 2012-06-03 08:32:21 UTC
The problem is that a syntactically wrong sql statement is generated in that case:

e.g.
select * from tab1 tab1

So the bug has to stay open/unsolved!
Comment 4 r4zoli 2012-06-06 19:17:49 UTC
The  
select * from tab1 tab1
 is correct SQL, you can left out the AS clause in alias.
This error was corrected several version earlier.

This not happens with my win7 32 bit version of AOO 3.4

This happens in AOO 3.4? 
You use odb file with connection to external database, or use standalone file?
Comment 5 Jens611 2012-06-07 07:14:15 UTC
Created attachment 78107 [details]
Wizard's screen
Comment 6 Jens611 2012-06-07 07:19:03 UTC
I use standalone database.

I'm still confused by the wizard's behaviour. If I create a query with an empty field Belege.Art:

https://issues.apache.org/ooo/attachment.cgi?id=78107

I also expect the wizard to create a search for rows with the field being empty, i.e. 

select * from Belege where Belege.Art =''

Instead of that the query is neglected!
Comment 7 r4zoli 2012-06-07 14:46:36 UTC
Now it is clear to me, you want add parameter query, when you added empty field into query wizard.

Use 
:parameter
in wizard, it will ask for input.
Comment 8 Jens611 2012-06-08 07:17:42 UTC
You are partly right:
The wizard cheats, when allowing entry of data but doing nothing.

At least an error message is expected here!