Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f68583e7
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1193
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f68583e7
编写于
11月 04, 2021
作者:
X
Xiaoyu Wang
浏览文件
操作
浏览文件
下载
差异文件
merge master
上级
a721ba58
a6be900d
变更
54
显示空白变更内容
内联
并排
Showing
54 changed file
with
2164 addition
and
1440 deletion
+2164
-1440
.gitignore
.gitignore
+4
-0
Jenkinsfile
Jenkinsfile
+157
-32
cmake/version.inc
cmake/version.inc
+1
-1
documentation20/cn/09.connections/docs.md
documentation20/cn/09.connections/docs.md
+19
-9
documentation20/cn/14.devops/01.telegraf/docs.md
documentation20/cn/14.devops/01.telegraf/docs.md
+73
-0
documentation20/cn/14.devops/02.collectd/docs.md
documentation20/cn/14.devops/02.collectd/docs.md
+79
-0
documentation20/cn/images/connections/dashboard-15146.png
documentation20/cn/images/connections/dashboard-15146.png
+0
-0
documentation20/en/09.connections/docs.md
documentation20/en/09.connections/docs.md
+10
-5
documentation20/en/images/connections/dashboard-15146.png
documentation20/en/images/connections/dashboard-15146.png
+0
-0
packaging/deb/makedeb.sh
packaging/deb/makedeb.sh
+0
-6
packaging/rpm/tdengine.spec
packaging/rpm/tdengine.spec
+0
-6
packaging/tools/make_install.sh
packaging/tools/make_install.sh
+0
-5
packaging/tools/makeclient.sh
packaging/tools/makeclient.sh
+0
-5
packaging/tools/makeclient_power.sh
packaging/tools/makeclient_power.sh
+0
-5
packaging/tools/makeclient_pro.sh
packaging/tools/makeclient_pro.sh
+0
-5
packaging/tools/makeclient_tq.sh
packaging/tools/makeclient_tq.sh
+0
-5
packaging/tools/makepkg.sh
packaging/tools/makepkg.sh
+0
-5
packaging/tools/makepkg_power.sh
packaging/tools/makepkg_power.sh
+0
-5
packaging/tools/makepkg_pro.sh
packaging/tools/makepkg_pro.sh
+0
-5
packaging/tools/makepkg_tq.sh
packaging/tools/makepkg_tq.sh
+0
-5
snap/snapcraft.yaml
snap/snapcraft.yaml
+2
-2
src/client/inc/tscUtil.h
src/client/inc/tscUtil.h
+1
-0
src/client/src/tscPrepare.c
src/client/src/tscPrepare.c
+61
-16
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+47
-27
src/common/inc/tglobal.h
src/common/inc/tglobal.h
+44
-42
src/common/src/tdataformat.c
src/common/src/tdataformat.c
+25
-11
src/common/src/tglobal.c
src/common/src/tglobal.c
+115
-105
src/connector/jdbc/pom.xml
src/connector/jdbc/pom.xml
+1
-0
src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBErrorNumbers.java
...dbc/src/main/java/com/taosdata/jdbc/TSDBErrorNumbers.java
+4
-0
src/connector/jdbc/src/main/java/com/taosdata/jdbc/utils/HttpClientPoolUtil.java
...main/java/com/taosdata/jdbc/utils/HttpClientPoolUtil.java
+15
-26
src/connector/jdbc/src/test/java/com/taosdata/jdbc/utils/HttpClientPoolUtilTest.java
.../java/com/taosdata/jdbc/utils/HttpClientPoolUtilTest.java
+76
-0
src/inc/ttokendef.h
src/inc/ttokendef.h
+1
-1
src/os/src/darwin/dwSysInfo.c
src/os/src/darwin/dwSysInfo.c
+2
-0
src/os/src/detail/osSysinfo.c
src/os/src/detail/osSysinfo.c
+2
-0
src/os/src/windows/wSysinfo.c
src/os/src/windows/wSysinfo.c
+11
-0
src/plugins/http/inc/httpInt.h
src/plugins/http/inc/httpInt.h
+23
-22
src/plugins/http/src/httpContext.c
src/plugins/http/src/httpContext.c
+5
-1
src/plugins/http/src/httpHandle.c
src/plugins/http/src/httpHandle.c
+5
-6
src/plugins/http/src/httpSql.c
src/plugins/http/src/httpSql.c
+7
-0
src/query/inc/qExecutor.h
src/query/inc/qExecutor.h
+3
-0
src/query/inc/sql.y
src/query/inc/sql.y
+1
-1
src/query/src/qAggMain.c
src/query/src/qAggMain.c
+1
-1
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+2
-2
src/query/src/queryMain.c
src/query/src/queryMain.c
+4
-1
src/query/src/sql.c
src/query/src/sql.c
+882
-880
src/util/inc/tconfig.h
src/util/inc/tconfig.h
+1
-1
tests/pytest/query/udf.py
tests/pytest/query/udf.py
+368
-123
tests/script/api/batchprepare.c
tests/script/api/batchprepare.c
+46
-3
tests/script/general/parser/udf_dll.sim
tests/script/general/parser/udf_dll.sim
+1
-1
tests/script/general/parser/udf_dll_stable.sim
tests/script/general/parser/udf_dll_stable.sim
+1
-1
tests/script/sh/abs_max.c
tests/script/sh/abs_max.c
+31
-26
tests/script/sh/add_one.c
tests/script/sh/add_one.c
+5
-7
tests/script/sh/add_one_64232.c
tests/script/sh/add_one_64232.c
+2
-4
tests/script/sh/sum_double.c
tests/script/sh/sum_double.c
+26
-26
未找到文件。
.gitignore
浏览文件 @
f68583e7
...
...
@@ -81,6 +81,10 @@ tests/comparisonTest/opentsdb/opentsdbtest/.settings/
tests/examples/JDBC/JDBCDemo/.classpath
tests/examples/JDBC/JDBCDemo/.project
tests/examples/JDBC/JDBCDemo/.settings/
tests/script/api/batchprepare
tests/script/api/stmt
tests/script/api/stmtBatchTest
tests/script/api/stmtTest
# Emacs
# -*- mode: gitignore; -*-
...
...
Jenkinsfile
浏览文件 @
f68583e7
...
...
@@ -111,6 +111,77 @@ def pre_test(){
'''
return
1
}
def
pre_test_noinstall
(){
sh
'hostname'
sh
'''
cd ${WKC}
git reset --hard HEAD~10 >/dev/null
'''
script
{
if
(
env
.
CHANGE_TARGET
==
'master'
)
{
sh
'''
cd ${WKC}
git checkout master
'''
}
else
if
(
env
.
CHANGE_TARGET
==
'2.0'
){
sh
'''
cd ${WKC}
git checkout 2.0
'''
}
else
{
sh
'''
cd ${WKC}
git checkout develop
'''
}
}
sh
'''
cd ${WKC}
git pull >/dev/null
git fetch origin +refs/pull/${CHANGE_ID}/merge
git checkout -qf FETCH_HEAD
git clean -dfx
git submodule update --init --recursive
cd ${WK}
git reset --hard HEAD~10
'''
script
{
if
(
env
.
CHANGE_TARGET
==
'master'
)
{
sh
'''
cd ${WK}
git checkout master
'''
}
else
if
(
env
.
CHANGE_TARGET
==
'2.0'
){
sh
'''
cd ${WK}
git checkout 2.0
'''
}
else
{
sh
'''
cd ${WK}
git checkout develop
'''
}
}
sh
'''
cd ${WK}
git pull >/dev/null
export TZ=Asia/Harbin
date
git clean -dfx
mkdir debug
cd debug
cmake .. > /dev/null
make
'''
return
1
}
def
pre_test_win
(){
bat
'''
taskkill /f /t /im python.exe
...
...
@@ -179,9 +250,9 @@ def pre_test_win(){
git clean -dfx
mkdir debug
cd debug
call "C:\\Program Files (x86)\\Microsoft Visual Studio
14.0\\VC
\\vcvarsall.bat" amd64
call "C:\\Program Files (x86)\\Microsoft Visual Studio
\\2017\\Community\\VC\\Auxiliary\\Build
\\vcvarsall.bat" amd64
cmake ../ -G "NMake Makefiles"
nmake || exit 8
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
...
...
@@ -396,7 +467,7 @@ pipeline {
stage
(
'test_b4_s7'
)
{
agent
{
label
" slave7 || slave17 "
}
steps
{
timeout
(
time:
5
5
,
unit:
'MINUTES'
){
timeout
(
time:
10
5
,
unit:
'MINUTES'
){
pre_test
()
sh
'''
date
...
...
@@ -428,7 +499,7 @@ pipeline {
stage
(
'test_b6_s9'
)
{
agent
{
label
" slave9 || slave19 "
}
steps
{
timeout
(
time:
5
5
,
unit:
'MINUTES'
){
timeout
(
time:
10
5
,
unit:
'MINUTES'
){
pre_test
()
sh
'''
date
...
...
@@ -451,36 +522,90 @@ pipeline {
}
}
}
stage
(
'arm64centos7'
)
{
agent
{
label
" arm64centos7 "
}
steps
{
pre_test_noinstall
()
}
}
stage
(
'arm64centos8'
)
{
agent
{
label
" arm64centos8 "
}
steps
{
pre_test_noinstall
()
}
}
stage
(
'arm32bionic'
)
{
agent
{
label
" arm32bionic "
}
steps
{
pre_test_noinstall
()
}
}
stage
(
'arm64bionic'
)
{
agent
{
label
" arm64bionic "
}
steps
{
pre_test_noinstall
()
}
}
stage
(
'arm64focal'
)
{
agent
{
label
" arm64focal "
}
steps
{
pre_test_noinstall
()
}
}
stage
(
'centos7'
)
{
agent
{
label
" centos7 "
}
steps
{
pre_test_noinstall
()
}
}
stage
(
'ubuntu:trusty'
)
{
agent
{
label
" trusty "
}
steps
{
pre_test_noinstall
()
}
}
stage
(
'ubuntu:xenial'
)
{
agent
{
label
" xenial "
}
steps
{
pre_test_noinstall
()
}
}
stage
(
'ubuntu:bionic'
)
{
agent
{
label
" bionic "
}
steps
{
pre_test_noinstall
()
}
}
//
stage('build'){
//
agent{label " wintest "}
//
steps {
//
pre_test()
//
script{
//
while(win_stop == 0){
//
sleep(1)
//
}
//
}
//
}
//
}
//
stage('test'){
//
agent{label "win"}
//
steps{
stage
(
'build'
){
agent
{
label
" wintest "
}
steps
{
pre_test
()
script
{
while
(
win_stop
==
0
){
sleep
(
1
)
}
}
}
}
stage
(
'test'
){
agent
{
label
"win"
}
steps
{
//
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
//
pre_test_win()
//
timeout(time: 20, unit: 'MINUTES'){
//
bat'''
//
cd C:\\workspace\\TDinternal\\community\\tests\\pytest
// .\\test-all.bat W
intest
//
'''
//
}
//
}
//
script{
//
win_stop=1
//
}
//
}
//
}
catchError
(
buildResult:
'FAILURE'
,
stageResult:
'FAILURE'
)
{
pre_test_win
()
timeout
(
time:
20
,
unit:
'MINUTES'
){
bat
'''
cd C:\\workspace\\TDinternal\\community\\tests\\pytest
.\\test-all.bat w
intest
'''
}
}
script
{
win_stop
=
1
}
}
}
}
...
...
cmake/version.inc
浏览文件 @
f68583e7
...
...
@@ -4,7 +4,7 @@ PROJECT(TDengine)
IF
(
DEFINED
VERNUMBER
)
SET
(
TD_VER_NUMBER
$
{
VERNUMBER
})
ELSE
()
SET
(
TD_VER_NUMBER
"2.2.1.
1
"
)
SET
(
TD_VER_NUMBER
"2.2.1.
3
"
)
ENDIF
()
IF
(
DEFINED
VERCOMPATIBLE
)
...
...
documentation20/cn/09.connections/docs.md
浏览文件 @
f68583e7
...
...
@@ -3,7 +3,7 @@
## <a class="anchor" id="grafana"></a>Grafana
TDengine
能够与开源数据可视化系统
[
Grafana
](
https://www.grafana.com/
)
快速集成搭建数据监测报警系统,整个过程无需任何代码开发,TDengine中数据表中内容可以在仪表盘(DashBoard)上进行可视化展现
。
TDengine
能够与开源数据可视化系统
[
Grafana
](
https://www.grafana.com/
)
快速集成搭建数据监测报警系统,整个过程无需任何代码开发,TDengine 中数据表中内容可以在仪表盘(DashBoard)上进行可视化展现。关于TDengine插件的使用您可以在
[
GitHub
](
https://github.com/taosdata/grafanaplugin/blob/master/README.md
)
中了解更多
。
### 安装Grafana
...
...
@@ -11,12 +11,24 @@ TDengine能够与开源数据可视化系统[Grafana](https://www.grafana.com/)
### 配置Grafana
TDengine
的Grafana插件在安装包的/usr/local/taos/connector/grafanaplugin目录下
。
TDengine
的 Grafana 插件请从
<https://github.com/taosdata/grafanaplugin/releases/latest>
下载
。
以CentOS 7.2操作系统为例,将grafanaplugin目录拷贝到/var/lib/grafana/plugins目录下,重新启动grafana即可。
```
bash
GF_VERSION
=
3.1.1
wget https://github.com/taosdata/grafanaplugin/releases/download/v
$GF_VERSION
/tdengine-datasource-
$GF_VERSION
.zip
```
以 CentOS 7.2 操作系统为例,将插件包解压到 /var/lib/grafana/plugins 目录下,重新启动 grafana 即可。
```
bash
sudo cp
-rf
/usr/local/taos/connector/grafanaplugin /var/lib/grafana/plugins/tdengine
sudo
unzip tdengine-datasource-
$GF_VERSION
.zip
-d
/var/lib/grafana/plugins/
```
Grafana 7.3+ / 8.x 版本会对插件进行签名检查,因此还需要在 grafana.ini 文件中增加如下行,才能正确使用插件:
```
ini
[plugins]
allow_loading_unsigned_plugins
=
tdengine-datasource
```
### 使用 Grafana
...
...
@@ -55,7 +67,6 @@ sudo cp -rf /usr/local/taos/connector/grafanaplugin /var/lib/grafana/plugins/tde
*
ALIAS BY:可设置当前查询别名。
*
GENERATE SQL: 点击该按钮会自动替换相应变量,并生成最终执行的语句。
按照默认提示查询当前 TDengine 部署所在服务器指定间隔系统内存平均使用量如下:

...
...
@@ -64,16 +75,15 @@ sudo cp -rf /usr/local/taos/connector/grafanaplugin /var/lib/grafana/plugins/tde
#### 导入 Dashboard
在 Grafana 插件目录 /usr/local/taos/connector/grafana/tdengine/dashboard/ 下提供了一个
`tdengine-grafana.json`
可导入的 dashboard
。
我们提供一个 TDengine Dashboard 可以作为 TDengine 集群的监控可视化工具使用,见
[
Grafana Dashboard 15146
](
https://grafana.com/grafana/dashboards/15146
)
。
点击左侧
`Import`
按钮,
并上传
`tdengine-grafana.json`
文件
:
点击左侧
`Import`
按钮,
选择
**Grafana.com Dashboard**
,j将id
`15146`
填入并加载
:

导入完成之后可看到如下效果:


## <a class="anchor" id="matlab"></a>MATLAB
...
...
documentation20/cn/14.devops/01.telegraf/docs.md
0 → 100644
浏览文件 @
f68583e7
# 使用 TDengine + Telegraf + Grafana 快速搭建 IT 运维展示系统
## 背景介绍
TDengine是涛思数据专为物联网、车联网、工业互联网、IT运维等设计和优化的大数据平台。自从 2019年 7 月开源以来,凭借创新的数据建模设计、快捷的安装方式、易用的编程接口和强大的数据写入查询性能博得了大量时序数据开发者的青睐。
IT 运维监测数据通常都是对时间特性比较敏感的数据,例如:
-
系统资源指标:CPU、内存、IO、带宽等。
-
软件系统指标:存活状态、连接数目、请求数目、超时数目、错误数目、响应时间、服务类型及其他与业务有关的指标。
当前主流的 IT 运维系统通常包含一个数据采集模块,一个数据存储模块,和一个可视化显示模块。Telegraf 和 Grafana 分别是当前最流行的数据采集模块和可视化显示模块之一。而数据存储模块可供选择的软件比较多,其中 OpenTSDB 或 InfluxDB 比较流行。而 TDengine 作为新兴的时序大数据平台,具备极强的高性能、高可靠、易管理、易维护的优势。
本文介绍不需要写一行代码,通过简单修改几行配置文件,就可以快速搭建一个基于 TDengine + Telegraf + Grafana 的 IT 运维系统。架构如下图:

## 安装步骤
### 安装 Telegraf,Grafana 和 TDengine
安装 Telegraf、Grafana 和 TDengine 请参考相关官方文档。
### Telegraf
请参考
[
官方文档
](
https://portal.influxdata.com/downloads/
)
。
### Grafana
请参考
[
官方文档
](
https://grafana.com/grafana/download
)
。
### 安装 TDengine
从涛思数据官网
[
下载
](
http://taosdata.com/cn/all-downloads/)页面下载最新
TDengine-server 2.3.0.0 或以上版本安装。
## 数据链路设置
### 下载 TDengine 插件到 grafana 插件目录
```
bash
1. wget
-c
https://github.com/taosdata/grafanaplugin/releases/download/v3.1.1/tdengine-datasource-3.1.1.zip
2.
sudo
unzip tdengine-datasource-3.1.1.zip
-d
/var/lib/grafana/plugins/
3.
sudo chown
grafana:grafana
-R
/var/lib/grafana/plugins/tdengine
4.
echo
-e
"[plugins]
\n
allow_loading_unsigned_plugins = tdengine-datasource
\n
"
|
sudo tee
-a
/etc/grafana/grafana.ini
5.
sudo
systemctl restart grafana-server.service
```
### 修改 /etc/telegraf/telegraf.conf
配置方法,在 /etc/telegraf/telegraf.conf 增加如下文字,其中 database name 请填写希望在 TDengine 保存 Telegraf 数据的数据库名,TDengine server/cluster host、username和 password 填写 TDengine 实际值:
```
[[outputs.http]]
url = "http://<TDengine server/cluster host>:6041/influxdb/v1/write?db=<database name>"
method = "POST"
timeout = "5s"
username = "<TDengine's username>"
password = "<TDengine's password>"
data_format = "influx"
influx_max_line_bytes = 250
```
然后重启 telegraf:
```
sudo systemctl start telegraf
```
### 导入 Dashboard
使用 Web 浏览器访问 IP:3000 登录 Grafana 界面,系统初始用户名密码为 admin/admin。
点击左侧齿轮图标并选择 Plugins,应该可以找到 TDengine data source 插件图标。
点击左侧加号图标并选择 Import,从 https://github.com/taosdata/grafanaplugin/blob/master/examples/telegraf/grafana/dashboards/telegraf-dashboard-v0.1.0.json 下载 dashboard JSON 文件后导入。之后可以看到如下界面的仪表盘:

## 总结
以上演示如何快速搭建一个完整的 IT 运维展示系统。得力于 TDengine 2.3.0.0 版本中新增的 schemaless 协议解析功能,以及强大的生态软件适配能力,用户可以短短数分钟就可以搭建一个高效易用的 IT 运维系统。TDengine 强大的数据写入查询性能和其他丰富功能请参考官方文档和产品落地案例。
documentation20/cn/14.devops/02.collectd/docs.md
0 → 100644
浏览文件 @
f68583e7
# 使用 TDengine + collectd/StatsD + Grafana 快速搭建 IT 运维监控系统
## 背景介绍
TDengine是涛思数据专为物联网、车联网、工业互联网、IT运维等设计和优化的大数据平台。自从 2019年 7 月开源以来,凭借创新的数据建模设计、快捷的安装方式、易用的编程接口和强大的数据写入查询性能博得了大量时序数据开发者的青睐。
IT 运维监测数据通常都是对时间特性比较敏感的数据,例如:
-
系统资源指标:CPU、内存、IO、带宽等。
-
软件系统指标:存活状态、连接数目、请求数目、超时数目、错误数目、响应时间、服务类型及其他与业务有关的指标。
当前主流的 IT 运维系统通常包含一个数据采集模块,一个数据存储模块,和一个可视化显示模块。collectd / statsD 作为老牌开源数据采集工具,具有广泛的用户群。但是 collectd / StatsD 自身功能有限,往往需要配合 Telegraf、Grafana 以及时序数据库组合搭建成为完整的监控系统。而 TDengine 新版本支持多种数据协议接入,可以直接接受 collectd 和 statsD 的数据写入,并提供 Grafana dashboard 进行图形化展示。
本文介绍不需要写一行代码,通过简单修改几行配置文件,就可以快速搭建一个基于 TDengine + collectd / statsD + Grafana 的 IT 运维系统。架构如下图:

## 安装步骤
安装 collectd, StatsD, Grafana 和 TDengine 请参考相关官方文档。
### 安装 collectd
请参考
[
官方文档
](
https://collectd.org/documentation.shtml
)
。
### 安装 StatsD
请参考
[
官方文档
](
https://github.com/statsd/statsd
)
。
### 安装 Grafana
请参考
[
官方文档
](
https://grafana.com/grafana/download
)
。
### 安装 TDengine
从涛思数据官网
[
下载
](
http://taosdata.com/cn/all-downloads/)页面下载最新
TDengine-server 2.3.0.0 或以上版本安装。
## 数据链路设置
### 复制 TDengine 插件到 grafana 插件目录
```
bash
1. wget
-c
https://github.com/taosdata/grafanaplugin/releases/download/v3.1.1/tdengine-datasource-3.1.1.zip
2.
sudo
unzip tdengine-datasource-3.1.1.zip
-d
/var/lib/grafana/plugins/
3.
sudo chown
grafana:grafana
-R
/var/lib/grafana/plugins/tdengine
4.
echo
-e
"[plugins]
\n
allow_loading_unsigned_plugins = tdengine-datasource
\n
"
|
sudo tee
-a
/etc/grafana/grafana.ini
5.
sudo
systemctl restart grafana-server.service
```
### 配置 collectd
在 /etc/collectd/collectd.conf 文件中增加如下内容,其中 host 和 port 请填写 TDengine 和 BLM3 配置的实际值:
```
LoadPlugin network
<Plugin network>
Server "<TDengine cluster/server host>" "<port for collectd>"
</Plugin>
sudo systemctl start collectd
```
### 配置 StatsD
在 config.js 文件中增加如下内容后启动 StatsD,其中 host 和 port 请填写 TDengine 和 BLM3 配置的实际值:
```
backends 部分添加 "./backends/repeater"
repeater 部分添加 { host:'<TDengine server/cluster host>', port: <port for StatsD>}
```
### 导入 Dashboard
使用 Web 浏览器访问运行 Grafana 的服务器的3000端口 host:3000 登录 Grafana 界面,系统初始用户名密码为 admin/admin。
点击左侧齿轮图标并选择 Plugins,应该可以找到 TDengine data source 插件图标。
#### 导入 collectd 仪表盘
从 https://github.com/taosdata/grafanaplugin/blob/master/examples/collectd/grafana/dashboards/collect-metrics-with-tdengine-v0.1.0.json 下载 dashboard json 文件,点击左侧加号图标并选择 Import,按照界面提示选择 JSON 文件导入。之后可以看到如下界面的仪表盘:

#### 导入 StatsD 仪表盘
从 https://github.com/taosdata/grafanaplugin/blob/master/examples/statsd/dashboards/statsd-with-tdengine-v0.1.0.json 下载 dashboard json 文件,点击左侧加号图标并选择 Import,按照界面提示导入JSON文件。之后可以看到如下界面的仪表盘:

## 总结
TDengine 作为新兴的时序大数据平台,具备极强的高性能、高可靠、易管理、易维护的优势。得力于 TDengine 2.3.0.0 版本中新增的 schemaless 协议解析功能,以及强大的生态软件适配能力,用户可以短短数分钟就可以搭建一个高效易用的 IT 运维系统或者适配一个已存在的系统。
TDengine 强大的数据写入查询性能和其他丰富功能请参考官方文档和产品成功落地案例。
documentation20/cn/images/connections/dashboard-15146.png
0 → 100644
浏览文件 @
f68583e7
171.2 KB
documentation20/en/09.connections/docs.md
浏览文件 @
f68583e7
...
...
@@ -12,12 +12,17 @@ https://grafana.com/grafana/download.
### Configure Grafana
TDengine Grafana plugin is in the /usr/local/taos/connector/grafanaplugin directory.
Download grafana plugin from
<https://github.com/taosdata/grafanaplugin/releases/latest>
.
```
bash
GF_VERSION
=
3.1.1
wget https://github.com/taosdata/grafanaplugin/releases/download/v
$GF_VERSION
/tdengine-datasource-
$GF_VERSION
.zip
```
Taking Centos 7.2 as an example, just copy grafanaplugin directory to /var/lib/grafana/plugins directory and restart Grafana.
```
bash
sudo
cp
-rf
/usr/local/taos/connector/grafanaplugin /var/lib/grafana/plugins/tdengine
sudo
unzip tdengine-datasource-
$GF_VERSION
.zip /var/lib/grafana/plugins/
```
### Use Grafana
...
...
@@ -64,15 +69,15 @@ According to the default prompt, query the average system memory usage at the sp
#### Import Dashboard
A
`tdengine-grafana.json`
importable dashboard is provided under the Grafana plug-in directory/usr/local/taos/connector/grafana/tdengine/dashboard/.
We provide an example dashboard
[
Grafana Dashboard 15146
](
https://grafana.com/grafana/dashboards/15146
)
。
Click the
`Import`
button on the left panel and
upload the
`tdengine-grafana.json`
file
:
Click the
`Import`
button on the left panel and
load the grafana id
:

You can see as follows after Dashboard imported.


## <a class="anchor" id="matlab"></a> MATLAB
...
...
documentation20/en/images/connections/dashboard-15146.png
0 → 100644
浏览文件 @
f68583e7
171.2 KB
packaging/deb/makedeb.sh
浏览文件 @
f68583e7
...
...
@@ -58,12 +58,6 @@ cp ${compile_dir}/build/lib/${libfile} ${pkg_dir}${install_home_pat
cp
${
compile_dir
}
/../src/inc/taos.h
${
pkg_dir
}${
install_home_path
}
/include
cp
${
compile_dir
}
/../src/inc/taoserror.h
${
pkg_dir
}${
install_home_path
}
/include
cp
-r
${
top_dir
}
/tests/examples/
*
${
pkg_dir
}${
install_home_path
}
/examples
if
[
-d
"
${
top_dir
}
/src/connector/grafanaplugin/dist"
]
;
then
cp
-r
${
top_dir
}
/src/connector/grafanaplugin/dist
${
pkg_dir
}${
install_home_path
}
/connector/grafanaplugin
else
echo
"grafanaplugin bundled directory not found!"
exit
1
fi
cp
-r
${
top_dir
}
/src/connector/python
${
pkg_dir
}${
install_home_path
}
/connector
cp
-r
${
top_dir
}
/src/connector/go
${
pkg_dir
}${
install_home_path
}
/connector
cp
-r
${
top_dir
}
/src/connector/nodejs
${
pkg_dir
}${
install_home_path
}
/connector
...
...
packaging/rpm/tdengine.spec
浏览文件 @
f68583e7
...
...
@@ -67,12 +67,6 @@ cp %{_compiledir}/build/bin/taosdump %{buildroot}%{homepath}/bin
cp %{_compiledir}/build/lib/${libfile} %{buildroot}%{homepath}/driver
cp %{_compiledir}/../src/inc/taos.h %{buildroot}%{homepath}/include
cp %{_compiledir}/../src/inc/taoserror.h %{buildroot}%{homepath}/include
if [ -d %{_compiledir}/../src/connector/grafanaplugin/dist ]; then
cp -r %{_compiledir}/../src/connector/grafanaplugin/dist %{buildroot}%{homepath}/connector/grafanaplugin
else
echo grafanaplugin bundled directory not found!
exit 1
fi
cp -r %{_compiledir}/../src/connector/python %{buildroot}%{homepath}/connector
cp -r %{_compiledir}/../src/connector/go %{buildroot}%{homepath}/connector
cp -r %{_compiledir}/../src/connector/nodejs %{buildroot}%{homepath}/connector
...
...
packaging/tools/make_install.sh
浏览文件 @
f68583e7
...
...
@@ -316,11 +316,6 @@ function install_data() {
}
function
install_connector
()
{
if
[
-d
"
${
source_dir
}
/src/connector/grafanaplugin/dist"
]
;
then
${
csudo
}
cp
-rf
${
source_dir
}
/src/connector/grafanaplugin/dist
${
install_main_dir
}
/connector/grafanaplugin
else
echo
"WARNING: grafanaplugin bundled dir not found, please check if want to use it!"
fi
if
find
${
source_dir
}
/src/connector/go
-mindepth
1
-maxdepth
1 |
read
;
then
${
csudo
}
cp
-r
${
source_dir
}
/src/connector/go
${
install_main_dir
}
/connector
else
...
...
packaging/tools/makeclient.sh
浏览文件 @
f68583e7
...
...
@@ -150,11 +150,6 @@ if [[ "$pagMode" != "lite" ]] && [[ "$cpuType" != "aarch32" ]]; then
if
[
"
$osType
"
!=
"Darwin"
]
;
then
cp
${
build_dir
}
/lib/
*
.jar
${
install_dir
}
/connector
||
:
fi
if
[
-d
"
${
connector_dir
}
/grafanaplugin/dist"
]
;
then
cp
-r
${
connector_dir
}
/grafanaplugin/dist
${
install_dir
}
/connector/grafanaplugin
else
echo
"WARNING: grafanaplugin bundled dir not found, please check if want to use it!"
fi
if
find
${
connector_dir
}
/go
-mindepth
1
-maxdepth
1 |
read
;
then
cp
-r
${
connector_dir
}
/go
${
install_dir
}
/connector
else
...
...
packaging/tools/makeclient_power.sh
浏览文件 @
f68583e7
...
...
@@ -210,11 +210,6 @@ if [[ "$pagMode" != "lite" ]] && [[ "$cpuType" != "aarch32" ]]; then
if
[
"
$osType
"
!=
"Darwin"
]
;
then
cp
${
build_dir
}
/lib/
*
.jar
${
install_dir
}
/connector
||
:
fi
if
[
-d
"
${
connector_dir
}
/grafanaplugin/dist"
]
;
then
cp
-r
${
connector_dir
}
/grafanaplugin/dist
${
install_dir
}
/connector/grafanaplugin
else
echo
"WARNING: grafanaplugin bunlded dir not found, please check if want to use it!"
fi
if
find
${
connector_dir
}
/go
-mindepth
1
-maxdepth
1 |
read
;
then
cp
-r
${
connector_dir
}
/go
${
install_dir
}
/connector
else
...
...
packaging/tools/makeclient_pro.sh
浏览文件 @
f68583e7
...
...
@@ -172,11 +172,6 @@ if [[ "$pagMode" != "lite" ]] && [[ "$cpuType" != "aarch32" ]]; then
if
[
"
$osType
"
!=
"Darwin"
]
;
then
cp
${
build_dir
}
/lib/
*
.jar
${
install_dir
}
/connector
||
:
fi
if
[
-d
"
${
connector_dir
}
/grafanaplugin/dist"
]
;
then
cp
-r
${
connector_dir
}
/grafanaplugin/dist
${
install_dir
}
/connector/grafanaplugin
else
echo
"WARNING: grafanaplugin bunlded dir not found, please check if want to use it!"
fi
if
find
${
connector_dir
}
/go
-mindepth
1
-maxdepth
1 |
read
;
then
cp
-r
${
connector_dir
}
/go
${
install_dir
}
/connector
else
...
...
packaging/tools/makeclient_tq.sh
浏览文件 @
f68583e7
...
...
@@ -177,11 +177,6 @@ if [[ "$pagMode" != "lite" ]] && [[ "$cpuType" != "aarch32" ]]; then
if
[
"
$osType
"
!=
"Darwin"
]
;
then
cp
${
build_dir
}
/lib/
*
.jar
${
install_dir
}
/connector
||
:
fi
if
[
-d
"
${
connector_dir
}
/grafanaplugin/dist"
]
;
then
cp
-r
${
connector_dir
}
/grafanaplugin/dist
${
install_dir
}
/connector/grafanaplugin
else
echo
"WARNING: grafanaplugin bunlded dir not found, please check if want to use it!"
fi
if
find
${
connector_dir
}
/go
-mindepth
1
-maxdepth
1 |
read
;
then
cp
-r
${
connector_dir
}
/go
${
install_dir
}
/connector
else
...
...
packaging/tools/makepkg.sh
浏览文件 @
f68583e7
...
...
@@ -183,11 +183,6 @@ connector_dir="${code_dir}/connector"
mkdir
-p
${
install_dir
}
/connector
if
[[
"
$pagMode
"
!=
"lite"
]]
&&
[[
"
$cpuType
"
!=
"aarch32"
]]
;
then
cp
${
build_dir
}
/lib/
*
.jar
${
install_dir
}
/connector
||
:
if
[
-d
"
${
connector_dir
}
/grafanaplugin/dist"
]
;
then
cp
-r
${
connector_dir
}
/grafanaplugin/dist
${
install_dir
}
/connector/grafanaplugin
else
echo
"WARNING: grafanaplugin bundled dir not found, please check if you want to use it!"
fi
if
find
${
connector_dir
}
/go
-mindepth
1
-maxdepth
1 |
read
;
then
cp
-r
${
connector_dir
}
/go
${
install_dir
}
/connector
else
...
...
packaging/tools/makepkg_power.sh
浏览文件 @
f68583e7
...
...
@@ -167,11 +167,6 @@ mkdir -p ${install_dir}/connector
if
[[
"
$pagMode
"
!=
"lite"
]]
&&
[[
"
$cpuType
"
!=
"aarch32"
]]
;
then
cp
${
build_dir
}
/lib/
*
.jar
${
install_dir
}
/connector
||
:
if
[
-d
"
${
connector_dir
}
/grafanaplugin/dist"
]
;
then
cp
-r
${
connector_dir
}
/grafanaplugin/dist
${
install_dir
}
/connector/grafanaplugin
else
echo
"WARNING: grafanaplugin bundled dir not found, please check if want to use it!"
fi
if
find
${
connector_dir
}
/go
-mindepth
1
-maxdepth
1 |
read
;
then
cp
-r
${
connector_dir
}
/go
${
install_dir
}
/connector
else
...
...
packaging/tools/makepkg_pro.sh
浏览文件 @
f68583e7
...
...
@@ -153,11 +153,6 @@ mkdir -p ${install_dir}/driver && cp ${lib_files} ${install_dir}/driver && echo
#if [[ "$pagMode" != "lite" ]] && [[ "$cpuType" != "aarch32" ]]; then
# cp ${build_dir}/lib/*.jar ${install_dir}/connector ||:
# if [ -d "${connector_dir}/grafanaplugin/dist" ]; then
# cp -r ${connector_dir}/grafanaplugin/dist ${install_dir}/connector/grafanaplugin
# else
# echo "WARNING: grafanaplugin bundled dir not found, please check if want to use it!"
# fi
# if find ${connector_dir}/go -mindepth 1 -maxdepth 1 | read; then
# cp -r ${connector_dir}/go ${install_dir}/connector
# else
...
...
packaging/tools/makepkg_tq.sh
浏览文件 @
f68583e7
...
...
@@ -167,11 +167,6 @@ mkdir -p ${install_dir}/connector
if
[[
"
$pagMode
"
!=
"lite"
]]
&&
[[
"
$cpuType
"
!=
"aarch32"
]]
;
then
cp
${
build_dir
}
/lib/
*
.jar
${
install_dir
}
/connector
||
:
if
[
-d
"
${
connector_dir
}
/grafanaplugin/dist"
]
;
then
cp
-r
${
connector_dir
}
/grafanaplugin/dist
${
install_dir
}
/connector/grafanaplugin
else
echo
"WARNING: grafanaplugin bundled dir not found, please check if want to use it!"
fi
if
find
${
connector_dir
}
/go
-mindepth
1
-maxdepth
1 |
read
;
then
cp
-r
${
connector_dir
}
/go
${
install_dir
}
/connector
else
...
...
snap/snapcraft.yaml
浏览文件 @
f68583e7
name
:
tdengine
base
:
core18
version
:
'
2.2.1.
1
'
version
:
'
2.2.1.
3
'
icon
:
snap/gui/t-dengine.svg
summary
:
an open-source big data platform designed and optimized for IoT.
description
:
|
...
...
@@ -72,7 +72,7 @@ parts:
-
usr/bin/taosd
-
usr/bin/taos
-
usr/bin/taosdemo
-
usr/lib/libtaos.so.2.2.1.
1
-
usr/lib/libtaos.so.2.2.1.
3
-
usr/lib/libtaos.so.1
-
usr/lib/libtaos.so
...
...
src/client/inc/tscUtil.h
浏览文件 @
f68583e7
...
...
@@ -108,6 +108,7 @@ typedef struct SBlockKeyInfo {
int32_t
converToStr
(
char
*
str
,
int
type
,
void
*
buf
,
int32_t
bufSize
,
int32_t
*
len
);
int32_t
tscCreateDataBlock
(
size_t
initialSize
,
int32_t
rowSize
,
int32_t
startOffset
,
SName
*
name
,
STableMeta
*
pTableMeta
,
STableDataBlocks
**
dataBlocks
);
int32_t
tscCreateDataBlockData
(
STableDataBlocks
*
dataBuf
,
size_t
defaultSize
,
int32_t
rowSize
,
int32_t
startOffset
);
void
tscDestroyDataBlock
(
STableDataBlocks
*
pDataBlock
,
bool
removeMeta
);
void
tscSortRemoveDataBlockDupRowsRaw
(
STableDataBlocks
*
dataBuf
);
int
tscSortRemoveDataBlockDupRows
(
STableDataBlocks
*
dataBuf
,
SBlockKeyInfo
*
pBlkKeyInfo
);
...
...
src/client/src/tscPrepare.c
浏览文件 @
f68583e7
...
...
@@ -48,12 +48,14 @@ typedef struct SMultiTbStmt {
bool
nameSet
;
bool
tagSet
;
bool
subSet
;
bool
tagColSet
;
uint64_t
currentUid
;
char
*
sqlstr
;
uint32_t
tbNum
;
SStrToken
tbname
;
SStrToken
stbname
;
SStrToken
values
;
SStrToken
tagCols
;
SArray
*
tags
;
STableDataBlocks
*
lastBlock
;
SHashObj
*
pTableHash
;
...
...
@@ -1246,6 +1248,12 @@ static void insertBatchClean(STscStmt* pStmt) {
pCmd
->
insertParam
.
pDataBlocks
=
tscDestroyBlockArrayList
(
pCmd
->
insertParam
.
pDataBlocks
);
pCmd
->
insertParam
.
numOfTables
=
0
;
STableDataBlocks
**
p
=
taosHashIterate
(
pCmd
->
insertParam
.
pTableBlockHashList
,
NULL
);
while
(
p
)
{
tfree
((
*
p
)
->
pData
);
p
=
taosHashIterate
(
pCmd
->
insertParam
.
pTableBlockHashList
,
p
);
}
taosHashClear
(
pCmd
->
insertParam
.
pTableBlockHashList
);
tscFreeSqlResult
(
pSql
);
tscFreeSubobj
(
pSql
);
...
...
@@ -1336,11 +1344,42 @@ int stmtParseInsertTbTags(SSqlObj* pSql, STscStmt* pStmt) {
}
pStmt
->
mtb
.
stbname
=
sToken
;
sToken
=
tStrGetToken
(
pCmd
->
insertParam
.
sql
,
&
index
,
false
);
if
(
sToken
.
n
<=
0
||
((
sToken
.
type
!=
TK_TAGS
)
&&
(
sToken
.
type
!=
TK_LP
)))
{
tscError
(
"invalid token, sql:%s"
,
pCmd
->
insertParam
.
sql
);
return
tscSQLSyntaxErrMsg
(
pCmd
->
payload
,
"invalid token"
,
sToken
.
z
?
sToken
.
z
:
pCmd
->
insertParam
.
sql
);
}
// ... (tag_col_list) TAGS(tag_val_list) ...
int32_t
tagColsCnt
=
0
;
if
(
sToken
.
type
==
TK_LP
)
{
pStmt
->
mtb
.
tagColSet
=
true
;
pStmt
->
mtb
.
tagCols
=
sToken
;
int32_t
tagColsStart
=
index
;
while
(
1
)
{
sToken
=
tStrGetToken
(
pCmd
->
insertParam
.
sql
,
&
index
,
false
);
if
(
sToken
.
type
==
TK_ILLEGAL
)
{
return
tscSQLSyntaxErrMsg
(
pCmd
->
payload
,
"unrecognized token"
,
sToken
.
z
);
}
if
(
sToken
.
type
==
TK_ID
)
{
++
tagColsCnt
;
}
if
(
sToken
.
type
==
TK_RP
)
{
break
;
}
}
if
(
tagColsCnt
==
0
)
{
tscError
(
"tag column list expected, sql:%s"
,
pCmd
->
insertParam
.
sql
);
return
tscSQLSyntaxErrMsg
(
pCmd
->
payload
,
"tag column list expected"
,
pCmd
->
insertParam
.
sql
);
}
pStmt
->
mtb
.
tagCols
.
n
=
index
-
tagColsStart
+
1
;
sToken
=
tStrGetToken
(
pCmd
->
insertParam
.
sql
,
&
index
,
false
);
if
(
sToken
.
n
<=
0
||
sToken
.
type
!=
TK_TAGS
)
{
tscError
(
"keyword TAGS expected, sql:%s"
,
pCmd
->
insertParam
.
sql
);
return
tscSQLSyntaxErrMsg
(
pCmd
->
payload
,
"keyword TAGS expected"
,
sToken
.
z
?
sToken
.
z
:
pCmd
->
insertParam
.
sql
);
}
}
sToken
=
tStrGetToken
(
pCmd
->
insertParam
.
sql
,
&
index
,
false
);
if
(
sToken
.
n
<=
0
||
sToken
.
type
!=
TK_LP
)
{
...
...
@@ -1379,6 +1418,11 @@ int stmtParseInsertTbTags(SSqlObj* pSql, STscStmt* pStmt) {
return
tscSQLSyntaxErrMsg
(
pCmd
->
payload
,
"no tags"
,
pCmd
->
insertParam
.
sql
);
}
if
(
tagColsCnt
>
0
&&
taosArrayGetSize
(
pStmt
->
mtb
.
tags
)
!=
tagColsCnt
)
{
tscError
(
"not match tags, sql:%s"
,
pCmd
->
insertParam
.
sql
);
return
tscSQLSyntaxErrMsg
(
pCmd
->
payload
,
"not match tags"
,
pCmd
->
insertParam
.
sql
);
}
sToken
=
tStrGetToken
(
pCmd
->
insertParam
.
sql
,
&
index
,
false
);
if
(
sToken
.
n
<=
0
||
(
sToken
.
type
!=
TK_VALUES
&&
sToken
.
type
!=
TK_LP
))
{
tscError
(
"sql error, sql:%s"
,
pCmd
->
insertParam
.
sql
);
...
...
@@ -1401,7 +1445,13 @@ int stmtGenInsertStatement(SSqlObj* pSql, STscStmt* pStmt, const char* name, TAO
int32_t
j
=
0
;
while
(
1
)
{
if
(
pStmt
->
mtb
.
tagColSet
)
{
len
=
(
size_t
)
snprintf
(
str
,
size
-
1
,
"insert into %s using %.*s %.*s tags("
,
name
,
pStmt
->
mtb
.
stbname
.
n
,
pStmt
->
mtb
.
stbname
.
z
,
pStmt
->
mtb
.
tagCols
.
n
,
pStmt
->
mtb
.
tagCols
.
z
);
}
else
{
len
=
(
size_t
)
snprintf
(
str
,
size
-
1
,
"insert into %s using %.*s tags("
,
name
,
pStmt
->
mtb
.
stbname
.
n
,
pStmt
->
mtb
.
stbname
.
z
);
}
if
(
len
>=
(
size
-
1
))
{
size
*=
2
;
free
(
str
);
...
...
@@ -1637,6 +1687,13 @@ int taos_stmt_set_tbname_tags(TAOS_STMT* stmt, const char* name, TAOS_BIND* tags
STMT_RET
(
TSDB_CODE_TSC_APP_ERROR
);
}
if
((
*
t1
)
->
pData
==
NULL
)
{
code
=
tscCreateDataBlockData
(
*
t1
,
TSDB_PAYLOAD_SIZE
,
(
*
t1
)
->
pTableMeta
->
tableInfo
.
rowSize
,
sizeof
(
SSubmitBlk
));
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
STMT_RET
(
code
);
}
}
SSubmitBlk
*
pBlk
=
(
SSubmitBlk
*
)
(
*
t1
)
->
pData
;
pCmd
->
batchSize
=
pBlk
->
numOfRows
;
if
(
pBlk
->
numOfRows
==
0
)
{
...
...
@@ -1695,7 +1752,6 @@ int taos_stmt_set_tbname_tags(TAOS_STMT* stmt, const char* name, TAOS_BIND* tags
STMT_RET
(
TSDB_CODE_SUCCESS
);
}
if
(
pStmt
->
mtb
.
tagSet
)
{
pStmt
->
mtb
.
tbname
=
tscReplaceStrToken
(
&
pSql
->
sqlstr
,
&
pStmt
->
mtb
.
tbname
,
name
);
}
else
{
...
...
@@ -1762,7 +1818,6 @@ int taos_stmt_set_tbname_tags(TAOS_STMT* stmt, const char* name, TAOS_BIND* tags
STMT_RET
(
code
);
}
int
taos_stmt_set_sub_tbname
(
TAOS_STMT
*
stmt
,
const
char
*
name
)
{
STscStmt
*
pStmt
=
(
STscStmt
*
)
stmt
;
STMT_CHECK
...
...
@@ -1770,8 +1825,6 @@ int taos_stmt_set_sub_tbname(TAOS_STMT* stmt, const char* name) {
return
taos_stmt_set_tbname_tags
(
stmt
,
name
,
NULL
);
}
int
taos_stmt_set_tbname
(
TAOS_STMT
*
stmt
,
const
char
*
name
)
{
STscStmt
*
pStmt
=
(
STscStmt
*
)
stmt
;
STMT_CHECK
...
...
@@ -1779,7 +1832,6 @@ int taos_stmt_set_tbname(TAOS_STMT* stmt, const char* name) {
return
taos_stmt_set_tbname_tags
(
stmt
,
name
,
NULL
);
}
int
taos_stmt_close
(
TAOS_STMT
*
stmt
)
{
STscStmt
*
pStmt
=
(
STscStmt
*
)
stmt
;
if
(
pStmt
==
NULL
||
pStmt
->
taos
==
NULL
)
{
...
...
@@ -1846,7 +1898,6 @@ int taos_stmt_bind_param(TAOS_STMT* stmt, TAOS_BIND* bind) {
}
}
int
taos_stmt_bind_param_batch
(
TAOS_STMT
*
stmt
,
TAOS_MULTI_BIND
*
bind
)
{
STscStmt
*
pStmt
=
(
STscStmt
*
)
stmt
;
...
...
@@ -1910,8 +1961,6 @@ int taos_stmt_bind_single_param_batch(TAOS_STMT* stmt, TAOS_MULTI_BIND* bind, in
STMT_RET
(
insertStmtBindParamBatch
(
pStmt
,
bind
,
colIdx
));
}
int
taos_stmt_add_batch
(
TAOS_STMT
*
stmt
)
{
STscStmt
*
pStmt
=
(
STscStmt
*
)
stmt
;
STMT_CHECK
...
...
@@ -2052,7 +2101,6 @@ int taos_stmt_get_param(TAOS_STMT *stmt, int idx, int *type, int *bytes) {
}
}
char
*
taos_stmt_errstr
(
TAOS_STMT
*
stmt
)
{
STscStmt
*
pStmt
=
(
STscStmt
*
)
stmt
;
...
...
@@ -2063,8 +2111,6 @@ char *taos_stmt_errstr(TAOS_STMT *stmt) {
return
taos_errstr
(
pStmt
->
pSql
);
}
const
char
*
taos_data_type
(
int
type
)
{
switch
(
type
)
{
case
TSDB_DATA_TYPE_NULL
:
return
"TSDB_DATA_TYPE_NULL"
;
...
...
@@ -2081,4 +2127,3 @@ const char *taos_data_type(int type) {
default:
return
"UNKNOWN"
;
}
}
src/client/src/tscUtil.c
浏览文件 @
f68583e7
...
...
@@ -919,23 +919,31 @@ SSDataBlock* doGetDataBlock(void* param, bool* newgroup) {
pBlock
->
info
.
rows
=
pRes
->
numOfRows
;
if
(
pRes
->
numOfRows
!=
0
)
{
doSetupSDataBlock
(
pRes
,
pBlock
,
pInput
->
pFilterInfo
,
pInput
->
numOfFilterCols
);
if
(
pBlock
->
info
.
rows
>
0
)
{
*
newgroup
=
false
;
return
pBlock
;
}
}
SSDataBlock
*
result
=
NULL
;
do
{
// No data block exists. So retrieve and transfer it into to SSDataBlock
TAOS_ROW
pRow
=
NULL
;
taos_fetch_block
(
pSql
,
&
pRow
);
if
(
pRes
->
numOfRows
==
0
)
{
pOperator
->
status
=
OP_EXEC_DONE
;
return
NULL
;
result
=
NULL
;
break
;
}
pBlock
->
info
.
rows
=
pRes
->
numOfRows
;
doSetupSDataBlock
(
pRes
,
pBlock
,
pInput
->
pFilterInfo
,
pInput
->
numOfFilterCols
);
*
newgroup
=
false
;
return
pBlock
;
result
=
pBlock
;
}
while
(
result
->
info
.
rows
==
0
);
return
result
;
}
static
void
fetchNextBlockIfCompleted
(
SOperatorInfo
*
pOperator
,
bool
*
newgroup
)
{
...
...
@@ -1797,6 +1805,32 @@ int32_t tscCreateDataBlock(size_t defaultSize, int32_t rowSize, int32_t startOff
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
}
int32_t
code
=
tscCreateDataBlockData
(
dataBuf
,
defaultSize
,
rowSize
,
startOffset
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
tfree
(
dataBuf
);
return
code
;
}
//Here we keep the tableMeta to avoid it to be remove by other threads.
dataBuf
->
pTableMeta
=
tscTableMetaDup
(
pTableMeta
);
SParsedDataColInfo
*
pColInfo
=
&
dataBuf
->
boundColumnInfo
;
SSchema
*
pSchema
=
tscGetTableSchema
(
dataBuf
->
pTableMeta
);
tscSetBoundColumnInfo
(
pColInfo
,
pSchema
,
dataBuf
->
pTableMeta
->
tableInfo
.
numOfColumns
);
dataBuf
->
vgId
=
dataBuf
->
pTableMeta
->
vgId
;
tNameAssign
(
&
dataBuf
->
tableName
,
name
);
assert
(
defaultSize
>
0
&&
pTableMeta
!=
NULL
&&
dataBuf
->
pTableMeta
!=
NULL
);
*
dataBlocks
=
dataBuf
;
return
TSDB_CODE_SUCCESS
;
}
int32_t
tscCreateDataBlockData
(
STableDataBlocks
*
dataBuf
,
size_t
defaultSize
,
int32_t
rowSize
,
int32_t
startOffset
)
{
assert
(
dataBuf
!=
NULL
);
dataBuf
->
nAllocSize
=
(
uint32_t
)
defaultSize
;
dataBuf
->
headerSize
=
startOffset
;
...
...
@@ -1809,30 +1843,16 @@ int32_t tscCreateDataBlock(size_t defaultSize, int32_t rowSize, int32_t startOff
dataBuf
->
pData
=
malloc
(
dataBuf
->
nAllocSize
);
if
(
dataBuf
->
pData
==
NULL
)
{
tscError
(
"failed to allocated memory, reason:%s"
,
strerror
(
errno
));
tfree
(
dataBuf
);
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
}
memset
(
dataBuf
->
pData
,
0
,
sizeof
(
SSubmitBlk
));
//Here we keep the tableMeta to avoid it to be remove by other threads.
dataBuf
->
pTableMeta
=
tscTableMetaDup
(
pTableMeta
);
SParsedDataColInfo
*
pColInfo
=
&
dataBuf
->
boundColumnInfo
;
SSchema
*
pSchema
=
tscGetTableSchema
(
dataBuf
->
pTableMeta
);
tscSetBoundColumnInfo
(
pColInfo
,
pSchema
,
dataBuf
->
pTableMeta
->
tableInfo
.
numOfColumns
);
dataBuf
->
ordered
=
true
;
dataBuf
->
prevTS
=
INT64_MIN
;
dataBuf
->
rowSize
=
rowSize
;
dataBuf
->
size
=
startOffset
;
dataBuf
->
tsSource
=
-
1
;
dataBuf
->
vgId
=
dataBuf
->
pTableMeta
->
vgId
;
tNameAssign
(
&
dataBuf
->
tableName
,
name
);
assert
(
defaultSize
>
0
&&
pTableMeta
!=
NULL
&&
dataBuf
->
pTableMeta
!=
NULL
);
*
dataBlocks
=
dataBuf
;
return
TSDB_CODE_SUCCESS
;
}
...
...
src/common/inc/tglobal.h
浏览文件 @
f68583e7
...
...
@@ -62,10 +62,11 @@ extern int32_t tsCompressMsgSize;
extern
int32_t
tsMaxNumOfDistinctResults
;
extern
char
tsTempDir
[];
//query buffer management
//
query buffer management
extern
int32_t
tsQueryBufferSize
;
// maximum allowed usage buffer size in MB for each data node during query processing
extern
int64_t
tsQueryBufferSizeBytes
;
// maximum allowed usage buffer size in byte for each data node during query processing
extern
int32_t
tsRetrieveBlockingModel
;
// retrieve threads will be blocked
extern
int64_t
tsQueryBufferSizeBytes
;
// maximum allowed usage buffer size in byte for each data node during query processing
extern
int32_t
tsRetrieveBlockingModel
;
// retrieve threads will be blocked
extern
int8_t
tsKeepOriginalColumnName
;
...
...
@@ -126,6 +127,7 @@ extern int8_t tsHttpEnableCompress;
extern
int8_t
tsHttpEnableRecordSql
;
extern
int8_t
tsTelegrafUseFieldNum
;
extern
int8_t
tsHttpDbNameMandatory
;
extern
int32_t
tsHttpKeepAlive
;
// mqtt
extern
int8_t
tsEnableMqttModule
;
...
...
src/common/src/tdataformat.c
浏览文件 @
f68583e7
...
...
@@ -253,9 +253,10 @@ int dataColAppendVal(SDataCol *pCol, const void *value, int numOfRows, int maxPo
}
if
(
tdAllocMemForCol
(
pCol
,
maxPoints
)
<
0
)
return
-
1
;
if
(
numOfRows
>
0
)
{
if
(((
rowOffset
==
0
)
&&
(
numOfRows
>
0
))
||
((
rowOffset
==
-
1
)
&&
(
numOfRows
>=
0
)))
{
// Find the first not null value, fill all previouse values as NULL
dataColSetNEleNull
(
pCol
,
numOfRows
);
dataColSetNEleNull
(
pCol
,
numOfRows
-
rowOffset
);
}
}
...
...
@@ -463,9 +464,7 @@ static void tdAppendDataRowToDataCol(SDataRow row, STSchema *pSchema, SDataCols
int
rcol
=
0
;
int
dcol
=
0
;
while
(
dcol
<
pCols
->
numOfCols
)
{
bool
setCol
=
0
;
SDataCol
*
pDataCol
=
&
(
pCols
->
cols
[
dcol
]);
if
(
rcol
>=
schemaNCols
(
pSchema
))
{
dataColAppendVal
(
pDataCol
,
getNullValue
(
pDataCol
->
type
),
pCols
->
numOfRows
,
pCols
->
maxPoints
,
rowOffset
);
...
...
@@ -476,14 +475,22 @@ static void tdAppendDataRowToDataCol(SDataRow row, STSchema *pSchema, SDataCols
STColumn
*
pRowCol
=
schemaColAt
(
pSchema
,
rcol
);
if
(
pRowCol
->
colId
==
pDataCol
->
colId
)
{
void
*
value
=
tdGetRowDataOfCol
(
row
,
pRowCol
->
type
,
pRowCol
->
offset
+
TD_DATA_ROW_HEAD_SIZE
);
if
(
!
isNull
(
value
,
pDataCol
->
type
))
setCol
=
1
;
if
(
rowOffset
==
0
)
{
dataColAppendVal
(
pDataCol
,
value
,
pCols
->
numOfRows
,
pCols
->
maxPoints
,
rowOffset
);
}
else
if
(
rowOffset
==
-
1
)
{
// for update 2
if
(
!
isNull
(
value
,
pDataCol
->
type
))
{
dataColAppendVal
(
pDataCol
,
value
,
pCols
->
numOfRows
,
pCols
->
maxPoints
,
rowOffset
);
}
}
else
{
ASSERT
(
0
);
}
dcol
++
;
rcol
++
;
}
else
if
(
pRowCol
->
colId
<
pDataCol
->
colId
)
{
rcol
++
;
}
else
{
if
(
forceSetNull
||
setCol
)
{
if
(
forceSetNull
)
{
dataColAppendVal
(
pDataCol
,
getNullValue
(
pDataCol
->
type
),
pCols
->
numOfRows
,
pCols
->
maxPoints
,
rowOffset
);
}
dcol
++
;
...
...
@@ -501,7 +508,6 @@ static void tdAppendKvRowToDataCol(SKVRow row, STSchema *pSchema, SDataCols *pCo
int
nRowCols
=
kvRowNCols
(
row
);
while
(
dcol
<
pCols
->
numOfCols
)
{
bool
setCol
=
0
;
SDataCol
*
pDataCol
=
&
(
pCols
->
cols
[
dcol
]);
if
(
rcol
>=
nRowCols
||
rcol
>=
schemaNCols
(
pSchema
))
{
dataColAppendVal
(
pDataCol
,
getNullValue
(
pDataCol
->
type
),
pCols
->
numOfRows
,
pCols
->
maxPoints
,
rowOffset
);
...
...
@@ -513,14 +519,22 @@ static void tdAppendKvRowToDataCol(SKVRow row, STSchema *pSchema, SDataCols *pCo
if
(
colIdx
->
colId
==
pDataCol
->
colId
)
{
void
*
value
=
tdGetKvRowDataOfCol
(
row
,
colIdx
->
offset
);
if
(
!
isNull
(
value
,
pDataCol
->
type
))
setCol
=
1
;
if
(
rowOffset
==
0
)
{
dataColAppendVal
(
pDataCol
,
value
,
pCols
->
numOfRows
,
pCols
->
maxPoints
,
rowOffset
);
}
else
if
(
rowOffset
==
-
1
)
{
// for update 2
if
(
!
isNull
(
value
,
pDataCol
->
type
))
{
dataColAppendVal
(
pDataCol
,
value
,
pCols
->
numOfRows
,
pCols
->
maxPoints
,
rowOffset
);
}
}
else
{
ASSERT
(
0
);
}
++
dcol
;
++
rcol
;
}
else
if
(
colIdx
->
colId
<
pDataCol
->
colId
)
{
++
rcol
;
}
else
{
if
(
forceSetNull
||
setCol
)
{
if
(
forceSetNull
)
{
dataColAppendVal
(
pDataCol
,
getNullValue
(
pDataCol
->
type
),
pCols
->
numOfRows
,
pCols
->
maxPoints
,
rowOffset
);
}
++
dcol
;
...
...
src/common/src/tglobal.c
浏览文件 @
f68583e7
...
...
@@ -14,18 +14,18 @@
*/
#define _DEFAULT_SOURCE
#include "tglobal.h"
#include "monitor.h"
#include "os.h"
#include "taosdef.h"
#include "taoserror.h"
#include "t
ulog
.h"
#include "t
compare
.h"
#include "tconfig.h"
#include "tglobal.h"
#include "monitor.h"
#include "tsocket.h"
#include "tutil.h"
#include "tlocale.h"
#include "tsocket.h"
#include "ttimezone.h"
#include "tcompare.h"
#include "tulog.h"
#include "tutil.h"
// TSDB
bool
tsdbForceKeepFile
=
false
;
...
...
@@ -53,7 +53,7 @@ int32_t tsDnodeId = 0;
// common
int32_t
tsRpcTimer
=
300
;
int32_t
tsRpcMaxTime
=
600
;
// seconds;
int32_t
tsRpcForceTcp
=
0
;
//
disable this, means query, show command use udp protocol as default
int32_t
tsRpcForceTcp
=
0
;
//
disable this, means query, show command use udp protocol as default
int32_t
tsMaxShellConns
=
50000
;
int32_t
tsMaxConnections
=
5000
;
int32_t
tsShellActivityTimer
=
3
;
// second
...
...
@@ -102,7 +102,7 @@ int32_t tsMaxStreamComputDelay = 20000;
int32_t
tsStreamCompStartDelay
=
10000
;
// the stream computing delay time after executing failed, change accordingly
int32_t
tsRetryStreamCompDelay
=
10
*
1000
;
int32_t
tsRetryStreamCompDelay
=
10
*
1000
;
// The delayed computing ration. 10% of the whole computing time window by default.
float
tsStreamComputDelayRatio
=
0
.
1
f
;
...
...
@@ -166,6 +166,7 @@ int8_t tsHttpEnableCompress = 1;
int8_t
tsHttpEnableRecordSql
=
0
;
int8_t
tsTelegrafUseFieldNum
=
0
;
int8_t
tsHttpDbNameMandatory
=
0
;
int32_t
tsHttpKeepAlive
=
30000
;
// mqtt
int8_t
tsEnableMqttModule
=
0
;
// not finished yet, not started it by default
...
...
@@ -260,7 +261,8 @@ int8_t tsClientMerge = 0;
//
// lossy compress 6
//
char
lossyColumns
[
32
]
=
""
;
// "float|double" means all float and double columns can be lossy compressed. set empty can close lossy compress.
char
lossyColumns
[
32
]
=
""
;
// "float|double" means all float and double columns can be lossy compressed. set empty
// can close lossy compress.
// below option can take effect when tsLossyColumns not empty
double
fPrecision
=
1E-8
;
// float column precision
double
dPrecision
=
1E-16
;
// double column precision
...
...
@@ -306,7 +308,8 @@ bool taosCfgDynamicOptions(char *msg) {
int32_t
vint
=
0
;
paGetToken
(
msg
,
&
option
,
&
olen
);
if
(
olen
==
0
)
return
false
;;
if
(
olen
==
0
)
return
false
;
;
paGetToken
(
option
+
olen
+
1
,
&
value
,
&
vlen
);
if
(
vlen
==
0
)
...
...
@@ -319,7 +322,7 @@ bool taosCfgDynamicOptions(char *msg) {
for
(
int32_t
i
=
0
;
i
<
tsGlobalConfigNum
;
++
i
)
{
SGlobalCfg
*
cfg
=
tsGlobalConfig
+
i
;
//if (!(cfg->cfgType & TSDB_CFG_CTYPE_B_LOG)) continue;
//
if (!(cfg->cfgType & TSDB_CFG_CTYPE_B_LOG)) continue;
if
(
cfg
->
valType
!=
TAOS_CFG_VTYPE_INT32
&&
cfg
->
valType
!=
TAOS_CFG_VTYPE_INT8
)
continue
;
int32_t
cfgLen
=
(
int32_t
)
strlen
(
cfg
->
option
);
...
...
@@ -407,7 +410,7 @@ static void taosCheckDataDirCfg() {
}
static
int32_t
taosCheckTmpDir
(
void
)
{
if
(
strlen
(
tsTempDir
)
<=
0
){
if
(
strlen
(
tsTempDir
)
<=
0
)
{
uError
(
"tempDir is not set"
);
return
-
1
;
}
...
...
@@ -557,8 +560,8 @@ static void doInitGlobalConfig(void) {
cfg
.
ptr
=
&
tsMaxNumOfDistinctResults
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_SHOW
|
TSDB_CFG_CTYPE_B_CLIENT
;
cfg
.
minValue
=
10
*
10000
;
cfg
.
maxValue
=
10000
*
10000
;
cfg
.
minValue
=
10
*
10000
;
cfg
.
maxValue
=
10000
*
10000
;
cfg
.
ptrLength
=
0
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
...
...
@@ -1280,6 +1283,17 @@ static void doInitGlobalConfig(void) {
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
// pContext in cache
cfg
.
option
=
"httpKeepAlive"
;
cfg
.
ptr
=
&
tsHttpKeepAlive
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
;
cfg
.
minValue
=
3000
;
cfg
.
maxValue
=
3600000
;
cfg
.
ptrLength
=
0
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
// debug flag
cfg
.
option
=
"numOfLogLines"
;
cfg
.
ptr
=
&
tsNumOfLogLines
;
...
...
@@ -1361,7 +1375,6 @@ static void doInitGlobalConfig(void) {
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
cfg
.
option
=
"sdbDebugFlag"
;
cfg
.
ptr
=
&
sdbDebugFlag
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
...
...
@@ -1648,12 +1661,9 @@ static void doInitGlobalConfig(void) {
#else
assert
(
tsGlobalConfigNum
==
TSDB_CFG_MAX_NUM
-
5
);
#endif
}
void
taosInitGlobalCfg
()
{
pthread_once
(
&
tsInitGlobalCfgOnce
,
doInitGlobalConfig
);
}
void
taosInitGlobalCfg
()
{
pthread_once
(
&
tsInitGlobalCfgOnce
,
doInitGlobalConfig
);
}
int32_t
taosCheckGlobalCfg
()
{
char
fqdn
[
TSDB_FQDN_LEN
];
...
...
@@ -1711,8 +1721,8 @@ int32_t taosCheckGlobalCfg() {
}
if
(
tsMaxTablePerVnode
<
tsMinTablePerVnode
)
{
uError
(
"maxTablesPerVnode(%d) < minTablesPerVnode(%d), reset to minTablesPerVnode(%d)"
,
tsMaxTablePerVnode
,
tsMinTablePerVnode
,
tsMinTablePerVnode
);
uError
(
"maxTablesPerVnode(%d) < minTablesPerVnode(%d), reset to minTablesPerVnode(%d)"
,
tsMaxTablePerVnode
,
tsMinTablePerVnode
,
tsMinTablePerVnode
);
tsMaxTablePerVnode
=
tsMinTablePerVnode
;
}
...
...
@@ -1756,7 +1766,7 @@ int taosGetFqdnPortFromEp(const char *ep, char *fqdn, uint16_t *port) {
char
*
temp
=
strchr
(
fqdn
,
':'
);
if
(
temp
)
{
*
temp
=
0
;
*
port
=
atoi
(
temp
+
1
);
*
port
=
atoi
(
temp
+
1
);
}
if
(
*
port
==
0
)
{
...
...
src/connector/jdbc/pom.xml
浏览文件 @
f68583e7
...
...
@@ -112,6 +112,7 @@
<include>
**/*Test.java
</include>
</includes>
<excludes>
<exclude>
**/HttpClientPoolUtilTest.java
</exclude>
<exclude>
**/AppMemoryLeakTest.java
</exclude>
<exclude>
**/ConnectMultiTaosdByRestfulWithDifferentTokenTest.java
</exclude>
<exclude>
**/DatetimeBefore1970Test.java
</exclude>
...
...
src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBErrorNumbers.java
浏览文件 @
f68583e7
...
...
@@ -31,6 +31,8 @@ public class TSDBErrorNumbers {
public
static
final
int
ERROR_RESTFul_Client_IOException
=
0x2318
;
public
static
final
int
ERROR_USER_IS_REQUIRED
=
0x2319
;
// user is required
public
static
final
int
ERROR_PASSWORD_IS_REQUIRED
=
0x231a
;
// password is required
public
static
final
int
ERROR_INVALID_JSON_FORMAT
=
0x231b
;
public
static
final
int
ERROR_HTTP_ENTITY_IS_NULL
=
0x231c
;
//http entity is null
public
static
final
int
ERROR_UNKNOWN
=
0x2350
;
//unknown error
...
...
@@ -72,6 +74,8 @@ public class TSDBErrorNumbers {
errorNumbers
.
add
(
ERROR_RESTFul_Client_IOException
);
errorNumbers
.
add
(
ERROR_USER_IS_REQUIRED
);
errorNumbers
.
add
(
ERROR_PASSWORD_IS_REQUIRED
);
errorNumbers
.
add
(
ERROR_INVALID_JSON_FORMAT
);
errorNumbers
.
add
(
ERROR_HTTP_ENTITY_IS_NULL
);
errorNumbers
.
add
(
ERROR_RESTFul_Client_Protocol_Exception
);
...
...
src/connector/jdbc/src/main/java/com/taosdata/jdbc/utils/HttpClientPoolUtil.java
浏览文件 @
f68583e7
...
...
@@ -5,6 +5,7 @@ import com.taosdata.jdbc.TSDBErrorNumbers;
import
org.apache.http.HeaderElement
;
import
org.apache.http.HeaderElementIterator
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.NoHttpResponseException
;
import
org.apache.http.client.ClientProtocolException
;
import
org.apache.http.client.HttpRequestRetryHandler
;
import
org.apache.http.client.config.RequestConfig
;
...
...
@@ -30,12 +31,12 @@ import java.sql.SQLException;
public
class
HttpClientPoolUtil
{
private
static
final
String
DEFAULT_CONTENT_TYPE
=
"application/json"
;
private
static
final
int
DEFAULT_MAX_TOTAL
=
200
;
private
static
final
int
DEFAULT_MAX_PER_ROUTE
=
20
;
private
static
final
int
DEFAULT_TIME_OUT
=
15000
;
private
static
final
int
DEFAULT_HTTP_KEEP_TIME
=
15000
;
private
static
final
int
DEFAULT_MAX_RETRY_COUNT
=
5
;
private
static
final
int
DEFAULT_MAX_TOTAL
=
50
;
private
static
final
int
DEFAULT_MAX_PER_ROUTE
=
5
;
private
static
final
int
DEFAULT_HTTP_KEEP_TIME
=
-
1
;
private
static
final
ConnectionKeepAliveStrategy
DEFAULT_KEEP_ALIVE_STRATEGY
=
(
response
,
context
)
->
{
HeaderElementIterator
it
=
new
BasicHeaderElementIterator
(
response
.
headerIterator
(
HTTP
.
CONN_KEEP_ALIVE
));
while
(
it
.
hasNext
())
{
...
...
@@ -52,29 +53,19 @@ public class HttpClientPoolUtil {
return
DEFAULT_HTTP_KEEP_TIME
*
1000
;
};
private
static
final
HttpRequestRetryHandler
retryHandler
=
(
exception
,
executionCount
,
httpContext
)
->
{
if
(
executionCount
>=
DEFAULT_MAX_RETRY_COUNT
)
// do not retry if over max retry count
return
false
;
if
(
exception
instanceof
InterruptedIOException
)
// timeout
return
false
;
if
(
exception
instanceof
UnknownHostException
)
// unknown host
return
false
;
if
(
exception
instanceof
SSLException
)
// SSL handshake exception
return
false
;
return
true
;
};
private
static
CloseableHttpClient
httpClient
;
static
{
PoolingHttpClientConnectionManager
connectionManager
=
new
PoolingHttpClientConnectionManager
();
connectionManager
.
setMaxTotal
(
DEFAULT_MAX_TOTAL
);
connectionManager
.
setDefaultMaxPerRoute
(
DEFAULT_MAX_PER_ROUTE
);
httpClient
=
HttpClients
.
custom
().
setKeepAliveStrategy
(
DEFAULT_KEEP_ALIVE_STRATEGY
).
setConnectionManager
(
connectionManager
).
setRetryHandler
(
retryHandler
).
build
();
httpClient
=
HttpClients
.
custom
()
.
setKeepAliveStrategy
(
DEFAULT_KEEP_ALIVE_STRATEGY
)
.
setConnectionManager
(
connectionManager
)
.
setRetryHandler
((
exception
,
executionCount
,
httpContext
)
->
executionCount
<
DEFAULT_MAX_RETRY_COUNT
)
.
build
();
}
/*** execute GET request ***/
...
...
@@ -118,9 +109,10 @@ public class HttpClientPoolUtil {
HttpContext
context
=
HttpClientContext
.
create
();
CloseableHttpResponse
httpResponse
=
httpClient
.
execute
(
method
,
context
);
httpEntity
=
httpResponse
.
getEntity
();
if
(
httpEntity
!
=
null
)
{
responseBody
=
EntityUtils
.
toString
(
httpEntity
,
StandardCharsets
.
UTF_8
);
if
(
httpEntity
=
=
null
)
{
throw
TSDBError
.
createSQLException
(
TSDBErrorNumbers
.
ERROR_HTTP_ENTITY_IS_NULL
,
"httpEntity is null, sql: "
+
data
);
}
responseBody
=
EntityUtils
.
toString
(
httpEntity
,
StandardCharsets
.
UTF_8
);
}
catch
(
ClientProtocolException
e
)
{
e
.
printStackTrace
();
throw
TSDBError
.
createSQLException
(
TSDBErrorNumbers
.
ERROR_RESTFul_Client_Protocol_Exception
,
e
.
getMessage
());
...
...
@@ -139,9 +131,6 @@ public class HttpClientPoolUtil {
private
static
HttpRequestBase
getRequest
(
String
uri
,
String
methodName
)
{
HttpRequestBase
method
;
RequestConfig
requestConfig
=
RequestConfig
.
custom
()
.
setSocketTimeout
(
DEFAULT_TIME_OUT
*
1000
)
.
setConnectTimeout
(
DEFAULT_TIME_OUT
*
1000
)
.
setConnectionRequestTimeout
(
DEFAULT_TIME_OUT
*
1000
)
.
setExpectContinueEnabled
(
false
)
.
build
();
if
(
HttpPut
.
METHOD_NAME
.
equalsIgnoreCase
(
methodName
))
{
...
...
src/connector/jdbc/src/test/java/com/taosdata/jdbc/utils/HttpClientPoolUtilTest.java
0 → 100644
浏览文件 @
f68583e7
package
com.taosdata.jdbc.utils
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.taosdata.jdbc.TSDBDriver
;
import
com.taosdata.jdbc.TSDBError
;
import
org.junit.Test
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLEncoder
;
import
java.nio.charset.StandardCharsets
;
import
java.sql.SQLException
;
import
java.util.List
;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
import
java.util.stream.IntStream
;
public
class
HttpClientPoolUtilTest
{
String
user
=
"root"
;
String
password
=
"taosdata"
;
String
host
=
"127.0.0.1"
;
String
dbname
=
"log"
;
@Test
public
void
test
()
{
// given
List
<
Thread
>
threads
=
IntStream
.
range
(
0
,
4000
).
mapToObj
(
i
->
new
Thread
(()
->
{
useDB
();
// try {
// TimeUnit.SECONDS.sleep(10);
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
})).
collect
(
Collectors
.
toList
());
threads
.
forEach
(
Thread:
:
start
);
for
(
Thread
thread
:
threads
)
{
try
{
thread
.
join
();
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
}
}
private
void
useDB
()
{
try
{
user
=
URLEncoder
.
encode
(
user
,
StandardCharsets
.
UTF_8
.
displayName
());
password
=
URLEncoder
.
encode
(
password
,
StandardCharsets
.
UTF_8
.
displayName
());
String
loginUrl
=
"http://"
+
host
+
":"
+
6041
+
"/rest/login/"
+
user
+
"/"
+
password
+
""
;
String
result
=
HttpClientPoolUtil
.
execute
(
loginUrl
);
JSONObject
jsonResult
=
JSON
.
parseObject
(
result
);
String
status
=
jsonResult
.
getString
(
"status"
);
String
token
=
jsonResult
.
getString
(
"desc"
);
if
(!
status
.
equals
(
"succ"
))
{
throw
new
SQLException
(
jsonResult
.
getString
(
"desc"
));
}
String
url
=
"http://"
+
host
+
":6041/rest/sql"
;
String
sql
=
"use "
+
dbname
;
result
=
HttpClientPoolUtil
.
execute
(
url
,
sql
,
token
);
JSONObject
resultJson
=
JSON
.
parseObject
(
result
);
if
(
resultJson
.
getString
(
"status"
).
equals
(
"error"
))
{
throw
TSDBError
.
createSQLException
(
resultJson
.
getInteger
(
"code"
),
resultJson
.
getString
(
"desc"
));
}
}
catch
(
UnsupportedEncodingException
|
SQLException
e
)
{
e
.
printStackTrace
();
}
}
}
\ No newline at end of file
src/inc/ttokendef.h
浏览文件 @
f68583e7
...
...
@@ -211,6 +211,7 @@
#define TK_INSERT 193
#define TK_INTO 194
#define TK_VALUES 195
#define TK_FILE 196
#define TK_SPACE 300
...
...
@@ -219,7 +220,6 @@
#define TK_HEX 303 // hex number 0x123
#define TK_OCT 304 // oct number
#define TK_BIN 305 // bin format data 0b111
#define TK_FILE 306
#define TK_QUESTION 307 // denoting the placeholder of "?",when invoking statement bind query
#endif
...
...
src/os/src/darwin/dwSysInfo.c
浏览文件 @
f68583e7
...
...
@@ -65,6 +65,8 @@ static void taosGetSystemTimezone() {
struct
tm
tm1
;
localtime_r
(
&
tx1
,
&
tm1
);
tsDaylight
=
daylight
;
/*
* format example:
*
...
...
src/os/src/detail/osSysinfo.c
浏览文件 @
f68583e7
...
...
@@ -213,6 +213,8 @@ static void taosGetSystemTimezone() {
int32_t
tz
=
(
-
timezone
*
MILLISECOND_PER_SECOND
)
/
MILLISECOND_PER_HOUR
;
tz
+=
daylight
;
tsDaylight
=
daylight
;
/*
* format example:
*
...
...
src/os/src/windows/wSysinfo.c
浏览文件 @
f68583e7
...
...
@@ -91,6 +91,17 @@ static void taosGetSystemTimezone() {
strcpy
(
tsTimezone
,
tz
);
}
cfg_timezone
->
cfgStatus
=
TAOS_CFG_CSTATUS_DEFAULT
;
#ifdef _MSC_VER
#if _MSC_VER >= 1900
int64_t
timezone
=
_timezone
;
int32_t
daylight
=
_daylight
;
char
**
tzname
=
_tzname
;
#endif
#endif
tsDaylight
=
daylight
;
uInfo
(
"timezone not configured, use default"
);
}
}
...
...
src/plugins/http/inc/httpInt.h
浏览文件 @
f68583e7
...
...
@@ -154,12 +154,13 @@ typedef struct HttpContext {
char
db
[
/*TSDB_ACCT_ID_LEN + */
TSDB_DB_NAME_LEN
];
TAOS
*
taos
;
void
*
ppContext
;
pthread_mutex_t
ctxMutex
;
HttpSession
*
session
;
z_stream
gzipStream
;
HttpParser
*
parser
;
HttpSqlCmd
singleCmd
;
HttpSqlCmds
*
multiCmds
;
JsonBuf
*
jsonBuf
;
JsonBuf
*
jsonBuf
;
HttpEncodeMethod
*
encodeMethod
;
HttpDecodeMethod
*
decodeMethod
;
struct
HttpThread
*
pThread
;
...
...
src/plugins/http/src/httpContext.c
浏览文件 @
f68583e7
...
...
@@ -67,6 +67,8 @@ static void httpDestroyContext(void *data) {
pContext
->
parser
=
NULL
;
}
pthread_mutex_destroy
(
&
pContext
->
ctxMutex
);
tfree
(
pContext
);
}
...
...
@@ -121,13 +123,15 @@ HttpContext *httpCreateContext(SOCKET fd) {
TSDB_CACHE_PTR_TYPE
handleVal
=
(
TSDB_CACHE_PTR_TYPE
)
pContext
;
HttpContext
**
ppContext
=
taosCachePut
(
tsHttpServer
.
contextCache
,
&
handleVal
,
sizeof
(
TSDB_CACHE_PTR_TYPE
),
&
pContext
,
sizeof
(
TSDB_CACHE_PTR_TYPE
),
3000
);
sizeof
(
TSDB_CACHE_PTR_TYPE
),
tsHttpKeepAlive
);
pContext
->
ppContext
=
ppContext
;
httpDebug
(
"context:%p, fd:%d, is created, data:%p"
,
pContext
,
fd
,
ppContext
);
// set the ref to 0
taosCacheRelease
(
tsHttpServer
.
contextCache
,
(
void
**
)
&
ppContext
,
false
);
pthread_mutex_init
(
&
pContext
->
ctxMutex
,
NULL
);
return
pContext
;
}
...
...
src/plugins/http/src/httpHandle.c
浏览文件 @
f68583e7
...
...
@@ -45,15 +45,14 @@ bool httpProcessData(HttpContext* pContext) {
httpTrace
(
"context:%p, fd:%d, process options request"
,
pContext
,
pContext
->
fd
);
httpSendOptionResp
(
pContext
,
"process options request success"
);
}
else
{
if
(
!
httpDecodeRequest
(
pContext
))
{
/*
* httpCloseContextByApp has been called when parsing the error
*/
// httpCloseContextByApp(pContext);
}
else
{
pthread_mutex_lock
(
&
pContext
->
ctxMutex
);
if
(
httpDecodeRequest
(
pContext
))
{
httpClearParser
(
pContext
->
parser
);
httpProcessRequest
(
pContext
);
}
pthread_mutex_unlock
(
&
pContext
->
ctxMutex
);
}
return
true
;
...
...
src/plugins/http/src/httpSql.c
浏览文件 @
f68583e7
...
...
@@ -406,7 +406,14 @@ void httpProcessRequestCb(void *param, TAOS_RES *result, int32_t code) {
if
(
pContext
->
session
==
NULL
)
{
httpSendErrorResp
(
pContext
,
TSDB_CODE_HTTP_SESSION_FULL
);
}
else
{
// httpProcessRequestCb called by another thread and a subsequent thread calls this
// function again, if this function called by httpProcessRequestCb executes memset
// just before the subsequent thread executes *Cmd function, nativSql will be NULL
pthread_mutex_lock
(
&
pContext
->
ctxMutex
);
httpExecCmd
(
pContext
);
pthread_mutex_unlock
(
&
pContext
->
ctxMutex
);
}
}
...
...
src/query/inc/qExecutor.h
浏览文件 @
f68583e7
...
...
@@ -43,6 +43,8 @@ typedef int32_t (*__block_search_fn_t)(char* data, int32_t num, int64_t key, int
#define GET_NUM_OF_RESULTS(_r) (((_r)->outputBuf) == NULL? 0:((_r)->outputBuf)->info.rows)
#define RESET_NUM_OF_RESULTS(_r) (((_r)->outputBuf) == NULL? 0:(((_r)->outputBuf)->info.rows = 0))
enum
{
// when query starts to execute, this status will set
QUERY_NOT_COMPLETED
=
0x1u
,
...
...
@@ -389,6 +391,7 @@ typedef struct SQInfo {
int32_t
dataReady
;
// denote if query result is ready or not
void
*
rspContext
;
// response context
int64_t
startExecTs
;
// start to exec timestamp
int64_t
lastRetrieveTs
;
// last retrieve timestamp
char
*
sql
;
// query sql string
SQueryCostInfo
summary
;
}
SQInfo
;
...
...
src/query/inc/sql.y
浏览文件 @
f68583e7
...
...
@@ -913,4 +913,4 @@ cmd ::= KILL QUERY INTEGER(X) COLON(Z) INTEGER(Y). {X.n += (Z.n + Y.n); s
%fallback ID ABORT AFTER ASC ATTACH BEFORE BEGIN CASCADE CLUSTER CONFLICT COPY DATABASE DEFERRED
DELIMITERS DESC DETACH EACH END EXPLAIN FAIL FOR GLOB IGNORE IMMEDIATE INITIALLY INSTEAD
LIKE MATCH KEY OF OFFSET RAISE REPLACE RESTRICT ROW STATEMENT TRIGGER VIEW ALL
NOW IPTOKEN SEMI NONE PREV LINEAR IMPORT TBNAME JOIN STABLE NULL INSERT INTO VALUES.
NOW IPTOKEN SEMI NONE PREV LINEAR IMPORT TBNAME JOIN STABLE NULL INSERT INTO VALUES
FILE
.
src/query/src/qAggMain.c
浏览文件 @
f68583e7
...
...
@@ -758,7 +758,7 @@ static int32_t lastDistFuncRequired(SQLFunctionCtx *pCtx, STimeWindow* w, int32_
if
(
pInfo
->
hasResult
!=
DATA_SET_FLAG
)
{
return
BLK_DATA_ALL_NEEDED
;
}
else
{
return
(
pInfo
->
ts
>
w
->
ekey
)
?
BLK_DATA_NO_NEEDED
:
BLK_DATA_ALL_NEEDED
;
return
(
pInfo
->
ts
>
=
w
->
ekey
)
?
BLK_DATA_NO_NEEDED
:
BLK_DATA_ALL_NEEDED
;
}
}
...
...
src/query/src/qExecutor.c
浏览文件 @
f68583e7
...
...
@@ -2430,11 +2430,11 @@ bool isQueryKilled(SQInfo *pQInfo) {
// query has been executed more than tsShellActivityTimer, and the retrieve has not arrived
// abort current query execution.
if
(
pQInfo
->
owner
!=
0
&&
((
taosGetTimestampSec
()
-
pQInfo
->
startExecTs
)
>
getMaximumIdleDurationSec
())
&&
if
(
pQInfo
->
owner
!=
0
&&
((
taosGetTimestampSec
()
-
pQInfo
->
lastRetrieveTs
/
1000
)
>
getMaximumIdleDurationSec
())
&&
(
!
needBuildResAfterQueryComplete
(
pQInfo
)))
{
assert
(
pQInfo
->
startExecTs
!=
0
);
qDebug
(
"QInfo:%"
PRIu64
" retrieve not arrive beyond %d
sec
, abort current query execution, start:%"
PRId64
qDebug
(
"QInfo:%"
PRIu64
" retrieve not arrive beyond %d
ms
, abort current query execution, start:%"
PRId64
", current:%d"
,
pQInfo
->
qId
,
1
,
pQInfo
->
startExecTs
,
taosGetTimestampSec
());
return
true
;
}
...
...
src/query/src/queryMain.c
浏览文件 @
f68583e7
...
...
@@ -213,7 +213,10 @@ bool qTableQuery(qinfo_t qinfo, uint64_t *qId) {
}
*
qId
=
pQInfo
->
qId
;
pQInfo
->
startExecTs
=
taosGetTimestampSec
();
if
(
pQInfo
->
startExecTs
==
0
)
{
pQInfo
->
startExecTs
=
taosGetTimestampMs
();
pQInfo
->
lastRetrieveTs
=
pQInfo
->
startExecTs
;
}
if
(
isQueryKilled
(
pQInfo
))
{
qDebug
(
"QInfo:0x%"
PRIx64
" it is already killed, abort"
,
pQInfo
->
qId
);
...
...
src/query/src/sql.c
浏览文件 @
f68583e7
...
...
@@ -100,29 +100,29 @@
#endif
/************* Begin control #defines *****************************************/
#define YYCODETYPE unsigned short int
#define YYNOCODE 27
7
#define YYNOCODE 27
8
#define YYACTIONTYPE unsigned short int
#define ParseTOKENTYPE SStrToken
typedef
union
{
int
yyinit
;
ParseTOKENTYPE
yy0
;
S
CreateTableSql
*
yy56
;
int
yy7
0
;
S
CreatedTableInfo
yy84
;
S
RelationInfo
*
yy114
;
int
32_t
yy202
;
SIntervalVal
yy222
;
SS
qlNode
*
yy224
;
SCreate
DbInfo
yy246
;
tSqlExpr
*
yy260
;
TAOS_FIELD
yy363
;
SSessionWindowVal
yy365
;
SCreateAcctInfo
yy377
;
int64_t
yy387
;
SArray
*
yy4
03
;
SLimitVal
yy404
;
tVariant
yy48
8
;
SWindowStateVal
yy544
;
S
RelationInfo
*
yy8
;
SWindowStateVal
yy4
0
;
S
SqlNode
*
yy56
;
S
CreateDbInfo
yy90
;
int
yy96
;
int32_t
yy104
;
SS
essionWindowVal
yy147
;
SCreate
dTableInfo
yy152
;
SLimitVal
yy166
;
SCreateAcctInfo
yy171
;
TAOS_FIELD
yy183
;
int64_t
yy325
;
SIntervalVal
yy400
;
SArray
*
yy4
21
;
tVariant
yy430
;
SCreateTableSql
*
yy43
8
;
tSqlExpr
*
yy439
;
}
YYMINORTYPE
;
#ifndef YYSTACKDEPTH
#define YYSTACKDEPTH 100
...
...
@@ -140,7 +140,7 @@ typedef union {
#define YYFALLBACK 1
#define YYNSTATE 363
#define YYNRULE 291
#define YYNTOKEN 19
6
#define YYNTOKEN 19
7
#define YY_MAX_SHIFT 362
#define YY_MIN_SHIFTREDUCE 571
#define YY_MAX_SHIFTREDUCE 861
...
...
@@ -230,167 +230,167 @@ static const YYACTIONTYPE yy_action[] = {
/* 100 */
51
,
1014
,
60
,
318
,
65
,
63
,
66
,
64
,
1131
,
1081
,
/* 110 */
271
,
290
,
56
,
55
,
316
,
1080
,
54
,
53
,
52
,
57
,
/* 120 */
59
,
243
,
61
,
62
,
1008
,
1020
,
249
,
51
,
95
,
60
,
/* 130 */
318
,
65
,
63
,
66
,
64
,
45
,
800
,
23
,
1033
,
56
,
/* 140 */
55
,
160
,
348
,
54
,
53
,
52
,
58
,
242
,
61
,
62
,
/* 130 */
318
,
65
,
63
,
66
,
64
,
45
,
800
,
348
,
1033
,
56
,
/* 140 */
55
,
160
,
1019
,
54
,
53
,
52
,
58
,
242
,
61
,
62
,
/* 150 */
765
,
766
,
249
,
51
,
233
,
60
,
318
,
65
,
63
,
66
,
/* 160 */
64
,
1003
,
1004
,
35
,
1007
,
56
,
55
,
316
,
245
,
54
,
/* 170 */
53
,
52
,
44
,
314
,
355
,
354
,
313
,
312
,
311
,
353
,
/* 180 */
310
,
309
,
308
,
352
,
307
,
351
,
350
,
982
,
970
,
971
,
/* 190 */
972
,
973
,
974
,
975
,
976
,
977
,
978
,
979
,
980
,
981
,
/* 200 */
983
,
984
,
61
,
62
,
24
,
204
,
249
,
51
,
263
,
60
,
/* 210 */
318
,
65
,
63
,
66
,
64
,
92
,
7
4
,
267
,
266
,
56
,
/* 220 */
55
,
258
,
210
,
54
,
53
,
52
,
248
,
815
,
207
,
216
,
/* 230 */
804
,
174
,
807
,
123
,
810
,
137
,
136
,
135
,
215
,
1132
,
/* 240 */
248
,
815
,
323
,
86
,
804
,
348
,
807
,
160
,
810
,
250
,
/* 250 */
913
,
205
,
65
,
63
,
66
,
64
,
75
,
188
,
227
,
228
,
/* 260 */
56
,
55
,
319
,
9
2
3
,
54
,
53
,
52
,
5
,
41
,
178
,
/* 200 */
983
,
984
,
61
,
62
,
24
,
23
,
249
,
51
,
263
,
60
,
/* 210 */
318
,
65
,
63
,
66
,
64
,
92
,
7
9
,
267
,
266
,
56
,
/* 220 */
55
,
123
,
210
,
54
,
53
,
52
,
248
,
815
,
207
,
216
,
/* 230 */
804
,
93
,
807
,
348
,
810
,
137
,
136
,
135
,
215
,
1132
,
/* 240 */
248
,
815
,
323
,
86
,
804
,
81
,
807
,
258
,
810
,
250
,
/* 250 */
1005
,
204
,
65
,
63
,
66
,
64
,
160
,
174
,
227
,
228
,
/* 260 */
56
,
55
,
319
,
9
1
3
,
54
,
53
,
52
,
5
,
41
,
178
,
/* 270 */
188
,
622
,
227
,
228
,
177
,
104
,
109
,
100
,
108
,
623
,
/* 280 */
45
,
730
,
356
,
951
,
727
,
38
,
728
,
38
,
729
,
121
,
/* 290 */
115
,
126
,
252
,
303
,
38
,
806
,
125
,
809
,
131
,
134
,
/* 300 */
124
,
805
,
270
,
808
,
78
,
257
,
38
,
128
,
67
,
207
,
/* 310 */
211
,
223
,
254
,
255
,
3
,
189
,
198
,
196
,
194
,
292
,
/* 320 */
1132
,
91
,
67
,
193
,
141
,
140
,
139
,
138
,
1128
,
239
,
/* 330 */
38
,
240
,
38
,
1017
,
44
,
1017
,
355
,
354
,
327
,
25
8
,
/* 340 */
38
,
353
,
1017
,
816
,
811
,
352
,
38
,
351
,
350
,
175
,
/* 350 */
812
,
746
,
38
,
29
,
1016
,
38
,
743
,
816
,
811
,
1127
,
/* 360 */
38
,
56
,
55
,
706
,
812
,
54
,
53
,
52
,
253
,
25
8
,
/* 370 */
251
,
14
,
326
,
325
,
328
,
94
,
329
,
782
,
1017
,
1018
,
/* 380 */
1017
,
259
,
9
,
256
,
330
,
333
,
332
,
272
,
1017
,
79
,
/* 390 */
3
34
,
338
,
337
,
93
,
1017
,
914
,
335
,
731
,
732
,
336
,
/* 400 */
1017
,
39
,
188
,
1017
,
340
,
97
,
83
,
81
,
1017
,
54
,
/* 410 */
53
,
52
,
359
,
358
,
599
,
813
,
151
,
149
,
148
,
1
,
/* 420 */
176
,
814
,
84
,
1005
,
762
,
772
,
773
,
716
,
71
,
802
,
/* 430 */
247
,
295
,
718
,
297
,
781
,
717
,
836
,
750
,
155
,
68
,
/* 440 */
26
,
39
,
34
,
274
,
320
,
39
,
68
,
96
,
817
,
68
,
/* 450 */
25
,
16
,
6
,
15
,
621
,
114
,
18
,
113
,
17
,
274
,
/* 460 */
77
,
735
,
25
,
736
,
733
,
803
,
734
,
20
,
25
,
19
,
/* 470 */
72
,
120
,
22
,
119
,
21
,
298
,
133
,
132
,
1126
,
225
,
/* 480 */
226
,
208
,
209
,
212
,
206
,
213
,
214
,
218
,
1019
,
219
,
/* 490 */
1151
,
1143
,
705
,
220
,
217
,
203
,
268
,
1091
,
1090
,
237
,
/* 500 */
1087
,
1086
,
238
,
339
,
170
,
152
,
1041
,
1052
,
48
,
150
,
/* 510 */
1049
,
1050
,
1034
,
275
,
1054
,
154
,
159
,
286
,
1015
,
1073
,
/* 520 */
1072
,
279
,
171
,
1013
,
234
,
281
,
172
,
163
,
173
,
1031
,
/* 530 */
928
,
300
,
301
,
302
,
305
,
306
,
46
,
761
,
201
,
16
2
,
/* 540 */
283
,
161
,
293
,
42
,
317
,
165
,
76
,
819
,
291
,
922
,
/* 550 */
73
,
50
,
164
,
324
,
1150
,
111
,
1149
,
289
,
285
,
1146
,
/* 560 */
179
,
331
,
1142
,
287
,
117
,
1141
,
1138
,
180
,
166
,
28
2
,
/* 570 */
948
,
33
,
43
,
40
,
47
,
202
,
49
,
910
,
127
,
908
,
/* 580 */
129
,
130
,
906
,
905
,
260
,
191
,
192
,
902
,
901
,
900
,
/* 590 */
899
,
898
,
897
,
896
,
195
,
197
,
304
,
892
,
890
,
888
,
/* 600 */
199
,
885
,
200
,
349
,
273
,
82
,
87
,
284
,
1074
,
122
,
/* 610 */
34
1
,
342
,
343
,
344
,
345
,
346
,
347
,
224
,
244
,
299
,
/* 620 */
357
,
861
,
261
,
262
,
221
,
222
,
860
,
264
,
265
,
105
,
/* 630 */
927
,
926
,
106
,
859
,
842
,
269
,
841
,
274
,
294
,
10
,
/* 640 */
276
,
738
,
85
,
88
,
904
,
903
,
30
,
142
,
187
,
182
,
/* 650 */
949
,
181
,
183
,
184
,
185
,
143
,
186
,
895
,
894
,
986
,
/* 660 */
2
,
144
,
145
,
887
,
950
,
886
,
4
,
763
,
167
,
168
,
/* 670 */
1
56
,
158
,
774
,
157
,
236
,
768
,
89
,
31
,
77
0
,
996
,
/* 680 */
90
,
288
,
11
,
32
,
12
,
13
,
27
,
296
,
28
,
97
,
/* 290 */
115
,
126
,
252
,
303
,
38
,
16
,
125
,
15
,
131
,
134
,
/* 300 */
124
,
205
,
270
,
38
,
78
,
257
,
782
,
128
,
67
,
207
,
/* 310 */
746
,
223
,
254
,
255
,
3
,
189
,
198
,
196
,
194
,
806
,
/* 320 */
1132
,
809
,
67
,
193
,
141
,
140
,
139
,
138
,
292
,
239
,
/* 330 */
91
,
240
,
923
,
1017
,
44
,
1017
,
355
,
354
,
327
,
18
8
,
/* 340 */
38
,
353
,
1017
,
816
,
811
,
352
,
38
,
351
,
350
,
706
,
/* 350 */
812
,
1016
,
805
,
29
,
808
,
211
,
38
,
816
,
811
,
38
,
/* 360 */
1091
,
56
,
55
,
781
,
812
,
54
,
53
,
52
,
253
,
3
8
,
/* 370 */
251
,
38
,
326
,
325
,
38
,
14
,
1128
,
338
,
337
,
94
,
/* 380 */
914
,
259
,
743
,
256
,
328
,
333
,
332
,
188
,
1017
,
258
,
/* 390 */
3
29
,
54
,
53
,
52
,
1017
,
258
,
750
,
731
,
732
,
175
,
/* 400 */
330
,
1
,
176
,
334
,
1017
,
1018
,
272
,
1017
,
9
,
97
,
/* 410 */
83
,
84
,
34
,
335
,
71
,
336
,
762
,
1017
,
340
,
1017
,
/* 420 */
39
,
772
,
1017
,
359
,
358
,
599
,
151
,
149
,
148
,
773
,
/* 430 */
155
,
74
,
716
,
802
,
320
,
68
,
295
,
718
,
77
,
813
,
/* 440 */
247
,
133
,
132
,
26
,
297
,
298
,
39
,
274
,
274
,
717
,
/* 450 */
39
,
68
,
836
,
817
,
621
,
114
,
72
,
113
,
96
,
18
,
/* 460 */
1127
,
17
,
6
,
68
,
1126
,
225
,
25
,
25
,
25
,
803
,
/* 470 */
705
,
75
,
814
,
735
,
733
,
736
,
734
,
20
,
226
,
19
,
/* 480 */
120
,
22
,
119
,
21
,
208
,
209
,
212
,
206
,
213
,
1151
,
/* 490 */
214
,
1143
,
1034
,
1090
,
218
,
237
,
219
,
220
,
217
,
203
,
/* 500 */
1087
,
1086
,
238
,
339
,
268
,
152
,
1041
,
1052
,
48
,
1073
,
/* 510 */
1049
,
1050
,
275
,
1072
,
1015
,
1054
,
150
,
154
,
159
,
286
,
/* 520 */
170
,
171
,
279
,
1013
,
172
,
173
,
162
,
234
,
281
,
283
,
/* 530 */
928
,
163
,
165
,
1031
,
761
,
161
,
300
,
819
,
301
,
30
2
,
/* 540 */
305
,
306
,
46
,
201
,
293
,
164
,
42
,
289
,
291
,
317
,
/* 550 */
922
,
324
,
76
,
73
,
50
,
287
,
1150
,
166
,
111
,
1149
,
/* 560 */
282
,
1146
,
285
,
167
,
179
,
49
,
331
,
1142
,
304
,
12
2
,
/* 570 */
349
,
117
,
1141
,
1138
,
180
,
948
,
43
,
40
,
47
,
341
,
/* 580 */
202
,
910
,
127
,
908
,
129
,
130
,
906
,
905
,
260
,
191
,
/* 590 */
192
,
902
,
901
,
900
,
899
,
898
,
897
,
896
,
195
,
197
,
/* 600 */
892
,
890
,
888
,
199
,
885
,
200
,
342
,
273
,
82
,
87
,
/* 610 */
34
3
,
284
,
1074
,
344
,
345
,
346
,
347
,
357
,
861
,
261
,
/* 620 */
262
,
860
,
224
,
244
,
299
,
264
,
265
,
859
,
842
,
841
,
/* 630 */
269
,
274
,
221
,
10
,
85
,
294
,
927
,
105
,
926
,
222
,
/* 640 */
106
,
738
,
276
,
30
,
88
,
763
,
904
,
156
,
903
,
774
,
/* 650 */
142
,
143
,
895
,
183
,
182
,
949
,
181
,
184
,
185
,
187
,
/* 660 */
186
,
144
,
894
,
887
,
950
,
145
,
986
,
886
,
2
,
157
,
/* 670 */
1
68
,
768
,
33
,
4
,
158
,
89
,
236
,
770
,
9
0
,
996
,
/* 680 */
288
,
31
,
11
,
32
,
12
,
13
,
27
,
296
,
28
,
97
,
/* 690 */
99
,
102
,
36
,
101
,
636
,
37
,
103
,
671
,
669
,
668
,
/* 700 */
667
,
665
,
664
,
663
,
660
,
626
,
315
,
7
,
107
,
818
,
/* 710 */
8
20
,
321
,
322
,
8
,
110
,
112
,
69
,
70
,
116
,
708
,
/* 720 */
39
,
707
,
118
,
704
,
652
,
650
,
642
,
648
,
644
,
646
,
/* 700 */
667
,
665
,
664
,
663
,
660
,
626
,
315
,
107
,
7
,
820
,
/* 710 */
8
18
,
321
,
8
,
322
,
110
,
112
,
69
,
70
,
116
,
708
,
/* 720 */
707
,
39
,
118
,
704
,
652
,
650
,
642
,
648
,
644
,
646
,
/* 730 */
640
,
638
,
674
,
673
,
672
,
670
,
666
,
662
,
661
,
190
,
/* 740 */
624
,
589
,
587
,
865
,
864
,
864
,
864
,
864
,
864
,
864
,
/* 740 */
589
,
624
,
587
,
865
,
864
,
864
,
864
,
864
,
864
,
864
,
/* 750 */
864
,
864
,
864
,
864
,
864
,
146
,
147
,
};
static
const
YYCODETYPE
yy_lookahead
[]
=
{
/* 0 */
25
2
,
1
,
244
,
1
,
198
,
199
,
248
,
199
,
244
,
9
,
/* 10 */
20
5
,
9
,
248
,
13
,
14
,
199
,
16
,
17
,
270
,
199
,
/* 20 */
20
,
21
,
1
,
23
,
24
,
25
,
26
,
27
,
28
,
22
2
,
/* 30 */
9
,
22
4
,
225
,
33
,
34
,
199
,
229
,
37
,
38
,
39
,
/* 40 */
23
3
,
199
,
235
,
236
,
196
,
197
,
246
,
45
,
46
,
47
,
/* 0 */
25
3
,
1
,
245
,
1
,
199
,
200
,
249
,
200
,
245
,
9
,
/* 10 */
20
6
,
9
,
249
,
13
,
14
,
200
,
16
,
17
,
271
,
200
,
/* 20 */
20
,
21
,
1
,
23
,
24
,
25
,
26
,
27
,
28
,
22
3
,
/* 30 */
9
,
22
5
,
226
,
33
,
34
,
200
,
230
,
37
,
38
,
39
,
/* 40 */
23
4
,
200
,
236
,
237
,
197
,
198
,
247
,
45
,
46
,
47
,
/* 50 */
48
,
49
,
50
,
51
,
52
,
53
,
54
,
55
,
56
,
57
,
/* 60 */
58
,
59
,
26
2
,
243
,
62
,
13
,
14
,
247
,
16
,
17
,
/* 70 */
26
5
,
5
,
20
,
21
,
266
,
23
,
24
,
25
,
26
,
27
,
/* 80 */
28
,
27
6
,
0
,
267
,
268
,
33
,
34
,
87
,
206
,
37
,
/* 90 */
38
,
39
,
13
,
14
,
24
6
,
16
,
17
,
265
,
83
,
20
,
/* 100 */
21
,
199
,
23
,
24
,
25
,
26
,
27
,
28
,
276
,
273
,
/* 110 */
26
2
,
275
,
33
,
34
,
85
,
273
,
37
,
38
,
39
,
13
,
/* 120 */
14
,
24
4
,
16
,
17
,
242
,
248
,
20
,
21
,
206
,
23
,
/* 130 */
24
,
25
,
26
,
27
,
28
,
120
,
84
,
265
,
246
,
33
,
/* 140 */
34
,
199
,
91
,
37
,
38
,
39
,
14
,
245
,
16
,
17
,
/* 150 */
126
,
127
,
20
,
21
,
26
2
,
23
,
24
,
25
,
26
,
27
,
/* 160 */
28
,
2
39
,
240
,
241
,
242
,
33
,
34
,
85
,
205
,
37
,
/* 60 */
58
,
59
,
26
3
,
244
,
62
,
13
,
14
,
248
,
16
,
17
,
/* 70 */
26
6
,
5
,
20
,
21
,
267
,
23
,
24
,
25
,
26
,
27
,
/* 80 */
28
,
27
7
,
0
,
268
,
269
,
33
,
34
,
87
,
207
,
37
,
/* 90 */
38
,
39
,
13
,
14
,
24
7
,
16
,
17
,
266
,
83
,
20
,
/* 100 */
21
,
200
,
23
,
24
,
25
,
26
,
27
,
28
,
277
,
274
,
/* 110 */
26
3
,
276
,
33
,
34
,
85
,
274
,
37
,
38
,
39
,
13
,
/* 120 */
14
,
24
5
,
16
,
17
,
243
,
249
,
20
,
21
,
207
,
23
,
/* 130 */
24
,
25
,
26
,
27
,
28
,
120
,
84
,
91
,
247
,
33
,
/* 140 */
34
,
200
,
249
,
37
,
38
,
39
,
14
,
246
,
16
,
17
,
/* 150 */
126
,
127
,
20
,
21
,
26
3
,
23
,
24
,
25
,
26
,
27
,
/* 160 */
28
,
2
40
,
241
,
242
,
243
,
33
,
34
,
85
,
206
,
37
,
/* 170 */
38
,
39
,
99
,
100
,
101
,
102
,
103
,
104
,
105
,
106
,
/* 180 */
107
,
108
,
109
,
110
,
111
,
112
,
113
,
22
2
,
223
,
224
,
/* 190 */
22
5
,
226
,
227
,
228
,
229
,
230
,
231
,
232
,
233
,
234
,
/* 200 */
23
5
,
236
,
16
,
17
,
44
,
265
,
20
,
21
,
143
,
23
,
/* 210 */
24
,
25
,
26
,
27
,
28
,
27
3
,
98
,
152
,
153
,
33
,
/* 220 */
34
,
199
,
62
,
37
,
38
,
39
,
1
,
2
,
265
,
69
,
/* 230 */
5
,
2
09
,
7
,
79
,
9
,
75
,
76
,
77
,
78
,
276
,
/* 240 */
1
,
2
,
82
,
83
,
5
,
91
,
7
,
199
,
9
,
205
,
/* 250 */
2
04
,
265
,
25
,
26
,
27
,
28
,
138
,
211
,
33
,
34
,
/* 260 */
33
,
34
,
37
,
20
4
,
37
,
38
,
39
,
63
,
64
,
65
,
/* 270 */
21
1
,
1
,
33
,
34
,
70
,
71
,
72
,
73
,
74
,
9
,
/* 280 */
120
,
2
,
22
0
,
221
,
5
,
199
,
7
,
199
,
9
,
63
,
/* 290 */
64
,
65
,
69
,
89
,
199
,
5
,
70
,
7
,
72
,
73
,
/* 300 */
74
,
5
,
142
,
7
,
144
,
69
,
199
,
81
,
83
,
265
,
/* 310 */
265
,
151
,
33
,
34
,
202
,
203
,
63
,
64
,
65
,
271
,
/* 320 */
27
6
,
273
,
83
,
70
,
71
,
72
,
73
,
74
,
265
,
243
,
/* 330 */
199
,
243
,
199
,
247
,
99
,
247
,
101
,
102
,
243
,
199
,
/* 340 */
199
,
106
,
247
,
118
,
119
,
110
,
199
,
112
,
113
,
209
,
/* 350 */
125
,
37
,
199
,
83
,
247
,
199
,
98
,
118
,
119
,
265
,
/* 360 */
199
,
33
,
34
,
5
,
125
,
37
,
38
,
39
,
145
,
199
,
/* 370 */
147
,
83
,
149
,
150
,
243
,
87
,
243
,
77
,
247
,
209
,
/* 380 */
2
47
,
145
,
124
,
147
,
243
,
149
,
150
,
84
,
247
,
206
,
/* 390 */
24
3
,
33
,
34
,
249
,
247
,
204
,
243
,
118
,
119
,
243
,
/* 400 */
24
7
,
98
,
211
,
247
,
243
,
117
,
84
,
263
,
247
,
3
7
,
/* 410 */
38
,
39
,
66
,
67
,
68
,
125
,
63
,
64
,
65
,
207
,
/* 420 */
208
,
125
,
84
,
240
,
84
,
84
,
84
,
84
,
98
,
1
,
/* 430 */
61
,
84
,
84
,
84
,
134
,
84
,
84
,
123
,
98
,
98
,
/* 440 */
98
,
98
,
83
,
121
,
15
,
98
,
98
,
98
,
84
,
98
,
/* 450 */
98
,
146
,
83
,
148
,
84
,
146
,
146
,
148
,
148
,
121
,
/* 460 */
83
,
5
,
98
,
7
,
5
,
37
,
7
,
146
,
98
,
148
,
/* 470 */
1
40
,
146
,
146
,
148
,
148
,
116
,
79
,
80
,
265
,
265
,
/* 480 */
265
,
265
,
265
,
265
,
265
,
265
,
265
,
265
,
248
,
265
,
/* 490 */
2
48
,
248
,
115
,
265
,
265
,
265
,
199
,
238
,
238
,
238
,
/* 500 */
23
8
,
238
,
238
,
238
,
250
,
199
,
199
,
199
,
264
,
61
,
/* 510 */
199
,
199
,
246
,
246
,
199
,
199
,
199
,
199
,
246
,
274
,
/* 520 */
2
74
,
269
,
199
,
199
,
269
,
269
,
199
,
258
,
199
,
261
,
/* 530 */
199
,
199
,
199
,
199
,
199
,
199
,
199
,
125
,
199
,
259
,
/* 540 */
2
69
,
260
,
132
,
199
,
199
,
256
,
137
,
118
,
135
,
199
,
/* 550 */
139
,
136
,
257
,
199
,
199
,
199
,
199
,
130
,
128
,
199
,
/* 560 */
1
99
,
199
,
199
,
129
,
199
,
199
,
199
,
199
,
255
,
131
,
/* 570 */
1
99
,
251
,
199
,
199
,
199
,
199
,
141
,
199
,
199
,
199
,
/* 580 */
199
,
199
,
199
,
199
,
199
,
199
,
199
,
199
,
199
,
199
,
/* 590 */
199
,
199
,
199
,
199
,
199
,
199
,
90
,
199
,
199
,
199
,
/* 600 */
199
,
199
,
199
,
114
,
200
,
200
,
200
,
200
,
200
,
97
,
/* 610 */
9
6
,
51
,
93
,
95
,
55
,
94
,
92
,
200
,
200
,
200
,
/* 620 */
85
,
5
,
154
,
5
,
200
,
200
,
5
,
154
,
5
,
206
,
/* 630 */
210
,
210
,
206
,
5
,
101
,
143
,
100
,
121
,
116
,
83
,
/* 640 */
98
,
84
,
122
,
98
,
200
,
200
,
83
,
201
,
212
,
217
,
/* 650 */
2
19
,
218
,
213
,
216
,
214
,
201
,
215
,
200
,
200
,
237
,
/* 660 */
2
07
,
201
,
201
,
200
,
221
,
200
,
202
,
84
,
254
,
25
3
,
/* 670 */
83
,
98
,
84
,
83
,
1
,
84
,
83
,
98
,
84
,
237
,
/* 680 */
83
,
83
,
133
,
98
,
133
,
83
,
83
,
116
,
83
,
117
,
/* 180 */
107
,
108
,
109
,
110
,
111
,
112
,
113
,
22
3
,
224
,
225
,
/* 190 */
22
6
,
227
,
228
,
229
,
230
,
231
,
232
,
233
,
234
,
235
,
/* 200 */
23
6
,
237
,
16
,
17
,
44
,
266
,
20
,
21
,
143
,
23
,
/* 210 */
24
,
25
,
26
,
27
,
28
,
27
4
,
207
,
152
,
153
,
33
,
/* 220 */
34
,
79
,
62
,
37
,
38
,
39
,
1
,
2
,
266
,
69
,
/* 230 */
5
,
2
50
,
7
,
91
,
9
,
75
,
76
,
77
,
78
,
277
,
/* 240 */
1
,
2
,
82
,
83
,
5
,
264
,
7
,
200
,
9
,
206
,
/* 250 */
2
41
,
266
,
25
,
26
,
27
,
28
,
200
,
210
,
33
,
34
,
/* 260 */
33
,
34
,
37
,
20
5
,
37
,
38
,
39
,
63
,
64
,
65
,
/* 270 */
21
2
,
1
,
33
,
34
,
70
,
71
,
72
,
73
,
74
,
9
,
/* 280 */
120
,
2
,
22
1
,
222
,
5
,
200
,
7
,
200
,
9
,
63
,
/* 290 */
64
,
65
,
69
,
89
,
200
,
146
,
70
,
148
,
72
,
73
,
/* 300 */
74
,
266
,
142
,
200
,
144
,
69
,
77
,
81
,
83
,
266
,
/* 310 */
37
,
151
,
33
,
34
,
203
,
204
,
63
,
64
,
65
,
5
,
/* 320 */
27
7
,
7
,
83
,
70
,
71
,
72
,
73
,
74
,
272
,
244
,
/* 330 */
274
,
244
,
205
,
248
,
99
,
248
,
101
,
102
,
244
,
212
,
/* 340 */
200
,
106
,
248
,
118
,
119
,
110
,
200
,
112
,
113
,
5
,
/* 350 */
125
,
248
,
5
,
83
,
7
,
266
,
200
,
118
,
119
,
200
,
/* 360 */
239
,
33
,
34
,
134
,
125
,
37
,
38
,
39
,
145
,
200
,
/* 370 */
147
,
200
,
149
,
150
,
200
,
83
,
266
,
33
,
34
,
87
,
/* 380 */
2
05
,
145
,
98
,
147
,
244
,
149
,
150
,
212
,
248
,
200
,
/* 390 */
24
4
,
37
,
38
,
39
,
248
,
200
,
123
,
118
,
119
,
210
,
/* 400 */
24
4
,
208
,
209
,
244
,
248
,
210
,
84
,
248
,
124
,
11
7
,
/* 410 */
84
,
84
,
83
,
244
,
98
,
244
,
84
,
248
,
244
,
248
,
/* 420 */
98
,
84
,
248
,
66
,
67
,
68
,
63
,
64
,
65
,
84
,
/* 430 */
98
,
98
,
84
,
1
,
15
,
98
,
84
,
84
,
83
,
125
,
/* 440 */
61
,
79
,
80
,
98
,
84
,
116
,
98
,
121
,
121
,
84
,
/* 450 */
98
,
98
,
84
,
84
,
84
,
146
,
140
,
148
,
98
,
146
,
/* 460 */
266
,
148
,
83
,
98
,
266
,
266
,
98
,
98
,
98
,
37
,
/* 470 */
1
15
,
138
,
125
,
5
,
5
,
7
,
7
,
146
,
266
,
148
,
/* 480 */
146
,
146
,
148
,
148
,
266
,
266
,
266
,
266
,
266
,
249
,
/* 490 */
2
66
,
249
,
247
,
239
,
266
,
239
,
266
,
266
,
266
,
266
,
/* 500 */
23
9
,
239
,
239
,
239
,
200
,
200
,
200
,
200
,
265
,
275
,
/* 510 */
200
,
200
,
247
,
275
,
247
,
200
,
61
,
200
,
200
,
200
,
/* 520 */
2
51
,
200
,
270
,
200
,
200
,
200
,
260
,
270
,
270
,
270
,
/* 530 */
200
,
259
,
257
,
262
,
125
,
261
,
200
,
118
,
200
,
200
,
/* 540 */
2
00
,
200
,
200
,
200
,
132
,
258
,
200
,
130
,
135
,
200
,
/* 550 */
200
,
200
,
137
,
139
,
136
,
129
,
200
,
256
,
200
,
200
,
/* 560 */
1
31
,
200
,
128
,
255
,
200
,
141
,
200
,
200
,
90
,
97
,
/* 570 */
1
14
,
200
,
200
,
200
,
200
,
200
,
200
,
200
,
200
,
96
,
/* 580 */
200
,
200
,
200
,
200
,
200
,
200
,
200
,
200
,
200
,
200
,
/* 590 */
200
,
200
,
200
,
200
,
200
,
200
,
200
,
200
,
200
,
200
,
/* 600 */
200
,
200
,
200
,
200
,
200
,
200
,
51
,
201
,
201
,
201
,
/* 610 */
9
3
,
201
,
201
,
95
,
55
,
94
,
92
,
85
,
5
,
154
,
/* 620 */
5
,
5
,
201
,
201
,
201
,
154
,
5
,
5
,
101
,
100
,
/* 630 */
143
,
121
,
201
,
83
,
122
,
116
,
211
,
207
,
211
,
201
,
/* 640 */
207
,
84
,
98
,
83
,
98
,
84
,
201
,
83
,
201
,
84
,
/* 650 */
2
02
,
202
,
201
,
214
,
218
,
220
,
219
,
217
,
215
,
213
,
/* 660 */
2
16
,
202
,
201
,
201
,
222
,
202
,
238
,
201
,
208
,
8
3
,
/* 670 */
254
,
84
,
252
,
203
,
98
,
83
,
1
,
84
,
83
,
238
,
/* 680 */
83
,
98
,
133
,
98
,
133
,
83
,
83
,
116
,
83
,
117
,
/* 690 */
79
,
71
,
88
,
87
,
5
,
88
,
87
,
9
,
5
,
5
,
/* 700 */
5
,
5
,
5
,
5
,
5
,
86
,
15
,
83
,
79
,
84
,
/* 710 */
118
,
24
,
59
,
83
,
148
,
148
,
16
,
16
,
148
,
5
,
/* 720 */
98
,
5
,
148
,
84
,
5
,
5
,
5
,
5
,
5
,
5
,
/* 700 */
5
,
5
,
5
,
5
,
5
,
86
,
15
,
79
,
83
,
118
,
/* 710 */
84
,
24
,
83
,
59
,
148
,
148
,
16
,
16
,
148
,
5
,
/* 720 */
5
,
98
,
148
,
84
,
5
,
5
,
5
,
5
,
5
,
5
,
/* 730 */
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
98
,
/* 740 */
86
,
61
,
60
,
0
,
277
,
277
,
277
,
277
,
277
,
277
,
/* 750 */
27
7
,
277
,
277
,
277
,
277
,
21
,
21
,
277
,
277
,
277
,
/* 760 */
27
7
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
/* 770 */
27
7
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
/* 780 */
27
7
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
/* 790 */
27
7
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
/* 800 */
27
7
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
/* 810 */
27
7
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
/* 820 */
27
7
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
/* 830 */
27
7
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
/* 840 */
27
7
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
/* 850 */
27
7
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
/* 860 */
27
7
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
/* 870 */
27
7
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
/* 880 */
27
7
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
/* 890 */
27
7
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
/* 900 */
27
7
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
/* 910 */
27
7
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
/* 920 */
27
7
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
/* 930 */
27
7
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
/* 940 */
27
7
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
277
,
/* 950 */
27
7
,
277
,
277
,
/* 740 */
61
,
86
,
60
,
0
,
278
,
278
,
278
,
278
,
278
,
278
,
/* 750 */
27
8
,
278
,
278
,
278
,
278
,
21
,
21
,
278
,
278
,
278
,
/* 760 */
27
8
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
/* 770 */
27
8
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
/* 780 */
27
8
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
/* 790 */
27
8
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
/* 800 */
27
8
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
/* 810 */
27
8
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
/* 820 */
27
8
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
/* 830 */
27
8
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
/* 840 */
27
8
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
/* 850 */
27
8
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
/* 860 */
27
8
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
/* 870 */
27
8
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
/* 880 */
27
8
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
/* 890 */
27
8
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
/* 900 */
27
8
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
/* 910 */
27
8
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
/* 920 */
27
8
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
/* 930 */
27
8
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
/* 940 */
27
8
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
278
,
/* 950 */
27
8
,
278
,
278
,
278
,
};
#define YY_SHIFT_COUNT (362)
#define YY_SHIFT_MIN (0)
...
...
@@ -400,65 +400,65 @@ static const unsigned short int yy_shift_ofst[] = {
/* 10 */
21
,
21
,
21
,
21
,
21
,
21
,
21
,
21
,
21
,
21
,
/* 20 */
21
,
21
,
21
,
0
,
2
,
239
,
279
,
279
,
279
,
15
,
/* 30 */
15
,
21
,
21
,
24
,
21
,
82
,
21
,
21
,
21
,
21
,
/* 40 */
1
54
,
29
,
51
,
51
,
66
,
757
,
757
,
757
,
239
,
239
,
/* 40 */
1
42
,
29
,
46
,
46
,
66
,
757
,
757
,
757
,
239
,
239
,
/* 50 */
239
,
239
,
239
,
239
,
239
,
239
,
239
,
239
,
239
,
239
,
/* 60 */
239
,
239
,
239
,
239
,
239
,
239
,
239
,
239
,
279
,
279
,
/* 70 */
279
,
3
58
,
358
,
358
,
358
,
358
,
358
,
358
,
21
,
21
,
/* 80 */
21
,
314
,
21
,
21
,
21
,
15
,
15
,
21
,
21
,
21
,
/* 90 */
21
,
300
,
300
,
258
,
15
,
21
,
21
,
21
,
21
,
21
,
/* 70 */
279
,
3
44
,
344
,
344
,
344
,
344
,
344
,
344
,
21
,
21
,
/* 80 */
21
,
273
,
21
,
21
,
21
,
15
,
15
,
21
,
21
,
21
,
/* 90 */
21
,
229
,
229
,
284
,
15
,
21
,
21
,
21
,
21
,
21
,
/* 100 */
21
,
21
,
21
,
21
,
21
,
21
,
21
,
21
,
21
,
21
,
/* 110 */
21
,
21
,
21
,
21
,
21
,
21
,
21
,
21
,
21
,
21
,
/* 120 */
21
,
21
,
21
,
21
,
21
,
21
,
21
,
21
,
21
,
21
,
/* 130 */
21
,
21
,
21
,
21
,
21
,
21
,
21
,
21
,
21
,
21
,
/* 140 */
21
,
21
,
21
,
21
,
21
,
21
,
21
,
21
,
21
,
21
,
/* 150 */
21
,
21
,
4
48
,
448
,
448
,
412
,
412
,
412
,
412
,
448
,
/* 160 */
4
48
,
409
,
411
,
410
,
415
,
413
,
427
,
434
,
430
,
438
,
/* 170 */
4
35
,
448
,
448
,
448
,
506
,
506
,
489
,
29
,
29
,
448
,
/* 180 */
4
48
,
512
,
514
,
560
,
519
,
518
,
559
,
521
,
524
,
489
,
/* 190 */
66
,
4
48
,
448
,
535
,
535
,
448
,
535
,
448
,
535
,
448
,
/* 200 */
4
48
,
757
,
757
,
52
,
79
,
79
,
106
,
79
,
132
,
186
,
/* 150 */
21
,
21
,
4
55
,
455
,
455
,
409
,
409
,
409
,
409
,
455
,
/* 160 */
4
55
,
415
,
414
,
412
,
418
,
413
,
417
,
426
,
434
,
429
,
/* 170 */
4
24
,
455
,
455
,
455
,
478
,
478
,
456
,
29
,
29
,
455
,
/* 180 */
4
55
,
472
,
483
,
555
,
517
,
518
,
559
,
521
,
524
,
456
,
/* 190 */
66
,
4
55
,
455
,
532
,
532
,
455
,
532
,
455
,
532
,
455
,
/* 200 */
4
55
,
757
,
757
,
52
,
79
,
79
,
106
,
79
,
132
,
186
,
/* 210 */
204
,
227
,
227
,
227
,
227
,
226
,
253
,
328
,
328
,
328
,
/* 220 */
328
,
223
,
236
,
65
,
2
88
,
372
,
372
,
290
,
296
,
346
,
/* 230 */
3
53
,
303
,
322
,
338
,
340
,
341
,
342
,
330
,
118
,
343
,
/* 240 */
3
47
,
348
,
349
,
351
,
359
,
352
,
364
,
428
,
369
,
42
9
,
/* 250 */
370
,
305
,
309
,
310
,
456
,
459
,
321
,
325
,
377
,
326
,
/* 260 */
3
97
,
616
,
468
,
618
,
621
,
473
,
623
,
628
,
533
,
536
,
/* 270 */
4
92
,
516
,
522
,
556
,
520
,
557
,
563
,
542
,
545
,
583
,
/* 280 */
5
87
,
588
,
590
,
591
,
573
,
593
,
594
,
597
,
673
,
598
,
/* 290 */
5
79
,
549
,
585
,
551
,
602
,
522
,
603
,
571
,
605
,
572
,
/* 220 */
328
,
223
,
236
,
65
,
2
92
,
354
,
354
,
314
,
347
,
357
,
/* 230 */
3
63
,
322
,
326
,
327
,
332
,
337
,
345
,
316
,
333
,
348
,
/* 240 */
3
52
,
353
,
360
,
365
,
329
,
368
,
369
,
432
,
379
,
41
9
,
/* 250 */
370
,
149
,
309
,
313
,
468
,
469
,
331
,
334
,
355
,
335
,
/* 260 */
3
62
,
613
,
465
,
615
,
616
,
471
,
621
,
622
,
527
,
529
,
/* 270 */
4
87
,
510
,
519
,
550
,
512
,
557
,
560
,
544
,
546
,
561
,
/* 280 */
5
64
,
565
,
586
,
587
,
576
,
592
,
593
,
595
,
675
,
597
,
/* 290 */
5
83
,
549
,
585
,
551
,
602
,
519
,
603
,
571
,
605
,
572
,
/* 300 */
611
,
604
,
606
,
620
,
689
,
607
,
609
,
688
,
693
,
694
,
/* 310 */
695
,
696
,
697
,
698
,
699
,
619
,
691
,
62
9
,
624
,
625
,
/* 320 */
59
2
,
630
,
687
,
653
,
700
,
566
,
567
,
622
,
622
,
622
,
/* 330 */
62
2
,
701
,
570
,
574
,
622
,
622
,
622
,
714
,
716
,
639
,
/* 340 */
62
2
,
719
,
720
,
721
,
722
,
723
,
724
,
725
,
726
,
727
,
/* 350 */
728
,
729
,
730
,
731
,
732
,
733
,
641
,
65
4
,
734
,
735
,
/* 360 */
6
80
,
682
,
743
,
/* 310 */
695
,
696
,
697
,
698
,
699
,
619
,
691
,
62
8
,
625
,
626
,
/* 320 */
59
1
,
629
,
687
,
654
,
700
,
566
,
567
,
623
,
623
,
623
,
/* 330 */
62
3
,
701
,
570
,
574
,
623
,
623
,
623
,
714
,
715
,
639
,
/* 340 */
62
3
,
719
,
720
,
721
,
722
,
723
,
724
,
725
,
726
,
727
,
/* 350 */
728
,
729
,
730
,
731
,
732
,
733
,
641
,
65
5
,
734
,
735
,
/* 360 */
6
79
,
682
,
743
,
};
#define YY_REDUCE_COUNT (202)
#define YY_REDUCE_MIN (-25
2
)
#define YY_REDUCE_MAX (4
65
)
#define YY_REDUCE_MIN (-25
3
)
#define YY_REDUCE_MAX (4
70
)
static
const
short
yy_reduce_ofst
[]
=
{
/* 0 */
-
15
2
,
-
35
,
-
35
,
-
193
,
-
193
,
-
78
,
-
195
,
-
37
,
44
,
-
184
,
/* 10 */
-
18
0
,
-
164
,
48
,
86
,
88
,
95
,
131
,
133
,
141
,
147
,
/* 20 */
1
53
,
156
,
161
,
-
192
,
-
194
,
-
168
,
-
242
,
-
236
,
-
123
,
-
200
,
/* 30 */
-
10
8
,
-
158
,
-
58
,
-
252
,
-
98
,
-
118
,
22
,
140
,
170
,
107
,
/* 40 */
46
,
183
,
59
,
191
,
62
,
144
,
212
,
112
,
-
128
,
-
60
,
/* 50 */
-
14
,
45
,
63
,
94
,
213
,
214
,
215
,
216
,
217
,
218
,
/* 60 */
2
19
,
220
,
221
,
222
,
224
,
228
,
229
,
230
,
240
,
242
,
/* 70 */
24
3
,
259
,
260
,
261
,
262
,
263
,
264
,
265
,
297
,
306
,
/* 80 */
30
7
,
244
,
308
,
311
,
312
,
266
,
267
,
315
,
316
,
317
,
/* 90 */
31
8
,
245
,
246
,
254
,
272
,
323
,
324
,
327
,
329
,
331
,
/* 100 */
33
2
,
333
,
334
,
335
,
336
,
337
,
339
,
344
,
345
,
350
,
/* 110 */
35
4
,
355
,
356
,
357
,
360
,
361
,
362
,
363
,
365
,
366
,
/* 120 */
3
67
,
368
,
371
,
373
,
374
,
375
,
376
,
378
,
379
,
380
,
/* 130 */
38
1
,
382
,
383
,
384
,
385
,
386
,
387
,
388
,
389
,
390
,
/* 140 */
39
1
,
392
,
393
,
394
,
395
,
396
,
398
,
399
,
400
,
401
,
/* 150 */
40
2
,
403
,
404
,
405
,
406
,
252
,
255
,
256
,
271
,
407
,
/* 160 */
4
08
,
268
,
281
,
280
,
269
,
295
,
289
,
313
,
414
,
416
,
/* 170 */
320
,
417
,
418
,
419
,
420
,
421
,
422
,
423
,
426
,
424
,
/* 180 */
4
25
,
431
,
433
,
432
,
439
,
437
,
440
,
441
,
436
,
442
,
/* 190 */
44
3
,
444
,
445
,
446
,
454
,
457
,
460
,
458
,
461
,
463
,
/* 200 */
46
5
,
453
,
464
,
/* 0 */
-
15
3
,
-
36
,
-
36
,
-
194
,
-
194
,
-
79
,
-
196
,
-
38
,
43
,
-
185
,
/* 10 */
-
18
1
,
-
165
,
56
,
85
,
87
,
94
,
140
,
146
,
156
,
159
,
/* 20 */
1
69
,
171
,
174
,
-
193
,
-
195
,
-
169
,
-
243
,
-
237
,
-
124
,
-
201
,
/* 30 */
-
10
9
,
-
159
,
-
59
,
-
253
,
-
99
,
-
119
,
47
,
189
,
195
,
103
,
/* 40 */
58
,
9
,
127
,
175
,
61
,
-
19
,
193
,
111
,
-
61
,
-
15
,
/* 50 */
35
,
89
,
110
,
194
,
198
,
199
,
212
,
218
,
219
,
220
,
/* 60 */
2
21
,
222
,
224
,
228
,
230
,
231
,
232
,
233
,
-
107
,
240
,
/* 70 */
24
2
,
121
,
254
,
256
,
261
,
262
,
263
,
264
,
304
,
305
,
/* 80 */
30
6
,
243
,
307
,
310
,
311
,
245
,
265
,
315
,
317
,
318
,
/* 90 */
31
9
,
234
,
238
,
269
,
267
,
321
,
323
,
324
,
325
,
330
,
/* 100 */
33
6
,
338
,
339
,
340
,
341
,
342
,
343
,
346
,
349
,
350
,
/* 110 */
35
1
,
356
,
358
,
359
,
361
,
364
,
366
,
367
,
371
,
372
,
/* 120 */
3
73
,
374
,
375
,
376
,
377
,
378
,
380
,
381
,
382
,
383
,
/* 130 */
38
4
,
385
,
386
,
387
,
388
,
389
,
390
,
391
,
392
,
393
,
/* 140 */
39
4
,
395
,
396
,
397
,
398
,
399
,
400
,
401
,
402
,
403
,
/* 150 */
40
4
,
405
,
406
,
407
,
408
,
252
,
257
,
258
,
259
,
410
,
/* 160 */
4
11
,
271
,
274
,
266
,
272
,
287
,
275
,
301
,
308
,
416
,
/* 170 */
420
,
421
,
422
,
423
,
425
,
427
,
428
,
430
,
433
,
431
,
/* 180 */
4
38
,
435
,
437
,
436
,
439
,
440
,
443
,
444
,
446
,
441
,
/* 190 */
44
2
,
445
,
447
,
448
,
449
,
451
,
459
,
461
,
463
,
462
,
/* 200 */
46
6
,
460
,
470
,
};
static
const
YYACTIONTYPE
yy_default
[]
=
{
/* 0 */
862
,
985
,
924
,
995
,
911
,
921
,
1134
,
1134
,
1134
,
862
,
...
...
@@ -713,6 +713,7 @@ static const YYCODETYPE yyFallback[] = {
1
,
/* INSERT => ID */
1
,
/* INTO => ID */
1
,
/* VALUES => ID */
1
,
/* FILE => ID */
};
#endif
/* YYFALLBACK */
...
...
@@ -996,87 +997,88 @@ static const char *const yyTokenName[] = {
/* 193 */
"INSERT"
,
/* 194 */
"INTO"
,
/* 195 */
"VALUES"
,
/* 196 */
"program"
,
/* 197 */
"cmd"
,
/* 198 */
"dbPrefix"
,
/* 199 */
"ids"
,
/* 200 */
"cpxName"
,
/* 201 */
"ifexists"
,
/* 202 */
"alter_db_optr"
,
/* 203 */
"alter_topic_optr"
,
/* 204 */
"acct_optr"
,
/* 205 */
"exprlist"
,
/* 206 */
"ifnotexists"
,
/* 207 */
"db_optr"
,
/* 208 */
"topic_optr"
,
/* 209 */
"typename"
,
/* 210 */
"bufsize"
,
/* 211 */
"pps"
,
/* 212 */
"tseries"
,
/* 213 */
"dbs"
,
/* 214 */
"streams"
,
/* 215 */
"storage"
,
/* 216 */
"qtime"
,
/* 217 */
"users"
,
/* 218 */
"conns"
,
/* 219 */
"state"
,
/* 220 */
"intitemlist"
,
/* 221 */
"intitem"
,
/* 222 */
"keep"
,
/* 223 */
"cache"
,
/* 224 */
"replica"
,
/* 225 */
"quorum"
,
/* 226 */
"days"
,
/* 227 */
"minrows"
,
/* 228 */
"maxrows"
,
/* 229 */
"blocks"
,
/* 230 */
"ctime"
,
/* 231 */
"wal"
,
/* 232 */
"fsync"
,
/* 233 */
"comp"
,
/* 234 */
"prec"
,
/* 235 */
"update"
,
/* 236 */
"cachelast"
,
/* 237 */
"partitions"
,
/* 238 */
"signed"
,
/* 239 */
"create_table_args"
,
/* 240 */
"create_stable_args"
,
/* 241 */
"create_table_list"
,
/* 242 */
"create_from_stable"
,
/* 243 */
"columnlist"
,
/* 244 */
"tagitemlist"
,
/* 245 */
"tagNamelist"
,
/* 246 */
"select"
,
/* 247 */
"column"
,
/* 248 */
"tagitem"
,
/* 249 */
"selcollist"
,
/* 250 */
"from"
,
/* 251 */
"where_opt"
,
/* 252 */
"interval_option"
,
/* 253 */
"sliding_opt"
,
/* 254 */
"session_option"
,
/* 255 */
"windowstate_option"
,
/* 256 */
"fill_opt"
,
/* 257 */
"groupby_opt"
,
/* 258 */
"having_opt"
,
/* 259 */
"orderby_opt"
,
/* 260 */
"slimit_opt"
,
/* 261 */
"limit_opt"
,
/* 262 */
"union"
,
/* 263 */
"sclp"
,
/* 264 */
"distinct"
,
/* 265 */
"expr"
,
/* 266 */
"as"
,
/* 267 */
"tablelist"
,
/* 268 */
"sub"
,
/* 269 */
"tmvar"
,
/* 270 */
"intervalKey"
,
/* 271 */
"sortlist"
,
/* 272 */
"sortitem"
,
/* 273 */
"item"
,
/* 274 */
"sortorder"
,
/* 275 */
"grouplist"
,
/* 276 */
"expritem"
,
/* 196 */
"FILE"
,
/* 197 */
"program"
,
/* 198 */
"cmd"
,
/* 199 */
"dbPrefix"
,
/* 200 */
"ids"
,
/* 201 */
"cpxName"
,
/* 202 */
"ifexists"
,
/* 203 */
"alter_db_optr"
,
/* 204 */
"alter_topic_optr"
,
/* 205 */
"acct_optr"
,
/* 206 */
"exprlist"
,
/* 207 */
"ifnotexists"
,
/* 208 */
"db_optr"
,
/* 209 */
"topic_optr"
,
/* 210 */
"typename"
,
/* 211 */
"bufsize"
,
/* 212 */
"pps"
,
/* 213 */
"tseries"
,
/* 214 */
"dbs"
,
/* 215 */
"streams"
,
/* 216 */
"storage"
,
/* 217 */
"qtime"
,
/* 218 */
"users"
,
/* 219 */
"conns"
,
/* 220 */
"state"
,
/* 221 */
"intitemlist"
,
/* 222 */
"intitem"
,
/* 223 */
"keep"
,
/* 224 */
"cache"
,
/* 225 */
"replica"
,
/* 226 */
"quorum"
,
/* 227 */
"days"
,
/* 228 */
"minrows"
,
/* 229 */
"maxrows"
,
/* 230 */
"blocks"
,
/* 231 */
"ctime"
,
/* 232 */
"wal"
,
/* 233 */
"fsync"
,
/* 234 */
"comp"
,
/* 235 */
"prec"
,
/* 236 */
"update"
,
/* 237 */
"cachelast"
,
/* 238 */
"partitions"
,
/* 239 */
"signed"
,
/* 240 */
"create_table_args"
,
/* 241 */
"create_stable_args"
,
/* 242 */
"create_table_list"
,
/* 243 */
"create_from_stable"
,
/* 244 */
"columnlist"
,
/* 245 */
"tagitemlist"
,
/* 246 */
"tagNamelist"
,
/* 247 */
"select"
,
/* 248 */
"column"
,
/* 249 */
"tagitem"
,
/* 250 */
"selcollist"
,
/* 251 */
"from"
,
/* 252 */
"where_opt"
,
/* 253 */
"interval_option"
,
/* 254 */
"sliding_opt"
,
/* 255 */
"session_option"
,
/* 256 */
"windowstate_option"
,
/* 257 */
"fill_opt"
,
/* 258 */
"groupby_opt"
,
/* 259 */
"having_opt"
,
/* 260 */
"orderby_opt"
,
/* 261 */
"slimit_opt"
,
/* 262 */
"limit_opt"
,
/* 263 */
"union"
,
/* 264 */
"sclp"
,
/* 265 */
"distinct"
,
/* 266 */
"expr"
,
/* 267 */
"as"
,
/* 268 */
"tablelist"
,
/* 269 */
"sub"
,
/* 270 */
"tmvar"
,
/* 271 */
"intervalKey"
,
/* 272 */
"sortlist"
,
/* 273 */
"sortitem"
,
/* 274 */
"item"
,
/* 275 */
"sortorder"
,
/* 276 */
"grouplist"
,
/* 277 */
"expritem"
,
};
#endif
/* defined(YYCOVERAGE) || !defined(NDEBUG) */
...
...
@@ -1500,60 +1502,60 @@ static void yy_destructor(
** inside the C code.
*/
/********* Begin destructor definitions ***************************************/
case
20
5
:
/* exprlist */
case
2
49
:
/* selcollist */
case
26
3
:
/* sclp */
case
20
6
:
/* exprlist */
case
2
50
:
/* selcollist */
case
26
4
:
/* sclp */
{
tSqlExprListDestroy
((
yypminor
->
yy4
03
));
tSqlExprListDestroy
((
yypminor
->
yy4
21
));
}
break
;
case
22
0
:
/* intitemlist */
case
22
2
:
/* keep */
case
24
3
:
/* columnlist */
case
24
4
:
/* tagitemlist */
case
24
5
:
/* tagNamelist */
case
25
6
:
/* fill_opt */
case
25
7
:
/* groupby_opt */
case
2
59
:
/* orderby_opt */
case
27
1
:
/* sortlist */
case
27
5
:
/* grouplist */
case
22
1
:
/* intitemlist */
case
22
3
:
/* keep */
case
24
4
:
/* columnlist */
case
24
5
:
/* tagitemlist */
case
24
6
:
/* tagNamelist */
case
25
7
:
/* fill_opt */
case
25
8
:
/* groupby_opt */
case
2
60
:
/* orderby_opt */
case
27
2
:
/* sortlist */
case
27
6
:
/* grouplist */
{
taosArrayDestroy
((
yypminor
->
yy4
03
));
taosArrayDestroy
((
yypminor
->
yy4
21
));
}
break
;
case
24
1
:
/* create_table_list */
case
24
2
:
/* create_table_list */
{
destroyCreateTableSql
((
yypminor
->
yy
56
));
destroyCreateTableSql
((
yypminor
->
yy
438
));
}
break
;
case
24
6
:
/* select */
case
24
7
:
/* select */
{
destroySqlNode
((
yypminor
->
yy
224
));
destroySqlNode
((
yypminor
->
yy
56
));
}
break
;
case
25
0
:
/* from */
case
26
7
:
/* tablelist */
case
26
8
:
/* sub */
case
25
1
:
/* from */
case
26
8
:
/* tablelist */
case
26
9
:
/* sub */
{
destroyRelationInfo
((
yypminor
->
yy
114
));
destroyRelationInfo
((
yypminor
->
yy
8
));
}
break
;
case
25
1
:
/* where_opt */
case
25
8
:
/* having_opt */
case
26
5
:
/* expr */
case
27
6
:
/* expritem */
case
25
2
:
/* where_opt */
case
25
9
:
/* having_opt */
case
26
6
:
/* expr */
case
27
7
:
/* expritem */
{
tSqlExprDestroy
((
yypminor
->
yy
260
));
tSqlExprDestroy
((
yypminor
->
yy
439
));
}
break
;
case
26
2
:
/* union */
case
26
3
:
/* union */
{
destroyAllSqlNode
((
yypminor
->
yy4
03
));
destroyAllSqlNode
((
yypminor
->
yy4
21
));
}
break
;
case
27
2
:
/* sortitem */
case
27
3
:
/* sortitem */
{
tVariantDestroy
(
&
(
yypminor
->
yy4
88
));
tVariantDestroy
(
&
(
yypminor
->
yy4
30
));
}
break
;
/********* End destructor definitions *****************************************/
...
...
@@ -1850,297 +1852,297 @@ static const struct {
YYCODETYPE
lhs
;
/* Symbol on the left-hand side of the rule */
signed
char
nrhs
;
/* Negative of the number of RHS symbols in the rule */
}
yyRuleInfo
[]
=
{
{
19
6
,
-
1
},
/* (0) program ::= cmd */
{
19
7
,
-
2
},
/* (1) cmd ::= SHOW DATABASES */
{
19
7
,
-
2
},
/* (2) cmd ::= SHOW TOPICS */
{
19
7
,
-
2
},
/* (3) cmd ::= SHOW FUNCTIONS */
{
19
7
,
-
2
},
/* (4) cmd ::= SHOW MNODES */
{
19
7
,
-
2
},
/* (5) cmd ::= SHOW DNODES */
{
19
7
,
-
2
},
/* (6) cmd ::= SHOW ACCOUNTS */
{
19
7
,
-
2
},
/* (7) cmd ::= SHOW USERS */
{
19
7
,
-
2
},
/* (8) cmd ::= SHOW MODULES */
{
19
7
,
-
2
},
/* (9) cmd ::= SHOW QUERIES */
{
19
7
,
-
2
},
/* (10) cmd ::= SHOW CONNECTIONS */
{
19
7
,
-
2
},
/* (11) cmd ::= SHOW STREAMS */
{
19
7
,
-
2
},
/* (12) cmd ::= SHOW VARIABLES */
{
19
7
,
-
2
},
/* (13) cmd ::= SHOW SCORES */
{
19
7
,
-
2
},
/* (14) cmd ::= SHOW GRANTS */
{
19
7
,
-
2
},
/* (15) cmd ::= SHOW VNODES */
{
19
7
,
-
3
},
/* (16) cmd ::= SHOW VNODES IPTOKEN */
{
19
8
,
0
},
/* (17) dbPrefix ::= */
{
19
8
,
-
2
},
/* (18) dbPrefix ::= ids DOT */
{
20
0
,
0
},
/* (19) cpxName ::= */
{
20
0
,
-
2
},
/* (20) cpxName ::= DOT ids */
{
19
7
,
-
5
},
/* (21) cmd ::= SHOW CREATE TABLE ids cpxName */
{
19
7
,
-
5
},
/* (22) cmd ::= SHOW CREATE STABLE ids cpxName */
{
19
7
,
-
4
},
/* (23) cmd ::= SHOW CREATE DATABASE ids */
{
19
7
,
-
3
},
/* (24) cmd ::= SHOW dbPrefix TABLES */
{
19
7
,
-
5
},
/* (25) cmd ::= SHOW dbPrefix TABLES LIKE ids */
{
19
7
,
-
3
},
/* (26) cmd ::= SHOW dbPrefix STABLES */
{
19
7
,
-
5
},
/* (27) cmd ::= SHOW dbPrefix STABLES LIKE ids */
{
19
7
,
-
3
},
/* (28) cmd ::= SHOW dbPrefix VGROUPS */
{
19
7
,
-
5
},
/* (29) cmd ::= DROP TABLE ifexists ids cpxName */
{
19
7
,
-
5
},
/* (30) cmd ::= DROP STABLE ifexists ids cpxName */
{
19
7
,
-
4
},
/* (31) cmd ::= DROP DATABASE ifexists ids */
{
19
7
,
-
4
},
/* (32) cmd ::= DROP TOPIC ifexists ids */
{
19
7
,
-
3
},
/* (33) cmd ::= DROP FUNCTION ids */
{
19
7
,
-
3
},
/* (34) cmd ::= DROP DNODE ids */
{
19
7
,
-
3
},
/* (35) cmd ::= DROP USER ids */
{
19
7
,
-
3
},
/* (36) cmd ::= DROP ACCOUNT ids */
{
19
7
,
-
2
},
/* (37) cmd ::= USE ids */
{
19
7
,
-
3
},
/* (38) cmd ::= DESCRIBE ids cpxName */
{
19
7
,
-
3
},
/* (39) cmd ::= DESC ids cpxName */
{
19
7
,
-
5
},
/* (40) cmd ::= ALTER USER ids PASS ids */
{
19
7
,
-
5
},
/* (41) cmd ::= ALTER USER ids PRIVILEGE ids */
{
19
7
,
-
4
},
/* (42) cmd ::= ALTER DNODE ids ids */
{
19
7
,
-
5
},
/* (43) cmd ::= ALTER DNODE ids ids ids */
{
19
7
,
-
3
},
/* (44) cmd ::= ALTER LOCAL ids */
{
19
7
,
-
4
},
/* (45) cmd ::= ALTER LOCAL ids ids */
{
19
7
,
-
4
},
/* (46) cmd ::= ALTER DATABASE ids alter_db_optr */
{
19
7
,
-
4
},
/* (47) cmd ::= ALTER TOPIC ids alter_topic_optr */
{
19
7
,
-
4
},
/* (48) cmd ::= ALTER ACCOUNT ids acct_optr */
{
19
7
,
-
6
},
/* (49) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */
{
19
7
,
-
6
},
/* (50) cmd ::= COMPACT VNODES IN LP exprlist RP */
{
199
,
-
1
},
/* (51) ids ::= ID */
{
199
,
-
1
},
/* (52) ids ::= STRING */
{
20
1
,
-
2
},
/* (53) ifexists ::= IF EXISTS */
{
20
1
,
0
},
/* (54) ifexists ::= */
{
20
6
,
-
3
},
/* (55) ifnotexists ::= IF NOT EXISTS */
{
20
6
,
0
},
/* (56) ifnotexists ::= */
{
19
7
,
-
3
},
/* (57) cmd ::= CREATE DNODE ids */
{
19
7
,
-
6
},
/* (58) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
{
19
7
,
-
5
},
/* (59) cmd ::= CREATE DATABASE ifnotexists ids db_optr */
{
19
7
,
-
5
},
/* (60) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */
{
19
7
,
-
8
},
/* (61) cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
{
19
7
,
-
9
},
/* (62) cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
{
19
7
,
-
5
},
/* (63) cmd ::= CREATE USER ids PASS ids */
{
21
0
,
0
},
/* (64) bufsize ::= */
{
21
0
,
-
2
},
/* (65) bufsize ::= BUFSIZE INTEGER */
{
21
1
,
0
},
/* (66) pps ::= */
{
21
1
,
-
2
},
/* (67) pps ::= PPS INTEGER */
{
21
2
,
0
},
/* (68) tseries ::= */
{
21
2
,
-
2
},
/* (69) tseries ::= TSERIES INTEGER */
{
21
3
,
0
},
/* (70) dbs ::= */
{
21
3
,
-
2
},
/* (71) dbs ::= DBS INTEGER */
{
21
4
,
0
},
/* (72) streams ::= */
{
21
4
,
-
2
},
/* (73) streams ::= STREAMS INTEGER */
{
21
5
,
0
},
/* (74) storage ::= */
{
21
5
,
-
2
},
/* (75) storage ::= STORAGE INTEGER */
{
21
6
,
0
},
/* (76) qtime ::= */
{
21
6
,
-
2
},
/* (77) qtime ::= QTIME INTEGER */
{
21
7
,
0
},
/* (78) users ::= */
{
21
7
,
-
2
},
/* (79) users ::= USERS INTEGER */
{
21
8
,
0
},
/* (80) conns ::= */
{
21
8
,
-
2
},
/* (81) conns ::= CONNS INTEGER */
{
2
19
,
0
},
/* (82) state ::= */
{
2
19
,
-
2
},
/* (83) state ::= STATE ids */
{
20
4
,
-
9
},
/* (84) acct_optr ::= pps tseries storage streams qtime dbs users conns state */
{
22
0
,
-
3
},
/* (85) intitemlist ::= intitemlist COMMA intitem */
{
22
0
,
-
1
},
/* (86) intitemlist ::= intitem */
{
22
1
,
-
1
},
/* (87) intitem ::= INTEGER */
{
22
2
,
-
2
},
/* (88) keep ::= KEEP intitemlist */
{
22
3
,
-
2
},
/* (89) cache ::= CACHE INTEGER */
{
22
4
,
-
2
},
/* (90) replica ::= REPLICA INTEGER */
{
22
5
,
-
2
},
/* (91) quorum ::= QUORUM INTEGER */
{
22
6
,
-
2
},
/* (92) days ::= DAYS INTEGER */
{
22
7
,
-
2
},
/* (93) minrows ::= MINROWS INTEGER */
{
22
8
,
-
2
},
/* (94) maxrows ::= MAXROWS INTEGER */
{
2
29
,
-
2
},
/* (95) blocks ::= BLOCKS INTEGER */
{
23
0
,
-
2
},
/* (96) ctime ::= CTIME INTEGER */
{
23
1
,
-
2
},
/* (97) wal ::= WAL INTEGER */
{
23
2
,
-
2
},
/* (98) fsync ::= FSYNC INTEGER */
{
23
3
,
-
2
},
/* (99) comp ::= COMP INTEGER */
{
23
4
,
-
2
},
/* (100) prec ::= PRECISION STRING */
{
23
5
,
-
2
},
/* (101) update ::= UPDATE INTEGER */
{
23
6
,
-
2
},
/* (102) cachelast ::= CACHELAST INTEGER */
{
23
7
,
-
2
},
/* (103) partitions ::= PARTITIONS INTEGER */
{
20
7
,
0
},
/* (104) db_optr ::= */
{
20
7
,
-
2
},
/* (105) db_optr ::= db_optr cache */
{
20
7
,
-
2
},
/* (106) db_optr ::= db_optr replica */
{
20
7
,
-
2
},
/* (107) db_optr ::= db_optr quorum */
{
20
7
,
-
2
},
/* (108) db_optr ::= db_optr days */
{
20
7
,
-
2
},
/* (109) db_optr ::= db_optr minrows */
{
20
7
,
-
2
},
/* (110) db_optr ::= db_optr maxrows */
{
20
7
,
-
2
},
/* (111) db_optr ::= db_optr blocks */
{
20
7
,
-
2
},
/* (112) db_optr ::= db_optr ctime */
{
20
7
,
-
2
},
/* (113) db_optr ::= db_optr wal */
{
20
7
,
-
2
},
/* (114) db_optr ::= db_optr fsync */
{
20
7
,
-
2
},
/* (115) db_optr ::= db_optr comp */
{
20
7
,
-
2
},
/* (116) db_optr ::= db_optr prec */
{
20
7
,
-
2
},
/* (117) db_optr ::= db_optr keep */
{
20
7
,
-
2
},
/* (118) db_optr ::= db_optr update */
{
20
7
,
-
2
},
/* (119) db_optr ::= db_optr cachelast */
{
20
8
,
-
1
},
/* (120) topic_optr ::= db_optr */
{
20
8
,
-
2
},
/* (121) topic_optr ::= topic_optr partitions */
{
20
2
,
0
},
/* (122) alter_db_optr ::= */
{
20
2
,
-
2
},
/* (123) alter_db_optr ::= alter_db_optr replica */
{
20
2
,
-
2
},
/* (124) alter_db_optr ::= alter_db_optr quorum */
{
20
2
,
-
2
},
/* (125) alter_db_optr ::= alter_db_optr keep */
{
20
2
,
-
2
},
/* (126) alter_db_optr ::= alter_db_optr blocks */
{
20
2
,
-
2
},
/* (127) alter_db_optr ::= alter_db_optr comp */
{
20
2
,
-
2
},
/* (128) alter_db_optr ::= alter_db_optr update */
{
20
2
,
-
2
},
/* (129) alter_db_optr ::= alter_db_optr cachelast */
{
20
3
,
-
1
},
/* (130) alter_topic_optr ::= alter_db_optr */
{
20
3
,
-
2
},
/* (131) alter_topic_optr ::= alter_topic_optr partitions */
{
2
09
,
-
1
},
/* (132) typename ::= ids */
{
2
09
,
-
4
},
/* (133) typename ::= ids LP signed RP */
{
2
09
,
-
2
},
/* (134) typename ::= ids UNSIGNED */
{
23
8
,
-
1
},
/* (135) signed ::= INTEGER */
{
23
8
,
-
2
},
/* (136) signed ::= PLUS INTEGER */
{
23
8
,
-
2
},
/* (137) signed ::= MINUS INTEGER */
{
19
7
,
-
3
},
/* (138) cmd ::= CREATE TABLE create_table_args */
{
19
7
,
-
3
},
/* (139) cmd ::= CREATE TABLE create_stable_args */
{
19
7
,
-
3
},
/* (140) cmd ::= CREATE STABLE create_stable_args */
{
19
7
,
-
3
},
/* (141) cmd ::= CREATE TABLE create_table_list */
{
24
1
,
-
1
},
/* (142) create_table_list ::= create_from_stable */
{
24
1
,
-
2
},
/* (143) create_table_list ::= create_table_list create_from_stable */
{
2
39
,
-
6
},
/* (144) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
{
24
0
,
-
10
},
/* (145) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
{
24
2
,
-
10
},
/* (146) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */
{
24
2
,
-
13
},
/* (147) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */
{
24
5
,
-
3
},
/* (148) tagNamelist ::= tagNamelist COMMA ids */
{
24
5
,
-
1
},
/* (149) tagNamelist ::= ids */
{
2
39
,
-
5
},
/* (150) create_table_args ::= ifnotexists ids cpxName AS select */
{
24
3
,
-
3
},
/* (151) columnlist ::= columnlist COMMA column */
{
24
3
,
-
1
},
/* (152) columnlist ::= column */
{
24
7
,
-
2
},
/* (153) column ::= ids typename */
{
24
4
,
-
3
},
/* (154) tagitemlist ::= tagitemlist COMMA tagitem */
{
24
4
,
-
1
},
/* (155) tagitemlist ::= tagitem */
{
24
8
,
-
1
},
/* (156) tagitem ::= INTEGER */
{
24
8
,
-
1
},
/* (157) tagitem ::= FLOAT */
{
24
8
,
-
1
},
/* (158) tagitem ::= STRING */
{
24
8
,
-
1
},
/* (159) tagitem ::= BOOL */
{
24
8
,
-
1
},
/* (160) tagitem ::= NULL */
{
24
8
,
-
1
},
/* (161) tagitem ::= NOW */
{
24
8
,
-
2
},
/* (162) tagitem ::= MINUS INTEGER */
{
24
8
,
-
2
},
/* (163) tagitem ::= MINUS FLOAT */
{
24
8
,
-
2
},
/* (164) tagitem ::= PLUS INTEGER */
{
24
8
,
-
2
},
/* (165) tagitem ::= PLUS FLOAT */
{
24
6
,
-
14
},
/* (166) select ::= SELECT selcollist from where_opt interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */
{
24
6
,
-
3
},
/* (167) select ::= LP select RP */
{
26
2
,
-
1
},
/* (168) union ::= select */
{
26
2
,
-
4
},
/* (169) union ::= union UNION ALL select */
{
19
7
,
-
1
},
/* (170) cmd ::= union */
{
24
6
,
-
2
},
/* (171) select ::= SELECT selcollist */
{
26
3
,
-
2
},
/* (172) sclp ::= selcollist COMMA */
{
26
3
,
0
},
/* (173) sclp ::= */
{
2
49
,
-
4
},
/* (174) selcollist ::= sclp distinct expr as */
{
2
49
,
-
2
},
/* (175) selcollist ::= sclp STAR */
{
26
6
,
-
2
},
/* (176) as ::= AS ids */
{
26
6
,
-
1
},
/* (177) as ::= ids */
{
26
6
,
0
},
/* (178) as ::= */
{
26
4
,
-
1
},
/* (179) distinct ::= DISTINCT */
{
26
4
,
0
},
/* (180) distinct ::= */
{
25
0
,
-
2
},
/* (181) from ::= FROM tablelist */
{
25
0
,
-
2
},
/* (182) from ::= FROM sub */
{
26
8
,
-
3
},
/* (183) sub ::= LP union RP */
{
26
8
,
-
4
},
/* (184) sub ::= LP union RP ids */
{
26
8
,
-
6
},
/* (185) sub ::= sub COMMA LP union RP ids */
{
26
7
,
-
2
},
/* (186) tablelist ::= ids cpxName */
{
26
7
,
-
3
},
/* (187) tablelist ::= ids cpxName ids */
{
26
7
,
-
4
},
/* (188) tablelist ::= tablelist COMMA ids cpxName */
{
26
7
,
-
5
},
/* (189) tablelist ::= tablelist COMMA ids cpxName ids */
{
2
69
,
-
1
},
/* (190) tmvar ::= VARIABLE */
{
25
2
,
-
4
},
/* (191) interval_option ::= intervalKey LP tmvar RP */
{
25
2
,
-
6
},
/* (192) interval_option ::= intervalKey LP tmvar COMMA tmvar RP */
{
25
2
,
0
},
/* (193) interval_option ::= */
{
27
0
,
-
1
},
/* (194) intervalKey ::= INTERVAL */
{
27
0
,
-
1
},
/* (195) intervalKey ::= EVERY */
{
25
4
,
0
},
/* (196) session_option ::= */
{
25
4
,
-
7
},
/* (197) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */
{
25
5
,
0
},
/* (198) windowstate_option ::= */
{
25
5
,
-
4
},
/* (199) windowstate_option ::= STATE_WINDOW LP ids RP */
{
25
6
,
0
},
/* (200) fill_opt ::= */
{
25
6
,
-
6
},
/* (201) fill_opt ::= FILL LP ID COMMA tagitemlist RP */
{
25
6
,
-
4
},
/* (202) fill_opt ::= FILL LP ID RP */
{
25
3
,
-
4
},
/* (203) sliding_opt ::= SLIDING LP tmvar RP */
{
25
3
,
0
},
/* (204) sliding_opt ::= */
{
2
59
,
0
},
/* (205) orderby_opt ::= */
{
2
59
,
-
3
},
/* (206) orderby_opt ::= ORDER BY sortlist */
{
27
1
,
-
4
},
/* (207) sortlist ::= sortlist COMMA item sortorder */
{
27
1
,
-
2
},
/* (208) sortlist ::= item sortorder */
{
27
3
,
-
2
},
/* (209) item ::= ids cpxName */
{
27
4
,
-
1
},
/* (210) sortorder ::= ASC */
{
27
4
,
-
1
},
/* (211) sortorder ::= DESC */
{
27
4
,
0
},
/* (212) sortorder ::= */
{
25
7
,
0
},
/* (213) groupby_opt ::= */
{
25
7
,
-
3
},
/* (214) groupby_opt ::= GROUP BY grouplist */
{
27
5
,
-
3
},
/* (215) grouplist ::= grouplist COMMA item */
{
27
5
,
-
1
},
/* (216) grouplist ::= item */
{
25
8
,
0
},
/* (217) having_opt ::= */
{
25
8
,
-
2
},
/* (218) having_opt ::= HAVING expr */
{
26
1
,
0
},
/* (219) limit_opt ::= */
{
26
1
,
-
2
},
/* (220) limit_opt ::= LIMIT signed */
{
26
1
,
-
4
},
/* (221) limit_opt ::= LIMIT signed OFFSET signed */
{
26
1
,
-
4
},
/* (222) limit_opt ::= LIMIT signed COMMA signed */
{
26
0
,
0
},
/* (223) slimit_opt ::= */
{
26
0
,
-
2
},
/* (224) slimit_opt ::= SLIMIT signed */
{
26
0
,
-
4
},
/* (225) slimit_opt ::= SLIMIT signed SOFFSET signed */
{
26
0
,
-
4
},
/* (226) slimit_opt ::= SLIMIT signed COMMA signed */
{
25
1
,
0
},
/* (227) where_opt ::= */
{
25
1
,
-
2
},
/* (228) where_opt ::= WHERE expr */
{
26
5
,
-
3
},
/* (229) expr ::= LP expr RP */
{
26
5
,
-
1
},
/* (230) expr ::= ID */
{
26
5
,
-
3
},
/* (231) expr ::= ID DOT ID */
{
26
5
,
-
3
},
/* (232) expr ::= ID DOT STAR */
{
26
5
,
-
1
},
/* (233) expr ::= INTEGER */
{
26
5
,
-
2
},
/* (234) expr ::= MINUS INTEGER */
{
26
5
,
-
2
},
/* (235) expr ::= PLUS INTEGER */
{
26
5
,
-
1
},
/* (236) expr ::= FLOAT */
{
26
5
,
-
2
},
/* (237) expr ::= MINUS FLOAT */
{
26
5
,
-
2
},
/* (238) expr ::= PLUS FLOAT */
{
26
5
,
-
1
},
/* (239) expr ::= STRING */
{
26
5
,
-
1
},
/* (240) expr ::= NOW */
{
26
5
,
-
1
},
/* (241) expr ::= VARIABLE */
{
26
5
,
-
2
},
/* (242) expr ::= PLUS VARIABLE */
{
26
5
,
-
2
},
/* (243) expr ::= MINUS VARIABLE */
{
26
5
,
-
1
},
/* (244) expr ::= BOOL */
{
26
5
,
-
1
},
/* (245) expr ::= NULL */
{
26
5
,
-
4
},
/* (246) expr ::= ID LP exprlist RP */
{
26
5
,
-
4
},
/* (247) expr ::= ID LP STAR RP */
{
26
5
,
-
3
},
/* (248) expr ::= expr IS NULL */
{
26
5
,
-
4
},
/* (249) expr ::= expr IS NOT NULL */
{
26
5
,
-
3
},
/* (250) expr ::= expr LT expr */
{
26
5
,
-
3
},
/* (251) expr ::= expr GT expr */
{
26
5
,
-
3
},
/* (252) expr ::= expr LE expr */
{
26
5
,
-
3
},
/* (253) expr ::= expr GE expr */
{
26
5
,
-
3
},
/* (254) expr ::= expr NE expr */
{
26
5
,
-
3
},
/* (255) expr ::= expr EQ expr */
{
26
5
,
-
5
},
/* (256) expr ::= expr BETWEEN expr AND expr */
{
26
5
,
-
3
},
/* (257) expr ::= expr AND expr */
{
26
5
,
-
3
},
/* (258) expr ::= expr OR expr */
{
26
5
,
-
3
},
/* (259) expr ::= expr PLUS expr */
{
26
5
,
-
3
},
/* (260) expr ::= expr MINUS expr */
{
26
5
,
-
3
},
/* (261) expr ::= expr STAR expr */
{
26
5
,
-
3
},
/* (262) expr ::= expr SLASH expr */
{
26
5
,
-
3
},
/* (263) expr ::= expr REM expr */
{
26
5
,
-
3
},
/* (264) expr ::= expr LIKE expr */
{
26
5
,
-
5
},
/* (265) expr ::= expr IN LP exprlist RP */
{
20
5
,
-
3
},
/* (266) exprlist ::= exprlist COMMA expritem */
{
20
5
,
-
1
},
/* (267) exprlist ::= expritem */
{
27
6
,
-
1
},
/* (268) expritem ::= expr */
{
27
6
,
0
},
/* (269) expritem ::= */
{
19
7
,
-
3
},
/* (270) cmd ::= RESET QUERY CACHE */
{
19
7
,
-
3
},
/* (271) cmd ::= SYNCDB ids REPLICA */
{
19
7
,
-
7
},
/* (272) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
{
19
7
,
-
7
},
/* (273) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
{
19
7
,
-
7
},
/* (274) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */
{
19
7
,
-
7
},
/* (275) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
{
19
7
,
-
7
},
/* (276) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
{
19
7
,
-
8
},
/* (277) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
{
19
7
,
-
9
},
/* (278) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
{
19
7
,
-
7
},
/* (279) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */
{
19
7
,
-
7
},
/* (280) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
{
19
7
,
-
7
},
/* (281) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
{
19
7
,
-
7
},
/* (282) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */
{
19
7
,
-
7
},
/* (283) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
{
19
7
,
-
7
},
/* (284) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
{
19
7
,
-
8
},
/* (285) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
{
19
7
,
-
9
},
/* (286) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */
{
19
7
,
-
7
},
/* (287) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */
{
19
7
,
-
3
},
/* (288) cmd ::= KILL CONNECTION INTEGER */
{
19
7
,
-
5
},
/* (289) cmd ::= KILL STREAM INTEGER COLON INTEGER */
{
19
7
,
-
5
},
/* (290) cmd ::= KILL QUERY INTEGER COLON INTEGER */
{
19
7
,
-
1
},
/* (0) program ::= cmd */
{
19
8
,
-
2
},
/* (1) cmd ::= SHOW DATABASES */
{
19
8
,
-
2
},
/* (2) cmd ::= SHOW TOPICS */
{
19
8
,
-
2
},
/* (3) cmd ::= SHOW FUNCTIONS */
{
19
8
,
-
2
},
/* (4) cmd ::= SHOW MNODES */
{
19
8
,
-
2
},
/* (5) cmd ::= SHOW DNODES */
{
19
8
,
-
2
},
/* (6) cmd ::= SHOW ACCOUNTS */
{
19
8
,
-
2
},
/* (7) cmd ::= SHOW USERS */
{
19
8
,
-
2
},
/* (8) cmd ::= SHOW MODULES */
{
19
8
,
-
2
},
/* (9) cmd ::= SHOW QUERIES */
{
19
8
,
-
2
},
/* (10) cmd ::= SHOW CONNECTIONS */
{
19
8
,
-
2
},
/* (11) cmd ::= SHOW STREAMS */
{
19
8
,
-
2
},
/* (12) cmd ::= SHOW VARIABLES */
{
19
8
,
-
2
},
/* (13) cmd ::= SHOW SCORES */
{
19
8
,
-
2
},
/* (14) cmd ::= SHOW GRANTS */
{
19
8
,
-
2
},
/* (15) cmd ::= SHOW VNODES */
{
19
8
,
-
3
},
/* (16) cmd ::= SHOW VNODES IPTOKEN */
{
19
9
,
0
},
/* (17) dbPrefix ::= */
{
19
9
,
-
2
},
/* (18) dbPrefix ::= ids DOT */
{
20
1
,
0
},
/* (19) cpxName ::= */
{
20
1
,
-
2
},
/* (20) cpxName ::= DOT ids */
{
19
8
,
-
5
},
/* (21) cmd ::= SHOW CREATE TABLE ids cpxName */
{
19
8
,
-
5
},
/* (22) cmd ::= SHOW CREATE STABLE ids cpxName */
{
19
8
,
-
4
},
/* (23) cmd ::= SHOW CREATE DATABASE ids */
{
19
8
,
-
3
},
/* (24) cmd ::= SHOW dbPrefix TABLES */
{
19
8
,
-
5
},
/* (25) cmd ::= SHOW dbPrefix TABLES LIKE ids */
{
19
8
,
-
3
},
/* (26) cmd ::= SHOW dbPrefix STABLES */
{
19
8
,
-
5
},
/* (27) cmd ::= SHOW dbPrefix STABLES LIKE ids */
{
19
8
,
-
3
},
/* (28) cmd ::= SHOW dbPrefix VGROUPS */
{
19
8
,
-
5
},
/* (29) cmd ::= DROP TABLE ifexists ids cpxName */
{
19
8
,
-
5
},
/* (30) cmd ::= DROP STABLE ifexists ids cpxName */
{
19
8
,
-
4
},
/* (31) cmd ::= DROP DATABASE ifexists ids */
{
19
8
,
-
4
},
/* (32) cmd ::= DROP TOPIC ifexists ids */
{
19
8
,
-
3
},
/* (33) cmd ::= DROP FUNCTION ids */
{
19
8
,
-
3
},
/* (34) cmd ::= DROP DNODE ids */
{
19
8
,
-
3
},
/* (35) cmd ::= DROP USER ids */
{
19
8
,
-
3
},
/* (36) cmd ::= DROP ACCOUNT ids */
{
19
8
,
-
2
},
/* (37) cmd ::= USE ids */
{
19
8
,
-
3
},
/* (38) cmd ::= DESCRIBE ids cpxName */
{
19
8
,
-
3
},
/* (39) cmd ::= DESC ids cpxName */
{
19
8
,
-
5
},
/* (40) cmd ::= ALTER USER ids PASS ids */
{
19
8
,
-
5
},
/* (41) cmd ::= ALTER USER ids PRIVILEGE ids */
{
19
8
,
-
4
},
/* (42) cmd ::= ALTER DNODE ids ids */
{
19
8
,
-
5
},
/* (43) cmd ::= ALTER DNODE ids ids ids */
{
19
8
,
-
3
},
/* (44) cmd ::= ALTER LOCAL ids */
{
19
8
,
-
4
},
/* (45) cmd ::= ALTER LOCAL ids ids */
{
19
8
,
-
4
},
/* (46) cmd ::= ALTER DATABASE ids alter_db_optr */
{
19
8
,
-
4
},
/* (47) cmd ::= ALTER TOPIC ids alter_topic_optr */
{
19
8
,
-
4
},
/* (48) cmd ::= ALTER ACCOUNT ids acct_optr */
{
19
8
,
-
6
},
/* (49) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */
{
19
8
,
-
6
},
/* (50) cmd ::= COMPACT VNODES IN LP exprlist RP */
{
200
,
-
1
},
/* (51) ids ::= ID */
{
200
,
-
1
},
/* (52) ids ::= STRING */
{
20
2
,
-
2
},
/* (53) ifexists ::= IF EXISTS */
{
20
2
,
0
},
/* (54) ifexists ::= */
{
20
7
,
-
3
},
/* (55) ifnotexists ::= IF NOT EXISTS */
{
20
7
,
0
},
/* (56) ifnotexists ::= */
{
19
8
,
-
3
},
/* (57) cmd ::= CREATE DNODE ids */
{
19
8
,
-
6
},
/* (58) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
{
19
8
,
-
5
},
/* (59) cmd ::= CREATE DATABASE ifnotexists ids db_optr */
{
19
8
,
-
5
},
/* (60) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */
{
19
8
,
-
8
},
/* (61) cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
{
19
8
,
-
9
},
/* (62) cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
{
19
8
,
-
5
},
/* (63) cmd ::= CREATE USER ids PASS ids */
{
21
1
,
0
},
/* (64) bufsize ::= */
{
21
1
,
-
2
},
/* (65) bufsize ::= BUFSIZE INTEGER */
{
21
2
,
0
},
/* (66) pps ::= */
{
21
2
,
-
2
},
/* (67) pps ::= PPS INTEGER */
{
21
3
,
0
},
/* (68) tseries ::= */
{
21
3
,
-
2
},
/* (69) tseries ::= TSERIES INTEGER */
{
21
4
,
0
},
/* (70) dbs ::= */
{
21
4
,
-
2
},
/* (71) dbs ::= DBS INTEGER */
{
21
5
,
0
},
/* (72) streams ::= */
{
21
5
,
-
2
},
/* (73) streams ::= STREAMS INTEGER */
{
21
6
,
0
},
/* (74) storage ::= */
{
21
6
,
-
2
},
/* (75) storage ::= STORAGE INTEGER */
{
21
7
,
0
},
/* (76) qtime ::= */
{
21
7
,
-
2
},
/* (77) qtime ::= QTIME INTEGER */
{
21
8
,
0
},
/* (78) users ::= */
{
21
8
,
-
2
},
/* (79) users ::= USERS INTEGER */
{
21
9
,
0
},
/* (80) conns ::= */
{
21
9
,
-
2
},
/* (81) conns ::= CONNS INTEGER */
{
2
20
,
0
},
/* (82) state ::= */
{
2
20
,
-
2
},
/* (83) state ::= STATE ids */
{
20
5
,
-
9
},
/* (84) acct_optr ::= pps tseries storage streams qtime dbs users conns state */
{
22
1
,
-
3
},
/* (85) intitemlist ::= intitemlist COMMA intitem */
{
22
1
,
-
1
},
/* (86) intitemlist ::= intitem */
{
22
2
,
-
1
},
/* (87) intitem ::= INTEGER */
{
22
3
,
-
2
},
/* (88) keep ::= KEEP intitemlist */
{
22
4
,
-
2
},
/* (89) cache ::= CACHE INTEGER */
{
22
5
,
-
2
},
/* (90) replica ::= REPLICA INTEGER */
{
22
6
,
-
2
},
/* (91) quorum ::= QUORUM INTEGER */
{
22
7
,
-
2
},
/* (92) days ::= DAYS INTEGER */
{
22
8
,
-
2
},
/* (93) minrows ::= MINROWS INTEGER */
{
22
9
,
-
2
},
/* (94) maxrows ::= MAXROWS INTEGER */
{
2
30
,
-
2
},
/* (95) blocks ::= BLOCKS INTEGER */
{
23
1
,
-
2
},
/* (96) ctime ::= CTIME INTEGER */
{
23
2
,
-
2
},
/* (97) wal ::= WAL INTEGER */
{
23
3
,
-
2
},
/* (98) fsync ::= FSYNC INTEGER */
{
23
4
,
-
2
},
/* (99) comp ::= COMP INTEGER */
{
23
5
,
-
2
},
/* (100) prec ::= PRECISION STRING */
{
23
6
,
-
2
},
/* (101) update ::= UPDATE INTEGER */
{
23
7
,
-
2
},
/* (102) cachelast ::= CACHELAST INTEGER */
{
23
8
,
-
2
},
/* (103) partitions ::= PARTITIONS INTEGER */
{
20
8
,
0
},
/* (104) db_optr ::= */
{
20
8
,
-
2
},
/* (105) db_optr ::= db_optr cache */
{
20
8
,
-
2
},
/* (106) db_optr ::= db_optr replica */
{
20
8
,
-
2
},
/* (107) db_optr ::= db_optr quorum */
{
20
8
,
-
2
},
/* (108) db_optr ::= db_optr days */
{
20
8
,
-
2
},
/* (109) db_optr ::= db_optr minrows */
{
20
8
,
-
2
},
/* (110) db_optr ::= db_optr maxrows */
{
20
8
,
-
2
},
/* (111) db_optr ::= db_optr blocks */
{
20
8
,
-
2
},
/* (112) db_optr ::= db_optr ctime */
{
20
8
,
-
2
},
/* (113) db_optr ::= db_optr wal */
{
20
8
,
-
2
},
/* (114) db_optr ::= db_optr fsync */
{
20
8
,
-
2
},
/* (115) db_optr ::= db_optr comp */
{
20
8
,
-
2
},
/* (116) db_optr ::= db_optr prec */
{
20
8
,
-
2
},
/* (117) db_optr ::= db_optr keep */
{
20
8
,
-
2
},
/* (118) db_optr ::= db_optr update */
{
20
8
,
-
2
},
/* (119) db_optr ::= db_optr cachelast */
{
20
9
,
-
1
},
/* (120) topic_optr ::= db_optr */
{
20
9
,
-
2
},
/* (121) topic_optr ::= topic_optr partitions */
{
20
3
,
0
},
/* (122) alter_db_optr ::= */
{
20
3
,
-
2
},
/* (123) alter_db_optr ::= alter_db_optr replica */
{
20
3
,
-
2
},
/* (124) alter_db_optr ::= alter_db_optr quorum */
{
20
3
,
-
2
},
/* (125) alter_db_optr ::= alter_db_optr keep */
{
20
3
,
-
2
},
/* (126) alter_db_optr ::= alter_db_optr blocks */
{
20
3
,
-
2
},
/* (127) alter_db_optr ::= alter_db_optr comp */
{
20
3
,
-
2
},
/* (128) alter_db_optr ::= alter_db_optr update */
{
20
3
,
-
2
},
/* (129) alter_db_optr ::= alter_db_optr cachelast */
{
20
4
,
-
1
},
/* (130) alter_topic_optr ::= alter_db_optr */
{
20
4
,
-
2
},
/* (131) alter_topic_optr ::= alter_topic_optr partitions */
{
2
10
,
-
1
},
/* (132) typename ::= ids */
{
2
10
,
-
4
},
/* (133) typename ::= ids LP signed RP */
{
2
10
,
-
2
},
/* (134) typename ::= ids UNSIGNED */
{
23
9
,
-
1
},
/* (135) signed ::= INTEGER */
{
23
9
,
-
2
},
/* (136) signed ::= PLUS INTEGER */
{
23
9
,
-
2
},
/* (137) signed ::= MINUS INTEGER */
{
19
8
,
-
3
},
/* (138) cmd ::= CREATE TABLE create_table_args */
{
19
8
,
-
3
},
/* (139) cmd ::= CREATE TABLE create_stable_args */
{
19
8
,
-
3
},
/* (140) cmd ::= CREATE STABLE create_stable_args */
{
19
8
,
-
3
},
/* (141) cmd ::= CREATE TABLE create_table_list */
{
24
2
,
-
1
},
/* (142) create_table_list ::= create_from_stable */
{
24
2
,
-
2
},
/* (143) create_table_list ::= create_table_list create_from_stable */
{
2
40
,
-
6
},
/* (144) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
{
24
1
,
-
10
},
/* (145) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
{
24
3
,
-
10
},
/* (146) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */
{
24
3
,
-
13
},
/* (147) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */
{
24
6
,
-
3
},
/* (148) tagNamelist ::= tagNamelist COMMA ids */
{
24
6
,
-
1
},
/* (149) tagNamelist ::= ids */
{
2
40
,
-
5
},
/* (150) create_table_args ::= ifnotexists ids cpxName AS select */
{
24
4
,
-
3
},
/* (151) columnlist ::= columnlist COMMA column */
{
24
4
,
-
1
},
/* (152) columnlist ::= column */
{
24
8
,
-
2
},
/* (153) column ::= ids typename */
{
24
5
,
-
3
},
/* (154) tagitemlist ::= tagitemlist COMMA tagitem */
{
24
5
,
-
1
},
/* (155) tagitemlist ::= tagitem */
{
24
9
,
-
1
},
/* (156) tagitem ::= INTEGER */
{
24
9
,
-
1
},
/* (157) tagitem ::= FLOAT */
{
24
9
,
-
1
},
/* (158) tagitem ::= STRING */
{
24
9
,
-
1
},
/* (159) tagitem ::= BOOL */
{
24
9
,
-
1
},
/* (160) tagitem ::= NULL */
{
24
9
,
-
1
},
/* (161) tagitem ::= NOW */
{
24
9
,
-
2
},
/* (162) tagitem ::= MINUS INTEGER */
{
24
9
,
-
2
},
/* (163) tagitem ::= MINUS FLOAT */
{
24
9
,
-
2
},
/* (164) tagitem ::= PLUS INTEGER */
{
24
9
,
-
2
},
/* (165) tagitem ::= PLUS FLOAT */
{
24
7
,
-
14
},
/* (166) select ::= SELECT selcollist from where_opt interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */
{
24
7
,
-
3
},
/* (167) select ::= LP select RP */
{
26
3
,
-
1
},
/* (168) union ::= select */
{
26
3
,
-
4
},
/* (169) union ::= union UNION ALL select */
{
19
8
,
-
1
},
/* (170) cmd ::= union */
{
24
7
,
-
2
},
/* (171) select ::= SELECT selcollist */
{
26
4
,
-
2
},
/* (172) sclp ::= selcollist COMMA */
{
26
4
,
0
},
/* (173) sclp ::= */
{
2
50
,
-
4
},
/* (174) selcollist ::= sclp distinct expr as */
{
2
50
,
-
2
},
/* (175) selcollist ::= sclp STAR */
{
26
7
,
-
2
},
/* (176) as ::= AS ids */
{
26
7
,
-
1
},
/* (177) as ::= ids */
{
26
7
,
0
},
/* (178) as ::= */
{
26
5
,
-
1
},
/* (179) distinct ::= DISTINCT */
{
26
5
,
0
},
/* (180) distinct ::= */
{
25
1
,
-
2
},
/* (181) from ::= FROM tablelist */
{
25
1
,
-
2
},
/* (182) from ::= FROM sub */
{
26
9
,
-
3
},
/* (183) sub ::= LP union RP */
{
26
9
,
-
4
},
/* (184) sub ::= LP union RP ids */
{
26
9
,
-
6
},
/* (185) sub ::= sub COMMA LP union RP ids */
{
26
8
,
-
2
},
/* (186) tablelist ::= ids cpxName */
{
26
8
,
-
3
},
/* (187) tablelist ::= ids cpxName ids */
{
26
8
,
-
4
},
/* (188) tablelist ::= tablelist COMMA ids cpxName */
{
26
8
,
-
5
},
/* (189) tablelist ::= tablelist COMMA ids cpxName ids */
{
2
70
,
-
1
},
/* (190) tmvar ::= VARIABLE */
{
25
3
,
-
4
},
/* (191) interval_option ::= intervalKey LP tmvar RP */
{
25
3
,
-
6
},
/* (192) interval_option ::= intervalKey LP tmvar COMMA tmvar RP */
{
25
3
,
0
},
/* (193) interval_option ::= */
{
27
1
,
-
1
},
/* (194) intervalKey ::= INTERVAL */
{
27
1
,
-
1
},
/* (195) intervalKey ::= EVERY */
{
25
5
,
0
},
/* (196) session_option ::= */
{
25
5
,
-
7
},
/* (197) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */
{
25
6
,
0
},
/* (198) windowstate_option ::= */
{
25
6
,
-
4
},
/* (199) windowstate_option ::= STATE_WINDOW LP ids RP */
{
25
7
,
0
},
/* (200) fill_opt ::= */
{
25
7
,
-
6
},
/* (201) fill_opt ::= FILL LP ID COMMA tagitemlist RP */
{
25
7
,
-
4
},
/* (202) fill_opt ::= FILL LP ID RP */
{
25
4
,
-
4
},
/* (203) sliding_opt ::= SLIDING LP tmvar RP */
{
25
4
,
0
},
/* (204) sliding_opt ::= */
{
2
60
,
0
},
/* (205) orderby_opt ::= */
{
2
60
,
-
3
},
/* (206) orderby_opt ::= ORDER BY sortlist */
{
27
2
,
-
4
},
/* (207) sortlist ::= sortlist COMMA item sortorder */
{
27
2
,
-
2
},
/* (208) sortlist ::= item sortorder */
{
27
4
,
-
2
},
/* (209) item ::= ids cpxName */
{
27
5
,
-
1
},
/* (210) sortorder ::= ASC */
{
27
5
,
-
1
},
/* (211) sortorder ::= DESC */
{
27
5
,
0
},
/* (212) sortorder ::= */
{
25
8
,
0
},
/* (213) groupby_opt ::= */
{
25
8
,
-
3
},
/* (214) groupby_opt ::= GROUP BY grouplist */
{
27
6
,
-
3
},
/* (215) grouplist ::= grouplist COMMA item */
{
27
6
,
-
1
},
/* (216) grouplist ::= item */
{
25
9
,
0
},
/* (217) having_opt ::= */
{
25
9
,
-
2
},
/* (218) having_opt ::= HAVING expr */
{
26
2
,
0
},
/* (219) limit_opt ::= */
{
26
2
,
-
2
},
/* (220) limit_opt ::= LIMIT signed */
{
26
2
,
-
4
},
/* (221) limit_opt ::= LIMIT signed OFFSET signed */
{
26
2
,
-
4
},
/* (222) limit_opt ::= LIMIT signed COMMA signed */
{
26
1
,
0
},
/* (223) slimit_opt ::= */
{
26
1
,
-
2
},
/* (224) slimit_opt ::= SLIMIT signed */
{
26
1
,
-
4
},
/* (225) slimit_opt ::= SLIMIT signed SOFFSET signed */
{
26
1
,
-
4
},
/* (226) slimit_opt ::= SLIMIT signed COMMA signed */
{
25
2
,
0
},
/* (227) where_opt ::= */
{
25
2
,
-
2
},
/* (228) where_opt ::= WHERE expr */
{
26
6
,
-
3
},
/* (229) expr ::= LP expr RP */
{
26
6
,
-
1
},
/* (230) expr ::= ID */
{
26
6
,
-
3
},
/* (231) expr ::= ID DOT ID */
{
26
6
,
-
3
},
/* (232) expr ::= ID DOT STAR */
{
26
6
,
-
1
},
/* (233) expr ::= INTEGER */
{
26
6
,
-
2
},
/* (234) expr ::= MINUS INTEGER */
{
26
6
,
-
2
},
/* (235) expr ::= PLUS INTEGER */
{
26
6
,
-
1
},
/* (236) expr ::= FLOAT */
{
26
6
,
-
2
},
/* (237) expr ::= MINUS FLOAT */
{
26
6
,
-
2
},
/* (238) expr ::= PLUS FLOAT */
{
26
6
,
-
1
},
/* (239) expr ::= STRING */
{
26
6
,
-
1
},
/* (240) expr ::= NOW */
{
26
6
,
-
1
},
/* (241) expr ::= VARIABLE */
{
26
6
,
-
2
},
/* (242) expr ::= PLUS VARIABLE */
{
26
6
,
-
2
},
/* (243) expr ::= MINUS VARIABLE */
{
26
6
,
-
1
},
/* (244) expr ::= BOOL */
{
26
6
,
-
1
},
/* (245) expr ::= NULL */
{
26
6
,
-
4
},
/* (246) expr ::= ID LP exprlist RP */
{
26
6
,
-
4
},
/* (247) expr ::= ID LP STAR RP */
{
26
6
,
-
3
},
/* (248) expr ::= expr IS NULL */
{
26
6
,
-
4
},
/* (249) expr ::= expr IS NOT NULL */
{
26
6
,
-
3
},
/* (250) expr ::= expr LT expr */
{
26
6
,
-
3
},
/* (251) expr ::= expr GT expr */
{
26
6
,
-
3
},
/* (252) expr ::= expr LE expr */
{
26
6
,
-
3
},
/* (253) expr ::= expr GE expr */
{
26
6
,
-
3
},
/* (254) expr ::= expr NE expr */
{
26
6
,
-
3
},
/* (255) expr ::= expr EQ expr */
{
26
6
,
-
5
},
/* (256) expr ::= expr BETWEEN expr AND expr */
{
26
6
,
-
3
},
/* (257) expr ::= expr AND expr */
{
26
6
,
-
3
},
/* (258) expr ::= expr OR expr */
{
26
6
,
-
3
},
/* (259) expr ::= expr PLUS expr */
{
26
6
,
-
3
},
/* (260) expr ::= expr MINUS expr */
{
26
6
,
-
3
},
/* (261) expr ::= expr STAR expr */
{
26
6
,
-
3
},
/* (262) expr ::= expr SLASH expr */
{
26
6
,
-
3
},
/* (263) expr ::= expr REM expr */
{
26
6
,
-
3
},
/* (264) expr ::= expr LIKE expr */
{
26
6
,
-
5
},
/* (265) expr ::= expr IN LP exprlist RP */
{
20
6
,
-
3
},
/* (266) exprlist ::= exprlist COMMA expritem */
{
20
6
,
-
1
},
/* (267) exprlist ::= expritem */
{
27
7
,
-
1
},
/* (268) expritem ::= expr */
{
27
7
,
0
},
/* (269) expritem ::= */
{
19
8
,
-
3
},
/* (270) cmd ::= RESET QUERY CACHE */
{
19
8
,
-
3
},
/* (271) cmd ::= SYNCDB ids REPLICA */
{
19
8
,
-
7
},
/* (272) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
{
19
8
,
-
7
},
/* (273) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
{
19
8
,
-
7
},
/* (274) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */
{
19
8
,
-
7
},
/* (275) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
{
19
8
,
-
7
},
/* (276) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
{
19
8
,
-
8
},
/* (277) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
{
19
8
,
-
9
},
/* (278) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
{
19
8
,
-
7
},
/* (279) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */
{
19
8
,
-
7
},
/* (280) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
{
19
8
,
-
7
},
/* (281) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
{
19
8
,
-
7
},
/* (282) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */
{
19
8
,
-
7
},
/* (283) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
{
19
8
,
-
7
},
/* (284) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
{
19
8
,
-
8
},
/* (285) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
{
19
8
,
-
9
},
/* (286) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */
{
19
8
,
-
7
},
/* (287) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */
{
19
8
,
-
3
},
/* (288) cmd ::= KILL CONNECTION INTEGER */
{
19
8
,
-
5
},
/* (289) cmd ::= KILL STREAM INTEGER COLON INTEGER */
{
19
8
,
-
5
},
/* (290) cmd ::= KILL QUERY INTEGER COLON INTEGER */
};
static
void
yy_accept
(
yyParser
*
);
/* Forward Declaration */
...
...
@@ -2400,16 +2402,16 @@ static YYACTIONTYPE yy_reduce(
break
;
case
46
:
/* cmd ::= ALTER DATABASE ids alter_db_optr */
case
47
:
/* cmd ::= ALTER TOPIC ids alter_topic_optr */
yytestcase
(
yyruleno
==
47
);
{
SStrToken
t
=
{
0
};
setCreateDbInfo
(
pInfo
,
TSDB_SQL_ALTER_DB
,
&
yymsp
[
-
1
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy
246
,
&
t
);}
{
SStrToken
t
=
{
0
};
setCreateDbInfo
(
pInfo
,
TSDB_SQL_ALTER_DB
,
&
yymsp
[
-
1
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy
90
,
&
t
);}
break
;
case
48
:
/* cmd ::= ALTER ACCOUNT ids acct_optr */
{
setCreateAcctSql
(
pInfo
,
TSDB_SQL_ALTER_ACCT
,
&
yymsp
[
-
1
].
minor
.
yy0
,
NULL
,
&
yymsp
[
0
].
minor
.
yy
377
);}
{
setCreateAcctSql
(
pInfo
,
TSDB_SQL_ALTER_ACCT
,
&
yymsp
[
-
1
].
minor
.
yy0
,
NULL
,
&
yymsp
[
0
].
minor
.
yy
171
);}
break
;
case
49
:
/* cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */
{
setCreateAcctSql
(
pInfo
,
TSDB_SQL_ALTER_ACCT
,
&
yymsp
[
-
3
].
minor
.
yy0
,
&
yymsp
[
-
1
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy
377
);}
{
setCreateAcctSql
(
pInfo
,
TSDB_SQL_ALTER_ACCT
,
&
yymsp
[
-
3
].
minor
.
yy0
,
&
yymsp
[
-
1
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy
171
);}
break
;
case
50
:
/* cmd ::= COMPACT VNODES IN LP exprlist RP */
{
setCompactVnodeSql
(
pInfo
,
TSDB_SQL_COMPACT_VNODE
,
yymsp
[
-
1
].
minor
.
yy4
03
);}
{
setCompactVnodeSql
(
pInfo
,
TSDB_SQL_COMPACT_VNODE
,
yymsp
[
-
1
].
minor
.
yy4
21
);}
break
;
case
51
:
/* ids ::= ID */
case
52
:
/* ids ::= STRING */
yytestcase
(
yyruleno
==
52
);
...
...
@@ -2431,17 +2433,17 @@ static YYACTIONTYPE yy_reduce(
{
setDCLSqlElems
(
pInfo
,
TSDB_SQL_CREATE_DNODE
,
1
,
&
yymsp
[
0
].
minor
.
yy0
);}
break
;
case
58
:
/* cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
{
setCreateAcctSql
(
pInfo
,
TSDB_SQL_CREATE_ACCT
,
&
yymsp
[
-
3
].
minor
.
yy0
,
&
yymsp
[
-
1
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy
377
);}
{
setCreateAcctSql
(
pInfo
,
TSDB_SQL_CREATE_ACCT
,
&
yymsp
[
-
3
].
minor
.
yy0
,
&
yymsp
[
-
1
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy
171
);}
break
;
case
59
:
/* cmd ::= CREATE DATABASE ifnotexists ids db_optr */
case
60
:
/* cmd ::= CREATE TOPIC ifnotexists ids topic_optr */
yytestcase
(
yyruleno
==
60
);
{
setCreateDbInfo
(
pInfo
,
TSDB_SQL_CREATE_DB
,
&
yymsp
[
-
1
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy
246
,
&
yymsp
[
-
2
].
minor
.
yy0
);}
{
setCreateDbInfo
(
pInfo
,
TSDB_SQL_CREATE_DB
,
&
yymsp
[
-
1
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy
90
,
&
yymsp
[
-
2
].
minor
.
yy0
);}
break
;
case
61
:
/* cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
{
setCreateFuncInfo
(
pInfo
,
TSDB_SQL_CREATE_FUNCTION
,
&
yymsp
[
-
5
].
minor
.
yy0
,
&
yymsp
[
-
3
].
minor
.
yy0
,
&
yymsp
[
-
1
].
minor
.
yy
36
3
,
&
yymsp
[
0
].
minor
.
yy0
,
1
);}
{
setCreateFuncInfo
(
pInfo
,
TSDB_SQL_CREATE_FUNCTION
,
&
yymsp
[
-
5
].
minor
.
yy0
,
&
yymsp
[
-
3
].
minor
.
yy0
,
&
yymsp
[
-
1
].
minor
.
yy
18
3
,
&
yymsp
[
0
].
minor
.
yy0
,
1
);}
break
;
case
62
:
/* cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
{
setCreateFuncInfo
(
pInfo
,
TSDB_SQL_CREATE_FUNCTION
,
&
yymsp
[
-
5
].
minor
.
yy0
,
&
yymsp
[
-
3
].
minor
.
yy0
,
&
yymsp
[
-
1
].
minor
.
yy
36
3
,
&
yymsp
[
0
].
minor
.
yy0
,
2
);}
{
setCreateFuncInfo
(
pInfo
,
TSDB_SQL_CREATE_FUNCTION
,
&
yymsp
[
-
5
].
minor
.
yy0
,
&
yymsp
[
-
3
].
minor
.
yy0
,
&
yymsp
[
-
1
].
minor
.
yy
18
3
,
&
yymsp
[
0
].
minor
.
yy0
,
2
);}
break
;
case
63
:
/* cmd ::= CREATE USER ids PASS ids */
{
setCreateUserSql
(
pInfo
,
&
yymsp
[
-
2
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy0
);}
...
...
@@ -2472,38 +2474,38 @@ static YYACTIONTYPE yy_reduce(
break
;
case
84
:
/* acct_optr ::= pps tseries storage streams qtime dbs users conns state */
{
yylhsminor
.
yy
377
.
maxUsers
=
(
yymsp
[
-
2
].
minor
.
yy0
.
n
>
0
)
?
atoi
(
yymsp
[
-
2
].
minor
.
yy0
.
z
)
:-
1
;
yylhsminor
.
yy
377
.
maxDbs
=
(
yymsp
[
-
3
].
minor
.
yy0
.
n
>
0
)
?
atoi
(
yymsp
[
-
3
].
minor
.
yy0
.
z
)
:-
1
;
yylhsminor
.
yy
377
.
maxTimeSeries
=
(
yymsp
[
-
7
].
minor
.
yy0
.
n
>
0
)
?
atoi
(
yymsp
[
-
7
].
minor
.
yy0
.
z
)
:-
1
;
yylhsminor
.
yy
377
.
maxStreams
=
(
yymsp
[
-
5
].
minor
.
yy0
.
n
>
0
)
?
atoi
(
yymsp
[
-
5
].
minor
.
yy0
.
z
)
:-
1
;
yylhsminor
.
yy
377
.
maxPointsPerSecond
=
(
yymsp
[
-
8
].
minor
.
yy0
.
n
>
0
)
?
atoi
(
yymsp
[
-
8
].
minor
.
yy0
.
z
)
:-
1
;
yylhsminor
.
yy
377
.
maxStorage
=
(
yymsp
[
-
6
].
minor
.
yy0
.
n
>
0
)
?
strtoll
(
yymsp
[
-
6
].
minor
.
yy0
.
z
,
NULL
,
10
)
:-
1
;
yylhsminor
.
yy
377
.
maxQueryTime
=
(
yymsp
[
-
4
].
minor
.
yy0
.
n
>
0
)
?
strtoll
(
yymsp
[
-
4
].
minor
.
yy0
.
z
,
NULL
,
10
)
:-
1
;
yylhsminor
.
yy
377
.
maxConnections
=
(
yymsp
[
-
1
].
minor
.
yy0
.
n
>
0
)
?
atoi
(
yymsp
[
-
1
].
minor
.
yy0
.
z
)
:-
1
;
yylhsminor
.
yy
377
.
stat
=
yymsp
[
0
].
minor
.
yy0
;
yylhsminor
.
yy
171
.
maxUsers
=
(
yymsp
[
-
2
].
minor
.
yy0
.
n
>
0
)
?
atoi
(
yymsp
[
-
2
].
minor
.
yy0
.
z
)
:-
1
;
yylhsminor
.
yy
171
.
maxDbs
=
(
yymsp
[
-
3
].
minor
.
yy0
.
n
>
0
)
?
atoi
(
yymsp
[
-
3
].
minor
.
yy0
.
z
)
:-
1
;
yylhsminor
.
yy
171
.
maxTimeSeries
=
(
yymsp
[
-
7
].
minor
.
yy0
.
n
>
0
)
?
atoi
(
yymsp
[
-
7
].
minor
.
yy0
.
z
)
:-
1
;
yylhsminor
.
yy
171
.
maxStreams
=
(
yymsp
[
-
5
].
minor
.
yy0
.
n
>
0
)
?
atoi
(
yymsp
[
-
5
].
minor
.
yy0
.
z
)
:-
1
;
yylhsminor
.
yy
171
.
maxPointsPerSecond
=
(
yymsp
[
-
8
].
minor
.
yy0
.
n
>
0
)
?
atoi
(
yymsp
[
-
8
].
minor
.
yy0
.
z
)
:-
1
;
yylhsminor
.
yy
171
.
maxStorage
=
(
yymsp
[
-
6
].
minor
.
yy0
.
n
>
0
)
?
strtoll
(
yymsp
[
-
6
].
minor
.
yy0
.
z
,
NULL
,
10
)
:-
1
;
yylhsminor
.
yy
171
.
maxQueryTime
=
(
yymsp
[
-
4
].
minor
.
yy0
.
n
>
0
)
?
strtoll
(
yymsp
[
-
4
].
minor
.
yy0
.
z
,
NULL
,
10
)
:-
1
;
yylhsminor
.
yy
171
.
maxConnections
=
(
yymsp
[
-
1
].
minor
.
yy0
.
n
>
0
)
?
atoi
(
yymsp
[
-
1
].
minor
.
yy0
.
z
)
:-
1
;
yylhsminor
.
yy
171
.
stat
=
yymsp
[
0
].
minor
.
yy0
;
}
yymsp
[
-
8
].
minor
.
yy
377
=
yylhsminor
.
yy377
;
yymsp
[
-
8
].
minor
.
yy
171
=
yylhsminor
.
yy171
;
break
;
case
85
:
/* intitemlist ::= intitemlist COMMA intitem */
case
154
:
/* tagitemlist ::= tagitemlist COMMA tagitem */
yytestcase
(
yyruleno
==
154
);
{
yylhsminor
.
yy4
03
=
tVariantListAppend
(
yymsp
[
-
2
].
minor
.
yy403
,
&
yymsp
[
0
].
minor
.
yy488
,
-
1
);
}
yymsp
[
-
2
].
minor
.
yy4
03
=
yylhsminor
.
yy403
;
{
yylhsminor
.
yy4
21
=
tVariantListAppend
(
yymsp
[
-
2
].
minor
.
yy421
,
&
yymsp
[
0
].
minor
.
yy430
,
-
1
);
}
yymsp
[
-
2
].
minor
.
yy4
21
=
yylhsminor
.
yy421
;
break
;
case
86
:
/* intitemlist ::= intitem */
case
155
:
/* tagitemlist ::= tagitem */
yytestcase
(
yyruleno
==
155
);
{
yylhsminor
.
yy4
03
=
tVariantListAppend
(
NULL
,
&
yymsp
[
0
].
minor
.
yy488
,
-
1
);
}
yymsp
[
0
].
minor
.
yy4
03
=
yylhsminor
.
yy403
;
{
yylhsminor
.
yy4
21
=
tVariantListAppend
(
NULL
,
&
yymsp
[
0
].
minor
.
yy430
,
-
1
);
}
yymsp
[
0
].
minor
.
yy4
21
=
yylhsminor
.
yy421
;
break
;
case
87
:
/* intitem ::= INTEGER */
case
156
:
/* tagitem ::= INTEGER */
yytestcase
(
yyruleno
==
156
);
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
.
yy4
88
,
&
yymsp
[
0
].
minor
.
yy0
);
}
yymsp
[
0
].
minor
.
yy4
88
=
yylhsminor
.
yy488
;
{
toTSDBType
(
yymsp
[
0
].
minor
.
yy0
.
type
);
tVariantCreate
(
&
yylhsminor
.
yy4
30
,
&
yymsp
[
0
].
minor
.
yy0
);
}
yymsp
[
0
].
minor
.
yy4
30
=
yylhsminor
.
yy430
;
break
;
case
88
:
/* keep ::= KEEP intitemlist */
{
yymsp
[
-
1
].
minor
.
yy4
03
=
yymsp
[
0
].
minor
.
yy403
;
}
{
yymsp
[
-
1
].
minor
.
yy4
21
=
yymsp
[
0
].
minor
.
yy421
;
}
break
;
case
89
:
/* cache ::= CACHE INTEGER */
case
90
:
/* replica ::= REPLICA INTEGER */
yytestcase
(
yyruleno
==
90
);
...
...
@@ -2523,221 +2525,221 @@ static YYACTIONTYPE yy_reduce(
{
yymsp
[
-
1
].
minor
.
yy0
=
yymsp
[
0
].
minor
.
yy0
;
}
break
;
case
104
:
/* db_optr ::= */
{
setDefaultCreateDbOption
(
&
yymsp
[
1
].
minor
.
yy
246
);
yymsp
[
1
].
minor
.
yy246
.
dbType
=
TSDB_DB_TYPE_DEFAULT
;}
{
setDefaultCreateDbOption
(
&
yymsp
[
1
].
minor
.
yy
90
);
yymsp
[
1
].
minor
.
yy90
.
dbType
=
TSDB_DB_TYPE_DEFAULT
;}
break
;
case
105
:
/* db_optr ::= db_optr cache */
{
yylhsminor
.
yy
246
=
yymsp
[
-
1
].
minor
.
yy246
;
yylhsminor
.
yy246
.
cacheBlockSize
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
yymsp
[
-
1
].
minor
.
yy
246
=
yylhsminor
.
yy246
;
{
yylhsminor
.
yy
90
=
yymsp
[
-
1
].
minor
.
yy90
;
yylhsminor
.
yy90
.
cacheBlockSize
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
yymsp
[
-
1
].
minor
.
yy
90
=
yylhsminor
.
yy90
;
break
;
case
106
:
/* db_optr ::= db_optr replica */
case
123
:
/* alter_db_optr ::= alter_db_optr replica */
yytestcase
(
yyruleno
==
123
);
{
yylhsminor
.
yy
246
=
yymsp
[
-
1
].
minor
.
yy246
;
yylhsminor
.
yy246
.
replica
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
yymsp
[
-
1
].
minor
.
yy
246
=
yylhsminor
.
yy246
;
{
yylhsminor
.
yy
90
=
yymsp
[
-
1
].
minor
.
yy90
;
yylhsminor
.
yy90
.
replica
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
yymsp
[
-
1
].
minor
.
yy
90
=
yylhsminor
.
yy90
;
break
;
case
107
:
/* db_optr ::= db_optr quorum */
case
124
:
/* alter_db_optr ::= alter_db_optr quorum */
yytestcase
(
yyruleno
==
124
);
{
yylhsminor
.
yy
246
=
yymsp
[
-
1
].
minor
.
yy246
;
yylhsminor
.
yy246
.
quorum
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
yymsp
[
-
1
].
minor
.
yy
246
=
yylhsminor
.
yy246
;
{
yylhsminor
.
yy
90
=
yymsp
[
-
1
].
minor
.
yy90
;
yylhsminor
.
yy90
.
quorum
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
yymsp
[
-
1
].
minor
.
yy
90
=
yylhsminor
.
yy90
;
break
;
case
108
:
/* db_optr ::= db_optr days */
{
yylhsminor
.
yy
246
=
yymsp
[
-
1
].
minor
.
yy246
;
yylhsminor
.
yy246
.
daysPerFile
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
yymsp
[
-
1
].
minor
.
yy
246
=
yylhsminor
.
yy246
;
{
yylhsminor
.
yy
90
=
yymsp
[
-
1
].
minor
.
yy90
;
yylhsminor
.
yy90
.
daysPerFile
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
yymsp
[
-
1
].
minor
.
yy
90
=
yylhsminor
.
yy90
;
break
;
case
109
:
/* db_optr ::= db_optr minrows */
{
yylhsminor
.
yy
246
=
yymsp
[
-
1
].
minor
.
yy246
;
yylhsminor
.
yy246
.
minRowsPerBlock
=
strtod
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
);
}
yymsp
[
-
1
].
minor
.
yy
246
=
yylhsminor
.
yy246
;
{
yylhsminor
.
yy
90
=
yymsp
[
-
1
].
minor
.
yy90
;
yylhsminor
.
yy90
.
minRowsPerBlock
=
strtod
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
);
}
yymsp
[
-
1
].
minor
.
yy
90
=
yylhsminor
.
yy90
;
break
;
case
110
:
/* db_optr ::= db_optr maxrows */
{
yylhsminor
.
yy
246
=
yymsp
[
-
1
].
minor
.
yy246
;
yylhsminor
.
yy246
.
maxRowsPerBlock
=
strtod
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
);
}
yymsp
[
-
1
].
minor
.
yy
246
=
yylhsminor
.
yy246
;
{
yylhsminor
.
yy
90
=
yymsp
[
-
1
].
minor
.
yy90
;
yylhsminor
.
yy90
.
maxRowsPerBlock
=
strtod
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
);
}
yymsp
[
-
1
].
minor
.
yy
90
=
yylhsminor
.
yy90
;
break
;
case
111
:
/* db_optr ::= db_optr blocks */
case
126
:
/* alter_db_optr ::= alter_db_optr blocks */
yytestcase
(
yyruleno
==
126
);
{
yylhsminor
.
yy
246
=
yymsp
[
-
1
].
minor
.
yy246
;
yylhsminor
.
yy246
.
numOfBlocks
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
yymsp
[
-
1
].
minor
.
yy
246
=
yylhsminor
.
yy246
;
{
yylhsminor
.
yy
90
=
yymsp
[
-
1
].
minor
.
yy90
;
yylhsminor
.
yy90
.
numOfBlocks
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
yymsp
[
-
1
].
minor
.
yy
90
=
yylhsminor
.
yy90
;
break
;
case
112
:
/* db_optr ::= db_optr ctime */
{
yylhsminor
.
yy
246
=
yymsp
[
-
1
].
minor
.
yy246
;
yylhsminor
.
yy246
.
commitTime
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
yymsp
[
-
1
].
minor
.
yy
246
=
yylhsminor
.
yy246
;
{
yylhsminor
.
yy
90
=
yymsp
[
-
1
].
minor
.
yy90
;
yylhsminor
.
yy90
.
commitTime
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
yymsp
[
-
1
].
minor
.
yy
90
=
yylhsminor
.
yy90
;
break
;
case
113
:
/* db_optr ::= db_optr wal */
{
yylhsminor
.
yy
246
=
yymsp
[
-
1
].
minor
.
yy246
;
yylhsminor
.
yy246
.
walLevel
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
yymsp
[
-
1
].
minor
.
yy
246
=
yylhsminor
.
yy246
;
{
yylhsminor
.
yy
90
=
yymsp
[
-
1
].
minor
.
yy90
;
yylhsminor
.
yy90
.
walLevel
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
yymsp
[
-
1
].
minor
.
yy
90
=
yylhsminor
.
yy90
;
break
;
case
114
:
/* db_optr ::= db_optr fsync */
{
yylhsminor
.
yy
246
=
yymsp
[
-
1
].
minor
.
yy246
;
yylhsminor
.
yy246
.
fsyncPeriod
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
yymsp
[
-
1
].
minor
.
yy
246
=
yylhsminor
.
yy246
;
{
yylhsminor
.
yy
90
=
yymsp
[
-
1
].
minor
.
yy90
;
yylhsminor
.
yy90
.
fsyncPeriod
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
yymsp
[
-
1
].
minor
.
yy
90
=
yylhsminor
.
yy90
;
break
;
case
115
:
/* db_optr ::= db_optr comp */
case
127
:
/* alter_db_optr ::= alter_db_optr comp */
yytestcase
(
yyruleno
==
127
);
{
yylhsminor
.
yy
246
=
yymsp
[
-
1
].
minor
.
yy246
;
yylhsminor
.
yy246
.
compressionLevel
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
yymsp
[
-
1
].
minor
.
yy
246
=
yylhsminor
.
yy246
;
{
yylhsminor
.
yy
90
=
yymsp
[
-
1
].
minor
.
yy90
;
yylhsminor
.
yy90
.
compressionLevel
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
yymsp
[
-
1
].
minor
.
yy
90
=
yylhsminor
.
yy90
;
break
;
case
116
:
/* db_optr ::= db_optr prec */
{
yylhsminor
.
yy
246
=
yymsp
[
-
1
].
minor
.
yy246
;
yylhsminor
.
yy246
.
precision
=
yymsp
[
0
].
minor
.
yy0
;
}
yymsp
[
-
1
].
minor
.
yy
246
=
yylhsminor
.
yy246
;
{
yylhsminor
.
yy
90
=
yymsp
[
-
1
].
minor
.
yy90
;
yylhsminor
.
yy90
.
precision
=
yymsp
[
0
].
minor
.
yy0
;
}
yymsp
[
-
1
].
minor
.
yy
90
=
yylhsminor
.
yy90
;
break
;
case
117
:
/* db_optr ::= db_optr keep */
case
125
:
/* alter_db_optr ::= alter_db_optr keep */
yytestcase
(
yyruleno
==
125
);
{
yylhsminor
.
yy
246
=
yymsp
[
-
1
].
minor
.
yy246
;
yylhsminor
.
yy246
.
keep
=
yymsp
[
0
].
minor
.
yy403
;
}
yymsp
[
-
1
].
minor
.
yy
246
=
yylhsminor
.
yy246
;
{
yylhsminor
.
yy
90
=
yymsp
[
-
1
].
minor
.
yy90
;
yylhsminor
.
yy90
.
keep
=
yymsp
[
0
].
minor
.
yy421
;
}
yymsp
[
-
1
].
minor
.
yy
90
=
yylhsminor
.
yy90
;
break
;
case
118
:
/* db_optr ::= db_optr update */
case
128
:
/* alter_db_optr ::= alter_db_optr update */
yytestcase
(
yyruleno
==
128
);
{
yylhsminor
.
yy
246
=
yymsp
[
-
1
].
minor
.
yy246
;
yylhsminor
.
yy246
.
update
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
yymsp
[
-
1
].
minor
.
yy
246
=
yylhsminor
.
yy246
;
{
yylhsminor
.
yy
90
=
yymsp
[
-
1
].
minor
.
yy90
;
yylhsminor
.
yy90
.
update
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
yymsp
[
-
1
].
minor
.
yy
90
=
yylhsminor
.
yy90
;
break
;
case
119
:
/* db_optr ::= db_optr cachelast */
case
129
:
/* alter_db_optr ::= alter_db_optr cachelast */
yytestcase
(
yyruleno
==
129
);
{
yylhsminor
.
yy
246
=
yymsp
[
-
1
].
minor
.
yy246
;
yylhsminor
.
yy246
.
cachelast
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
yymsp
[
-
1
].
minor
.
yy
246
=
yylhsminor
.
yy246
;
{
yylhsminor
.
yy
90
=
yymsp
[
-
1
].
minor
.
yy90
;
yylhsminor
.
yy90
.
cachelast
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
yymsp
[
-
1
].
minor
.
yy
90
=
yylhsminor
.
yy90
;
break
;
case
120
:
/* topic_optr ::= db_optr */
case
130
:
/* alter_topic_optr ::= alter_db_optr */
yytestcase
(
yyruleno
==
130
);
{
yylhsminor
.
yy
246
=
yymsp
[
0
].
minor
.
yy246
;
yylhsminor
.
yy246
.
dbType
=
TSDB_DB_TYPE_TOPIC
;
}
yymsp
[
0
].
minor
.
yy
246
=
yylhsminor
.
yy246
;
{
yylhsminor
.
yy
90
=
yymsp
[
0
].
minor
.
yy90
;
yylhsminor
.
yy90
.
dbType
=
TSDB_DB_TYPE_TOPIC
;
}
yymsp
[
0
].
minor
.
yy
90
=
yylhsminor
.
yy90
;
break
;
case
121
:
/* topic_optr ::= topic_optr partitions */
case
131
:
/* alter_topic_optr ::= alter_topic_optr partitions */
yytestcase
(
yyruleno
==
131
);
{
yylhsminor
.
yy
246
=
yymsp
[
-
1
].
minor
.
yy246
;
yylhsminor
.
yy246
.
partitions
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
yymsp
[
-
1
].
minor
.
yy
246
=
yylhsminor
.
yy246
;
{
yylhsminor
.
yy
90
=
yymsp
[
-
1
].
minor
.
yy90
;
yylhsminor
.
yy90
.
partitions
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
yymsp
[
-
1
].
minor
.
yy
90
=
yylhsminor
.
yy90
;
break
;
case
122
:
/* alter_db_optr ::= */
{
setDefaultCreateDbOption
(
&
yymsp
[
1
].
minor
.
yy
246
);
yymsp
[
1
].
minor
.
yy246
.
dbType
=
TSDB_DB_TYPE_DEFAULT
;}
{
setDefaultCreateDbOption
(
&
yymsp
[
1
].
minor
.
yy
90
);
yymsp
[
1
].
minor
.
yy90
.
dbType
=
TSDB_DB_TYPE_DEFAULT
;}
break
;
case
132
:
/* typename ::= ids */
{
yymsp
[
0
].
minor
.
yy0
.
type
=
0
;
tSetColumnType
(
&
yylhsminor
.
yy
36
3
,
&
yymsp
[
0
].
minor
.
yy0
);
tSetColumnType
(
&
yylhsminor
.
yy
18
3
,
&
yymsp
[
0
].
minor
.
yy0
);
}
yymsp
[
0
].
minor
.
yy
363
=
yylhsminor
.
yy36
3
;
yymsp
[
0
].
minor
.
yy
183
=
yylhsminor
.
yy18
3
;
break
;
case
133
:
/* typename ::= ids LP signed RP */
{
if
(
yymsp
[
-
1
].
minor
.
yy3
87
<=
0
)
{
if
(
yymsp
[
-
1
].
minor
.
yy3
25
<=
0
)
{
yymsp
[
-
3
].
minor
.
yy0
.
type
=
0
;
tSetColumnType
(
&
yylhsminor
.
yy
36
3
,
&
yymsp
[
-
3
].
minor
.
yy0
);
tSetColumnType
(
&
yylhsminor
.
yy
18
3
,
&
yymsp
[
-
3
].
minor
.
yy0
);
}
else
{
yymsp
[
-
3
].
minor
.
yy0
.
type
=
-
yymsp
[
-
1
].
minor
.
yy3
87
;
// negative value of name length
tSetColumnType
(
&
yylhsminor
.
yy
36
3
,
&
yymsp
[
-
3
].
minor
.
yy0
);
yymsp
[
-
3
].
minor
.
yy0
.
type
=
-
yymsp
[
-
1
].
minor
.
yy3
25
;
// negative value of name length
tSetColumnType
(
&
yylhsminor
.
yy
18
3
,
&
yymsp
[
-
3
].
minor
.
yy0
);
}
}
yymsp
[
-
3
].
minor
.
yy
363
=
yylhsminor
.
yy36
3
;
yymsp
[
-
3
].
minor
.
yy
183
=
yylhsminor
.
yy18
3
;
break
;
case
134
:
/* typename ::= ids UNSIGNED */
{
yymsp
[
-
1
].
minor
.
yy0
.
type
=
0
;
yymsp
[
-
1
].
minor
.
yy0
.
n
=
((
yymsp
[
0
].
minor
.
yy0
.
z
+
yymsp
[
0
].
minor
.
yy0
.
n
)
-
yymsp
[
-
1
].
minor
.
yy0
.
z
);
tSetColumnType
(
&
yylhsminor
.
yy
36
3
,
&
yymsp
[
-
1
].
minor
.
yy0
);
tSetColumnType
(
&
yylhsminor
.
yy
18
3
,
&
yymsp
[
-
1
].
minor
.
yy0
);
}
yymsp
[
-
1
].
minor
.
yy
363
=
yylhsminor
.
yy36
3
;
yymsp
[
-
1
].
minor
.
yy
183
=
yylhsminor
.
yy18
3
;
break
;
case
135
:
/* signed ::= INTEGER */
{
yylhsminor
.
yy3
87
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
yymsp
[
0
].
minor
.
yy3
87
=
yylhsminor
.
yy387
;
{
yylhsminor
.
yy3
25
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
yymsp
[
0
].
minor
.
yy3
25
=
yylhsminor
.
yy325
;
break
;
case
136
:
/* signed ::= PLUS INTEGER */
{
yymsp
[
-
1
].
minor
.
yy3
87
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
{
yymsp
[
-
1
].
minor
.
yy3
25
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
break
;
case
137
:
/* signed ::= MINUS INTEGER */
{
yymsp
[
-
1
].
minor
.
yy3
87
=
-
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);}
{
yymsp
[
-
1
].
minor
.
yy3
25
=
-
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);}
break
;
case
141
:
/* cmd ::= CREATE TABLE create_table_list */
{
pInfo
->
type
=
TSDB_SQL_CREATE_TABLE
;
pInfo
->
pCreateTableInfo
=
yymsp
[
0
].
minor
.
yy
56
;}
{
pInfo
->
type
=
TSDB_SQL_CREATE_TABLE
;
pInfo
->
pCreateTableInfo
=
yymsp
[
0
].
minor
.
yy
438
;}
break
;
case
142
:
/* create_table_list ::= create_from_stable */
{
SCreateTableSql
*
pCreateTable
=
calloc
(
1
,
sizeof
(
SCreateTableSql
));
pCreateTable
->
childTableInfo
=
taosArrayInit
(
4
,
sizeof
(
SCreatedTableInfo
));
taosArrayPush
(
pCreateTable
->
childTableInfo
,
&
yymsp
[
0
].
minor
.
yy
84
);
taosArrayPush
(
pCreateTable
->
childTableInfo
,
&
yymsp
[
0
].
minor
.
yy
152
);
pCreateTable
->
type
=
TSQL_CREATE_TABLE_FROM_STABLE
;
yylhsminor
.
yy
56
=
pCreateTable
;
yylhsminor
.
yy
438
=
pCreateTable
;
}
yymsp
[
0
].
minor
.
yy
56
=
yylhsminor
.
yy56
;
yymsp
[
0
].
minor
.
yy
438
=
yylhsminor
.
yy438
;
break
;
case
143
:
/* create_table_list ::= create_table_list create_from_stable */
{
taosArrayPush
(
yymsp
[
-
1
].
minor
.
yy
56
->
childTableInfo
,
&
yymsp
[
0
].
minor
.
yy84
);
yylhsminor
.
yy
56
=
yymsp
[
-
1
].
minor
.
yy56
;
taosArrayPush
(
yymsp
[
-
1
].
minor
.
yy
438
->
childTableInfo
,
&
yymsp
[
0
].
minor
.
yy152
);
yylhsminor
.
yy
438
=
yymsp
[
-
1
].
minor
.
yy438
;
}
yymsp
[
-
1
].
minor
.
yy
56
=
yylhsminor
.
yy56
;
yymsp
[
-
1
].
minor
.
yy
438
=
yylhsminor
.
yy438
;
break
;
case
144
:
/* create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
{
yylhsminor
.
yy
56
=
tSetCreateTableInfo
(
yymsp
[
-
1
].
minor
.
yy403
,
NULL
,
NULL
,
TSQL_CREATE_TABLE
);
setSqlInfo
(
pInfo
,
yylhsminor
.
yy
56
,
NULL
,
TSDB_SQL_CREATE_TABLE
);
yylhsminor
.
yy
438
=
tSetCreateTableInfo
(
yymsp
[
-
1
].
minor
.
yy421
,
NULL
,
NULL
,
TSQL_CREATE_TABLE
);
setSqlInfo
(
pInfo
,
yylhsminor
.
yy
438
,
NULL
,
TSDB_SQL_CREATE_TABLE
);
yymsp
[
-
4
].
minor
.
yy0
.
n
+=
yymsp
[
-
3
].
minor
.
yy0
.
n
;
setCreatedTableName
(
pInfo
,
&
yymsp
[
-
4
].
minor
.
yy0
,
&
yymsp
[
-
5
].
minor
.
yy0
);
}
yymsp
[
-
5
].
minor
.
yy
56
=
yylhsminor
.
yy56
;
yymsp
[
-
5
].
minor
.
yy
438
=
yylhsminor
.
yy438
;
break
;
case
145
:
/* create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
{
yylhsminor
.
yy
56
=
tSetCreateTableInfo
(
yymsp
[
-
5
].
minor
.
yy403
,
yymsp
[
-
1
].
minor
.
yy403
,
NULL
,
TSQL_CREATE_STABLE
);
setSqlInfo
(
pInfo
,
yylhsminor
.
yy
56
,
NULL
,
TSDB_SQL_CREATE_TABLE
);
yylhsminor
.
yy
438
=
tSetCreateTableInfo
(
yymsp
[
-
5
].
minor
.
yy421
,
yymsp
[
-
1
].
minor
.
yy421
,
NULL
,
TSQL_CREATE_STABLE
);
setSqlInfo
(
pInfo
,
yylhsminor
.
yy
438
,
NULL
,
TSDB_SQL_CREATE_TABLE
);
yymsp
[
-
8
].
minor
.
yy0
.
n
+=
yymsp
[
-
7
].
minor
.
yy0
.
n
;
setCreatedTableName
(
pInfo
,
&
yymsp
[
-
8
].
minor
.
yy0
,
&
yymsp
[
-
9
].
minor
.
yy0
);
}
yymsp
[
-
9
].
minor
.
yy
56
=
yylhsminor
.
yy56
;
yymsp
[
-
9
].
minor
.
yy
438
=
yylhsminor
.
yy438
;
break
;
case
146
:
/* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */
{
yymsp
[
-
5
].
minor
.
yy0
.
n
+=
yymsp
[
-
4
].
minor
.
yy0
.
n
;
yymsp
[
-
8
].
minor
.
yy0
.
n
+=
yymsp
[
-
7
].
minor
.
yy0
.
n
;
yylhsminor
.
yy
84
=
createNewChildTableInfo
(
&
yymsp
[
-
5
].
minor
.
yy0
,
NULL
,
yymsp
[
-
1
].
minor
.
yy403
,
&
yymsp
[
-
8
].
minor
.
yy0
,
&
yymsp
[
-
9
].
minor
.
yy0
);
yylhsminor
.
yy
152
=
createNewChildTableInfo
(
&
yymsp
[
-
5
].
minor
.
yy0
,
NULL
,
yymsp
[
-
1
].
minor
.
yy421
,
&
yymsp
[
-
8
].
minor
.
yy0
,
&
yymsp
[
-
9
].
minor
.
yy0
);
}
yymsp
[
-
9
].
minor
.
yy
84
=
yylhsminor
.
yy84
;
yymsp
[
-
9
].
minor
.
yy
152
=
yylhsminor
.
yy152
;
break
;
case
147
:
/* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */
{
yymsp
[
-
8
].
minor
.
yy0
.
n
+=
yymsp
[
-
7
].
minor
.
yy0
.
n
;
yymsp
[
-
11
].
minor
.
yy0
.
n
+=
yymsp
[
-
10
].
minor
.
yy0
.
n
;
yylhsminor
.
yy
84
=
createNewChildTableInfo
(
&
yymsp
[
-
8
].
minor
.
yy0
,
yymsp
[
-
5
].
minor
.
yy403
,
yymsp
[
-
1
].
minor
.
yy403
,
&
yymsp
[
-
11
].
minor
.
yy0
,
&
yymsp
[
-
12
].
minor
.
yy0
);
yylhsminor
.
yy
152
=
createNewChildTableInfo
(
&
yymsp
[
-
8
].
minor
.
yy0
,
yymsp
[
-
5
].
minor
.
yy421
,
yymsp
[
-
1
].
minor
.
yy421
,
&
yymsp
[
-
11
].
minor
.
yy0
,
&
yymsp
[
-
12
].
minor
.
yy0
);
}
yymsp
[
-
12
].
minor
.
yy
84
=
yylhsminor
.
yy84
;
yymsp
[
-
12
].
minor
.
yy
152
=
yylhsminor
.
yy152
;
break
;
case
148
:
/* tagNamelist ::= tagNamelist COMMA ids */
{
taosArrayPush
(
yymsp
[
-
2
].
minor
.
yy4
03
,
&
yymsp
[
0
].
minor
.
yy0
);
yylhsminor
.
yy403
=
yymsp
[
-
2
].
minor
.
yy403
;
}
yymsp
[
-
2
].
minor
.
yy4
03
=
yylhsminor
.
yy403
;
{
taosArrayPush
(
yymsp
[
-
2
].
minor
.
yy4
21
,
&
yymsp
[
0
].
minor
.
yy0
);
yylhsminor
.
yy421
=
yymsp
[
-
2
].
minor
.
yy421
;
}
yymsp
[
-
2
].
minor
.
yy4
21
=
yylhsminor
.
yy421
;
break
;
case
149
:
/* tagNamelist ::= ids */
{
yylhsminor
.
yy4
03
=
taosArrayInit
(
4
,
sizeof
(
SStrToken
));
taosArrayPush
(
yylhsminor
.
yy403
,
&
yymsp
[
0
].
minor
.
yy0
);}
yymsp
[
0
].
minor
.
yy4
03
=
yylhsminor
.
yy403
;
{
yylhsminor
.
yy4
21
=
taosArrayInit
(
4
,
sizeof
(
SStrToken
));
taosArrayPush
(
yylhsminor
.
yy421
,
&
yymsp
[
0
].
minor
.
yy0
);}
yymsp
[
0
].
minor
.
yy4
21
=
yylhsminor
.
yy421
;
break
;
case
150
:
/* create_table_args ::= ifnotexists ids cpxName AS select */
{
yylhsminor
.
yy
56
=
tSetCreateTableInfo
(
NULL
,
NULL
,
yymsp
[
0
].
minor
.
yy224
,
TSQL_CREATE_STREAM
);
setSqlInfo
(
pInfo
,
yylhsminor
.
yy
56
,
NULL
,
TSDB_SQL_CREATE_TABLE
);
yylhsminor
.
yy
438
=
tSetCreateTableInfo
(
NULL
,
NULL
,
yymsp
[
0
].
minor
.
yy56
,
TSQL_CREATE_STREAM
);
setSqlInfo
(
pInfo
,
yylhsminor
.
yy
438
,
NULL
,
TSDB_SQL_CREATE_TABLE
);
yymsp
[
-
3
].
minor
.
yy0
.
n
+=
yymsp
[
-
2
].
minor
.
yy0
.
n
;
setCreatedTableName
(
pInfo
,
&
yymsp
[
-
3
].
minor
.
yy0
,
&
yymsp
[
-
4
].
minor
.
yy0
);
}
yymsp
[
-
4
].
minor
.
yy
56
=
yylhsminor
.
yy56
;
yymsp
[
-
4
].
minor
.
yy
438
=
yylhsminor
.
yy438
;
break
;
case
151
:
/* columnlist ::= columnlist COMMA column */
{
taosArrayPush
(
yymsp
[
-
2
].
minor
.
yy4
03
,
&
yymsp
[
0
].
minor
.
yy363
);
yylhsminor
.
yy403
=
yymsp
[
-
2
].
minor
.
yy403
;
}
yymsp
[
-
2
].
minor
.
yy4
03
=
yylhsminor
.
yy403
;
{
taosArrayPush
(
yymsp
[
-
2
].
minor
.
yy4
21
,
&
yymsp
[
0
].
minor
.
yy183
);
yylhsminor
.
yy421
=
yymsp
[
-
2
].
minor
.
yy421
;
}
yymsp
[
-
2
].
minor
.
yy4
21
=
yylhsminor
.
yy421
;
break
;
case
152
:
/* columnlist ::= column */
{
yylhsminor
.
yy4
03
=
taosArrayInit
(
4
,
sizeof
(
TAOS_FIELD
));
taosArrayPush
(
yylhsminor
.
yy403
,
&
yymsp
[
0
].
minor
.
yy36
3
);}
yymsp
[
0
].
minor
.
yy4
03
=
yylhsminor
.
yy403
;
{
yylhsminor
.
yy4
21
=
taosArrayInit
(
4
,
sizeof
(
TAOS_FIELD
));
taosArrayPush
(
yylhsminor
.
yy421
,
&
yymsp
[
0
].
minor
.
yy18
3
);}
yymsp
[
0
].
minor
.
yy4
21
=
yylhsminor
.
yy421
;
break
;
case
153
:
/* column ::= ids typename */
{
tSetColumnInfo
(
&
yylhsminor
.
yy
363
,
&
yymsp
[
-
1
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy36
3
);
tSetColumnInfo
(
&
yylhsminor
.
yy
183
,
&
yymsp
[
-
1
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy18
3
);
}
yymsp
[
-
1
].
minor
.
yy
363
=
yylhsminor
.
yy36
3
;
yymsp
[
-
1
].
minor
.
yy
183
=
yylhsminor
.
yy18
3
;
break
;
case
160
:
/* tagitem ::= NULL */
{
yymsp
[
0
].
minor
.
yy0
.
type
=
0
;
tVariantCreate
(
&
yylhsminor
.
yy4
88
,
&
yymsp
[
0
].
minor
.
yy0
);
}
yymsp
[
0
].
minor
.
yy4
88
=
yylhsminor
.
yy488
;
{
yymsp
[
0
].
minor
.
yy0
.
type
=
0
;
tVariantCreate
(
&
yylhsminor
.
yy4
30
,
&
yymsp
[
0
].
minor
.
yy0
);
}
yymsp
[
0
].
minor
.
yy4
30
=
yylhsminor
.
yy430
;
break
;
case
161
:
/* tagitem ::= NOW */
{
yymsp
[
0
].
minor
.
yy0
.
type
=
TSDB_DATA_TYPE_TIMESTAMP
;
tVariantCreate
(
&
yylhsminor
.
yy4
88
,
&
yymsp
[
0
].
minor
.
yy0
);}
yymsp
[
0
].
minor
.
yy4
88
=
yylhsminor
.
yy488
;
{
yymsp
[
0
].
minor
.
yy0
.
type
=
TSDB_DATA_TYPE_TIMESTAMP
;
tVariantCreate
(
&
yylhsminor
.
yy4
30
,
&
yymsp
[
0
].
minor
.
yy0
);}
yymsp
[
0
].
minor
.
yy4
30
=
yylhsminor
.
yy430
;
break
;
case
162
:
/* tagitem ::= MINUS INTEGER */
case
163
:
/* tagitem ::= MINUS FLOAT */
yytestcase
(
yyruleno
==
163
);
...
...
@@ -2747,56 +2749,56 @@ static YYACTIONTYPE yy_reduce(
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
.
yy4
88
,
&
yymsp
[
-
1
].
minor
.
yy0
);
tVariantCreate
(
&
yylhsminor
.
yy4
30
,
&
yymsp
[
-
1
].
minor
.
yy0
);
}
yymsp
[
-
1
].
minor
.
yy4
88
=
yylhsminor
.
yy488
;
yymsp
[
-
1
].
minor
.
yy4
30
=
yylhsminor
.
yy430
;
break
;
case
166
:
/* select ::= SELECT selcollist from where_opt interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */
{
yylhsminor
.
yy
224
=
tSetQuerySqlNode
(
&
yymsp
[
-
13
].
minor
.
yy0
,
yymsp
[
-
12
].
minor
.
yy403
,
yymsp
[
-
11
].
minor
.
yy114
,
yymsp
[
-
10
].
minor
.
yy260
,
yymsp
[
-
4
].
minor
.
yy403
,
yymsp
[
-
2
].
minor
.
yy403
,
&
yymsp
[
-
9
].
minor
.
yy222
,
&
yymsp
[
-
7
].
minor
.
yy365
,
&
yymsp
[
-
6
].
minor
.
yy544
,
&
yymsp
[
-
8
].
minor
.
yy0
,
yymsp
[
-
5
].
minor
.
yy403
,
&
yymsp
[
0
].
minor
.
yy404
,
&
yymsp
[
-
1
].
minor
.
yy404
,
yymsp
[
-
3
].
minor
.
yy260
);
yylhsminor
.
yy
56
=
tSetQuerySqlNode
(
&
yymsp
[
-
13
].
minor
.
yy0
,
yymsp
[
-
12
].
minor
.
yy421
,
yymsp
[
-
11
].
minor
.
yy8
,
yymsp
[
-
10
].
minor
.
yy439
,
yymsp
[
-
4
].
minor
.
yy421
,
yymsp
[
-
2
].
minor
.
yy421
,
&
yymsp
[
-
9
].
minor
.
yy400
,
&
yymsp
[
-
7
].
minor
.
yy147
,
&
yymsp
[
-
6
].
minor
.
yy40
,
&
yymsp
[
-
8
].
minor
.
yy0
,
yymsp
[
-
5
].
minor
.
yy421
,
&
yymsp
[
0
].
minor
.
yy166
,
&
yymsp
[
-
1
].
minor
.
yy166
,
yymsp
[
-
3
].
minor
.
yy439
);
}
yymsp
[
-
13
].
minor
.
yy
224
=
yylhsminor
.
yy224
;
yymsp
[
-
13
].
minor
.
yy
56
=
yylhsminor
.
yy56
;
break
;
case
167
:
/* select ::= LP select RP */
{
yymsp
[
-
2
].
minor
.
yy
224
=
yymsp
[
-
1
].
minor
.
yy224
;}
{
yymsp
[
-
2
].
minor
.
yy
56
=
yymsp
[
-
1
].
minor
.
yy56
;}
break
;
case
168
:
/* union ::= select */
{
yylhsminor
.
yy4
03
=
setSubclause
(
NULL
,
yymsp
[
0
].
minor
.
yy224
);
}
yymsp
[
0
].
minor
.
yy4
03
=
yylhsminor
.
yy403
;
{
yylhsminor
.
yy4
21
=
setSubclause
(
NULL
,
yymsp
[
0
].
minor
.
yy56
);
}
yymsp
[
0
].
minor
.
yy4
21
=
yylhsminor
.
yy421
;
break
;
case
169
:
/* union ::= union UNION ALL select */
{
yylhsminor
.
yy4
03
=
appendSelectClause
(
yymsp
[
-
3
].
minor
.
yy403
,
yymsp
[
0
].
minor
.
yy224
);
}
yymsp
[
-
3
].
minor
.
yy4
03
=
yylhsminor
.
yy403
;
{
yylhsminor
.
yy4
21
=
appendSelectClause
(
yymsp
[
-
3
].
minor
.
yy421
,
yymsp
[
0
].
minor
.
yy56
);
}
yymsp
[
-
3
].
minor
.
yy4
21
=
yylhsminor
.
yy421
;
break
;
case
170
:
/* cmd ::= union */
{
setSqlInfo
(
pInfo
,
yymsp
[
0
].
minor
.
yy4
03
,
NULL
,
TSDB_SQL_SELECT
);
}
{
setSqlInfo
(
pInfo
,
yymsp
[
0
].
minor
.
yy4
21
,
NULL
,
TSDB_SQL_SELECT
);
}
break
;
case
171
:
/* select ::= SELECT selcollist */
{
yylhsminor
.
yy
224
=
tSetQuerySqlNode
(
&
yymsp
[
-
1
].
minor
.
yy0
,
yymsp
[
0
].
minor
.
yy403
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
yylhsminor
.
yy
56
=
tSetQuerySqlNode
(
&
yymsp
[
-
1
].
minor
.
yy0
,
yymsp
[
0
].
minor
.
yy421
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
}
yymsp
[
-
1
].
minor
.
yy
224
=
yylhsminor
.
yy224
;
yymsp
[
-
1
].
minor
.
yy
56
=
yylhsminor
.
yy56
;
break
;
case
172
:
/* sclp ::= selcollist COMMA */
{
yylhsminor
.
yy4
03
=
yymsp
[
-
1
].
minor
.
yy403
;}
yymsp
[
-
1
].
minor
.
yy4
03
=
yylhsminor
.
yy403
;
{
yylhsminor
.
yy4
21
=
yymsp
[
-
1
].
minor
.
yy421
;}
yymsp
[
-
1
].
minor
.
yy4
21
=
yylhsminor
.
yy421
;
break
;
case
173
:
/* sclp ::= */
case
205
:
/* orderby_opt ::= */
yytestcase
(
yyruleno
==
205
);
{
yymsp
[
1
].
minor
.
yy4
03
=
0
;}
{
yymsp
[
1
].
minor
.
yy4
21
=
0
;}
break
;
case
174
:
/* selcollist ::= sclp distinct expr as */
{
yylhsminor
.
yy4
03
=
tSqlExprListAppend
(
yymsp
[
-
3
].
minor
.
yy403
,
yymsp
[
-
1
].
minor
.
yy260
,
yymsp
[
-
2
].
minor
.
yy0
.
n
?
&
yymsp
[
-
2
].
minor
.
yy0
:
0
,
yymsp
[
0
].
minor
.
yy0
.
n
?&
yymsp
[
0
].
minor
.
yy0
:
0
);
yylhsminor
.
yy4
21
=
tSqlExprListAppend
(
yymsp
[
-
3
].
minor
.
yy421
,
yymsp
[
-
1
].
minor
.
yy439
,
yymsp
[
-
2
].
minor
.
yy0
.
n
?
&
yymsp
[
-
2
].
minor
.
yy0
:
0
,
yymsp
[
0
].
minor
.
yy0
.
n
?&
yymsp
[
0
].
minor
.
yy0
:
0
);
}
yymsp
[
-
3
].
minor
.
yy4
03
=
yylhsminor
.
yy403
;
yymsp
[
-
3
].
minor
.
yy4
21
=
yylhsminor
.
yy421
;
break
;
case
175
:
/* selcollist ::= sclp STAR */
{
tSqlExpr
*
pNode
=
tSqlExprCreateIdValue
(
NULL
,
TK_ALL
);
yylhsminor
.
yy4
03
=
tSqlExprListAppend
(
yymsp
[
-
1
].
minor
.
yy403
,
pNode
,
0
,
0
);
yylhsminor
.
yy4
21
=
tSqlExprListAppend
(
yymsp
[
-
1
].
minor
.
yy421
,
pNode
,
0
,
0
);
}
yymsp
[
-
1
].
minor
.
yy4
03
=
yylhsminor
.
yy403
;
yymsp
[
-
1
].
minor
.
yy4
21
=
yylhsminor
.
yy421
;
break
;
case
176
:
/* as ::= AS ids */
{
yymsp
[
-
1
].
minor
.
yy0
=
yymsp
[
0
].
minor
.
yy0
;
}
...
...
@@ -2814,85 +2816,85 @@ static YYACTIONTYPE yy_reduce(
break
;
case
181
:
/* from ::= FROM tablelist */
case
182
:
/* from ::= FROM sub */
yytestcase
(
yyruleno
==
182
);
{
yymsp
[
-
1
].
minor
.
yy
114
=
yymsp
[
0
].
minor
.
yy114
;}
{
yymsp
[
-
1
].
minor
.
yy
8
=
yymsp
[
0
].
minor
.
yy8
;}
break
;
case
183
:
/* sub ::= LP union RP */
{
yymsp
[
-
2
].
minor
.
yy
114
=
addSubqueryElem
(
NULL
,
yymsp
[
-
1
].
minor
.
yy403
,
NULL
);}
{
yymsp
[
-
2
].
minor
.
yy
8
=
addSubqueryElem
(
NULL
,
yymsp
[
-
1
].
minor
.
yy421
,
NULL
);}
break
;
case
184
:
/* sub ::= LP union RP ids */
{
yymsp
[
-
3
].
minor
.
yy
114
=
addSubqueryElem
(
NULL
,
yymsp
[
-
2
].
minor
.
yy403
,
&
yymsp
[
0
].
minor
.
yy0
);}
{
yymsp
[
-
3
].
minor
.
yy
8
=
addSubqueryElem
(
NULL
,
yymsp
[
-
2
].
minor
.
yy421
,
&
yymsp
[
0
].
minor
.
yy0
);}
break
;
case
185
:
/* sub ::= sub COMMA LP union RP ids */
{
yylhsminor
.
yy
114
=
addSubqueryElem
(
yymsp
[
-
5
].
minor
.
yy114
,
yymsp
[
-
2
].
minor
.
yy403
,
&
yymsp
[
0
].
minor
.
yy0
);}
yymsp
[
-
5
].
minor
.
yy
114
=
yylhsminor
.
yy114
;
{
yylhsminor
.
yy
8
=
addSubqueryElem
(
yymsp
[
-
5
].
minor
.
yy8
,
yymsp
[
-
2
].
minor
.
yy421
,
&
yymsp
[
0
].
minor
.
yy0
);}
yymsp
[
-
5
].
minor
.
yy
8
=
yylhsminor
.
yy8
;
break
;
case
186
:
/* tablelist ::= ids cpxName */
{
yymsp
[
-
1
].
minor
.
yy0
.
n
+=
yymsp
[
0
].
minor
.
yy0
.
n
;
yylhsminor
.
yy
114
=
setTableNameList
(
NULL
,
&
yymsp
[
-
1
].
minor
.
yy0
,
NULL
);
yylhsminor
.
yy
8
=
setTableNameList
(
NULL
,
&
yymsp
[
-
1
].
minor
.
yy0
,
NULL
);
}
yymsp
[
-
1
].
minor
.
yy
114
=
yylhsminor
.
yy114
;
yymsp
[
-
1
].
minor
.
yy
8
=
yylhsminor
.
yy8
;
break
;
case
187
:
/* tablelist ::= ids cpxName ids */
{
yymsp
[
-
2
].
minor
.
yy0
.
n
+=
yymsp
[
-
1
].
minor
.
yy0
.
n
;
yylhsminor
.
yy
114
=
setTableNameList
(
NULL
,
&
yymsp
[
-
2
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy0
);
yylhsminor
.
yy
8
=
setTableNameList
(
NULL
,
&
yymsp
[
-
2
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy0
);
}
yymsp
[
-
2
].
minor
.
yy
114
=
yylhsminor
.
yy114
;
yymsp
[
-
2
].
minor
.
yy
8
=
yylhsminor
.
yy8
;
break
;
case
188
:
/* tablelist ::= tablelist COMMA ids cpxName */
{
yymsp
[
-
1
].
minor
.
yy0
.
n
+=
yymsp
[
0
].
minor
.
yy0
.
n
;
yylhsminor
.
yy
114
=
setTableNameList
(
yymsp
[
-
3
].
minor
.
yy114
,
&
yymsp
[
-
1
].
minor
.
yy0
,
NULL
);
yylhsminor
.
yy
8
=
setTableNameList
(
yymsp
[
-
3
].
minor
.
yy8
,
&
yymsp
[
-
1
].
minor
.
yy0
,
NULL
);
}
yymsp
[
-
3
].
minor
.
yy
114
=
yylhsminor
.
yy114
;
yymsp
[
-
3
].
minor
.
yy
8
=
yylhsminor
.
yy8
;
break
;
case
189
:
/* tablelist ::= tablelist COMMA ids cpxName ids */
{
yymsp
[
-
2
].
minor
.
yy0
.
n
+=
yymsp
[
-
1
].
minor
.
yy0
.
n
;
yylhsminor
.
yy
114
=
setTableNameList
(
yymsp
[
-
4
].
minor
.
yy114
,
&
yymsp
[
-
2
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy0
);
yylhsminor
.
yy
8
=
setTableNameList
(
yymsp
[
-
4
].
minor
.
yy8
,
&
yymsp
[
-
2
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy0
);
}
yymsp
[
-
4
].
minor
.
yy
114
=
yylhsminor
.
yy114
;
yymsp
[
-
4
].
minor
.
yy
8
=
yylhsminor
.
yy8
;
break
;
case
190
:
/* tmvar ::= VARIABLE */
{
yylhsminor
.
yy0
=
yymsp
[
0
].
minor
.
yy0
;}
yymsp
[
0
].
minor
.
yy0
=
yylhsminor
.
yy0
;
break
;
case
191
:
/* interval_option ::= intervalKey LP tmvar RP */
{
yylhsminor
.
yy
222
.
interval
=
yymsp
[
-
1
].
minor
.
yy0
;
yylhsminor
.
yy222
.
offset
.
n
=
0
;
yylhsminor
.
yy222
.
token
=
yymsp
[
-
3
].
minor
.
yy202
;}
yymsp
[
-
3
].
minor
.
yy
222
=
yylhsminor
.
yy222
;
{
yylhsminor
.
yy
400
.
interval
=
yymsp
[
-
1
].
minor
.
yy0
;
yylhsminor
.
yy400
.
offset
.
n
=
0
;
yylhsminor
.
yy400
.
token
=
yymsp
[
-
3
].
minor
.
yy104
;}
yymsp
[
-
3
].
minor
.
yy
400
=
yylhsminor
.
yy400
;
break
;
case
192
:
/* interval_option ::= intervalKey LP tmvar COMMA tmvar RP */
{
yylhsminor
.
yy
222
.
interval
=
yymsp
[
-
3
].
minor
.
yy0
;
yylhsminor
.
yy222
.
offset
=
yymsp
[
-
1
].
minor
.
yy0
;
yylhsminor
.
yy222
.
token
=
yymsp
[
-
5
].
minor
.
yy202
;}
yymsp
[
-
5
].
minor
.
yy
222
=
yylhsminor
.
yy222
;
{
yylhsminor
.
yy
400
.
interval
=
yymsp
[
-
3
].
minor
.
yy0
;
yylhsminor
.
yy400
.
offset
=
yymsp
[
-
1
].
minor
.
yy0
;
yylhsminor
.
yy400
.
token
=
yymsp
[
-
5
].
minor
.
yy104
;}
yymsp
[
-
5
].
minor
.
yy
400
=
yylhsminor
.
yy400
;
break
;
case
193
:
/* interval_option ::= */
{
memset
(
&
yymsp
[
1
].
minor
.
yy
222
,
0
,
sizeof
(
yymsp
[
1
].
minor
.
yy222
));}
{
memset
(
&
yymsp
[
1
].
minor
.
yy
400
,
0
,
sizeof
(
yymsp
[
1
].
minor
.
yy400
));}
break
;
case
194
:
/* intervalKey ::= INTERVAL */
{
yymsp
[
0
].
minor
.
yy
202
=
TK_INTERVAL
;}
{
yymsp
[
0
].
minor
.
yy
104
=
TK_INTERVAL
;}
break
;
case
195
:
/* intervalKey ::= EVERY */
{
yymsp
[
0
].
minor
.
yy
202
=
TK_EVERY
;
}
{
yymsp
[
0
].
minor
.
yy
104
=
TK_EVERY
;
}
break
;
case
196
:
/* session_option ::= */
{
yymsp
[
1
].
minor
.
yy
365
.
col
.
n
=
0
;
yymsp
[
1
].
minor
.
yy365
.
gap
.
n
=
0
;}
{
yymsp
[
1
].
minor
.
yy
147
.
col
.
n
=
0
;
yymsp
[
1
].
minor
.
yy147
.
gap
.
n
=
0
;}
break
;
case
197
:
/* session_option ::= SESSION LP ids cpxName COMMA tmvar RP */
{
yymsp
[
-
4
].
minor
.
yy0
.
n
+=
yymsp
[
-
3
].
minor
.
yy0
.
n
;
yymsp
[
-
6
].
minor
.
yy
365
.
col
=
yymsp
[
-
4
].
minor
.
yy0
;
yymsp
[
-
6
].
minor
.
yy
365
.
gap
=
yymsp
[
-
1
].
minor
.
yy0
;
yymsp
[
-
6
].
minor
.
yy
147
.
col
=
yymsp
[
-
4
].
minor
.
yy0
;
yymsp
[
-
6
].
minor
.
yy
147
.
gap
=
yymsp
[
-
1
].
minor
.
yy0
;
}
break
;
case
198
:
/* windowstate_option ::= */
{
yymsp
[
1
].
minor
.
yy
544
.
col
.
n
=
0
;
yymsp
[
1
].
minor
.
yy544
.
col
.
z
=
NULL
;}
{
yymsp
[
1
].
minor
.
yy
40
.
col
.
n
=
0
;
yymsp
[
1
].
minor
.
yy40
.
col
.
z
=
NULL
;}
break
;
case
199
:
/* windowstate_option ::= STATE_WINDOW LP ids RP */
{
yymsp
[
-
3
].
minor
.
yy
544
.
col
=
yymsp
[
-
1
].
minor
.
yy0
;
}
{
yymsp
[
-
3
].
minor
.
yy
40
.
col
=
yymsp
[
-
1
].
minor
.
yy0
;
}
break
;
case
200
:
/* fill_opt ::= */
{
yymsp
[
1
].
minor
.
yy4
03
=
0
;
}
{
yymsp
[
1
].
minor
.
yy4
21
=
0
;
}
break
;
case
201
:
/* fill_opt ::= FILL LP ID COMMA tagitemlist RP */
{
...
...
@@ -2900,14 +2902,14 @@ static YYACTIONTYPE yy_reduce(
toTSDBType
(
yymsp
[
-
3
].
minor
.
yy0
.
type
);
tVariantCreate
(
&
A
,
&
yymsp
[
-
3
].
minor
.
yy0
);
tVariantListInsert
(
yymsp
[
-
1
].
minor
.
yy4
03
,
&
A
,
-
1
,
0
);
yymsp
[
-
5
].
minor
.
yy4
03
=
yymsp
[
-
1
].
minor
.
yy403
;
tVariantListInsert
(
yymsp
[
-
1
].
minor
.
yy4
21
,
&
A
,
-
1
,
0
);
yymsp
[
-
5
].
minor
.
yy4
21
=
yymsp
[
-
1
].
minor
.
yy421
;
}
break
;
case
202
:
/* fill_opt ::= FILL LP ID RP */
{
toTSDBType
(
yymsp
[
-
1
].
minor
.
yy0
.
type
);
yymsp
[
-
3
].
minor
.
yy4
03
=
tVariantListAppendToken
(
NULL
,
&
yymsp
[
-
1
].
minor
.
yy0
,
-
1
);
yymsp
[
-
3
].
minor
.
yy4
21
=
tVariantListAppendToken
(
NULL
,
&
yymsp
[
-
1
].
minor
.
yy0
,
-
1
);
}
break
;
case
203
:
/* sliding_opt ::= SLIDING LP tmvar RP */
...
...
@@ -2917,235 +2919,235 @@ static YYACTIONTYPE yy_reduce(
{
yymsp
[
1
].
minor
.
yy0
.
n
=
0
;
yymsp
[
1
].
minor
.
yy0
.
z
=
NULL
;
yymsp
[
1
].
minor
.
yy0
.
type
=
0
;
}
break
;
case
206
:
/* orderby_opt ::= ORDER BY sortlist */
{
yymsp
[
-
2
].
minor
.
yy4
03
=
yymsp
[
0
].
minor
.
yy403
;}
{
yymsp
[
-
2
].
minor
.
yy4
21
=
yymsp
[
0
].
minor
.
yy421
;}
break
;
case
207
:
/* sortlist ::= sortlist COMMA item sortorder */
{
yylhsminor
.
yy4
03
=
tVariantListAppend
(
yymsp
[
-
3
].
minor
.
yy403
,
&
yymsp
[
-
1
].
minor
.
yy488
,
yymsp
[
0
].
minor
.
yy70
);
yylhsminor
.
yy4
21
=
tVariantListAppend
(
yymsp
[
-
3
].
minor
.
yy421
,
&
yymsp
[
-
1
].
minor
.
yy430
,
yymsp
[
0
].
minor
.
yy96
);
}
yymsp
[
-
3
].
minor
.
yy4
03
=
yylhsminor
.
yy403
;
yymsp
[
-
3
].
minor
.
yy4
21
=
yylhsminor
.
yy421
;
break
;
case
208
:
/* sortlist ::= item sortorder */
{
yylhsminor
.
yy4
03
=
tVariantListAppend
(
NULL
,
&
yymsp
[
-
1
].
minor
.
yy488
,
yymsp
[
0
].
minor
.
yy70
);
yylhsminor
.
yy4
21
=
tVariantListAppend
(
NULL
,
&
yymsp
[
-
1
].
minor
.
yy430
,
yymsp
[
0
].
minor
.
yy96
);
}
yymsp
[
-
1
].
minor
.
yy4
03
=
yylhsminor
.
yy403
;
yymsp
[
-
1
].
minor
.
yy4
21
=
yylhsminor
.
yy421
;
break
;
case
209
:
/* item ::= ids cpxName */
{
toTSDBType
(
yymsp
[
-
1
].
minor
.
yy0
.
type
);
yymsp
[
-
1
].
minor
.
yy0
.
n
+=
yymsp
[
0
].
minor
.
yy0
.
n
;
tVariantCreate
(
&
yylhsminor
.
yy4
88
,
&
yymsp
[
-
1
].
minor
.
yy0
);
tVariantCreate
(
&
yylhsminor
.
yy4
30
,
&
yymsp
[
-
1
].
minor
.
yy0
);
}
yymsp
[
-
1
].
minor
.
yy4
88
=
yylhsminor
.
yy488
;
yymsp
[
-
1
].
minor
.
yy4
30
=
yylhsminor
.
yy430
;
break
;
case
210
:
/* sortorder ::= ASC */
{
yymsp
[
0
].
minor
.
yy
70
=
TSDB_ORDER_ASC
;
}
{
yymsp
[
0
].
minor
.
yy
96
=
TSDB_ORDER_ASC
;
}
break
;
case
211
:
/* sortorder ::= DESC */
{
yymsp
[
0
].
minor
.
yy
70
=
TSDB_ORDER_DESC
;}
{
yymsp
[
0
].
minor
.
yy
96
=
TSDB_ORDER_DESC
;}
break
;
case
212
:
/* sortorder ::= */
{
yymsp
[
1
].
minor
.
yy
70
=
TSDB_ORDER_ASC
;
}
{
yymsp
[
1
].
minor
.
yy
96
=
TSDB_ORDER_ASC
;
}
break
;
case
213
:
/* groupby_opt ::= */
{
yymsp
[
1
].
minor
.
yy4
03
=
0
;}
{
yymsp
[
1
].
minor
.
yy4
21
=
0
;}
break
;
case
214
:
/* groupby_opt ::= GROUP BY grouplist */
{
yymsp
[
-
2
].
minor
.
yy4
03
=
yymsp
[
0
].
minor
.
yy403
;}
{
yymsp
[
-
2
].
minor
.
yy4
21
=
yymsp
[
0
].
minor
.
yy421
;}
break
;
case
215
:
/* grouplist ::= grouplist COMMA item */
{
yylhsminor
.
yy4
03
=
tVariantListAppend
(
yymsp
[
-
2
].
minor
.
yy403
,
&
yymsp
[
0
].
minor
.
yy488
,
-
1
);
yylhsminor
.
yy4
21
=
tVariantListAppend
(
yymsp
[
-
2
].
minor
.
yy421
,
&
yymsp
[
0
].
minor
.
yy430
,
-
1
);
}
yymsp
[
-
2
].
minor
.
yy4
03
=
yylhsminor
.
yy403
;
yymsp
[
-
2
].
minor
.
yy4
21
=
yylhsminor
.
yy421
;
break
;
case
216
:
/* grouplist ::= item */
{
yylhsminor
.
yy4
03
=
tVariantListAppend
(
NULL
,
&
yymsp
[
0
].
minor
.
yy488
,
-
1
);
yylhsminor
.
yy4
21
=
tVariantListAppend
(
NULL
,
&
yymsp
[
0
].
minor
.
yy430
,
-
1
);
}
yymsp
[
0
].
minor
.
yy4
03
=
yylhsminor
.
yy403
;
yymsp
[
0
].
minor
.
yy4
21
=
yylhsminor
.
yy421
;
break
;
case
217
:
/* having_opt ::= */
case
227
:
/* where_opt ::= */
yytestcase
(
yyruleno
==
227
);
case
269
:
/* expritem ::= */
yytestcase
(
yyruleno
==
269
);
{
yymsp
[
1
].
minor
.
yy
260
=
0
;}
{
yymsp
[
1
].
minor
.
yy
439
=
0
;}
break
;
case
218
:
/* having_opt ::= HAVING expr */
case
228
:
/* where_opt ::= WHERE expr */
yytestcase
(
yyruleno
==
228
);
{
yymsp
[
-
1
].
minor
.
yy
260
=
yymsp
[
0
].
minor
.
yy260
;}
{
yymsp
[
-
1
].
minor
.
yy
439
=
yymsp
[
0
].
minor
.
yy439
;}
break
;
case
219
:
/* limit_opt ::= */
case
223
:
/* slimit_opt ::= */
yytestcase
(
yyruleno
==
223
);
{
yymsp
[
1
].
minor
.
yy
404
.
limit
=
-
1
;
yymsp
[
1
].
minor
.
yy404
.
offset
=
0
;}
{
yymsp
[
1
].
minor
.
yy
166
.
limit
=
-
1
;
yymsp
[
1
].
minor
.
yy166
.
offset
=
0
;}
break
;
case
220
:
/* limit_opt ::= LIMIT signed */
case
224
:
/* slimit_opt ::= SLIMIT signed */
yytestcase
(
yyruleno
==
224
);
{
yymsp
[
-
1
].
minor
.
yy
404
.
limit
=
yymsp
[
0
].
minor
.
yy387
;
yymsp
[
-
1
].
minor
.
yy404
.
offset
=
0
;}
{
yymsp
[
-
1
].
minor
.
yy
166
.
limit
=
yymsp
[
0
].
minor
.
yy325
;
yymsp
[
-
1
].
minor
.
yy166
.
offset
=
0
;}
break
;
case
221
:
/* limit_opt ::= LIMIT signed OFFSET signed */
{
yymsp
[
-
3
].
minor
.
yy
404
.
limit
=
yymsp
[
-
2
].
minor
.
yy387
;
yymsp
[
-
3
].
minor
.
yy404
.
offset
=
yymsp
[
0
].
minor
.
yy387
;}
{
yymsp
[
-
3
].
minor
.
yy
166
.
limit
=
yymsp
[
-
2
].
minor
.
yy325
;
yymsp
[
-
3
].
minor
.
yy166
.
offset
=
yymsp
[
0
].
minor
.
yy325
;}
break
;
case
222
:
/* limit_opt ::= LIMIT signed COMMA signed */
{
yymsp
[
-
3
].
minor
.
yy
404
.
limit
=
yymsp
[
0
].
minor
.
yy387
;
yymsp
[
-
3
].
minor
.
yy404
.
offset
=
yymsp
[
-
2
].
minor
.
yy387
;}
{
yymsp
[
-
3
].
minor
.
yy
166
.
limit
=
yymsp
[
0
].
minor
.
yy325
;
yymsp
[
-
3
].
minor
.
yy166
.
offset
=
yymsp
[
-
2
].
minor
.
yy325
;}
break
;
case
225
:
/* slimit_opt ::= SLIMIT signed SOFFSET signed */
{
yymsp
[
-
3
].
minor
.
yy
404
.
limit
=
yymsp
[
-
2
].
minor
.
yy387
;
yymsp
[
-
3
].
minor
.
yy404
.
offset
=
yymsp
[
0
].
minor
.
yy387
;}
{
yymsp
[
-
3
].
minor
.
yy
166
.
limit
=
yymsp
[
-
2
].
minor
.
yy325
;
yymsp
[
-
3
].
minor
.
yy166
.
offset
=
yymsp
[
0
].
minor
.
yy325
;}
break
;
case
226
:
/* slimit_opt ::= SLIMIT signed COMMA signed */
{
yymsp
[
-
3
].
minor
.
yy
404
.
limit
=
yymsp
[
0
].
minor
.
yy387
;
yymsp
[
-
3
].
minor
.
yy404
.
offset
=
yymsp
[
-
2
].
minor
.
yy387
;}
{
yymsp
[
-
3
].
minor
.
yy
166
.
limit
=
yymsp
[
0
].
minor
.
yy325
;
yymsp
[
-
3
].
minor
.
yy166
.
offset
=
yymsp
[
-
2
].
minor
.
yy325
;}
break
;
case
229
:
/* expr ::= LP expr RP */
{
yylhsminor
.
yy
260
=
yymsp
[
-
1
].
minor
.
yy260
;
yylhsminor
.
yy260
->
exprToken
.
z
=
yymsp
[
-
2
].
minor
.
yy0
.
z
;
yylhsminor
.
yy260
->
exprToken
.
n
=
(
yymsp
[
0
].
minor
.
yy0
.
z
-
yymsp
[
-
2
].
minor
.
yy0
.
z
+
1
);}
yymsp
[
-
2
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
yylhsminor
.
yy
439
=
yymsp
[
-
1
].
minor
.
yy439
;
yylhsminor
.
yy439
->
exprToken
.
z
=
yymsp
[
-
2
].
minor
.
yy0
.
z
;
yylhsminor
.
yy439
->
exprToken
.
n
=
(
yymsp
[
0
].
minor
.
yy0
.
z
-
yymsp
[
-
2
].
minor
.
yy0
.
z
+
1
);}
yymsp
[
-
2
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
230
:
/* expr ::= ID */
{
yylhsminor
.
yy
260
=
tSqlExprCreateIdValue
(
&
yymsp
[
0
].
minor
.
yy0
,
TK_ID
);}
yymsp
[
0
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
yylhsminor
.
yy
439
=
tSqlExprCreateIdValue
(
&
yymsp
[
0
].
minor
.
yy0
,
TK_ID
);}
yymsp
[
0
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
231
:
/* expr ::= ID DOT ID */
{
yymsp
[
-
2
].
minor
.
yy0
.
n
+=
(
1
+
yymsp
[
0
].
minor
.
yy0
.
n
);
yylhsminor
.
yy
260
=
tSqlExprCreateIdValue
(
&
yymsp
[
-
2
].
minor
.
yy0
,
TK_ID
);}
yymsp
[
-
2
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
yymsp
[
-
2
].
minor
.
yy0
.
n
+=
(
1
+
yymsp
[
0
].
minor
.
yy0
.
n
);
yylhsminor
.
yy
439
=
tSqlExprCreateIdValue
(
&
yymsp
[
-
2
].
minor
.
yy0
,
TK_ID
);}
yymsp
[
-
2
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
232
:
/* expr ::= ID DOT STAR */
{
yymsp
[
-
2
].
minor
.
yy0
.
n
+=
(
1
+
yymsp
[
0
].
minor
.
yy0
.
n
);
yylhsminor
.
yy
260
=
tSqlExprCreateIdValue
(
&
yymsp
[
-
2
].
minor
.
yy0
,
TK_ALL
);}
yymsp
[
-
2
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
yymsp
[
-
2
].
minor
.
yy0
.
n
+=
(
1
+
yymsp
[
0
].
minor
.
yy0
.
n
);
yylhsminor
.
yy
439
=
tSqlExprCreateIdValue
(
&
yymsp
[
-
2
].
minor
.
yy0
,
TK_ALL
);}
yymsp
[
-
2
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
233
:
/* expr ::= INTEGER */
{
yylhsminor
.
yy
260
=
tSqlExprCreateIdValue
(
&
yymsp
[
0
].
minor
.
yy0
,
TK_INTEGER
);}
yymsp
[
0
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
yylhsminor
.
yy
439
=
tSqlExprCreateIdValue
(
&
yymsp
[
0
].
minor
.
yy0
,
TK_INTEGER
);}
yymsp
[
0
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
234
:
/* expr ::= MINUS INTEGER */
case
235
:
/* expr ::= PLUS INTEGER */
yytestcase
(
yyruleno
==
235
);
{
yymsp
[
-
1
].
minor
.
yy0
.
n
+=
yymsp
[
0
].
minor
.
yy0
.
n
;
yymsp
[
-
1
].
minor
.
yy0
.
type
=
TK_INTEGER
;
yylhsminor
.
yy
260
=
tSqlExprCreateIdValue
(
&
yymsp
[
-
1
].
minor
.
yy0
,
TK_INTEGER
);}
yymsp
[
-
1
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
yymsp
[
-
1
].
minor
.
yy0
.
n
+=
yymsp
[
0
].
minor
.
yy0
.
n
;
yymsp
[
-
1
].
minor
.
yy0
.
type
=
TK_INTEGER
;
yylhsminor
.
yy
439
=
tSqlExprCreateIdValue
(
&
yymsp
[
-
1
].
minor
.
yy0
,
TK_INTEGER
);}
yymsp
[
-
1
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
236
:
/* expr ::= FLOAT */
{
yylhsminor
.
yy
260
=
tSqlExprCreateIdValue
(
&
yymsp
[
0
].
minor
.
yy0
,
TK_FLOAT
);}
yymsp
[
0
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
yylhsminor
.
yy
439
=
tSqlExprCreateIdValue
(
&
yymsp
[
0
].
minor
.
yy0
,
TK_FLOAT
);}
yymsp
[
0
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
237
:
/* expr ::= MINUS FLOAT */
case
238
:
/* expr ::= PLUS FLOAT */
yytestcase
(
yyruleno
==
238
);
{
yymsp
[
-
1
].
minor
.
yy0
.
n
+=
yymsp
[
0
].
minor
.
yy0
.
n
;
yymsp
[
-
1
].
minor
.
yy0
.
type
=
TK_FLOAT
;
yylhsminor
.
yy
260
=
tSqlExprCreateIdValue
(
&
yymsp
[
-
1
].
minor
.
yy0
,
TK_FLOAT
);}
yymsp
[
-
1
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
yymsp
[
-
1
].
minor
.
yy0
.
n
+=
yymsp
[
0
].
minor
.
yy0
.
n
;
yymsp
[
-
1
].
minor
.
yy0
.
type
=
TK_FLOAT
;
yylhsminor
.
yy
439
=
tSqlExprCreateIdValue
(
&
yymsp
[
-
1
].
minor
.
yy0
,
TK_FLOAT
);}
yymsp
[
-
1
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
239
:
/* expr ::= STRING */
{
yylhsminor
.
yy
260
=
tSqlExprCreateIdValue
(
&
yymsp
[
0
].
minor
.
yy0
,
TK_STRING
);}
yymsp
[
0
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
yylhsminor
.
yy
439
=
tSqlExprCreateIdValue
(
&
yymsp
[
0
].
minor
.
yy0
,
TK_STRING
);}
yymsp
[
0
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
240
:
/* expr ::= NOW */
{
yylhsminor
.
yy
260
=
tSqlExprCreateIdValue
(
&
yymsp
[
0
].
minor
.
yy0
,
TK_NOW
);
}
yymsp
[
0
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
yylhsminor
.
yy
439
=
tSqlExprCreateIdValue
(
&
yymsp
[
0
].
minor
.
yy0
,
TK_NOW
);
}
yymsp
[
0
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
241
:
/* expr ::= VARIABLE */
{
yylhsminor
.
yy
260
=
tSqlExprCreateIdValue
(
&
yymsp
[
0
].
minor
.
yy0
,
TK_VARIABLE
);}
yymsp
[
0
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
yylhsminor
.
yy
439
=
tSqlExprCreateIdValue
(
&
yymsp
[
0
].
minor
.
yy0
,
TK_VARIABLE
);}
yymsp
[
0
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
242
:
/* expr ::= PLUS VARIABLE */
case
243
:
/* expr ::= MINUS VARIABLE */
yytestcase
(
yyruleno
==
243
);
{
yymsp
[
-
1
].
minor
.
yy0
.
n
+=
yymsp
[
0
].
minor
.
yy0
.
n
;
yymsp
[
-
1
].
minor
.
yy0
.
type
=
TK_VARIABLE
;
yylhsminor
.
yy
260
=
tSqlExprCreateIdValue
(
&
yymsp
[
-
1
].
minor
.
yy0
,
TK_VARIABLE
);}
yymsp
[
-
1
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
yymsp
[
-
1
].
minor
.
yy0
.
n
+=
yymsp
[
0
].
minor
.
yy0
.
n
;
yymsp
[
-
1
].
minor
.
yy0
.
type
=
TK_VARIABLE
;
yylhsminor
.
yy
439
=
tSqlExprCreateIdValue
(
&
yymsp
[
-
1
].
minor
.
yy0
,
TK_VARIABLE
);}
yymsp
[
-
1
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
244
:
/* expr ::= BOOL */
{
yylhsminor
.
yy
260
=
tSqlExprCreateIdValue
(
&
yymsp
[
0
].
minor
.
yy0
,
TK_BOOL
);}
yymsp
[
0
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
yylhsminor
.
yy
439
=
tSqlExprCreateIdValue
(
&
yymsp
[
0
].
minor
.
yy0
,
TK_BOOL
);}
yymsp
[
0
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
245
:
/* expr ::= NULL */
{
yylhsminor
.
yy
260
=
tSqlExprCreateIdValue
(
&
yymsp
[
0
].
minor
.
yy0
,
TK_NULL
);}
yymsp
[
0
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
yylhsminor
.
yy
439
=
tSqlExprCreateIdValue
(
&
yymsp
[
0
].
minor
.
yy0
,
TK_NULL
);}
yymsp
[
0
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
246
:
/* expr ::= ID LP exprlist RP */
{
tStrTokenAppend
(
pInfo
->
funcs
,
&
yymsp
[
-
3
].
minor
.
yy0
);
yylhsminor
.
yy
260
=
tSqlExprCreateFunction
(
yymsp
[
-
1
].
minor
.
yy403
,
&
yymsp
[
-
3
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy0
,
yymsp
[
-
3
].
minor
.
yy0
.
type
);
}
yymsp
[
-
3
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
tStrTokenAppend
(
pInfo
->
funcs
,
&
yymsp
[
-
3
].
minor
.
yy0
);
yylhsminor
.
yy
439
=
tSqlExprCreateFunction
(
yymsp
[
-
1
].
minor
.
yy421
,
&
yymsp
[
-
3
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy0
,
yymsp
[
-
3
].
minor
.
yy0
.
type
);
}
yymsp
[
-
3
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
247
:
/* expr ::= ID LP STAR RP */
{
tStrTokenAppend
(
pInfo
->
funcs
,
&
yymsp
[
-
3
].
minor
.
yy0
);
yylhsminor
.
yy
260
=
tSqlExprCreateFunction
(
NULL
,
&
yymsp
[
-
3
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy0
,
yymsp
[
-
3
].
minor
.
yy0
.
type
);
}
yymsp
[
-
3
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
tStrTokenAppend
(
pInfo
->
funcs
,
&
yymsp
[
-
3
].
minor
.
yy0
);
yylhsminor
.
yy
439
=
tSqlExprCreateFunction
(
NULL
,
&
yymsp
[
-
3
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy0
,
yymsp
[
-
3
].
minor
.
yy0
.
type
);
}
yymsp
[
-
3
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
248
:
/* expr ::= expr IS NULL */
{
yylhsminor
.
yy
260
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy260
,
NULL
,
TK_ISNULL
);}
yymsp
[
-
2
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
yylhsminor
.
yy
439
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy439
,
NULL
,
TK_ISNULL
);}
yymsp
[
-
2
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
249
:
/* expr ::= expr IS NOT NULL */
{
yylhsminor
.
yy
260
=
tSqlExprCreate
(
yymsp
[
-
3
].
minor
.
yy260
,
NULL
,
TK_NOTNULL
);}
yymsp
[
-
3
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
yylhsminor
.
yy
439
=
tSqlExprCreate
(
yymsp
[
-
3
].
minor
.
yy439
,
NULL
,
TK_NOTNULL
);}
yymsp
[
-
3
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
250
:
/* expr ::= expr LT expr */
{
yylhsminor
.
yy
260
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy260
,
yymsp
[
0
].
minor
.
yy260
,
TK_LT
);}
yymsp
[
-
2
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
yylhsminor
.
yy
439
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy439
,
yymsp
[
0
].
minor
.
yy439
,
TK_LT
);}
yymsp
[
-
2
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
251
:
/* expr ::= expr GT expr */
{
yylhsminor
.
yy
260
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy260
,
yymsp
[
0
].
minor
.
yy260
,
TK_GT
);}
yymsp
[
-
2
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
yylhsminor
.
yy
439
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy439
,
yymsp
[
0
].
minor
.
yy439
,
TK_GT
);}
yymsp
[
-
2
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
252
:
/* expr ::= expr LE expr */
{
yylhsminor
.
yy
260
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy260
,
yymsp
[
0
].
minor
.
yy260
,
TK_LE
);}
yymsp
[
-
2
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
yylhsminor
.
yy
439
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy439
,
yymsp
[
0
].
minor
.
yy439
,
TK_LE
);}
yymsp
[
-
2
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
253
:
/* expr ::= expr GE expr */
{
yylhsminor
.
yy
260
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy260
,
yymsp
[
0
].
minor
.
yy260
,
TK_GE
);}
yymsp
[
-
2
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
yylhsminor
.
yy
439
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy439
,
yymsp
[
0
].
minor
.
yy439
,
TK_GE
);}
yymsp
[
-
2
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
254
:
/* expr ::= expr NE expr */
{
yylhsminor
.
yy
260
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy260
,
yymsp
[
0
].
minor
.
yy260
,
TK_NE
);}
yymsp
[
-
2
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
yylhsminor
.
yy
439
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy439
,
yymsp
[
0
].
minor
.
yy439
,
TK_NE
);}
yymsp
[
-
2
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
255
:
/* expr ::= expr EQ expr */
{
yylhsminor
.
yy
260
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy260
,
yymsp
[
0
].
minor
.
yy260
,
TK_EQ
);}
yymsp
[
-
2
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
yylhsminor
.
yy
439
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy439
,
yymsp
[
0
].
minor
.
yy439
,
TK_EQ
);}
yymsp
[
-
2
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
256
:
/* expr ::= expr BETWEEN expr AND expr */
{
tSqlExpr
*
X2
=
tSqlExprClone
(
yymsp
[
-
4
].
minor
.
yy
260
);
yylhsminor
.
yy260
=
tSqlExprCreate
(
tSqlExprCreate
(
yymsp
[
-
4
].
minor
.
yy260
,
yymsp
[
-
2
].
minor
.
yy260
,
TK_GE
),
tSqlExprCreate
(
X2
,
yymsp
[
0
].
minor
.
yy260
,
TK_LE
),
TK_AND
);}
yymsp
[
-
4
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
tSqlExpr
*
X2
=
tSqlExprClone
(
yymsp
[
-
4
].
minor
.
yy
439
);
yylhsminor
.
yy439
=
tSqlExprCreate
(
tSqlExprCreate
(
yymsp
[
-
4
].
minor
.
yy439
,
yymsp
[
-
2
].
minor
.
yy439
,
TK_GE
),
tSqlExprCreate
(
X2
,
yymsp
[
0
].
minor
.
yy439
,
TK_LE
),
TK_AND
);}
yymsp
[
-
4
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
257
:
/* expr ::= expr AND expr */
{
yylhsminor
.
yy
260
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy260
,
yymsp
[
0
].
minor
.
yy260
,
TK_AND
);}
yymsp
[
-
2
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
yylhsminor
.
yy
439
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy439
,
yymsp
[
0
].
minor
.
yy439
,
TK_AND
);}
yymsp
[
-
2
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
258
:
/* expr ::= expr OR expr */
{
yylhsminor
.
yy
260
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy260
,
yymsp
[
0
].
minor
.
yy260
,
TK_OR
);
}
yymsp
[
-
2
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
yylhsminor
.
yy
439
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy439
,
yymsp
[
0
].
minor
.
yy439
,
TK_OR
);
}
yymsp
[
-
2
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
259
:
/* expr ::= expr PLUS expr */
{
yylhsminor
.
yy
260
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy260
,
yymsp
[
0
].
minor
.
yy260
,
TK_PLUS
);
}
yymsp
[
-
2
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
yylhsminor
.
yy
439
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy439
,
yymsp
[
0
].
minor
.
yy439
,
TK_PLUS
);
}
yymsp
[
-
2
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
260
:
/* expr ::= expr MINUS expr */
{
yylhsminor
.
yy
260
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy260
,
yymsp
[
0
].
minor
.
yy260
,
TK_MINUS
);
}
yymsp
[
-
2
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
yylhsminor
.
yy
439
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy439
,
yymsp
[
0
].
minor
.
yy439
,
TK_MINUS
);
}
yymsp
[
-
2
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
261
:
/* expr ::= expr STAR expr */
{
yylhsminor
.
yy
260
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy260
,
yymsp
[
0
].
minor
.
yy260
,
TK_STAR
);
}
yymsp
[
-
2
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
yylhsminor
.
yy
439
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy439
,
yymsp
[
0
].
minor
.
yy439
,
TK_STAR
);
}
yymsp
[
-
2
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
262
:
/* expr ::= expr SLASH expr */
{
yylhsminor
.
yy
260
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy260
,
yymsp
[
0
].
minor
.
yy260
,
TK_DIVIDE
);}
yymsp
[
-
2
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
yylhsminor
.
yy
439
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy439
,
yymsp
[
0
].
minor
.
yy439
,
TK_DIVIDE
);}
yymsp
[
-
2
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
263
:
/* expr ::= expr REM expr */
{
yylhsminor
.
yy
260
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy260
,
yymsp
[
0
].
minor
.
yy260
,
TK_REM
);
}
yymsp
[
-
2
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
yylhsminor
.
yy
439
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy439
,
yymsp
[
0
].
minor
.
yy439
,
TK_REM
);
}
yymsp
[
-
2
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
264
:
/* expr ::= expr LIKE expr */
{
yylhsminor
.
yy
260
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy260
,
yymsp
[
0
].
minor
.
yy260
,
TK_LIKE
);
}
yymsp
[
-
2
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
yylhsminor
.
yy
439
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy439
,
yymsp
[
0
].
minor
.
yy439
,
TK_LIKE
);
}
yymsp
[
-
2
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
265
:
/* expr ::= expr IN LP exprlist RP */
{
yylhsminor
.
yy
260
=
tSqlExprCreate
(
yymsp
[
-
4
].
minor
.
yy260
,
(
tSqlExpr
*
)
yymsp
[
-
1
].
minor
.
yy403
,
TK_IN
);
}
yymsp
[
-
4
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
yylhsminor
.
yy
439
=
tSqlExprCreate
(
yymsp
[
-
4
].
minor
.
yy439
,
(
tSqlExpr
*
)
yymsp
[
-
1
].
minor
.
yy421
,
TK_IN
);
}
yymsp
[
-
4
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
266
:
/* exprlist ::= exprlist COMMA expritem */
{
yylhsminor
.
yy4
03
=
tSqlExprListAppend
(
yymsp
[
-
2
].
minor
.
yy403
,
yymsp
[
0
].
minor
.
yy260
,
0
,
0
);}
yymsp
[
-
2
].
minor
.
yy4
03
=
yylhsminor
.
yy403
;
{
yylhsminor
.
yy4
21
=
tSqlExprListAppend
(
yymsp
[
-
2
].
minor
.
yy421
,
yymsp
[
0
].
minor
.
yy439
,
0
,
0
);}
yymsp
[
-
2
].
minor
.
yy4
21
=
yylhsminor
.
yy421
;
break
;
case
267
:
/* exprlist ::= expritem */
{
yylhsminor
.
yy4
03
=
tSqlExprListAppend
(
0
,
yymsp
[
0
].
minor
.
yy260
,
0
,
0
);}
yymsp
[
0
].
minor
.
yy4
03
=
yylhsminor
.
yy403
;
{
yylhsminor
.
yy4
21
=
tSqlExprListAppend
(
0
,
yymsp
[
0
].
minor
.
yy439
,
0
,
0
);}
yymsp
[
0
].
minor
.
yy4
21
=
yylhsminor
.
yy421
;
break
;
case
268
:
/* expritem ::= expr */
{
yylhsminor
.
yy
260
=
yymsp
[
0
].
minor
.
yy260
;}
yymsp
[
0
].
minor
.
yy
260
=
yylhsminor
.
yy260
;
{
yylhsminor
.
yy
439
=
yymsp
[
0
].
minor
.
yy439
;}
yymsp
[
0
].
minor
.
yy
439
=
yylhsminor
.
yy439
;
break
;
case
270
:
/* cmd ::= RESET QUERY CACHE */
{
setDCLSqlElems
(
pInfo
,
TSDB_SQL_RESET_CACHE
,
0
);}
...
...
@@ -3156,7 +3158,7 @@ static YYACTIONTYPE yy_reduce(
case
272
:
/* 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
.
yy4
03
,
NULL
,
TSDB_ALTER_TABLE_ADD_COLUMN
,
-
1
);
SAlterTableInfo
*
pAlterTable
=
tSetAlterTableInfo
(
&
yymsp
[
-
4
].
minor
.
yy0
,
yymsp
[
0
].
minor
.
yy4
21
,
NULL
,
TSDB_ALTER_TABLE_ADD_COLUMN
,
-
1
);
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
...
...
@@ -3174,14 +3176,14 @@ static YYACTIONTYPE yy_reduce(
case
274
:
/* 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
.
yy4
03
,
NULL
,
TSDB_ALTER_TABLE_CHANGE_COLUMN
,
-
1
);
SAlterTableInfo
*
pAlterTable
=
tSetAlterTableInfo
(
&
yymsp
[
-
4
].
minor
.
yy0
,
yymsp
[
0
].
minor
.
yy4
21
,
NULL
,
TSDB_ALTER_TABLE_CHANGE_COLUMN
,
-
1
);
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
case
275
:
/* 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
.
yy4
03
,
NULL
,
TSDB_ALTER_TABLE_ADD_TAG_COLUMN
,
-
1
);
SAlterTableInfo
*
pAlterTable
=
tSetAlterTableInfo
(
&
yymsp
[
-
4
].
minor
.
yy0
,
yymsp
[
0
].
minor
.
yy4
21
,
NULL
,
TSDB_ALTER_TABLE_ADD_TAG_COLUMN
,
-
1
);
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
...
...
@@ -3216,7 +3218,7 @@ static YYACTIONTYPE yy_reduce(
toTSDBType
(
yymsp
[
-
2
].
minor
.
yy0
.
type
);
SArray
*
A
=
tVariantListAppendToken
(
NULL
,
&
yymsp
[
-
2
].
minor
.
yy0
,
-
1
);
A
=
tVariantListAppend
(
A
,
&
yymsp
[
0
].
minor
.
yy4
88
,
-
1
);
A
=
tVariantListAppend
(
A
,
&
yymsp
[
0
].
minor
.
yy4
30
,
-
1
);
SAlterTableInfo
*
pAlterTable
=
tSetAlterTableInfo
(
&
yymsp
[
-
6
].
minor
.
yy0
,
NULL
,
A
,
TSDB_ALTER_TABLE_UPDATE_TAG_VAL
,
-
1
);
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
...
...
@@ -3225,14 +3227,14 @@ static YYACTIONTYPE yy_reduce(
case
279
:
/* 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
.
yy4
03
,
NULL
,
TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN
,
-
1
);
SAlterTableInfo
*
pAlterTable
=
tSetAlterTableInfo
(
&
yymsp
[
-
4
].
minor
.
yy0
,
yymsp
[
0
].
minor
.
yy4
21
,
NULL
,
TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN
,
-
1
);
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
case
280
:
/* 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
.
yy4
03
,
NULL
,
TSDB_ALTER_TABLE_ADD_COLUMN
,
TSDB_SUPER_TABLE
);
SAlterTableInfo
*
pAlterTable
=
tSetAlterTableInfo
(
&
yymsp
[
-
4
].
minor
.
yy0
,
yymsp
[
0
].
minor
.
yy4
21
,
NULL
,
TSDB_ALTER_TABLE_ADD_COLUMN
,
TSDB_SUPER_TABLE
);
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
...
...
@@ -3250,14 +3252,14 @@ static YYACTIONTYPE yy_reduce(
case
282
:
/* 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
.
yy4
03
,
NULL
,
TSDB_ALTER_TABLE_CHANGE_COLUMN
,
TSDB_SUPER_TABLE
);
SAlterTableInfo
*
pAlterTable
=
tSetAlterTableInfo
(
&
yymsp
[
-
4
].
minor
.
yy0
,
yymsp
[
0
].
minor
.
yy4
21
,
NULL
,
TSDB_ALTER_TABLE_CHANGE_COLUMN
,
TSDB_SUPER_TABLE
);
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
case
283
:
/* 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
.
yy4
03
,
NULL
,
TSDB_ALTER_TABLE_ADD_TAG_COLUMN
,
TSDB_SUPER_TABLE
);
SAlterTableInfo
*
pAlterTable
=
tSetAlterTableInfo
(
&
yymsp
[
-
4
].
minor
.
yy0
,
yymsp
[
0
].
minor
.
yy4
21
,
NULL
,
TSDB_ALTER_TABLE_ADD_TAG_COLUMN
,
TSDB_SUPER_TABLE
);
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
...
...
@@ -3292,7 +3294,7 @@ static YYACTIONTYPE yy_reduce(
toTSDBType
(
yymsp
[
-
2
].
minor
.
yy0
.
type
);
SArray
*
A
=
tVariantListAppendToken
(
NULL
,
&
yymsp
[
-
2
].
minor
.
yy0
,
-
1
);
A
=
tVariantListAppend
(
A
,
&
yymsp
[
0
].
minor
.
yy4
88
,
-
1
);
A
=
tVariantListAppend
(
A
,
&
yymsp
[
0
].
minor
.
yy4
30
,
-
1
);
SAlterTableInfo
*
pAlterTable
=
tSetAlterTableInfo
(
&
yymsp
[
-
6
].
minor
.
yy0
,
NULL
,
A
,
TSDB_ALTER_TABLE_UPDATE_TAG_VAL
,
TSDB_SUPER_TABLE
);
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
...
...
@@ -3301,7 +3303,7 @@ static YYACTIONTYPE yy_reduce(
case
287
:
/* 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
.
yy4
03
,
NULL
,
TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN
,
TSDB_SUPER_TABLE
);
SAlterTableInfo
*
pAlterTable
=
tSetAlterTableInfo
(
&
yymsp
[
-
4
].
minor
.
yy0
,
yymsp
[
0
].
minor
.
yy4
21
,
NULL
,
TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN
,
TSDB_SUPER_TABLE
);
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
...
...
src/util/inc/tconfig.h
浏览文件 @
f68583e7
...
...
@@ -20,7 +20,7 @@
extern
"C"
{
#endif
#define TSDB_CFG_MAX_NUM 12
0
#define TSDB_CFG_MAX_NUM 12
1
#define TSDB_CFG_PRINT_LEN 23
#define TSDB_CFG_OPTION_LEN 24
#define TSDB_CFG_VALUE_LEN 41
...
...
tests/pytest/query/udf.py
浏览文件 @
f68583e7
...
...
@@ -73,21 +73,18 @@ class TDTestCase:
tdSql
.
error
(
sql
)
sql
=
'select abs_max(c2) from db.stb'
tdSql
.
query
(
sql
)
tdSql
.
checkData
(
0
,
0
,
1
410065607
)
tdSql
.
checkData
(
0
,
0
,
1
0000000199
)
def
test_udf_values
(
self
):
tdSql
.
execute
(
"drop function abs_max"
)
tdSql
.
execute
(
"create function add_one as '/tmp/add_one.so' outputtype int"
)
tdSql
.
execute
(
"create aggregate function abs_max as '/tmp/abs_max.so' outputtype bigint;"
)
tdSql
.
execute
(
"create aggregate function sum_double as '/tmp/sum_double.so' outputtype
int bufsize 128
;"
)
tdSql
.
execute
(
"create aggregate function sum_double as '/tmp/sum_double.so' outputtype
bigint
;"
)
# UDF bug no 1 -> follow 3 cases about this bug ;
# tdSql.error("create aggregate function max as '/tmp/abs_max.so' outputtype bigint ;")
# tdSql.error("create aggregate function avg as '/tmp/abs_max.so' outputtype bigint ;")
# tdSql.error("create aggregate function dbs as '/tmp/abs_max.so' outputtype bigint ;")
tdSql
.
execute
(
"drop database if exists test"
)
tdSql
.
execute
(
"create database test"
)
tdSql
.
execute
(
"use test"
)
...
...
@@ -117,7 +114,7 @@ class TDTestCase:
tdSql
.
execute
(
"insert into bound values(%d, %d , %f, %d , %s)"
%
(
epoch_time
+
1000
,
intdata2
+
1
,
float
(
intdata2
+
1
),
bigintdata2
+
1
,
"'binary"
+
str
(
intdata2
+
1
)
+
"'"
))
# check super table calculation results
tdSql
.
query
(
"select add_one(id) from st"
)
tdSql
.
query
(
"select add_one(id)
test
from st"
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
checkData
(
1
,
0
,
2
)
tdSql
.
checkData
(
4
,
0
,
5
)
...
...
@@ -157,29 +154,266 @@ class TDTestCase:
tdLog
.
info
(
" ====== unexpected error occured about UDF function ====="
)
sys
.
exit
()
# UDF bug no 2 -> values of abs_max not inconsistent from common table and stable.
# tdSql.query("select abs_max(val) from st") # result is 0 rows
# tdSql.query("select abs_max(val) from tb1")
# tdSql.checkData(0,0,0) # this is error result
# tdSql.query("select sum_double(val) from st") # result is 0 rows
# tdSql.query("select sum_double(val) from tb1")
# tdSql.checkData(0,0,0) # this is error result
# UDF bug no 3 -> values of abs_max will error for boundary number
tdSql
.
query
(
"select abs_max(val) from st"
)
tdSql
.
query
(
"select abs_max(val) from tb1"
)
tdSql
.
checkRows
(
0
)
tdSql
.
query
(
"select sum_double(val) from st"
)
tdSql
.
query
(
"select sum_double(val) from tb1"
)
tdSql
.
checkRows
(
0
)
# check super table calculation results
#
tdSql.query("select abs_max(number) from st")
#
tdSql.checkData(0,0,9223372036854775807)
tdSql
.
query
(
"select abs_max(number) from st"
)
tdSql
.
checkData
(
0
,
0
,
9223372036854775807
)
# check common table calculation results
tdSql
.
query
(
"select abs_max(number) from tb1"
)
tdSql
.
checkData
(
0
,
0
,
400
)
tdSql
.
query
(
"select abs_max(number) from tb2"
)
tdSql
.
checkData
(
0
,
0
,
400
)
tdSql
.
execute
(
"select add_one(id) from st limit 10 offset 2"
)
tdSql
.
query
(
"select add_one(id) from st where ts > 1604298064000 and ts < 1604298064020 "
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
checkData
(
1
,
0
,
-
2147483644
)
tdSql
.
query
(
"select add_one(id) from tb1 where ts > 1604298064000 and ts < 1604298064020 "
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
"select sum_double(id) from st where ts > 1604298064030 and ts < 1604298064060 "
)
tdSql
.
checkData
(
0
,
0
,
14
)
tdSql
.
query
(
"select sum_double(id) from tb2 where ts > 1604298064030 and ts < 1604298064060 "
)
tdSql
.
checkRows
(
0
)
tdSql
.
query
(
"select add_one(id) from st where ts = 1604298064000 "
)
tdSql
.
checkData
(
0
,
0
,
-
2147483645
)
tdSql
.
query
(
"select add_one(id) from st where ts > 1604298064000 and id in (2,3) and ind =1;"
)
tdSql
.
checkData
(
0
,
0
,
3
)
tdSql
.
checkData
(
1
,
0
,
4
)
tdSql
.
query
(
"select id , add_one(id) from tb1 where ts > 1604298064000 and id in (2,3)"
)
tdSql
.
checkData
(
0
,
0
,
2
)
tdSql
.
checkData
(
0
,
1
,
3
)
tdSql
.
checkData
(
1
,
0
,
3
)
tdSql
.
checkData
(
1
,
1
,
4
)
tdSql
.
query
(
"select sum_double(id) from tb1 where ts > 1604298064000 and id in (2,3)"
)
tdSql
.
checkData
(
0
,
0
,
10
)
tdSql
.
query
(
"select sum_double(id) from st where ts > 1604298064000 and id in (2,3) and ind =1"
)
tdSql
.
checkData
(
0
,
0
,
10
)
tdSql
.
query
(
"select abs_max(number) from st where ts > 1604298064000 and id in (2,3) and ind =1"
)
tdSql
.
checkData
(
0
,
0
,
300
)
tdSql
.
query
(
"select sum_double(id) from st where ts = 1604298064030 "
)
tdSql
.
checkData
(
0
,
0
,
4
)
tdSql
.
query
(
"select abs_max(number) from st where ts = 1604298064100 "
)
tdSql
.
checkData
(
0
,
0
,
9223372036854775806
)
tdSql
.
query
(
"select abs_max(number) from tb2 where ts = 1604298064100 "
)
tdSql
.
checkData
(
0
,
0
,
400
)
tdSql
.
query
(
"select sum_double(id) from tb2 where ts = 1604298064100 "
)
tdSql
.
checkData
(
0
,
0
,
8
)
tdSql
.
query
(
"select add_one(id) from st where ts >= 1604298064000 and ts <= 1604298064010"
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
checkData
(
1
,
0
,
-
2147483645
)
tdSql
.
checkData
(
2
,
0
,
-
2147483644
)
tdSql
.
query
(
"select add_one(id) from tb1 where ts >= 1604298064000 and ts <= 1604298064010"
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
"select sum_double(id) from st where ts >= 1604298064030 and ts <= 1604298064050"
)
tdSql
.
checkData
(
0
,
0
,
18
)
tdSql
.
query
(
"select sum_double(id) from tb2 where ts >= 1604298064030 and ts <= 1604298064100"
)
tdSql
.
checkData
(
0
,
0
,
20
)
tdSql
.
query
(
"select abs_max(number) from tb2 where ts >= 1604298064030 and ts <= 1604298064100"
)
tdSql
.
checkData
(
0
,
0
,
400
)
tdSql
.
query
(
"select abs_max(number) from st where ts >= 1604298064030 and ts <= 1604298064100"
)
tdSql
.
checkData
(
0
,
0
,
9223372036854775806
)
tdSql
.
query
(
"select id from st where id != 0 and ts >=1604298064070"
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
"select add_one(id) from st where id != 0 and ts >=1604298064070"
)
tdSql
.
checkData
(
0
,
0
,
2
)
tdSql
.
query
(
"select add_one(id) from st where id <> 0 and ts >=1604298064010"
)
tdSql
.
checkData
(
0
,
0
,
2
)
tdSql
.
query
(
"select sum_double(id) from st where id in (2,3,4) and ts >=1604298064070"
)
tdSql
.
checkData
(
0
,
0
,
18
)
tdSql
.
query
(
"select sum_double(id) from tb2 where id in (2,3,4) and ts >=1604298064070"
)
tdSql
.
checkData
(
0
,
0
,
18
)
tdSql
.
query
(
"select abs_max(number) from st where id in (2,3,4) and ts >=1604298064070"
)
tdSql
.
checkData
(
0
,
0
,
400
)
tdSql
.
query
(
"select add_one(id) from st where id = 0 "
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
checkData
(
1
,
0
,
1
)
tdSql
.
query
(
"select add_one(id) from tb2 where id = 0 "
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
query
(
"select sum_double(id) from st where id = 1"
)
tdSql
.
checkData
(
0
,
0
,
4
)
tdSql
.
query
(
"select sum_double(id) from tb2 where id = 1"
)
tdSql
.
checkData
(
0
,
0
,
2
)
tdSql
.
query
(
"select add_one(id) from st where id is not null and ts >=1604298065000 "
)
tdSql
.
checkData
(
0
,
0
,
None
)
tdSql
.
query
(
"select abs_max(number) from st where id is not null and ts >=1604298065000 "
)
tdSql
.
checkData
(
0
,
0
,
9223372036854775807
)
tdSql
.
query
(
"select abs_max(number) from bound where id is not null and ts >=1604298065000 "
)
tdSql
.
checkData
(
0
,
0
,
9223372036854775807
)
tdSql
.
query
(
"select sum_double(id) from st where id is not null and ts >=1604298064000 and ind = 1 "
)
tdSql
.
checkData
(
0
,
0
,
20
)
tdSql
.
query
(
"select sum_double(id) from tb1 where id is not null and ts >=1604298064000 "
)
tdSql
.
checkData
(
0
,
0
,
20
)
tdSql
.
query
(
"select add_one(id) from st where id is null and ts >=1604298065000 "
)
tdSql
.
checkRows
(
0
)
tdSql
.
query
(
"select abs_max(number) from st where id is null and ts >=1604298065000 "
)
tdSql
.
checkRows
(
0
)
tdSql
.
query
(
"select abs_max(number) from tb1 where id is null and ts >=1604298065000 "
)
tdSql
.
checkRows
(
0
)
tdSql
.
query
(
"select add_one(id) from bound where id is not null and ts >=1604298065000;"
)
tdSql
.
checkData
(
0
,
0
,
None
)
tdSql
.
query
(
"select id,add_one(id) from bound;"
)
tdSql
.
checkRowCol
(
4
,
2
)
tdSql
.
checkData
(
3
,
1
,
None
)
tdSql
.
query
(
"select add_one(id) from st where ts between 1604298064000 and 1604298064010"
)
tdSql
.
checkRows
(
3
)
tdSql
.
query
(
"select add_one(id) from tb1 where ts between 1604298064000 and 1604298064010"
)
tdSql
.
checkRows
(
1
)
tdSql
.
query
(
"select sum_double(id) from st where ts between 1604298064000 and 1604298064010 and id>=0"
)
tdSql
.
checkData
(
0
,
0
,
0
)
tdSql
.
query
(
"select sum_double(id) from tb1 where ts between 1604298064000 and 1604298064010 and id>=0"
)
tdSql
.
checkData
(
0
,
0
,
0
)
tdSql
.
query
(
"select add_one(id) from st where id in (1,2)"
)
tdSql
.
checkData
(
0
,
0
,
2
)
tdSql
.
checkData
(
1
,
0
,
3
)
tdSql
.
checkData
(
2
,
0
,
2
)
tdSql
.
checkData
(
3
,
0
,
3
)
tdSql
.
checkRows
(
4
)
tdSql
.
query
(
"select sum_double(id) from st where ts < now and ind =1 interval(1s)"
)
tdSql
.
checkData
(
0
,
1
,
20
)
tdSql
.
error
(
"select sum_double(id) from st where ts < now and ind =1 interval(3s) sliding (1s) fill (NULL) "
)
tdSql
.
error
(
"select sum_double(id) from st session(ts, 1s)"
)
tdSql
.
query
(
"select sum_double(id) from tb1 session(ts, 1s)"
)
tdSql
.
checkData
(
0
,
1
,
20
)
# intervals sliding values calculation
tdSql
.
query
(
"select sum_double(id) from st where ts < now and ind =1 interval(3s) sliding (1s) limit 2"
)
tdSql
.
checkData
(
0
,
1
,
20
)
tdSql
.
checkData
(
1
,
1
,
20
)
# scalar_function can't work when using interval and sliding =========
tdSql
.
error
(
"select add_one(id) from st where ts < now and ind =1 interval(3s) sliding (1s) limit 2 "
)
tdSql
.
error
(
"select add_one(id) from st order by ts"
)
tdSql
.
error
(
"select ts,id,add_one(id) from st order by ts asc;"
)
# # UDF not support order by
tdSql
.
error
(
"select ts,id,add_one(id) from st order by ts desc;"
)
# UDF function union all
tdSql
.
query
(
"select add_one(id) from tb1 union all select add_one(id) from tb2;"
)
tdSql
.
checkRows
(
10
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
checkData
(
5
,
0
,
1
)
tdSql
.
query
(
"select sum_double(id) from tb1 union all select sum_double(id) from tb2;"
)
tdSql
.
checkRows
(
2
)
tdSql
.
checkData
(
0
,
0
,
20
)
tdSql
.
checkData
(
1
,
0
,
20
)
tdSql
.
query
(
"select abs_max(number) from tb1 union all select abs_max(number) from bound;"
)
tdSql
.
checkRows
(
2
)
tdSql
.
checkData
(
0
,
0
,
400
)
tdSql
.
checkData
(
1
,
0
,
9223372036854775807
)
tdSql
.
execute
(
"create stable stb (ts timestamp,id int , val double , number bigint, chars binary(200)) tags (ind int)"
)
tdSql
.
execute
(
"create table stb1 using stb tags(3)"
)
tdSql
.
execute
(
"insert into stb1 values(1604298064000 , 1 , 1.0 , 10000 ,'chars')"
)
tdSql
.
query
(
"select add_one(id) from st union all select add_one(id) from stb;"
)
tdSql
.
checkRows
(
15
)
tdSql
.
checkData
(
13
,
0
,
None
)
tdSql
.
checkData
(
14
,
0
,
2
)
tdSql
.
query
(
"select add_one(id) from st union all select add_one(id) from stb1;"
)
tdSql
.
checkRows
(
15
)
tdSql
.
checkData
(
13
,
0
,
None
)
tdSql
.
checkData
(
14
,
0
,
2
)
tdSql
.
query
(
"select id ,add_one(id) from tb1 union all select id ,add_one(id) from stb1;"
)
tdSql
.
checkRows
(
6
)
tdSql
.
checkData
(
0
,
0
,
0
)
tdSql
.
checkData
(
0
,
1
,
1
)
tdSql
.
checkData
(
1
,
0
,
1
)
tdSql
.
checkData
(
1
,
1
,
2
)
# aggregate union all for different stables
tdSql
.
query
(
"select sum_double(id) from st union all select sum_double(id) from stb;"
)
tdSql
.
checkRows
(
2
)
tdSql
.
checkData
(
0
,
0
,
44
)
tdSql
.
checkData
(
1
,
0
,
2
)
tdSql
.
query
(
"select id from st union all select id from stb1;"
)
tdSql
.
checkRows
(
15
)
tdSql
.
query
(
"select id from tb1 union all select id from stb1"
)
tdSql
.
checkRows
(
6
)
tdSql
.
query
(
"select sum_double(id) from tb1 union all select sum_double(id) from stb"
)
tdSql
.
checkData
(
0
,
0
,
20
)
tdSql
.
checkData
(
1
,
0
,
2
)
tdSql
.
query
(
"select sum_double(id) from st union all select sum_double(id) from stb1;"
)
tdSql
.
checkRows
(
2
)
tdSql
.
checkData
(
0
,
0
,
44
)
tdSql
.
checkData
(
1
,
0
,
2
)
tdSql
.
query
(
"select abs_max(number) from st union all select abs_max(number) from stb;"
)
tdSql
.
checkData
(
0
,
0
,
9223372036854775807
)
tdSql
.
query
(
"select abs_max(number) from bound union all select abs_max(number) from stb1;"
)
tdSql
.
checkData
(
0
,
0
,
9223372036854775807
)
tdSql
.
checkData
(
1
,
0
,
10000
)
tdSql
.
query
(
"select abs_max(number) from st union all select abs_max(number) from stb1;"
)
tdSql
.
checkData
(
0
,
0
,
9223372036854775807
)
tdSql
.
checkData
(
1
,
0
,
10000
)
# group by for aggegate function ;
tdSql
.
query
(
"select sum_double(id) from st group by tbname;"
)
tdSql
.
checkData
(
0
,
0
,
20
)
tdSql
.
checkData
(
0
,
1
,
'tb1'
)
tdSql
.
checkData
(
1
,
0
,
20
)
tdSql
.
checkData
(
1
,
1
,
'tb2'
)
tdSql
.
query
(
"select sum_double(id) from st group by id;"
)
tdSql
.
checkRows
(
9
)
tdSql
.
query
(
"select sum_double(id) from st group by ts"
)
tdSql
.
checkRows
(
12
)
tdSql
.
query
(
"select sum_double(id) from st group by ind"
)
tdSql
.
checkRows
(
3
)
tdSql
.
query
(
"select sum_double(id) from st group by tbname order by ts asc;"
)
tdSql
.
query
(
"select abs_max(number) from st group by id"
)
tdSql
.
checkRows
(
9
)
tdSql
.
checkData
(
0
,
0
,
9223372036854775806
)
tdSql
.
checkData
(
8
,
0
,
9223372036854775807
)
tdSql
.
query
(
"select abs_max(number) from st group by ts"
)
tdSql
.
checkRows
(
12
)
tdSql
.
checkData
(
11
,
0
,
9223372036854775807
)
tdSql
.
checkData
(
1
,
0
,
9223372036854775805
)
tdSql
.
query
(
"select abs_max(number) from st group by ind"
)
tdSql
.
checkRows
(
3
)
tdSql
.
checkData
(
0
,
0
,
400
)
tdSql
.
checkData
(
2
,
0
,
9223372036854775807
)
# UDF join
tdSql
.
query
(
"select add_one(tb1.id),add_one(bound.id) from tb1,bound where tb1.ts=bound.ts;"
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
checkData
(
0
,
1
,
-
2147483644
)
tdSql
.
query
(
"select stb1.ts,add_one(stb1.id),bound.ts,add_one(bound.id) from stb1,bound where stb1.ts=bound.ts"
)
tdSql
.
checkData
(
0
,
1
,
2
)
tdSql
.
checkData
(
0
,
3
,
-
2147483645
)
tdSql
.
query
(
"select st.ts,add_one(st.id),stb.ts,add_one(stb.id) from st,stb where st.ts=stb.ts and st.ind=stb.ind"
)
tdSql
.
checkData
(
0
,
1
,
-
2147483645
)
tdSql
.
checkData
(
0
,
3
,
2
)
tdSql
.
query
(
"select sum_double(tb1.id),sum_double(bound.id) from tb1,bound where tb1.ts=bound.ts;"
)
tdSql
.
checkData
(
0
,
0
,
0
)
tdSql
.
checkData
(
0
,
1
,
-
4294967290
)
tdSql
.
query
(
"select sum_double(stb1.id),sum_double(bound.id) from stb1,bound where stb1.ts=bound.ts"
)
tdSql
.
checkData
(
0
,
0
,
2
)
tdSql
.
checkData
(
0
,
1
,
-
4294967292
)
#UDF join for stables
tdSql
.
query
(
"select sum_double(st.id),sum_double(stb.id) from st,stb where st.ts=stb.ts and st.ind=stb.ind"
)
tdSql
.
checkData
(
0
,
0
,
-
4294967292
)
tdSql
.
checkData
(
0
,
1
,
2
)
tdSql
.
query
(
"select abs_max(tb1.number),abs_max(bound.number) from tb1,bound where tb1.ts=bound.ts;"
)
tdSql
.
checkData
(
0
,
0
,
0
)
tdSql
.
checkData
(
0
,
1
,
9223372036854775805
)
tdSql
.
query
(
"select abs_max(stb1.number),abs_max(bound.number) from stb1,bound where stb1.ts=bound.ts"
)
tdSql
.
checkData
(
0
,
0
,
10000
)
tdSql
.
checkData
(
0
,
1
,
9223372036854775806
)
tdSql
.
query
(
"select abs_max(st.number),abs_max(stb.number) from st,stb where st.ts=stb.ts and st.ind=stb.ind"
)
tdSql
.
checkData
(
0
,
0
,
9223372036854775806
)
tdSql
.
checkData
(
0
,
1
,
10000
)
# check boundary
#
tdSql.query("select abs_max(number) from bound")
#
tdSql.checkData(0,0,9223372036854775807)
tdSql
.
query
(
"select abs_max(number) from bound"
)
tdSql
.
checkData
(
0
,
0
,
9223372036854775807
)
tdLog
.
info
(
"======= UDF function sum_double check ======="
)
...
...
@@ -189,14 +423,10 @@ class TDTestCase:
tdSql
.
query
(
"select sum_double(id) from tb1"
)
tdSql
.
checkData
(
0
,
0
,
20
)
# UDF bug no 4 -> values error while two function work : it is limit that udf can't work with build-in functions.
# tdSql.query("select sum_double(id) , abs_max(number) from tb1")
# tdSql.checkData(0,0,20)
# tdSql.checkData(0,0,400)
# only one udf function in SQL can use ,follow errors notice.
tdSql
.
error
(
"select sum_double(id) , abs_max(number) from tb1"
)
tdSql
.
error
(
"select sum_double(id) , abs_max(number) from st"
)
# tdSql.query("select sum_double(id) , abs_max(number) from st")
# tdSql.checkData(0,0,44)
# tdSql.checkData(0,0,9223372036854775807)
# UDF not support mix up with build-in functions
# it seems like not support scalar_function mix up with aggregate functions
...
...
@@ -204,147 +434,162 @@ class TDTestCase:
tdSql
.
error
(
"select sum_double(id) ,add_one(id) from tb1"
)
tdSql
.
error
(
"select sum_double(id) ,max(id) from st"
)
tdSql
.
error
(
"select sum_double(id) ,max(id) from tb1"
)
tdSql
.
error
(
"select twa(id),add_one(id) from st"
)
tdSql
.
error
(
"select twa(id),add_one(id) from tb1"
)
# UDF function not support Arithmetic ===================
tdSql
.
query
(
"select max(id) + 5 from st"
)
tdSql
.
query
(
"select max(id) + 5 from tb1"
)
tdSql
.
query
(
"select max(id) + avg(val) from st"
)
tdSql
.
query
(
"select abs_max(number)*5 from st"
)
tdSql
.
checkData
(
0
,
0
,
46116860184273879040.000000000
)
tdSql
.
query
(
"select abs_max(number)*5 from tb1"
)
tdSql
.
checkData
(
0
,
0
,
2000.000000000
)
tdSql
.
query
(
"select max(id) + avg(val) from tb1"
)
tdSql
.
query
(
"select abs_max(number) + 5 from st"
)
tdSql
.
query
(
"select add_one(id) + 5 from st"
)
tdSql
.
checkData
(
4
,
0
,
10.000000000
)
tdSql
.
query
(
"select add_one(id)/5 from tb1"
)
tdSql
.
checkData
(
4
,
0
,
1.000000000
)
tdSql
.
query
(
"select sum_double(id)-5 from st"
)
tdSql
.
checkData
(
0
,
0
,
39.000000000
)
tdSql
.
query
(
"select sum_double(id)*5 from tb1"
)
tdSql
.
checkData
(
0
,
0
,
100.000000000
)
tdSql
.
query
(
"select abs_max(number) + 5 from tb1"
)
tdSql
.
error
(
"select abs_max(number) + max(id) from st"
)
tdSql
.
query
(
"select abs_max(number)*abs_max(val) from st"
)
tdSql
.
query
(
"select sum_double(id) + sum_double(id) from st"
)
tdSql
.
checkData
(
0
,
0
,
88.000000000
)
tdLog
.
info
(
"======= UDF Nested query test ======="
)
tdSql
.
query
(
"select sum(id) from (select id from st)"
)
tdSql
.
checkData
(
0
,
0
,
22
)
#UDF bug no 5 -> not support Nested query
# tdSql.query("select abs_max(number) from (select number from st)")
# tdSql.checkData(0,0,9223372036854775807)
# tdSql.query("select abs_max(number) from (select number from bound)")
# tdSql.checkData(0,0,9223372036854775807)
# tdSql.query("select sum_double(id) from (select id from st)")
# tdSql.checkData(0,0,44)
# tdSql.query("select sum_double(id) from (select id from tb1)")
# tdSql.checkData(0,0,10)
#UDF bug -> Nested query
# outer nest query
tdSql
.
query
(
"select abs_max(number) from (select number from st)"
)
tdSql
.
checkData
(
0
,
0
,
9223372036854775807
)
tdSql
.
query
(
"select abs_max(number) from (select number from bound)"
)
tdSql
.
checkData
(
0
,
0
,
9223372036854775807
)
tdSql
.
query
(
"select sum_double(id) from (select id from st)"
)
tdSql
.
checkData
(
0
,
0
,
44
)
tdSql
.
query
(
"select sum_double(id) from (select id from bound)"
)
tdSql
.
checkData
(
0
,
0
,
4
)
tdSql
.
query
(
"select add_one(id) from (select id from st);"
)
tdSql
.
checkRows
(
14
)
tdSql
.
checkData
(
1
,
0
,
2
)
tdSql
.
query
(
"select add_one(id) from (select id from bound);"
)
tdSql
.
checkRows
(
4
)
tdSql
.
checkData
(
1
,
0
,
-
2147483644
)
# inner nest query
tdSql
.
query
(
"select id from (select add_one(id) id from st)"
)
tdSql
.
checkRows
(
14
)
tdSql
.
checkData
(
13
,
0
,
None
)
tdSql
.
query
(
"select id from (select add_one(id) id from bound)"
)
tdSql
.
checkRows
(
4
)
tdSql
.
checkData
(
3
,
0
,
None
)
tdSql
.
query
(
"select id from (select sum_double(id) id from bound)"
)
tdSql
.
checkData
(
0
,
0
,
4
)
tdSql
.
query
(
"select id from (select sum_double(id) id from st)"
)
# it will crash taos shell
tdSql
.
checkData
(
0
,
0
,
44
)
# UDF bug no 6 -> group by work error
tdLog
.
info
(
"======= UDF work with group by ======="
)
tdSql
.
query
(
"select id from (select abs_max(number) id from st)"
)
# it will crash taos shell
tdSql
.
checkData
(
0
,
0
,
9223372036854775807
)
tdSql
.
query
(
"select id from (select abs_max(number) id from bound)"
)
tdSql
.
checkData
(
0
,
0
,
9223372036854775807
)
# tdSql.query("select sum_double(id) from st group by tbname;")
# tdSql.checkData(0,0,6)
# tdSql.checkData(0,1,'tb1')
# tdSql.checkData(1,0,2)
# tdSql.checkData(1,1,'tb2')
# tdSql.query("select sum_double(id) from st group by id;")
# tdSql.checkRows(2)
# tdSql.query("select sum_double(id) from st group by tbname order by ts asc;")
# inner and outer nest query
tdSql
.
query
(
"select add_one(id) from (select add_one(id) id from st)"
)
tdSql
.
checkRows
(
14
)
tdSql
.
checkData
(
0
,
0
,
2
)
tdSql
.
checkData
(
1
,
0
,
3
)
tdSql
.
query
(
"select sum_double(id) from st where ts < now and ind =1 interval(1s)"
)
tdSql
.
checkData
(
0
,
1
,
20
)
tdSql
.
error
(
"select sum_double(id) from st session(ts, 1s) interval (10s,1s) sliding(10s) fill (NULL) "
)
tdSql
.
error
(
"select sum_double(id) from st session(ts, 1s)"
)
tdSql
.
query
(
"select sum_double(id) from tb1 session(ts, 1s)"
)
tdSql
.
checkData
(
0
,
1
,
20
)
tdSql
.
query
(
"select add_one(id) from (select add_one(id) id from tb1)"
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
2
)
tdSql
.
checkData
(
1
,
0
,
3
)
# UDF -> bug no 7 : intervals sliding values calculation error
# tdSql.query("select sum_double(id) from st where ts < now and ind =1 interval(3s) sliding (1s) limit 2")
# tdSql.checkData(0,1,20)
# tdSql.checkData(1,1,20)
tdSql
.
query
(
"select sum_double(sumdb) from (select sum_double(id) sumdb from st)"
)
tdSql
.
query
(
"select sum_double(sumdb) from (select sum_double(id) sumdb from tb1)"
)
tdSql
.
query
(
"select abs_max(number) from (select abs_max(number) number from st)"
)
tdSql
.
checkData
(
0
,
0
,
9223372036854775807
)
tdSql
.
query
(
"select abs_max(number) from (select abs_max(number) number from bound)"
)
tdSql
.
checkData
(
0
,
0
,
9223372036854775807
)
# nest inner and outer with build-in func
tdSql
.
query
(
"select max(number) from (select abs_max(number) number from st)"
)
tdSql
.
checkData
(
0
,
0
,
9223372036854775807
)
tdSql
.
query
(
"select max(number) from (select abs_max(number) number from bound)"
)
tdSql
.
checkData
(
0
,
0
,
9223372036854775807
)
tdSql
.
query
(
"select sum_double(sumdb) from (select sum_double(id) sumdb from st)"
)
tdSql
.
query
(
"select sum(sumdb) from (select sum_double(id) sumdb from tb1)"
)
tdSql
.
checkData
(
0
,
0
,
20
)
# scalar_function can't work when using interval and sliding =========
tdSql
.
error
(
"select add_one(id) from st where ts < now and ind =1 interval(3s) sliding (1s) limit 2 "
)
tdLog
.
info
(
" =====================test illegal creation method ====================="
)
tdSql
.
execute
(
"drop function add_one"
)
#
tdSql.execute("drop function add_one")
tdSql
.
execute
(
"drop function abs_max"
)
tdSql
.
execute
(
"drop function sum_double"
)
tdSql
.
execute
(
"create aggregate function error_use1 as '/tmp/abs_max.so' outputtype bigint "
)
tdSql
.
error
(
"select error_use1(number) from st"
)
#
UDF -> bug no 8: error return values when
create aggregate functions as an scalar_function
#
illega UDF
create aggregate functions as an scalar_function
# with no aggregate
# tdSql.execute("create function abs_max as '/tmp/abs_max.so' outputtype bigint bufsize 128")
# tdSql.query("select abs_max(number) from st") # this bug will return 3 rows
# tdSql.checkRows(1)
# tdSql.execute("create function sum_double as '/tmp/sum_double.so' outputtype bigint bufsize 128")
# tdSql.execute("select sum_double(id) from st")
# tdSql.checkRows(1)
# UDF -> bug no 9: give bufsize for scalar_function add_one;
# UDF -> need improve : when outputtype is not match datatype which is defined in function codes
tdSql
.
execute
(
"create function add_one as '/tmp/add_one.so' outputtype bigint bufsize 128"
)
# tdSql.error("select add_one(val) from st") # it should return error not [] for not match col datatype
# tdSql.query("select add_one(id) from st") # return error query result
# tdSql.checkData(0,0,1)
# tdSql.checkData(1,0,2)
# tdSql.checkData(5,0,1)
# tdSql.checkData(10,0,-2147483645)
# tdSql.checkData(13,0,None)
tdSql
.
execute
(
"create function abs_max as '/tmp/abs_max.so' outputtype bigint bufsize 128"
)
tdSql
.
error
(
"select abs_max(number) from st"
)
tdSql
.
execute
(
"create function sum_double as '/tmp/sum_double.so' outputtype bigint bufsize 128"
)
tdSql
.
error
(
"select sum_double(id) from st"
)
# UDF -> improve : aggregate function with no bufsize : it seems with no affect
#
tdSql.execute("drop function abs_max")
#
tdSql.execute("drop function sum_double")
tdSql
.
execute
(
"drop function abs_max"
)
tdSql
.
execute
(
"drop function sum_double"
)
tdSql
.
execute
(
"create aggregate function abs_max as '/tmp/abs_max.so' outputtype bigint "
)
tdSql
.
execute
(
"create aggregate function sum_double as '/tmp/sum_double.so' outputtype int "
)
tdSql
.
query
(
"select sum_double(id) from st"
)
tdSql
.
checkData
(
0
,
0
,
44
)
tdSql
.
query
(
"select sum_double(id) from tb1"
)
tdSql
.
checkData
(
0
,
0
,
20
)
#
tdSql.query("select abs_max(number) from st")
#
tdSql.checkData(0,0,9223372036854775807)
tdSql
.
query
(
"select abs_max(number) from st"
)
tdSql
.
checkData
(
0
,
0
,
9223372036854775807
)
tdSql
.
query
(
"select abs_max(number) from tb1"
)
tdSql
.
checkData
(
0
,
0
,
400
)
#UDF bug no 10 -> create function datatype of outputtype not match col datatype
tdSql
.
execute
(
"drop function abs_max"
)
tdSql
.
execute
(
"drop function sum_double"
)
tdSql
.
execute
(
"drop function add_one"
)
tdSql
.
execute
(
"create function add_one as '/tmp/add_one.so' outputtype bigint;"
)
tdSql
.
execute
(
"create aggregate function abs_max as '/tmp/abs_max.so' outputtype int bufsize 128;"
)
tdSql
.
execute
(
"create aggregate function sum_double as '/tmp/sum_double.so' outputtype double bufsize 128;"
)
# tdSql.query("select sum_double(id) from st") this bug will return 0.000000
# tdSql.checkData(0,0,44)
# tdSql.query("select sum_double(id) from tb1")
# tdSql.checkData(0,0,20) this bug will return 0.000000
# tdSql.query("select add_one(id) from st") this bug will return series error values
# tdSql.checkData(0,0,1)
# tdSql.checkData(1,0,2)
# tdSql.checkData(5,0,1)
# tdSql.checkData(10,0,-2147483645)
# tdSql.checkData(13,0,None)
# tdSql.query("select add_one(id) from tb1") this bug will return series error values
# tdSql.checkData(0,0,1)
# tdSql.checkData(2,0,3)
# tdSql.query("select abs_max(id) from st")
# tdSql.checkData(0,0,9223372036854775807)
tdSql
.
query
(
"select abs_max(number) from tb1"
)
# it seems work well
tdSql
.
checkData
(
0
,
0
,
400
)
# UDF scalar function not support group by
tdSql
.
error
(
"select add_one(id) from st group by tbname"
)
# UDF bug no 11 -> follow test case will coredump for taosd and let data lost
# tdSql.query("select add_one(id) from st group by tbname")
# UDF -> bug no 12: give aggregate for scalar_function add_one ,it will let taosd coredump as data lost
# tdSql.execute("drop function add_one")
# tdSql.execute("create aggregate function add_one as '/tmp/add_one.so' outputtype bigint bufsize 128")
# tdSql.query("select add_one(id) from st")
# UDF bug no 13 -> follow test case will coredump for taosc
# tdSql.query("select add_one(*) from st ")
# tdSql.query("select add_one(*) from tb1 ")
# UDF bug no 14 -> follow test case will coredump for taosc
# tdSql.query("select abs_max(id),abs_max(number) from st ")
# tdSql.query("select abs_max(number),abs_max(number) from st ")
# tdSql.query("select sum_double(id),sum_double(id) from st ")
# UDF : give aggregate for scalar_function add_one ,it can't work well
tdSql
.
execute
(
"drop function add_one"
)
tdSql
.
execute
(
"create aggregate function add_one as '/tmp/add_one.so' outputtype bigint bufsize 128"
)
tdSql
.
error
(
"select add_one(id) from st"
)
# udf must give col list
tdSql
.
error
(
"select add_one(*) from st "
)
tdSql
.
error
(
"select add_one(*) from tb1 "
)
# one udf function can multi use
tdSql
.
query
(
"select abs_max(id),abs_max(number) from st "
)
tdSql
.
query
(
"select abs_max(number),abs_max(number)*3 from st "
)
tdSql
.
query
(
"select abs_max(number),abs_max(number)*3 from tb1 "
)
tdSql
.
query
(
"select sum_double(id),sum_double(id) from st "
)
def
run
(
self
):
tdSql
.
prepare
()
...
...
tests/script/api/batchprepare.c
浏览文件 @
f68583e7
...
...
@@ -1761,7 +1761,7 @@ int stmt_funcb_autoctb_e1(TAOS_STMT *stmt) {
int
code
=
taos_stmt_prepare
(
stmt
,
sql
,
0
);
if
(
code
!=
0
){
printf
(
"failed to execute taos_stmt_prepare. error:%s
\n
"
,
taos_stmt_errstr
(
stmt
));
return
-
1
;
exit
(
1
)
;
}
int
id
=
0
;
...
...
@@ -1797,9 +1797,44 @@ int stmt_funcb_autoctb_e1(TAOS_STMT *stmt) {
return
0
;
}
int
stmt_multi_insert_check
(
TAOS_STMT
*
stmt
)
{
char
*
sql
;
// The number of tag column list is not equal to the number of tag value list
sql
=
"insert into ? using stb1 (id1) tags(1,?) values(?,?,?,?,?,?,?,?,?,?)"
;
if
(
0
==
taos_stmt_prepare
(
stmt
,
sql
,
0
))
{
printf
(
"failed to check taos_stmt_prepare. sql:%s
\n
"
,
sql
);
exit
(
1
);
}
// The number of column list is not equal to the number of value list
sql
=
"insert into ? using stb1 tags(1,?,2,?,4,?,6.0,?,'b') "
"(ts, b, v1, v2, v4, v8, f4, f8, bin) values(?,?,?,?,?,?,?,?,?,?)"
;
if
(
0
==
taos_stmt_prepare
(
stmt
,
sql
,
0
))
{
printf
(
"failed to check taos_stmt_prepare. sql:%s
\n
"
,
sql
);
exit
(
1
);
}
sql
=
"insert into ? using stb1 () tags(1,?) values(?,?,?,?,?,?,?,?,?,?)"
;
if
(
0
==
taos_stmt_prepare
(
stmt
,
sql
,
0
))
{
printf
(
"failed to check taos_stmt_prepare. sql:%s
\n
"
,
sql
);
exit
(
1
);
}
sql
=
"insert into ? using stb1 ( tags(1,?) values(?,?,?,?,?,?,?,?,?,?)"
;
if
(
0
==
taos_stmt_prepare
(
stmt
,
sql
,
0
))
{
printf
(
"failed to check taos_stmt_prepare. sql:%s
\n
"
,
sql
);
exit
(
1
);
}
sql
=
"insert into ? using stb1 ) tags(1,?) values(?,?,?,?,?,?,?,?,?,?)"
;
if
(
0
==
taos_stmt_prepare
(
stmt
,
sql
,
0
))
{
printf
(
"failed to check taos_stmt_prepare. sql:%s
\n
"
,
sql
);
exit
(
1
);
}
return
0
;
}
//1 tables 10 records
int
stmt_funcb_autoctb_e2
(
TAOS_STMT
*
stmt
)
{
...
...
@@ -4505,7 +4540,6 @@ void* runcase(void *par) {
(
void
)
idx
;
#if 1
prepare
(
taos
,
1
,
1
);
...
...
@@ -4819,6 +4853,16 @@ void* runcase(void *par) {
#endif
#if 1
prepare
(
taos
,
1
,
0
);
stmt
=
taos_stmt_init
(
taos
);
printf
(
"stmt_multi_insert_check start
\n
"
);
stmt_multi_insert_check
(
stmt
);
printf
(
"stmt_multi_insert_check end
\n
"
);
taos_stmt_close
(
stmt
);
#endif
#if 1
prepare
(
taos
,
1
,
1
);
...
...
@@ -5007,7 +5051,6 @@ void* runcase(void *par) {
printf
(
"check result end
\n
"
);
#endif
#if 1
preparem
(
taos
,
0
,
idx
);
...
...
tests/script/general/parser/udf_dll.sim
浏览文件 @
f68583e7
...
...
@@ -10,7 +10,7 @@ sql connect
print ======================== dnode1 start
sql create function add_one as '/tmp/add_one.so' outputtype int;
sql create aggregate function sum_double as '/tmp/sum_double.so' outputtype int;
sql create aggregate function sum_double as '/tmp/sum_double.so' outputtype
big
int;
sql show functions;
if $rows != 2 then
return -1
...
...
tests/script/general/parser/udf_dll_stable.sim
浏览文件 @
f68583e7
...
...
@@ -11,7 +11,7 @@ print ======================== dnode1 start
sql create function add_one as '/tmp/add_one.so' outputtype int;
sql create function add_one_64232 as '/tmp/add_one_64232.so' outputtype int;
sql create aggregate function sum_double as '/tmp/sum_double.so' outputtype int;
sql create aggregate function sum_double as '/tmp/sum_double.so' outputtype
big
int;
sql show functions;
if $rows != 3 then
return -1
...
...
tests/script/sh/abs_max.c
浏览文件 @
f68583e7
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
typedef
struct
SUdfInit
{
int
maybe_null
;
/* 1 if function can return NULL */
int
decimals
;
/* for real functions */
long
long
length
;
/* For string functions */
int64_t
length
;
/* For string functions */
char
*
ptr
;
/* free pointer for function data */
int
const_item
;
/* 0 if result is independent of arguments */
}
SUdfInit
;
...
...
@@ -14,31 +15,36 @@ typedef struct SUdfInit{
#define TSDB_DATA_INT_NULL 0x80000000L
#define TSDB_DATA_BIGINT_NULL 0x8000000000000000L
void
abs_max
(
char
*
data
,
short
itype
,
short
ibytes
,
int
numOfRows
,
long
long
*
ts
,
char
*
dataOutput
,
char
*
interBuf
,
char
*
tsOutput
,
void
abs_max
(
char
*
data
,
short
itype
,
short
ibytes
,
int
numOfRows
,
int64_t
*
ts
,
char
*
dataOutput
,
char
*
interBuf
,
char
*
tsOutput
,
int
*
numOfOutput
,
short
otype
,
short
obytes
,
SUdfInit
*
buf
)
{
int
i
;
int
r
=
0
;
printf
(
"abs_max input data:%p, type:%d, rows:%d, ts:%p,%lld
, dataoutput:%p, tsOutput:%p, numOfOutput:%p, buf:%p
\n
"
,
data
,
itype
,
numOfRows
,
ts
,
*
ts
,
dataOutput
,
tsOutput
,
numOfOutput
,
buf
);
int
64_t
r
=
0
;
// printf("abs_max input data:%p, type:%d, rows:%d, ts:%p, %" PRId64 "
, dataoutput:%p, tsOutput:%p, numOfOutput:%p, buf:%p\n", data, itype, numOfRows, ts, *ts, dataOutput, tsOutput, numOfOutput, buf);
if
(
itype
==
5
)
{
r
=*
(
long
*
)
dataOutput
;
r
=*
(
int64_t
*
)
dataOutput
;
*
numOfOutput
=
0
;
for
(
i
=
0
;
i
<
numOfRows
;
++
i
)
{
if
(
*
((
long
*
)
data
+
i
)
==
TSDB_DATA_BIGINT_NULL
)
{
if
(
*
((
int64_t
*
)
data
+
i
)
==
TSDB_DATA_BIGINT_NULL
)
{
continue
;
}
*
numOfOutput
=
1
;
long
v
=
abs
(
*
((
long
*
)
data
+
i
));
//int64_t v = abs(*((int64_t *)data + i));
int64_t
v
=
*
((
int64_t
*
)
data
+
i
);
if
(
v
<
0
)
{
v
=
0
-
v
;
}
if
(
v
>
r
)
{
r
=
v
;
}
}
*
(
long
*
)
dataOutput
=
r
;
*
(
int64_t
*
)
dataOutput
=
r
;
printf
(
"abs_max out, dataoutput:%ld, numOfOutput:%d
\n
"
,
*
(
long
*
)
dataOutput
,
*
numOfOutput
);
}
else
{
// printf("abs_max out, dataoutput:%" PRId64", numOfOutput:%d\n", *(int64_t
*)dataOutput, *numOfOutput);
}
else
{
*
numOfOutput
=
0
;
}
}
...
...
@@ -47,44 +53,43 @@ void abs_max(char* data, short itype, short ibytes, int numOfRows, long long* ts
void
abs_max_finalize
(
char
*
dataOutput
,
char
*
interBuf
,
int
*
numOfOutput
,
SUdfInit
*
buf
)
{
int
i
;
in
t
r
=
0
;
printf
(
"abs_max_finalize dataoutput:%p:%d, numOfOutput:%d, buf:%p
\n
"
,
dataOutput
,
*
dataOutput
,
*
numOfOutput
,
buf
);
printf
(
"abs_max finalize, dataoutput:%ld, numOfOutput:%d
\n
"
,
*
(
long
*
)
dataOutput
,
*
numOfOutput
);
//int64_
t r = 0;
//
printf("abs_max_finalize dataoutput:%p:%d, numOfOutput:%d, buf:%p\n", dataOutput, *dataOutput, *numOfOutput, buf);
// *numOfOutput=1;
// printf("abs_max finalize, dataoutput:%" PRId64", numOfOutput:%d\n", *(int64_t
*)dataOutput, *numOfOutput);
}
void
abs_max_merge
(
char
*
data
,
int32_t
numOfRows
,
char
*
dataOutput
,
int32_t
*
numOfOutput
,
SUdfInit
*
buf
)
{
int
r
=
0
;
int
64_t
r
=
0
;
if
(
numOfRows
>
0
)
{
r
=
*
((
long
*
)
data
);
r
=
*
((
int64_t
*
)
data
);
}
printf
(
"abs_max_merge numOfRows:%d, dataoutput:%p, buf:%p
\n
"
,
numOfRows
,
dataOutput
,
buf
);
//
printf("abs_max_merge numOfRows:%d, dataoutput:%p, buf:%p\n", numOfRows, dataOutput, buf);
for
(
int
i
=
1
;
i
<
numOfRows
;
++
i
)
{
printf
(
"abs_max_merge %d - %ld
\n
"
,
i
,
*
((
long
*
)
data
+
i
));
if
(
*
((
long
*
)
data
+
i
)
>
r
)
{
r
=
*
((
long
*
)
data
+
i
);
// printf("abs_max_merge %d - %" PRId64"\n", i, *((int64_t
*)data + i));
if
(
*
((
int64_t
*
)
data
+
i
)
>
r
)
{
r
=
*
((
int64_t
*
)
data
+
i
);
}
}
*
(
long
*
)
dataOutput
=
r
;
*
(
int64_t
*
)
dataOutput
=
r
;
if
(
numOfRows
>
0
)
{
*
numOfOutput
=
1
;
}
else
{
*
numOfOutput
=
0
;
}
printf
(
"abs_max_merge, dataoutput:%ld, numOfOutput:%d
\n
"
,
*
(
long
*
)
dataOutput
,
*
numOfOutput
);
// printf("abs_max_merge, dataoutput:%" PRId64", numOfOutput:%d\n", *(int64_t
*)dataOutput, *numOfOutput);
}
int
abs_max_init
(
SUdfInit
*
buf
)
{
printf
(
"abs_max init
\n
"
);
//
printf("abs_max init\n");
return
0
;
}
void
abs_max_destroy
(
SUdfInit
*
buf
)
{
printf
(
"abs_max destroy
\n
"
);
//
printf("abs_max destroy\n");
}
\ No newline at end of file
tests/script/sh/add_one.c
浏览文件 @
f68583e7
...
...
@@ -14,20 +14,18 @@ void add_one(char* data, short itype, short ibytes, int numOfRows, long long* ts
int
*
numOfOutput
,
short
otype
,
short
obytes
,
SUdfInit
*
buf
)
{
int
i
;
int
r
=
0
;
printf
(
"add_one input data:%p, type:%d, rows:%d, ts:%p,%lld, dataoutput:%p, tsOutput:%p, numOfOutput:%p, buf:%p
\n
"
,
data
,
itype
,
numOfRows
,
ts
,
*
ts
,
dataOutput
,
tsOutput
,
numOfOutput
,
buf
);
//
printf("add_one input data:%p, type:%d, rows:%d, ts:%p,%lld, dataoutput:%p, tsOutput:%p, numOfOutput:%p, buf:%p\n", data, itype, numOfRows, ts, *ts, dataOutput, tsOutput, numOfOutput, buf);
if
(
itype
==
4
)
{
for
(
i
=
0
;
i
<
numOfRows
;
++
i
)
{
printf
(
"input %d - %d"
,
i
,
*
((
int
*
)
data
+
i
));
//
printf("input %d - %d", i, *((int *)data + i));
*
((
int
*
)
dataOutput
+
i
)
=*
((
int
*
)
data
+
i
)
+
1
;
printf
(
", output %d
\n
"
,
*
((
int
*
)
dataOutput
+
i
));
//
printf(", output %d\n", *((int *)dataOutput+i));
if
(
tsOutput
)
{
*
(
long
long
*
)
tsOutput
=
1000000
;
}
}
*
numOfOutput
=
numOfRows
;
printf
(
"add_one out, numOfOutput:%d
\n
"
,
*
numOfOutput
);
//
printf("add_one out, numOfOutput:%d\n", *numOfOutput);
}
}
\ No newline at end of file
tests/script/sh/add_one_64232.c
浏览文件 @
f68583e7
...
...
@@ -17,7 +17,7 @@ void add_one_64232(char* data, short itype, short ibytes, int numOfRows, long lo
printf
(
"add_one_64232 input data:%p, type:%d, rows:%d, ts:%p,%lld, dataoutput:%p, tsOutput:%p, numOfOutput:%p, buf:%p
\n
"
,
data
,
itype
,
numOfRows
,
ts
,
*
ts
,
dataOutput
,
tsOutput
,
numOfOutput
,
buf
);
if
(
itype
==
5
)
{
for
(
i
=
0
;
i
<
numOfRows
;
++
i
)
{
printf
(
"input %d - %d"
,
i
,
*
((
long
*
)
data
+
i
));
printf
(
"input %d - %
l
d"
,
i
,
*
((
long
*
)
data
+
i
));
*
((
int
*
)
dataOutput
+
i
)
=
(
int
)
*
((
long
*
)
data
+
i
)
+
1
;
printf
(
", output %d
\n
"
,
*
((
int
*
)
dataOutput
+
i
));
if
(
tsOutput
)
{
...
...
@@ -29,5 +29,3 @@ void add_one_64232(char* data, short itype, short ibytes, int numOfRows, long lo
printf
(
"add_one_64232 out, numOfOutput:%d
\n
"
,
*
numOfOutput
);
}
}
\ No newline at end of file
tests/script/sh/sum_double.c
浏览文件 @
f68583e7
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
typedef
struct
SUdfInit
{
int
maybe_null
;
/* 1 if function can return NULL */
int
decimals
;
/* for real functions */
long
long
length
;
/* For string functions */
int64_t
length
;
/* For string functions */
char
*
ptr
;
/* free pointer for function data */
int
const_item
;
/* 0 if result is independent of arguments */
}
SUdfInit
;
...
...
@@ -13,13 +14,13 @@ typedef struct SUdfInit{
#define TSDB_DATA_INT_NULL 0x80000000L
void
sum_double
(
char
*
data
,
short
itype
,
short
ibytes
,
int
numOfRows
,
long
long
*
ts
,
char
*
dataOutput
,
char
*
interBuf
,
char
*
tsOutput
,
void
sum_double
(
char
*
data
,
short
itype
,
short
ibytes
,
int
numOfRows
,
int64_t
*
ts
,
char
*
dataOutput
,
char
*
interBuf
,
char
*
tsOutput
,
int
*
numOfOutput
,
short
otype
,
short
obytes
,
SUdfInit
*
buf
)
{
int
i
;
int
r
=
0
;
printf
(
"sum_double input data:%p, type:%d, rows:%d, ts:%p,%
lld
, dataoutput:%p, tsOutput:%p, numOfOutput:%p, buf:%p
\n
"
,
data
,
itype
,
numOfRows
,
ts
,
*
ts
,
dataOutput
,
tsOutput
,
numOfOutput
,
buf
);
int
64_t
r
=
0
;
printf
(
"sum_double input data:%p, type:%d, rows:%d, ts:%p,%
"
PRId64
"
, dataoutput:%p, tsOutput:%p, numOfOutput:%p, buf:%p
\n
"
,
data
,
itype
,
numOfRows
,
ts
,
*
ts
,
dataOutput
,
tsOutput
,
numOfOutput
,
buf
);
if
(
itype
==
4
)
{
r
=*
(
int
*
)
dataOutput
;
r
=*
(
int
64_t
*
)
dataOutput
;
*
numOfOutput
=
0
;
for
(
i
=
0
;
i
<
numOfRows
;
++
i
)
{
...
...
@@ -29,10 +30,10 @@ void sum_double(char* data, short itype, short ibytes, int numOfRows, long long*
*
numOfOutput
=
1
;
r
+=*
((
int
*
)
data
+
i
);
*
(
int
*
)
dataOutput
=
r
;
*
(
int
64_t
*
)
dataOutput
=
r
;
}
printf
(
"sum_double out, dataoutput:%d, numOfOutput:%d
\n
"
,
*
(
in
t
*
)
dataOutput
,
*
numOfOutput
);
// printf("sum_double out, dataoutput:%"PRId64", numOfOutput:%d\n", *(int64_
t *)dataOutput, *numOfOutput);
}
}
...
...
@@ -40,45 +41,44 @@ void sum_double(char* data, short itype, short ibytes, int numOfRows, long long*
void
sum_double_finalize
(
char
*
dataOutput
,
char
*
interBuf
,
int
*
numOfOutput
,
SUdfInit
*
buf
)
{
int
i
;
int
r
=
0
;
printf
(
"sum_double_finalize dataoutput:%p:%d, numOfOutput:%d, buf:%p
\n
"
,
dataOutput
,
*
dataOutput
,
*
numOfOutput
,
buf
);
*
numOfOutput
=
1
;
*
(
int
*
)(
buf
->
ptr
)
=*
(
in
t
*
)
dataOutput
*
2
;
*
(
int
*
)
dataOutput
=*
(
in
t
*
)(
buf
->
ptr
);
printf
(
"sum_double finalize, dataoutput:%d, numOfOutput:%d
\n
"
,
*
(
in
t
*
)
dataOutput
,
*
numOfOutput
);
int
64_t
r
=
0
;
// printf("sum_double_finalize dataoutput:%p:%"PRId64", numOfOutput:%d, buf:%p\n", dataOutput, *(int64_t*)
dataOutput, *numOfOutput, buf);
//
*numOfOutput=1;
*
(
int
64_t
*
)(
buf
->
ptr
)
=*
(
int64_
t
*
)
dataOutput
*
2
;
*
(
int
64_t
*
)
dataOutput
=*
(
int64_
t
*
)(
buf
->
ptr
);
// printf("sum_double finalize, dataoutput:%"PRId64", numOfOutput:%d\n", *(int64_
t *)dataOutput, *numOfOutput);
}
void
sum_double_merge
(
char
*
data
,
int32_t
numOfRows
,
char
*
dataOutput
,
int
32_t
*
numOfOutput
,
SUdfInit
*
buf
)
{
void
sum_double_merge
(
char
*
data
,
int32_t
numOfRows
,
char
*
dataOutput
,
int
*
numOfOutput
,
SUdfInit
*
buf
)
{
int
r
=
0
;
int
sum
=
0
;
int
64_t
sum
=
0
;
printf
(
"sum_double_merge numOfRows:%d, dataoutput:%p, buf:%p
\n
"
,
numOfRows
,
dataOutput
,
buf
);
//
printf("sum_double_merge numOfRows:%d, dataoutput:%p, buf:%p\n", numOfRows, dataOutput, buf);
for
(
int
i
=
0
;
i
<
numOfRows
;
++
i
)
{
printf
(
"sum_double_merge %d - %d
\n
"
,
i
,
*
((
in
t
*
)
data
+
i
));
sum
+=*
((
int
*
)
data
+
i
);
// printf("sum_double_merge %d - %"PRId64"\n", i, *((int64_
t*)data + i));
sum
+=*
((
int
64_t
*
)
data
+
i
);
}
*
(
int
*
)
dataOutput
+=
sum
;
*
(
int
64_t
*
)
dataOutput
+=
sum
;
if
(
numOfRows
>
0
)
{
*
numOfOutput
=
1
;
}
else
{
*
numOfOutput
=
0
;
}
printf
(
"sum_double_merge, dataoutput:%d, numOfOutput:%d
\n
"
,
*
(
in
t
*
)
dataOutput
,
*
numOfOutput
);
// printf("sum_double_merge, dataoutput:%"PRId64", numOfOutput:%d\n", *(int64_
t *)dataOutput, *numOfOutput);
}
int
sum_double_init
(
SUdfInit
*
buf
)
{
buf
->
maybe_null
=
1
;
buf
->
ptr
=
malloc
(
sizeof
(
int
));
printf
(
"sum_double init
\n
"
);
buf
->
ptr
=
malloc
(
sizeof
(
int
64_t
));
//
printf("sum_double init\n");
return
0
;
}
void
sum_double_destroy
(
SUdfInit
*
buf
)
{
free
(
buf
->
ptr
);
printf
(
"sum_double destroy
\n
"
);
//
printf("sum_double destroy\n");
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录