You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/06/29 07:58:35 UTC

[GitHub] [shardingsphere] strongduanmu commented on issue #11025: Wrong LIMIT [offset, row_count] rewrite SQL on postgresql

strongduanmu commented on issue #11025:
URL: https://github.com/apache/shardingsphere/issues/11025#issuecomment-870368932


   @justbk2015 I refer to the official documentation of PG, this SQL seems to be illegal.
   
   ```
   [ WITH [ RECURSIVE ] with_query [, ...] ]
   SELECT [ ALL | DISTINCT [ ON ( expression [, ...] ) ] ]
       [ * | expression [ [ AS ] output_name ] [, ...] ]
       [ FROM from_item [, ...] ]
       [ WHERE condition ]
       [ GROUP BY grouping_element [, ...] ]
       [ HAVING condition ]
       [ WINDOW window_name AS ( window_definition ) [, ...] ]
       [ { UNION | INTERSECT | EXCEPT } [ ALL | DISTINCT ] select ]
       [ ORDER BY expression [ ASC | DESC | USING operator ] [ NULLS { FIRST | LAST } ] [, ...] ]
       [ LIMIT { count | ALL } ]
       [ OFFSET start [ ROW | ROWS ] ]
       [ FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } ONLY ]
       [ FOR { UPDATE | NO KEY UPDATE | SHARE | KEY SHARE } [ OF table_name [, ...] ] [ NOWAIT | SKIP LOCKED ] [...] ]
   ```
   
   The legal sql should be `select * from tb_notdb_distable1 LIMIT 5 OFFSET 2;`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org