taosdata / taosdata/TDengine

After Tdengine is upgraded from 3.1.1.0 to 3.3.3.0, an error is reported in the original correct query SQL statement. Parser internal error

Open
#28,461 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C
Stars
25.1k
Forks
5k
Avg merge
4d 59m
Merged PRs (30d)
7

Description

Bug Description
After Tdengine is upgraded from 3.1.1.0 to 3.3.3.0, an error is reported in the original correct query SQL statement. The SQL syntax is correct,The error message is displayed: Parser internal error

To Reproduce

  1. super table:
    CREATE STABLE energy_data (collect_date_timeTIMESTAMP ENCODE 'delta-i' COMPRESS 'lz4' LEVEL 'medium',collect_valueDOUBLE ENCODE 'delta-d' COMPRESS 'lz4' LEVEL 'medium',e_valueDOUBLE ENCODE 'delta-d' COMPRESS 'lz4' LEVEL 'medium',repair_numberSMALLINT ENCODE 'simple8b' COMPRESS 'lz4' LEVEL 'medium',is_checkBOOL ENCODE 'bit-packing' COMPRESS 'lz4' LEVEL 'medium',is_supplementBOOL ENCODE 'bit-packing' COMPRESS 'lz4' LEVEL 'medium',ts BIGINT ENCODE 'simple8b' COMPRESS 'lz4' LEVEL 'medium') TAGS (device_idNCHAR(36),project_id NCHAR(36))
  2. An error is reported in the SQL statement:
    select groupId,start_time,end_time,device_id,sum(value) as valuefrom( select 1297874473749565440 as groupId,_wstart as start_time,_wend as end_time,device_id, sum( CASE WHEN ts>=0 and ts < 12600000 THEN e_value * '2.0000000000' WHEN ts>=12600000 and ts < 41400000 THEN e_value * '3.0000000000' WHEN ts>=41400000 and ts < 57540000 THEN e_value * '4.0000000000' WHEN ts>=57600000 and ts < 68400000 THEN e_value * '1.0000000000' WHEN ts>=68400000 and ts < 86340000 THEN e_value * '2.0000000000' ELSE 0 end) asvalue from taiot.energy_data where (collect_date_time >= 1727712000000 and collect_date_time < 1730390400000 ) and e_value is not null and project_id = '1295391763945324544' and device_id in ('szsb1') partition by device_id interval(1n) ) as t1 group by groupId,start_time,end_time,device_id;

Expected Behavior
Correct query

Environment (please complete the following information):

  • TDengine Version 3.3.3.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No repository files, tests, or parser entry points are named. Start by running the supplied SQL against TDengine 3.1.1.0 and 3.3.3.0, then trace where 3.3.3.0 emits "Parser internal error"; done means the query is accepted as expected or the regression is covered by a reproducible test.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.