zettadb / kunlun

KunlunBase is a distributed relational database management system(RDBMS) with complete NewSQL capabilities and robust transaction ACID guarantees and is compatible with standard SQL. Applications which used PostgreSQL or MySQL can work with KunlunBase as-is without any code change or rebuild because KunlunBase supports both PostgreSQL and MySQL connection protocols and DML SQL grammars. MySQL DBAs can quickly work on a KunlunBase cluster because we use MySQL as storage nodes of KunlunBase. KunlunBase can elastically scale out as needed, and guarantees transaction ACID under error conditions, and KunlunBase fully passes TPC-C, TPC-H and TPC-DS test suites, so it not only support OLTP workloads but also OLAP workloads. Application developers can use KunlunBase to build IT systems that handles terabytes of data, without any effort on their part to implement data sharding, distributed transaction processing, distributed query processing, crash safety, high availability, strong consistency, horizontal scalability. All these powerful features are provided by KunlunBase. KunlunBase supports powerful and user friendly cluster management, monitor and provision features, can be readily used as DBaaS.
http://www.kunlunbase.com
Apache License 2.0
143 stars 20 forks source link

检查游标获取查询的行数出现的错误 #713

Open jd-zhang opened 2 years ago

jd-zhang commented 2 years ago

Issue migrated from trac ticket # 629

component: computing nodes | priority: major

2022-04-27 17:30:35: vito@zettadb.com created the issue


git clone https://gitee.com/zettadb/kunlun.git sql code: CREATE TABLE tenk1 ( unique1 int4, unique2 int4, two int4, four int4, ten int4, twenty int4, hundred int4, thousand int4, twothousand int4, fivethous int4, tenthous int4, odd int4, even int4, stringu1 name, stringu2 name, string4 name ); COPY tenk1 FROM 'kunlun/src/test/regress/data/tenk.data';

-- check row count for a cursor-fetched query \set FETCH_COUNT 10 select unique2 from tenk1 order by unique2 limit 19;

 unique2 
---------
       0
       1
       2
       3
       4
       5
       6
       7
       8
       9
psql:sql/psql.sql:677: ERROR:  Kunlun-db: Can not append remote queries to a broken channel to shard 1 node 1.

pg中的输入为:

 unique2 
---------
       0
       1
       2
       3
       4
       5
       6
       7
       8
       9
      10
      11
      12
      13
      14
      15
      16
      17
      18
(19 rows)

下面的语句受到影响,产生不同

\echo 'error:' :ERROR
\echo 'error code:' :SQLSTATE
\echo 'number of rows:' :ROW_COUNT

-- cursor-fetched query with an error after the first group
select 1/(15-unique2) from tenk1 order by unique2 limit 19;
jd-zhang commented 2 years ago

2022-04-27 18:31:55: vito@zettadb.com edited the issue description

jd-zhang commented 2 years ago

2022-04-29 17:35:08: smith changed status from assigned to accepted

jd-zhang commented 2 years ago

2022-05-13 18:43:18: vito@zettadb.com commented


类似的语句,应该是不能除于零 select 1/(15-unique2) from tenk1 order by unique2 limit 19;

expoct: ERROR: division by zero

jd-zhang commented 2 years ago

2022-05-13 18:43:18: vito@zettadb.com edited the issue description

jd-zhang commented 2 years ago

2022-05-13 18:43:18: vito@zettadb.com changed status from accepted to assigned

jd-zhang commented 2 years ago

2022-06-14 18:53:10: vito@zettadb.com commented


Replying to [comment:3 vito]:

类似的语句,应该是不能除于零 select 1/(15-unique2) from tenk1 order by unique2 limit 19;

expoct: ERROR: division by zero

他的结果存在差异 select 1/(15-unique2) from tenk1 order by unique2 limit 19;

 ?column? 
----------
        0
        0
        0
        0
        0
        0
        0
        0
        0
        0
        0
        0
        0
        0
        1

       -1
        0
        0
(19 rows)

expoct:

ERROR:  division by zero

在#94中也有相似的案例