db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nirmal Fernando <nirmal070...@gmail.com>
Subject Reconsidering an entry in orderby.out
Date Thu, 19 Aug 2010 12:21:51 GMT
Hi All,

I found the following test at line 1810 in
java/testing/org/apache/derbyTesting/functionTests/master/orderby.out:

ij> -- Ordering by an expression involving an unselected column is not.
However,
-- Derby does not currently enforce this restriction. Note that the answer
-- that Derby returns is incorrect: Derby returns two rows with duplicate
-- 'name' values. This is because Derby currently implicitly includes the
-- 'age' column into the 'distinct' processing due to its presence in the
-- ORDER BY clause. DERBY-2351 and DERBY-3373 discuss this situation in
-- more detail.
select distinct name from person order by age*2;
NAME
----------
John
Mary
John

As per discussions at
Derby-4371<https://issues.apache.org/jira/browse/DERBY-4371>this query
should not be allowed, since column "age" is not there in the
select clause.

What you think? I think we should correct this test.

Thanks.

-- 
Best Regards,
Nirmal

C.S.Nirmal J. Fernando
Department of Computer Science & Engineering,
Faculty of Engineering,
University of Moratuwa,
Sri Lanka.

Mime
View raw message