Switching between sql and design view don't handle distinct as expected.
Steps to reproduce the bug:
1. Create a non-empty query in design view
2. Push distinct button on toolbar
3. Switch to sql view
4. Delete distinct from select statment
5. Switch back to design view
Distinct button is still active. If we switch to sql view again, then distinct will appear in select.
Distinct button would be inactive and in case of switching to sql view, distinct would not be put back into select.
Zolnai Tamas committed a patch related to this issue.
It has been pushed to "master":
fdo#58842 Handle case of non-distinct statment
The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
Affected users are encouraged to test the fix and report feedback.