diff --git a/Jenkinsfile b/Jenkinsfile index d8803cd1a993250055c9aa3f2e0b457ab4d0f170..9d131d0ca500ef248740b5ce31fd92ce197b32f8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -57,7 +57,7 @@ def pre_test(){ cd ${WKC} git checkout 2.0 ''' - } + } else{ sh ''' cd ${WKC} @@ -67,6 +67,7 @@ def pre_test(){ } sh''' cd ${WKC} + git remote prune origin [ -f src/connector/grafanaplugin/README.md ] && rm -f src/connector/grafanaplugin/README.md > /dev/null || echo "failed to remove grafanaplugin README.md" git pull >/dev/null git fetch origin +refs/pull/${CHANGE_ID}/merge @@ -88,28 +89,28 @@ def pre_test(){ cd ${WK} git checkout 2.0 ''' - } + } else{ sh ''' cd ${WK} git checkout develop ''' - } + } } sh ''' cd ${WK} - git pull >/dev/null - + git pull >/dev/null + export TZ=Asia/Harbin date git clean -dfx mkdir debug cd debug - cmake .. -DBUILD_HTTP=false > /dev/null + cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true > /dev/null make > /dev/null make install > /dev/null cd ${WKC}/tests - pip3 install ${WKC}/src/connector/python/ + pip3 install ${WKC}/src/connector/python/ ''' return 1 } @@ -131,7 +132,7 @@ def pre_test_noinstall(){ cd ${WKC} git checkout 2.0 ''' - } + } else{ sh ''' cd ${WKC} @@ -141,6 +142,7 @@ def pre_test_noinstall(){ } sh''' cd ${WKC} + git remote prune origin [ -f src/connector/grafanaplugin/README.md ] && rm -f src/connector/grafanaplugin/README.md > /dev/null || echo "failed to remove grafanaplugin README.md" git pull >/dev/null git fetch origin +refs/pull/${CHANGE_ID}/merge @@ -162,24 +164,24 @@ def pre_test_noinstall(){ cd ${WK} git checkout 2.0 ''' - } + } else{ sh ''' cd ${WK} git checkout develop ''' - } + } } sh ''' cd ${WK} - git pull >/dev/null - + git pull >/dev/null + export TZ=Asia/Harbin date git clean -dfx mkdir debug cd debug - cmake .. -DBUILD_HTTP=false > /dev/null + cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=false > /dev/null make ''' return 1 @@ -202,7 +204,7 @@ def pre_test_mac(){ cd ${WKC} git checkout 2.0 ''' - } + } else{ sh ''' cd ${WKC} @@ -212,6 +214,7 @@ def pre_test_mac(){ } sh''' cd ${WKC} + git remote prune origin [ -f src/connector/grafanaplugin/README.md ] && rm -f src/connector/grafanaplugin/README.md > /dev/null || echo "failed to remove grafanaplugin README.md" git pull >/dev/null git fetch origin +refs/pull/${CHANGE_ID}/merge @@ -233,24 +236,24 @@ def pre_test_mac(){ cd ${WK} git checkout 2.0 ''' - } + } else{ sh ''' cd ${WK} git checkout develop ''' - } + } } sh ''' cd ${WK} - git pull >/dev/null - + git pull >/dev/null + export TZ=Asia/Harbin date git clean -dfx mkdir debug cd debug - cmake .. > /dev/null + cmake .. -DBUILD_TOOLS=false > /dev/null go env -w GOPROXY=https://goproxy.cn,direct go env -w GO111MODULE=on cmake --build . @@ -265,7 +268,7 @@ def pre_test_win(){ cd C:\\workspace\\TDinternal rd /s /Q C:\\workspace\\TDinternal\\debug cd C:\\workspace\\TDinternal\\community - git reset --hard HEAD~10 + git reset --hard HEAD~10 ''' script { if (env.CHANGE_TARGET == 'master') { @@ -279,7 +282,7 @@ def pre_test_win(){ cd C:\\workspace\\TDinternal\\community git checkout 2.0 ''' - } + } else{ bat ''' cd C:\\workspace\\TDinternal\\community @@ -289,7 +292,8 @@ def pre_test_win(){ } bat''' cd C:\\workspace\\TDinternal\\community - git pull + git remote prune origin + git pull git fetch origin +refs/pull/%CHANGE_ID%/merge git checkout -qf FETCH_HEAD git clean -dfx @@ -309,36 +313,36 @@ def pre_test_win(){ cd C:\\workspace\\TDinternal git checkout 2.0 ''' - } + } else{ bat ''' cd C:\\workspace\\TDinternal git checkout develop ''' - } + } } bat ''' cd C:\\workspace\\TDinternal - git pull + git pull date git clean -dfx mkdir debug cd debug call "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build\\vcvarsall.bat" amd64 - cmake ../ -G "NMake Makefiles" + cmake ../ -G "NMake Makefiles" set CL=/MP nmake nmake || exit 8 nmake install || exit 8 xcopy /e/y/i/f C:\\workspace\\TDinternal\\debug\\build\\lib\\taos.dll C:\\Windows\\System32 || exit 8 cd C:\\workspace\\TDinternal\\community\\src\\connector\\python python -m pip install . - + ''' return 1 } pipeline { agent none - options { skipDefaultCheckout() } + options { skipDefaultCheckout() } environment{ WK = '/var/lib/jenkins/workspace/TDinternal' WKC= '/var/lib/jenkins/workspace/TDinternal/community' @@ -346,7 +350,7 @@ pipeline { stages { stage('pre_build'){ agent{label 'master'} - options { skipDefaultCheckout() } + options { skipDefaultCheckout() } when { changeRequest() } @@ -371,32 +375,32 @@ pipeline { // sh ''' // git checkout 2.0 // ''' - // } + // } // else{ // sh ''' // git checkout develop // ''' - // } + // } // } // sh''' // git fetch origin +refs/pull/${CHANGE_ID}/merge // git checkout -qf FETCH_HEAD - // ''' + // ''' - // script{ - // skipbuild='2' + // script{ + // skipbuild='2' // skipbuild=sh(script: "git log -2 --pretty=%B | fgrep -ie '[skip ci]' -e '[ci skip]' && echo 1 || echo 2", returnStdout:true) // println skipbuild // } // sh''' // rm -rf ${WORKSPACE}.tes // ''' - // } + // } } } stage('Parallel test stage') { //only build pr - options { skipDefaultCheckout() } + options { skipDefaultCheckout() } when { allOf{ changeRequest() @@ -415,13 +419,11 @@ pipeline { ./test-all.sh p1 date''' } - } } stage('python_2_s5') { agent{label " slave5 || slave15 "} steps { - pre_test() timeout(time: 55, unit: 'MINUTES'){ sh ''' @@ -434,8 +436,8 @@ pipeline { } stage('python_3_s6') { agent{label " slave6 || slave16 "} - steps { - timeout(time: 55, unit: 'MINUTES'){ + steps { + timeout(time: 55, unit: 'MINUTES'){ pre_test() sh ''' date @@ -447,8 +449,8 @@ pipeline { } stage('test_b1_s2') { agent{label " slave2 || slave12 "} - steps { - timeout(time: 55, unit: 'MINUTES'){ + steps { + timeout(time: 55, unit: 'MINUTES'){ pre_test() sh ''' rm -rf /var/lib/taos/* @@ -492,11 +494,11 @@ pipeline { cd ${WKC}/src/connector/C# dotnet test dotnet run --project src/test/Cases/Cases.csproj - + cd ${WKC}/tests/examples/C# dotnet run --project C#checker/C#checker.csproj dotnet run --project TDengineTest/TDengineTest.csproj - dotnet run --project schemaless/schemaless.csproj + dotnet run --project schemaless/schemaless.csproj cd ${WKC}/tests/examples/C#/taosdemo dotnet build -c Release @@ -517,7 +519,7 @@ pipeline { } stage('test_crash_gen_s3') { agent{label " slave3 || slave13 "} - + steps { pre_test() timeout(time: 60, unit: 'MINUTES'){ @@ -547,7 +549,7 @@ pipeline { ./test-all.sh b2fq date ''' - } + } } } stage('test_valgrind_s4') { @@ -561,8 +563,8 @@ pipeline { ./valgrind-test.sh 2>&1 > mem-error-out.log ./handle_val_log.sh ''' - } - timeout(time: 55, unit: 'MINUTES'){ + } + timeout(time: 55, unit: 'MINUTES'){ sh ''' date cd ${WKC}/tests @@ -578,8 +580,8 @@ pipeline { } stage('test_b4_s7') { agent{label " slave7 || slave17 "} - steps { - timeout(time: 105, unit: 'MINUTES'){ + steps { + timeout(time: 105, unit: 'MINUTES'){ pre_test() sh ''' date @@ -592,14 +594,13 @@ pipeline { // ./test-all.sh full jdbc // cd ${WKC}/tests // ./test-all.sh full unit - } } } stage('test_b5_s8') { agent{label " slave8 || slave18 "} - steps { - timeout(time: 55, unit: 'MINUTES'){ + steps { + timeout(time: 55, unit: 'MINUTES'){ pre_test() sh ''' date @@ -611,8 +612,8 @@ pipeline { } stage('test_b6_s9') { agent{label " slave9 || slave19 "} - steps { - timeout(time: 55, unit: 'MINUTES'){ + steps { + timeout(time: 55, unit: 'MINUTES'){ pre_test() sh ''' cd ${WKC}/tests @@ -623,14 +624,13 @@ pipeline { cd ${WKC}/tests ./test-all.sh b6fq date''' - } } } stage('test_b7_s10') { agent{label " slave10 || slave20 "} - steps { - timeout(time: 55, unit: 'MINUTES'){ + steps { + timeout(time: 55, unit: 'MINUTES'){ pre_test() sh ''' cd ${WKC}/tests @@ -640,68 +640,68 @@ pipeline { date cd ${WKC}/tests ./test-all.sh b7fq - date''' + date''' } } - } + } stage('arm64centos7') { agent{label " arm64centos7 "} - steps { - pre_test_noinstall() + steps { + pre_test_noinstall() } } stage('arm64centos8') { agent{label " arm64centos8 "} - steps { - pre_test_noinstall() + steps { + pre_test_noinstall() } } stage('arm32bionic') { agent{label " arm32bionic "} - steps { - pre_test_noinstall() + steps { + pre_test_noinstall() } } stage('arm64bionic') { agent{label " arm64bionic "} - steps { - pre_test_noinstall() + steps { + pre_test_noinstall() } } stage('arm64focal') { agent{label " arm64focal "} - steps { - pre_test_noinstall() + steps { + pre_test_noinstall() } } stage('centos7') { agent{label " centos7 "} - steps { - pre_test_noinstall() + steps { + pre_test_noinstall() } } stage('ubuntu:trusty') { agent{label " trusty "} - steps { - pre_test_noinstall() + steps { + pre_test_noinstall() } } stage('ubuntu:xenial') { agent{label " xenial "} - steps { - pre_test_noinstall() + steps { + pre_test_noinstall() } } stage('ubuntu:bionic') { agent{label " bionic "} - steps { - pre_test_noinstall() + steps { + pre_test_noinstall() } } stage('Mac_build') { agent{label " catalina "} - steps { - pre_test_mac() + steps { + pre_test_mac() } } @@ -709,7 +709,7 @@ pipeline { agent{label " wintest "} steps { pre_test() - script{ + script{ while(win_stop == 0){ sleep(1) } @@ -719,7 +719,6 @@ pipeline { stage('test'){ agent{label "win"} steps{ - catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { pre_test_win() timeout(time: 20, unit: 'MINUTES'){ @@ -728,18 +727,16 @@ pipeline { .\\test-all.bat wintest ''' } - } + } script{ win_stop=1 } } } - - } } } - post { + post { success { emailext ( subject: "PR-result: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' SUCCESS", @@ -766,7 +763,6 @@ pipeline {
  • 提交信息:${env.CHANGE_TITLE}
  • 构建地址:${BUILD_URL}
  • 构建日志:${BUILD_URL}console
  • - @@ -804,7 +800,6 @@ pipeline {
  • 提交信息:${env.CHANGE_TITLE}
  • 构建地址:${BUILD_URL}
  • 构建日志:${BUILD_URL}console
  • - @@ -816,5 +811,5 @@ pipeline { from: "support@taosdata.com" ) } - } + } } diff --git a/README.md b/README.md index 6cf09e1589946cdb752eba2f3e3135af1699fe3c..31973af6c7baa6fbbe78dcedda52c40a942752b9 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,9 @@ sudo apt-get install -y maven ``` #### Install build dependencies for taos-tools +We provide a few useful tools such as taosBenchmark (was named taosdemo) and taosdump. They were part of TDengine. From TDengine 2.4.0.0, taosBenchmark and taosdump were not released together with TDengine. +By default, TDengine compiling does not include taos-tools. You can use 'cmake .. -DBUILD_TOOLS=true' to make them be compiled with TDengine. + To build the [taos-tools](https://github.com/taosdata/taos-tools) on Ubuntu/Debian, the following packages need to be installed. ```bash sudo apt install libjansson-dev libsnappy-dev liblzma-dev libz-dev pkg-config @@ -142,7 +145,7 @@ mkdir debug && cd debug cmake .. && cmake --build . ``` -Note TDengine 2.3.x.0 and later use a component named 'taosAdapter' to play http daemon role by default instead of the http daemon embedded in the early version of TDengine. The taosAdapter is programmed by go language. If you pull TDengine source code to the latest from an existing codebase, please execute 'git submodule update --init --recursive' to pull taosAdapter source code. Please install go language 1.14 or above for compiling taosAdapter. If you meet difficulties regarding 'go mod', especially you are from China, you can use a proxy to solve the problem. +Note TDengine 2.3.x.0 and later use a component named 'taosAdapter' to play http daemon role by default instead of the http daemon embedded in the early version of TDengine. The taosAdapter is programmed by go language. If you pull TDengine source code to the latest from an existing codebase, please execute 'git submodule update --init --recursive' to pull taosAdapter source code. Please install go language version 1.14 or above for compiling taosAdapter. If you meet difficulties regarding 'go mod', especially you are from China, you can use a proxy to solve the problem. ``` go env -w GO111MODULE=on go env -w GOPROXY=https://goproxy.cn,direct diff --git a/cmake/define.inc b/cmake/define.inc index 07df84a7f4df5d27020716b4d9986a578b839595..6877ee7257cab244c6cc2872e44fa899a798c856 100755 --- a/cmake/define.inc +++ b/cmake/define.inc @@ -168,7 +168,7 @@ IF ("${BUILD_TOOLS}" STREQUAL "") ELSEIF (TD_ARM_64) SET(BUILD_TOOLS "false") ELSE () - SET(BUILD_TOOLS "true") + SET(BUILD_TOOLS "false") ENDIF () ELSEIF (TD_DARWIN) SET(BUILD_TOOLS "false") diff --git a/documentation20/cn/02.getting-started/02.taosdemo/docs.md b/documentation20/cn/02.getting-started/02.taosdemo/docs.md index 98e9ef79eb2a179109d4f7fef51573a9c9a4807d..c01c2efb514c22883bbc9a8bd07a974ba37d3019 100644 --- a/documentation20/cn/02.getting-started/02.taosdemo/docs.md +++ b/documentation20/cn/02.getting-started/02.taosdemo/docs.md @@ -364,7 +364,7 @@ taosdemo 不仅仅可以进行数据写入,也可以执行查询和订阅功 } ``` 以下为 JSON 文件中和查询相关的特有参数含义: - +``` "query_times": 每种查询类型的查询次数 "query_mode": 查询数据接口,"taosc":调用TDengine的c接口;“resetful”:使用restfule接口。可选项。缺省是“taosc”。 "specified_table_query": { 指定表的查询 @@ -379,7 +379,7 @@ taosdemo 不仅仅可以进行数据写入,也可以执行查询和订阅功 "threads": 并发执行sqls的线程数,可选项,缺省是1。每个线程负责一部分子表,执行所有的sqls。 "sql": "select count(*) from xxxx"。查询超级表内所有子表的查询语句,其中表名必须写成 “xxxx”,实例会自动替换成子表名。 "result": 查询结果写入的文件名。可选项,缺省是空,表示查询结果不写入文件。 - +``` 以下为一个典型订阅 JSON 示例文件内容: ``` @@ -422,13 +422,13 @@ taosdemo 不仅仅可以进行数据写入,也可以执行查询和订阅功 } ``` 以下为订阅功能相关的特有参数含义: - +``` "interval": 执行订阅的间隔,单位是秒。可选项,缺省是0。 "restart": 订阅重启。"yes":如果订阅已经存在,重新开始,"no": 继续之前的订阅。(请注意执行用户需要对 dataDir 目录有读写权限) "keepProgress": 保留订阅信息进度。yes表示保留订阅信息,no表示不保留。该值为yes,restart为no时,才能继续之前的订阅。 "resubAfterConsume": 配合 keepProgress 使用,在订阅消费了相应次数后调用 unsubscribe 取消订阅并再次订阅。 "result": 查询结果写入的文件名。可选项,缺省是空,表示查询结果不写入文件。 注意:每条sql语句后的保存结果的文件不能重名,且生成结果文件时,文件名会附加线程号。 - +``` 结语 -- TDengine是涛思数据专为物联网、车联网、工业互联网、IT运维等设计和优化的大数据平台。TDengine 由于数据库内核中创新的数据存储和查询引擎设计,展现出远超同类产品的高效性能。并且由于支持 SQL 语法和多种编程语言的连接器(目前支持 Java, Python, Go, C#, NodeJS, Rust 等),易用性极强,学习成本为零。为了便于运维需求,我们还提供数据迁移和监控功能等相关生态工具软件。 @@ -440,6 +440,7 @@ TDengine是涛思数据专为物联网、车联网、工业互联网、IT运维 附录 - 完整 taosdemo 参数介绍 -- taosdemo支持两种配置参数的模式,一种是命令行参数,一种是使用 JSON 格式的配置文件。 + 一、命令行参数 -f:指定taosdemo所需参数的meta文件。当使用该参数时,其他所有命令行参数都失效。可选项,缺省是NULL。目前仅支持不含 BOM(byte-order mark)的标准 UTF-8 编码文件。 @@ -508,8 +509,9 @@ taosdemo支持两种配置参数的模式,一种是命令行参数,一种是 二、JSON 格式的配置文件中所有参数说明 taosdemo支持3种功能的测试,包括插入、查询、订阅。但一个taosdemo实例不能同时支持三种功能,一个 taosdemo 实例只能支持其中的一种功能,通过配置文件来指定进行哪种功能的测试。 -1、插入功能测试的 JSON 配置文件 +1、插入功能测试的 JSON 配置文件 +``` { "filetype": "insert", "cfgdir": "/etc/taos", @@ -571,6 +573,7 @@ taosdemo支持3种功能的测试,包括插入、查询、订阅。但一个ta }] }] } +``` "filetype": 本taosdemo实例进行哪种功能测试。"insert"表示数据插入功能。必选项。 @@ -600,7 +603,7 @@ taosdemo支持3种功能的测试,包括插入、查询、订阅。但一个ta "databases": [{ -"dbinfo": { ​ "name": 数据库名称。必选项。 +"dbinfo": {"name": 数据库名称。必选项。 "drop": 如果数据库已经存在,”yes“:删除后重建;”no“:不删除,直接使用。可选项,缺省是”no“。drop = yes 会使其他子表创建相关条目无效。 @@ -695,8 +698,9 @@ taosdemo支持3种功能的测试,包括插入、查询、订阅。但一个ta "count":该类型的连续列个数,可选项,缺省是1。 }] -2、查询功能测试的 JSON 配置文件 +2、查询功能测试的 JSON 配置文件 +``` { "filetype": "query", "cfgdir": "/etc/taos", @@ -734,7 +738,7 @@ taosdemo支持3种功能的测试,包括插入、查询、订阅。但一个ta ] } } -​ +``` "filetype": 本taosdemo实例进行哪种功能测试。"query"表示数据查询功能。必选项。 @@ -784,8 +788,9 @@ taosdemo支持3种功能的测试,包括插入、查询、订阅。但一个ta 注意:每条sql语句后的保存结果的文件不能重名,且生成结果文件时,文件名会附加线程号。 查询结果显示:如果查询线程结束一次查询距开始执行时间超过30秒打印一次查询次数、用时和QPS。所有查询结束时,汇总打印总的查询次数和QPS。 -3、订阅功能测试的 JSON 配置文件 +3、订阅功能测试的 JSON 配置文件 +``` { "filetype":"subscribe", "cfgdir": "/etc/taos", @@ -822,7 +827,8 @@ taosdemo支持3种功能的测试,包括插入、查询、订阅。但一个ta "result": "./subscribe_res1.txt" }] } - } +} +``` "filetype": 本taosdemo实例进行哪种功能测试。"subscribe"表示数据查询功能。必选项。** @@ -878,4 +884,4 @@ taosdemo支持3种功能的测试,包括插入、查询、订阅。但一个ta "sql": " select count(*) from xxxx "。查询语句,其中表名必须写成 “xxxx”,实例会自动替换成子表名。 -​ "result": 查询结果写入的文件名。可选项,缺省是空,表示查询结果不写入文件。 注意:每条sql语句后的保存结果的文件不能重名,且生成结果文件时,文件名会附加线程号。 +"result": 查询结果写入的文件名。可选项,缺省是空,表示查询结果不写入文件。 注意:每条sql语句后的保存结果的文件不能重名,且生成结果文件时,文件名会附加线程号。 diff --git a/documentation20/cn/02.getting-started/docs.md b/documentation20/cn/02.getting-started/docs.md index 5f887df914ef06d40f3b3b8bf6ef8dfe18fe6ecf..f38522b5c257fdb3f72e833e72f14f4c9acdefb0 100644 --- a/documentation20/cn/02.getting-started/docs.md +++ b/documentation20/cn/02.getting-started/docs.md @@ -30,7 +30,7 @@ wget -qO - http://repos.taosdata.com/tdengine.key | sudo apt-key add - echo "deb [arch=amd64] http://repos.taosdata.com/tdengine-stable stable main" | sudo tee /etc/apt/sources.list.d/tdengine-stable.list [ beta 版安装包仓库为可选安装项 ] echo "deb [arch=amd64] http://repos.taosdata.com/tdengine-beta beta main" | sudo tee /etc/apt/sources.list.d/tdengine-beta.list sudo apt-get update -apt-get policy tdengine +apt-cache policy tdengine sudo apt-get install tdengine ``` diff --git a/documentation20/cn/05.insert/docs.md b/documentation20/cn/05.insert/docs.md index 243d8509f069e5073cc15ee69438ff6e2cc28e3d..d32a23e9a187e662cf00e2fbe4864472a859b3e0 100644 --- a/documentation20/cn/05.insert/docs.md +++ b/documentation20/cn/05.insert/docs.md @@ -319,118 +319,9 @@ taosAdapter 相关配置参数请参考 taosadapter --help 命令输出以及相 ## 使用 Bailongma 2.0 接入 Telegraf 数据写入 -*注意:TDengine 新版本(2.3.0.0+)提供新版本 Bailongma ,命名为 taosAdapter ,提供更简便的 Telegraf 数据写入以及其他更强大的功能,Bailongma v2 即之前版本将逐步不再维护。 +**注意:** +TDengine 新版本(2.3.0.0+)提供新版本 Bailongma ,命名为 taosAdapter ,提供更简便的 Telegraf 数据写入以及其他更强大的功能,Bailongma v2 及之前版本将逐步不再维护。 -[Telegraf](https://www.influxdata.com/time-series-platform/telegraf/)是一流行的IT运维数据采集开源工具,TDengine提供一个小工具[Bailongma](https://github.com/taosdata/Bailongma),只需在Telegraf做简单配置,无需任何代码,就可将Telegraf采集的数据直接写入TDengine,并按规则在TDengine自动创建库和相关表项。博文[用Docker容器快速搭建一个Devops监控Demo](https://www.taosdata.com/blog/2020/02/03/1189.html)即是采用bailongma将Prometheus和Telegraf的数据写入TDengine中的示例,可以参考。 - -### 从源代码编译 blm_telegraf - -用户需要从github下载[Bailongma](https://github.com/taosdata/Bailongma)的源码,使用Golang语言编译器编译生成可执行文件。在开始编译前,需要准备好以下条件: - -- Linux操作系统的服务器 -- 安装好Golang,1.10版本以上 -- 对应的TDengine版本。因为用到了TDengine的客户端动态链接库,因此需要安装好和服务端相同版本的TDengine程序;比如服务端版本是TDengine 2.0.0, 则在Bailongma所在的Linux服务器(可以与TDengine在同一台服务器,或者不同服务器) - -Bailongma项目中有一个文件夹blm_telegraf,存放了Telegraf的写入API程序。编译过程如下: - -```bash -cd blm_telegraf -go build -``` - -一切正常的情况下,就会在对应的目录下生成一个blm_telegraf的可执行程序。 - -### 安装 Telegraf - -目前TDengine支持Telegraf 1.7.4以上的版本。用户可以根据当前的操作系统,到Telegraf官网下载安装包,并执行安装。下载地址如下:https://portal.influxdata.com/downloads 。 - -### 配置 Telegraf - -修改Telegraf配置文件/etc/telegraf/telegraf.conf中与TDengine有关的配置项。 - -在output plugins部分,增加[[outputs.http]]配置项: - -- url:Bailongma API服务提供的URL,参考下面的启动示例章节 -- data_format:"json" -- json_timestamp_units:"1ms" - -在agent部分: - -- hostname: 区分不同采集设备的机器名称,需确保其唯一性。 -- metric_batch_size: 100,允许Telegraf每批次写入记录最大数量,增大其数量可以降低Telegraf的请求发送频率。 - -关于如何使用Telegraf采集数据以及更多有关使用Telegraf的信息,请参考Telegraf官方的[文档](https://docs.influxdata.com/telegraf/v1.11/)。 - -### 启动 blm_telegraf 程序 - -blm_telegraf程序有以下选项,在启动blm_telegraf程序时可以通过设定这些选项来设定blm_telegraf的配置。 - -```bash ---host -TDengine服务端的IP地址,缺省值为空。 - ---batch-size -blm_telegraf会将收到的telegraf的数据拼装成TDengine的写入请求,这个参数控制一次发给TDengine的写入请求中携带的数据条数。 - ---dbname -设置在TDengine中创建的数据库名称,blm_telegraf会自动在TDengine中创建一个以dbname为名称的数据库,缺省值是prometheus。 - ---dbuser -设置访问TDengine的用户名,缺省值是'root'。 - ---dbpassword -设置访问TDengine的密码,缺省值是'taosdata'。 - ---port -blm_telegraf对telegraf提供服务的端口号。 -``` - -### 启动示例 - -通过以下命令启动一个blm_telegraf的API服务: -```bash -./blm_telegraf -host 127.0.0.1 -port 8089 -``` - -假设blm_telegraf所在服务器的IP地址为"10.1.2.3",则在telegraf的配置文件中, 在output plugins部分,增加[[outputs.http]]配置项: - -```yaml -url = "http://10.1.2.3:8089/telegraf" -``` - -### 查询 telegraf 写入数据 - -telegraf产生的数据格式如下: -```json -{ - "fields": { - "usage_guest": 0, - "usage_guest_nice": 0, - "usage_idle": 89.7897897897898, - "usage_iowait": 0, - "usage_irq": 0, - "usage_nice": 0, - "usage_softirq": 0, - "usage_steal": 0, - "usage_system": 5.405405405405405, - "usage_user": 4.804804804804805 - }, - - "name": "cpu", - "tags": { - "cpu": "cpu2", - "host": "bogon" - }, - "timestamp": 1576464360 -} -``` - -其中,name字段为telegraf采集的时序数据的名称,tags字段为该时序数据的标签。blm_telegraf会以时序数据的名称在TDengine中自动创建一个超级表,并将tags字段中的标签转换成TDengine的tag值,timestamp作为时间戳,fields字段中的值作为该时序数据的值。因此在TDengine的客户端中,可以通过以下指令查到这个数据是否成功写入。 - -```mysql -use telegraf; -select * from cpu; -``` ## EMQ Broker 直接写入 diff --git a/documentation20/cn/08.connector/docs.md b/documentation20/cn/08.connector/docs.md index 9203c2cc9e24a8aaa424bb9e2ee64bd23310cc99..7806de6093b422b40938b701d85c1512b32945ec 100644 --- a/documentation20/cn/08.connector/docs.md +++ b/documentation20/cn/08.connector/docs.md @@ -208,6 +208,8 @@ C/C++的API类似于MySQL的C API。应用程序使用时,需要包含TDengine 返回值为空表示失败。应用程序需要保存返回的参数,以便后续API调用。 + **提示:** 同一进程可以根据不同的host/port 连接多个taosd 集群 + - `char *taos_get_server_info(TAOS *taos)` 获取服务端版本信息。 diff --git a/documentation20/cn/11.administrator/docs.md b/documentation20/cn/11.administrator/docs.md index 8ce6732efec4da35683913e8f73082f98f88f89d..7b7b2262d470f5226eef780a9971894a65663579 100644 --- a/documentation20/cn/11.administrator/docs.md +++ b/documentation20/cn/11.administrator/docs.md @@ -223,7 +223,6 @@ taosd -C | 105 | compressColData | | **S** | bytes | 客户端与服务器之间进行消息通讯过程中,对服务器端查询结果进行列压缩的阈值。 | 0: 对所有查询结果均进行压缩 >0: 查询结果中任意列大小超过该值的消息才进行压缩 -1: 不压缩 | -1 | 2.3.0.0 版本新增。 | | 106 | tsdbMetaCompactRatio | | **C** | | tsdb meta文件中冗余数据超过多少阈值,开启meta文件的压缩功能 | 0:不开启,[1-100]:冗余数据比例 | 0 | | | 107 | rpcForceTcp | | **SC**| | 强制使用TCP传输 | 0: 不开启 1: 开启 | 0 | 在网络比较差的环境中,建议开启。2.0版本新增。| -| 107 | rpcForceTcp | | **SC** | | 强制使用TCP传输。 | 0: 不开启 1: 开启 | 0 | 在网络比较差的环境中,建议开启。2.0 版本新增。 | **注意:**对于端口,TDengine会使用从serverPort起13个连续的TCP和UDP端口号,请务必在防火墙打开。因此如果是缺省配置,需要打开从6030到6042共13个端口,而且必须TCP和UDP都打开。(详细的端口情况请参见 [TDengine 2.0 端口说明](https://www.taosdata.com/cn/documentation/faq#port)) diff --git a/documentation20/en/02.getting-started/02.taosdemo/docs.md b/documentation20/en/02.getting-started/02.taosdemo/docs.md index 750983c85e8ebcd896587df98af83ce20b23ac28..c872d2971ef3cce250592df0534af5369c4682dd 100644 --- a/documentation20/en/02.getting-started/02.taosdemo/docs.md +++ b/documentation20/en/02.getting-started/02.taosdemo/docs.md @@ -374,7 +374,7 @@ The following is the content of a typical query JSON example file. } ``` The following parameters are specific to the query in the JSON file. - +``` "query_times": the number of queries per query type "query_mode": query data interface, "tosc": call TDengine's c interface; "resetful": use restfule interface. Options are available. Default is "taosc". "specified_table_query": { query for the specified table @@ -389,7 +389,7 @@ The following parameters are specific to the query in the JSON file. "threads": the number of threads to execute sqls concurrently, optional, default is 1. Each thread is responsible for a part of sub-tables and executes all sqls. "sql": "select count(*) from xxxx". Query statement for all sub-tables in the super table, where the table name must be written as "xxxx" and the instance will be replaced with the sub-table name automatically. "result": the name of the file to which the query result is written. Optional, the default is null, which means the query results are not written to a file. - +``` The following is a typical subscription JSON example file content. ``` @@ -432,13 +432,13 @@ The following is a typical subscription JSON example file content. } ``` The following are the meanings of the parameters specific to the subscription function. - +``` "interval": interval for executing subscriptions, in seconds. Optional, default is 0. "restart": subscription restart." yes": restart the subscription if it already exists, "no": continue the previous subscription. (Please note that the executing user needs to have read/write access to the dataDir directory) "keepProgress": keep the progress of the subscription information. yes means keep the subscription information, no means don't keep it. The value is yes and restart is no to continue the previous subscriptions. "resubAfterConsume": Used in conjunction with keepProgress to call unsubscribe after the subscription has been consumed the appropriate number of times and to subscribe again. "result": the name of the file to which the query result is written. Optional, default is null, means the query result will not be written to the file. Note: The file to save the result after each sql statement cannot be renamed, and the file name will be appended with the thread number when generating the result file. - +``` Conclusion -- TDengine is a big data platform designed and optimized for IoT, Telematics, Industrial Internet, DevOps, etc. TDengine shows a high performance that far exceeds similar products due to the innovative data storage and query engine design in the database kernel. And withSQL syntax support and connectors for multiple programming languages (currently Java, Python, Go, C#, NodeJS, Rust, etc. are supported), it is extremely easy to use and has zero learning cost. To facilitate the operation and maintenance needs, we also provide data migration and monitoring functions and other related ecological tools and software. diff --git a/documentation20/en/05.insert/docs.md b/documentation20/en/05.insert/docs.md index 7abecfda380b1219a6c5d407d48e7876eecd55ea..aa8ea7dde45959347bbc8f51da012fa864e5bf46 100644 --- a/documentation20/en/05.insert/docs.md +++ b/documentation20/en/05.insert/docs.md @@ -1,6 +1,6 @@ # Efficient Data Writing -TDengine supports multiple ways to write data, including SQL, Prometheus, Telegraf, EMQ MQTT Broker, HiveMQ Broker, CSV file, etc. Kafka, OPC and other interfaces will be provided in the future. Data can be inserted in one single record or in batches, data from one or multiple data collection points can be inserted at the same time. TDengine supports multi-thread insertion, out-of-order data insertion, and also historical data insertion. +TDengine supports multiple ways to write data, including SQL, Prometheus, Telegraf, collectd, StatsD, EMQ MQTT Broker, HiveMQ Broker, CSV file, etc. Kafka, OPC and other interfaces will be provided in the future. Data can be inserted in one single record or in batches, data from one or multiple data collection points can be inserted at the same time. TDengine supports multi-thread insertion, out-of-order data insertion, and also historical data insertion. ## Data Writing via SQL @@ -141,141 +141,84 @@ use prometheus; select * from apiserver_request_latencies_bucket; ``` +## Data Writing via Telegraf and taosAdapter +Please refer to [Official document](https://portal.influxdata.com/downloads/) for Telegraf installation. +TDengine version 2.3.0.0+ includes a stand-alone application taosAdapter in charge of receive data insertion from Telegraf. -## Data Writing via Telegraf - -[Telegraf](https://www.influxdata.com/time-series-platform/telegraf/) is a popular open source tool for IT operation data collection. TDengine provides a simple tool [Bailongma](https://github.com/taosdata/Bailongma), which only needs to be simply configured in Telegraf without any code, and can directly write the data collected by Telegraf into TDengine, then automatically create databases and related table entries in TDengine according to rules. Blog post [Use Docker Container to Quickly Build a Devops Monitoring Demo](https://www.taosdata.com/blog/2020/02/03/1189.html), which is an example of using bailongma to write Prometheus and Telegraf data into TDengine. - -### Compile blm_telegraf From Source Code - -Users need to download the source code of [Bailongma](https://github.com/taosdata/Bailongma) from github, then compile and generate an executable file using Golang language compiler. Before you start compiling, you need to complete following prepares: - -- A server running Linux OS -- Golang version 1.10 and higher installed -- An appropriated TDengine version. Because the client dynamic link library of TDengine is used, it is necessary to install the same version of TDengine as the server-side; for example, if the server version is TDengine 2.0. 0, ensure install the same version on the linux server where bailongma is located (can be on the same server as TDengine, or on a different server) - -Bailongma project has a folder, blm_telegraf, which holds the Telegraf writing API. The compiling process is as follows: - -```bash -cd blm_telegraf - -go build +Configuration: +Please add following words in /etc/telegraf/telegraf.conf. Fill 'database name' with the database name you want to store in the TDengine for Telegraf data. Please fill the values in TDengine server/cluster host, username and password fields. +``` +[[outputs.http]] + url = "http://:6041/influxdb/v1/write?db=" + method = "POST" + timeout = "5s" + username = "" + password = "" + data_format = "influx" + influx_max_line_bytes = 250 ``` -If everything goes well, an executable of blm_telegraf will be generated in the corresponding directory. - -### Install Telegraf - -At the moment, TDengine supports Telegraf version 1.7. 4 and above. Users can download the installation package on Telegraf's website according to your current operating system. The download address is as follows: https://portal.influxdata.com/downloads - -### Configure Telegraf - -Modify the TDengine-related configurations in the Telegraf configuration file /etc/telegraf/telegraf.conf. - -In the output plugins section, add the [[outputs.http]] configuration: - -- url: The URL provided by bailongma API service, please refer to the example section below -- data_format: "json" -- json_timestamp_units: "1ms" - -In agent section: - -- hostname: The machine name that distinguishes different collection devices, and it is necessary to ensure its uniqueness -- metric_batch_size: 100, which is the max number of records per batch written by Telegraf allowed. Increasing the number can reduce the request sending frequency of Telegraf. - -For information on how to use Telegraf to collect data and more about using Telegraf, please refer to the official [document](https://docs.influxdata.com/telegraf/v1.11/) of Telegraf. - -### Launch blm_telegraf - -blm_telegraf has following options, which can be set to tune configurations of blm_telegraf when launching. - -```sh ---host - -The ip address of TDengine server, default is null - ---batch-size - -blm_prometheus assembles the received telegraf data into a TDengine writing request. This parameter controls the number of data pieces carried in a writing request sent to TDengine at a time. - ---dbname - -Set a name for the database created in TDengine, blm_telegraf will automatically create a database named dbname in TDengine, and the default value is prometheus. - ---dbuser +Then restart telegraf: +``` +sudo systemctl start telegraf +``` +Now you can query the metrics data of Telegraf from TDengine. -Set the user name to access TDengine, the default value is 'root ' +Please find taosAdapter configuration and usage from `taosadapter --help` output. ---dbpassword +## collectd 直接写入(通过 taosAdapter) +Please refer to [official document](https://collectd.org/download.shtml) for collectd installation. -Set the password to access TDengine, the default value is'taosdata ' +TDengine version 2.3.0.0+ includes a stand-alone application taosAdapter in charge of receive data insertion from collectd. ---port - -The port number blm_telegraf used to serve Telegraf. +Configuration: +Please add following words in /etc/collectd/collectd.conf. Please fill the value 'host' and 'port' with what the TDengine and taosAdapter using. ``` +LoadPlugin network + + Server "" "" + +``` +Then restart collectd +``` +sudo systemctl start collectd +``` +Please find taosAdapter configuration and usage from `taosadapter --help` output. +## StatsD 直接写入(通过 taosAdapter) +Please refer to [official document](https://github.com/statsd/statsd) for StatsD installation. +TDengine version 2.3.0.0+ includes a stand-alone application taosAdapter in charge of receive data insertion from StatsD. -### Example - -Launch an API service for blm_telegraf with the following command - -```bash -./blm_telegraf -host 127.0.0.1 -port 8089 +Please add following words in the config.js file. Please fill the value to 'host' and 'port' with what the TDengine and taosAdapter using. ``` - -Assuming that the IP address of the server where blm_telegraf located is "10.1.2. 3", the URL shall be added to the configuration file of telegraf as: - -```yaml -url = "http://10.1.2.3:8089/telegraf" +add "./backends/repeater" to backends section. +add { host:'', port: } to repeater section. ``` -### Query written data of telegraf - -The format of generated data by telegraf is as follows: - -```json +Example file: +``` { - "fields": { - "usage_guest": 0, - "usage_guest_nice": 0, - "usage_idle": 89.7897897897898, - "usage_iowait": 0, - "usage_irq": 0, - "usage_nice": 0, - "usage_softirq": 0, - "usage_steal": 0, - "usage_system": 5.405405405405405, - "usage_user": 4.804804804804805 - }, - - "name": "cpu", - "tags": { - "cpu": "cpu2", - "host": "bogon" - }, - "timestamp": 1576464360 +port: 8125 +, backends: ["./backends/repeater"] +, repeater: [{ host: '127.0.0.1', port: 6044}] } ``` -Where the name field is the name of the time-series data collected by telegraf, and the tag field is the tag of the time-series data. blm_telegraf automatically creates a STable in TDengine with the name of the time series data, and converts the tag field into the tag value of TDengine, with Timestamp as the timestamp and fields values as the value of the time-series data. Therefore, in the client of TDEngine, you can check whether this data was successfully written through the following instruction. +Please find taosAdapter configuration and usage from `taosadapter --help` output. -```mysql -use telegraf; -select * from cpu; -``` +## Insert data via Bailongma 2.0 and Telegraf + +**Notice:** +TDengine 2.3.0.0+ provides taosAdapter to support Telegraf data writing. Bailongma v2 will be abandoned and no more maintained. -MQTT is a popular data transmission protocol in the IoT. TDengine can easily access the data received by MQTT Broker and write it to TDengine. ## Data Writing via EMQ Broker [EMQ](https://github.com/emqx/emqx) is an open source MQTT Broker software, with no need of coding, only to use "rules" in EMQ Dashboard for simple configuration, and MQTT data can be directly written into TDengine. EMQ X supports storing data to the TDengine by sending it to a Web service, and also provides a native TDengine driver on Enterprise Edition for direct data store. Please refer to [EMQ official documents](https://docs.emqx.io/broker/latest/cn/rule/rule-example.html#%E4%BF%9D%E5%AD%98%E6%95%B0%E6%8D%AE%E5%88%B0-tdengine) for more details. - - ## Data Writing via HiveMQ Broker -[HiveMQ](https://www.hivemq.com/) is an MQTT agent that provides Free Personal and Enterprise Edition versions. It is mainly used for enterprises, emerging machine-to-machine(M2M) communication and internal transmission to meet scalability, easy management and security features. HiveMQ provides an open source plug-in development kit. You can store data to TDengine via HiveMQ extension-TDengine. Refer to the [HiveMQ extension-TDengine documentation](https://github.com/huskar-t/hivemq-tdengine-extension/blob/b62a26ecc164a310104df57691691b237e091c89/README.md) for more details. \ No newline at end of file +[HiveMQ](https://www.hivemq.com/) is an MQTT agent that provides Free Personal and Enterprise Edition versions. It is mainly used for enterprises, emerging machine-to-machine(M2M) communication and internal transmission to meet scalability, easy management and security features. HiveMQ provides an open source plug-in development kit. You can store data to TDengine via HiveMQ extension-TDengine. Refer to the [HiveMQ extension-TDengine documentation](https://github.com/huskar-t/hivemq-tdengine-extension/blob/b62a26ecc164a310104df57691691b237e091c89/README.md) for more details. diff --git a/documentation20/en/08.connector/docs.md b/documentation20/en/08.connector/docs.md index 2a67c65c16ea11873e65c87fb6d059ac82dfc9ec..b3b4dedabbbc55f554541710c4e0d8abd8e5c892 100644 --- a/documentation20/en/08.connector/docs.md +++ b/documentation20/en/08.connector/docs.md @@ -200,6 +200,8 @@ Create a database connection and initialize the connection context. The paramete * port: Port number A null return value indicates a failure. The application needs to save the returned parameters for subsequent API calls. +Note: The same process can connect to multiple taosd processes based on ip/port + - `char *taos_get_server_info(TAOS *taos)` diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index fe2bc7bf6d5c38ba8df24a2e711d4483e63a5fed..9d64f0a40c9fac43aed987be20d4bbca70fa48ee 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -6278,7 +6278,7 @@ int32_t validateOrderbyNode(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SSqlNode* pSq const char* msg0 = "only one column allowed in orderby"; const char* msg1 = "invalid column name in orderby clause"; const char* msg2 = "too many order by columns"; - const char* msg3 = "only primary timestamp/column in groupby clause allowed as order column"; + const char* msg3 = "only primary timestamp, first tag/tbname in groupby clause allowed as order column"; const char* msg4 = "only tag in groupby clause allowed in order clause"; const char* msg5 = "only primary timestamp/column in top/bottom function allowed as order column"; const char* msg6 = "only primary timestamp allowed as the second order column"; diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index e2263f696a885e885091e86c6b1210bc817996c2..3367c4a36acc33413fae256290ddc5926f2720e3 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -5558,7 +5558,7 @@ end: int8_t jsonType2DbType(double data, int jsonType){ switch(jsonType){ case cJSON_Number: - if (data - (int64_t)data > 0) return TSDB_DATA_TYPE_DOUBLE; else return TSDB_DATA_TYPE_BIGINT; + if (data - (int64_t)data == 0) return TSDB_DATA_TYPE_BIGINT; else return TSDB_DATA_TYPE_DOUBLE; case cJSON_String: return TSDB_DATA_TYPE_NCHAR; case cJSON_NULL: diff --git a/src/common/inc/tvariant.h b/src/common/inc/tvariant.h index 31bc7a247ad9851aa48d99a3c6eec31e90313972..23fd601090bc24606e22b7bc99f7fbf52bd4ac34 100644 --- a/src/common/inc/tvariant.h +++ b/src/common/inc/tvariant.h @@ -39,7 +39,9 @@ typedef struct tVariant { bool tVariantIsValid(tVariant *pVar); -void tVariantCreate(tVariant *pVar, SStrToken *token, bool needRmquoteEscape); +void tVariantCreate(tVariant *pVar, SStrToken *token); + +void tVariantCreateExt(tVariant *pVar, SStrToken *token, int32_t optrType, bool needRmquoteEscape); void tVariantCreateFromBinary(tVariant *pVar, const char *pz, size_t len, uint32_t type); diff --git a/src/common/src/tvariant.c b/src/common/src/tvariant.c index 68ed5c5c109cdfacb5ffac50e4f424ec431b78a0..33b93cfde482e67667e463b13a95be33db785462 100644 --- a/src/common/src/tvariant.c +++ b/src/common/src/tvariant.c @@ -16,6 +16,7 @@ #include "hash.h" #include "taos.h" +#include "taoserror.h" #include "taosdef.h" #include "ttoken.h" #include "ttokendef.h" @@ -30,7 +31,11 @@ assert(0); \ } while (0) -void tVariantCreate(tVariant *pVar, SStrToken *token, bool needRmquoteEscape) { +void tVariantCreate(tVariant *pVar, SStrToken *token) { + tVariantCreateExt(pVar, token, TK_ID, true); +} + +void tVariantCreateExt(tVariant *pVar, SStrToken *token, int32_t optrType, bool needRmquoteEscape) { int32_t ret = 0; int32_t type = token->type; @@ -54,7 +59,7 @@ void tVariantCreate(tVariant *pVar, SStrToken *token, bool needRmquoteEscape) { case TSDB_DATA_TYPE_BIGINT: case TSDB_DATA_TYPE_INT:{ ret = tStrToInteger(token->z, token->type, token->n, &pVar->i64, true); - if (ret != 0) { + if (ret != TSDB_CODE_SUCCESS) { SStrToken t = {0}; tGetToken(token->z, &t.type); if (t.type == TK_MINUS) { // it is a signed number which is greater than INT64_MAX or less than INT64_MIN @@ -64,7 +69,7 @@ void tVariantCreate(tVariant *pVar, SStrToken *token, bool needRmquoteEscape) { // data overflow, try unsigned parse the input number ret = tStrToInteger(token->z, token->type, token->n, &pVar->i64, false); - if (ret != 0) { + if (ret != TSDB_CODE_SUCCESS) { pVar->nType = -1; // -1 means error type return; } @@ -85,15 +90,29 @@ void tVariantCreate(tVariant *pVar, SStrToken *token, bool needRmquoteEscape) { break; } case TSDB_DATA_TYPE_TIMESTAMP: { - pVar->i64 = taosGetTimestamp(TSDB_TIME_PRECISION_NANO); - break; - } - + if (optrType == TK_NOW) { + pVar->i64 = taosGetTimestamp(TSDB_TIME_PRECISION_NANO); + } else if (optrType == TK_PLUS || optrType == TK_MINUS) { + char unit = 0; + ret = parseAbsoluteDuration(token->z, token->n, &pVar->i64, &unit, TSDB_TIME_PRECISION_NANO); + if (ret != TSDB_CODE_SUCCESS) { + pVar->nType = -1; // -1 means error type + return; + } + if (optrType == TK_PLUS) { + pVar->i64 += taosGetTimestamp(TSDB_TIME_PRECISION_NANO); + } else { + pVar->i64 = taosGetTimestamp(TSDB_TIME_PRECISION_NANO) - pVar->i64; + } + } + break; + } + default: { // nType == 0 means the null value type = TSDB_DATA_TYPE_NULL; } } - + pVar->nType = type; } @@ -164,7 +183,7 @@ void tVariantCreateFromBinary(tVariant *pVar, const char *pz, size_t len, uint32 pVar->wpz = calloc(1, (lenInwchar + 1) * TSDB_NCHAR_SIZE); memcpy(pVar->wpz, pz, lenInwchar * TSDB_NCHAR_SIZE); pVar->nLen = (int32_t)len; - + break; } case TSDB_DATA_TYPE_JSON:{ @@ -179,18 +198,18 @@ void tVariantCreateFromBinary(tVariant *pVar, const char *pz, size_t len, uint32 pVar->nLen = (int32_t)len; break; } - + default: pVar->i64 = GET_INT32_VAL(pz); pVar->nLen = tDataTypes[TSDB_DATA_TYPE_INT].bytes; } - + pVar->nType = type; } void tVariantDestroy(tVariant *pVar) { if (pVar == NULL) return; - + if (pVar->nType == TSDB_DATA_TYPE_BINARY || pVar->nType == TSDB_DATA_TYPE_NCHAR || pVar->nType == TSDB_DATA_TYPE_JSON) { tfree(pVar->pz); pVar->nLen = 0; @@ -248,7 +267,7 @@ bool tVariantTypeMatch(tVariant *pVar, int8_t dbType){ void tVariantAssign(tVariant *pDst, const tVariant *pSrc) { if (pSrc == NULL || pDst == NULL) return; - + pDst->nType = pSrc->nType; if (pSrc->nType == TSDB_DATA_TYPE_BINARY || pSrc->nType == TSDB_DATA_TYPE_NCHAR || pSrc->nType == TSDB_DATA_TYPE_JSON) { int32_t len = pSrc->nLen + TSDB_NCHAR_SIZE; @@ -332,14 +351,14 @@ int32_t tVariantCompare(const tVariant* p1, const tVariant* p2) { int32_t tVariantToString(tVariant *pVar, char *dst) { if (pVar == NULL || dst == NULL) return 0; - + switch (pVar->nType) { case TSDB_DATA_TYPE_BINARY: { int32_t len = sprintf(dst, "\'%s\'", pVar->pz); assert(len <= pVar->nLen + sizeof("\'") * 2); // two more chars return len; } - + case TSDB_DATA_TYPE_NCHAR: { dst[0] = '\''; taosUcs4ToMbs(pVar->wpz, (twcslen(pVar->wpz) + 1) * TSDB_NCHAR_SIZE, dst + 1); @@ -348,7 +367,7 @@ int32_t tVariantToString(tVariant *pVar, char *dst) { dst[len + 1] = 0; return len + 1; } - + case TSDB_DATA_TYPE_BOOL: case TSDB_DATA_TYPE_TINYINT: case TSDB_DATA_TYPE_SMALLINT: @@ -357,7 +376,7 @@ int32_t tVariantToString(tVariant *pVar, char *dst) { case TSDB_DATA_TYPE_USMALLINT: case TSDB_DATA_TYPE_UINT: return sprintf(dst, "%d", (int32_t)pVar->i64); - + case TSDB_DATA_TYPE_BIGINT: return sprintf(dst, "%" PRId64, pVar->i64); case TSDB_DATA_TYPE_UBIGINT: @@ -365,7 +384,7 @@ int32_t tVariantToString(tVariant *pVar, char *dst) { case TSDB_DATA_TYPE_FLOAT: case TSDB_DATA_TYPE_DOUBLE: return sprintf(dst, "%.9lf", pVar->dKey); - + default: return 0; } @@ -403,21 +422,21 @@ static int32_t toBinary(tVariant *pVariant, char **pDest, int32_t *pDestSize) { if (*pDest == pVariant->pz) { pBuf = calloc(1, INITIAL_ALLOC_SIZE); } - + if (pVariant->nType == TSDB_DATA_TYPE_NCHAR) { size_t newSize = pVariant->nLen * TSDB_NCHAR_SIZE; if (pBuf != NULL) { if (newSize >= INITIAL_ALLOC_SIZE) { pBuf = realloc(pBuf, newSize + 1); } - + taosUcs4ToMbs(pVariant->wpz, (int32_t)newSize, pBuf); free(pVariant->wpz); pBuf[newSize] = 0; } else { taosUcs4ToMbs(pVariant->wpz, (int32_t)newSize, *pDest); } - + } else { if (IS_SIGNED_NUMERIC_TYPE(pVariant->nType)) { sprintf(pBuf == NULL ? *pDest : pBuf, "%" PRId64, pVariant->i64); @@ -429,18 +448,18 @@ static int32_t toBinary(tVariant *pVariant, char **pDest, int32_t *pDestSize) { setNull(pBuf == NULL ? *pDest : pBuf, TSDB_DATA_TYPE_BINARY, 0); } } - + if (pBuf != NULL) { *pDest = pBuf; } - + *pDestSize = (int32_t)strlen(*pDest); return 0; } static int32_t toNchar(tVariant *pVariant, char **pDest, int32_t *pDestSize) { char tmpBuf[40] = {0}; - + char * pDst = tmpBuf; int32_t nLen = 0; @@ -778,7 +797,7 @@ int32_t tVariantDumpEx(tVariant *pVariant, char *payload, int16_t type, bool inc if (converted) { *converted = true; } - + if (value > FLT_MAX || value < -FLT_MAX) { SET_EXT_INFO(converted, value, -FLT_MAX, FLT_MAX, extInfo); return -1; @@ -789,8 +808,8 @@ int32_t tVariantDumpEx(tVariant *pVariant, char *payload, int16_t type, bool inc if (converted) { *converted = true; } - - if (pVariant->i64 > FLT_MAX || pVariant->i64 < -FLT_MAX) { + + if (pVariant->i64 > FLT_MAX || pVariant->i64 < -FLT_MAX) { SET_EXT_INFO(converted, pVariant->i64, -FLT_MAX, FLT_MAX, extInfo); return -1; } @@ -800,12 +819,12 @@ int32_t tVariantDumpEx(tVariant *pVariant, char *payload, int16_t type, bool inc if (converted) { *converted = true; } - - if (pVariant->dKey > FLT_MAX || pVariant->dKey < -FLT_MAX) { + + if (pVariant->dKey > FLT_MAX || pVariant->dKey < -FLT_MAX) { SET_EXT_INFO(converted, pVariant->dKey, -FLT_MAX, FLT_MAX, extInfo); return -1; } - + SET_FLOAT_VAL(payload, pVariant->dKey); } else if (pVariant->nType == TSDB_DATA_TYPE_NULL) { *((uint32_t *)payload) = TSDB_DATA_FLOAT_NULL; @@ -850,7 +869,7 @@ int32_t tVariantDumpEx(tVariant *pVariant, char *payload, int16_t type, bool inc break; } - + case TSDB_DATA_TYPE_BINARY:{ if (!includeLengthPrefix) { if (pVariant->nType == TSDB_DATA_TYPE_NULL) { @@ -921,7 +940,7 @@ int32_t tVariantDumpEx(tVariant *pVariant, char *payload, int16_t type, bool inc assert(p == varDataVal(payload)); } } - + break; } case TSDB_DATA_TYPE_JSON:{ @@ -935,7 +954,7 @@ int32_t tVariantDumpEx(tVariant *pVariant, char *payload, int16_t type, bool inc break; } } - + return 0; } @@ -950,13 +969,13 @@ int32_t tVariantTypeSetType(tVariant *pVariant, char type) { if (pVariant == NULL || pVariant->nType == 0) { // value is not set return 0; } - + switch (type) { case TSDB_DATA_TYPE_BOOL: { // bool if (convertToBool(pVariant, &pVariant->i64) < 0) { return -1; } - + pVariant->nType = type; break; } @@ -977,7 +996,7 @@ int32_t tVariantTypeSetType(tVariant *pVariant, char type) { free(pVariant->pz); return -1; } - + free(pVariant->pz); pVariant->dKey = v; } else if (pVariant->nType == TSDB_DATA_TYPE_NCHAR) { @@ -987,14 +1006,14 @@ int32_t tVariantTypeSetType(tVariant *pVariant, char type) { free(pVariant->pz); return -1; } - + free(pVariant->pz); pVariant->dKey = v; } else if (pVariant->nType >= TSDB_DATA_TYPE_BOOL && pVariant->nType <= TSDB_DATA_TYPE_BIGINT) { double tmp = (double) pVariant->i64; pVariant->dKey = tmp; } - + pVariant->nType = TSDB_DATA_TYPE_DOUBLE; break; } @@ -1015,6 +1034,6 @@ int32_t tVariantTypeSetType(tVariant *pVariant, char type) { break; } } - + return 0; } diff --git a/src/inc/ttokendef.h b/src/inc/ttokendef.h index 5d73f48eb6378573bbecc8261790a18a147f2133..7d721d21a0b85bb3e7119977f74f3e05e69cc361 100644 --- a/src/inc/ttokendef.h +++ b/src/inc/ttokendef.h @@ -16,7 +16,6 @@ #ifndef TDENGINE_TTOKENDEF_H #define TDENGINE_TTOKENDEF_H - #define TK_ID 1 #define TK_BOOL 2 #define TK_TINYINT 3 @@ -139,12 +138,12 @@ #define TK_USING 120 #define TK_NULL 121 #define TK_NOW 122 -#define TK_SELECT 123 -#define TK_UNION 124 -#define TK_ALL 125 -#define TK_DISTINCT 126 -#define TK_FROM 127 -#define TK_VARIABLE 128 +#define TK_VARIABLE 123 +#define TK_SELECT 124 +#define TK_UNION 125 +#define TK_ALL 126 +#define TK_DISTINCT 127 +#define TK_FROM 128 #define TK_RANGE 129 #define TK_INTERVAL 130 #define TK_EVERY 131 @@ -219,7 +218,6 @@ #define TK_FILE 200 - #define TK_SPACE 300 #define TK_COMMENT 301 #define TK_ILLEGAL 302 diff --git a/src/query/inc/sql.y b/src/query/inc/sql.y index b435722d2093ce6434fe38f1af2f743885b46249..7f0ca21c7a616198cbbf9956d373b3712ecbe1ec 100644 --- a/src/query/inc/sql.y +++ b/src/query/inc/sql.y @@ -253,7 +253,7 @@ acct_optr(Y) ::= pps(C) tseries(D) storage(P) streams(F) qtime(Q) dbs(E) users(K intitemlist(A) ::= intitemlist(X) COMMA intitem(Y). { A = tVariantListAppend(X, &Y, -1); } intitemlist(A) ::= intitem(X). { A = tVariantListAppend(NULL, &X, -1); } -intitem(A) ::= INTEGER(X). { toTSDBType(X.type); tVariantCreate(&A, &X, true); } +intitem(A) ::= INTEGER(X). { toTSDBType(X.type); tVariantCreate(&A, &X); } %type keep {SArray*} %destructor keep {taosArrayDestroy($$);} @@ -438,39 +438,49 @@ column(A) ::= ids(X) typename(Y). { tagitemlist(A) ::= tagitemlist(X) COMMA tagitem(Y). { A = tVariantListAppend(X, &Y, -1); } tagitemlist(A) ::= tagitem(X). { A = tVariantListAppend(NULL, &X, -1); } -tagitem(A) ::= INTEGER(X). { toTSDBType(X.type); tVariantCreate(&A, &X, true); } -tagitem(A) ::= FLOAT(X). { toTSDBType(X.type); tVariantCreate(&A, &X, true); } -tagitem(A) ::= STRING(X). { toTSDBType(X.type); tVariantCreate(&A, &X, true); } -tagitem(A) ::= BOOL(X). { toTSDBType(X.type); tVariantCreate(&A, &X, true); } -tagitem(A) ::= NULL(X). { X.type = 0; tVariantCreate(&A, &X, true); } -tagitem(A) ::= NOW(X). { X.type = TSDB_DATA_TYPE_TIMESTAMP; tVariantCreate(&A, &X, true);} +tagitem(A) ::= INTEGER(X). { toTSDBType(X.type); tVariantCreate(&A, &X); } +tagitem(A) ::= FLOAT(X). { toTSDBType(X.type); tVariantCreate(&A, &X); } +tagitem(A) ::= STRING(X). { toTSDBType(X.type); tVariantCreate(&A, &X); } +tagitem(A) ::= BOOL(X). { toTSDBType(X.type); tVariantCreate(&A, &X); } +tagitem(A) ::= NULL(X). { X.type = 0; tVariantCreate(&A, &X); } +tagitem(A) ::= NOW(X). { X.type = TSDB_DATA_TYPE_TIMESTAMP; tVariantCreateExt(&A, &X, TK_NOW, true);} + +tagitem(A) ::= NOW PLUS VARIABLE(X).{ + X.type = TSDB_DATA_TYPE_TIMESTAMP; + tVariantCreateExt(&A, &X, TK_PLUS, true); +} + +tagitem(A) ::= NOW MINUS VARIABLE(X).{ + X.type = TSDB_DATA_TYPE_TIMESTAMP; + tVariantCreateExt(&A, &X, TK_MINUS, true); +} tagitem(A) ::= MINUS(X) INTEGER(Y).{ X.n += Y.n; X.type = Y.type; toTSDBType(X.type); - tVariantCreate(&A, &X, true); + tVariantCreate(&A, &X); } tagitem(A) ::= MINUS(X) FLOAT(Y). { X.n += Y.n; X.type = Y.type; toTSDBType(X.type); - tVariantCreate(&A, &X, true); + tVariantCreate(&A, &X); } tagitem(A) ::= PLUS(X) INTEGER(Y). { X.n += Y.n; X.type = Y.type; toTSDBType(X.type); - tVariantCreate(&A, &X, true); + tVariantCreate(&A, &X); } tagitem(A) ::= PLUS(X) FLOAT(Y). { X.n += Y.n; X.type = Y.type; toTSDBType(X.type); - tVariantCreate(&A, &X, true); + tVariantCreate(&A, &X); } //////////////////////// The SELECT statement ///////////////////////////////// @@ -609,7 +619,7 @@ fill_opt(N) ::= . { N = 0; } fill_opt(N) ::= FILL LP ID(Y) COMMA tagitemlist(X) RP. { tVariant A = {0}; toTSDBType(Y.type); - tVariantCreate(&A, &Y, true); + tVariantCreate(&A, &Y); tVariantListInsert(X, &A, -1, 0); N = X; @@ -652,12 +662,12 @@ sortlist(A) ::= arrow(Y) sortorder(Z). { %type item {tVariant} item(A) ::= ID(X). { toTSDBType(X.type); - tVariantCreate(&A, &X, true); + tVariantCreate(&A, &X); } item(A) ::= ID(X) DOT ID(Y). { toTSDBType(X.type); X.n += (1+Y.n); - tVariantCreate(&A, &X, true); + tVariantCreate(&A, &X); } %type sortorder {int} diff --git a/src/query/src/qSqlParser.c b/src/query/src/qSqlParser.c index f34f54710dfd259a338ad43e5d299eb0e6e2283d..166881346fb4bae0bcf97d0c325c52a03c44cb85 100644 --- a/src/query/src/qSqlParser.c +++ b/src/query/src/qSqlParser.c @@ -143,14 +143,14 @@ tSqlExpr *tSqlExprCreateIdValue(SSqlInfo* pInfo, SStrToken *pToken, int32_t optr if (optrType == TK_NULL) { if (pToken){ pToken->type = TSDB_DATA_TYPE_NULL; - tVariantCreate(&pSqlExpr->value, pToken, true); + tVariantCreate(&pSqlExpr->value, pToken); } pSqlExpr->tokenId = optrType; pSqlExpr->type = SQL_NODE_VALUE; } else if (optrType == TK_INTEGER || optrType == TK_STRING || optrType == TK_FLOAT || optrType == TK_BOOL) { if (pToken) { toTSDBType(pToken->type); - tVariantCreate(&pSqlExpr->value, pToken, true); + tVariantCreate(&pSqlExpr->value, pToken); } pSqlExpr->tokenId = optrType; pSqlExpr->type = SQL_NODE_VALUE; @@ -211,7 +211,7 @@ tSqlExpr *tSqlExprCreateTimestamp(SStrToken *pToken, int32_t optrType) { if (optrType == TK_INTEGER || optrType == TK_STRING) { if (pToken) { toTSDBType(pToken->type); - tVariantCreate(&pSqlExpr->value, pToken, true); + tVariantCreate(&pSqlExpr->value, pToken); } pSqlExpr->tokenId = optrType; pSqlExpr->type = SQL_NODE_VALUE; @@ -599,7 +599,7 @@ SArray *tVariantListAppendToken(SArray *pList, SStrToken *pToken, uint8_t order, if (pToken) { tVariantListItem item; - tVariantCreate(&item.pVar, pToken, needRmquoteEscape); + tVariantCreateExt(&item.pVar, pToken, TK_ID, needRmquoteEscape); item.sortOrder = order; taosArrayPush(pList, &item); diff --git a/src/query/src/sql.c b/src/query/src/sql.c index 0b8e9542742b9ab8b04d265c7cd6da0e482b7c92..c2d150911dc694ae6b9ab6e35f34207e86219a85 100644 --- a/src/query/src/sql.c +++ b/src/query/src/sql.c @@ -162,12 +162,12 @@ #define TK_USING 120 #define TK_NULL 121 #define TK_NOW 122 -#define TK_SELECT 123 -#define TK_UNION 124 -#define TK_ALL 125 -#define TK_DISTINCT 126 -#define TK_FROM 127 -#define TK_VARIABLE 128 +#define TK_VARIABLE 123 +#define TK_SELECT 124 +#define TK_UNION 125 +#define TK_ALL 126 +#define TK_DISTINCT 127 +#define TK_FROM 128 #define TK_RANGE 129 #define TK_INTERVAL 130 #define TK_EVERY 131 @@ -338,18 +338,18 @@ typedef union { #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 390 -#define YYNRULE 313 -#define YYNRULE_WITH_ACTION 313 +#define YYNSTATE 393 +#define YYNRULE 315 +#define YYNRULE_WITH_ACTION 315 #define YYNTOKEN 201 -#define YY_MAX_SHIFT 389 -#define YY_MIN_SHIFTREDUCE 613 -#define YY_MAX_SHIFTREDUCE 925 -#define YY_ERROR_ACTION 926 -#define YY_ACCEPT_ACTION 927 -#define YY_NO_ACTION 928 -#define YY_MIN_REDUCE 929 -#define YY_MAX_REDUCE 1241 +#define YY_MAX_SHIFT 392 +#define YY_MIN_SHIFTREDUCE 617 +#define YY_MAX_SHIFTREDUCE 931 +#define YY_ERROR_ACTION 932 +#define YY_ACCEPT_ACTION 933 +#define YY_NO_ACTION 934 +#define YY_MIN_REDUCE 935 +#define YY_MAX_REDUCE 1249 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -416,94 +416,94 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (854) +#define YY_ACTTAB_COUNT (858) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 102, 664, 664, 1158, 161, 1159, 311, 804, 260, 665, - /* 10 */ 665, 807, 388, 241, 37, 38, 24, 41, 42, 1078, - /* 20 */ 1070, 263, 31, 30, 29, 1083, 1215, 40, 343, 45, - /* 30 */ 43, 46, 44, 1067, 1068, 55, 1071, 36, 35, 297, - /* 40 */ 298, 34, 33, 32, 37, 38, 213, 41, 42, 250, - /* 50 */ 84, 263, 31, 30, 29, 214, 1215, 40, 343, 45, - /* 60 */ 43, 46, 44, 927, 389, 1215, 256, 36, 35, 211, - /* 70 */ 215, 34, 33, 32, 292, 291, 128, 122, 133, 1215, - /* 80 */ 1215, 1218, 1217, 132, 1069, 138, 141, 131, 37, 38, - /* 90 */ 85, 41, 42, 977, 135, 263, 31, 30, 29, 664, - /* 100 */ 196, 40, 343, 45, 43, 46, 44, 665, 339, 286, - /* 110 */ 13, 36, 35, 1097, 101, 34, 33, 32, 37, 38, + /* 0 */ 102, 668, 668, 1166, 161, 1167, 312, 810, 260, 669, + /* 10 */ 669, 813, 391, 241, 37, 38, 24, 41, 42, 1084, + /* 20 */ 1076, 263, 31, 30, 29, 1089, 1223, 40, 344, 45, + /* 30 */ 43, 46, 44, 1073, 1074, 55, 1077, 36, 35, 298, + /* 40 */ 299, 34, 33, 32, 37, 38, 213, 41, 42, 250, + /* 50 */ 84, 263, 31, 30, 29, 214, 1223, 40, 344, 45, + /* 60 */ 43, 46, 44, 933, 392, 1223, 256, 36, 35, 211, + /* 70 */ 215, 34, 33, 32, 293, 292, 128, 122, 133, 1223, + /* 80 */ 1223, 1226, 1225, 132, 1075, 138, 141, 131, 37, 38, + /* 90 */ 85, 41, 42, 983, 135, 263, 31, 30, 29, 668, + /* 100 */ 196, 40, 344, 45, 43, 46, 44, 669, 340, 287, + /* 110 */ 13, 36, 35, 1105, 101, 34, 33, 32, 37, 38, /* 120 */ 58, 41, 42, 60, 246, 263, 31, 30, 29, 220, - /* 130 */ 285, 40, 343, 45, 43, 46, 44, 315, 97, 1215, - /* 140 */ 96, 36, 35, 664, 104, 34, 33, 32, 339, 37, - /* 150 */ 39, 665, 41, 42, 1097, 176, 263, 31, 30, 29, - /* 160 */ 1106, 856, 40, 343, 45, 43, 46, 44, 34, 33, - /* 170 */ 32, 244, 36, 35, 301, 221, 34, 33, 32, 206, - /* 180 */ 204, 202, 376, 59, 51, 1215, 201, 148, 147, 146, - /* 190 */ 145, 614, 615, 616, 617, 618, 619, 620, 621, 622, - /* 200 */ 623, 624, 625, 626, 627, 159, 987, 242, 38, 277, - /* 210 */ 41, 42, 59, 196, 263, 31, 30, 29, 281, 280, - /* 220 */ 40, 343, 45, 43, 46, 44, 978, 222, 243, 1103, - /* 230 */ 36, 35, 1081, 196, 34, 33, 32, 1215, 41, 42, - /* 240 */ 384, 1015, 263, 31, 30, 29, 1, 184, 40, 343, - /* 250 */ 45, 43, 46, 44, 387, 386, 641, 253, 36, 35, - /* 260 */ 700, 1081, 34, 33, 32, 67, 337, 383, 382, 336, - /* 270 */ 335, 334, 381, 333, 332, 331, 380, 330, 379, 378, - /* 280 */ 1046, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, - /* 290 */ 1043, 1044, 1045, 1047, 1048, 234, 871, 25, 862, 860, - /* 300 */ 865, 863, 1237, 866, 772, 59, 59, 769, 1207, 770, - /* 310 */ 861, 771, 864, 1206, 219, 1205, 234, 871, 1215, 59, - /* 320 */ 860, 227, 863, 1215, 866, 1215, 59, 144, 143, 142, - /* 330 */ 226, 239, 240, 788, 351, 91, 5, 62, 186, 268, - /* 340 */ 269, 3, 197, 185, 111, 116, 107, 115, 266, 91, - /* 350 */ 254, 355, 239, 240, 1081, 1081, 345, 45, 43, 46, - /* 360 */ 44, 59, 326, 271, 356, 36, 35, 785, 1081, 34, - /* 370 */ 33, 32, 68, 1229, 67, 1080, 383, 382, 36, 35, - /* 380 */ 47, 381, 34, 33, 32, 380, 68, 379, 378, 1054, - /* 390 */ 259, 1052, 1053, 10, 293, 284, 1055, 83, 264, 1169, - /* 400 */ 1056, 47, 1057, 1058, 235, 59, 357, 59, 59, 342, - /* 410 */ 1081, 158, 156, 155, 748, 872, 867, 1097, 792, 59, - /* 420 */ 130, 869, 868, 773, 774, 267, 100, 265, 59, 354, - /* 430 */ 353, 341, 376, 870, 245, 294, 872, 867, 88, 237, - /* 440 */ 273, 86, 270, 868, 361, 360, 366, 365, 262, 1215, - /* 450 */ 358, 215, 362, 363, 1081, 238, 1081, 1081, 1156, 215, - /* 460 */ 1157, 1215, 217, 1218, 364, 1215, 218, 105, 1081, 1215, - /* 470 */ 6, 1218, 1215, 368, 223, 288, 1215, 1081, 836, 216, - /* 480 */ 224, 225, 229, 230, 1215, 99, 231, 98, 228, 1215, - /* 490 */ 1215, 1215, 1215, 1215, 212, 248, 1215, 89, 1215, 1084, - /* 500 */ 272, 255, 257, 1072, 1215, 1084, 1084, 816, 817, 272, - /* 510 */ 272, 182, 272, 296, 295, 813, 823, 824, 341, 76, - /* 520 */ 183, 344, 79, 1082, 758, 318, 760, 320, 759, 163, - /* 530 */ 71, 48, 54, 347, 288, 314, 835, 900, 60, 60, - /* 540 */ 71, 103, 71, 873, 261, 348, 663, 15, 82, 14, - /* 550 */ 282, 9, 121, 1168, 120, 346, 17, 9, 16, 251, - /* 560 */ 9, 1165, 77, 80, 777, 321, 778, 19, 775, 18, - /* 570 */ 776, 160, 127, 21, 126, 20, 140, 139, 1164, 252, - /* 580 */ 747, 1105, 367, 26, 859, 1116, 1113, 178, 1114, 1118, - /* 590 */ 162, 1098, 167, 289, 307, 1079, 179, 1148, 1077, 1147, - /* 600 */ 1146, 1145, 180, 181, 992, 157, 323, 324, 325, 300, - /* 610 */ 328, 329, 803, 169, 69, 209, 65, 340, 986, 352, - /* 620 */ 1095, 247, 1236, 118, 302, 304, 81, 1235, 1232, 187, - /* 630 */ 359, 78, 168, 316, 1228, 124, 1227, 1224, 188, 1012, - /* 640 */ 28, 312, 172, 170, 171, 66, 61, 70, 210, 310, - /* 650 */ 876, 974, 134, 308, 972, 136, 137, 970, 969, 306, - /* 660 */ 274, 199, 299, 200, 966, 303, 965, 964, 963, 962, - /* 670 */ 961, 960, 203, 205, 327, 956, 954, 952, 207, 27, - /* 680 */ 949, 208, 945, 377, 129, 287, 87, 92, 305, 369, - /* 690 */ 370, 371, 372, 373, 374, 236, 375, 258, 322, 385, - /* 700 */ 925, 276, 924, 275, 232, 278, 279, 923, 173, 233, - /* 710 */ 991, 990, 112, 906, 113, 905, 283, 288, 317, 11, - /* 720 */ 290, 90, 968, 967, 780, 149, 959, 191, 190, 1013, - /* 730 */ 189, 192, 193, 195, 194, 2, 52, 150, 1014, 4, - /* 740 */ 1050, 151, 958, 951, 53, 152, 174, 177, 175, 950, - /* 750 */ 93, 812, 74, 1060, 810, 809, 806, 805, 75, 166, - /* 760 */ 814, 164, 249, 825, 165, 22, 819, 94, 63, 821, - /* 770 */ 95, 309, 346, 313, 12, 64, 23, 49, 319, 50, - /* 780 */ 104, 106, 109, 56, 108, 678, 713, 711, 710, 57, - /* 790 */ 110, 709, 707, 706, 705, 702, 668, 338, 114, 7, - /* 800 */ 897, 895, 875, 898, 874, 896, 8, 877, 350, 117, - /* 810 */ 72, 60, 349, 119, 73, 123, 750, 125, 749, 746, - /* 820 */ 694, 692, 684, 690, 686, 688, 682, 680, 716, 715, - /* 830 */ 714, 712, 708, 704, 703, 198, 666, 631, 929, 928, - /* 840 */ 928, 928, 928, 928, 928, 928, 928, 928, 928, 928, - /* 850 */ 928, 928, 153, 154, + /* 130 */ 286, 40, 344, 45, 43, 46, 44, 316, 97, 1223, + /* 140 */ 96, 36, 35, 668, 104, 34, 33, 32, 340, 37, + /* 150 */ 39, 669, 41, 42, 1105, 176, 263, 31, 30, 29, + /* 160 */ 1114, 862, 40, 344, 45, 43, 46, 44, 34, 33, + /* 170 */ 32, 244, 36, 35, 302, 221, 34, 33, 32, 206, + /* 180 */ 204, 202, 379, 59, 51, 1223, 201, 148, 147, 146, + /* 190 */ 145, 618, 619, 620, 621, 622, 623, 624, 625, 626, + /* 200 */ 627, 628, 629, 630, 631, 159, 993, 242, 38, 278, + /* 210 */ 41, 42, 59, 196, 263, 31, 30, 29, 282, 281, + /* 220 */ 40, 344, 45, 43, 46, 44, 984, 222, 243, 1111, + /* 230 */ 36, 35, 1087, 196, 34, 33, 32, 1223, 41, 42, + /* 240 */ 387, 1021, 263, 31, 30, 29, 822, 823, 40, 344, + /* 250 */ 45, 43, 46, 44, 390, 389, 645, 253, 36, 35, + /* 260 */ 704, 1087, 34, 33, 32, 67, 338, 386, 385, 337, + /* 270 */ 336, 335, 384, 334, 333, 332, 383, 331, 382, 381, + /* 280 */ 1052, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, + /* 290 */ 1049, 1050, 1051, 1053, 1054, 234, 877, 25, 1215, 866, + /* 300 */ 1164, 869, 1165, 872, 776, 59, 59, 773, 1223, 774, + /* 310 */ 868, 775, 871, 867, 219, 870, 234, 877, 59, 1245, + /* 320 */ 866, 227, 869, 1214, 872, 342, 266, 144, 143, 142, + /* 330 */ 226, 239, 240, 1223, 352, 91, 5, 62, 186, 268, + /* 340 */ 269, 259, 315, 185, 111, 116, 107, 115, 272, 59, + /* 350 */ 254, 356, 239, 240, 1087, 1087, 346, 45, 43, 46, + /* 360 */ 44, 67, 327, 386, 385, 36, 35, 1086, 384, 34, + /* 370 */ 33, 32, 383, 68, 382, 381, 100, 59, 264, 1060, + /* 380 */ 47, 1058, 1059, 36, 35, 1237, 1061, 34, 33, 32, + /* 390 */ 1062, 86, 1063, 1064, 357, 285, 343, 83, 1087, 59, + /* 400 */ 752, 47, 215, 267, 235, 265, 248, 355, 354, 59, + /* 410 */ 1090, 59, 1223, 294, 1226, 878, 873, 874, 342, 59, + /* 420 */ 59, 91, 358, 777, 270, 274, 1087, 271, 875, 364, + /* 430 */ 363, 876, 369, 368, 273, 262, 878, 873, 874, 215, + /* 440 */ 158, 156, 155, 255, 359, 182, 257, 1090, 1087, 1223, + /* 450 */ 1090, 1226, 1213, 237, 365, 130, 366, 6, 1087, 68, + /* 460 */ 1087, 238, 1223, 1223, 367, 371, 217, 379, 1087, 1087, + /* 470 */ 218, 1223, 223, 216, 224, 225, 1223, 1105, 105, 794, + /* 480 */ 1223, 229, 1223, 1223, 1223, 1223, 230, 273, 842, 231, + /* 490 */ 228, 1223, 791, 212, 245, 273, 1223, 88, 183, 1223, + /* 500 */ 1223, 273, 99, 1223, 98, 89, 345, 1, 184, 819, + /* 510 */ 3, 197, 1088, 829, 1078, 297, 296, 830, 76, 10, + /* 520 */ 762, 79, 319, 163, 764, 349, 321, 71, 763, 261, + /* 530 */ 54, 48, 348, 906, 60, 289, 60, 879, 71, 667, + /* 540 */ 103, 295, 71, 289, 1177, 82, 841, 9, 15, 1176, + /* 550 */ 14, 9, 251, 9, 347, 121, 17, 120, 16, 361, + /* 560 */ 360, 77, 80, 322, 783, 798, 784, 1173, 781, 865, + /* 570 */ 782, 19, 1172, 18, 127, 252, 126, 751, 21, 370, + /* 580 */ 20, 140, 139, 283, 160, 1113, 26, 1124, 1121, 1122, + /* 590 */ 1106, 290, 1126, 162, 1156, 167, 308, 1155, 1154, 1153, + /* 600 */ 178, 1085, 179, 1083, 180, 181, 998, 324, 157, 809, + /* 610 */ 325, 1103, 326, 301, 329, 330, 69, 209, 65, 341, + /* 620 */ 168, 169, 992, 247, 303, 317, 353, 305, 1244, 81, + /* 630 */ 882, 28, 118, 78, 1243, 1240, 170, 187, 171, 362, + /* 640 */ 313, 172, 311, 1236, 309, 124, 1235, 307, 1232, 173, + /* 650 */ 188, 1018, 66, 304, 61, 175, 70, 210, 980, 134, + /* 660 */ 978, 136, 300, 137, 976, 975, 275, 199, 200, 972, + /* 670 */ 971, 970, 969, 968, 967, 966, 203, 205, 962, 960, + /* 680 */ 958, 27, 207, 955, 208, 951, 328, 174, 288, 87, + /* 690 */ 92, 380, 306, 373, 129, 372, 374, 375, 236, 376, + /* 700 */ 258, 323, 377, 378, 388, 931, 276, 232, 277, 930, + /* 710 */ 233, 279, 997, 996, 112, 113, 280, 929, 912, 284, + /* 720 */ 911, 318, 289, 11, 90, 291, 786, 52, 974, 973, + /* 730 */ 1019, 191, 149, 189, 190, 192, 193, 195, 150, 194, + /* 740 */ 965, 2, 1056, 151, 964, 4, 152, 1020, 957, 53, + /* 750 */ 177, 956, 93, 818, 74, 816, 815, 812, 1066, 811, + /* 760 */ 75, 166, 820, 164, 249, 831, 165, 22, 825, 94, + /* 770 */ 63, 827, 95, 310, 347, 314, 12, 64, 49, 23, + /* 780 */ 320, 50, 104, 106, 56, 682, 108, 109, 57, 110, + /* 790 */ 717, 715, 714, 713, 711, 710, 709, 706, 672, 339, + /* 800 */ 114, 7, 903, 901, 881, 904, 880, 902, 8, 883, + /* 810 */ 350, 351, 72, 754, 780, 117, 119, 60, 73, 123, + /* 820 */ 125, 779, 753, 750, 698, 696, 688, 694, 690, 692, + /* 830 */ 686, 684, 720, 719, 718, 716, 712, 708, 707, 198, + /* 840 */ 670, 635, 935, 934, 934, 934, 934, 934, 934, 934, + /* 850 */ 934, 934, 934, 934, 934, 934, 153, 154, }; static const YYCODETYPE yy_lookahead[] = { /* 0 */ 211, 1, 1, 279, 203, 281, 282, 5, 210, 9, @@ -530,68 +530,68 @@ static const YYCODETYPE yy_lookahead[] = { /* 210 */ 17, 18, 203, 216, 21, 22, 23, 24, 156, 157, /* 220 */ 27, 28, 29, 30, 31, 32, 209, 271, 248, 272, /* 230 */ 37, 38, 252, 216, 41, 42, 43, 281, 17, 18, - /* 240 */ 225, 226, 21, 22, 23, 24, 212, 213, 27, 28, + /* 240 */ 225, 226, 21, 22, 23, 24, 130, 131, 27, 28, /* 250 */ 29, 30, 31, 32, 69, 70, 71, 248, 37, 38, /* 260 */ 5, 252, 41, 42, 43, 102, 103, 104, 105, 106, /* 270 */ 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, /* 280 */ 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - /* 290 */ 237, 238, 239, 240, 241, 1, 2, 48, 5, 5, - /* 300 */ 7, 7, 253, 9, 2, 203, 203, 5, 271, 7, - /* 310 */ 5, 9, 7, 271, 65, 271, 1, 2, 281, 203, - /* 320 */ 5, 72, 7, 281, 9, 281, 203, 78, 79, 80, - /* 330 */ 81, 37, 38, 41, 85, 86, 66, 67, 68, 37, - /* 340 */ 38, 207, 208, 73, 74, 75, 76, 77, 72, 86, + /* 290 */ 237, 238, 239, 240, 241, 1, 2, 48, 271, 5, + /* 300 */ 279, 7, 281, 9, 2, 203, 203, 5, 281, 7, + /* 310 */ 5, 9, 7, 5, 65, 7, 1, 2, 203, 253, + /* 320 */ 5, 72, 7, 271, 9, 47, 72, 78, 79, 80, + /* 330 */ 81, 37, 38, 281, 85, 86, 66, 67, 68, 37, + /* 340 */ 38, 210, 64, 73, 74, 75, 76, 77, 72, 203, /* 350 */ 248, 248, 37, 38, 252, 252, 41, 29, 30, 31, - /* 360 */ 32, 203, 92, 72, 248, 37, 38, 101, 252, 41, - /* 370 */ 42, 43, 123, 253, 102, 252, 104, 105, 37, 38, - /* 380 */ 86, 109, 41, 42, 43, 113, 123, 115, 116, 227, - /* 390 */ 210, 229, 230, 127, 276, 146, 234, 148, 210, 243, - /* 400 */ 238, 86, 240, 241, 155, 203, 248, 203, 203, 25, - /* 410 */ 252, 66, 67, 68, 5, 121, 122, 251, 126, 203, - /* 420 */ 82, 128, 128, 121, 122, 149, 254, 151, 203, 153, - /* 430 */ 154, 47, 94, 128, 268, 276, 121, 122, 87, 271, - /* 440 */ 149, 269, 151, 128, 153, 154, 37, 38, 64, 281, - /* 450 */ 248, 271, 248, 248, 252, 271, 252, 252, 279, 271, - /* 460 */ 281, 281, 271, 283, 248, 281, 271, 211, 252, 281, - /* 470 */ 86, 283, 281, 248, 271, 124, 281, 252, 80, 271, - /* 480 */ 271, 271, 271, 271, 281, 279, 271, 281, 271, 281, - /* 490 */ 281, 281, 281, 281, 271, 249, 281, 87, 281, 253, - /* 500 */ 203, 249, 249, 247, 281, 253, 253, 130, 131, 203, - /* 510 */ 203, 214, 203, 37, 38, 87, 87, 87, 47, 101, - /* 520 */ 214, 214, 101, 214, 87, 87, 87, 87, 87, 101, - /* 530 */ 101, 101, 86, 25, 124, 64, 138, 87, 101, 101, - /* 540 */ 101, 101, 101, 87, 1, 16, 87, 150, 86, 152, - /* 550 */ 203, 101, 150, 243, 152, 47, 150, 101, 152, 243, - /* 560 */ 101, 243, 144, 142, 5, 119, 7, 150, 5, 152, - /* 570 */ 7, 203, 150, 150, 152, 152, 82, 83, 243, 243, - /* 580 */ 118, 203, 243, 270, 41, 203, 203, 255, 203, 203, - /* 590 */ 203, 251, 203, 251, 203, 251, 203, 280, 203, 280, - /* 600 */ 280, 280, 203, 203, 203, 64, 203, 203, 203, 275, - /* 610 */ 203, 203, 128, 265, 203, 203, 203, 203, 203, 203, - /* 620 */ 267, 275, 203, 203, 275, 275, 141, 203, 203, 203, - /* 630 */ 203, 143, 266, 136, 203, 203, 203, 203, 203, 203, - /* 640 */ 140, 139, 262, 264, 263, 203, 203, 203, 203, 134, - /* 650 */ 121, 203, 203, 133, 203, 203, 203, 203, 203, 132, - /* 660 */ 203, 203, 129, 203, 203, 135, 203, 203, 203, 203, - /* 670 */ 203, 203, 203, 203, 93, 203, 203, 203, 203, 145, - /* 680 */ 203, 203, 203, 117, 100, 205, 205, 205, 205, 99, - /* 690 */ 55, 96, 98, 59, 97, 205, 95, 205, 205, 88, - /* 700 */ 5, 5, 5, 158, 205, 158, 5, 5, 261, 205, - /* 710 */ 215, 215, 211, 104, 211, 103, 147, 124, 119, 86, - /* 720 */ 101, 125, 205, 205, 87, 206, 205, 218, 222, 224, - /* 730 */ 223, 221, 219, 217, 220, 212, 86, 206, 226, 207, - /* 740 */ 242, 206, 205, 205, 257, 206, 260, 256, 259, 205, - /* 750 */ 101, 87, 101, 242, 128, 128, 5, 5, 86, 101, - /* 760 */ 87, 86, 1, 87, 86, 137, 87, 86, 101, 87, - /* 770 */ 86, 86, 47, 1, 86, 101, 137, 86, 119, 86, - /* 780 */ 120, 82, 74, 91, 90, 5, 9, 5, 5, 91, - /* 790 */ 90, 5, 5, 5, 5, 5, 89, 16, 82, 86, - /* 800 */ 9, 9, 87, 9, 87, 9, 86, 121, 63, 152, - /* 810 */ 17, 101, 28, 152, 17, 152, 5, 152, 5, 87, - /* 820 */ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - /* 830 */ 5, 5, 5, 5, 5, 101, 89, 64, 0, 284, - /* 840 */ 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, - /* 850 */ 284, 284, 22, 22, 284, 284, 284, 284, 284, 284, + /* 360 */ 32, 102, 92, 104, 105, 37, 38, 252, 109, 41, + /* 370 */ 42, 43, 113, 124, 115, 116, 254, 203, 210, 227, + /* 380 */ 86, 229, 230, 37, 38, 253, 234, 41, 42, 43, + /* 390 */ 238, 269, 240, 241, 248, 146, 25, 148, 252, 203, + /* 400 */ 5, 86, 271, 149, 155, 151, 249, 153, 154, 203, + /* 410 */ 253, 203, 281, 276, 283, 121, 122, 123, 47, 203, + /* 420 */ 203, 86, 248, 121, 122, 149, 252, 151, 123, 153, + /* 430 */ 154, 123, 37, 38, 203, 64, 121, 122, 123, 271, + /* 440 */ 66, 67, 68, 249, 248, 214, 249, 253, 252, 281, + /* 450 */ 253, 283, 271, 271, 248, 82, 248, 86, 252, 124, + /* 460 */ 252, 271, 281, 281, 248, 248, 271, 94, 252, 252, + /* 470 */ 271, 281, 271, 271, 271, 271, 281, 251, 211, 41, + /* 480 */ 281, 271, 281, 281, 281, 281, 271, 203, 80, 271, + /* 490 */ 271, 281, 101, 271, 268, 203, 281, 87, 214, 281, + /* 500 */ 281, 203, 279, 281, 281, 87, 214, 212, 213, 87, + /* 510 */ 207, 208, 214, 87, 247, 37, 38, 87, 101, 128, + /* 520 */ 87, 101, 87, 101, 87, 16, 87, 101, 87, 1, + /* 530 */ 86, 101, 25, 87, 101, 125, 101, 87, 101, 87, + /* 540 */ 101, 276, 101, 125, 243, 86, 138, 101, 150, 243, + /* 550 */ 152, 101, 243, 101, 47, 150, 150, 152, 152, 37, + /* 560 */ 38, 144, 142, 119, 5, 127, 7, 243, 5, 41, + /* 570 */ 7, 150, 243, 152, 150, 243, 152, 118, 150, 243, + /* 580 */ 152, 82, 83, 203, 203, 203, 270, 203, 203, 203, + /* 590 */ 251, 251, 203, 203, 280, 203, 203, 280, 280, 280, + /* 600 */ 255, 251, 203, 203, 203, 203, 203, 203, 64, 123, + /* 610 */ 203, 267, 203, 275, 203, 203, 203, 203, 203, 203, + /* 620 */ 266, 265, 203, 275, 275, 136, 203, 275, 203, 141, + /* 630 */ 121, 140, 203, 143, 203, 203, 264, 203, 263, 203, + /* 640 */ 139, 262, 134, 203, 133, 203, 203, 132, 203, 261, + /* 650 */ 203, 203, 203, 135, 203, 259, 203, 203, 203, 203, + /* 660 */ 203, 203, 129, 203, 203, 203, 203, 203, 203, 203, + /* 670 */ 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, + /* 680 */ 203, 145, 203, 203, 203, 203, 93, 260, 205, 205, + /* 690 */ 205, 117, 205, 55, 100, 99, 96, 98, 205, 59, + /* 700 */ 205, 205, 97, 95, 88, 5, 158, 205, 5, 5, + /* 710 */ 205, 158, 215, 215, 211, 211, 5, 5, 104, 147, + /* 720 */ 103, 119, 125, 86, 126, 101, 87, 86, 205, 205, + /* 730 */ 224, 218, 206, 223, 222, 221, 219, 217, 206, 220, + /* 740 */ 205, 212, 242, 206, 205, 207, 206, 226, 205, 257, + /* 750 */ 256, 205, 101, 87, 101, 123, 123, 5, 242, 5, + /* 760 */ 86, 101, 87, 86, 1, 87, 86, 137, 87, 86, + /* 770 */ 101, 87, 86, 86, 47, 1, 86, 101, 86, 137, + /* 780 */ 119, 86, 120, 82, 91, 5, 90, 74, 91, 90, + /* 790 */ 9, 5, 5, 5, 5, 5, 5, 5, 89, 16, + /* 800 */ 82, 86, 9, 9, 87, 9, 87, 9, 86, 121, + /* 810 */ 28, 63, 17, 5, 123, 152, 152, 101, 17, 152, + /* 820 */ 152, 123, 5, 87, 5, 5, 5, 5, 5, 5, + /* 830 */ 5, 5, 5, 5, 5, 5, 5, 5, 5, 101, + /* 840 */ 89, 64, 0, 284, 284, 284, 284, 284, 284, 284, + /* 850 */ 284, 284, 284, 284, 284, 284, 22, 22, 284, 284, /* 860 */ 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, /* 870 */ 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, /* 880 */ 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, @@ -611,119 +611,121 @@ static const YYCODETYPE yy_lookahead[] = { /* 1020 */ 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, /* 1030 */ 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, /* 1040 */ 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, - /* 1050 */ 284, 284, 284, 284, 284, + /* 1050 */ 284, 284, 284, 284, 284, 284, 284, 284, 284, }; -#define YY_SHIFT_COUNT (389) +#define YY_SHIFT_COUNT (392) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (838) +#define YY_SHIFT_MAX (842) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 249, 163, 163, 272, 272, 60, 315, 294, 294, 294, + /* 0 */ 249, 163, 163, 259, 259, 60, 315, 294, 294, 294, /* 10 */ 98, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 20 */ 1, 1, 48, 48, 0, 142, 294, 294, 294, 294, /* 30 */ 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, /* 40 */ 294, 294, 294, 294, 294, 294, 294, 294, 302, 302, - /* 50 */ 302, 263, 263, 377, 1, 20, 1, 1, 1, 1, - /* 60 */ 1, 338, 60, 48, 48, 88, 88, 255, 854, 854, - /* 70 */ 854, 302, 302, 302, 2, 2, 409, 409, 409, 409, - /* 80 */ 409, 409, 409, 1, 1, 1, 292, 1, 1, 1, - /* 90 */ 263, 263, 1, 1, 1, 1, 398, 398, 398, 398, - /* 100 */ 266, 263, 1, 1, 1, 1, 1, 1, 1, 1, + /* 50 */ 302, 335, 335, 116, 1, 20, 1, 1, 1, 1, + /* 60 */ 1, 373, 60, 48, 48, 88, 88, 255, 858, 858, + /* 70 */ 858, 302, 302, 302, 2, 2, 395, 395, 395, 395, + /* 80 */ 395, 395, 395, 1, 1, 1, 438, 1, 1, 1, + /* 90 */ 335, 335, 1, 1, 1, 1, 408, 408, 408, 408, + /* 100 */ 391, 335, 1, 1, 1, 1, 1, 1, 1, 1, /* 110 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 120 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 130 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 140 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 150 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - /* 160 */ 541, 541, 541, 484, 484, 484, 484, 541, 485, 488, - /* 170 */ 497, 500, 502, 515, 520, 527, 530, 533, 534, 541, - /* 180 */ 541, 541, 581, 581, 566, 60, 60, 541, 541, 584, - /* 190 */ 590, 635, 595, 594, 634, 597, 601, 566, 255, 541, - /* 200 */ 541, 611, 611, 541, 611, 541, 611, 541, 541, 854, - /* 210 */ 854, 30, 74, 104, 104, 104, 135, 193, 221, 270, - /* 220 */ 328, 328, 328, 328, 328, 328, 10, 113, 341, 341, - /* 230 */ 341, 341, 276, 291, 384, 62, 24, 127, 127, 293, - /* 240 */ 305, 185, 345, 22, 351, 410, 476, 428, 429, 430, - /* 250 */ 471, 418, 421, 437, 438, 439, 440, 441, 446, 450, - /* 260 */ 456, 508, 543, 529, 459, 397, 402, 406, 559, 563, - /* 270 */ 417, 422, 462, 423, 494, 695, 545, 696, 697, 547, - /* 280 */ 701, 702, 609, 612, 569, 593, 599, 633, 596, 637, - /* 290 */ 650, 619, 649, 664, 651, 626, 627, 751, 752, 672, - /* 300 */ 673, 675, 676, 678, 679, 658, 681, 682, 684, 761, - /* 310 */ 685, 667, 628, 725, 772, 674, 639, 688, 599, 691, - /* 320 */ 659, 693, 660, 699, 692, 694, 708, 780, 698, 700, - /* 330 */ 777, 782, 783, 786, 787, 788, 789, 790, 707, 781, - /* 340 */ 716, 791, 792, 713, 715, 717, 794, 796, 686, 720, - /* 350 */ 784, 745, 793, 657, 661, 710, 710, 710, 710, 797, - /* 360 */ 663, 665, 710, 710, 710, 811, 813, 732, 710, 815, - /* 370 */ 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, - /* 380 */ 826, 827, 828, 829, 734, 747, 830, 831, 773, 838, + /* 160 */ 544, 544, 544, 486, 486, 486, 486, 544, 488, 490, + /* 170 */ 489, 491, 501, 508, 511, 515, 518, 533, 536, 544, + /* 180 */ 544, 544, 593, 593, 574, 60, 60, 544, 544, 594, + /* 190 */ 596, 638, 600, 599, 640, 605, 608, 574, 255, 544, + /* 200 */ 544, 616, 616, 544, 616, 544, 616, 544, 544, 858, + /* 210 */ 858, 30, 74, 104, 104, 104, 135, 193, 221, 270, + /* 220 */ 328, 328, 328, 328, 328, 328, 10, 113, 346, 346, + /* 230 */ 346, 346, 254, 276, 371, 62, 24, 127, 127, 305, + /* 240 */ 308, 185, 374, 22, 410, 418, 478, 422, 426, 430, + /* 250 */ 278, 417, 420, 433, 435, 437, 439, 441, 444, 446, + /* 260 */ 450, 507, 528, 509, 452, 398, 405, 406, 559, 563, + /* 270 */ 522, 421, 424, 459, 428, 499, 700, 548, 703, 704, + /* 280 */ 553, 711, 712, 614, 617, 572, 597, 602, 637, 598, + /* 290 */ 639, 641, 624, 651, 666, 653, 632, 633, 752, 754, + /* 300 */ 674, 675, 677, 678, 680, 681, 660, 683, 684, 686, + /* 310 */ 763, 687, 669, 630, 727, 774, 676, 642, 690, 602, + /* 320 */ 692, 661, 695, 662, 701, 693, 696, 713, 780, 697, + /* 330 */ 699, 781, 786, 787, 788, 789, 790, 791, 792, 709, + /* 340 */ 783, 718, 793, 794, 715, 717, 719, 796, 798, 688, + /* 350 */ 722, 782, 748, 795, 663, 664, 716, 716, 716, 716, + /* 360 */ 691, 698, 801, 667, 668, 716, 716, 716, 808, 817, + /* 370 */ 736, 716, 819, 820, 821, 822, 823, 824, 825, 826, + /* 380 */ 827, 828, 829, 830, 831, 832, 833, 738, 751, 834, + /* 390 */ 835, 777, 842, }; #define YY_REDUCE_COUNT (210) #define YY_REDUCE_MIN (-276) -#define YY_REDUCE_MAX (544) +#define YY_REDUCE_MAX (546) static const short yy_reduce_ofst[] = { - /* 0 */ -138, 53, 53, 162, 162, -211, -202, 180, 188, -201, - /* 10 */ -199, -20, 9, 102, 103, 116, 158, 202, 204, 205, - /* 20 */ 216, 225, -276, -141, -43, -191, -255, -225, -216, -142, - /* 30 */ -96, -44, 37, 42, 44, 168, 184, 191, 195, 203, - /* 40 */ 208, 209, 210, 211, 212, 215, 217, 223, 246, 252, - /* 50 */ 253, -97, 166, -103, -184, 256, 297, 306, 307, 309, - /* 60 */ 123, -116, -161, 179, 206, -3, 17, 15, 172, 34, - /* 70 */ 134, -228, 49, 120, 118, 159, 156, 310, 316, 318, - /* 80 */ 335, 336, 339, 347, 368, 378, 313, 382, 383, 385, - /* 90 */ 340, 342, 386, 387, 389, 391, 317, 319, 320, 321, - /* 100 */ 332, 344, 393, 395, 399, 400, 401, 403, 404, 405, - /* 110 */ 407, 408, 411, 412, 413, 414, 415, 416, 419, 420, - /* 120 */ 424, 425, 426, 427, 431, 432, 433, 434, 435, 436, - /* 130 */ 442, 443, 444, 445, 448, 449, 451, 452, 453, 454, - /* 140 */ 455, 457, 458, 460, 461, 463, 464, 465, 466, 467, - /* 150 */ 468, 469, 470, 472, 473, 474, 475, 477, 478, 479, - /* 160 */ 480, 481, 482, 334, 346, 349, 350, 483, 353, 366, - /* 170 */ 348, 379, 381, 380, 447, 486, 489, 487, 491, 490, - /* 180 */ 492, 493, 495, 496, 498, 501, 503, 499, 504, 505, - /* 190 */ 507, 506, 509, 510, 513, 514, 516, 511, 512, 517, - /* 200 */ 518, 519, 531, 521, 535, 537, 539, 538, 544, 523, - /* 210 */ 532, + /* 0 */ -138, 53, 53, 152, 152, -211, -202, 131, 168, -201, + /* 10 */ -199, -20, 9, 102, 103, 146, 174, 196, 206, 208, + /* 20 */ 216, 217, -276, -141, -43, -191, -255, -225, -216, -142, + /* 30 */ -96, -44, 27, 52, 181, 182, 190, 195, 199, 201, + /* 40 */ 202, 203, 204, 210, 215, 218, 219, 222, 157, 194, + /* 50 */ 197, -97, 226, -103, -184, 267, 231, 284, 292, 298, + /* 60 */ 115, -116, -161, 21, 223, -3, 17, 15, 122, 295, + /* 70 */ 303, -228, 66, 132, 137, 265, 301, 306, 309, 324, + /* 80 */ 329, 332, 336, 380, 381, 382, 316, 384, 385, 386, + /* 90 */ 339, 340, 389, 390, 392, 393, 314, 317, 318, 319, + /* 100 */ 345, 350, 399, 400, 401, 402, 403, 404, 407, 409, + /* 110 */ 411, 412, 413, 414, 415, 416, 419, 423, 425, 429, + /* 120 */ 431, 432, 434, 436, 440, 442, 443, 445, 447, 448, + /* 130 */ 449, 451, 453, 454, 455, 456, 457, 458, 460, 461, + /* 140 */ 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, + /* 150 */ 472, 473, 474, 475, 476, 477, 479, 480, 481, 482, + /* 160 */ 483, 484, 485, 338, 348, 349, 352, 487, 344, 354, + /* 170 */ 356, 372, 375, 379, 388, 427, 396, 492, 494, 493, + /* 180 */ 495, 496, 497, 498, 500, 503, 504, 502, 505, 506, + /* 190 */ 510, 512, 513, 514, 517, 519, 520, 516, 521, 523, + /* 200 */ 524, 526, 532, 535, 537, 539, 540, 543, 546, 529, + /* 210 */ 538, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 926, 1049, 988, 1059, 975, 985, 1220, 1220, 1220, 1220, - /* 10 */ 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, - /* 20 */ 926, 926, 926, 926, 1107, 946, 926, 926, 926, 926, - /* 30 */ 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, - /* 40 */ 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, - /* 50 */ 926, 926, 926, 1131, 926, 985, 926, 926, 926, 926, - /* 60 */ 926, 995, 985, 926, 926, 995, 995, 926, 1102, 1033, - /* 70 */ 1051, 926, 926, 926, 926, 926, 926, 926, 926, 926, - /* 80 */ 926, 926, 926, 926, 926, 926, 1109, 1115, 1112, 926, - /* 90 */ 926, 926, 1117, 926, 926, 926, 1153, 1153, 1153, 1153, - /* 100 */ 1100, 926, 926, 926, 926, 926, 926, 926, 926, 926, - /* 110 */ 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, - /* 120 */ 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, - /* 130 */ 926, 926, 926, 926, 973, 926, 971, 926, 926, 926, - /* 140 */ 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, - /* 150 */ 926, 926, 926, 926, 926, 926, 926, 926, 926, 944, - /* 160 */ 948, 948, 948, 926, 926, 926, 926, 948, 1162, 1166, - /* 170 */ 1143, 1160, 1154, 1138, 1136, 1134, 1142, 1127, 1170, 948, - /* 180 */ 948, 948, 993, 993, 989, 985, 985, 948, 948, 1011, - /* 190 */ 1009, 1007, 999, 1005, 1001, 1003, 997, 976, 926, 948, - /* 200 */ 948, 983, 983, 948, 983, 948, 983, 948, 948, 1033, - /* 210 */ 1051, 1219, 926, 1171, 1161, 1219, 926, 1202, 1201, 926, - /* 220 */ 1210, 1209, 1208, 1200, 1199, 1198, 926, 926, 1194, 1197, - /* 230 */ 1196, 1195, 926, 926, 1173, 926, 926, 1204, 1203, 926, - /* 240 */ 926, 926, 926, 926, 926, 926, 1124, 926, 926, 926, - /* 250 */ 1149, 1167, 1163, 926, 926, 926, 926, 926, 926, 926, - /* 260 */ 926, 1174, 926, 926, 926, 926, 926, 926, 926, 926, - /* 270 */ 926, 926, 1061, 926, 926, 926, 926, 926, 926, 926, - /* 280 */ 926, 926, 926, 926, 926, 1099, 926, 926, 926, 926, - /* 290 */ 926, 1111, 1110, 926, 926, 926, 926, 926, 926, 926, - /* 300 */ 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, - /* 310 */ 926, 1155, 926, 1150, 926, 1144, 926, 926, 1073, 926, - /* 320 */ 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, - /* 330 */ 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, - /* 340 */ 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, - /* 350 */ 926, 926, 926, 926, 926, 1238, 1233, 1234, 1231, 926, - /* 360 */ 926, 926, 1230, 1225, 1226, 926, 926, 926, 1223, 926, - /* 370 */ 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, - /* 380 */ 926, 926, 926, 926, 1017, 926, 955, 953, 926, 926, + /* 0 */ 932, 1055, 994, 1065, 981, 991, 1228, 1228, 1228, 1228, + /* 10 */ 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, + /* 20 */ 932, 932, 932, 932, 1115, 952, 932, 932, 932, 932, + /* 30 */ 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, + /* 40 */ 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, + /* 50 */ 932, 932, 932, 1139, 932, 991, 932, 932, 932, 932, + /* 60 */ 932, 1001, 991, 932, 932, 1001, 1001, 932, 1110, 1039, + /* 70 */ 1057, 932, 932, 932, 932, 932, 932, 932, 932, 932, + /* 80 */ 932, 932, 932, 932, 932, 932, 1117, 1123, 1120, 932, + /* 90 */ 932, 932, 1125, 932, 932, 932, 1161, 1161, 1161, 1161, + /* 100 */ 1108, 932, 932, 932, 932, 932, 932, 932, 932, 932, + /* 110 */ 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, + /* 120 */ 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, + /* 130 */ 932, 932, 932, 932, 979, 932, 977, 932, 932, 932, + /* 140 */ 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, + /* 150 */ 932, 932, 932, 932, 932, 932, 932, 932, 932, 950, + /* 160 */ 954, 954, 954, 932, 932, 932, 932, 954, 1170, 1174, + /* 170 */ 1151, 1168, 1162, 1146, 1144, 1142, 1150, 1135, 1178, 954, + /* 180 */ 954, 954, 999, 999, 995, 991, 991, 954, 954, 1017, + /* 190 */ 1015, 1013, 1005, 1011, 1007, 1009, 1003, 982, 932, 954, + /* 200 */ 954, 989, 989, 954, 989, 954, 989, 954, 954, 1039, + /* 210 */ 1057, 1227, 932, 1179, 1169, 1227, 932, 1210, 1209, 932, + /* 220 */ 1218, 1217, 1216, 1208, 1207, 1206, 932, 932, 1202, 1205, + /* 230 */ 1204, 1203, 932, 932, 1181, 932, 932, 1212, 1211, 932, + /* 240 */ 932, 932, 932, 932, 932, 932, 1132, 932, 932, 932, + /* 250 */ 1157, 1175, 1171, 932, 932, 932, 932, 932, 932, 932, + /* 260 */ 932, 1182, 932, 932, 932, 932, 932, 932, 932, 932, + /* 270 */ 1096, 932, 932, 1067, 932, 932, 932, 932, 932, 932, + /* 280 */ 932, 932, 932, 932, 932, 932, 1107, 932, 932, 932, + /* 290 */ 932, 932, 1119, 1118, 932, 932, 932, 932, 932, 932, + /* 300 */ 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, + /* 310 */ 932, 932, 1163, 932, 1158, 932, 1152, 932, 932, 1079, + /* 320 */ 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, + /* 330 */ 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, + /* 340 */ 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, + /* 350 */ 932, 932, 932, 932, 932, 932, 1246, 1241, 1242, 1239, + /* 360 */ 932, 932, 932, 932, 932, 1238, 1233, 1234, 932, 932, + /* 370 */ 932, 1231, 932, 932, 932, 932, 932, 932, 932, 932, + /* 380 */ 932, 932, 932, 932, 932, 932, 932, 1023, 932, 961, + /* 390 */ 959, 932, 932, }; /********** End of lemon-generated parsing tables *****************************/ @@ -866,12 +868,12 @@ static const YYCODETYPE yyFallback[] = { 0, /* USING => nothing */ 1, /* NULL => ID */ 1, /* NOW => ID */ + 0, /* VARIABLE => nothing */ 0, /* SELECT => nothing */ 0, /* UNION => nothing */ 1, /* ALL => ID */ 0, /* DISTINCT => nothing */ 0, /* FROM => nothing */ - 0, /* VARIABLE => nothing */ 0, /* RANGE => nothing */ 0, /* INTERVAL => nothing */ 0, /* EVERY => nothing */ @@ -1155,12 +1157,12 @@ static const char *const yyTokenName[] = { /* 120 */ "USING", /* 121 */ "NULL", /* 122 */ "NOW", - /* 123 */ "SELECT", - /* 124 */ "UNION", - /* 125 */ "ALL", - /* 126 */ "DISTINCT", - /* 127 */ "FROM", - /* 128 */ "VARIABLE", + /* 123 */ "VARIABLE", + /* 124 */ "SELECT", + /* 125 */ "UNION", + /* 126 */ "ALL", + /* 127 */ "DISTINCT", + /* 128 */ "FROM", /* 129 */ "RANGE", /* 130 */ "INTERVAL", /* 131 */ "EVERY", @@ -1485,157 +1487,159 @@ static const char *const yyRuleName[] = { /* 159 */ "tagitem ::= BOOL", /* 160 */ "tagitem ::= NULL", /* 161 */ "tagitem ::= NOW", - /* 162 */ "tagitem ::= MINUS INTEGER", - /* 163 */ "tagitem ::= MINUS FLOAT", - /* 164 */ "tagitem ::= PLUS INTEGER", - /* 165 */ "tagitem ::= PLUS FLOAT", - /* 166 */ "select ::= SELECT selcollist from where_opt range_option interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt", - /* 167 */ "select ::= LP select RP", - /* 168 */ "union ::= select", - /* 169 */ "union ::= union UNION ALL select", - /* 170 */ "cmd ::= union", - /* 171 */ "select ::= SELECT selcollist", - /* 172 */ "sclp ::= selcollist COMMA", - /* 173 */ "sclp ::=", - /* 174 */ "selcollist ::= sclp distinct expr as", - /* 175 */ "selcollist ::= sclp STAR", - /* 176 */ "as ::= AS ids", - /* 177 */ "as ::= ids", - /* 178 */ "as ::=", - /* 179 */ "distinct ::= DISTINCT", - /* 180 */ "distinct ::=", - /* 181 */ "from ::= FROM tablelist", - /* 182 */ "from ::= FROM sub", - /* 183 */ "sub ::= LP union RP", - /* 184 */ "sub ::= LP union RP ids", - /* 185 */ "sub ::= sub COMMA LP union RP ids", - /* 186 */ "tablelist ::= ids cpxName", - /* 187 */ "tablelist ::= ids cpxName ids", - /* 188 */ "tablelist ::= tablelist COMMA ids cpxName", - /* 189 */ "tablelist ::= tablelist COMMA ids cpxName ids", - /* 190 */ "tmvar ::= VARIABLE", - /* 191 */ "timestamp ::= INTEGER", - /* 192 */ "timestamp ::= MINUS INTEGER", - /* 193 */ "timestamp ::= PLUS INTEGER", - /* 194 */ "timestamp ::= STRING", - /* 195 */ "timestamp ::= NOW", - /* 196 */ "timestamp ::= NOW PLUS VARIABLE", - /* 197 */ "timestamp ::= NOW MINUS VARIABLE", - /* 198 */ "range_option ::=", - /* 199 */ "range_option ::= RANGE LP timestamp COMMA timestamp RP", - /* 200 */ "interval_option ::= intervalKey LP tmvar RP", - /* 201 */ "interval_option ::= intervalKey LP tmvar COMMA tmvar RP", - /* 202 */ "interval_option ::=", - /* 203 */ "intervalKey ::= INTERVAL", - /* 204 */ "intervalKey ::= EVERY", - /* 205 */ "session_option ::=", - /* 206 */ "session_option ::= SESSION LP ids cpxName COMMA tmvar RP", - /* 207 */ "windowstate_option ::=", - /* 208 */ "windowstate_option ::= STATE_WINDOW LP ids RP", - /* 209 */ "fill_opt ::=", - /* 210 */ "fill_opt ::= FILL LP ID COMMA tagitemlist RP", - /* 211 */ "fill_opt ::= FILL LP ID RP", - /* 212 */ "sliding_opt ::= SLIDING LP tmvar RP", - /* 213 */ "sliding_opt ::=", - /* 214 */ "orderby_opt ::=", - /* 215 */ "orderby_opt ::= ORDER BY sortlist", - /* 216 */ "sortlist ::= sortlist COMMA item sortorder", - /* 217 */ "sortlist ::= sortlist COMMA arrow sortorder", - /* 218 */ "sortlist ::= item sortorder", - /* 219 */ "sortlist ::= arrow sortorder", - /* 220 */ "item ::= ID", - /* 221 */ "item ::= ID DOT ID", - /* 222 */ "sortorder ::= ASC", - /* 223 */ "sortorder ::= DESC", - /* 224 */ "sortorder ::=", - /* 225 */ "groupby_opt ::=", - /* 226 */ "groupby_opt ::= GROUP BY grouplist", - /* 227 */ "grouplist ::= grouplist COMMA item", - /* 228 */ "grouplist ::= grouplist COMMA arrow", - /* 229 */ "grouplist ::= item", - /* 230 */ "grouplist ::= arrow", - /* 231 */ "having_opt ::=", - /* 232 */ "having_opt ::= HAVING expr", - /* 233 */ "limit_opt ::=", - /* 234 */ "limit_opt ::= LIMIT signed", - /* 235 */ "limit_opt ::= LIMIT signed OFFSET signed", - /* 236 */ "limit_opt ::= LIMIT signed COMMA signed", - /* 237 */ "slimit_opt ::=", - /* 238 */ "slimit_opt ::= SLIMIT signed", - /* 239 */ "slimit_opt ::= SLIMIT signed SOFFSET signed", - /* 240 */ "slimit_opt ::= SLIMIT signed COMMA signed", - /* 241 */ "where_opt ::=", - /* 242 */ "where_opt ::= WHERE expr", - /* 243 */ "expr ::= LP expr RP", - /* 244 */ "expr ::= ID", - /* 245 */ "expr ::= ID DOT ID", - /* 246 */ "expr ::= ID DOT STAR", - /* 247 */ "expr ::= INTEGER", - /* 248 */ "expr ::= MINUS INTEGER", - /* 249 */ "expr ::= PLUS INTEGER", - /* 250 */ "expr ::= FLOAT", - /* 251 */ "expr ::= MINUS FLOAT", - /* 252 */ "expr ::= PLUS FLOAT", - /* 253 */ "expr ::= STRING", - /* 254 */ "expr ::= NOW", - /* 255 */ "expr ::= VARIABLE", - /* 256 */ "expr ::= PLUS VARIABLE", - /* 257 */ "expr ::= MINUS VARIABLE", - /* 258 */ "expr ::= BOOL", - /* 259 */ "expr ::= NULL", - /* 260 */ "expr ::= ID LP exprlist RP", - /* 261 */ "expr ::= ID LP STAR RP", - /* 262 */ "expr ::= ID LP expr AS typename RP", - /* 263 */ "expr ::= expr IS NULL", - /* 264 */ "expr ::= expr IS NOT NULL", - /* 265 */ "expr ::= expr LT expr", - /* 266 */ "expr ::= expr GT expr", - /* 267 */ "expr ::= expr LE expr", - /* 268 */ "expr ::= expr GE expr", - /* 269 */ "expr ::= expr NE expr", - /* 270 */ "expr ::= expr EQ expr", - /* 271 */ "expr ::= expr BETWEEN expr AND expr", - /* 272 */ "expr ::= expr AND expr", - /* 273 */ "expr ::= expr OR expr", - /* 274 */ "expr ::= expr PLUS expr", - /* 275 */ "expr ::= expr MINUS expr", - /* 276 */ "expr ::= expr STAR expr", - /* 277 */ "expr ::= expr SLASH expr", - /* 278 */ "expr ::= expr REM expr", - /* 279 */ "expr ::= expr LIKE expr", - /* 280 */ "expr ::= expr MATCH expr", - /* 281 */ "expr ::= expr NMATCH expr", - /* 282 */ "expr ::= ID CONTAINS STRING", - /* 283 */ "expr ::= ID DOT ID CONTAINS STRING", - /* 284 */ "arrow ::= ID ARROW STRING", - /* 285 */ "arrow ::= ID DOT ID ARROW STRING", - /* 286 */ "expr ::= arrow", - /* 287 */ "expr ::= expr IN LP exprlist RP", - /* 288 */ "exprlist ::= exprlist COMMA expritem", - /* 289 */ "exprlist ::= expritem", - /* 290 */ "expritem ::= expr", - /* 291 */ "expritem ::=", - /* 292 */ "cmd ::= RESET QUERY CACHE", - /* 293 */ "cmd ::= SYNCDB ids REPLICA", - /* 294 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist", - /* 295 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids", - /* 296 */ "cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist", - /* 297 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist", - /* 298 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids", - /* 299 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids", - /* 300 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem", - /* 301 */ "cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist", - /* 302 */ "cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist", - /* 303 */ "cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids", - /* 304 */ "cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist", - /* 305 */ "cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist", - /* 306 */ "cmd ::= ALTER STABLE ids cpxName DROP TAG ids", - /* 307 */ "cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids", - /* 308 */ "cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem", - /* 309 */ "cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist", - /* 310 */ "cmd ::= KILL CONNECTION INTEGER", - /* 311 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER", - /* 312 */ "cmd ::= KILL QUERY INTEGER COLON INTEGER", + /* 162 */ "tagitem ::= NOW PLUS VARIABLE", + /* 163 */ "tagitem ::= NOW MINUS VARIABLE", + /* 164 */ "tagitem ::= MINUS INTEGER", + /* 165 */ "tagitem ::= MINUS FLOAT", + /* 166 */ "tagitem ::= PLUS INTEGER", + /* 167 */ "tagitem ::= PLUS FLOAT", + /* 168 */ "select ::= SELECT selcollist from where_opt range_option interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt", + /* 169 */ "select ::= LP select RP", + /* 170 */ "union ::= select", + /* 171 */ "union ::= union UNION ALL select", + /* 172 */ "cmd ::= union", + /* 173 */ "select ::= SELECT selcollist", + /* 174 */ "sclp ::= selcollist COMMA", + /* 175 */ "sclp ::=", + /* 176 */ "selcollist ::= sclp distinct expr as", + /* 177 */ "selcollist ::= sclp STAR", + /* 178 */ "as ::= AS ids", + /* 179 */ "as ::= ids", + /* 180 */ "as ::=", + /* 181 */ "distinct ::= DISTINCT", + /* 182 */ "distinct ::=", + /* 183 */ "from ::= FROM tablelist", + /* 184 */ "from ::= FROM sub", + /* 185 */ "sub ::= LP union RP", + /* 186 */ "sub ::= LP union RP ids", + /* 187 */ "sub ::= sub COMMA LP union RP ids", + /* 188 */ "tablelist ::= ids cpxName", + /* 189 */ "tablelist ::= ids cpxName ids", + /* 190 */ "tablelist ::= tablelist COMMA ids cpxName", + /* 191 */ "tablelist ::= tablelist COMMA ids cpxName ids", + /* 192 */ "tmvar ::= VARIABLE", + /* 193 */ "timestamp ::= INTEGER", + /* 194 */ "timestamp ::= MINUS INTEGER", + /* 195 */ "timestamp ::= PLUS INTEGER", + /* 196 */ "timestamp ::= STRING", + /* 197 */ "timestamp ::= NOW", + /* 198 */ "timestamp ::= NOW PLUS VARIABLE", + /* 199 */ "timestamp ::= NOW MINUS VARIABLE", + /* 200 */ "range_option ::=", + /* 201 */ "range_option ::= RANGE LP timestamp COMMA timestamp RP", + /* 202 */ "interval_option ::= intervalKey LP tmvar RP", + /* 203 */ "interval_option ::= intervalKey LP tmvar COMMA tmvar RP", + /* 204 */ "interval_option ::=", + /* 205 */ "intervalKey ::= INTERVAL", + /* 206 */ "intervalKey ::= EVERY", + /* 207 */ "session_option ::=", + /* 208 */ "session_option ::= SESSION LP ids cpxName COMMA tmvar RP", + /* 209 */ "windowstate_option ::=", + /* 210 */ "windowstate_option ::= STATE_WINDOW LP ids RP", + /* 211 */ "fill_opt ::=", + /* 212 */ "fill_opt ::= FILL LP ID COMMA tagitemlist RP", + /* 213 */ "fill_opt ::= FILL LP ID RP", + /* 214 */ "sliding_opt ::= SLIDING LP tmvar RP", + /* 215 */ "sliding_opt ::=", + /* 216 */ "orderby_opt ::=", + /* 217 */ "orderby_opt ::= ORDER BY sortlist", + /* 218 */ "sortlist ::= sortlist COMMA item sortorder", + /* 219 */ "sortlist ::= sortlist COMMA arrow sortorder", + /* 220 */ "sortlist ::= item sortorder", + /* 221 */ "sortlist ::= arrow sortorder", + /* 222 */ "item ::= ID", + /* 223 */ "item ::= ID DOT ID", + /* 224 */ "sortorder ::= ASC", + /* 225 */ "sortorder ::= DESC", + /* 226 */ "sortorder ::=", + /* 227 */ "groupby_opt ::=", + /* 228 */ "groupby_opt ::= GROUP BY grouplist", + /* 229 */ "grouplist ::= grouplist COMMA item", + /* 230 */ "grouplist ::= grouplist COMMA arrow", + /* 231 */ "grouplist ::= item", + /* 232 */ "grouplist ::= arrow", + /* 233 */ "having_opt ::=", + /* 234 */ "having_opt ::= HAVING expr", + /* 235 */ "limit_opt ::=", + /* 236 */ "limit_opt ::= LIMIT signed", + /* 237 */ "limit_opt ::= LIMIT signed OFFSET signed", + /* 238 */ "limit_opt ::= LIMIT signed COMMA signed", + /* 239 */ "slimit_opt ::=", + /* 240 */ "slimit_opt ::= SLIMIT signed", + /* 241 */ "slimit_opt ::= SLIMIT signed SOFFSET signed", + /* 242 */ "slimit_opt ::= SLIMIT signed COMMA signed", + /* 243 */ "where_opt ::=", + /* 244 */ "where_opt ::= WHERE expr", + /* 245 */ "expr ::= LP expr RP", + /* 246 */ "expr ::= ID", + /* 247 */ "expr ::= ID DOT ID", + /* 248 */ "expr ::= ID DOT STAR", + /* 249 */ "expr ::= INTEGER", + /* 250 */ "expr ::= MINUS INTEGER", + /* 251 */ "expr ::= PLUS INTEGER", + /* 252 */ "expr ::= FLOAT", + /* 253 */ "expr ::= MINUS FLOAT", + /* 254 */ "expr ::= PLUS FLOAT", + /* 255 */ "expr ::= STRING", + /* 256 */ "expr ::= NOW", + /* 257 */ "expr ::= VARIABLE", + /* 258 */ "expr ::= PLUS VARIABLE", + /* 259 */ "expr ::= MINUS VARIABLE", + /* 260 */ "expr ::= BOOL", + /* 261 */ "expr ::= NULL", + /* 262 */ "expr ::= ID LP exprlist RP", + /* 263 */ "expr ::= ID LP STAR RP", + /* 264 */ "expr ::= ID LP expr AS typename RP", + /* 265 */ "expr ::= expr IS NULL", + /* 266 */ "expr ::= expr IS NOT NULL", + /* 267 */ "expr ::= expr LT expr", + /* 268 */ "expr ::= expr GT expr", + /* 269 */ "expr ::= expr LE expr", + /* 270 */ "expr ::= expr GE expr", + /* 271 */ "expr ::= expr NE expr", + /* 272 */ "expr ::= expr EQ expr", + /* 273 */ "expr ::= expr BETWEEN expr AND expr", + /* 274 */ "expr ::= expr AND expr", + /* 275 */ "expr ::= expr OR expr", + /* 276 */ "expr ::= expr PLUS expr", + /* 277 */ "expr ::= expr MINUS expr", + /* 278 */ "expr ::= expr STAR expr", + /* 279 */ "expr ::= expr SLASH expr", + /* 280 */ "expr ::= expr REM expr", + /* 281 */ "expr ::= expr LIKE expr", + /* 282 */ "expr ::= expr MATCH expr", + /* 283 */ "expr ::= expr NMATCH expr", + /* 284 */ "expr ::= ID CONTAINS STRING", + /* 285 */ "expr ::= ID DOT ID CONTAINS STRING", + /* 286 */ "arrow ::= ID ARROW STRING", + /* 287 */ "arrow ::= ID DOT ID ARROW STRING", + /* 288 */ "expr ::= arrow", + /* 289 */ "expr ::= expr IN LP exprlist RP", + /* 290 */ "exprlist ::= exprlist COMMA expritem", + /* 291 */ "exprlist ::= expritem", + /* 292 */ "expritem ::= expr", + /* 293 */ "expritem ::=", + /* 294 */ "cmd ::= RESET QUERY CACHE", + /* 295 */ "cmd ::= SYNCDB ids REPLICA", + /* 296 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist", + /* 297 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids", + /* 298 */ "cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist", + /* 299 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist", + /* 300 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids", + /* 301 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids", + /* 302 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem", + /* 303 */ "cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist", + /* 304 */ "cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist", + /* 305 */ "cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids", + /* 306 */ "cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist", + /* 307 */ "cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist", + /* 308 */ "cmd ::= ALTER STABLE ids cpxName DROP TAG ids", + /* 309 */ "cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids", + /* 310 */ "cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem", + /* 311 */ "cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist", + /* 312 */ "cmd ::= KILL CONNECTION INTEGER", + /* 313 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER", + /* 314 */ "cmd ::= KILL QUERY INTEGER COLON INTEGER", }; #endif /* NDEBUG */ @@ -2262,157 +2266,159 @@ static const YYCODETYPE yyRuleInfoLhs[] = { 253, /* (159) tagitem ::= BOOL */ 253, /* (160) tagitem ::= NULL */ 253, /* (161) tagitem ::= NOW */ - 253, /* (162) tagitem ::= MINUS INTEGER */ - 253, /* (163) tagitem ::= MINUS FLOAT */ - 253, /* (164) tagitem ::= PLUS INTEGER */ - 253, /* (165) tagitem ::= PLUS FLOAT */ - 251, /* (166) select ::= SELECT selcollist from where_opt range_option interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */ - 251, /* (167) select ::= LP select RP */ - 268, /* (168) union ::= select */ - 268, /* (169) union ::= union UNION ALL select */ - 202, /* (170) cmd ::= union */ - 251, /* (171) select ::= SELECT selcollist */ - 269, /* (172) sclp ::= selcollist COMMA */ - 269, /* (173) sclp ::= */ - 254, /* (174) selcollist ::= sclp distinct expr as */ - 254, /* (175) selcollist ::= sclp STAR */ - 272, /* (176) as ::= AS ids */ - 272, /* (177) as ::= ids */ - 272, /* (178) as ::= */ - 270, /* (179) distinct ::= DISTINCT */ - 270, /* (180) distinct ::= */ - 255, /* (181) from ::= FROM tablelist */ - 255, /* (182) from ::= FROM sub */ - 274, /* (183) sub ::= LP union RP */ - 274, /* (184) sub ::= LP union RP ids */ - 274, /* (185) sub ::= sub COMMA LP union RP ids */ - 273, /* (186) tablelist ::= ids cpxName */ - 273, /* (187) tablelist ::= ids cpxName ids */ - 273, /* (188) tablelist ::= tablelist COMMA ids cpxName */ - 273, /* (189) tablelist ::= tablelist COMMA ids cpxName ids */ - 275, /* (190) tmvar ::= VARIABLE */ - 276, /* (191) timestamp ::= INTEGER */ - 276, /* (192) timestamp ::= MINUS INTEGER */ - 276, /* (193) timestamp ::= PLUS INTEGER */ - 276, /* (194) timestamp ::= STRING */ - 276, /* (195) timestamp ::= NOW */ - 276, /* (196) timestamp ::= NOW PLUS VARIABLE */ - 276, /* (197) timestamp ::= NOW MINUS VARIABLE */ - 257, /* (198) range_option ::= */ - 257, /* (199) range_option ::= RANGE LP timestamp COMMA timestamp RP */ - 258, /* (200) interval_option ::= intervalKey LP tmvar RP */ - 258, /* (201) interval_option ::= intervalKey LP tmvar COMMA tmvar RP */ - 258, /* (202) interval_option ::= */ - 277, /* (203) intervalKey ::= INTERVAL */ - 277, /* (204) intervalKey ::= EVERY */ - 260, /* (205) session_option ::= */ - 260, /* (206) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ - 261, /* (207) windowstate_option ::= */ - 261, /* (208) windowstate_option ::= STATE_WINDOW LP ids RP */ - 262, /* (209) fill_opt ::= */ - 262, /* (210) fill_opt ::= FILL LP ID COMMA tagitemlist RP */ - 262, /* (211) fill_opt ::= FILL LP ID RP */ - 259, /* (212) sliding_opt ::= SLIDING LP tmvar RP */ - 259, /* (213) sliding_opt ::= */ - 265, /* (214) orderby_opt ::= */ - 265, /* (215) orderby_opt ::= ORDER BY sortlist */ - 278, /* (216) sortlist ::= sortlist COMMA item sortorder */ - 278, /* (217) sortlist ::= sortlist COMMA arrow sortorder */ - 278, /* (218) sortlist ::= item sortorder */ - 278, /* (219) sortlist ::= arrow sortorder */ - 279, /* (220) item ::= ID */ - 279, /* (221) item ::= ID DOT ID */ - 280, /* (222) sortorder ::= ASC */ - 280, /* (223) sortorder ::= DESC */ - 280, /* (224) sortorder ::= */ - 263, /* (225) groupby_opt ::= */ - 263, /* (226) groupby_opt ::= GROUP BY grouplist */ - 282, /* (227) grouplist ::= grouplist COMMA item */ - 282, /* (228) grouplist ::= grouplist COMMA arrow */ - 282, /* (229) grouplist ::= item */ - 282, /* (230) grouplist ::= arrow */ - 264, /* (231) having_opt ::= */ - 264, /* (232) having_opt ::= HAVING expr */ - 267, /* (233) limit_opt ::= */ - 267, /* (234) limit_opt ::= LIMIT signed */ - 267, /* (235) limit_opt ::= LIMIT signed OFFSET signed */ - 267, /* (236) limit_opt ::= LIMIT signed COMMA signed */ - 266, /* (237) slimit_opt ::= */ - 266, /* (238) slimit_opt ::= SLIMIT signed */ - 266, /* (239) slimit_opt ::= SLIMIT signed SOFFSET signed */ - 266, /* (240) slimit_opt ::= SLIMIT signed COMMA signed */ - 256, /* (241) where_opt ::= */ - 256, /* (242) where_opt ::= WHERE expr */ - 271, /* (243) expr ::= LP expr RP */ - 271, /* (244) expr ::= ID */ - 271, /* (245) expr ::= ID DOT ID */ - 271, /* (246) expr ::= ID DOT STAR */ - 271, /* (247) expr ::= INTEGER */ - 271, /* (248) expr ::= MINUS INTEGER */ - 271, /* (249) expr ::= PLUS INTEGER */ - 271, /* (250) expr ::= FLOAT */ - 271, /* (251) expr ::= MINUS FLOAT */ - 271, /* (252) expr ::= PLUS FLOAT */ - 271, /* (253) expr ::= STRING */ - 271, /* (254) expr ::= NOW */ - 271, /* (255) expr ::= VARIABLE */ - 271, /* (256) expr ::= PLUS VARIABLE */ - 271, /* (257) expr ::= MINUS VARIABLE */ - 271, /* (258) expr ::= BOOL */ - 271, /* (259) expr ::= NULL */ - 271, /* (260) expr ::= ID LP exprlist RP */ - 271, /* (261) expr ::= ID LP STAR RP */ - 271, /* (262) expr ::= ID LP expr AS typename RP */ - 271, /* (263) expr ::= expr IS NULL */ - 271, /* (264) expr ::= expr IS NOT NULL */ - 271, /* (265) expr ::= expr LT expr */ - 271, /* (266) expr ::= expr GT expr */ - 271, /* (267) expr ::= expr LE expr */ - 271, /* (268) expr ::= expr GE expr */ - 271, /* (269) expr ::= expr NE expr */ - 271, /* (270) expr ::= expr EQ expr */ - 271, /* (271) expr ::= expr BETWEEN expr AND expr */ - 271, /* (272) expr ::= expr AND expr */ - 271, /* (273) expr ::= expr OR expr */ - 271, /* (274) expr ::= expr PLUS expr */ - 271, /* (275) expr ::= expr MINUS expr */ - 271, /* (276) expr ::= expr STAR expr */ - 271, /* (277) expr ::= expr SLASH expr */ - 271, /* (278) expr ::= expr REM expr */ - 271, /* (279) expr ::= expr LIKE expr */ - 271, /* (280) expr ::= expr MATCH expr */ - 271, /* (281) expr ::= expr NMATCH expr */ - 271, /* (282) expr ::= ID CONTAINS STRING */ - 271, /* (283) expr ::= ID DOT ID CONTAINS STRING */ - 281, /* (284) arrow ::= ID ARROW STRING */ - 281, /* (285) arrow ::= ID DOT ID ARROW STRING */ - 271, /* (286) expr ::= arrow */ - 271, /* (287) expr ::= expr IN LP exprlist RP */ - 210, /* (288) exprlist ::= exprlist COMMA expritem */ - 210, /* (289) exprlist ::= expritem */ - 283, /* (290) expritem ::= expr */ - 283, /* (291) expritem ::= */ - 202, /* (292) cmd ::= RESET QUERY CACHE */ - 202, /* (293) cmd ::= SYNCDB ids REPLICA */ - 202, /* (294) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ - 202, /* (295) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ - 202, /* (296) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */ - 202, /* (297) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ - 202, /* (298) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ - 202, /* (299) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ - 202, /* (300) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ - 202, /* (301) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */ - 202, /* (302) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ - 202, /* (303) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ - 202, /* (304) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */ - 202, /* (305) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ - 202, /* (306) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ - 202, /* (307) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ - 202, /* (308) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */ - 202, /* (309) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */ - 202, /* (310) cmd ::= KILL CONNECTION INTEGER */ - 202, /* (311) cmd ::= KILL STREAM INTEGER COLON INTEGER */ - 202, /* (312) cmd ::= KILL QUERY INTEGER COLON INTEGER */ + 253, /* (162) tagitem ::= NOW PLUS VARIABLE */ + 253, /* (163) tagitem ::= NOW MINUS VARIABLE */ + 253, /* (164) tagitem ::= MINUS INTEGER */ + 253, /* (165) tagitem ::= MINUS FLOAT */ + 253, /* (166) tagitem ::= PLUS INTEGER */ + 253, /* (167) tagitem ::= PLUS FLOAT */ + 251, /* (168) select ::= SELECT selcollist from where_opt range_option interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */ + 251, /* (169) select ::= LP select RP */ + 268, /* (170) union ::= select */ + 268, /* (171) union ::= union UNION ALL select */ + 202, /* (172) cmd ::= union */ + 251, /* (173) select ::= SELECT selcollist */ + 269, /* (174) sclp ::= selcollist COMMA */ + 269, /* (175) sclp ::= */ + 254, /* (176) selcollist ::= sclp distinct expr as */ + 254, /* (177) selcollist ::= sclp STAR */ + 272, /* (178) as ::= AS ids */ + 272, /* (179) as ::= ids */ + 272, /* (180) as ::= */ + 270, /* (181) distinct ::= DISTINCT */ + 270, /* (182) distinct ::= */ + 255, /* (183) from ::= FROM tablelist */ + 255, /* (184) from ::= FROM sub */ + 274, /* (185) sub ::= LP union RP */ + 274, /* (186) sub ::= LP union RP ids */ + 274, /* (187) sub ::= sub COMMA LP union RP ids */ + 273, /* (188) tablelist ::= ids cpxName */ + 273, /* (189) tablelist ::= ids cpxName ids */ + 273, /* (190) tablelist ::= tablelist COMMA ids cpxName */ + 273, /* (191) tablelist ::= tablelist COMMA ids cpxName ids */ + 275, /* (192) tmvar ::= VARIABLE */ + 276, /* (193) timestamp ::= INTEGER */ + 276, /* (194) timestamp ::= MINUS INTEGER */ + 276, /* (195) timestamp ::= PLUS INTEGER */ + 276, /* (196) timestamp ::= STRING */ + 276, /* (197) timestamp ::= NOW */ + 276, /* (198) timestamp ::= NOW PLUS VARIABLE */ + 276, /* (199) timestamp ::= NOW MINUS VARIABLE */ + 257, /* (200) range_option ::= */ + 257, /* (201) range_option ::= RANGE LP timestamp COMMA timestamp RP */ + 258, /* (202) interval_option ::= intervalKey LP tmvar RP */ + 258, /* (203) interval_option ::= intervalKey LP tmvar COMMA tmvar RP */ + 258, /* (204) interval_option ::= */ + 277, /* (205) intervalKey ::= INTERVAL */ + 277, /* (206) intervalKey ::= EVERY */ + 260, /* (207) session_option ::= */ + 260, /* (208) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ + 261, /* (209) windowstate_option ::= */ + 261, /* (210) windowstate_option ::= STATE_WINDOW LP ids RP */ + 262, /* (211) fill_opt ::= */ + 262, /* (212) fill_opt ::= FILL LP ID COMMA tagitemlist RP */ + 262, /* (213) fill_opt ::= FILL LP ID RP */ + 259, /* (214) sliding_opt ::= SLIDING LP tmvar RP */ + 259, /* (215) sliding_opt ::= */ + 265, /* (216) orderby_opt ::= */ + 265, /* (217) orderby_opt ::= ORDER BY sortlist */ + 278, /* (218) sortlist ::= sortlist COMMA item sortorder */ + 278, /* (219) sortlist ::= sortlist COMMA arrow sortorder */ + 278, /* (220) sortlist ::= item sortorder */ + 278, /* (221) sortlist ::= arrow sortorder */ + 279, /* (222) item ::= ID */ + 279, /* (223) item ::= ID DOT ID */ + 280, /* (224) sortorder ::= ASC */ + 280, /* (225) sortorder ::= DESC */ + 280, /* (226) sortorder ::= */ + 263, /* (227) groupby_opt ::= */ + 263, /* (228) groupby_opt ::= GROUP BY grouplist */ + 282, /* (229) grouplist ::= grouplist COMMA item */ + 282, /* (230) grouplist ::= grouplist COMMA arrow */ + 282, /* (231) grouplist ::= item */ + 282, /* (232) grouplist ::= arrow */ + 264, /* (233) having_opt ::= */ + 264, /* (234) having_opt ::= HAVING expr */ + 267, /* (235) limit_opt ::= */ + 267, /* (236) limit_opt ::= LIMIT signed */ + 267, /* (237) limit_opt ::= LIMIT signed OFFSET signed */ + 267, /* (238) limit_opt ::= LIMIT signed COMMA signed */ + 266, /* (239) slimit_opt ::= */ + 266, /* (240) slimit_opt ::= SLIMIT signed */ + 266, /* (241) slimit_opt ::= SLIMIT signed SOFFSET signed */ + 266, /* (242) slimit_opt ::= SLIMIT signed COMMA signed */ + 256, /* (243) where_opt ::= */ + 256, /* (244) where_opt ::= WHERE expr */ + 271, /* (245) expr ::= LP expr RP */ + 271, /* (246) expr ::= ID */ + 271, /* (247) expr ::= ID DOT ID */ + 271, /* (248) expr ::= ID DOT STAR */ + 271, /* (249) expr ::= INTEGER */ + 271, /* (250) expr ::= MINUS INTEGER */ + 271, /* (251) expr ::= PLUS INTEGER */ + 271, /* (252) expr ::= FLOAT */ + 271, /* (253) expr ::= MINUS FLOAT */ + 271, /* (254) expr ::= PLUS FLOAT */ + 271, /* (255) expr ::= STRING */ + 271, /* (256) expr ::= NOW */ + 271, /* (257) expr ::= VARIABLE */ + 271, /* (258) expr ::= PLUS VARIABLE */ + 271, /* (259) expr ::= MINUS VARIABLE */ + 271, /* (260) expr ::= BOOL */ + 271, /* (261) expr ::= NULL */ + 271, /* (262) expr ::= ID LP exprlist RP */ + 271, /* (263) expr ::= ID LP STAR RP */ + 271, /* (264) expr ::= ID LP expr AS typename RP */ + 271, /* (265) expr ::= expr IS NULL */ + 271, /* (266) expr ::= expr IS NOT NULL */ + 271, /* (267) expr ::= expr LT expr */ + 271, /* (268) expr ::= expr GT expr */ + 271, /* (269) expr ::= expr LE expr */ + 271, /* (270) expr ::= expr GE expr */ + 271, /* (271) expr ::= expr NE expr */ + 271, /* (272) expr ::= expr EQ expr */ + 271, /* (273) expr ::= expr BETWEEN expr AND expr */ + 271, /* (274) expr ::= expr AND expr */ + 271, /* (275) expr ::= expr OR expr */ + 271, /* (276) expr ::= expr PLUS expr */ + 271, /* (277) expr ::= expr MINUS expr */ + 271, /* (278) expr ::= expr STAR expr */ + 271, /* (279) expr ::= expr SLASH expr */ + 271, /* (280) expr ::= expr REM expr */ + 271, /* (281) expr ::= expr LIKE expr */ + 271, /* (282) expr ::= expr MATCH expr */ + 271, /* (283) expr ::= expr NMATCH expr */ + 271, /* (284) expr ::= ID CONTAINS STRING */ + 271, /* (285) expr ::= ID DOT ID CONTAINS STRING */ + 281, /* (286) arrow ::= ID ARROW STRING */ + 281, /* (287) arrow ::= ID DOT ID ARROW STRING */ + 271, /* (288) expr ::= arrow */ + 271, /* (289) expr ::= expr IN LP exprlist RP */ + 210, /* (290) exprlist ::= exprlist COMMA expritem */ + 210, /* (291) exprlist ::= expritem */ + 283, /* (292) expritem ::= expr */ + 283, /* (293) expritem ::= */ + 202, /* (294) cmd ::= RESET QUERY CACHE */ + 202, /* (295) cmd ::= SYNCDB ids REPLICA */ + 202, /* (296) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ + 202, /* (297) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ + 202, /* (298) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */ + 202, /* (299) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ + 202, /* (300) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ + 202, /* (301) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ + 202, /* (302) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ + 202, /* (303) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */ + 202, /* (304) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ + 202, /* (305) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ + 202, /* (306) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */ + 202, /* (307) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ + 202, /* (308) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ + 202, /* (309) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ + 202, /* (310) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */ + 202, /* (311) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */ + 202, /* (312) cmd ::= KILL CONNECTION INTEGER */ + 202, /* (313) cmd ::= KILL STREAM INTEGER COLON INTEGER */ + 202, /* (314) cmd ::= KILL QUERY INTEGER COLON INTEGER */ }; /* For rule J, yyRuleInfoNRhs[J] contains the negative of the number @@ -2580,157 +2586,159 @@ static const signed char yyRuleInfoNRhs[] = { -1, /* (159) tagitem ::= BOOL */ -1, /* (160) tagitem ::= NULL */ -1, /* (161) tagitem ::= NOW */ - -2, /* (162) tagitem ::= MINUS INTEGER */ - -2, /* (163) tagitem ::= MINUS FLOAT */ - -2, /* (164) tagitem ::= PLUS INTEGER */ - -2, /* (165) tagitem ::= PLUS FLOAT */ - -15, /* (166) select ::= SELECT selcollist from where_opt range_option interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */ - -3, /* (167) select ::= LP select RP */ - -1, /* (168) union ::= select */ - -4, /* (169) union ::= union UNION ALL select */ - -1, /* (170) cmd ::= union */ - -2, /* (171) select ::= SELECT selcollist */ - -2, /* (172) sclp ::= selcollist COMMA */ - 0, /* (173) sclp ::= */ - -4, /* (174) selcollist ::= sclp distinct expr as */ - -2, /* (175) selcollist ::= sclp STAR */ - -2, /* (176) as ::= AS ids */ - -1, /* (177) as ::= ids */ - 0, /* (178) as ::= */ - -1, /* (179) distinct ::= DISTINCT */ - 0, /* (180) distinct ::= */ - -2, /* (181) from ::= FROM tablelist */ - -2, /* (182) from ::= FROM sub */ - -3, /* (183) sub ::= LP union RP */ - -4, /* (184) sub ::= LP union RP ids */ - -6, /* (185) sub ::= sub COMMA LP union RP ids */ - -2, /* (186) tablelist ::= ids cpxName */ - -3, /* (187) tablelist ::= ids cpxName ids */ - -4, /* (188) tablelist ::= tablelist COMMA ids cpxName */ - -5, /* (189) tablelist ::= tablelist COMMA ids cpxName ids */ - -1, /* (190) tmvar ::= VARIABLE */ - -1, /* (191) timestamp ::= INTEGER */ - -2, /* (192) timestamp ::= MINUS INTEGER */ - -2, /* (193) timestamp ::= PLUS INTEGER */ - -1, /* (194) timestamp ::= STRING */ - -1, /* (195) timestamp ::= NOW */ - -3, /* (196) timestamp ::= NOW PLUS VARIABLE */ - -3, /* (197) timestamp ::= NOW MINUS VARIABLE */ - 0, /* (198) range_option ::= */ - -6, /* (199) range_option ::= RANGE LP timestamp COMMA timestamp RP */ - -4, /* (200) interval_option ::= intervalKey LP tmvar RP */ - -6, /* (201) interval_option ::= intervalKey LP tmvar COMMA tmvar RP */ - 0, /* (202) interval_option ::= */ - -1, /* (203) intervalKey ::= INTERVAL */ - -1, /* (204) intervalKey ::= EVERY */ - 0, /* (205) session_option ::= */ - -7, /* (206) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ - 0, /* (207) windowstate_option ::= */ - -4, /* (208) windowstate_option ::= STATE_WINDOW LP ids RP */ - 0, /* (209) fill_opt ::= */ - -6, /* (210) fill_opt ::= FILL LP ID COMMA tagitemlist RP */ - -4, /* (211) fill_opt ::= FILL LP ID RP */ - -4, /* (212) sliding_opt ::= SLIDING LP tmvar RP */ - 0, /* (213) sliding_opt ::= */ - 0, /* (214) orderby_opt ::= */ - -3, /* (215) orderby_opt ::= ORDER BY sortlist */ - -4, /* (216) sortlist ::= sortlist COMMA item sortorder */ - -4, /* (217) sortlist ::= sortlist COMMA arrow sortorder */ - -2, /* (218) sortlist ::= item sortorder */ - -2, /* (219) sortlist ::= arrow sortorder */ - -1, /* (220) item ::= ID */ - -3, /* (221) item ::= ID DOT ID */ - -1, /* (222) sortorder ::= ASC */ - -1, /* (223) sortorder ::= DESC */ - 0, /* (224) sortorder ::= */ - 0, /* (225) groupby_opt ::= */ - -3, /* (226) groupby_opt ::= GROUP BY grouplist */ - -3, /* (227) grouplist ::= grouplist COMMA item */ - -3, /* (228) grouplist ::= grouplist COMMA arrow */ - -1, /* (229) grouplist ::= item */ - -1, /* (230) grouplist ::= arrow */ - 0, /* (231) having_opt ::= */ - -2, /* (232) having_opt ::= HAVING expr */ - 0, /* (233) limit_opt ::= */ - -2, /* (234) limit_opt ::= LIMIT signed */ - -4, /* (235) limit_opt ::= LIMIT signed OFFSET signed */ - -4, /* (236) limit_opt ::= LIMIT signed COMMA signed */ - 0, /* (237) slimit_opt ::= */ - -2, /* (238) slimit_opt ::= SLIMIT signed */ - -4, /* (239) slimit_opt ::= SLIMIT signed SOFFSET signed */ - -4, /* (240) slimit_opt ::= SLIMIT signed COMMA signed */ - 0, /* (241) where_opt ::= */ - -2, /* (242) where_opt ::= WHERE expr */ - -3, /* (243) expr ::= LP expr RP */ - -1, /* (244) expr ::= ID */ - -3, /* (245) expr ::= ID DOT ID */ - -3, /* (246) expr ::= ID DOT STAR */ - -1, /* (247) expr ::= INTEGER */ - -2, /* (248) expr ::= MINUS INTEGER */ - -2, /* (249) expr ::= PLUS INTEGER */ - -1, /* (250) expr ::= FLOAT */ - -2, /* (251) expr ::= MINUS FLOAT */ - -2, /* (252) expr ::= PLUS FLOAT */ - -1, /* (253) expr ::= STRING */ - -1, /* (254) expr ::= NOW */ - -1, /* (255) expr ::= VARIABLE */ - -2, /* (256) expr ::= PLUS VARIABLE */ - -2, /* (257) expr ::= MINUS VARIABLE */ - -1, /* (258) expr ::= BOOL */ - -1, /* (259) expr ::= NULL */ - -4, /* (260) expr ::= ID LP exprlist RP */ - -4, /* (261) expr ::= ID LP STAR RP */ - -6, /* (262) expr ::= ID LP expr AS typename RP */ - -3, /* (263) expr ::= expr IS NULL */ - -4, /* (264) expr ::= expr IS NOT NULL */ - -3, /* (265) expr ::= expr LT expr */ - -3, /* (266) expr ::= expr GT expr */ - -3, /* (267) expr ::= expr LE expr */ - -3, /* (268) expr ::= expr GE expr */ - -3, /* (269) expr ::= expr NE expr */ - -3, /* (270) expr ::= expr EQ expr */ - -5, /* (271) expr ::= expr BETWEEN expr AND expr */ - -3, /* (272) expr ::= expr AND expr */ - -3, /* (273) expr ::= expr OR expr */ - -3, /* (274) expr ::= expr PLUS expr */ - -3, /* (275) expr ::= expr MINUS expr */ - -3, /* (276) expr ::= expr STAR expr */ - -3, /* (277) expr ::= expr SLASH expr */ - -3, /* (278) expr ::= expr REM expr */ - -3, /* (279) expr ::= expr LIKE expr */ - -3, /* (280) expr ::= expr MATCH expr */ - -3, /* (281) expr ::= expr NMATCH expr */ - -3, /* (282) expr ::= ID CONTAINS STRING */ - -5, /* (283) expr ::= ID DOT ID CONTAINS STRING */ - -3, /* (284) arrow ::= ID ARROW STRING */ - -5, /* (285) arrow ::= ID DOT ID ARROW STRING */ - -1, /* (286) expr ::= arrow */ - -5, /* (287) expr ::= expr IN LP exprlist RP */ - -3, /* (288) exprlist ::= exprlist COMMA expritem */ - -1, /* (289) exprlist ::= expritem */ - -1, /* (290) expritem ::= expr */ - 0, /* (291) expritem ::= */ - -3, /* (292) cmd ::= RESET QUERY CACHE */ - -3, /* (293) cmd ::= SYNCDB ids REPLICA */ - -7, /* (294) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ - -7, /* (295) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ - -7, /* (296) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */ - -7, /* (297) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ - -7, /* (298) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ - -8, /* (299) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ - -9, /* (300) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ - -7, /* (301) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */ - -7, /* (302) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ - -7, /* (303) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ - -7, /* (304) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */ - -7, /* (305) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ - -7, /* (306) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ - -8, /* (307) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ - -9, /* (308) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */ - -7, /* (309) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */ - -3, /* (310) cmd ::= KILL CONNECTION INTEGER */ - -5, /* (311) cmd ::= KILL STREAM INTEGER COLON INTEGER */ - -5, /* (312) cmd ::= KILL QUERY INTEGER COLON INTEGER */ + -3, /* (162) tagitem ::= NOW PLUS VARIABLE */ + -3, /* (163) tagitem ::= NOW MINUS VARIABLE */ + -2, /* (164) tagitem ::= MINUS INTEGER */ + -2, /* (165) tagitem ::= MINUS FLOAT */ + -2, /* (166) tagitem ::= PLUS INTEGER */ + -2, /* (167) tagitem ::= PLUS FLOAT */ + -15, /* (168) select ::= SELECT selcollist from where_opt range_option interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */ + -3, /* (169) select ::= LP select RP */ + -1, /* (170) union ::= select */ + -4, /* (171) union ::= union UNION ALL select */ + -1, /* (172) cmd ::= union */ + -2, /* (173) select ::= SELECT selcollist */ + -2, /* (174) sclp ::= selcollist COMMA */ + 0, /* (175) sclp ::= */ + -4, /* (176) selcollist ::= sclp distinct expr as */ + -2, /* (177) selcollist ::= sclp STAR */ + -2, /* (178) as ::= AS ids */ + -1, /* (179) as ::= ids */ + 0, /* (180) as ::= */ + -1, /* (181) distinct ::= DISTINCT */ + 0, /* (182) distinct ::= */ + -2, /* (183) from ::= FROM tablelist */ + -2, /* (184) from ::= FROM sub */ + -3, /* (185) sub ::= LP union RP */ + -4, /* (186) sub ::= LP union RP ids */ + -6, /* (187) sub ::= sub COMMA LP union RP ids */ + -2, /* (188) tablelist ::= ids cpxName */ + -3, /* (189) tablelist ::= ids cpxName ids */ + -4, /* (190) tablelist ::= tablelist COMMA ids cpxName */ + -5, /* (191) tablelist ::= tablelist COMMA ids cpxName ids */ + -1, /* (192) tmvar ::= VARIABLE */ + -1, /* (193) timestamp ::= INTEGER */ + -2, /* (194) timestamp ::= MINUS INTEGER */ + -2, /* (195) timestamp ::= PLUS INTEGER */ + -1, /* (196) timestamp ::= STRING */ + -1, /* (197) timestamp ::= NOW */ + -3, /* (198) timestamp ::= NOW PLUS VARIABLE */ + -3, /* (199) timestamp ::= NOW MINUS VARIABLE */ + 0, /* (200) range_option ::= */ + -6, /* (201) range_option ::= RANGE LP timestamp COMMA timestamp RP */ + -4, /* (202) interval_option ::= intervalKey LP tmvar RP */ + -6, /* (203) interval_option ::= intervalKey LP tmvar COMMA tmvar RP */ + 0, /* (204) interval_option ::= */ + -1, /* (205) intervalKey ::= INTERVAL */ + -1, /* (206) intervalKey ::= EVERY */ + 0, /* (207) session_option ::= */ + -7, /* (208) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ + 0, /* (209) windowstate_option ::= */ + -4, /* (210) windowstate_option ::= STATE_WINDOW LP ids RP */ + 0, /* (211) fill_opt ::= */ + -6, /* (212) fill_opt ::= FILL LP ID COMMA tagitemlist RP */ + -4, /* (213) fill_opt ::= FILL LP ID RP */ + -4, /* (214) sliding_opt ::= SLIDING LP tmvar RP */ + 0, /* (215) sliding_opt ::= */ + 0, /* (216) orderby_opt ::= */ + -3, /* (217) orderby_opt ::= ORDER BY sortlist */ + -4, /* (218) sortlist ::= sortlist COMMA item sortorder */ + -4, /* (219) sortlist ::= sortlist COMMA arrow sortorder */ + -2, /* (220) sortlist ::= item sortorder */ + -2, /* (221) sortlist ::= arrow sortorder */ + -1, /* (222) item ::= ID */ + -3, /* (223) item ::= ID DOT ID */ + -1, /* (224) sortorder ::= ASC */ + -1, /* (225) sortorder ::= DESC */ + 0, /* (226) sortorder ::= */ + 0, /* (227) groupby_opt ::= */ + -3, /* (228) groupby_opt ::= GROUP BY grouplist */ + -3, /* (229) grouplist ::= grouplist COMMA item */ + -3, /* (230) grouplist ::= grouplist COMMA arrow */ + -1, /* (231) grouplist ::= item */ + -1, /* (232) grouplist ::= arrow */ + 0, /* (233) having_opt ::= */ + -2, /* (234) having_opt ::= HAVING expr */ + 0, /* (235) limit_opt ::= */ + -2, /* (236) limit_opt ::= LIMIT signed */ + -4, /* (237) limit_opt ::= LIMIT signed OFFSET signed */ + -4, /* (238) limit_opt ::= LIMIT signed COMMA signed */ + 0, /* (239) slimit_opt ::= */ + -2, /* (240) slimit_opt ::= SLIMIT signed */ + -4, /* (241) slimit_opt ::= SLIMIT signed SOFFSET signed */ + -4, /* (242) slimit_opt ::= SLIMIT signed COMMA signed */ + 0, /* (243) where_opt ::= */ + -2, /* (244) where_opt ::= WHERE expr */ + -3, /* (245) expr ::= LP expr RP */ + -1, /* (246) expr ::= ID */ + -3, /* (247) expr ::= ID DOT ID */ + -3, /* (248) expr ::= ID DOT STAR */ + -1, /* (249) expr ::= INTEGER */ + -2, /* (250) expr ::= MINUS INTEGER */ + -2, /* (251) expr ::= PLUS INTEGER */ + -1, /* (252) expr ::= FLOAT */ + -2, /* (253) expr ::= MINUS FLOAT */ + -2, /* (254) expr ::= PLUS FLOAT */ + -1, /* (255) expr ::= STRING */ + -1, /* (256) expr ::= NOW */ + -1, /* (257) expr ::= VARIABLE */ + -2, /* (258) expr ::= PLUS VARIABLE */ + -2, /* (259) expr ::= MINUS VARIABLE */ + -1, /* (260) expr ::= BOOL */ + -1, /* (261) expr ::= NULL */ + -4, /* (262) expr ::= ID LP exprlist RP */ + -4, /* (263) expr ::= ID LP STAR RP */ + -6, /* (264) expr ::= ID LP expr AS typename RP */ + -3, /* (265) expr ::= expr IS NULL */ + -4, /* (266) expr ::= expr IS NOT NULL */ + -3, /* (267) expr ::= expr LT expr */ + -3, /* (268) expr ::= expr GT expr */ + -3, /* (269) expr ::= expr LE expr */ + -3, /* (270) expr ::= expr GE expr */ + -3, /* (271) expr ::= expr NE expr */ + -3, /* (272) expr ::= expr EQ expr */ + -5, /* (273) expr ::= expr BETWEEN expr AND expr */ + -3, /* (274) expr ::= expr AND expr */ + -3, /* (275) expr ::= expr OR expr */ + -3, /* (276) expr ::= expr PLUS expr */ + -3, /* (277) expr ::= expr MINUS expr */ + -3, /* (278) expr ::= expr STAR expr */ + -3, /* (279) expr ::= expr SLASH expr */ + -3, /* (280) expr ::= expr REM expr */ + -3, /* (281) expr ::= expr LIKE expr */ + -3, /* (282) expr ::= expr MATCH expr */ + -3, /* (283) expr ::= expr NMATCH expr */ + -3, /* (284) expr ::= ID CONTAINS STRING */ + -5, /* (285) expr ::= ID DOT ID CONTAINS STRING */ + -3, /* (286) arrow ::= ID ARROW STRING */ + -5, /* (287) arrow ::= ID DOT ID ARROW STRING */ + -1, /* (288) expr ::= arrow */ + -5, /* (289) expr ::= expr IN LP exprlist RP */ + -3, /* (290) exprlist ::= exprlist COMMA expritem */ + -1, /* (291) exprlist ::= expritem */ + -1, /* (292) expritem ::= expr */ + 0, /* (293) expritem ::= */ + -3, /* (294) cmd ::= RESET QUERY CACHE */ + -3, /* (295) cmd ::= SYNCDB ids REPLICA */ + -7, /* (296) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ + -7, /* (297) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ + -7, /* (298) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */ + -7, /* (299) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ + -7, /* (300) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ + -8, /* (301) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ + -9, /* (302) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ + -7, /* (303) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */ + -7, /* (304) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ + -7, /* (305) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ + -7, /* (306) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */ + -7, /* (307) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ + -7, /* (308) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ + -8, /* (309) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ + -9, /* (310) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */ + -7, /* (311) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */ + -3, /* (312) cmd ::= KILL CONNECTION INTEGER */ + -5, /* (313) cmd ::= KILL STREAM INTEGER COLON INTEGER */ + -5, /* (314) cmd ::= KILL QUERY INTEGER COLON INTEGER */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -2966,7 +2974,7 @@ static YYACTIONTYPE yy_reduce( break; case 54: /* ifexists ::= */ case 56: /* ifnotexists ::= */ yytestcase(yyruleno==56); - case 180: /* distinct ::= */ yytestcase(yyruleno==180); + case 182: /* distinct ::= */ yytestcase(yyruleno==182); { yymsp[1].minor.yy0.n = 0;} break; case 55: /* ifnotexists ::= IF NOT EXISTS */ @@ -3044,7 +3052,7 @@ static YYACTIONTYPE yy_reduce( case 157: /* tagitem ::= FLOAT */ yytestcase(yyruleno==157); case 158: /* tagitem ::= STRING */ yytestcase(yyruleno==158); case 159: /* tagitem ::= BOOL */ yytestcase(yyruleno==159); -{ toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yylhsminor.yy162, &yymsp[0].minor.yy0, true); } +{ toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yylhsminor.yy162, &yymsp[0].minor.yy0); } yymsp[0].minor.yy162 = yylhsminor.yy162; break; case 88: /* keep ::= KEEP intitemlist */ @@ -3277,523 +3285,535 @@ static YYACTIONTYPE yy_reduce( yymsp[-1].minor.yy279 = yylhsminor.yy279; break; case 160: /* tagitem ::= NULL */ -{ yymsp[0].minor.yy0.type = 0; tVariantCreate(&yylhsminor.yy162, &yymsp[0].minor.yy0, true); } +{ yymsp[0].minor.yy0.type = 0; tVariantCreate(&yylhsminor.yy162, &yymsp[0].minor.yy0); } yymsp[0].minor.yy162 = yylhsminor.yy162; break; case 161: /* tagitem ::= NOW */ -{ yymsp[0].minor.yy0.type = TSDB_DATA_TYPE_TIMESTAMP; tVariantCreate(&yylhsminor.yy162, &yymsp[0].minor.yy0, true);} +{ yymsp[0].minor.yy0.type = TSDB_DATA_TYPE_TIMESTAMP; tVariantCreateExt(&yylhsminor.yy162, &yymsp[0].minor.yy0, TK_NOW, true);} yymsp[0].minor.yy162 = yylhsminor.yy162; break; - case 162: /* tagitem ::= MINUS INTEGER */ - case 163: /* tagitem ::= MINUS FLOAT */ yytestcase(yyruleno==163); - case 164: /* tagitem ::= PLUS INTEGER */ yytestcase(yyruleno==164); - case 165: /* tagitem ::= PLUS FLOAT */ yytestcase(yyruleno==165); + case 162: /* tagitem ::= NOW PLUS VARIABLE */ +{ + yymsp[0].minor.yy0.type = TSDB_DATA_TYPE_TIMESTAMP; + tVariantCreateExt(&yymsp[-2].minor.yy162, &yymsp[0].minor.yy0, TK_PLUS, true); +} + break; + case 163: /* tagitem ::= NOW MINUS VARIABLE */ +{ + yymsp[0].minor.yy0.type = TSDB_DATA_TYPE_TIMESTAMP; + tVariantCreateExt(&yymsp[-2].minor.yy162, &yymsp[0].minor.yy0, TK_MINUS, true); +} + break; + case 164: /* tagitem ::= MINUS INTEGER */ + case 165: /* tagitem ::= MINUS FLOAT */ yytestcase(yyruleno==165); + case 166: /* tagitem ::= PLUS INTEGER */ yytestcase(yyruleno==166); + case 167: /* tagitem ::= PLUS FLOAT */ yytestcase(yyruleno==167); { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = yymsp[0].minor.yy0.type; toTSDBType(yymsp[-1].minor.yy0.type); - tVariantCreate(&yylhsminor.yy162, &yymsp[-1].minor.yy0, true); + tVariantCreate(&yylhsminor.yy162, &yymsp[-1].minor.yy0); } yymsp[-1].minor.yy162 = yylhsminor.yy162; break; - case 166: /* select ::= SELECT selcollist from where_opt range_option interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */ + case 168: /* select ::= SELECT selcollist from where_opt range_option interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */ { yylhsminor.yy16 = tSetQuerySqlNode(&yymsp[-14].minor.yy0, yymsp[-13].minor.yy189, yymsp[-12].minor.yy36, yymsp[-11].minor.yy18, yymsp[-4].minor.yy189, yymsp[-2].minor.yy189, &yymsp[-9].minor.yy32, &yymsp[-7].minor.yy155, &yymsp[-6].minor.yy336, &yymsp[-8].minor.yy0, yymsp[-5].minor.yy189, &yymsp[0].minor.yy38, &yymsp[-1].minor.yy38, yymsp[-3].minor.yy18, &yymsp[-10].minor.yy124); } yymsp[-14].minor.yy16 = yylhsminor.yy16; break; - case 167: /* select ::= LP select RP */ + case 169: /* select ::= LP select RP */ {yymsp[-2].minor.yy16 = yymsp[-1].minor.yy16;} break; - case 168: /* union ::= select */ + case 170: /* union ::= select */ { yylhsminor.yy189 = setSubclause(NULL, yymsp[0].minor.yy16); } yymsp[0].minor.yy189 = yylhsminor.yy189; break; - case 169: /* union ::= union UNION ALL select */ + case 171: /* union ::= union UNION ALL select */ { yylhsminor.yy189 = appendSelectClause(yymsp[-3].minor.yy189, yymsp[0].minor.yy16); } yymsp[-3].minor.yy189 = yylhsminor.yy189; break; - case 170: /* cmd ::= union */ + case 172: /* cmd ::= union */ { setSqlInfo(pInfo, yymsp[0].minor.yy189, NULL, TSDB_SQL_SELECT); } break; - case 171: /* select ::= SELECT selcollist */ + case 173: /* select ::= SELECT selcollist */ { yylhsminor.yy16 = tSetQuerySqlNode(&yymsp[-1].minor.yy0, yymsp[0].minor.yy189, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); } yymsp[-1].minor.yy16 = yylhsminor.yy16; break; - case 172: /* sclp ::= selcollist COMMA */ + case 174: /* sclp ::= selcollist COMMA */ {yylhsminor.yy189 = yymsp[-1].minor.yy189;} yymsp[-1].minor.yy189 = yylhsminor.yy189; break; - case 173: /* sclp ::= */ - case 214: /* orderby_opt ::= */ yytestcase(yyruleno==214); + case 175: /* sclp ::= */ + case 216: /* orderby_opt ::= */ yytestcase(yyruleno==216); {yymsp[1].minor.yy189 = 0;} break; - case 174: /* selcollist ::= sclp distinct expr as */ + case 176: /* selcollist ::= sclp distinct expr as */ { yylhsminor.yy189 = tSqlExprListAppend(yymsp[-3].minor.yy189, yymsp[-1].minor.yy18, yymsp[-2].minor.yy0.n? &yymsp[-2].minor.yy0:0, yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0); } yymsp[-3].minor.yy189 = yylhsminor.yy189; break; - case 175: /* selcollist ::= sclp STAR */ + case 177: /* selcollist ::= sclp STAR */ { tSqlExpr *pNode = tSqlExprCreateIdValue(pInfo, NULL, TK_ALL); yylhsminor.yy189 = tSqlExprListAppend(yymsp[-1].minor.yy189, pNode, 0, 0); } yymsp[-1].minor.yy189 = yylhsminor.yy189; break; - case 176: /* as ::= AS ids */ + case 178: /* as ::= AS ids */ { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } break; - case 177: /* as ::= ids */ + case 179: /* as ::= ids */ { yylhsminor.yy0 = yymsp[0].minor.yy0; } yymsp[0].minor.yy0 = yylhsminor.yy0; break; - case 178: /* as ::= */ + case 180: /* as ::= */ { yymsp[1].minor.yy0.n = 0; } break; - case 179: /* distinct ::= DISTINCT */ + case 181: /* distinct ::= DISTINCT */ { yylhsminor.yy0 = yymsp[0].minor.yy0; } yymsp[0].minor.yy0 = yylhsminor.yy0; break; - case 181: /* from ::= FROM tablelist */ - case 182: /* from ::= FROM sub */ yytestcase(yyruleno==182); + case 183: /* from ::= FROM tablelist */ + case 184: /* from ::= FROM sub */ yytestcase(yyruleno==184); {yymsp[-1].minor.yy36 = yymsp[0].minor.yy36;} break; - case 183: /* sub ::= LP union RP */ + case 185: /* sub ::= LP union RP */ {yymsp[-2].minor.yy36 = addSubqueryElem(NULL, yymsp[-1].minor.yy189, NULL);} break; - case 184: /* sub ::= LP union RP ids */ + case 186: /* sub ::= LP union RP ids */ {yymsp[-3].minor.yy36 = addSubqueryElem(NULL, yymsp[-2].minor.yy189, &yymsp[0].minor.yy0);} break; - case 185: /* sub ::= sub COMMA LP union RP ids */ + case 187: /* sub ::= sub COMMA LP union RP ids */ {yylhsminor.yy36 = addSubqueryElem(yymsp[-5].minor.yy36, yymsp[-2].minor.yy189, &yymsp[0].minor.yy0);} yymsp[-5].minor.yy36 = yylhsminor.yy36; break; - case 186: /* tablelist ::= ids cpxName */ + case 188: /* tablelist ::= ids cpxName */ { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yylhsminor.yy36 = setTableNameList(NULL, &yymsp[-1].minor.yy0, NULL); } yymsp[-1].minor.yy36 = yylhsminor.yy36; break; - case 187: /* tablelist ::= ids cpxName ids */ + case 189: /* tablelist ::= ids cpxName ids */ { yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n; yylhsminor.yy36 = setTableNameList(NULL, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy36 = yylhsminor.yy36; break; - case 188: /* tablelist ::= tablelist COMMA ids cpxName */ + case 190: /* tablelist ::= tablelist COMMA ids cpxName */ { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yylhsminor.yy36 = setTableNameList(yymsp[-3].minor.yy36, &yymsp[-1].minor.yy0, NULL); } yymsp[-3].minor.yy36 = yylhsminor.yy36; break; - case 189: /* tablelist ::= tablelist COMMA ids cpxName ids */ + case 191: /* tablelist ::= tablelist COMMA ids cpxName ids */ { yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n; yylhsminor.yy36 = setTableNameList(yymsp[-4].minor.yy36, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } yymsp[-4].minor.yy36 = yylhsminor.yy36; break; - case 190: /* tmvar ::= VARIABLE */ + case 192: /* tmvar ::= VARIABLE */ {yylhsminor.yy0 = yymsp[0].minor.yy0;} yymsp[0].minor.yy0 = yylhsminor.yy0; break; - case 191: /* timestamp ::= INTEGER */ + case 193: /* timestamp ::= INTEGER */ { yylhsminor.yy18 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_INTEGER);} yymsp[0].minor.yy18 = yylhsminor.yy18; break; - case 192: /* timestamp ::= MINUS INTEGER */ - case 193: /* timestamp ::= PLUS INTEGER */ yytestcase(yyruleno==193); + case 194: /* timestamp ::= MINUS INTEGER */ + case 195: /* timestamp ::= PLUS INTEGER */ yytestcase(yyruleno==195); { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy18 = tSqlExprCreateTimestamp(&yymsp[-1].minor.yy0, TK_INTEGER);} yymsp[-1].minor.yy18 = yylhsminor.yy18; break; - case 194: /* timestamp ::= STRING */ + case 196: /* timestamp ::= STRING */ { yylhsminor.yy18 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_STRING);} yymsp[0].minor.yy18 = yylhsminor.yy18; break; - case 195: /* timestamp ::= NOW */ + case 197: /* timestamp ::= NOW */ { yylhsminor.yy18 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_NOW); } yymsp[0].minor.yy18 = yylhsminor.yy18; break; - case 196: /* timestamp ::= NOW PLUS VARIABLE */ + case 198: /* timestamp ::= NOW PLUS VARIABLE */ {yymsp[-2].minor.yy18 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_PLUS); } break; - case 197: /* timestamp ::= NOW MINUS VARIABLE */ + case 199: /* timestamp ::= NOW MINUS VARIABLE */ {yymsp[-2].minor.yy18 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_MINUS); } break; - case 198: /* range_option ::= */ + case 200: /* range_option ::= */ {yymsp[1].minor.yy124.start = 0; yymsp[1].minor.yy124.end = 0;} break; - case 199: /* range_option ::= RANGE LP timestamp COMMA timestamp RP */ + case 201: /* range_option ::= RANGE LP timestamp COMMA timestamp RP */ {yymsp[-5].minor.yy124.start = yymsp[-3].minor.yy18; yymsp[-5].minor.yy124.end = yymsp[-1].minor.yy18;} break; - case 200: /* interval_option ::= intervalKey LP tmvar RP */ + case 202: /* interval_option ::= intervalKey LP tmvar RP */ {yylhsminor.yy32.interval = yymsp[-1].minor.yy0; yylhsminor.yy32.offset.n = 0; yylhsminor.yy32.token = yymsp[-3].minor.yy516;} yymsp[-3].minor.yy32 = yylhsminor.yy32; break; - case 201: /* interval_option ::= intervalKey LP tmvar COMMA tmvar RP */ + case 203: /* interval_option ::= intervalKey LP tmvar COMMA tmvar RP */ {yylhsminor.yy32.interval = yymsp[-3].minor.yy0; yylhsminor.yy32.offset = yymsp[-1].minor.yy0; yylhsminor.yy32.token = yymsp[-5].minor.yy516;} yymsp[-5].minor.yy32 = yylhsminor.yy32; break; - case 202: /* interval_option ::= */ + case 204: /* interval_option ::= */ {memset(&yymsp[1].minor.yy32, 0, sizeof(yymsp[1].minor.yy32));} break; - case 203: /* intervalKey ::= INTERVAL */ + case 205: /* intervalKey ::= INTERVAL */ {yymsp[0].minor.yy516 = TK_INTERVAL;} break; - case 204: /* intervalKey ::= EVERY */ + case 206: /* intervalKey ::= EVERY */ {yymsp[0].minor.yy516 = TK_EVERY; } break; - case 205: /* session_option ::= */ + case 207: /* session_option ::= */ {yymsp[1].minor.yy155.col.n = 0; yymsp[1].minor.yy155.gap.n = 0;} break; - case 206: /* session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ + case 208: /* session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-6].minor.yy155.col = yymsp[-4].minor.yy0; yymsp[-6].minor.yy155.gap = yymsp[-1].minor.yy0; } break; - case 207: /* windowstate_option ::= */ + case 209: /* windowstate_option ::= */ { yymsp[1].minor.yy336.col.n = 0; yymsp[1].minor.yy336.col.z = NULL;} break; - case 208: /* windowstate_option ::= STATE_WINDOW LP ids RP */ + case 210: /* windowstate_option ::= STATE_WINDOW LP ids RP */ { yymsp[-3].minor.yy336.col = yymsp[-1].minor.yy0; } break; - case 209: /* fill_opt ::= */ + case 211: /* fill_opt ::= */ { yymsp[1].minor.yy189 = 0; } break; - case 210: /* fill_opt ::= FILL LP ID COMMA tagitemlist RP */ + case 212: /* fill_opt ::= FILL LP ID COMMA tagitemlist RP */ { tVariant A = {0}; toTSDBType(yymsp[-3].minor.yy0.type); - tVariantCreate(&A, &yymsp[-3].minor.yy0, true); + tVariantCreate(&A, &yymsp[-3].minor.yy0); tVariantListInsert(yymsp[-1].minor.yy189, &A, -1, 0); yymsp[-5].minor.yy189 = yymsp[-1].minor.yy189; } break; - case 211: /* fill_opt ::= FILL LP ID RP */ + case 213: /* fill_opt ::= FILL LP ID RP */ { toTSDBType(yymsp[-1].minor.yy0.type); yymsp[-3].minor.yy189 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1, true); } break; - case 212: /* sliding_opt ::= SLIDING LP tmvar RP */ + case 214: /* sliding_opt ::= SLIDING LP tmvar RP */ {yymsp[-3].minor.yy0 = yymsp[-1].minor.yy0; } break; - case 213: /* sliding_opt ::= */ + case 215: /* sliding_opt ::= */ {yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.z = NULL; yymsp[1].minor.yy0.type = 0; } break; - case 215: /* orderby_opt ::= ORDER BY sortlist */ + case 217: /* orderby_opt ::= ORDER BY sortlist */ {yymsp[-2].minor.yy189 = yymsp[0].minor.yy189;} break; - case 216: /* sortlist ::= sortlist COMMA item sortorder */ + case 218: /* sortlist ::= sortlist COMMA item sortorder */ { yylhsminor.yy189 = commonItemAppend(yymsp[-3].minor.yy189, &yymsp[-1].minor.yy162, NULL, false, yymsp[0].minor.yy420); } yymsp[-3].minor.yy189 = yylhsminor.yy189; break; - case 217: /* sortlist ::= sortlist COMMA arrow sortorder */ + case 219: /* sortlist ::= sortlist COMMA arrow sortorder */ { yylhsminor.yy189 = commonItemAppend(yymsp[-3].minor.yy189, NULL, yymsp[-1].minor.yy18, true, yymsp[0].minor.yy420); } yymsp[-3].minor.yy189 = yylhsminor.yy189; break; - case 218: /* sortlist ::= item sortorder */ + case 220: /* sortlist ::= item sortorder */ { yylhsminor.yy189 = commonItemAppend(NULL, &yymsp[-1].minor.yy162, NULL, false, yymsp[0].minor.yy420); } yymsp[-1].minor.yy189 = yylhsminor.yy189; break; - case 219: /* sortlist ::= arrow sortorder */ + case 221: /* sortlist ::= arrow sortorder */ { yylhsminor.yy189 = commonItemAppend(NULL, NULL, yymsp[-1].minor.yy18, true, yymsp[0].minor.yy420); } yymsp[-1].minor.yy189 = yylhsminor.yy189; break; - case 220: /* item ::= ID */ + case 222: /* item ::= ID */ { toTSDBType(yymsp[0].minor.yy0.type); - tVariantCreate(&yylhsminor.yy162, &yymsp[0].minor.yy0, true); + tVariantCreate(&yylhsminor.yy162, &yymsp[0].minor.yy0); } yymsp[0].minor.yy162 = yylhsminor.yy162; break; - case 221: /* item ::= ID DOT ID */ + case 223: /* item ::= ID DOT ID */ { toTSDBType(yymsp[-2].minor.yy0.type); yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); - tVariantCreate(&yylhsminor.yy162, &yymsp[-2].minor.yy0, true); + tVariantCreate(&yylhsminor.yy162, &yymsp[-2].minor.yy0); } yymsp[-2].minor.yy162 = yylhsminor.yy162; break; - case 222: /* sortorder ::= ASC */ + case 224: /* sortorder ::= ASC */ { yymsp[0].minor.yy420 = TSDB_ORDER_ASC; } break; - case 223: /* sortorder ::= DESC */ + case 225: /* sortorder ::= DESC */ { yymsp[0].minor.yy420 = TSDB_ORDER_DESC;} break; - case 224: /* sortorder ::= */ + case 226: /* sortorder ::= */ { yymsp[1].minor.yy420 = TSDB_ORDER_ASC; } break; - case 225: /* groupby_opt ::= */ + case 227: /* groupby_opt ::= */ { yymsp[1].minor.yy189 = 0;} break; - case 226: /* groupby_opt ::= GROUP BY grouplist */ + case 228: /* groupby_opt ::= GROUP BY grouplist */ { yymsp[-2].minor.yy189 = yymsp[0].minor.yy189;} break; - case 227: /* grouplist ::= grouplist COMMA item */ + case 229: /* grouplist ::= grouplist COMMA item */ { yylhsminor.yy189 = commonItemAppend(yymsp[-2].minor.yy189, &yymsp[0].minor.yy162, NULL, false, -1); } yymsp[-2].minor.yy189 = yylhsminor.yy189; break; - case 228: /* grouplist ::= grouplist COMMA arrow */ + case 230: /* grouplist ::= grouplist COMMA arrow */ { yylhsminor.yy189 = commonItemAppend(yymsp[-2].minor.yy189, NULL, yymsp[0].minor.yy18, true, -1); } yymsp[-2].minor.yy189 = yylhsminor.yy189; break; - case 229: /* grouplist ::= item */ + case 231: /* grouplist ::= item */ { yylhsminor.yy189 = commonItemAppend(NULL, &yymsp[0].minor.yy162, NULL, false, -1); } yymsp[0].minor.yy189 = yylhsminor.yy189; break; - case 230: /* grouplist ::= arrow */ + case 232: /* grouplist ::= arrow */ { yylhsminor.yy189 = commonItemAppend(NULL, NULL, yymsp[0].minor.yy18, true, -1); } yymsp[0].minor.yy189 = yylhsminor.yy189; break; - case 231: /* having_opt ::= */ - case 241: /* where_opt ::= */ yytestcase(yyruleno==241); - case 291: /* expritem ::= */ yytestcase(yyruleno==291); + case 233: /* having_opt ::= */ + case 243: /* where_opt ::= */ yytestcase(yyruleno==243); + case 293: /* expritem ::= */ yytestcase(yyruleno==293); {yymsp[1].minor.yy18 = 0;} break; - case 232: /* having_opt ::= HAVING expr */ - case 242: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==242); + case 234: /* having_opt ::= HAVING expr */ + case 244: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==244); {yymsp[-1].minor.yy18 = yymsp[0].minor.yy18;} break; - case 233: /* limit_opt ::= */ - case 237: /* slimit_opt ::= */ yytestcase(yyruleno==237); + case 235: /* limit_opt ::= */ + case 239: /* slimit_opt ::= */ yytestcase(yyruleno==239); {yymsp[1].minor.yy38.limit = -1; yymsp[1].minor.yy38.offset = 0;} break; - case 234: /* limit_opt ::= LIMIT signed */ - case 238: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==238); + case 236: /* limit_opt ::= LIMIT signed */ + case 240: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==240); {yymsp[-1].minor.yy38.limit = yymsp[0].minor.yy69; yymsp[-1].minor.yy38.offset = 0;} break; - case 235: /* limit_opt ::= LIMIT signed OFFSET signed */ + case 237: /* limit_opt ::= LIMIT signed OFFSET signed */ { yymsp[-3].minor.yy38.limit = yymsp[-2].minor.yy69; yymsp[-3].minor.yy38.offset = yymsp[0].minor.yy69;} break; - case 236: /* limit_opt ::= LIMIT signed COMMA signed */ + case 238: /* limit_opt ::= LIMIT signed COMMA signed */ { yymsp[-3].minor.yy38.limit = yymsp[0].minor.yy69; yymsp[-3].minor.yy38.offset = yymsp[-2].minor.yy69;} break; - case 239: /* slimit_opt ::= SLIMIT signed SOFFSET signed */ + case 241: /* slimit_opt ::= SLIMIT signed SOFFSET signed */ {yymsp[-3].minor.yy38.limit = yymsp[-2].minor.yy69; yymsp[-3].minor.yy38.offset = yymsp[0].minor.yy69;} break; - case 240: /* slimit_opt ::= SLIMIT signed COMMA signed */ + case 242: /* slimit_opt ::= SLIMIT signed COMMA signed */ {yymsp[-3].minor.yy38.limit = yymsp[0].minor.yy69; yymsp[-3].minor.yy38.offset = yymsp[-2].minor.yy69;} break; - case 243: /* expr ::= LP expr RP */ + case 245: /* expr ::= LP expr RP */ {yylhsminor.yy18 = yymsp[-1].minor.yy18; yylhsminor.yy18->exprToken.z = yymsp[-2].minor.yy0.z; yylhsminor.yy18->exprToken.n = (yymsp[0].minor.yy0.z - yymsp[-2].minor.yy0.z + 1);} yymsp[-2].minor.yy18 = yylhsminor.yy18; break; - case 244: /* expr ::= ID */ + case 246: /* expr ::= ID */ { yylhsminor.yy18 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_ID);} yymsp[0].minor.yy18 = yylhsminor.yy18; break; - case 245: /* expr ::= ID DOT ID */ + case 247: /* expr ::= ID DOT ID */ { yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy18 = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ID);} yymsp[-2].minor.yy18 = yylhsminor.yy18; break; - case 246: /* expr ::= ID DOT STAR */ + case 248: /* expr ::= ID DOT STAR */ { yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy18 = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ALL);} yymsp[-2].minor.yy18 = yylhsminor.yy18; break; - case 247: /* expr ::= INTEGER */ + case 249: /* expr ::= INTEGER */ { yylhsminor.yy18 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_INTEGER);} yymsp[0].minor.yy18 = yylhsminor.yy18; break; - case 248: /* expr ::= MINUS INTEGER */ - case 249: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==249); + case 250: /* expr ::= MINUS INTEGER */ + case 251: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==251); { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy18 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_INTEGER);} yymsp[-1].minor.yy18 = yylhsminor.yy18; break; - case 250: /* expr ::= FLOAT */ + case 252: /* expr ::= FLOAT */ { yylhsminor.yy18 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_FLOAT);} yymsp[0].minor.yy18 = yylhsminor.yy18; break; - case 251: /* expr ::= MINUS FLOAT */ - case 252: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==252); + case 253: /* expr ::= MINUS FLOAT */ + case 254: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==254); { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yylhsminor.yy18 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_FLOAT);} yymsp[-1].minor.yy18 = yylhsminor.yy18; break; - case 253: /* expr ::= STRING */ + case 255: /* expr ::= STRING */ { yylhsminor.yy18 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING);} yymsp[0].minor.yy18 = yylhsminor.yy18; break; - case 254: /* expr ::= NOW */ + case 256: /* expr ::= NOW */ { yylhsminor.yy18 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_NOW); } yymsp[0].minor.yy18 = yylhsminor.yy18; break; - case 255: /* expr ::= VARIABLE */ + case 257: /* expr ::= VARIABLE */ { yylhsminor.yy18 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_VARIABLE);} yymsp[0].minor.yy18 = yylhsminor.yy18; break; - case 256: /* expr ::= PLUS VARIABLE */ - case 257: /* expr ::= MINUS VARIABLE */ yytestcase(yyruleno==257); + case 258: /* expr ::= PLUS VARIABLE */ + case 259: /* expr ::= MINUS VARIABLE */ yytestcase(yyruleno==259); { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_VARIABLE; yylhsminor.yy18 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_VARIABLE);} yymsp[-1].minor.yy18 = yylhsminor.yy18; break; - case 258: /* expr ::= BOOL */ + case 260: /* expr ::= BOOL */ { yylhsminor.yy18 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_BOOL);} yymsp[0].minor.yy18 = yylhsminor.yy18; break; - case 259: /* expr ::= NULL */ + case 261: /* expr ::= NULL */ { yylhsminor.yy18 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_NULL);} yymsp[0].minor.yy18 = yylhsminor.yy18; break; - case 260: /* expr ::= ID LP exprlist RP */ + case 262: /* expr ::= ID LP exprlist RP */ { tStrTokenAppend(pInfo->funcs, &yymsp[-3].minor.yy0); yylhsminor.yy18 = tSqlExprCreateFunction(yymsp[-1].minor.yy189, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } yymsp[-3].minor.yy18 = yylhsminor.yy18; break; - case 261: /* expr ::= ID LP STAR RP */ + case 263: /* expr ::= ID LP STAR RP */ { tStrTokenAppend(pInfo->funcs, &yymsp[-3].minor.yy0); yylhsminor.yy18 = tSqlExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } yymsp[-3].minor.yy18 = yylhsminor.yy18; break; - case 262: /* expr ::= ID LP expr AS typename RP */ + case 264: /* expr ::= ID LP expr AS typename RP */ { tStrTokenAppend(pInfo->funcs, &yymsp[-5].minor.yy0); yylhsminor.yy18 = tSqlExprCreateFuncWithParams(pInfo, yymsp[-3].minor.yy18, &yymsp[-1].minor.yy279, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, yymsp[-5].minor.yy0.type); } yymsp[-5].minor.yy18 = yylhsminor.yy18; break; - case 263: /* expr ::= expr IS NULL */ + case 265: /* expr ::= expr IS NULL */ {yylhsminor.yy18 = tSqlExprCreate(yymsp[-2].minor.yy18, NULL, TK_ISNULL);} yymsp[-2].minor.yy18 = yylhsminor.yy18; break; - case 264: /* expr ::= expr IS NOT NULL */ + case 266: /* expr ::= expr IS NOT NULL */ {yylhsminor.yy18 = tSqlExprCreate(yymsp[-3].minor.yy18, NULL, TK_NOTNULL);} yymsp[-3].minor.yy18 = yylhsminor.yy18; break; - case 265: /* expr ::= expr LT expr */ + case 267: /* expr ::= expr LT expr */ {yylhsminor.yy18 = tSqlExprCreate(yymsp[-2].minor.yy18, yymsp[0].minor.yy18, TK_LT);} yymsp[-2].minor.yy18 = yylhsminor.yy18; break; - case 266: /* expr ::= expr GT expr */ + case 268: /* expr ::= expr GT expr */ {yylhsminor.yy18 = tSqlExprCreate(yymsp[-2].minor.yy18, yymsp[0].minor.yy18, TK_GT);} yymsp[-2].minor.yy18 = yylhsminor.yy18; break; - case 267: /* expr ::= expr LE expr */ + case 269: /* expr ::= expr LE expr */ {yylhsminor.yy18 = tSqlExprCreate(yymsp[-2].minor.yy18, yymsp[0].minor.yy18, TK_LE);} yymsp[-2].minor.yy18 = yylhsminor.yy18; break; - case 268: /* expr ::= expr GE expr */ + case 270: /* expr ::= expr GE expr */ {yylhsminor.yy18 = tSqlExprCreate(yymsp[-2].minor.yy18, yymsp[0].minor.yy18, TK_GE);} yymsp[-2].minor.yy18 = yylhsminor.yy18; break; - case 269: /* expr ::= expr NE expr */ + case 271: /* expr ::= expr NE expr */ {yylhsminor.yy18 = tSqlExprCreate(yymsp[-2].minor.yy18, yymsp[0].minor.yy18, TK_NE);} yymsp[-2].minor.yy18 = yylhsminor.yy18; break; - case 270: /* expr ::= expr EQ expr */ + case 272: /* expr ::= expr EQ expr */ {yylhsminor.yy18 = tSqlExprCreate(yymsp[-2].minor.yy18, yymsp[0].minor.yy18, TK_EQ);} yymsp[-2].minor.yy18 = yylhsminor.yy18; break; - case 271: /* expr ::= expr BETWEEN expr AND expr */ + case 273: /* expr ::= expr BETWEEN expr AND expr */ { tSqlExpr* X2 = tSqlExprClone(yymsp[-4].minor.yy18); yylhsminor.yy18 = tSqlExprCreate(tSqlExprCreate(yymsp[-4].minor.yy18, yymsp[-2].minor.yy18, TK_GE), tSqlExprCreate(X2, yymsp[0].minor.yy18, TK_LE), TK_AND);} yymsp[-4].minor.yy18 = yylhsminor.yy18; break; - case 272: /* expr ::= expr AND expr */ + case 274: /* expr ::= expr AND expr */ {yylhsminor.yy18 = tSqlExprCreate(yymsp[-2].minor.yy18, yymsp[0].minor.yy18, TK_AND);} yymsp[-2].minor.yy18 = yylhsminor.yy18; break; - case 273: /* expr ::= expr OR expr */ + case 275: /* expr ::= expr OR expr */ {yylhsminor.yy18 = tSqlExprCreate(yymsp[-2].minor.yy18, yymsp[0].minor.yy18, TK_OR); } yymsp[-2].minor.yy18 = yylhsminor.yy18; break; - case 274: /* expr ::= expr PLUS expr */ + case 276: /* expr ::= expr PLUS expr */ {yylhsminor.yy18 = tSqlExprCreate(yymsp[-2].minor.yy18, yymsp[0].minor.yy18, TK_PLUS); } yymsp[-2].minor.yy18 = yylhsminor.yy18; break; - case 275: /* expr ::= expr MINUS expr */ + case 277: /* expr ::= expr MINUS expr */ {yylhsminor.yy18 = tSqlExprCreate(yymsp[-2].minor.yy18, yymsp[0].minor.yy18, TK_MINUS); } yymsp[-2].minor.yy18 = yylhsminor.yy18; break; - case 276: /* expr ::= expr STAR expr */ + case 278: /* expr ::= expr STAR expr */ {yylhsminor.yy18 = tSqlExprCreate(yymsp[-2].minor.yy18, yymsp[0].minor.yy18, TK_STAR); } yymsp[-2].minor.yy18 = yylhsminor.yy18; break; - case 277: /* expr ::= expr SLASH expr */ + case 279: /* expr ::= expr SLASH expr */ {yylhsminor.yy18 = tSqlExprCreate(yymsp[-2].minor.yy18, yymsp[0].minor.yy18, TK_DIVIDE);} yymsp[-2].minor.yy18 = yylhsminor.yy18; break; - case 278: /* expr ::= expr REM expr */ + case 280: /* expr ::= expr REM expr */ {yylhsminor.yy18 = tSqlExprCreate(yymsp[-2].minor.yy18, yymsp[0].minor.yy18, TK_REM); } yymsp[-2].minor.yy18 = yylhsminor.yy18; break; - case 279: /* expr ::= expr LIKE expr */ + case 281: /* expr ::= expr LIKE expr */ {yylhsminor.yy18 = tSqlExprCreate(yymsp[-2].minor.yy18, yymsp[0].minor.yy18, TK_LIKE); } yymsp[-2].minor.yy18 = yylhsminor.yy18; break; - case 280: /* expr ::= expr MATCH expr */ + case 282: /* expr ::= expr MATCH expr */ {yylhsminor.yy18 = tSqlExprCreate(yymsp[-2].minor.yy18, yymsp[0].minor.yy18, TK_MATCH); } yymsp[-2].minor.yy18 = yylhsminor.yy18; break; - case 281: /* expr ::= expr NMATCH expr */ + case 283: /* expr ::= expr NMATCH expr */ {yylhsminor.yy18 = tSqlExprCreate(yymsp[-2].minor.yy18, yymsp[0].minor.yy18, TK_NMATCH); } yymsp[-2].minor.yy18 = yylhsminor.yy18; break; - case 282: /* expr ::= ID CONTAINS STRING */ + case 284: /* expr ::= ID CONTAINS STRING */ { tSqlExpr* S = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ID); tSqlExpr* M = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING); yylhsminor.yy18 = tSqlExprCreate(S, M, TK_CONTAINS); } yymsp[-2].minor.yy18 = yylhsminor.yy18; break; - case 283: /* expr ::= ID DOT ID CONTAINS STRING */ + case 285: /* expr ::= ID DOT ID CONTAINS STRING */ { yymsp[-4].minor.yy0.n += (1+yymsp[-2].minor.yy0.n); tSqlExpr* S = tSqlExprCreateIdValue(pInfo, &yymsp[-4].minor.yy0, TK_ID); tSqlExpr* M = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING); yylhsminor.yy18 = tSqlExprCreate(S, M, TK_CONTAINS); } yymsp[-4].minor.yy18 = yylhsminor.yy18; break; - case 284: /* arrow ::= ID ARROW STRING */ + case 286: /* arrow ::= ID ARROW STRING */ {tSqlExpr* S = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ID); tSqlExpr* M = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING); yylhsminor.yy18 = tSqlExprCreate(S, M, TK_ARROW); } yymsp[-2].minor.yy18 = yylhsminor.yy18; break; - case 285: /* arrow ::= ID DOT ID ARROW STRING */ + case 287: /* arrow ::= ID DOT ID ARROW STRING */ {yymsp[-4].minor.yy0.n += (1+yymsp[-2].minor.yy0.n); tSqlExpr* S = tSqlExprCreateIdValue(pInfo, &yymsp[-4].minor.yy0, TK_ID); tSqlExpr* M = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING); yylhsminor.yy18 = tSqlExprCreate(S, M, TK_ARROW); } yymsp[-4].minor.yy18 = yylhsminor.yy18; break; - case 286: /* expr ::= arrow */ - case 290: /* expritem ::= expr */ yytestcase(yyruleno==290); + case 288: /* expr ::= arrow */ + case 292: /* expritem ::= expr */ yytestcase(yyruleno==292); {yylhsminor.yy18 = yymsp[0].minor.yy18;} yymsp[0].minor.yy18 = yylhsminor.yy18; break; - case 287: /* expr ::= expr IN LP exprlist RP */ + case 289: /* expr ::= expr IN LP exprlist RP */ {yylhsminor.yy18 = tSqlExprCreate(yymsp[-4].minor.yy18, (tSqlExpr*)yymsp[-1].minor.yy189, TK_IN); } yymsp[-4].minor.yy18 = yylhsminor.yy18; break; - case 288: /* exprlist ::= exprlist COMMA expritem */ + case 290: /* exprlist ::= exprlist COMMA expritem */ {yylhsminor.yy189 = tSqlExprListAppend(yymsp[-2].minor.yy189,yymsp[0].minor.yy18,0, 0);} yymsp[-2].minor.yy189 = yylhsminor.yy189; break; - case 289: /* exprlist ::= expritem */ + case 291: /* exprlist ::= expritem */ {yylhsminor.yy189 = tSqlExprListAppend(0,yymsp[0].minor.yy18,0, 0);} yymsp[0].minor.yy189 = yylhsminor.yy189; break; - case 292: /* cmd ::= RESET QUERY CACHE */ + case 294: /* cmd ::= RESET QUERY CACHE */ { setDCLSqlElems(pInfo, TSDB_SQL_RESET_CACHE, 0);} break; - case 293: /* cmd ::= SYNCDB ids REPLICA */ + case 295: /* cmd ::= SYNCDB ids REPLICA */ { setDCLSqlElems(pInfo, TSDB_SQL_SYNC_DB_REPLICA, 1, &yymsp[-1].minor.yy0);} break; - case 294: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ + case 296: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy189, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 295: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ + case 297: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; @@ -3804,21 +3824,21 @@ static YYACTIONTYPE yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 296: /* cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */ + case 298: /* cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy189, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 297: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ + case 299: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy189, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 298: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ + case 300: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; @@ -3829,7 +3849,7 @@ static YYACTIONTYPE yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 299: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ + case 301: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ { yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; @@ -3843,7 +3863,7 @@ static YYACTIONTYPE yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 300: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ + case 302: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ { yymsp[-6].minor.yy0.n += yymsp[-5].minor.yy0.n; @@ -3855,21 +3875,21 @@ static YYACTIONTYPE yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 301: /* cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */ + case 303: /* cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy189, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 302: /* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ + case 304: /* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy189, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 303: /* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ + case 305: /* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; @@ -3880,21 +3900,21 @@ static YYACTIONTYPE yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 304: /* cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */ + case 306: /* cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy189, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 305: /* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ + case 307: /* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy189, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 306: /* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ + case 308: /* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; @@ -3905,7 +3925,7 @@ static YYACTIONTYPE yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 307: /* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ + case 309: /* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ { yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; @@ -3919,7 +3939,7 @@ static YYACTIONTYPE yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 308: /* cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */ + case 310: /* cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */ { yymsp[-6].minor.yy0.n += yymsp[-5].minor.yy0.n; @@ -3931,20 +3951,20 @@ static YYACTIONTYPE yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 309: /* cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */ + case 311: /* cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy189, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 310: /* cmd ::= KILL CONNECTION INTEGER */ + case 312: /* cmd ::= KILL CONNECTION INTEGER */ {setKillSql(pInfo, TSDB_SQL_KILL_CONNECTION, &yymsp[0].minor.yy0);} break; - case 311: /* cmd ::= KILL STREAM INTEGER COLON INTEGER */ + case 313: /* cmd ::= KILL STREAM INTEGER COLON INTEGER */ {yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_STREAM, &yymsp[-2].minor.yy0);} break; - case 312: /* cmd ::= KILL QUERY INTEGER COLON INTEGER */ + case 314: /* cmd ::= KILL QUERY INTEGER COLON INTEGER */ {yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_QUERY, &yymsp[-2].minor.yy0);} break; default: diff --git a/tests/develop-test/0-management/3-tag/json_tag.py b/tests/develop-test/0-management/3-tag/json_tag.py index 4810ec8b4e2437f5aecbb67a10c8d2ce4e5c55c5..dc7affe870f4462526aa1095311278d280abe77f 100644 --- a/tests/develop-test/0-management/3-tag/json_tag.py +++ b/tests/develop-test/0-management/3-tag/json_tag.py @@ -16,6 +16,7 @@ import taos from util.log import tdLog from util.cases import tdCases from util.sql import tdSql +import json class TDTestCase: @@ -505,6 +506,11 @@ class TDTestCase: tdSql.query("select round(dataint) from jsons1 where jtag->'tag1'>1") tdSql.checkRows(3) + #test TD-12077 + tdSql.execute("insert into jsons1_16 using jsons1 tags('{\"tag1\":\"收到货\",\"tag2\":\"\",\"tag3\":-2.111}') values(1591062628000, 2, NULL, '你就会', 'dws')") + tdSql.query("select jtag->'tag3' from jsons1_16") + tdSql.checkData(0, 0, '-2.111000000') + def stop(self): tdSql.close() tdLog.success("%s successfully executed" % __file__) diff --git a/tests/script/fullGeneralSuite.sim b/tests/script/fullGeneralSuite.sim index 6cec3895eb5e24bda398f8ce7472da83b403fbe7..e2ab5e6ffcd9dd499fda37ac3433023d85d4a446 100644 --- a/tests/script/fullGeneralSuite.sim +++ b/tests/script/fullGeneralSuite.sim @@ -238,3 +238,4 @@ run general/parser/tbname_escape.sim run general/parser/columnName_escape.sim run general/parser/tagName_escape.sim run general/parser/interp_blocks.sim +run general/parser/create_tb_with_timestamp_tag.sim diff --git a/tests/script/general/parser/create_tb_with_timestamp_tag.sim b/tests/script/general/parser/create_tb_with_timestamp_tag.sim new file mode 100644 index 0000000000000000000000000000000000000000..452fd2ddbf7d475a00f2fdd334e5065b6da71dc9 --- /dev/null +++ b/tests/script/general/parser/create_tb_with_timestamp_tag.sim @@ -0,0 +1,115 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/cfg.sh -n dnode1 -c walLevel -v 1 +system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2 +system sh/exec.sh -n dnode1 -s start + +sleep 100 +sql connect +print ======================== dnode1 start + +$db = testdb + +sql create database $db precision 'ns' +sql use $db + +sql create stable st1 (ts timestamp , c1 int) tags(t1 timestamp, t2 int) + +sql create table t1_0 using st1 tags(now, 0) +#nanoseconds +sql create table t1_1 using st1 tags(now + 1b, 0) +#microseconds +sql create table t1_2 using st1 tags(now + 1u, 0) +#milliseconds +sql create table t1_3 using st1 tags(now + 1a, 0) +#seconds +sql create table t1_4 using st1 tags(now + 1s, 0) +#minutes +sql create table t1_5 using st1 tags(now + 1m, 0) +#hours +sql create table t1_6 using st1 tags(now + 1h, 0) +#days +sql create table t1_7 using st1 tags(now + 1d, 0) +#weeks +sql create table t1_8 using st1 tags(now + 1w, 0) +#months(not supported) +sql_error create table t1_9 using st1 tags(now + 1n, 0) +#years(not supported) +sql_error create table t1_10 using st1 tags(now + 1y, 0) + + +sql create stable st2 (ts timestamp , c1 int) tags(t1 timestamp, t2 int) + +sql create table t2_0 using st2 tags(now, 0) +#nanoseconds +sql create table t2_1 using st2 tags(now - 1b, 0) +#microseconds +sql create table t2_2 using st2 tags(now - 1u, 0) +#milliseconds +sql create table t2_3 using st2 tags(now - 1a, 0) +#seconds +sql create table t2_4 using st2 tags(now - 1s, 0) +#minutes +sql create table t2_5 using st2 tags(now - 1m, 0) +#hours +sql create table t2_6 using st2 tags(now - 1h, 0) +#days +sql create table t2_7 using st2 tags(now - 1d, 0) +#weeks +sql create table t2_8 using st2 tags(now - 1w, 0) +#months(not supported) +sql_error create table t2_9 using st2 tags(now - 1n, 0) +#years(not supported) +sql_error create table t2_10 using st2 tags(now - 1y, 0) + +sql insert into t1_0 values (now, 0) +sql insert into t1_1 values (now, 1) +sql insert into t1_2 values (now, 2) +sql insert into t1_3 values (now, 3) +sql insert into t1_4 values (now, 4) +sql insert into t1_5 values (now, 5) +sql insert into t1_6 values (now, 6) +sql insert into t1_7 values (now, 7) +sql insert into t1_8 values (now, 8) + +sql insert into t2_0 values (now, 0) +sql insert into t2_1 values (now, 1) +sql insert into t2_2 values (now, 2) +sql insert into t2_3 values (now, 3) +sql insert into t2_4 values (now, 4) +sql insert into t2_5 values (now, 5) +sql insert into t2_6 values (now, 6) +sql insert into t2_7 values (now, 7) +sql insert into t2_8 values (now, 8) + +sql select * from st1 + +if $rows != 9 then + return -1 +endi + +sql select * from st2 + +if $rows != 9 then + return -1 +endi + +sql create stable st3 (ts timestamp , c1 int) tags (t1 timestamp, t2 timestamp, t3 timestamp, t4 timestamp, t5 timestamp, t6 timestamp, t7 timestamp, t8 timestamp, t9 timestamp) +sql create table t3 using st3 tags(now, now + 1b, now + 1u, now + 1a, now + 1s, now + 1m, now + 1h, now + 1d, now + 1w) +sql insert into t3 values (now, 1) + +sql select * from st3 +if $rows != 1 then + return -1 +endi + +sql create stable st4 (ts timestamp , c1 int) tags (t1 timestamp, t2 timestamp, t3 timestamp, t4 timestamp, t5 timestamp, t6 timestamp, t7 timestamp, t8 timestamp, t9 timestamp) +sql create table t4 using st4 tags(now, now - 1b, now - 1u, now - 1a, now - 1s, now - 1m, now - 1h, now - 1d, now - 1w) +sql insert into t4 values (now, 1) + +sql select * from st4 +if $rows != 1 then + return -1 +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT