influxdata / influxdata/influx-cli
(time=time) trigger Error
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 75
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Description
**Step to Reproduce**
```
--create bucket
CREATE DATABASE hintdb0;
USE hintdb0;
CREATE RETENTION POLICY "autogen" ON "hintdb0" DURATION INF REPLICATION 1 DEFAULT;
--insert data
INSERT t1,t1_f0=1 value=10 1641024028331837795
INSERT t1,t1_f0=1 value=11 1641024040091924467
INSERT t1,t1_f0=2 value=12 1730160367375000000
INSERT t1,t1_f0=3 value=13 1673100999751000000
INSERT t2,t2_f0=-146 value=22 1641024141329705070
INSERT t2,t2_f0=-146 value=23 1641024187641544505
INSERT t4,t4_f0=0.17 value=33 1641024266393313153
INSERT t4,t4_f0=0.17 value=34 1641024295432559539
```
Now query query 1 and then add (time = time) in query 2
```
--query 1
SELECT t1_f0 AS ref0 FROM hintdb0.autogen.t1
WHERE(((0.169971904196 <= 0.169971904197) AND (0.169971904197 <= 0.169971904198))) AND (time >= 1641024028331837795) AND (time <= 1641024040091924467);
--query 2
SELECT t1_f0 AS ref0 FROM hintdb0.autogen.t1
WHERE(((0.169971904196 <= 0.169971904197) AND (0.169971904197 <= 0.169971904198))) AND (time >= 1641024028331837795) AND (time <= 1641024040091924467) AND (time = time);
```
**Expected behaviour**
Both queries should execute successfully and return the corresponding results.
**Actual behaviour**
query 1 : return correctly
query 2 : error: invalid operation: time and *influxql.VarRef are not compatible
-------------
-The predicate time = time is logically equivalent to TRUE and is commonly used in testing/fuzzing as a semantics-preserving hint.
-The error only appears when the query already contains multiple concrete time predicates (including expressions like time >= (const + const) or time >= (const - const)) and we then add AND (time = time).
-Queries that add other tautologies such as AND TRUE or AND (1=1) do not trigger the error
**Environment**
InfluxDB: 1.8.10-1 (tested via influx v1 shell)
Windows 11 version (10.0.26100 build 26100)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure in the influx v1 shell using the two queries and sample data from the report, then compare query handling for concrete time predicates with the added `(time = time)` condition. Done means both queries execute successfully and return the corresponding results without the incompatibility error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100