databasejdbctime-seriesmybatistdengine

TDengine count() return nothing if no data


I need to use mybatis provide data which stored in TDengine time-series database. But I found the count() function will return nothing if there is no any data.

taos> select server_version();
 server_version() |
===================
 2.0.20.12        |
Query OK, 1 row(s) in set (0.000156s)

taos> select count(*) from d_entrance_data;
Query OK, 0 row(s) in set (0.000905s)

I supposed it should return 0 at least. Now I can't process it with mybatis.


       count(*)        |
========================
              0        |
Query OK, 1 row(s) in set (0.016176s)

It confuses me a lot. Any idea?


Solution

  • this is a known issue by design in TDengine, in TDengine 2.x version, this issue won't be fixed.