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 2022/12/15 10:08:50 UTC

[GitHub] [shardingsphere] peilinqian commented on issue #22826: In the federation scenario,"select order by null first" or "create view order by null first",the result is incorrect;

peilinqian commented on issue #22826:
URL: https://github.com/apache/shardingsphere/issues/22826#issuecomment-1352831273

   **the result of opengauss**
   ```
   og_db=# drop table if exists test;
   DROP TABLE
   og_db=# create table test (id int,name text,remark text);
   CREATE TABLE
   og_db=# insert into test values(1,'','空字符串');
   INSERT 0 1
   og_db=# insert into test values(2,null,'null');
   INSERT 0 1
   og_db=# insert into test values(3,'test','非空非null值');
   INSERT 0 1
   og_db=# select * from test order by name nulls last;
    id | name |    remark
   ----+------+--------------
     3 | test | 非空非null值
     1 |      | 空字符串
     2 |      | null
   (3 rows)
   
   og_db=# select * from test order by name nulls first;
    id | name |    remark
   ----+------+--------------
     1 |      | 空字符串
     2 |      | null
     3 | test | 非空非null值
   (3 rows)
   ```
   **the result of pg**
   ```
   postgres=# drop table if exists test;
   NOTICE:  table "test" does not exist, skipping
   DROP TABLE
   postgres=# create table test (id int,name text,remark text);
   CREATE TABLE
   postgres=# insert into test values(1,'','空字符串');
   INSERT 0 1
   postgres=# insert into test values(2,null,'null');
   INSERT 0 1
   postgres=# insert into test values(3,'test','非空非null值');
   INSERT 0 1
   postgres=# select * from test order by name nulls last;
    id | name |    remark
   ----+------+--------------
     1 |      | 空字符串
     3 | test | 非空非null值
     2 |      | null
   (3 rows)
   
   postgres=# select * from test order by name nulls first;
    id | name |    remark
   ----+------+--------------
     2 |      | null
     1 |      | 空字符串
     3 | test | 非空非null值
   (3 rows)
   ```
   
   
   


-- 
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