Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[influxdb/v2] inconsistent influxql result compared to 1.x #25010

Open
jdstrand opened this issue May 15, 2024 · 0 comments
Open

[influxdb/v2] inconsistent influxql result compared to 1.x #25010

jdstrand opened this issue May 15, 2024 · 0 comments

Comments

@jdstrand
Copy link
Contributor

jdstrand commented May 15, 2024

An external reporter sent an issue regarding an anomaly with InfluxQL queries in 2.x. Using 2.7.6, I found that the following influxql queries give different results from InfluxDB 1.8.10 and 1.11.5+git.

Eg, in 2.7.6, we see a partial result with one query:

$  export V1AUTH=$(echo -n "anything:$TOKEN" | base64 --wrap 0)

# generate some line protocol
$ cat > file.lp <<EOM
t0,t0_tag0=initTag t0_f0=0i 1715694000
t0,t0_tag0=initTag t0_f0=1i 1715694001
t0,t0_tag1=initTag t0_f0=0i 1715694000
EOM

# write
$ curl -H "Authorization: Basic $V1AUTH" -X POST "$URL/write?db=test1&precision=s" --data-binary @./file.lp
$

# queries
# ok
$ curl -H "Authorization: Basic $V1AUTH" -H "Accept: application/csv" -X POST "$URL/query?db=test1&rp=autogen" --data-urlencode "q=select * from t0;"
name,tags,time,t0_f0,t0_tag0,t0_tag1
t0,,1715694000000000000,0,initTag,
t0,,1715694000000000000,0,,initTag
t0,,1715694001000000000,1,initTag,

# partial result
$ curl -H "Authorization: Basic $V1AUTH" -H "Accept: application/csv" -X POST "$URL/query?db=test1&rp=autogen" --data-urlencode "q=select * from t0 where true & ((1 != 0) and (t0_tag0 != 'tag'))"
name,tags,time,t0_f0,t0_tag0,t0_tag1
t0,,1715694000000000000,0,initTag,
t0,,1715694001000000000,1,initTag,

InfluxDB 1.8.10 and 1.11.5+git have full results for both:

$ curl -H "Authorization: Basic $V1AUTH" -H "Accept: application/csv" -X POST "$URL/query?db=test1&rp=autogen" --data-urlencode "q=select * from t0;"
name,tags,time,t0_f0,t0_tag0,t0_tag1
t0,,1715694000000000000,0,initTag,
t0,,1715694000000000000,0,,initTag
t0,,1715694001000000000,1,initTag,

$ curl -H "Authorization: Basic $V1AUTH" -H "Accept: application/csv" -X POST "$URL/query?db=test1&rp=autogen" --data-urlencode "q=select * from t0 where true & ((1 != 0) and (t0_tag0 != 'tag'))"
name,tags,time,t0_f0,t0_tag0,t0_tag1
t0,,1715694000000000000,0,initTag,
t0,,1715694000000000000,0,,initTag
t0,,1715694001000000000,1,initTag,

cc @davidby-influx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant