mycat count(*) 问题


mysql> select * from test;
+----+-----------------------+
| id | tim                   |
+----+-----------------------+
|  1 | 2017-12-04 14:32:51.0 |
|  2 | 2017-12-04 14:32:51.0 |
|  1 | 2017-12-04 17:26:37.0 |
|  2 | 2017-12-04 17:26:37.0 |
|  3 | 2017-12-04 17:26:37.0 |
+----+-----------------------+
5 rows in set (0.14 sec)

mysql> select count(*),count(*)+10 from test;
+--------+---------------+
| COUNT0 | COUNT(*) + 10 |
+--------+---------------+
|      5 |         20005 |     
+--------+---------------+
1 row in set (0.15 sec)


正常应该返回15,但是它返回的值为:count(*)正常值 + datanode个数* 表达式中加的数据,这里datanode数为2000
所以它的结果变成了 5 + 2000*10=20005

mysql> select version();
+---------------------------------------+
| VERSION()                             |
+---------------------------------------+
| 5.6.29-mycat-1.7.0-DEV-20170416134921 |
+---------------------------------------+
1 row in set (0.00 sec)

mysql> 

结果都不准,不敢用了。