Issue Details (XML | Word | Printable)

Key: CORE-3807
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Dmitry Yemanov
Reporter: Pavel Zotov
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Firebird Core

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

Created: 04/Apr/12 08:20 AM   Updated: 16/May/12 02:09 PM
Component/s: Engine
Affects Version/s: 2.1.0, 2.1.1, 2.1.2, 2.1.3, 3.0 Initial, 2.5.0, 2.1.4, 2.5.1
Fix Version/s: 2.1.5, 2.5.2, 3.0 Alpha 1

Time Tracking:
Not Specified

Issue Links:
Relate
 

Planning Status: Unspecified


 Description  « Hide
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)


 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Dzirt added a comment - 05/Apr/12 07:55 AM - edited
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

Dmitry Yemanov added a comment - 05/Apr/12 08:17 AM
Additional fix is committed, thanks.