-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix sys.columnproperty ordinal (#3312)
In sys.columnproperty, the query for ordinal was incorrect. We put the order by clause outside `row_number() OVER()` clause which means the row_number() was called before ordering the result leading to random output. As a fix move ORDER BY clause to inside OVER() Additional an example to show that `row_number() OVER()` clause is executed before outside `ORDER BY`. ``` babelfish_db=# select a, row_number() over() from (select unnest(ARRAY[99, 1]) as a) order by a; a | row_number ----+------------ 1 | 2 99 | 1 (2 rows) babelfish_db=# select a, row_number() over(order by a) from (select unnest(ARRAY[99, 1]) as a); a | row_number ----+------------ 1 | 1 99 | 2 (2 rows) ``` Task: BABEL-5495 Signed-off-by: Tanzeel Khan <[email protected]>
- Loading branch information
1 parent
d246412
commit f55e465
Showing
2 changed files
with
50 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters