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

bug: the order of offset and limit in the parser is fixed #19732

Open
yezizp2012 opened this issue Dec 10, 2024 · 0 comments
Open

bug: the order of offset and limit in the parser is fixed #19732

yezizp2012 opened this issue Dec 10, 2024 · 0 comments
Labels
component/frontend Protocol, parsing, binder. good first issue Good for newcomers help wanted Issues that need help from contributors priority/low type/bug Something isn't working
Milestone

Comments

@yezizp2012
Copy link
Member

Describe the bug

limit must be placed before offset, It behaves differently with PG. PG does not have this requirement.
In RW:

dev=> explain select * from pg_type order by oid offset 1 limit 1;
ERROR:  Failed to run the query

Caused by:
  sql parser error: expected end of statement, found: limit
dev=> explain select * from pg_type order by oid limit 1 offset 1;
                                                                                                           QUERY PLAN
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 BatchTopN { order: [pg_type.oid ASC], limit: 1, offset: 1 }
 └─BatchScan { table: pg_type, columns: [oid, typname, typelem, typarray, typinput, typnotnull, typbasetype, typtypmod, typcollation, typlen, typnamespace, typtype, typdelim, typrelid, typdefault, typcategory, typreceive] }
(2 rows)

In PG:

metadata=> explain select * from pg_type order by oid limit 1 offset 1;
                                         QUERY PLAN
--------------------------------------------------------------------------------------------
 Limit  (cost=0.34..0.41 rows=1 width=259)
   ->  Index Scan using pg_type_oid_index on pg_type  (cost=0.28..48.66 rows=699 width=259)
(2 rows)

metadata=>  explain select * from pg_type order by oid offset 1 limit 1;
                                         QUERY PLAN
--------------------------------------------------------------------------------------------
 Limit  (cost=0.34..0.41 rows=1 width=259)
   ->  Index Scan using pg_type_oid_index on pg_type  (cost=0.28..48.66 rows=699 width=259)
(2 rows)

Error message/log

No response

To Reproduce

No response

Expected behavior

No response

How did you deploy RisingWave?

No response

The version of RisingWave

No response

Additional context

No response

@yezizp2012 yezizp2012 added the type/bug Something isn't working label Dec 10, 2024
@github-actions github-actions bot added this to the release-2.2 milestone Dec 10, 2024
@yezizp2012 yezizp2012 added component/frontend Protocol, parsing, binder. priority/low help wanted Issues that need help from contributors labels Dec 10, 2024
@lmatz lmatz added the good first issue Good for newcomers label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/frontend Protocol, parsing, binder. good first issue Good for newcomers help wanted Issues that need help from contributors priority/low type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants