BUG:Cache bug of the ”last“ function
Bug Description
When querying specified column data through the last function, the obtained value does not match the expectation. The expected value is false, but the value is true. However, not using the last function can query the correct value
To Reproduce Steps to reproduce the behavior:
-
Prepare an SQL A, and run it every second using a while loop select
Switchas property, _ts fromdevice_tablewhere device_id = 'deviceId1' andSwitchis not null and _ts >= {T} and _ts < {T+1} order by _ts desc limit 1 offset 0 (tips: device_id is a tag) -
Prepare an SQL B, and run it every second using a while loop select device_id, last(
Switch) fromdevice_tablewhere device_id in('deviceId1', 'deviceId2', 'deviceId3') group by device_id -
Insert new data through the schemaless model,
-
See error Assume that the initial value of SwitchState is true. After inserting new data, the value becomes false. You will find that the execution result of SQL A will immediately get the latest data 'false', while SQL B will get the expected latest result 'false' only after a varying time of 10-40 seconds.
Environment (please complete the following information):
- TDengine Version [3.0.7.1]
Additional Context Add any other context about the problem here.
Uploading 屏幕录制2024-05-30 112331_compressed.mp4…
此类问题均已在后续版本解决,请升级至目前最新的 3.3.5.8
注意:3.0.7.1 之后的版本,开源版操作系统支持范围参考:https://docs.taosdata.com/reference/supported/
如果不在支持范围,最好更换一下服务器,实在不方便可以使用docker ,具体安装/使用方式可以参考官方文档。