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

Error "Invalid expression in the select list" can be unexpectedly raised if a string literal is used inside a GROUP BY clause in a multi-byte connection [CORE3807] #4150

Closed
firebird-automations opened this issue Apr 4, 2012 · 10 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @pavel-zotov

Relate to QA463

Simplified test case (to be executed with connection charset = UTF-8):

select
'Current time is ' || cast(a.t as varchar(15))
from
(select current_time t from rdb$database) a
group by
'Current time is ' || cast(a.t as varchar(15))

-- ERROR:
-- Invalid expression in the select list (not contained in either an aggregate function or the GROUP BY clause)

Commits: 8d50e30 3c9d334 9942d23 525149c b587289 8bffc57

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

reporter: Dmitry Yemanov [ dimitr ] => Pavel Zotov [ tabloid ]

assignee: Dmitry Yemanov [ dimitr ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

status: Open [ 1 ] => In Progress [ 3 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

description: Simplified test case (to be executed with connection charset = UTF-8):

select
'Current time is ' || cast(a.t as varchar(10))
from
(select current_time t from rdb$database) a
group by
'Current time is ' || cast(a.t as varchar(10))

-- ERROR:
-- Invalid expression in the select list (not contained in either an aggregate function or the GROUP BY clause)

=>

Simplified test case (to be executed with connection charset = UTF-8):

select
'Current time is ' || cast(a.t as varchar(15))
from
(select current_time t from rdb$database) a
group by
'Current time is ' || cast(a.t as varchar(15))

-- ERROR:
-- Invalid expression in the select list (not contained in either an aggregate function or the GROUP BY clause)

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

status: In Progress [ 3 ] => Open [ 1 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

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

resolution: Fixed [ 1 ]

Fix Version: 2.1.5 [ 10420 ]

Fix Version: 2.5.2 [ 10450 ]

Fix Version: 3.0 Alpha 1 [ 10331 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: Dzirt (dzirt)

Server crashes when executing a query:

select
T.USER_NAME || iif ( count(*) > 1, ' *' || count(*), '' )
from (
select Trim(MON$USER) || ' (' || Trim(MON$REMOTE_ADDRESS) || iif ( MON$REMOTE_PROCESS is Null or Trim(MON$REMOTE_PROCESS) = '', '', ', ' || MON$REMOTE_PROCESS ) || ')' as USER_NAME
from MON$ATTACHMENTS
) as T
group by T.USER_NAME
order by 1

Connection charset UTF-8 or WIN-1251

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Additional fix is committed, thanks.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pmakowski

Link: This issue relate to QA463 [ QA463 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pmakowski

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

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: Done successfully

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment