Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GROUP BY RAND() returns infinite rows [CORE1943] #2382

Closed
firebird-issue-importer opened this issue Jun 19, 2008 · 10 comments
Closed

GROUP BY RAND() returns infinite rows [CORE1943] #2382

firebird-issue-importer opened this issue Jun 19, 2008 · 10 comments

Comments

@firebird-issue-importer

Submitted by: fabianobonin (fabianobonin)

Is related to QA349

The query below returns infinite rows:

select
1
from
rdb$database a
group by
rand()

Commits: f9e3032

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jun 19, 2008

Commented by: Sean Leyne (seanleyne)

Fabiano,

This seems to be a "non-sense case" -- it does not reflected anything close to a real-world scenario -- as such, I think this should be considered a "won't fix" case.

Can you explain why GROUP BY RAND() would ever be used?

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jun 19, 2008

Commented by: @asfernandes

Database engines should deal with "non-sense cases" too. Job of GROUP BY is not produce rows.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jun 19, 2008

Commented by: @dyemanov

I agree with Adriano. We already had such a problem previously with GROUP BY <constant>. The current one should also be solved. Our GROUP BY processing is somewhat non-optimal (to say at least).

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jun 19, 2008

Commented by: fabianobonin (fabianobonin)

In my case, i was grouping by a "case", 'cause i need to group some rows from a procedure and keep others not grouped, but as the procedure didn't have a unique column, i used rand() to fake one. I fixed it changing the procedure to return a unique column and using it instead.

group by
case when ... then ... else rand() end

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 9, 2008

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.5 Beta 1 [ 10251 ]

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 23, 2011

Modified by: @pcisar

Link: This issue is related to QA349 [ QA349 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Apr 25, 2011

Commented by: @pcisar

QA test added.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Apr 25, 2011

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 19, 2016

Modified by: @pavel-zotov

QA Status: No test

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 19, 2016

Modified by: @pavel-zotov

QA Status: No test => Done successfully

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants