Description
Please check the FAQ documentation before raising an issue
Describe the bug (required)
create tag ttl_tag1(age int);
insert vertex ttl_tag1(age) VALUES "1":(10),"2":(20),"3":(30);
alter tag ttl_tag1 add (ttl timestamp default now());
alter tag ttl_tag1 ttl_duration=10, ttl_col="ttl";
insert vertex ttl_tag1(age) VALUES "4":(40);
match (v:ttl_tag1) return v limit 10;
After the above series of operations. The ttl_tag1
of "1", "2" and "3" will never expire.
This is because there is a problem with our definition of default
. In this case, the default value of ttl
is now()
. now()
, which will be stored in the definition of ttl
(it is the function now()
, not the return value of it).
When we read a ttl
if the property does not exist in tag1.ttl, it will get the default value from the schema definition. So for ttl_tag1
of "1", "2" and "3", the latest now()
will be calculated every time when reading, so they will never expire.
Your Environments (required)
- OS:
uname -a
- Compiler:
g++ --version
orclang++ --version
- CPU:
lscpu
- Commit id (e.g.
a3ffc7d8
)
How To Reproduce(required)
Steps to reproduce the behavior:
- Step 1
- Step 2
- Step 3
Expected behavior
Additional context