diff --git a/.gitignore b/.gitignore index 50f4251320abc80358b67eab22c02672d5f26bd6..0e7125c6565e0809b39098502589758aa6cb02de 100644 --- a/.gitignore +++ b/.gitignore @@ -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; -*- diff --git a/Jenkinsfile b/Jenkinsfile index 413a5685feb59e159719de03e44dbad0e12cf834..ad3a5d877d26014fc2a303cd335f9469206a9212 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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 @@ -290,7 +361,7 @@ pipeline { stage('python_3_s6') { agent{label " slave6 || slave16 "} steps { - timeout(time: 55, unit: 'MINUTES'){ + timeout(time: 65, unit: 'MINUTES'){ pre_test() sh ''' date @@ -396,7 +467,7 @@ pipeline { stage('test_b4_s7') { agent{label " slave7 || slave17 "} steps { - timeout(time: 55, unit: 'MINUTES'){ + timeout(time: 105, unit: 'MINUTES'){ pre_test() sh ''' date @@ -428,7 +499,7 @@ pipeline { stage('test_b6_s9') { agent{label " slave9 || slave19 "} steps { - timeout(time: 55, unit: 'MINUTES'){ + timeout(time: 105, 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 Wintest - // ''' - // } - // } - // 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 wintest + ''' + } + } + script{ + win_stop=1 + } + } + } } diff --git a/cmake/define.inc b/cmake/define.inc index 87c88b35a9e9f68ce9d30e340f5b13570ce00231..c666d243e022f9a21f0f7f483ed9f97ab87b826b 100755 --- a/cmake/define.inc +++ b/cmake/define.inc @@ -117,7 +117,7 @@ IF (TD_MIPS_32) SET(COMMON_FLAGS "-Wall -Werror -fPIC -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE") ENDIF () -IF (TD_APLHINE) +IF (TD_ALPINE) SET(COMMON_FLAGS "${COMMON_FLAGS} -largp") link_libraries(/usr/lib/libargp.a) ADD_DEFINITIONS(-D_ALPINE) @@ -136,7 +136,12 @@ IF (TD_LINUX) ENDIF () IF (TD_MEMORY_SANITIZER) - SET(DEBUG_FLAGS "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fno-sanitize=null -fno-sanitize=alignment -static-libasan -O0 -g3 -DDEBUG") + IF (TD_ARCHLINUX) + SET(DEBUG_FLAGS "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fno-sanitize=null -fno-sanitize=alignment -O0 -g3 -DDEBUG") + ELSE () + SET(DEBUG_FLAGS "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fno-sanitize=null -fno-sanitize=alignment -static-libasan -O0 -g3 -DDEBUG") + ENDIF () + MESSAGE(STATUS "${BoldRed}Will compile with memory sanitizer! ${ColourReset}") ELSE () SET(DEBUG_FLAGS "-O0 -g3 -DDEBUG") ENDIF () diff --git a/cmake/install.inc b/cmake/install.inc index 5a39173697e596cb9fa96a883000d2f3ea996c46..792638be96bfe56362e80f939386ec3cd0e6d327 100755 --- a/cmake/install.inc +++ b/cmake/install.inc @@ -1,8 +1,7 @@ IF (TD_LINUX) SET(TD_MAKE_INSTALL_SH "${TD_COMMUNITY_DIR}/packaging/tools/make_install.sh") INSTALL(CODE "MESSAGE(\"make install script: ${TD_MAKE_INSTALL_SH}\")") - INSTALL(CODE "execute_process(COMMAND chmod 777 ${TD_MAKE_INSTALL_SH})") - INSTALL(CODE "execute_process(COMMAND ${TD_MAKE_INSTALL_SH} ${TD_COMMUNITY_DIR} ${PROJECT_BINARY_DIR} Linux ${TD_VER_NUMBER})") + INSTALL(CODE "execute_process(COMMAND bash ${TD_MAKE_INSTALL_SH} ${TD_COMMUNITY_DIR} ${PROJECT_BINARY_DIR} Linux ${TD_VER_NUMBER})") ELSEIF (TD_WINDOWS) IF (TD_POWER) SET(CMAKE_INSTALL_PREFIX C:/PowerDB) @@ -41,6 +40,5 @@ ELSEIF (TD_WINDOWS) ELSEIF (TD_DARWIN) SET(TD_MAKE_INSTALL_SH "${TD_COMMUNITY_DIR}/packaging/tools/make_install.sh") INSTALL(CODE "MESSAGE(\"make install script: ${TD_MAKE_INSTALL_SH}\")") - INSTALL(CODE "execute_process(COMMAND chmod 777 ${TD_MAKE_INSTALL_SH})") - INSTALL(CODE "execute_process(COMMAND ${TD_MAKE_INSTALL_SH} ${TD_COMMUNITY_DIR} ${PROJECT_BINARY_DIR} Darwin ${TD_VER_NUMBER})") + INSTALL(CODE "execute_process(COMMAND bash ${TD_MAKE_INSTALL_SH} ${TD_COMMUNITY_DIR} ${PROJECT_BINARY_DIR} Darwin ${TD_VER_NUMBER})") ENDIF () diff --git a/cmake/platform.inc b/cmake/platform.inc index a78082a1fc62a8ad66c54dcf005e3e15edf5f5f0..9ef04815c3150cf18193895475c93389cf26aac2 100755 --- a/cmake/platform.inc +++ b/cmake/platform.inc @@ -21,7 +21,7 @@ SET(TD_LINUX FALSE) SET(TD_ARM_32 FALSE) SET(TD_MIPS_64 FALSE) SET(TD_MIPS_32 FALSE) - SET(TD_APLHINE FALSE) + SET(TD_ALPINE FALSE) SET(TD_NINGSI FALSE) SET(TD_NINGSI_60 FALSE) SET(TD_NINGSI_80 FALSE) @@ -36,7 +36,7 @@ IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux") # Get OS information and store in variable TD_OS_INFO. # execute_process(COMMAND chmod 777 ${TD_COMMUNITY_DIR}/packaging/tools/get_os.sh) - execute_process(COMMAND ${TD_COMMUNITY_DIR}/packaging/tools/get_os.sh "" OUTPUT_VARIABLE TD_OS_INFO) + execute_process(COMMAND sh ${TD_COMMUNITY_DIR}/packaging/tools/get_os.sh "" OUTPUT_VARIABLE TD_OS_INFO) MESSAGE(STATUS "The current os is " ${TD_OS_INFO}) SET(TD_LINUX TRUE) @@ -52,8 +52,13 @@ IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux") ENDIF () IF (${TD_OS_INFO} MATCHES "Alpine") - SET(TD_APLHINE TRUE) - MESSAGE(STATUS "The current OS is Alpine, append extra flags") + SET(TD_ALPINE TRUE) + MESSAGE(STATUS "The current OS is Alpine Linux, append extra flags") + ELSEIF (${TD_OS_INFO} MATCHES "Arch") + SET(TD_ARCHLINUX TRUE) + MESSAGE(STATUS "The current OS is Arch Linux") + ELSE () + MESSAGE(STATUS "Ths distro is " ${TD_OS_INFO}) ENDIF() ELSEIF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") SET(TD_DARWIN TRUE) @@ -155,7 +160,7 @@ ELSEIF (${OSTYPE} MATCHES "Linux") MESSAGE(STATUS "input osType: Linux") ELSEIF (${OSTYPE} MATCHES "Alpine") MESSAGE(STATUS "input osType: Alpine") - SET(TD_APLHINE TRUE) + SET(TD_ALPINE TRUE) ELSE () MESSAGE(STATUS "The user specified osType is unknown: " ${OSTYPE}) ENDIF () diff --git a/cmake/version.inc b/cmake/version.inc index c199cdbaf74ed3272202e43bbf6153508dbd93e8..c697d79b56f2ca3b7725f9cdcc8807eac1dacbe9 100755 --- a/cmake/version.inc +++ b/cmake/version.inc @@ -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) diff --git a/documentation20/cn/09.connections/docs.md b/documentation20/cn/09.connections/docs.md index b47f297ae0a68c91e5d38aad000acdb14591283d..d341b31b01badfe0db97d6267243e079ccdda0eb 100644 --- a/documentation20/cn/09.connections/docs.md +++ b/documentation20/cn/09.connections/docs.md @@ -3,7 +3,7 @@ ## 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 插件请从 下载。 -以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 部署所在服务器指定间隔系统内存平均使用量如下: ![img](page://images/connections/create_dashboard2.jpg) @@ -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` 填入并加载: ![img](page://images/connections/import_dashboard1.jpg) 导入完成之后可看到如下效果: -![img](page://images/connections/import_dashboard2.jpg) - +![img](../images/connections/dashboard-15146.png) ## MATLAB diff --git a/documentation20/cn/14.devops/01.telegraf/docs.md b/documentation20/cn/14.devops/01.telegraf/docs.md new file mode 100644 index 0000000000000000000000000000000000000000..04765602dab18fbacf7d92d44ca324db660c0ac4 --- /dev/null +++ b/documentation20/cn/14.devops/01.telegraf/docs.md @@ -0,0 +1,73 @@ +# 使用 TDengine + Telegraf + Grafana 快速搭建 IT 运维展示系统 + +## 背景介绍 +TDengine是涛思数据专为物联网、车联网、工业互联网、IT运维等设计和优化的大数据平台。自从 2019年 7 月开源以来,凭借创新的数据建模设计、快捷的安装方式、易用的编程接口和强大的数据写入查询性能博得了大量时序数据开发者的青睐。 + +IT 运维监测数据通常都是对时间特性比较敏感的数据,例如: +- 系统资源指标:CPU、内存、IO、带宽等。 +- 软件系统指标:存活状态、连接数目、请求数目、超时数目、错误数目、响应时间、服务类型及其他与业务有关的指标。 + +当前主流的 IT 运维系统通常包含一个数据采集模块,一个数据存储模块,和一个可视化显示模块。Telegraf 和 Grafana 分别是当前最流行的数据采集模块和可视化显示模块之一。而数据存储模块可供选择的软件比较多,其中 OpenTSDB 或 InfluxDB 比较流行。而 TDengine 作为新兴的时序大数据平台,具备极强的高性能、高可靠、易管理、易维护的优势。 + +本文介绍不需要写一行代码,通过简单修改几行配置文件,就可以快速搭建一个基于 TDengine + Telegraf + Grafana 的 IT 运维系统。架构如下图: + +![IT-DevOps-Solutions-Telegraf.png](../../images/IT-DevOps-Solutions-Telegraf.png) + + +## 安装步骤 + +### 安装 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]\nallow_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://:6041/influxdb/v1/write?db=" + method = "POST" + timeout = "5s" + username = "" + 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-DevOps-Solutions-telegraf-dashboard.png](../../images/IT-DevOps-Solutions-telegraf-dashboard.png) + + +## 总结 + +以上演示如何快速搭建一个完整的 IT 运维展示系统。得力于 TDengine 2.3.0.0 版本中新增的 schemaless 协议解析功能,以及强大的生态软件适配能力,用户可以短短数分钟就可以搭建一个高效易用的 IT 运维系统。TDengine 强大的数据写入查询性能和其他丰富功能请参考官方文档和产品落地案例。 diff --git a/documentation20/cn/14.devops/02.collectd/docs.md b/documentation20/cn/14.devops/02.collectd/docs.md new file mode 100644 index 0000000000000000000000000000000000000000..a35772bb498d426a1f44a9e7eb0bea61b51f92a5 --- /dev/null +++ b/documentation20/cn/14.devops/02.collectd/docs.md @@ -0,0 +1,79 @@ +# 使用 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 运维系统。架构如下图: + +![IT-DevOps-Solutions-Collectd-StatsD.png](../../images/IT-DevOps-Solutions-Collectd-StatsD.png) + +## 安装步骤 +安装 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]\nallow_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 + + Server "" "" + + +sudo systemctl start collectd +``` + +### 配置 StatsD +在 config.js 文件中增加如下内容后启动 StatsD,其中 host 和 port 请填写 TDengine 和 BLM3 配置的实际值: +``` +backends 部分添加 "./backends/repeater" +repeater 部分添加 { host:'', port: } +``` + +### 导入 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 文件导入。之后可以看到如下界面的仪表盘: + +![IT-DevOps-Solutions-collectd-dashboard.png](../../images/IT-DevOps-Solutions-collectd-dashboard.png) + +#### 导入 StatsD 仪表盘 + +从 https://github.com/taosdata/grafanaplugin/blob/master/examples/statsd/dashboards/statsd-with-tdengine-v0.1.0.json 下载 dashboard json 文件,点击左侧加号图标并选择 Import,按照界面提示导入JSON文件。之后可以看到如下界面的仪表盘: +![IT-DevOps-Solutions-statsd-dashboard.png](../../images/IT-DevOps-Solutions-statsd-dashboard.png) + +## 总结 +TDengine 作为新兴的时序大数据平台,具备极强的高性能、高可靠、易管理、易维护的优势。得力于 TDengine 2.3.0.0 版本中新增的 schemaless 协议解析功能,以及强大的生态软件适配能力,用户可以短短数分钟就可以搭建一个高效易用的 IT 运维系统或者适配一个已存在的系统。 + +TDengine 强大的数据写入查询性能和其他丰富功能请参考官方文档和产品成功落地案例。 diff --git a/documentation20/cn/images/connections/dashboard-15146.png b/documentation20/cn/images/connections/dashboard-15146.png new file mode 100644 index 0000000000000000000000000000000000000000..3eb240ad8ad648953e32f27e674e2a9171ed9af8 Binary files /dev/null and b/documentation20/cn/images/connections/dashboard-15146.png differ diff --git a/documentation20/en/09.connections/docs.md b/documentation20/en/09.connections/docs.md index e759da31677a5344a0f6578c751c4b77f86a43db..6a398dfdf70f67ce4d5a520ec9bc9ebf3c6e993e 100644 --- a/documentation20/en/09.connections/docs.md +++ b/documentation20/en/09.connections/docs.md @@ -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 . + +```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: ![img](page://images/connections/import_dashboard1.jpg) You can see as follows after Dashboard imported. -![img](page://images/connections/import_dashboard2.jpg) +![img](../images/connections/dashboard-15146.png) ## MATLAB diff --git a/documentation20/en/images/connections/dashboard-15146.png b/documentation20/en/images/connections/dashboard-15146.png new file mode 100644 index 0000000000000000000000000000000000000000..3eb240ad8ad648953e32f27e674e2a9171ed9af8 Binary files /dev/null and b/documentation20/en/images/connections/dashboard-15146.png differ diff --git a/packaging/deb/makedeb.sh b/packaging/deb/makedeb.sh index a169bf2ba02d67d7c540d3dc3f017324bbc15fc8..f1a7e9bb9d3b4cfc86f55c68ec2b59417a371ac0 100755 --- a/packaging/deb/makedeb.sh +++ b/packaging/deb/makedeb.sh @@ -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 diff --git a/packaging/release.sh b/packaging/release.sh index 8ed73e9c85b42c2e42e11657dd30db50c1a4d779..185fb6a7dca06508c79ff707851fad2f6b7562e2 100755 --- a/packaging/release.sh +++ b/packaging/release.sh @@ -194,6 +194,7 @@ fi if [[ "$dbName" == "pro" ]]; then sed -i "s/taos config/prodb config/g" ${top_dir}/src/util/src/tconfig.c + sed -i "s/TDengine/ProDB/g" ${top_dir}/src/dnode/src/dnodeSystem.c fi diff --git a/packaging/rpm/tdengine.spec b/packaging/rpm/tdengine.spec index 8a870286aba1793ec880af6dd0d8a21602ddc86e..551f56bf0cf850a3680e8e92d36ecdcda737de49 100644 --- a/packaging/rpm/tdengine.spec +++ b/packaging/rpm/tdengine.spec @@ -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 diff --git a/packaging/tools/make_install.sh b/packaging/tools/make_install.sh index 962500284c8c3c1d7863a2905653eafee65268f7..dcdd277457956ba017ff19283b0ca1a1c5abc42a 100644 --- a/packaging/tools/make_install.sh +++ b/packaging/tools/make_install.sh @@ -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 diff --git a/packaging/tools/makeclient.sh b/packaging/tools/makeclient.sh index 8fc431bfbc66d4f9d482ab5885d282081139ef4d..b0fe788044387c4bde6279d6504957fa0eba911c 100755 --- a/packaging/tools/makeclient.sh +++ b/packaging/tools/makeclient.sh @@ -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 diff --git a/packaging/tools/makeclient_power.sh b/packaging/tools/makeclient_power.sh index 89591cac234b190f55d144ccf98cb2d5c70a7936..19e24b3dafb7f1f95832e637e181449e4c381faf 100755 --- a/packaging/tools/makeclient_power.sh +++ b/packaging/tools/makeclient_power.sh @@ -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 diff --git a/packaging/tools/makeclient_pro.sh b/packaging/tools/makeclient_pro.sh index 599c91fbf082955887c677b750aa12f946c0890b..4a0b033d30e6478f37a62f9cc896aee0903d39c9 100755 --- a/packaging/tools/makeclient_pro.sh +++ b/packaging/tools/makeclient_pro.sh @@ -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 diff --git a/packaging/tools/makeclient_tq.sh b/packaging/tools/makeclient_tq.sh index 03d9b13059daadfdc7207c78b6f89cae321f25ac..1cc7003661a7491b1df625916dd289de32434ee9 100755 --- a/packaging/tools/makeclient_tq.sh +++ b/packaging/tools/makeclient_tq.sh @@ -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 diff --git a/packaging/tools/makepkg.sh b/packaging/tools/makepkg.sh index e9266ec80da293571ece07dab9c724b5b8c12adf..39918325992ba140db6db656c6946ec40dd84435 100755 --- a/packaging/tools/makepkg.sh +++ b/packaging/tools/makepkg.sh @@ -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 diff --git a/packaging/tools/makepkg_power.sh b/packaging/tools/makepkg_power.sh index a2643b7486195041466d28d84d25a6b5aa05974e..e9839e4ef22126fb795501277f73768359f973c0 100755 --- a/packaging/tools/makepkg_power.sh +++ b/packaging/tools/makepkg_power.sh @@ -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 diff --git a/packaging/tools/makepkg_pro.sh b/packaging/tools/makepkg_pro.sh index e59cd65425ff2c9e9d37ac6fd2e548b2588dc76f..69076196b2eb9d539ce53f0e48e09b5fea317c2c 100755 --- a/packaging/tools/makepkg_pro.sh +++ b/packaging/tools/makepkg_pro.sh @@ -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 diff --git a/packaging/tools/makepkg_tq.sh b/packaging/tools/makepkg_tq.sh index 6f897de0ce5e7287e06719562199e8ed139b02ec..421e8d7858b764753de9d7519d25e73c7db80bea 100755 --- a/packaging/tools/makepkg_tq.sh +++ b/packaging/tools/makepkg_tq.sh @@ -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 diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 1851a482edc6b3dd0c6d55da66330a276f91aaf5..a9a6943497c5172fda33180d783ad2aad2cb5c74 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,6 +1,6 @@ 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 diff --git a/src/client/inc/tscUtil.h b/src/client/inc/tscUtil.h index b250eed5a12e88b1c4829ceee52520764d4e96b6..38550e6f08b1ab7f947b8c2c8904d35170b5548b 100644 --- a/src/client/inc/tscUtil.h +++ b/src/client/inc/tscUtil.h @@ -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); diff --git a/src/client/src/tscLocal.c b/src/client/src/tscLocal.c index 07db18b498873f4a023d8ea76aadd7e76a4cd8d2..461009fdb8540b2ef3e80cff27869bf28416ab97 100644 --- a/src/client/src/tscLocal.c +++ b/src/client/src/tscLocal.c @@ -358,9 +358,13 @@ static int32_t tscGetTableTagValue(SCreateBuilder *builder, char *result) { int num_fields = taos_num_fields(pSql); TAOS_FIELD *fields = taos_fetch_fields(pSql); - char buf[TSDB_COL_NAME_LEN + 16]; for (int i = 0; i < num_fields; i++) { - memset(buf, 0, sizeof(buf)); + char *buf = calloc(1, lengths[i] + 1); + if (buf == NULL) { + return TSDB_CODE_TSC_OUT_OF_MEMORY; + } + + memset(buf, 0, lengths[i] + 1); int32_t ret = tscGetNthFieldResult(row, fields, lengths, i, buf); if (i == 0) { @@ -373,10 +377,13 @@ static int32_t tscGetTableTagValue(SCreateBuilder *builder, char *result) { } else { snprintf(result + strlen(result), TSDB_MAX_BINARY_LEN - strlen(result), "%s,", buf); } + + free(buf); + if (i == num_fields - 1) { sprintf(result + strlen(result) - 1, "%s", ")"); } - } + } if (0 == strlen(result)) { return TSDB_CODE_TSC_INVALID_TABLE_NAME; diff --git a/src/client/src/tscPrepare.c b/src/client/src/tscPrepare.c index 6fb5b3c8d1116674937bb5930b3082ced5cd4485..8cc53aab3357d13d65d8e0ab6e3089240024b727 100644 --- a/src/client/src/tscPrepare.c +++ b/src/client/src/tscPrepare.c @@ -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); @@ -1337,9 +1345,40 @@ 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) { - tscError("keyword TAGS expected, sql:%s", pCmd->insertParam.sql); - return tscSQLSyntaxErrMsg(pCmd->payload, "keyword TAGS expected", sToken.z ? sToken.z : pCmd->insertParam.sql); + 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); @@ -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) { - len = (size_t)snprintf(str, size - 1, "insert into %s using %.*s tags(", name, pStmt->mtb.stbname.n, pStmt->mtb.stbname.z); + 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"; } } - diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 32c5246089cfcd8a40f19f86d833337c7db97624..d025ffa0c91883cf1383b835b8018fef08badde6 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -5610,7 +5610,7 @@ int32_t validateOrderbyNode(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SSqlNode* pSq bool udf = false; if (pQueryInfo->pUdfInfo && taosArrayGetSize(pQueryInfo->pUdfInfo) > 0) { - int32_t usize = taosArrayGetSize(pQueryInfo->pUdfInfo); + int32_t usize = (int32_t)taosArrayGetSize(pQueryInfo->pUdfInfo); for (int32_t i = 0; i < usize; ++i) { SUdfInfo* pUdfInfo = taosArrayGet(pQueryInfo->pUdfInfo, i); @@ -8406,7 +8406,7 @@ int32_t loadAllTableMeta(SSqlObj* pSql, struct SSqlInfo* pInfo) { for (int32_t j = 0; j < usize; ++j) { SUdfInfo* pUdfInfo = taosArrayGet(pQueryInfo->pUdfInfo, j); - int32_t len = strlen(pUdfInfo->name); + int32_t len = (int32_t)strlen(pUdfInfo->name); if (len == t->n && strncasecmp(info.name, pUdfInfo->name, t->n) == 0) { exist = 1; break; diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index d18f802237c569d79815d1340d544c92df97e655..8c6380687f33ef5f618b6a5910d6efe31eaa7f40 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -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); - *newgroup = false; - return pBlock; + if (pBlock->info.rows > 0) { + *newgroup = false; + return pBlock; + } } - // No data block exists. So retrieve and transfer it into to SSDataBlock - TAOS_ROW pRow = NULL; - taos_fetch_block(pSql, &pRow); + 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; - } + if (pRes->numOfRows == 0) { + pOperator->status = OP_EXEC_DONE; + result = NULL; + break; + } - pBlock->info.rows = pRes->numOfRows; - doSetupSDataBlock(pRes, pBlock, pInput->pFilterInfo, pInput->numOfFilterCols); - *newgroup = false; - return pBlock; + pBlock->info.rows = pRes->numOfRows; + doSetupSDataBlock(pRes, pBlock, pInput->pFilterInfo, pInput->numOfFilterCols); + *newgroup = false; + 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; } diff --git a/src/common/inc/tglobal.h b/src/common/inc/tglobal.h index 8a6cc9ddb5a4425e3d7bd10bb7dd5dda0712b0c3..9775a3898fb759873ffe48673062dd8402873041 100644 --- a/src/common/inc/tglobal.h +++ b/src/common/inc/tglobal.h @@ -45,7 +45,7 @@ extern int32_t tsDnodeId; // common extern int tsRpcTimer; extern int tsRpcMaxTime; -extern int tsRpcForceTcp; // all commands go to tcp protocol if this is enabled +extern int tsRpcForceTcp; // all commands go to tcp protocol if this is enabled extern int32_t tsMaxConnections; extern int32_t tsMaxShellConns; extern int32_t tsShellActivityTimer; @@ -56,18 +56,19 @@ extern float tsRatioOfQueryCores; extern int8_t tsDaylight; extern char tsTimezone[]; extern char tsLocale[]; -extern char tsCharset[]; // default encode string +extern char tsCharset[]; // default encode string extern int8_t tsEnableCoreFile; extern int32_t tsCompressMsgSize; extern int32_t tsMaxNumOfDistinctResults; extern char tsTempDir[]; -//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 +// 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 int8_t tsKeepOriginalColumnName; +extern int8_t tsKeepOriginalColumnName; // client extern int32_t tsMaxSQLStringLen; @@ -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; @@ -162,22 +164,22 @@ extern int64_t tsTickPerDay[3]; extern int32_t tsTopicBianryLen; // system info -extern char tsOsName[]; -extern int64_t tsPageSize; -extern int64_t tsOpenMax; -extern int64_t tsStreamMax; -extern int32_t tsNumOfCores; -extern float tsTotalLogDirGB; -extern float tsTotalTmpDirGB; -extern float tsTotalDataDirGB; -extern float tsAvailLogDirGB; -extern float tsAvailTmpDirectorySpace; -extern float tsAvailDataDirGB; -extern float tsUsedDataDirGB; -extern float tsMinimalLogDirGB; -extern float tsReservedTmpDirectorySpace; -extern float tsMinimalDataDirGB; -extern int32_t tsTotalMemoryMB; +extern char tsOsName[]; +extern int64_t tsPageSize; +extern int64_t tsOpenMax; +extern int64_t tsStreamMax; +extern int32_t tsNumOfCores; +extern float tsTotalLogDirGB; +extern float tsTotalTmpDirGB; +extern float tsTotalDataDirGB; +extern float tsAvailLogDirGB; +extern float tsAvailTmpDirectorySpace; +extern float tsAvailDataDirGB; +extern float tsUsedDataDirGB; +extern float tsMinimalLogDirGB; +extern float tsReservedTmpDirectorySpace; +extern float tsMinimalDataDirGB; +extern int32_t tsTotalMemoryMB; extern uint32_t tsVersion; // build info @@ -188,26 +190,26 @@ extern char gitinfoOfInternal[]; extern char buildinfo[]; // log -extern int8_t tsAsyncLog; -extern int32_t tsNumOfLogLines; -extern int32_t tsLogKeepDays; -extern int32_t dDebugFlag; -extern int32_t vDebugFlag; -extern int32_t mDebugFlag; +extern int8_t tsAsyncLog; +extern int32_t tsNumOfLogLines; +extern int32_t tsLogKeepDays; +extern int32_t dDebugFlag; +extern int32_t vDebugFlag; +extern int32_t mDebugFlag; extern uint32_t cDebugFlag; -extern int32_t jniDebugFlag; -extern int32_t tmrDebugFlag; -extern int32_t sdbDebugFlag; -extern int32_t httpDebugFlag; -extern int32_t mqttDebugFlag; -extern int32_t monDebugFlag; -extern int32_t uDebugFlag; -extern int32_t rpcDebugFlag; -extern int32_t odbcDebugFlag; +extern int32_t jniDebugFlag; +extern int32_t tmrDebugFlag; +extern int32_t sdbDebugFlag; +extern int32_t httpDebugFlag; +extern int32_t mqttDebugFlag; +extern int32_t monDebugFlag; +extern int32_t uDebugFlag; +extern int32_t rpcDebugFlag; +extern int32_t odbcDebugFlag; extern uint32_t qDebugFlag; -extern int32_t wDebugFlag; -extern int32_t cqDebugFlag; -extern int32_t debugFlag; +extern int32_t wDebugFlag; +extern int32_t cqDebugFlag; +extern int32_t debugFlag; extern int8_t tsClientMerge; @@ -218,7 +220,7 @@ extern double fPrecision; extern double dPrecision; extern uint32_t maxRange; extern uint32_t curRange; -extern char Compressor[]; +extern char Compressor[]; #endif diff --git a/src/common/src/tdataformat.c b/src/common/src/tdataformat.c index 2578f33246bc416e93ada6e442ae27741f3f4253..bce9474b6d4fb9f783947ba2e27382d8c1d46429 100644 --- a/src/common/src/tdataformat.c +++ b/src/common/src/tdataformat.c @@ -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; - dataColAppendVal(pDataCol, value, pCols->numOfRows, pCols->maxPoints, rowOffset); + 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; - dataColAppendVal(pDataCol, value, pCols->numOfRows, pCols->maxPoints, rowOffset); + 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; diff --git a/src/common/src/tglobal.c b/src/common/src/tglobal.c index f1a7e4f7fd12a85ed1b8b503db35fba7211fc788..ce942b60c6c91aa6f0e3773833359ada939c3d16 100644 --- a/src/common/src/tglobal.c +++ b/src/common/src/tglobal.c @@ -14,18 +14,18 @@ */ #define _DEFAULT_SOURCE +#include "tglobal.h" +#include "monitor.h" #include "os.h" #include "taosdef.h" #include "taoserror.h" -#include "tulog.h" +#include "tcompare.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; @@ -51,16 +51,16 @@ char tsEmail[TSDB_FQDN_LEN] = {0}; 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 tsMaxShellConns = 50000; +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 tsMaxShellConns = 50000; int32_t tsMaxConnections = 5000; -int32_t tsShellActivityTimer = 3; // second +int32_t tsShellActivityTimer = 3; // second float tsNumOfThreadsPerCore = 1.0f; int32_t tsNumOfCommitThreads = 4; float tsRatioOfQueryCores = 1.0f; -int8_t tsDaylight = 0; +int8_t tsDaylight = 0; char tsTimezone[TSDB_TIMEZONE_LEN] = {0}; char tsLocale[TSDB_LOCALE_LEN] = {0}; char tsCharset[TSDB_LOCALE_LEN] = {0}; // default encode string @@ -90,7 +90,7 @@ int32_t tsMaxNumOfOrderedResults = 1000000; int32_t tsMinSlidingTime = 10; // the maxinum number of distict query result -int32_t tsMaxNumOfDistinctResults = 1000 * 10000; +int32_t tsMaxNumOfDistinctResults = 1000 * 10000; // 1 us for interval time range, changed accordingly int32_t tsMinIntervalTime = 1; @@ -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.1f; @@ -121,26 +121,26 @@ int64_t tsQueryBufferSizeBytes = -1; int32_t tsRetrieveBlockingModel = 0; // last_row(*), first(*), last_row(ts, col1, col2) query, the result fields will be the original column name -int8_t tsKeepOriginalColumnName = 0; +int8_t tsKeepOriginalColumnName = 0; // db parameters int32_t tsCacheBlockSize = TSDB_DEFAULT_CACHE_BLOCK_SIZE; int32_t tsBlocksPerVnode = TSDB_DEFAULT_TOTAL_BLOCKS; -int16_t tsDaysPerFile = TSDB_DEFAULT_DAYS_PER_FILE; -int32_t tsDaysToKeep = TSDB_DEFAULT_KEEP; +int16_t tsDaysPerFile = TSDB_DEFAULT_DAYS_PER_FILE; +int32_t tsDaysToKeep = TSDB_DEFAULT_KEEP; int32_t tsMinRowsInFileBlock = TSDB_DEFAULT_MIN_ROW_FBLOCK; int32_t tsMaxRowsInFileBlock = TSDB_DEFAULT_MAX_ROW_FBLOCK; -int16_t tsCommitTime = TSDB_DEFAULT_COMMIT_TIME; // seconds +int16_t tsCommitTime = TSDB_DEFAULT_COMMIT_TIME; // seconds int32_t tsTimePrecision = TSDB_DEFAULT_PRECISION; -int8_t tsCompression = TSDB_DEFAULT_COMP_LEVEL; -int8_t tsWAL = TSDB_DEFAULT_WAL_LEVEL; -int32_t tsFsyncPeriod = TSDB_DEFAULT_FSYNC_PERIOD; -int32_t tsReplications = TSDB_DEFAULT_DB_REPLICA_OPTION; -int32_t tsQuorum = TSDB_DEFAULT_DB_QUORUM_OPTION; -int16_t tsPartitons = TSDB_DEFAULT_DB_PARTITON_OPTION; -int8_t tsUpdate = TSDB_DEFAULT_DB_UPDATE_OPTION; -int8_t tsCacheLastRow = TSDB_DEFAULT_CACHE_LAST_ROW; -int32_t tsMaxVgroupsPerDb = 0; +int8_t tsCompression = TSDB_DEFAULT_COMP_LEVEL; +int8_t tsWAL = TSDB_DEFAULT_WAL_LEVEL; +int32_t tsFsyncPeriod = TSDB_DEFAULT_FSYNC_PERIOD; +int32_t tsReplications = TSDB_DEFAULT_DB_REPLICA_OPTION; +int32_t tsQuorum = TSDB_DEFAULT_DB_QUORUM_OPTION; +int16_t tsPartitons = TSDB_DEFAULT_DB_PARTITON_OPTION; +int8_t tsUpdate = TSDB_DEFAULT_DB_UPDATE_OPTION; +int8_t tsCacheLastRow = TSDB_DEFAULT_CACHE_LAST_ROW; +int32_t tsMaxVgroupsPerDb = 0; int32_t tsMinTablePerVnode = TSDB_TABLES_STEP; int32_t tsMaxTablePerVnode = TSDB_DEFAULT_TABLES; int32_t tsTableIncStepPerVnode = TSDB_TABLES_STEP; @@ -148,7 +148,7 @@ int32_t tsTableIncStepPerVnode = TSDB_TABLES_STEP; // balance int8_t tsEnableBalance = 1; int8_t tsAlternativeRole = 0; -int32_t tsBalanceInterval = 300; // seconds +int32_t tsBalanceInterval = 300; // seconds int32_t tsOfflineThreshold = 86400 * 10; // seconds of 10 days int32_t tsMnodeEqualVnodeNum = 4; int8_t tsEnableFlowCtrl = 1; @@ -166,15 +166,16 @@ 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 -char tsMqttHostName[TSDB_MQTT_HOSTNAME_LEN] = "test.mosquitto.org"; -char tsMqttPort[TSDB_MQTT_PORT_LEN] = "1883"; -char tsMqttUser[TSDB_MQTT_USER_LEN] = {0}; -char tsMqttPass[TSDB_MQTT_PASS_LEN] = {0}; -char tsMqttClientId[TSDB_MQTT_CLIENT_ID_LEN] = "TDengineMqttSubscriber"; -char tsMqttTopic[TSDB_MQTT_TOPIC_LEN] = "/test"; // # +char tsMqttHostName[TSDB_MQTT_HOSTNAME_LEN] = "test.mosquitto.org"; +char tsMqttPort[TSDB_MQTT_PORT_LEN] = "1883"; +char tsMqttUser[TSDB_MQTT_USER_LEN] = {0}; +char tsMqttPass[TSDB_MQTT_PASS_LEN] = {0}; +char tsMqttClientId[TSDB_MQTT_CLIENT_ID_LEN] = "TDengineMqttSubscriber"; +char tsMqttTopic[TSDB_MQTT_TOPIC_LEN] = "/test"; // # // monitor int8_t tsEnableMonitorModule = 1; @@ -183,7 +184,7 @@ char tsInternalPass[] = "secretkey"; int32_t tsMonitorInterval = 30; // seconds // stream -int8_t tsEnableStream = 1; +int8_t tsEnableStream = 1; // internal int8_t tsCompactMnodeWal = 0; @@ -199,7 +200,7 @@ char tsDataDir[PATH_MAX] = {0}; char tsScriptDir[PATH_MAX] = {0}; char tsTempDir[PATH_MAX] = "/tmp/"; -int32_t tsDiskCfgNum = 0; +int32_t tsDiskCfgNum = 0; int32_t tsTopicBianryLen = 16000; #ifndef _STORAGE @@ -217,42 +218,42 @@ SDiskCfg tsDiskCfg[TSDB_MAX_DISKS]; int64_t tsTickPerDay[] = {86400000L, 86400000000L, 86400000000000L}; // system info -char tsOsName[10] = "Linux"; -int64_t tsPageSize; -int64_t tsOpenMax; -int64_t tsStreamMax; -int32_t tsNumOfCores = 1; -float tsTotalTmpDirGB = 0; -float tsTotalDataDirGB = 0; -float tsAvailTmpDirectorySpace = 0; -float tsAvailDataDirGB = 0; -float tsUsedDataDirGB = 0; -float tsReservedTmpDirectorySpace = 1.0f; -float tsMinimalDataDirGB = 2.0f; -int32_t tsTotalMemoryMB = 0; +char tsOsName[10] = "Linux"; +int64_t tsPageSize; +int64_t tsOpenMax; +int64_t tsStreamMax; +int32_t tsNumOfCores = 1; +float tsTotalTmpDirGB = 0; +float tsTotalDataDirGB = 0; +float tsAvailTmpDirectorySpace = 0; +float tsAvailDataDirGB = 0; +float tsUsedDataDirGB = 0; +float tsReservedTmpDirectorySpace = 1.0f; +float tsMinimalDataDirGB = 2.0f; +int32_t tsTotalMemoryMB = 0; uint32_t tsVersion = 0; // log -int32_t tsNumOfLogLines = 10000000; -int32_t mDebugFlag = 131; -int32_t sdbDebugFlag = 131; -int32_t dDebugFlag = 135; -int32_t vDebugFlag = 135; +int32_t tsNumOfLogLines = 10000000; +int32_t mDebugFlag = 131; +int32_t sdbDebugFlag = 131; +int32_t dDebugFlag = 135; +int32_t vDebugFlag = 135; uint32_t cDebugFlag = 131; -int32_t jniDebugFlag = 131; -int32_t odbcDebugFlag = 131; -int32_t httpDebugFlag = 131; -int32_t mqttDebugFlag = 131; -int32_t monDebugFlag = 131; +int32_t jniDebugFlag = 131; +int32_t odbcDebugFlag = 131; +int32_t httpDebugFlag = 131; +int32_t mqttDebugFlag = 131; +int32_t monDebugFlag = 131; uint32_t qDebugFlag = 131; -int32_t rpcDebugFlag = 131; -int32_t uDebugFlag = 131; -int32_t debugFlag = 0; -int32_t sDebugFlag = 135; -int32_t wDebugFlag = 135; -int32_t tsdbDebugFlag = 131; -int32_t cqDebugFlag = 131; -int32_t fsDebugFlag = 135; +int32_t rpcDebugFlag = 131; +int32_t uDebugFlag = 131; +int32_t debugFlag = 0; +int32_t sDebugFlag = 135; +int32_t wDebugFlag = 135; +int32_t tsdbDebugFlag = 131; +int32_t cqDebugFlag = 131; +int32_t fsDebugFlag = 135; int8_t tsClientMerge = 0; @@ -260,13 +261,14 @@ 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. -// below option can take effect when tsLossyColumns not empty -double fPrecision = 1E-8; // float column precision -double dPrecision = 1E-16; // double column precision -uint32_t maxRange = 500; // max range -uint32_t curRange = 100; // range -char Compressor[32] = "ZSTD_COMPRESSOR"; // ZSTD_COMPRESSOR or GZIP_COMPRESSOR +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 +uint32_t maxRange = 500; // max range +uint32_t curRange = 100; // range +char Compressor[32] = "ZSTD_COMPRESSOR"; // ZSTD_COMPRESSOR or GZIP_COMPRESSOR #endif int32_t (*monStartSystemFp)() = NULL; @@ -278,7 +280,7 @@ char *qtypeStr[] = {"rpc", "fwd", "wal", "cq", "query"}; static pthread_once_t tsInitGlobalCfgOnce = PTHREAD_ONCE_INIT; void taosSetAllDebugFlag() { - if (debugFlag != 0) { + if (debugFlag != 0) { mDebugFlag = debugFlag; sdbDebugFlag = debugFlag; dDebugFlag = debugFlag; @@ -289,7 +291,7 @@ void taosSetAllDebugFlag() { httpDebugFlag = debugFlag; mqttDebugFlag = debugFlag; monDebugFlag = debugFlag; - qDebugFlag = debugFlag; + qDebugFlag = debugFlag; rpcDebugFlag = debugFlag; uDebugFlag = debugFlag; sDebugFlag = debugFlag; @@ -301,12 +303,13 @@ void taosSetAllDebugFlag() { } bool taosCfgDynamicOptions(char *msg) { - char *option, *value; - int32_t olen, vlen; - int32_t vint = 0; + char *option, *value; + int32_t olen, vlen; + 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,9 +322,9 @@ 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); if (cfgLen != olen) continue; if (strncasecmp(option, cfg->option, olen) != 0) continue; @@ -350,7 +353,7 @@ bool taosCfgDynamicOptions(char *msg) { return true; } if (strncasecmp(cfg->option, "debugFlag", olen) == 0) { - taosSetAllDebugFlag(); + taosSetAllDebugFlag(); } return true; } @@ -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; } @@ -428,7 +431,7 @@ static void doInitGlobalConfig(void) { srand(taosSafeRand()); SGlobalCfg cfg = {0}; - + // ip address cfg.option = "firstEp"; cfg.ptr = tsFirst; @@ -557,12 +560,12 @@ 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); - + cfg.option = "numOfMnodes"; cfg.ptr = &tsNumOfMnodes; cfg.valType = TAOS_CFG_VTYPE_INT32; @@ -1149,7 +1152,7 @@ static void doInitGlobalConfig(void) { cfg.unitType = TAOS_CFG_UTYPE_NONE; taosInitConfigOption(cfg); - // module configs + // module configs cfg.option = "flowctrl"; cfg.ptr = &tsEnableFlowCtrl; cfg.valType = TAOS_CFG_VTYPE_INT8; @@ -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,21 +1661,18 @@ 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]; + char fqdn[TSDB_FQDN_LEN]; uint16_t port; if (debugFlag & DEBUG_TRACE || debugFlag & DEBUG_DEBUG || debugFlag & DEBUG_DUMP) { taosSetAllDebugFlag(); } - + if (tsLocalFqdn[0] == 0) { taosGetFqdn(tsLocalFqdn); } @@ -1689,7 +1699,7 @@ int32_t taosCheckGlobalCfg() { if (taosCheckTmpDir()) { return -1; } - + taosGetSystemInfo(); tsSetLocale(); @@ -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; } @@ -1734,7 +1744,7 @@ int32_t taosCheckGlobalCfg() { } tsDnodeShellPort = tsServerPort + TSDB_PORT_DNODESHELL; // udp[6035-6039] tcp[6035] - tsDnodeDnodePort = tsServerPort + TSDB_PORT_DNODEDNODE; // udp/tcp + tsDnodeDnodePort = tsServerPort + TSDB_PORT_DNODEDNODE; // udp/tcp tsSyncPort = tsServerPort + TSDB_PORT_SYNC; tsHttpPort = tsServerPort + TSDB_PORT_HTTP; @@ -1754,17 +1764,17 @@ int taosGetFqdnPortFromEp(const char *ep, char *fqdn, uint16_t *port) { strcpy(fqdn, ep); char *temp = strchr(fqdn, ':'); - if (temp) { + if (temp) { *temp = 0; - *port = atoi(temp+1); - } - + *port = atoi(temp + 1); + } + if (*port == 0) { *port = tsServerPort; return -1; } - return 0; + return 0; } /* diff --git a/src/connector/jdbc/pom.xml b/src/connector/jdbc/pom.xml index 6b9fc9d96ce16700ee1243ef7c148a423a965d0b..13b59928dfa9c769bac5b7a26b4bb8e8aa904d48 100644 --- a/src/connector/jdbc/pom.xml +++ b/src/connector/jdbc/pom.xml @@ -112,6 +112,7 @@ **/*Test.java + **/HttpClientPoolUtilTest.java **/AppMemoryLeakTest.java **/ConnectMultiTaosdByRestfulWithDifferentTokenTest.java **/DatetimeBefore1970Test.java diff --git a/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBErrorNumbers.java b/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBErrorNumbers.java index 2207db6f9379595e68b8ed00ea8f7298ca3b45ad..1c380fed7dac2c54655830eef6f575e9c07e22af 100644 --- a/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBErrorNumbers.java +++ b/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBErrorNumbers.java @@ -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); diff --git a/src/connector/jdbc/src/main/java/com/taosdata/jdbc/utils/HttpClientPoolUtil.java b/src/connector/jdbc/src/main/java/com/taosdata/jdbc/utils/HttpClientPoolUtil.java index de26ab7f1f458a4587ce15bebab3c2c1b0dbc070..99e46bc64f44f6326aec12734849cc5ef518c903 100644 --- a/src/connector/jdbc/src/main/java/com/taosdata/jdbc/utils/HttpClientPoolUtil.java +++ b/src/connector/jdbc/src/main/java/com/taosdata/jdbc/utils/HttpClientPoolUtil.java @@ -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)) { diff --git a/src/connector/jdbc/src/test/java/com/taosdata/jdbc/utils/HttpClientPoolUtilTest.java b/src/connector/jdbc/src/test/java/com/taosdata/jdbc/utils/HttpClientPoolUtilTest.java new file mode 100644 index 0000000000000000000000000000000000000000..cae33f18e7a04e443092d8e696bb32be9600a435 --- /dev/null +++ b/src/connector/jdbc/src/test/java/com/taosdata/jdbc/utils/HttpClientPoolUtilTest.java @@ -0,0 +1,76 @@ +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 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 diff --git a/src/inc/taosmsg.h b/src/inc/taosmsg.h index dd4374761a6c90aa97b822ba8e814781b8ef0c7c..3d375829178866cdf2dcfb9c79dddfbdae71f86e 100644 --- a/src/inc/taosmsg.h +++ b/src/inc/taosmsg.h @@ -400,7 +400,7 @@ typedef struct SColIndex { int16_t colId; // column id int16_t colIndex; // column index in colList if it is a normal column or index in tagColList if a tag uint16_t flag; // denote if it is a tag or a normal column - char name[TSDB_COL_NAME_LEN + TSDB_DB_NAME_LEN + 1]; + char name[TSDB_COL_NAME_LEN + TSDB_TABLE_NAME_LEN + 1]; } SColIndex; typedef struct SColumnFilterInfo { diff --git a/src/inc/ttokendef.h b/src/inc/ttokendef.h index 0a84d7f13b735e0589b4df5e17122ed2b0fe69b2..5f6ecdd466fb112b0415e4f2d9095d6169ca4eb8 100644 --- a/src/inc/ttokendef.h +++ b/src/inc/ttokendef.h @@ -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 diff --git a/src/kit/shell/src/shellImport.c b/src/kit/shell/src/shellImport.c index 38abb423cfd2c0329dad24244a798f0617b4cbb6..b3a07b257cbfdd639d6834e7981fb10e89e43512 100644 --- a/src/kit/shell/src/shellImport.c +++ b/src/kit/shell/src/shellImport.c @@ -25,7 +25,7 @@ static char **shellSQLFiles = NULL; static int32_t shellSQLFileNum = 0; -static char shellTablesSQLFile[TSDB_FILENAME_LEN] = {0}; +static char shellTablesSQLFile[4096] = {0}; typedef struct { pthread_t threadID; diff --git a/src/kit/taosdemo/taosdemo.c b/src/kit/taosdemo/taosdemo.c index d75dbbf82f0ef56f28c0fd639fbdef7e26f0e1aa..92b848b7edbbbdb759c653ca8a4aebe326991795 100644 --- a/src/kit/taosdemo/taosdemo.c +++ b/src/kit/taosdemo/taosdemo.c @@ -75,6 +75,7 @@ extern char configDir[]; #define MAX_DATA_SIZE (16*TSDB_MAX_COLUMNS)+20 // max record len: 16*MAX_COLUMNS, timestamp string and ,('') need extra space #define OPT_ABORT 1 /* –abort */ #define MAX_FILE_NAME_LEN 256 // max file name length on linux is 255. +#define MAX_PATH_LEN 4096 #define DEFAULT_START_TIME 1500000000000 @@ -244,6 +245,7 @@ typedef struct SArguments_S { uint64_t insert_interval; uint64_t timestamp_step; int64_t query_times; + int64_t prepared_rand; uint32_t interlaceRows; uint32_t reqPerReq; // num_of_records_per_req uint64_t max_sql_len; @@ -303,6 +305,7 @@ typedef struct SSuperTable_S { uint64_t lenOfTagOfOneRow; char* sampleDataBuf; + bool useSampleTs; uint32_t tagSource; // 0: rand, 1: tag sample char* tagDataBuf; @@ -363,7 +366,7 @@ typedef struct SDataBase_S { bool drop; // 0: use exists, 1: if exists, drop then new create SDbCfg dbCfg; uint64_t superTblCount; - SSuperTable superTbls[MAX_SUPER_TABLE_COUNT]; + SSuperTable* superTbls; } SDataBase; typedef struct SDbs_S { @@ -382,12 +385,11 @@ typedef struct SDbs_S { uint32_t threadCount; uint32_t threadCountForCreateTbl; uint32_t dbCount; - SDataBase db[MAX_DB_COUNT]; - // statistics uint64_t totalInsertRows; uint64_t totalAffectedRows; + SDataBase* db; } SDbs; typedef struct SpecifiedQueryInfo_S { @@ -501,6 +503,7 @@ typedef struct SThreadInfo_S { uint64_t querySeq; // sequence number of sql command TAOS_SUB* tsub; + int sockfd; } threadInfo; #ifdef WINDOWS @@ -580,8 +583,7 @@ static void prompt(); static int createDatabasesAndStables(); static void createChildTables(); static int queryDbExec(TAOS *taos, char *command, QUERY_TYPE type, bool quiet); -static int postProceSql(char *host, struct sockaddr_in *pServAddr, - uint16_t port, char* sqlstr, threadInfo *pThreadInfo); +static int postProceSql(char *host, uint16_t port, char* sqlstr, threadInfo *pThreadInfo); static int64_t getTSRandTail(int64_t timeStampStep, int32_t seq, int disorderRatio, int disorderRange); static bool getInfoFromJsonFile(char* file); @@ -590,12 +592,12 @@ static int regexMatch(const char *s, const char *reg, int cflags); /* ************ Global variables ************ */ -int32_t g_randint[MAX_PREPARED_RAND]; -uint32_t g_randuint[MAX_PREPARED_RAND]; -int64_t g_randbigint[MAX_PREPARED_RAND]; -uint64_t g_randubigint[MAX_PREPARED_RAND]; -float g_randfloat[MAX_PREPARED_RAND]; -double g_randdouble[MAX_PREPARED_RAND]; +int32_t* g_randint; +uint32_t* g_randuint; +int64_t* g_randbigint; +uint64_t* g_randubigint; +float* g_randfloat; +double* g_randdouble; char *g_randbool_buff = NULL; char *g_randint_buff = NULL; @@ -662,6 +664,7 @@ SArguments g_args = { 0, // insert_interval DEFAULT_TIMESTAMP_STEP, // timestamp_step 1, // query_times + 10000, // prepared_rand DEFAULT_INTERLACE_ROWS, // interlaceRows; 30000, // reqPerReq (1024*1024), // max_sql_len @@ -796,6 +799,8 @@ static void printHelp() { "Set the replica parameters of the database, By default use 1, min: 1, max: 3."); printf("%s%s%s%s\n", indent, "-m, --table-prefix=TABLEPREFIX", "\t", "Table prefix name. By default use 'd'."); + printf("%s%s%s%s\n", indent, "-E, --escape-character", "\t", + "Use escape character for Both Stable and normmal table name"); printf("%s%s%s%s\n", indent, "-s, --sql-file=FILE", "\t\t", "The select sql file."); printf("%s%s%s%s\n", indent, "-N, --normal-table", "\t\t", "Use normal table flag."); @@ -1298,7 +1303,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) { errorPrintReqArg2(argv[0], "S"); exit(EXIT_FAILURE); } - arguments->async_mode = atoi(argv[++i]); + arguments->timestamp_step = atoi(argv[++i]); } else if (0 == strncmp(argv[i], "--time-step=", strlen("--time-step="))) { if (isStringNumber((char *)(argv[i] + strlen("--time-step=")))) { arguments->async_mode = atoi((char *)(argv[i]+strlen("--time-step="))); @@ -1308,7 +1313,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) { } } else if (0 == strncmp(argv[i], "-S", strlen("-S"))) { if (isStringNumber((char *)(argv[i] + strlen("-S")))) { - arguments->async_mode = atoi((char *)(argv[i]+strlen("-S"))); + arguments->timestamp_step = atoi((char *)(argv[i]+strlen("-S"))); } else { errorPrintReqArg2(argv[0], "-S"); exit(EXIT_FAILURE); @@ -1321,7 +1326,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) { errorPrintReqArg2(argv[0], "--time-step"); exit(EXIT_FAILURE); } - arguments->async_mode = atoi(argv[++i]); + arguments->timestamp_step = atoi(argv[++i]); } else { errorUnrecognized(argv[0], argv[i]); exit(EXIT_FAILURE); @@ -1687,10 +1692,10 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) { arguments->data_type[index] = TSDB_DATA_TYPE_DOUBLE; } else if (0 == strcasecmp(token, "TINYINT")) { arguments->data_type[index] = TSDB_DATA_TYPE_TINYINT; - } else if (1 == regexMatch(token, "^BINARY(\\([1-9][0-9]*\\))?$", REG_ICASE | + } else if (1 == regexMatch(token, "^BINARY(\\([1-9][0-9]*\\))?$", REG_ICASE | REG_EXTENDED)) { arguments->data_type[index] = TSDB_DATA_TYPE_BINARY; - } else if (1 == regexMatch(token, "^NCHAR(\\([1-9][0-9]*\\))?$", REG_ICASE | + } else if (1 == regexMatch(token, "^NCHAR(\\([1-9][0-9]*\\))?$", REG_ICASE | REG_EXTENDED)) { arguments->data_type[index] = TSDB_DATA_TYPE_NCHAR; } else if (0 == strcasecmp(token, "BOOL")) { @@ -2097,7 +2102,7 @@ static void tmfclose(FILE *fp) { } } -static void tmfree(char *buf) { +static void tmfree(void *buf) { if (NULL != buf) { free(buf); buf = NULL; @@ -2205,7 +2210,7 @@ static void selectAndGetResult( } else if (0 == strncasecmp(g_queryInfo.queryMode, "rest", strlen("rest"))) { int retCode = postProceSql( - g_queryInfo.host, &(g_queryInfo.serv_addr), g_queryInfo.port, + g_queryInfo.host, g_queryInfo.port, command, pThreadInfo); if (0 != retCode) { @@ -2221,157 +2226,157 @@ static void selectAndGetResult( static char *rand_bool_str() { static int cursor; cursor++; - if (cursor > (MAX_PREPARED_RAND - 1)) cursor = 0; - return g_randbool_buff + ((cursor % MAX_PREPARED_RAND) * BOOL_BUFF_LEN); + if (cursor > (g_args.prepared_rand - 1)) cursor = 0; + return g_randbool_buff + ((cursor % g_args.prepared_rand) * BOOL_BUFF_LEN); } static int32_t rand_bool() { static int cursor; cursor++; - if (cursor > (MAX_PREPARED_RAND - 1)) cursor = 0; - return g_randint[cursor % MAX_PREPARED_RAND] % 2; + if (cursor > (g_args.prepared_rand - 1)) cursor = 0; + return g_randint[cursor % g_args.prepared_rand] % 2; } static char *rand_tinyint_str() { static int cursor; cursor++; - if (cursor > (MAX_PREPARED_RAND - 1)) cursor = 0; + if (cursor > (g_args.prepared_rand - 1)) cursor = 0; return g_randtinyint_buff + - ((cursor % MAX_PREPARED_RAND) * TINYINT_BUFF_LEN); + ((cursor % g_args.prepared_rand) * TINYINT_BUFF_LEN); } static int32_t rand_tinyint() { static int cursor; cursor++; - if (cursor > (MAX_PREPARED_RAND - 1)) cursor = 0; - return g_randint[cursor % MAX_PREPARED_RAND] % 128; + if (cursor > (g_args.prepared_rand - 1)) cursor = 0; + return g_randint[cursor % g_args.prepared_rand] % 128; } static char *rand_utinyint_str() { static int cursor; cursor++; - if (cursor > (MAX_PREPARED_RAND - 1)) cursor = 0; + if (cursor > (g_args.prepared_rand - 1)) cursor = 0; return g_randutinyint_buff + - ((cursor % MAX_PREPARED_RAND) * TINYINT_BUFF_LEN); + ((cursor % g_args.prepared_rand) * TINYINT_BUFF_LEN); } static int32_t rand_utinyint() { static int cursor; cursor++; - if (cursor > (MAX_PREPARED_RAND - 1)) cursor = 0; - return g_randuint[cursor % MAX_PREPARED_RAND] % 255; + if (cursor > (g_args.prepared_rand - 1)) cursor = 0; + return g_randuint[cursor % g_args.prepared_rand] % 255; } static char *rand_smallint_str() { static int cursor; cursor++; - if (cursor > (MAX_PREPARED_RAND - 1)) cursor = 0; + if (cursor > (g_args.prepared_rand - 1)) cursor = 0; return g_randsmallint_buff + - ((cursor % MAX_PREPARED_RAND) * SMALLINT_BUFF_LEN); + ((cursor % g_args.prepared_rand) * SMALLINT_BUFF_LEN); } static int32_t rand_smallint() { static int cursor; cursor++; - if (cursor > (MAX_PREPARED_RAND - 1)) cursor = 0; - return g_randint[cursor % MAX_PREPARED_RAND] % 32768; + if (cursor > (g_args.prepared_rand - 1)) cursor = 0; + return g_randint[cursor % g_args.prepared_rand] % 32768; } static char *rand_usmallint_str() { static int cursor; cursor++; - if (cursor > (MAX_PREPARED_RAND - 1)) cursor = 0; + if (cursor > (g_args.prepared_rand - 1)) cursor = 0; return g_randusmallint_buff + - ((cursor % MAX_PREPARED_RAND) * SMALLINT_BUFF_LEN); + ((cursor % g_args.prepared_rand) * SMALLINT_BUFF_LEN); } static int32_t rand_usmallint() { static int cursor; cursor++; - if (cursor > (MAX_PREPARED_RAND - 1)) cursor = 0; - return g_randuint[cursor % MAX_PREPARED_RAND] % 65535; + if (cursor > (g_args.prepared_rand - 1)) cursor = 0; + return g_randuint[cursor % g_args.prepared_rand] % 65535; } static char *rand_int_str() { static int cursor; cursor++; - if (cursor > (MAX_PREPARED_RAND - 1)) cursor = 0; - return g_randint_buff + ((cursor % MAX_PREPARED_RAND) * INT_BUFF_LEN); + if (cursor > (g_args.prepared_rand - 1)) cursor = 0; + return g_randint_buff + ((cursor % g_args.prepared_rand) * INT_BUFF_LEN); } static int32_t rand_int() { static int cursor; cursor++; - if (cursor > (MAX_PREPARED_RAND - 1)) cursor = 0; - return g_randint[cursor % MAX_PREPARED_RAND]; + if (cursor > (g_args.prepared_rand - 1)) cursor = 0; + return g_randint[cursor % g_args.prepared_rand]; } static char *rand_uint_str() { static int cursor; cursor++; - if (cursor > (MAX_PREPARED_RAND - 1)) cursor = 0; - return g_randuint_buff + ((cursor % MAX_PREPARED_RAND) * INT_BUFF_LEN); + if (cursor > (g_args.prepared_rand - 1)) cursor = 0; + return g_randuint_buff + ((cursor % g_args.prepared_rand) * INT_BUFF_LEN); } static int32_t rand_uint() { static int cursor; cursor++; - if (cursor > (MAX_PREPARED_RAND - 1)) cursor = 0; - return g_randuint[cursor % MAX_PREPARED_RAND]; + if (cursor > (g_args.prepared_rand - 1)) cursor = 0; + return g_randuint[cursor % g_args.prepared_rand]; } static char *rand_bigint_str() { static int cursor; cursor++; - if (cursor > (MAX_PREPARED_RAND - 1)) cursor = 0; + if (cursor > (g_args.prepared_rand - 1)) cursor = 0; return g_randbigint_buff + - ((cursor % MAX_PREPARED_RAND) * BIGINT_BUFF_LEN); + ((cursor % g_args.prepared_rand) * BIGINT_BUFF_LEN); } static int64_t rand_bigint() { static int cursor; cursor++; - if (cursor > (MAX_PREPARED_RAND - 1)) cursor = 0; - return g_randbigint[cursor % MAX_PREPARED_RAND]; + if (cursor > (g_args.prepared_rand - 1)) cursor = 0; + return g_randbigint[cursor % g_args.prepared_rand]; } static char *rand_ubigint_str() { static int cursor; cursor++; - if (cursor > (MAX_PREPARED_RAND - 1)) cursor = 0; + if (cursor > (g_args.prepared_rand - 1)) cursor = 0; return g_randubigint_buff + - ((cursor % MAX_PREPARED_RAND) * BIGINT_BUFF_LEN); + ((cursor % g_args.prepared_rand) * BIGINT_BUFF_LEN); } static int64_t rand_ubigint() { static int cursor; cursor++; - if (cursor > (MAX_PREPARED_RAND - 1)) cursor = 0; - return g_randubigint[cursor % MAX_PREPARED_RAND]; + if (cursor > (g_args.prepared_rand - 1)) cursor = 0; + return g_randubigint[cursor % g_args.prepared_rand]; } static char *rand_float_str() { static int cursor; cursor++; - if (cursor > (MAX_PREPARED_RAND - 1)) cursor = 0; - return g_randfloat_buff + ((cursor % MAX_PREPARED_RAND) * FLOAT_BUFF_LEN); + if (cursor > (g_args.prepared_rand - 1)) cursor = 0; + return g_randfloat_buff + ((cursor % g_args.prepared_rand) * FLOAT_BUFF_LEN); } @@ -2379,58 +2384,58 @@ static float rand_float() { static int cursor; cursor++; - if (cursor > (MAX_PREPARED_RAND - 1)) cursor = 0; - return g_randfloat[cursor % MAX_PREPARED_RAND]; + if (cursor > (g_args.prepared_rand - 1)) cursor = 0; + return g_randfloat[cursor % g_args.prepared_rand]; } static char *demo_current_float_str() { static int cursor; cursor++; - if (cursor > (MAX_PREPARED_RAND - 1)) cursor = 0; + if (cursor > (g_args.prepared_rand - 1)) cursor = 0; return g_rand_current_buff + - ((cursor % MAX_PREPARED_RAND) * FLOAT_BUFF_LEN); + ((cursor % g_args.prepared_rand) * FLOAT_BUFF_LEN); } static float UNUSED_FUNC demo_current_float() { static int cursor; cursor++; - if (cursor > (MAX_PREPARED_RAND - 1)) cursor = 0; - return (float)(9.8 + 0.04 * (g_randint[cursor % MAX_PREPARED_RAND] % 10) - + g_randfloat[cursor % MAX_PREPARED_RAND]/1000000000); + if (cursor > (g_args.prepared_rand - 1)) cursor = 0; + return (float)(9.8 + 0.04 * (g_randint[cursor % g_args.prepared_rand] % 10) + + g_randfloat[cursor % g_args.prepared_rand]/1000000000); } static char *demo_voltage_int_str() { static int cursor; cursor++; - if (cursor > (MAX_PREPARED_RAND - 1)) cursor = 0; + if (cursor > (g_args.prepared_rand - 1)) cursor = 0; return g_rand_voltage_buff + - ((cursor % MAX_PREPARED_RAND) * INT_BUFF_LEN); + ((cursor % g_args.prepared_rand) * INT_BUFF_LEN); } static int32_t UNUSED_FUNC demo_voltage_int() { static int cursor; cursor++; - if (cursor > (MAX_PREPARED_RAND - 1)) cursor = 0; - return 215 + g_randint[cursor % MAX_PREPARED_RAND] % 10; + if (cursor > (g_args.prepared_rand - 1)) cursor = 0; + return 215 + g_randint[cursor % g_args.prepared_rand] % 10; } static char *demo_phase_float_str() { static int cursor; cursor++; - if (cursor > (MAX_PREPARED_RAND - 1)) cursor = 0; - return g_rand_phase_buff + ((cursor % MAX_PREPARED_RAND) * FLOAT_BUFF_LEN); + if (cursor > (g_args.prepared_rand - 1)) cursor = 0; + return g_rand_phase_buff + ((cursor % g_args.prepared_rand) * FLOAT_BUFF_LEN); } static float UNUSED_FUNC demo_phase_float() { static int cursor; cursor++; - if (cursor > (MAX_PREPARED_RAND - 1)) cursor = 0; - return (float)((115 + g_randint[cursor % MAX_PREPARED_RAND] % 10 - + g_randfloat[cursor % MAX_PREPARED_RAND]/1000000000)/360); + if (cursor > (g_args.prepared_rand - 1)) cursor = 0; + return (float)((115 + g_randint[cursor % g_args.prepared_rand] % 10 + + g_randfloat[cursor % g_args.prepared_rand]/1000000000)/360); } #if 0 @@ -2469,7 +2474,7 @@ static char *rand_double_str() { static int cursor; cursor++; - if (cursor > (MAX_PREPARED_RAND - 1)) cursor = 0; + if (cursor > (g_args.prepared_rand - 1)) cursor = 0; return g_randdouble_buff + (cursor * DOUBLE_BUFF_LEN); } @@ -2477,42 +2482,54 @@ static double rand_double() { static int cursor; cursor++; - cursor = cursor % MAX_PREPARED_RAND; + cursor = cursor % g_args.prepared_rand; return g_randdouble[cursor]; } static void init_rand_data() { - g_randint_buff = calloc(1, INT_BUFF_LEN * MAX_PREPARED_RAND); + g_randint_buff = calloc(1, INT_BUFF_LEN * g_args.prepared_rand); assert(g_randint_buff); - g_rand_voltage_buff = calloc(1, INT_BUFF_LEN * MAX_PREPARED_RAND); + g_rand_voltage_buff = calloc(1, INT_BUFF_LEN * g_args.prepared_rand); assert(g_rand_voltage_buff); - g_randbigint_buff = calloc(1, BIGINT_BUFF_LEN * MAX_PREPARED_RAND); + g_randbigint_buff = calloc(1, BIGINT_BUFF_LEN * g_args.prepared_rand); assert(g_randbigint_buff); - g_randsmallint_buff = calloc(1, SMALLINT_BUFF_LEN * MAX_PREPARED_RAND); + g_randsmallint_buff = calloc(1, SMALLINT_BUFF_LEN * g_args.prepared_rand); assert(g_randsmallint_buff); - g_randtinyint_buff = calloc(1, TINYINT_BUFF_LEN * MAX_PREPARED_RAND); + g_randtinyint_buff = calloc(1, TINYINT_BUFF_LEN * g_args.prepared_rand); assert(g_randtinyint_buff); - g_randbool_buff = calloc(1, BOOL_BUFF_LEN * MAX_PREPARED_RAND); + g_randbool_buff = calloc(1, BOOL_BUFF_LEN * g_args.prepared_rand); assert(g_randbool_buff); - g_randfloat_buff = calloc(1, FLOAT_BUFF_LEN * MAX_PREPARED_RAND); + g_randfloat_buff = calloc(1, FLOAT_BUFF_LEN * g_args.prepared_rand); assert(g_randfloat_buff); - g_rand_current_buff = calloc(1, FLOAT_BUFF_LEN * MAX_PREPARED_RAND); + g_rand_current_buff = calloc(1, FLOAT_BUFF_LEN * g_args.prepared_rand); assert(g_rand_current_buff); - g_rand_phase_buff = calloc(1, FLOAT_BUFF_LEN * MAX_PREPARED_RAND); + g_rand_phase_buff = calloc(1, FLOAT_BUFF_LEN * g_args.prepared_rand); assert(g_rand_phase_buff); - g_randdouble_buff = calloc(1, DOUBLE_BUFF_LEN * MAX_PREPARED_RAND); + g_randdouble_buff = calloc(1, DOUBLE_BUFF_LEN * g_args.prepared_rand); assert(g_randdouble_buff); - g_randuint_buff = calloc(1, INT_BUFF_LEN * MAX_PREPARED_RAND); + g_randuint_buff = calloc(1, INT_BUFF_LEN * g_args.prepared_rand); assert(g_randuint_buff); - g_randutinyint_buff = calloc(1, TINYINT_BUFF_LEN * MAX_PREPARED_RAND); + g_randutinyint_buff = calloc(1, TINYINT_BUFF_LEN * g_args.prepared_rand); assert(g_randutinyint_buff); - g_randusmallint_buff = calloc(1, SMALLINT_BUFF_LEN * MAX_PREPARED_RAND); + g_randusmallint_buff = calloc(1, SMALLINT_BUFF_LEN * g_args.prepared_rand); assert(g_randusmallint_buff); - g_randubigint_buff = calloc(1, BIGINT_BUFF_LEN * MAX_PREPARED_RAND); + g_randubigint_buff = calloc(1, BIGINT_BUFF_LEN * g_args.prepared_rand); assert(g_randubigint_buff); - - for (int i = 0; i < MAX_PREPARED_RAND; i++) { + g_randint = calloc(1, sizeof(int32_t) * g_args.prepared_rand); + assert(g_randint); + g_randuint = calloc(1, sizeof(uint32_t) * g_args.prepared_rand); + assert(g_randuint); + g_randbigint = calloc(1, sizeof(int64_t) * g_args.prepared_rand); + assert(g_randbigint); + g_randubigint = calloc(1, sizeof(uint64_t) * g_args.prepared_rand); + assert(g_randubigint); + g_randfloat = calloc(1, sizeof(float) * g_args.prepared_rand); + assert(g_randfloat); + g_randdouble = calloc(1, sizeof(double) * g_args.prepared_rand); + assert(g_randdouble); + + for (int i = 0; i < g_args.prepared_rand; i++) { g_randint[i] = (int)(taosRandom() % RAND_MAX - (RAND_MAX >> 1)); g_randuint[i] = (int)(taosRandom()); sprintf(g_randint_buff + i * INT_BUFF_LEN, "%d", @@ -2755,6 +2772,8 @@ static int printfInsertMeta() { g_Dbs.db[i].superTbls[j].sampleFormat); printf(" sampleFile: \033[33m%s\033[0m\n", g_Dbs.db[i].superTbls[j].sampleFile); + printf(" useSampleTs: \033[33m%s\033[0m\n", + g_Dbs.db[i].superTbls[j].useSampleTs ? "yes (warning: disorderRange/disorderRatio is disabled)" : "no"); printf(" tagsFile: \033[33m%s\033[0m\n", g_Dbs.db[i].superTbls[j].tagsFile); printf(" columnCount: \033[33m%d\033[0m\n ", @@ -2799,8 +2818,6 @@ static int printfInsertMeta() { printf(" insertRows: \033[33m%"PRId64"\033[0m\n", g_args.insertRows); } - - printf("\n"); } @@ -3384,7 +3401,7 @@ static void printfQuerySystemInfo(TAOS * taos) { free(dbInfos); } -static int postProceSql(char *host, struct sockaddr_in *pServAddr, uint16_t port, +static int postProceSql(char *host, uint16_t port, char* sqlstr, threadInfo *pThreadInfo) { char *req_fmt = "POST %s HTTP/1.1\r\nHost: %s:%d\r\nAccept: */*\r\nAuthorization: Basic %s\r\nContent-Length: %d\r\nContent-Type: application/x-www-form-urlencoded\r\n\r\n%s"; @@ -3416,35 +3433,18 @@ static int postProceSql(char *host, struct sockaddr_in *pServAddr, uint16_t port 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'}; - snprintf(userpass_buf, INPUT_BUF_LEN, "%s:%s", + if (g_args.test_mode == INSERT_TEST) { + snprintf(userpass_buf, INPUT_BUF_LEN, "%s:%s", g_Dbs.user, g_Dbs.password); + } else { + snprintf(userpass_buf, INPUT_BUF_LEN, "%s:%s", + g_queryInfo.user, g_queryInfo.password); + } + size_t userpass_buf_len = strlen(userpass_buf); size_t encoded_len = 4 * ((userpass_buf_len +2) / 3); char base64_buf[INPUT_BUF_LEN]; -#ifdef WINDOWS - WSADATA wsaData; - WSAStartup(MAKEWORD(2, 2), &wsaData); - SOCKET sockfd; -#else - int sockfd; -#endif - sockfd = socket(AF_INET, SOCK_STREAM, 0); - if (sockfd < 0) { -#ifdef WINDOWS - errorPrint( "Could not create socket : %d" , WSAGetLastError()); -#endif - debugPrint("%s() LN%d, sockfd=%d\n", __func__, __LINE__, sockfd); - free(request_buf); - ERROR_EXIT("opening socket"); - } - - int retConn = connect(sockfd, (struct sockaddr *)pServAddr, sizeof(struct sockaddr)); - debugPrint("%s() LN%d connect() return %d\n", __func__, __LINE__, retConn); - if (retConn < 0) { - free(request_buf); - ERROR_EXIT("connecting"); - } memset(base64_buf, 0, INPUT_BUF_LEN); @@ -3484,9 +3484,9 @@ static int postProceSql(char *host, struct sockaddr_in *pServAddr, uint16_t port sent = 0; do { #ifdef WINDOWS - bytes = send(sockfd, request_buf + sent, req_str_len - sent, 0); + bytes = send(pThreadInfo->sockfd, request_buf + sent, req_str_len - sent, 0); #else - bytes = write(sockfd, request_buf + sent, req_str_len - sent); + bytes = write(pThreadInfo->sockfd, request_buf + sent, req_str_len - sent); #endif if (bytes < 0) ERROR_EXIT("writing message to socket"); @@ -3501,15 +3501,13 @@ static int postProceSql(char *host, struct sockaddr_in *pServAddr, uint16_t port char resEncodingChunk[] = "Encoding: chunked"; char resHttp[] = "HTTP/1.1 "; - int resHttpLen = strlen(resHttp); char resHttpOk[] = "HTTP/1.1 200 OK"; - int resHttpOkLen = strlen(resHttpOk); do { #ifdef WINDOWS - bytes = recv(sockfd, response_buf + received, resp_len - received, 0); + bytes = recv(pThreadInfo->sockfd, response_buf + received, resp_len - received, 0); #else - bytes = read(sockfd, response_buf + received, resp_len - received); + bytes = read(pThreadInfo->sockfd, response_buf + received, resp_len - received); #endif verbosePrint("%s() LN%d: bytes:%d\n", __func__, __LINE__, bytes); if (bytes < 0) { @@ -3520,15 +3518,14 @@ static int postProceSql(char *host, struct sockaddr_in *pServAddr, uint16_t port break; received += bytes; - response_buf[RESP_BUF_LEN - 1] = '\0'; + verbosePrint("%s() LN%d: received:%d resp_len:%d, response_buf:\n%s\n", + __func__, __LINE__, received, resp_len, response_buf); + response_buf[RESP_BUF_LEN - 1] = '\0'; if (strlen(response_buf)) { - verbosePrint("%s() LN%d: received:%d resp_len:%d, response_buf:\n%s\n", - __func__, __LINE__, received, resp_len, response_buf); - if (((NULL == strstr(response_buf, resEncodingChunk)) - && (0 == strncmp(response_buf, resHttp, resHttpLen))) - || ((0 == strncmp(response_buf, resHttpOk, resHttpOkLen)) + && (NULL != strstr(response_buf, resHttp))) + || ((NULL != strstr(response_buf, resHttpOk)) && (NULL != strstr(response_buf, "\"status\":")))) { debugPrint( "%s() LN%d: received:%d resp_len:%d, response_buf:\n%s\n", @@ -3548,14 +3545,9 @@ static int postProceSql(char *host, struct sockaddr_in *pServAddr, uint16_t port } free(request_buf); -#ifdef WINDOWS - closesocket(sockfd); - WSACleanup(); -#else - close(sockfd); -#endif - if (NULL == strstr(response_buf, "\"status\":\"succ\"")) { + response_buf[RESP_BUF_LEN - 1] = '\0'; + if (NULL == strstr(response_buf, resHttpOk)) { errorPrint("%s() LN%d, Response:\n%s\n", __func__, __LINE__, response_buf); return -1; @@ -3817,8 +3809,7 @@ static int getChildNameOfSuperTableWithLimitAndOffset(TAOS * taos, limit, offset); //get all child table name use cmd: select tbname from superTblName; - snprintf(command, 1024, "select tbname from %s.%s %s", - dbName, stbName, limitBuf); + snprintf(command, 1024, "select tbname from %s.%s %s", dbName, stbName, limitBuf); res = taos_query(taos, command); int32_t code = taos_errno(res); @@ -3999,21 +3990,21 @@ static int getSuperTableFromServer(TAOS * taos, char* dbName, (char *)row[TSDB_DESCRIBE_METRIC_FIELD_INDEX], fields[TSDB_DESCRIBE_METRIC_FIELD_INDEX].bytes); - + if (0 == strncasecmp((char *)row[TSDB_DESCRIBE_METRIC_TYPE_INDEX], - "INT", strlen("INT")) && + "INT", strlen("INT")) && strstr((char *)row[TSDB_DESCRIBE_METRIC_TYPE_INDEX], "UNSIGNED") == NULL) { superTbls->columns[columnIndex].data_type = TSDB_DATA_TYPE_INT; } else if (0 == strncasecmp((char *)row[TSDB_DESCRIBE_METRIC_TYPE_INDEX], - "TINYINT", strlen("TINYINT")) && + "TINYINT", strlen("TINYINT")) && strstr((char *)row[TSDB_DESCRIBE_METRIC_TYPE_INDEX], "UNSIGNED") == NULL) { superTbls->columns[columnIndex].data_type = TSDB_DATA_TYPE_TINYINT; } else if (0 == strncasecmp((char *)row[TSDB_DESCRIBE_METRIC_TYPE_INDEX], - "SMALLINT", strlen("SMALLINT")) && + "SMALLINT", strlen("SMALLINT")) && strstr((char *)row[TSDB_DESCRIBE_METRIC_TYPE_INDEX], "UNSIGNED") == NULL) { superTbls->columns[columnIndex].data_type = TSDB_DATA_TYPE_SMALLINT; } else if (0 == strncasecmp((char *)row[TSDB_DESCRIBE_METRIC_TYPE_INDEX], - "BIGINT", strlen("BIGINT")) && + "BIGINT", strlen("BIGINT")) && strstr((char *)row[TSDB_DESCRIBE_METRIC_TYPE_INDEX], "UNSIGNED") == NULL) { superTbls->columns[columnIndex].data_type = TSDB_DATA_TYPE_BIGINT; } else if (0 == strncasecmp((char *)row[TSDB_DESCRIBE_METRIC_TYPE_INDEX], @@ -4067,7 +4058,7 @@ static int getSuperTableFromServer(TAOS * taos, char* dbName, (char *)row[TSDB_DESCRIBE_METRIC_NOTE_INDEX], min(NOTE_BUFF_LEN, fields[TSDB_DESCRIBE_METRIC_NOTE_INDEX].bytes) + 1); - + if (strstr((char *)row[TSDB_DESCRIBE_METRIC_TYPE_INDEX], "UNSIGNED") == NULL) { tstrncpy(superTbls->columns[columnIndex].dataType, (char *)row[TSDB_DESCRIBE_METRIC_TYPE_INDEX], @@ -4346,9 +4337,10 @@ static int createSuperTable( superTbl->lenOfTagOfOneRow = lenOfTagOfOneRow; + snprintf(command, BUFFER_SIZE, - "CREATE TABLE IF NOT EXISTS %s.%s (ts TIMESTAMP%s) TAGS %s", - dbName, superTbl->stbName, cols, tags); + "CREATE TABLE IF NOT EXISTS %s.%s (ts TIMESTAMP%s) TAGS %s", + dbName, superTbl->stbName, cols, tags); if (0 != queryDbExec(taos, command, NO_INSERT_TYPE, false)) { errorPrint2("create supertable %s failed!\n\n", superTbl->stbName); @@ -4594,7 +4586,6 @@ static void* createTable(void *sarg) return NULL; } pThreadInfo->tables_created += batchNum; - uint64_t currentPrintTime = taosGetTimestampMs(); if (currentPrintTime - lastPrintTime > 30*1000) { printf("thread[%d] already create %"PRIu64" - %"PRIu64" tables\n", @@ -4608,8 +4599,8 @@ static void* createTable(void *sarg) NO_INSERT_TYPE, false)) { errorPrint2("queryDbExec() failed. buffer:\n%s\n", pThreadInfo->buffer); } + pThreadInfo->tables_created += batchNum; } - free(pThreadInfo->buffer); return NULL; } @@ -4816,6 +4807,23 @@ static int readTagFromCsvFileToMem(SSuperTable * stbInfo) { return 0; } +static void getAndSetRowsFromCsvFile(SSuperTable *stbInfo) { + FILE *fp = fopen(stbInfo->sampleFile, "r"); + int line_count = 0; + if (fp == NULL) { + errorPrint("Failed to open sample file: %s, reason:%s\n", + stbInfo->sampleFile, strerror(errno)); + exit(EXIT_FAILURE); + } + char *buf = calloc(1, stbInfo->maxSqlLen); + while (fgets(buf, stbInfo->maxSqlLen, fp)) { + line_count++; + } + fclose(fp); + tmfree(buf); + stbInfo->insertRows = line_count; +} + /* Read 10000 lines at most. If more than 10000 lines, continue to read after using */ @@ -5269,6 +5277,22 @@ static bool getMetaFromInsertJsonFile(cJSON* root) { goto PARSE_OVER; } + cJSON* prepareRand = cJSON_GetObjectItem(root, "prepared_rand"); + if (prepareRand && prepareRand->type == cJSON_Number) { + if (prepareRand->valueint <= 0) { + errorPrint("%s() LN%d, failed to read json, prepared_rand input mistake\n", + __func__, __LINE__); + goto PARSE_OVER; + } + g_args.prepared_rand = prepareRand->valueint; + } else if (!prepareRand) { + g_args.prepared_rand = 10000; + } else { + errorPrint("%s() LN%d, failed to read json, prepared_rand not found\n", + __func__, __LINE__); + goto PARSE_OVER; + } + cJSON *answerPrompt = cJSON_GetObjectItem(root, "confirm_parameter_prompt"); // yes, no, if (answerPrompt && answerPrompt->type == cJSON_String @@ -5310,7 +5334,8 @@ static bool getMetaFromInsertJsonFile(cJSON* root) { MAX_DB_COUNT); goto PARSE_OVER; } - + g_Dbs.db = calloc(1, sizeof(SDataBase)*dbSize); + assert(g_Dbs.db); g_Dbs.dbCount = dbSize; for (int i = 0; i < dbSize; ++i) { cJSON* dbinfos = cJSON_GetArrayItem(dbs, i); @@ -5510,7 +5535,8 @@ static bool getMetaFromInsertJsonFile(cJSON* root) { MAX_SUPER_TABLE_COUNT); goto PARSE_OVER; } - + g_Dbs.db[i].superTbls = calloc(1, stbSize * sizeof(SSuperTable)); + assert(g_Dbs.db[i].superTbls); g_Dbs.db[i].superTblCount = stbSize; for (int j = 0; j < stbSize; ++j) { cJSON* stbInfo = cJSON_GetArrayItem(stables, j); @@ -5709,6 +5735,23 @@ static bool getMetaFromInsertJsonFile(cJSON* root) { goto PARSE_OVER; } + cJSON *useSampleTs = cJSON_GetObjectItem(stbInfo, "use_sample_ts"); + if (useSampleTs && useSampleTs->type == cJSON_String + && useSampleTs->valuestring != NULL) { + if (0 == strncasecmp(useSampleTs->valuestring, "yes", 3)) { + g_Dbs.db[i].superTbls[j].useSampleTs = true; + } else if (0 == strncasecmp(useSampleTs->valuestring, "no", 2)){ + g_Dbs.db[i].superTbls[j].useSampleTs = false; + } else { + g_Dbs.db[i].superTbls[j].useSampleTs = false; + } + } else if (!useSampleTs) { + g_Dbs.db[i].superTbls[j].useSampleTs = false; + } else { + errorPrint("%s", "failed to read json, use_sample_ts not found\n"); + goto PARSE_OVER; + } + cJSON *tagsFile = cJSON_GetObjectItem(stbInfo, "tags_file"); if ((tagsFile && tagsFile->type == cJSON_String) && (tagsFile->valuestring != NULL)) { @@ -6366,9 +6409,12 @@ static bool getInfoFromJsonFile(char* file) { } if (INSERT_TEST == g_args.test_mode) { + memset(&g_Dbs, 0, sizeof(SDbs)); + g_Dbs.use_metric = g_args.use_metric; ret = getMetaFromInsertJsonFile(root); } else if ((QUERY_TEST == g_args.test_mode) || (SUBSCRIBE_TEST == g_args.test_mode)) { + memset(&g_queryInfo, 0, sizeof(SQueryMetaInfo)); ret = getMetaFromQueryJsonFile(root); } else { errorPrint("%s", @@ -6433,8 +6479,9 @@ static void postFreeResource() { g_Dbs.db[i].superTbls[j].childTblName = NULL; } } + tmfree(g_Dbs.db[i].superTbls); } - + tmfree(g_Dbs.db); tmfree(g_randbool_buff); tmfree(g_randint_buff); tmfree(g_rand_voltage_buff); @@ -6444,6 +6491,17 @@ static void postFreeResource() { tmfree(g_randfloat_buff); tmfree(g_rand_current_buff); tmfree(g_rand_phase_buff); + tmfree(g_randdouble_buff); + tmfree(g_randuint_buff); + tmfree(g_randutinyint_buff); + tmfree(g_randusmallint_buff); + tmfree(g_randubigint_buff); + tmfree(g_randint); + tmfree(g_randuint); + tmfree(g_randbigint); + tmfree(g_randubigint); + tmfree(g_randfloat); + tmfree(g_randdouble); tmfree(g_sampleDataBuf); @@ -6457,6 +6515,7 @@ static void postFreeResource() { } } tmfree(g_sampleBindBatchArray); + #endif } @@ -6469,13 +6528,20 @@ static int getRowDataFromSample( } int dataLen = 0; - - dataLen += snprintf(dataBuf + dataLen, maxLen - dataLen, + if(stbInfo->useSampleTs) { + dataLen += snprintf(dataBuf + dataLen, maxLen - dataLen, + "(%s", + stbInfo->sampleDataBuf + + stbInfo->lenOfOneRow * (*sampleUsePos)); + } else { + dataLen += snprintf(dataBuf + dataLen, maxLen - dataLen, "(%" PRId64 ", ", timestamp); - dataLen += snprintf(dataBuf + dataLen, maxLen - dataLen, + dataLen += snprintf(dataBuf + dataLen, maxLen - dataLen, "%s", stbInfo->sampleDataBuf + stbInfo->lenOfOneRow * (*sampleUsePos)); + } + dataLen += snprintf(dataBuf + dataLen, maxLen - dataLen, ")"); (*sampleUsePos)++; @@ -6547,7 +6613,7 @@ static int64_t generateStbRowData( tmpLen = strlen(tmp); tstrncpy(pstr + dataLen, tmp, min(tmpLen + 1, BIGINT_BUFF_LEN)); break; - + case TSDB_DATA_TYPE_UBIGINT: tmp = rand_ubigint_str(); tmpLen = strlen(tmp); @@ -6908,6 +6974,9 @@ static int prepareSampleForStb(SSuperTable *stbInfo) { int ret; if (0 == strncasecmp(stbInfo->dataSource, "sample", strlen("sample"))) { + if(stbInfo->useSampleTs) { + getAndSetRowsFromCsvFile(stbInfo); + } ret = generateSampleFromCsvForStb(stbInfo); } else { ret = generateSampleFromRandForStb(stbInfo); @@ -6958,7 +7027,7 @@ static int32_t execInsert(threadInfo *pThreadInfo, uint32_t k) verbosePrint("[%d] %s() LN%d %s\n", pThreadInfo->threadID, __func__, __LINE__, pThreadInfo->buffer); - if (0 != postProceSql(g_Dbs.host, &g_Dbs.serv_addr, g_Dbs.port, + if (0 != postProceSql(g_Dbs.host, g_Dbs.port, pThreadInfo->buffer, pThreadInfo)) { affectedRows = -1; printf("========restful return fail, threadID[%d]\n", @@ -7009,12 +7078,11 @@ static void getTableName(char *pTblName, stbInfo->childTblName + tableSeq * TSDB_TABLE_NAME_LEN); } } else { - snprintf(pTblName, TSDB_TABLE_NAME_LEN, "%s%"PRIu64"", - stbInfo->childTblPrefix, tableSeq); + snprintf(pTblName, TSDB_TABLE_NAME_LEN, + "%s%"PRIu64"", stbInfo->childTblPrefix, tableSeq); } } else { - snprintf(pTblName, TSDB_TABLE_NAME_LEN, "%s%"PRIu64"", - g_args.tb_prefix, tableSeq); + snprintf(pTblName, TSDB_TABLE_NAME_LEN, "%s%"PRIu64"", g_args.tb_prefix, tableSeq); } } @@ -7434,7 +7502,7 @@ static int32_t prepareStmtBindArrayByType( bind->length = &bind->buffer_length; bind->is_null = NULL; break; - + case TSDB_DATA_TYPE_UINT: bind_uint = malloc(sizeof(uint32_t)); assert(bind_uint); @@ -10258,7 +10326,7 @@ static void startMultiThreadInsertData(int threads, char* db_name, } int64_t ntables = 0; - uint64_t tableFrom; + uint64_t tableFrom = 0; if (stbInfo) { int64_t limit; @@ -10497,6 +10565,33 @@ static void startMultiThreadInsertData(int threads, char* db_name, pThreadInfo->start_time = pThreadInfo->start_time + rand_int() % 10000 - rand_tinyint(); } */ + + if (g_args.iface == REST_IFACE || ((stbInfo) && (stbInfo->iface == REST_IFACE))) { +#ifdef WINDOWS + WSADATA wsaData; + WSAStartup(MAKEWORD(2, 2), &wsaData); + SOCKET sockfd; +#else + int sockfd; +#endif + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if (sockfd < 0) { +#ifdef WINDOWS + errorPrint( "Could not create socket : %d" , WSAGetLastError()); +#endif + debugPrint("%s() LN%d, sockfd=%d\n", __func__, __LINE__, sockfd); + ERROR_EXIT("opening socket"); + } + + int retConn = connect(sockfd, (struct sockaddr *)&(g_Dbs.serv_addr), sizeof(struct sockaddr)); + debugPrint("%s() LN%d connect() return %d\n", __func__, __LINE__, retConn); + if (retConn < 0) { + ERROR_EXIT("connecting"); + } + pThreadInfo->sockfd = sockfd; + } + + tsem_init(&(pThreadInfo->lock_sem), 0, 0); if (ASYNC_MODE == g_Dbs.asyncMode) { pthread_create(pids + i, NULL, asyncWrite, pThreadInfo); @@ -10534,6 +10629,14 @@ static void startMultiThreadInsertData(int threads, char* db_name, tmfree((char *)pThreadInfo->bind_ts_array); tmfree(pThreadInfo->bindParams); tmfree(pThreadInfo->is_null); + if (g_args.iface == REST_IFACE || ((stbInfo) && (stbInfo->iface == REST_IFACE))) { +#ifdef WINDOWS + closesocket(pThreadInfo->sockfd); + WSACleanup(); +#else + close(pThreadInfo->sockfd); +#endif + } #else if (pThreadInfo->sampleBindArray) { for (int k = 0; k < MAX_SAMPLES; k++) { @@ -10936,7 +11039,6 @@ static int insertTestProcess() { // totalAffectedRows += g_Dbs.db[i].superTbls[j].totalAffectedRows; //} //printf("Spent %.4f seconds to insert rows: %"PRId64", affected rows: %"PRId64" with %d thread(s)\n\n", end - start, totalInsertRows, totalAffectedRows, g_Dbs.threadCount); - postFreeResource(); return 0; } @@ -11196,6 +11298,31 @@ static int queryTestProcess() { } } + if (0 == strncasecmp(g_queryInfo.queryMode, "rest", 4)) { +#ifdef WINDOWS + WSADATA wsaData; + WSAStartup(MAKEWORD(2, 2), &wsaData); + SOCKET sockfd; +#else + int sockfd; +#endif + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if (sockfd < 0) { +#ifdef WINDOWS + errorPrint( "Could not create socket : %d" , WSAGetLastError()); +#endif + debugPrint("%s() LN%d, sockfd=%d\n", __func__, __LINE__, sockfd); + ERROR_EXIT("opening socket"); + } + + int retConn = connect(sockfd, (struct sockaddr *)&(g_queryInfo.serv_addr), + sizeof(struct sockaddr)); + debugPrint("%s() LN%d connect() return %d\n", __func__, __LINE__, retConn); + if (retConn < 0) { + ERROR_EXIT("connecting"); + } + pThreadInfo->sockfd = sockfd; + } pThreadInfo->taos = NULL;// workaround to use separate taos connection; pthread_create(pids + seq, NULL, specifiedTableQuery, @@ -11247,6 +11374,31 @@ static int queryTestProcess() { pThreadInfo->end_table_to = i < b ? tableFrom + a : tableFrom + a - 1; tableFrom = pThreadInfo->end_table_to + 1; pThreadInfo->taos = NULL; // workaround to use separate taos connection; + if (0 == strncasecmp(g_queryInfo.queryMode, "rest", 4)) { +#ifdef WINDOWS + WSADATA wsaData; + WSAStartup(MAKEWORD(2, 2), &wsaData); + SOCKET sockfd; +#else + int sockfd; +#endif + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if (sockfd < 0) { +#ifdef WINDOWS + errorPrint( "Could not create socket : %d" , WSAGetLastError()); +#endif + debugPrint("%s() LN%d, sockfd=%d\n", __func__, __LINE__, sockfd); + ERROR_EXIT("opening socket"); + } + + int retConn = connect(sockfd, (struct sockaddr *)&(g_queryInfo.serv_addr), + sizeof(struct sockaddr)); + debugPrint("%s() LN%d connect() return %d\n", __func__, __LINE__, retConn); + if (retConn < 0) { + ERROR_EXIT("connecting"); + } + pThreadInfo->sockfd = sockfd; + } pthread_create(pidsOfSub + i, NULL, superTableQuery, pThreadInfo); } @@ -11259,6 +11411,15 @@ static int queryTestProcess() { for (int i = 0; i < nConcurrent; i++) { for (int j = 0; j < nSqlCount; j++) { pthread_join(pids[i * nSqlCount + j], NULL); + if (0 == strncasecmp(g_queryInfo.queryMode, "rest", 4)) { + threadInfo *pThreadInfo = infos + i * nSqlCount + j; +#ifdef WINDOWS + closesocket(pThreadInfo->sockfd); + WSACleanup(); +#else + close(pThreadInfo->sockfd); +#endif + } } } } @@ -11268,6 +11429,15 @@ static int queryTestProcess() { for (int i = 0; i < g_queryInfo.superQueryInfo.threadCnt; i++) { pthread_join(pidsOfSub[i], NULL); + if (0 == strncasecmp(g_queryInfo.queryMode, "rest", 4)) { + threadInfo *pThreadInfo = infosOfSub + i; +#ifdef WINDOWS + closesocket(pThreadInfo->sockfd); + WSACleanup(); +#else + close(pThreadInfo->sockfd); +#endif + } } tmfree((char*)pidsOfSub); @@ -11770,29 +11940,6 @@ static int subscribeTestProcess() { return 0; } -static void initOfInsertMeta() { - memset(&g_Dbs, 0, sizeof(SDbs)); - - // set default values - tstrncpy(g_Dbs.host, "127.0.0.1", MAX_HOSTNAME_SIZE); - g_Dbs.port = 6030; - tstrncpy(g_Dbs.user, TSDB_DEFAULT_USER, MAX_USERNAME_SIZE); - tstrncpy(g_Dbs.password, TSDB_DEFAULT_PASS, SHELL_MAX_PASSWORD_LEN); - g_Dbs.threadCount = 2; - - g_Dbs.use_metric = g_args.use_metric; -} - -static void initOfQueryMeta() { - memset(&g_queryInfo, 0, sizeof(SQueryMetaInfo)); - - // set default values - tstrncpy(g_queryInfo.host, "127.0.0.1", MAX_HOSTNAME_SIZE); - g_queryInfo.port = 6030; - tstrncpy(g_queryInfo.user, TSDB_DEFAULT_USER, MAX_USERNAME_SIZE); - tstrncpy(g_queryInfo.password, TSDB_DEFAULT_PASS, SHELL_MAX_PASSWORD_LEN); -} - static void setParaFromArg() { char type[20]; char length[20]; @@ -11825,7 +11972,7 @@ static void setParaFromArg() { tstrncpy(g_Dbs.resultFile, g_args.output_file, MAX_FILE_NAME_LEN); g_Dbs.use_metric = g_args.use_metric; - + g_args.prepared_rand = min(g_args.insertRows, MAX_PREPARED_RAND); g_Dbs.aggr_func = g_args.aggr_func; char dataString[TSDB_MAX_BYTES_PER_ROW]; @@ -11942,7 +12089,6 @@ static int regexMatch(const char *s, const char *reg, int cflags) { printf("Regex match failed: %s\n", msgbuf); exit(EXIT_FAILURE); } - return 0; } @@ -12102,8 +12248,6 @@ int main(int argc, char *argv[]) { if (g_args.metaFile) { g_totalChildTables = 0; - initOfInsertMeta(); - initOfQueryMeta(); if (false == getInfoFromJsonFile(g_args.metaFile)) { printf("Failed to read %s\n", g_args.metaFile); @@ -12113,6 +12257,10 @@ int main(int argc, char *argv[]) { testMetaFile(); } else { memset(&g_Dbs, 0, sizeof(SDbs)); + g_Dbs.db = calloc(1, sizeof(SDataBase)); + assert(g_Dbs.db); + g_Dbs.db[0].superTbls = calloc(1, sizeof(SSuperTable)); + assert(g_Dbs.db[0].superTbls); setParaFromArg(); if (NULL != g_args.sqlFile) { @@ -12132,6 +12280,7 @@ int main(int argc, char *argv[]) { if (g_dupstr) free(g_dupstr); } + postFreeResource(); return 0; } diff --git a/src/kit/taosdump/taosdump.c b/src/kit/taosdump/taosdump.c index 34d9956c642c5c91aa72c6a4386dc675ad48dc98..84233bd36b6d598c894dba41ee71ff554621190d 100644 --- a/src/kit/taosdump/taosdump.c +++ b/src/kit/taosdump/taosdump.c @@ -1972,7 +1972,7 @@ static int getTableDes( while ((row = taos_fetch_row(res)) != NULL) { tstrncpy(tableDes->cols[colCount].field, (char *)row[TSDB_DESCRIBE_METRIC_FIELD_INDEX], - min(TSDB_COL_NAME_LEN + 1, + min(TSDB_COL_NAME_LEN, fields[TSDB_DESCRIBE_METRIC_FIELD_INDEX].bytes + 1)); tstrncpy(tableDes->cols[colCount].type, (char *)row[TSDB_DESCRIBE_METRIC_TYPE_INDEX], diff --git a/src/mnode/src/mnodeDb.c b/src/mnode/src/mnodeDb.c index 9602e16483f3a367117f998cc619dbe408859d93..daf785cc0770fb68aa020550cc318a71539ca091 100644 --- a/src/mnode/src/mnodeDb.c +++ b/src/mnode/src/mnodeDb.c @@ -1136,7 +1136,7 @@ static int32_t mnodeAlterDbFp(SMnodeMsg *pMsg) { return sdbUpdateRow(&row); } - //bnNotify(); + bnNotify(); return TSDB_CODE_MND_ACTION_IN_PROGRESS; } diff --git a/src/mnode/src/mnodeVgroup.c b/src/mnode/src/mnodeVgroup.c index a32da29124016424ce5fe1436f29cca91da3e546..838aa577ae0fe396f3e80d2fca9066de10d3bc7a 100644 --- a/src/mnode/src/mnodeVgroup.c +++ b/src/mnode/src/mnodeVgroup.c @@ -742,19 +742,6 @@ static int32_t mnodeGetVgroupMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *p return 0; } -static bool mnodeFilterVgroups(SVgObj *pVgroup, STableObj *pTable) { - if (NULL == pTable || pTable->type == TSDB_SUPER_TABLE) { - return true; - } - - SCTableObj *pCTable = (SCTableObj *)pTable; - if (pVgroup->vgId == pCTable->vgId) { - return true; - } else { - return false; - } -} - static int32_t mnodeRetrieveVgroups(SShowObj *pShow, char *data, int32_t rows, void *pConn) { int32_t numOfRows = 0; SVgObj *pVgroup = NULL; @@ -770,11 +757,6 @@ static int32_t mnodeRetrieveVgroups(SShowObj *pShow, char *data, int32_t rows, v return 0; } - STableObj *pTable = NULL; - if (pShow->payloadLen > 0 ) { - pTable = mnodeGetTable(pShow->payload); - } - while (numOfRows < rows) { pShow->pIter = mnodeGetNextVgroup(pShow->pIter, &pVgroup); if (pVgroup == NULL) break; @@ -784,11 +766,6 @@ static int32_t mnodeRetrieveVgroups(SShowObj *pShow, char *data, int32_t rows, v continue; } - if (!mnodeFilterVgroups(pVgroup, pTable)) { - mnodeDecVgroupRef(pVgroup); - continue; - } - cols = 0; pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows; @@ -842,7 +819,6 @@ static int32_t mnodeRetrieveVgroups(SShowObj *pShow, char *data, int32_t rows, v mnodeVacuumResult(data, pShow->numOfColumns, numOfRows, rows, pShow); pShow->numOfReads += numOfRows; - mnodeDecTableRef(pTable); mnodeDecDbRef(pDb); return numOfRows; diff --git a/src/os/src/darwin/dwSysInfo.c b/src/os/src/darwin/dwSysInfo.c index 10e0acc1309d80154a42b6cc948a8afb7a04b668..f8cd61c7ef80e612ff439b8f696edffc15b3bd56 100644 --- a/src/os/src/darwin/dwSysInfo.c +++ b/src/os/src/darwin/dwSysInfo.c @@ -65,6 +65,8 @@ static void taosGetSystemTimezone() { struct tm tm1; localtime_r(&tx1, &tm1); + tsDaylight = daylight; + /* * format example: * diff --git a/src/os/src/detail/osSysinfo.c b/src/os/src/detail/osSysinfo.c index 04b1efe7bf78d57a8806960995b0e34ff79e3abb..8f39459f2ebf95146d6d90c78a4b648e7b2332f3 100644 --- a/src/os/src/detail/osSysinfo.c +++ b/src/os/src/detail/osSysinfo.c @@ -213,6 +213,8 @@ static void taosGetSystemTimezone() { int32_t tz = (-timezone * MILLISECOND_PER_SECOND) / MILLISECOND_PER_HOUR; tz += daylight; + tsDaylight = daylight; + /* * format example: * diff --git a/src/os/src/windows/wSysinfo.c b/src/os/src/windows/wSysinfo.c index 72793a1049506fed0fce2d1a04c576097fec9fba..6100101207749cc44f0488ca89d0ae04ca0ee7a2 100644 --- a/src/os/src/windows/wSysinfo.c +++ b/src/os/src/windows/wSysinfo.c @@ -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"); } } diff --git a/src/plugins/http/inc/httpInt.h b/src/plugins/http/inc/httpInt.h index 6c567e23bc817957d7f376ef101f8e5ca88559e6..bf8efd2831e19480615be291d409d53207bb8f63 100644 --- a/src/plugins/http/inc/httpInt.h +++ b/src/plugins/http/inc/httpInt.h @@ -140,28 +140,29 @@ typedef enum { } EHTTP_CONTEXT_FAILED_CAUSE; typedef struct HttpContext { - int32_t refCount; - SOCKET fd; - uint32_t accessTimes; - uint32_t lastAccessTime; - int32_t state; - uint8_t reqType; - uint8_t parsed; - uint8_t error; - char ipstr[22]; - char user[TSDB_USER_LEN]; // parsed from auth token or login message - char pass[HTTP_PASSWORD_LEN]; - char db[/*TSDB_ACCT_ID_LEN + */TSDB_DB_NAME_LEN]; - TAOS * taos; - void * ppContext; - HttpSession *session; - z_stream gzipStream; - HttpParser *parser; - HttpSqlCmd singleCmd; - HttpSqlCmds *multiCmds; - JsonBuf * jsonBuf; - HttpEncodeMethod *encodeMethod; - HttpDecodeMethod *decodeMethod; + int32_t refCount; + SOCKET fd; + uint32_t accessTimes; + uint32_t lastAccessTime; + int32_t state; + uint8_t reqType; + uint8_t parsed; + uint8_t error; + char ipstr[22]; + char user[TSDB_USER_LEN]; // parsed from auth token or login message + char pass[HTTP_PASSWORD_LEN]; + 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; + HttpEncodeMethod *encodeMethod; + HttpDecodeMethod *decodeMethod; struct HttpThread *pThread; } HttpContext; diff --git a/src/plugins/http/src/httpContext.c b/src/plugins/http/src/httpContext.c index 11945453c56ab7fdd1fc8b0c4f2510bbbdda1a6e..f26a4b4c8bdda05f801075b70c1b762882adfd27 100644 --- a/src/plugins/http/src/httpContext.c +++ b/src/plugins/http/src/httpContext.c @@ -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; } diff --git a/src/plugins/http/src/httpHandle.c b/src/plugins/http/src/httpHandle.c index 9719d93824b50064ec1cf23677c641428434592c..6f77994593ebbfc1dc2d9ce97b15a90a797dd8d5 100644 --- a/src/plugins/http/src/httpHandle.c +++ b/src/plugins/http/src/httpHandle.c @@ -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; diff --git a/src/plugins/http/src/httpSql.c b/src/plugins/http/src/httpSql.c index 602767a6563b3ca3430501c0dbcee65333f1d44b..e1b3b17347cba786fa12f5cc2fa7ab3cfb45bd54 100644 --- a/src/plugins/http/src/httpSql.c +++ b/src/plugins/http/src/httpSql.c @@ -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); } } diff --git a/src/query/inc/qExecutor.h b/src/query/inc/qExecutor.h index caf17ddb16141356906993333302b9007876f84f..fa47dd95d2dc445fb8e4125431dcf37a5c324dc4 100644 --- a/src/query/inc/qExecutor.h +++ b/src/query/inc/qExecutor.h @@ -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; diff --git a/src/query/inc/sql.y b/src/query/inc/sql.y index 1a9f39ce71544bdd92937d972a5f015e68edecc6..64e3f16b41e6e14630b982bfb84c6de25f0f7a9a 100644 --- a/src/query/inc/sql.y +++ b/src/query/inc/sql.y @@ -128,12 +128,6 @@ cmd ::= SHOW dbPrefix(X) VGROUPS. { setShowOptions(pInfo, TSDB_MGMT_TABLE_VGROUP, &token, 0); } -cmd ::= SHOW dbPrefix(X) VGROUPS ids(Y). { - SStrToken token; - tSetDbName(&token, &X); - setShowOptions(pInfo, TSDB_MGMT_TABLE_VGROUP, &token, &Y); -} - //drop configure for tables cmd ::= DROP TABLE ifexists(Y) ids(X) cpxName(Z). { X.n += Z.n; @@ -919,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. diff --git a/src/query/src/qAggMain.c b/src/query/src/qAggMain.c index da4cb62351b7244c050239688df82bf8bd396afe..b7d64d63e9bfbacd34e59c42b33cc6c240442062 100644 --- a/src/query/src/qAggMain.c +++ b/src/query/src/qAggMain.c @@ -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; } } diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index 884c9aa1f6e6d9a083eb722fd7248a27aed4720c..237d52b19eb8aadd625a47924f5670f024cac887 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -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; } diff --git a/src/query/src/queryMain.c b/src/query/src/queryMain.c index 7d30f7c66812c0feb9c7ac37db9d7330fc2f37fb..28c5df32516ae83fbccecd40208b2735e484a6c4 100644 --- a/src/query/src/queryMain.c +++ b/src/query/src/queryMain.c @@ -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); @@ -343,6 +346,9 @@ int32_t qDumpRetrieveResult(qinfo_t qinfo, SRetrieveTableRsp **pRsp, int32_t *co setQueryStatus(pRuntimeEnv, QUERY_OVER); } + RESET_NUM_OF_RESULTS(&(pQInfo->runtimeEnv)); + pQInfo->lastRetrieveTs = taosGetTimestampMs(); + pQInfo->rspContext = NULL; pQInfo->dataReady = QUERY_RESULT_NOT_READY; diff --git a/src/query/src/sql.c b/src/query/src/sql.c index a6ce057d703f93c48a587277f1ad717729b9fc61..fd087ba92b429d4bfde5e67183ab83e2d8493996 100644 --- a/src/query/src/sql.c +++ b/src/query/src/sql.c @@ -264,7 +264,7 @@ ** the minor type might be the name of the identifier. ** Each non-terminal can have a different minor type. ** Terminal symbols all have the same minor type, though. -** This macros defines the minor type for terminal +** This macros defines the minor type for terminal ** symbols. ** YYMINORTYPE is the data type used for all minor types. ** This is typically a union of many types, one of @@ -366,7 +366,7 @@ typedef union { /* Next are the tables used to determine what action to take based on the ** current state and lookahead token. These tables are used to implement ** functions that take a state number and lookahead value and return an -** action integer. +** action integer. ** ** Suppose the action integer is N. Then the action is determined as ** follows @@ -415,293 +415,293 @@ typedef union { *********** Begin parsing tables **********************************************/ #define YY_ACTTAB_COUNT (758) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 170, 624, 236, 624, 230, 361, 1023, 1045, 242, 625, - /* 10 */ 247, 625, 1023, 57, 58, 154, 61, 62, 281, 38, - /* 20 */ 250, 51, 624, 60, 319, 65, 63, 66, 64, 993, - /* 30 */ 625, 991, 992, 56, 55, 161, 994, 54, 53, 52, - /* 40 */ 995, 161, 996, 997, 865, 363, 1036, 573, 574, 575, - /* 50 */ 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, - /* 60 */ 586, 362, 233, 232, 231, 57, 58, 1020, 61, 62, - /* 70 */ 208, 660, 250, 51, 1042, 60, 319, 65, 63, 66, - /* 80 */ 64, 1135, 1009, 279, 278, 56, 55, 80, 98, 54, - /* 90 */ 53, 52, 57, 58, 1036, 61, 62, 208, 86, 250, - /* 100 */ 51, 1017, 60, 319, 65, 63, 66, 64, 1134, 1084, - /* 110 */ 272, 291, 56, 55, 317, 1083, 54, 53, 52, 57, - /* 120 */ 59, 244, 61, 62, 1011, 1023, 250, 51, 95, 60, - /* 130 */ 319, 65, 63, 66, 64, 45, 802, 23, 1036, 56, - /* 140 */ 55, 161, 349, 54, 53, 52, 58, 243, 61, 62, - /* 150 */ 767, 768, 250, 51, 234, 60, 319, 65, 63, 66, - /* 160 */ 64, 1006, 1007, 35, 1010, 56, 55, 317, 246, 54, - /* 170 */ 53, 52, 44, 315, 356, 355, 314, 313, 312, 354, - /* 180 */ 311, 310, 309, 353, 308, 352, 351, 985, 973, 974, - /* 190 */ 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, - /* 200 */ 986, 987, 61, 62, 24, 205, 250, 51, 264, 60, - /* 210 */ 319, 65, 63, 66, 64, 92, 74, 268, 267, 56, - /* 220 */ 55, 259, 211, 54, 53, 52, 249, 817, 208, 217, - /* 230 */ 806, 175, 809, 123, 812, 137, 136, 135, 216, 1135, - /* 240 */ 249, 817, 324, 86, 806, 349, 809, 161, 812, 251, - /* 250 */ 916, 206, 65, 63, 66, 64, 75, 189, 228, 229, - /* 260 */ 56, 55, 320, 926, 54, 53, 52, 5, 41, 179, - /* 270 */ 189, 624, 228, 229, 178, 104, 109, 100, 108, 625, - /* 280 */ 45, 732, 357, 954, 729, 38, 730, 38, 731, 121, - /* 290 */ 115, 126, 253, 304, 38, 808, 125, 811, 131, 134, - /* 300 */ 124, 807, 271, 810, 78, 258, 38, 128, 67, 208, - /* 310 */ 212, 224, 255, 256, 3, 190, 199, 197, 195, 293, - /* 320 */ 1135, 91, 67, 194, 141, 140, 139, 138, 1131, 240, - /* 330 */ 38, 241, 38, 1020, 44, 1020, 356, 355, 328, 259, - /* 340 */ 38, 354, 1020, 818, 813, 353, 38, 352, 351, 176, - /* 350 */ 814, 748, 38, 29, 1019, 38, 745, 818, 813, 1130, - /* 360 */ 38, 56, 55, 708, 814, 54, 53, 52, 254, 259, - /* 370 */ 252, 14, 327, 326, 329, 94, 330, 784, 1020, 1021, - /* 380 */ 1020, 260, 9, 257, 331, 334, 333, 273, 1020, 79, - /* 390 */ 335, 339, 338, 93, 1020, 917, 336, 733, 734, 337, - /* 400 */ 1020, 39, 189, 1020, 341, 97, 83, 81, 1020, 54, - /* 410 */ 53, 52, 360, 359, 146, 815, 152, 150, 149, 1, - /* 420 */ 177, 816, 84, 1008, 764, 774, 775, 718, 71, 804, - /* 430 */ 248, 296, 720, 298, 783, 719, 838, 752, 156, 68, - /* 440 */ 26, 39, 34, 275, 321, 39, 68, 96, 819, 68, - /* 450 */ 25, 16, 6, 15, 623, 114, 18, 113, 17, 275, - /* 460 */ 77, 737, 25, 738, 735, 805, 736, 20, 25, 19, - /* 470 */ 72, 120, 22, 119, 21, 299, 133, 132, 1129, 226, - /* 480 */ 227, 209, 210, 213, 207, 214, 215, 219, 1022, 220, - /* 490 */ 1154, 1146, 707, 221, 218, 204, 269, 1094, 1093, 238, - /* 500 */ 1090, 1089, 239, 340, 171, 153, 1044, 1055, 48, 151, - /* 510 */ 1052, 1053, 1037, 276, 1057, 155, 160, 287, 1018, 1076, - /* 520 */ 1075, 280, 172, 1016, 235, 282, 173, 164, 174, 1034, - /* 530 */ 931, 301, 302, 303, 306, 307, 46, 763, 202, 163, - /* 540 */ 284, 162, 294, 42, 318, 290, 165, 821, 76, 925, - /* 550 */ 50, 292, 73, 325, 1153, 111, 1152, 166, 286, 1149, - /* 560 */ 180, 332, 1145, 288, 117, 1144, 1141, 181, 167, 283, - /* 570 */ 951, 33, 43, 40, 47, 203, 49, 913, 127, 911, - /* 580 */ 129, 130, 909, 908, 261, 192, 193, 905, 904, 903, - /* 590 */ 902, 901, 900, 899, 196, 198, 305, 896, 894, 892, - /* 600 */ 890, 200, 887, 201, 350, 274, 82, 87, 285, 1077, - /* 610 */ 122, 342, 343, 344, 345, 346, 347, 348, 225, 358, - /* 620 */ 245, 300, 863, 262, 263, 862, 222, 223, 265, 266, - /* 630 */ 861, 105, 930, 929, 844, 843, 270, 106, 275, 295, - /* 640 */ 10, 277, 740, 85, 88, 907, 906, 30, 142, 898, - /* 650 */ 183, 952, 184, 185, 182, 186, 188, 187, 143, 144, - /* 660 */ 897, 989, 145, 889, 953, 888, 4, 765, 157, 2, - /* 670 */ 776, 168, 169, 158, 159, 770, 89, 999, 772, 90, - /* 680 */ 237, 289, 31, 11, 12, 32, 13, 27, 297, 28, - /* 690 */ 97, 99, 102, 36, 101, 638, 37, 103, 673, 671, - /* 700 */ 670, 669, 667, 666, 665, 662, 316, 107, 628, 7, - /* 710 */ 822, 820, 8, 323, 110, 112, 322, 69, 70, 116, - /* 720 */ 710, 39, 118, 709, 706, 654, 652, 644, 650, 646, - /* 730 */ 648, 642, 640, 676, 675, 674, 672, 668, 664, 663, - /* 740 */ 191, 626, 590, 588, 867, 866, 866, 866, 866, 866, - /* 750 */ 866, 866, 866, 866, 866, 866, 147, 148, + /* 0 */ 170, 624, 236, 624, 230, 361, 1023, 1045, 242, 625, + /* 10 */ 247, 625, 1023, 57, 58, 154, 61, 62, 281, 38, + /* 20 */ 250, 51, 624, 60, 319, 65, 63, 66, 64, 993, + /* 30 */ 625, 991, 992, 56, 55, 161, 994, 54, 53, 52, + /* 40 */ 995, 161, 996, 997, 865, 363, 1036, 573, 574, 575, + /* 50 */ 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, + /* 60 */ 586, 362, 233, 232, 231, 57, 58, 1020, 61, 62, + /* 70 */ 208, 660, 250, 51, 1042, 60, 319, 65, 63, 66, + /* 80 */ 64, 1135, 1009, 279, 278, 56, 55, 80, 98, 54, + /* 90 */ 53, 52, 57, 58, 1036, 61, 62, 208, 86, 250, + /* 100 */ 51, 1017, 60, 319, 65, 63, 66, 64, 1134, 1084, + /* 110 */ 272, 291, 56, 55, 317, 1083, 54, 53, 52, 57, + /* 120 */ 59, 244, 61, 62, 1011, 1023, 250, 51, 95, 60, + /* 130 */ 319, 65, 63, 66, 64, 45, 802, 23, 1036, 56, + /* 140 */ 55, 161, 349, 54, 53, 52, 58, 243, 61, 62, + /* 150 */ 767, 768, 250, 51, 234, 60, 319, 65, 63, 66, + /* 160 */ 64, 1006, 1007, 35, 1010, 56, 55, 317, 246, 54, + /* 170 */ 53, 52, 44, 315, 356, 355, 314, 313, 312, 354, + /* 180 */ 311, 310, 309, 353, 308, 352, 351, 985, 973, 974, + /* 190 */ 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, + /* 200 */ 986, 987, 61, 62, 24, 205, 250, 51, 264, 60, + /* 210 */ 319, 65, 63, 66, 64, 92, 74, 268, 267, 56, + /* 220 */ 55, 259, 211, 54, 53, 52, 249, 817, 208, 217, + /* 230 */ 806, 175, 809, 123, 812, 137, 136, 135, 216, 1135, + /* 240 */ 249, 817, 324, 86, 806, 349, 809, 161, 812, 251, + /* 250 */ 916, 206, 65, 63, 66, 64, 75, 189, 228, 229, + /* 260 */ 56, 55, 320, 926, 54, 53, 52, 5, 41, 179, + /* 270 */ 189, 624, 228, 229, 178, 104, 109, 100, 108, 625, + /* 280 */ 45, 732, 357, 954, 729, 38, 730, 38, 731, 121, + /* 290 */ 115, 126, 253, 304, 38, 808, 125, 811, 131, 134, + /* 300 */ 124, 807, 271, 810, 78, 258, 38, 128, 67, 208, + /* 310 */ 212, 224, 255, 256, 3, 190, 199, 197, 195, 293, + /* 320 */ 1135, 91, 67, 194, 141, 140, 139, 138, 1131, 240, + /* 330 */ 38, 241, 38, 1020, 44, 1020, 356, 355, 328, 259, + /* 340 */ 38, 354, 1020, 818, 813, 353, 38, 352, 351, 176, + /* 350 */ 814, 748, 38, 29, 1019, 38, 745, 818, 813, 1130, + /* 360 */ 38, 56, 55, 708, 814, 54, 53, 52, 254, 259, + /* 370 */ 252, 14, 327, 326, 329, 94, 330, 784, 1020, 1021, + /* 380 */ 1020, 260, 9, 257, 331, 334, 333, 273, 1020, 79, + /* 390 */ 335, 339, 338, 93, 1020, 917, 336, 733, 734, 337, + /* 400 */ 1020, 39, 189, 1020, 341, 97, 83, 81, 1020, 54, + /* 410 */ 53, 52, 360, 359, 146, 815, 152, 150, 149, 1, + /* 420 */ 177, 816, 84, 1008, 764, 774, 775, 718, 71, 804, + /* 430 */ 248, 296, 720, 298, 783, 719, 838, 752, 156, 68, + /* 440 */ 26, 39, 34, 275, 321, 39, 68, 96, 819, 68, + /* 450 */ 25, 16, 6, 15, 623, 114, 18, 113, 17, 275, + /* 460 */ 77, 737, 25, 738, 735, 805, 736, 20, 25, 19, + /* 470 */ 72, 120, 22, 119, 21, 299, 133, 132, 1129, 226, + /* 480 */ 227, 209, 210, 213, 207, 214, 215, 219, 1022, 220, + /* 490 */ 1154, 1146, 707, 221, 218, 204, 269, 1094, 1093, 238, + /* 500 */ 1090, 1089, 239, 340, 171, 153, 1044, 1055, 48, 151, + /* 510 */ 1052, 1053, 1037, 276, 1057, 155, 160, 287, 1018, 1076, + /* 520 */ 1075, 280, 172, 1016, 235, 282, 173, 164, 174, 1034, + /* 530 */ 931, 301, 302, 303, 306, 307, 46, 763, 202, 163, + /* 540 */ 284, 162, 294, 42, 318, 290, 165, 821, 76, 925, + /* 550 */ 50, 292, 73, 325, 1153, 111, 1152, 166, 286, 1149, + /* 560 */ 180, 332, 1145, 288, 117, 1144, 1141, 181, 167, 283, + /* 570 */ 951, 33, 43, 40, 47, 203, 49, 913, 127, 911, + /* 580 */ 129, 130, 909, 908, 261, 192, 193, 905, 904, 903, + /* 590 */ 902, 901, 900, 899, 196, 198, 305, 896, 894, 892, + /* 600 */ 890, 200, 887, 201, 350, 274, 82, 87, 285, 1077, + /* 610 */ 122, 342, 343, 344, 345, 346, 347, 348, 225, 358, + /* 620 */ 245, 300, 863, 262, 263, 862, 222, 223, 265, 266, + /* 630 */ 861, 105, 930, 929, 844, 843, 270, 106, 275, 295, + /* 640 */ 10, 277, 740, 85, 88, 907, 906, 30, 142, 898, + /* 650 */ 183, 952, 184, 185, 182, 186, 188, 187, 143, 144, + /* 660 */ 897, 989, 145, 889, 953, 888, 4, 765, 157, 2, + /* 670 */ 776, 168, 169, 158, 159, 770, 89, 999, 772, 90, + /* 680 */ 237, 289, 31, 11, 12, 32, 13, 27, 297, 28, + /* 690 */ 97, 99, 102, 36, 101, 638, 37, 103, 673, 671, + /* 700 */ 670, 669, 667, 666, 665, 662, 316, 107, 628, 7, + /* 710 */ 822, 820, 8, 323, 110, 112, 322, 69, 70, 116, + /* 720 */ 710, 39, 118, 709, 706, 654, 652, 644, 650, 646, + /* 730 */ 648, 642, 640, 676, 675, 674, 672, 668, 664, 663, + /* 740 */ 191, 626, 590, 588, 867, 866, 866, 866, 866, 866, + /* 750 */ 866, 866, 866, 866, 866, 866, 147, 148, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 252, 1, 244, 1, 198, 199, 248, 199, 244, 9, - /* 10 */ 205, 9, 248, 13, 14, 199, 16, 17, 270, 199, - /* 20 */ 20, 21, 1, 23, 24, 25, 26, 27, 28, 222, - /* 30 */ 9, 224, 225, 33, 34, 199, 229, 37, 38, 39, - /* 40 */ 233, 199, 235, 236, 196, 197, 246, 45, 46, 47, - /* 50 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - /* 60 */ 58, 59, 262, 243, 62, 13, 14, 247, 16, 17, - /* 70 */ 265, 5, 20, 21, 266, 23, 24, 25, 26, 27, - /* 80 */ 28, 276, 0, 267, 268, 33, 34, 87, 206, 37, - /* 90 */ 38, 39, 13, 14, 246, 16, 17, 265, 83, 20, - /* 100 */ 21, 199, 23, 24, 25, 26, 27, 28, 276, 273, - /* 110 */ 262, 275, 33, 34, 85, 273, 37, 38, 39, 13, - /* 120 */ 14, 244, 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, 262, 23, 24, 25, 26, 27, - /* 160 */ 28, 239, 240, 241, 242, 33, 34, 85, 205, 37, - /* 170 */ 38, 39, 99, 100, 101, 102, 103, 104, 105, 106, - /* 180 */ 107, 108, 109, 110, 111, 112, 113, 222, 223, 224, - /* 190 */ 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - /* 200 */ 235, 236, 16, 17, 44, 265, 20, 21, 143, 23, - /* 210 */ 24, 25, 26, 27, 28, 273, 98, 152, 153, 33, - /* 220 */ 34, 199, 62, 37, 38, 39, 1, 2, 265, 69, - /* 230 */ 5, 209, 7, 79, 9, 75, 76, 77, 78, 276, - /* 240 */ 1, 2, 82, 83, 5, 91, 7, 199, 9, 205, - /* 250 */ 204, 265, 25, 26, 27, 28, 138, 211, 33, 34, - /* 260 */ 33, 34, 37, 204, 37, 38, 39, 63, 64, 65, - /* 270 */ 211, 1, 33, 34, 70, 71, 72, 73, 74, 9, - /* 280 */ 120, 2, 220, 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 */ 276, 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 */ 247, 145, 124, 147, 243, 149, 150, 84, 247, 206, - /* 390 */ 243, 33, 34, 249, 247, 204, 243, 118, 119, 243, - /* 400 */ 247, 98, 211, 247, 243, 117, 84, 263, 247, 37, - /* 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 */ 140, 146, 146, 148, 148, 116, 79, 80, 265, 265, - /* 480 */ 265, 265, 265, 265, 265, 265, 265, 265, 248, 265, - /* 490 */ 248, 248, 115, 265, 265, 265, 199, 238, 238, 238, - /* 500 */ 238, 238, 238, 238, 250, 199, 199, 199, 264, 61, - /* 510 */ 199, 199, 246, 246, 199, 199, 199, 199, 246, 274, - /* 520 */ 274, 269, 199, 199, 269, 269, 199, 258, 199, 261, - /* 530 */ 199, 199, 199, 199, 199, 199, 199, 125, 199, 259, - /* 540 */ 269, 260, 132, 199, 199, 130, 257, 118, 137, 199, - /* 550 */ 136, 135, 139, 199, 199, 199, 199, 256, 128, 199, - /* 560 */ 199, 199, 199, 129, 199, 199, 199, 199, 255, 131, - /* 570 */ 199, 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, 199, 114, 200, 200, 200, 200, 200, - /* 610 */ 97, 96, 51, 93, 95, 55, 94, 92, 200, 85, - /* 620 */ 200, 200, 5, 154, 5, 5, 200, 200, 154, 5, - /* 630 */ 5, 206, 210, 210, 101, 100, 143, 206, 121, 116, - /* 640 */ 83, 98, 84, 122, 98, 200, 200, 83, 201, 200, - /* 650 */ 217, 219, 213, 216, 218, 214, 212, 215, 201, 201, - /* 660 */ 200, 237, 201, 200, 221, 200, 202, 84, 83, 207, - /* 670 */ 84, 254, 253, 83, 98, 84, 83, 237, 84, 83, - /* 680 */ 1, 83, 98, 133, 133, 98, 83, 83, 116, 83, - /* 690 */ 117, 79, 71, 88, 87, 5, 88, 87, 9, 5, - /* 700 */ 5, 5, 5, 5, 5, 5, 15, 79, 86, 83, - /* 710 */ 118, 84, 83, 59, 148, 148, 24, 16, 16, 148, - /* 720 */ 5, 98, 148, 5, 84, 5, 5, 5, 5, 5, - /* 730 */ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - /* 740 */ 98, 86, 61, 60, 0, 277, 277, 277, 277, 277, - /* 750 */ 277, 277, 277, 277, 277, 277, 21, 21, 277, 277, - /* 760 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, - /* 770 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, - /* 780 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, - /* 790 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, - /* 800 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, - /* 810 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, - /* 820 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, - /* 830 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, - /* 840 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, - /* 850 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, - /* 860 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, - /* 870 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, - /* 880 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, - /* 890 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, - /* 900 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, - /* 910 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, - /* 920 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, - /* 930 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, - /* 940 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, - /* 950 */ 277, 277, 277, 277, + /* 0 */ 252, 1, 244, 1, 198, 199, 248, 199, 244, 9, + /* 10 */ 205, 9, 248, 13, 14, 199, 16, 17, 270, 199, + /* 20 */ 20, 21, 1, 23, 24, 25, 26, 27, 28, 222, + /* 30 */ 9, 224, 225, 33, 34, 199, 229, 37, 38, 39, + /* 40 */ 233, 199, 235, 236, 196, 197, 246, 45, 46, 47, + /* 50 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + /* 60 */ 58, 59, 262, 243, 62, 13, 14, 247, 16, 17, + /* 70 */ 265, 5, 20, 21, 266, 23, 24, 25, 26, 27, + /* 80 */ 28, 276, 0, 267, 268, 33, 34, 87, 206, 37, + /* 90 */ 38, 39, 13, 14, 246, 16, 17, 265, 83, 20, + /* 100 */ 21, 199, 23, 24, 25, 26, 27, 28, 276, 273, + /* 110 */ 262, 275, 33, 34, 85, 273, 37, 38, 39, 13, + /* 120 */ 14, 244, 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, 262, 23, 24, 25, 26, 27, + /* 160 */ 28, 239, 240, 241, 242, 33, 34, 85, 205, 37, + /* 170 */ 38, 39, 99, 100, 101, 102, 103, 104, 105, 106, + /* 180 */ 107, 108, 109, 110, 111, 112, 113, 222, 223, 224, + /* 190 */ 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + /* 200 */ 235, 236, 16, 17, 44, 265, 20, 21, 143, 23, + /* 210 */ 24, 25, 26, 27, 28, 273, 98, 152, 153, 33, + /* 220 */ 34, 199, 62, 37, 38, 39, 1, 2, 265, 69, + /* 230 */ 5, 209, 7, 79, 9, 75, 76, 77, 78, 276, + /* 240 */ 1, 2, 82, 83, 5, 91, 7, 199, 9, 205, + /* 250 */ 204, 265, 25, 26, 27, 28, 138, 211, 33, 34, + /* 260 */ 33, 34, 37, 204, 37, 38, 39, 63, 64, 65, + /* 270 */ 211, 1, 33, 34, 70, 71, 72, 73, 74, 9, + /* 280 */ 120, 2, 220, 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 */ 276, 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 */ 247, 145, 124, 147, 243, 149, 150, 84, 247, 206, + /* 390 */ 243, 33, 34, 249, 247, 204, 243, 118, 119, 243, + /* 400 */ 247, 98, 211, 247, 243, 117, 84, 263, 247, 37, + /* 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 */ 140, 146, 146, 148, 148, 116, 79, 80, 265, 265, + /* 480 */ 265, 265, 265, 265, 265, 265, 265, 265, 248, 265, + /* 490 */ 248, 248, 115, 265, 265, 265, 199, 238, 238, 238, + /* 500 */ 238, 238, 238, 238, 250, 199, 199, 199, 264, 61, + /* 510 */ 199, 199, 246, 246, 199, 199, 199, 199, 246, 274, + /* 520 */ 274, 269, 199, 199, 269, 269, 199, 258, 199, 261, + /* 530 */ 199, 199, 199, 199, 199, 199, 199, 125, 199, 259, + /* 540 */ 269, 260, 132, 199, 199, 130, 257, 118, 137, 199, + /* 550 */ 136, 135, 139, 199, 199, 199, 199, 256, 128, 199, + /* 560 */ 199, 199, 199, 129, 199, 199, 199, 199, 255, 131, + /* 570 */ 199, 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, 199, 114, 200, 200, 200, 200, 200, + /* 610 */ 97, 96, 51, 93, 95, 55, 94, 92, 200, 85, + /* 620 */ 200, 200, 5, 154, 5, 5, 200, 200, 154, 5, + /* 630 */ 5, 206, 210, 210, 101, 100, 143, 206, 121, 116, + /* 640 */ 83, 98, 84, 122, 98, 200, 200, 83, 201, 200, + /* 650 */ 217, 219, 213, 216, 218, 214, 212, 215, 201, 201, + /* 660 */ 200, 237, 201, 200, 221, 200, 202, 84, 83, 207, + /* 670 */ 84, 254, 253, 83, 98, 84, 83, 237, 84, 83, + /* 680 */ 1, 83, 98, 133, 133, 98, 83, 83, 116, 83, + /* 690 */ 117, 79, 71, 88, 87, 5, 88, 87, 9, 5, + /* 700 */ 5, 5, 5, 5, 5, 5, 15, 79, 86, 83, + /* 710 */ 118, 84, 83, 59, 148, 148, 24, 16, 16, 148, + /* 720 */ 5, 98, 148, 5, 84, 5, 5, 5, 5, 5, + /* 730 */ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + /* 740 */ 98, 86, 61, 60, 0, 277, 277, 277, 277, 277, + /* 750 */ 277, 277, 277, 277, 277, 277, 21, 21, 277, 277, + /* 760 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, + /* 770 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, + /* 780 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, + /* 790 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, + /* 800 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, + /* 810 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, + /* 820 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, + /* 830 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, + /* 840 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, + /* 850 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, + /* 860 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, + /* 870 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, + /* 880 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, + /* 890 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, + /* 900 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, + /* 910 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, + /* 920 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, + /* 930 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, + /* 940 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, + /* 950 */ 277, 277, 277, 277, }; #define YY_SHIFT_COUNT (363) #define YY_SHIFT_MIN (0) #define YY_SHIFT_MAX (744) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 160, 73, 73, 235, 235, 29, 225, 239, 239, 270, - /* 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 */ 154, 29, 51, 51, 66, 758, 758, 758, 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, 358, 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, - /* 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, 21, 448, 448, 448, 412, 412, 412, 412, - /* 160 */ 448, 448, 411, 413, 410, 414, 416, 415, 434, 430, - /* 170 */ 438, 435, 448, 448, 448, 506, 506, 490, 29, 29, - /* 180 */ 448, 448, 513, 515, 561, 520, 519, 560, 522, 525, - /* 190 */ 490, 66, 448, 448, 534, 534, 448, 534, 448, 534, - /* 200 */ 448, 448, 758, 758, 52, 79, 79, 106, 79, 132, - /* 210 */ 186, 204, 227, 227, 227, 227, 226, 253, 328, 328, - /* 220 */ 328, 328, 223, 236, 65, 288, 372, 372, 290, 296, - /* 230 */ 346, 353, 303, 322, 338, 340, 341, 342, 330, 118, - /* 240 */ 343, 347, 348, 349, 351, 359, 352, 364, 428, 369, - /* 250 */ 429, 370, 305, 309, 310, 456, 459, 321, 325, 377, - /* 260 */ 326, 397, 617, 469, 619, 620, 474, 624, 625, 533, - /* 270 */ 535, 493, 517, 523, 557, 521, 558, 564, 543, 546, - /* 280 */ 583, 585, 586, 590, 591, 576, 593, 594, 596, 679, - /* 290 */ 598, 584, 550, 587, 551, 603, 523, 604, 572, 606, - /* 300 */ 573, 612, 605, 607, 621, 690, 608, 610, 689, 694, - /* 310 */ 695, 696, 697, 698, 699, 700, 622, 691, 628, 626, - /* 320 */ 627, 592, 629, 692, 654, 701, 566, 567, 623, 623, - /* 330 */ 623, 623, 702, 571, 574, 623, 623, 623, 715, 718, - /* 340 */ 640, 623, 720, 721, 722, 723, 724, 725, 726, 727, - /* 350 */ 728, 729, 730, 731, 732, 733, 734, 642, 655, 735, - /* 360 */ 736, 681, 683, 744, + /* 0 */ 160, 73, 73, 235, 235, 29, 225, 239, 239, 270, + /* 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 */ 154, 29, 51, 51, 66, 758, 758, 758, 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, 358, 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, + /* 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, 21, 448, 448, 448, 412, 412, 412, 412, + /* 160 */ 448, 448, 411, 413, 410, 414, 416, 415, 434, 430, + /* 170 */ 438, 435, 448, 448, 448, 506, 506, 490, 29, 29, + /* 180 */ 448, 448, 513, 515, 561, 520, 519, 560, 522, 525, + /* 190 */ 490, 66, 448, 448, 534, 534, 448, 534, 448, 534, + /* 200 */ 448, 448, 758, 758, 52, 79, 79, 106, 79, 132, + /* 210 */ 186, 204, 227, 227, 227, 227, 226, 253, 328, 328, + /* 220 */ 328, 328, 223, 236, 65, 288, 372, 372, 290, 296, + /* 230 */ 346, 353, 303, 322, 338, 340, 341, 342, 330, 118, + /* 240 */ 343, 347, 348, 349, 351, 359, 352, 364, 428, 369, + /* 250 */ 429, 370, 305, 309, 310, 456, 459, 321, 325, 377, + /* 260 */ 326, 397, 617, 469, 619, 620, 474, 624, 625, 533, + /* 270 */ 535, 493, 517, 523, 557, 521, 558, 564, 543, 546, + /* 280 */ 583, 585, 586, 590, 591, 576, 593, 594, 596, 679, + /* 290 */ 598, 584, 550, 587, 551, 603, 523, 604, 572, 606, + /* 300 */ 573, 612, 605, 607, 621, 690, 608, 610, 689, 694, + /* 310 */ 695, 696, 697, 698, 699, 700, 622, 691, 628, 626, + /* 320 */ 627, 592, 629, 692, 654, 701, 566, 567, 623, 623, + /* 330 */ 623, 623, 702, 571, 574, 623, 623, 623, 715, 718, + /* 340 */ 640, 623, 720, 721, 722, 723, 724, 725, 726, 727, + /* 350 */ 728, 729, 730, 731, 732, 733, 734, 642, 655, 735, + /* 360 */ 736, 681, 683, 744, }; #define YY_REDUCE_COUNT (203) #define YY_REDUCE_MIN (-252) #define YY_REDUCE_MAX (465) static const short yy_reduce_ofst[] = { - /* 0 */ -152, -35, -35, -193, -193, -78, -195, -37, 44, -184, - /* 10 */ -180, -164, 48, 86, 88, 95, 131, 133, 141, 147, - /* 20 */ 153, 156, 161, -192, -194, -168, -242, -236, -123, -200, - /* 30 */ -108, -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 */ 219, 220, 221, 222, 224, 228, 229, 230, 240, 242, - /* 70 */ 243, 259, 260, 261, 262, 263, 264, 265, 297, 306, - /* 80 */ 307, 244, 308, 311, 312, 266, 267, 315, 316, 317, - /* 90 */ 318, 245, 246, 254, 272, 323, 324, 327, 329, 331, - /* 100 */ 332, 333, 334, 335, 336, 337, 339, 344, 345, 350, - /* 110 */ 354, 355, 356, 357, 360, 361, 362, 363, 365, 366, - /* 120 */ 367, 368, 371, 373, 374, 375, 376, 378, 379, 380, - /* 130 */ 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - /* 140 */ 391, 392, 393, 394, 395, 396, 398, 399, 400, 401, - /* 150 */ 402, 403, 404, 405, 406, 407, 252, 255, 256, 271, - /* 160 */ 408, 409, 268, 281, 280, 269, 289, 301, 313, 417, - /* 170 */ 419, 320, 418, 420, 421, 422, 423, 424, 425, 431, - /* 180 */ 426, 427, 432, 436, 433, 439, 437, 441, 442, 444, - /* 190 */ 440, 443, 445, 446, 447, 457, 449, 458, 460, 461, - /* 200 */ 463, 465, 462, 464, + /* 0 */ -152, -35, -35, -193, -193, -78, -195, -37, 44, -184, + /* 10 */ -180, -164, 48, 86, 88, 95, 131, 133, 141, 147, + /* 20 */ 153, 156, 161, -192, -194, -168, -242, -236, -123, -200, + /* 30 */ -108, -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 */ 219, 220, 221, 222, 224, 228, 229, 230, 240, 242, + /* 70 */ 243, 259, 260, 261, 262, 263, 264, 265, 297, 306, + /* 80 */ 307, 244, 308, 311, 312, 266, 267, 315, 316, 317, + /* 90 */ 318, 245, 246, 254, 272, 323, 324, 327, 329, 331, + /* 100 */ 332, 333, 334, 335, 336, 337, 339, 344, 345, 350, + /* 110 */ 354, 355, 356, 357, 360, 361, 362, 363, 365, 366, + /* 120 */ 367, 368, 371, 373, 374, 375, 376, 378, 379, 380, + /* 130 */ 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, + /* 140 */ 391, 392, 393, 394, 395, 396, 398, 399, 400, 401, + /* 150 */ 402, 403, 404, 405, 406, 407, 252, 255, 256, 271, + /* 160 */ 408, 409, 268, 281, 280, 269, 289, 301, 313, 417, + /* 170 */ 419, 320, 418, 420, 421, 422, 423, 424, 425, 431, + /* 180 */ 426, 427, 432, 436, 433, 439, 437, 441, 442, 444, + /* 190 */ 440, 443, 445, 446, 447, 457, 449, 458, 460, 461, + /* 200 */ 463, 465, 462, 464, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 864, 988, 927, 998, 914, 924, 1137, 1137, 1137, 864, - /* 10 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, - /* 20 */ 864, 864, 864, 1046, 884, 1137, 864, 864, 864, 864, - /* 30 */ 864, 864, 864, 1061, 864, 924, 864, 864, 864, 864, - /* 40 */ 934, 924, 934, 934, 864, 1041, 972, 990, 864, 864, - /* 50 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, - /* 60 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, - /* 70 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, - /* 80 */ 864, 1048, 1054, 1051, 864, 864, 864, 1056, 864, 864, - /* 90 */ 864, 1080, 1080, 1039, 864, 864, 864, 864, 864, 864, - /* 100 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, - /* 110 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, - /* 120 */ 864, 864, 864, 864, 864, 864, 864, 912, 864, 910, - /* 130 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, - /* 140 */ 864, 864, 864, 864, 864, 864, 895, 864, 864, 864, - /* 150 */ 864, 864, 864, 886, 886, 886, 864, 864, 864, 864, - /* 160 */ 886, 886, 1087, 1091, 1073, 1085, 1081, 1068, 1066, 1064, - /* 170 */ 1072, 1095, 886, 886, 886, 932, 932, 928, 924, 924, - /* 180 */ 886, 886, 950, 948, 946, 938, 944, 940, 942, 936, - /* 190 */ 915, 864, 886, 886, 922, 922, 886, 922, 886, 922, - /* 200 */ 886, 886, 972, 990, 864, 1096, 1086, 864, 1136, 1126, - /* 210 */ 1125, 864, 1132, 1124, 1123, 1122, 864, 864, 1118, 1121, - /* 220 */ 1120, 1119, 864, 864, 864, 864, 1128, 1127, 864, 864, - /* 230 */ 864, 864, 864, 864, 864, 864, 864, 864, 1092, 1088, - /* 240 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 1098, - /* 250 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 1000, - /* 260 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, - /* 270 */ 864, 864, 1038, 864, 864, 864, 864, 864, 1050, 1049, - /* 280 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, - /* 290 */ 864, 1082, 864, 1074, 864, 864, 1012, 864, 864, 864, - /* 300 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, - /* 310 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, - /* 320 */ 864, 864, 864, 864, 864, 864, 864, 864, 1155, 1150, - /* 330 */ 1151, 1148, 864, 864, 864, 1147, 1142, 1143, 864, 864, - /* 340 */ 864, 1140, 864, 864, 864, 864, 864, 864, 864, 864, - /* 350 */ 864, 864, 864, 864, 864, 864, 864, 956, 864, 893, - /* 360 */ 891, 864, 882, 864, + /* 0 */ 864, 988, 927, 998, 914, 924, 1137, 1137, 1137, 864, + /* 10 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, + /* 20 */ 864, 864, 864, 1046, 884, 1137, 864, 864, 864, 864, + /* 30 */ 864, 864, 864, 1061, 864, 924, 864, 864, 864, 864, + /* 40 */ 934, 924, 934, 934, 864, 1041, 972, 990, 864, 864, + /* 50 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, + /* 60 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, + /* 70 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, + /* 80 */ 864, 1048, 1054, 1051, 864, 864, 864, 1056, 864, 864, + /* 90 */ 864, 1080, 1080, 1039, 864, 864, 864, 864, 864, 864, + /* 100 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, + /* 110 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, + /* 120 */ 864, 864, 864, 864, 864, 864, 864, 912, 864, 910, + /* 130 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, + /* 140 */ 864, 864, 864, 864, 864, 864, 895, 864, 864, 864, + /* 150 */ 864, 864, 864, 886, 886, 886, 864, 864, 864, 864, + /* 160 */ 886, 886, 1087, 1091, 1073, 1085, 1081, 1068, 1066, 1064, + /* 170 */ 1072, 1095, 886, 886, 886, 932, 932, 928, 924, 924, + /* 180 */ 886, 886, 950, 948, 946, 938, 944, 940, 942, 936, + /* 190 */ 915, 864, 886, 886, 922, 922, 886, 922, 886, 922, + /* 200 */ 886, 886, 972, 990, 864, 1096, 1086, 864, 1136, 1126, + /* 210 */ 1125, 864, 1132, 1124, 1123, 1122, 864, 864, 1118, 1121, + /* 220 */ 1120, 1119, 864, 864, 864, 864, 1128, 1127, 864, 864, + /* 230 */ 864, 864, 864, 864, 864, 864, 864, 864, 1092, 1088, + /* 240 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 1098, + /* 250 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 1000, + /* 260 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, + /* 270 */ 864, 864, 1038, 864, 864, 864, 864, 864, 1050, 1049, + /* 280 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, + /* 290 */ 864, 1082, 864, 1074, 864, 864, 1012, 864, 864, 864, + /* 300 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, + /* 310 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, + /* 320 */ 864, 864, 864, 864, 864, 864, 864, 864, 1155, 1150, + /* 330 */ 1151, 1148, 864, 864, 864, 1147, 1142, 1143, 864, 864, + /* 340 */ 864, 1140, 864, 864, 864, 864, 864, 864, 864, 864, + /* 350 */ 864, 864, 864, 864, 864, 864, 864, 956, 864, 893, + /* 360 */ 891, 864, 882, 864, }; /********** End of lemon-generated parsing tables *****************************/ -/* The next table maps tokens (terminal symbols) into fallback tokens. +/* The next table maps tokens (terminal symbols) into fallback tokens. ** If a construct like the following: -** +** ** %fallback ID X Y Z. ** ** appears in the grammar, then ID becomes a fallback token for X, Y, @@ -950,13 +950,13 @@ struct yyParser { int yyerrcnt; /* Shifts left before out of the error */ #endif ParseARG_SDECL /* A place to hold %extra_argument */ - ParseCTX_SDECL /* A place to hold %extra_context */ + ParseCTX_SDECL /* A place to hold %extra_context */ #if YYSTACKDEPTH<=0 - int yystksz; /* Current side of the stack */ + int yystksz; /* Current side of the stack */ yyStackEntry *yystack; /* The parser's stack */ yyStackEntry yystk0; /* First stack entry */ #else - yyStackEntry yystack[YYSTACKDEPTH]; /* The parser's stack */ + yyStackEntry yystack[YYSTACKDEPTH]; /* The parser's stack */ yyStackEntry *yystackEnd; /* Last entry in the stack */ #endif }; @@ -970,10 +970,10 @@ static char *yyTracePrompt = 0; #endif /* NDEBUG */ #ifndef NDEBUG -/* +/* ** Turn parser tracing on by giving a stream to which to write the trace ** and a prompt to preface each trace message. Tracing is turned off -** by making either argument NULL +** by making either argument NULL ** ** Inputs: **
    @@ -998,583 +998,583 @@ void ParseTrace(FILE *TraceFILE, char *zTracePrompt){ #if defined(YYCOVERAGE) || !defined(NDEBUG) /* For tracing shifts, the names of all terminals and nonterminals ** are required. The following table supplies these names */ -static const char *const yyTokenName[] = { - /* 0 */ "$", - /* 1 */ "ID", - /* 2 */ "BOOL", - /* 3 */ "TINYINT", - /* 4 */ "SMALLINT", - /* 5 */ "INTEGER", - /* 6 */ "BIGINT", - /* 7 */ "FLOAT", - /* 8 */ "DOUBLE", - /* 9 */ "STRING", - /* 10 */ "TIMESTAMP", - /* 11 */ "BINARY", - /* 12 */ "NCHAR", - /* 13 */ "OR", - /* 14 */ "AND", - /* 15 */ "NOT", - /* 16 */ "EQ", - /* 17 */ "NE", - /* 18 */ "ISNULL", - /* 19 */ "NOTNULL", - /* 20 */ "IS", - /* 21 */ "LIKE", - /* 22 */ "GLOB", - /* 23 */ "BETWEEN", - /* 24 */ "IN", - /* 25 */ "GT", - /* 26 */ "GE", - /* 27 */ "LT", - /* 28 */ "LE", - /* 29 */ "BITAND", - /* 30 */ "BITOR", - /* 31 */ "LSHIFT", - /* 32 */ "RSHIFT", - /* 33 */ "PLUS", - /* 34 */ "MINUS", - /* 35 */ "DIVIDE", - /* 36 */ "TIMES", - /* 37 */ "STAR", - /* 38 */ "SLASH", - /* 39 */ "REM", - /* 40 */ "CONCAT", - /* 41 */ "UMINUS", - /* 42 */ "UPLUS", - /* 43 */ "BITNOT", - /* 44 */ "SHOW", - /* 45 */ "DATABASES", - /* 46 */ "TOPICS", - /* 47 */ "FUNCTIONS", - /* 48 */ "MNODES", - /* 49 */ "DNODES", - /* 50 */ "ACCOUNTS", - /* 51 */ "USERS", - /* 52 */ "MODULES", - /* 53 */ "QUERIES", - /* 54 */ "CONNECTIONS", - /* 55 */ "STREAMS", - /* 56 */ "VARIABLES", - /* 57 */ "SCORES", - /* 58 */ "GRANTS", - /* 59 */ "VNODES", - /* 60 */ "IPTOKEN", - /* 61 */ "DOT", - /* 62 */ "CREATE", - /* 63 */ "TABLE", - /* 64 */ "STABLE", - /* 65 */ "DATABASE", - /* 66 */ "TABLES", - /* 67 */ "STABLES", - /* 68 */ "VGROUPS", - /* 69 */ "DROP", - /* 70 */ "TOPIC", - /* 71 */ "FUNCTION", - /* 72 */ "DNODE", - /* 73 */ "USER", - /* 74 */ "ACCOUNT", - /* 75 */ "USE", - /* 76 */ "DESCRIBE", - /* 77 */ "DESC", - /* 78 */ "ALTER", - /* 79 */ "PASS", - /* 80 */ "PRIVILEGE", - /* 81 */ "LOCAL", - /* 82 */ "COMPACT", - /* 83 */ "LP", - /* 84 */ "RP", - /* 85 */ "IF", - /* 86 */ "EXISTS", - /* 87 */ "AS", - /* 88 */ "OUTPUTTYPE", - /* 89 */ "AGGREGATE", - /* 90 */ "BUFSIZE", - /* 91 */ "PPS", - /* 92 */ "TSERIES", - /* 93 */ "DBS", - /* 94 */ "STORAGE", - /* 95 */ "QTIME", - /* 96 */ "CONNS", - /* 97 */ "STATE", - /* 98 */ "COMMA", - /* 99 */ "KEEP", - /* 100 */ "CACHE", - /* 101 */ "REPLICA", - /* 102 */ "QUORUM", - /* 103 */ "DAYS", - /* 104 */ "MINROWS", - /* 105 */ "MAXROWS", - /* 106 */ "BLOCKS", - /* 107 */ "CTIME", - /* 108 */ "WAL", - /* 109 */ "FSYNC", - /* 110 */ "COMP", - /* 111 */ "PRECISION", - /* 112 */ "UPDATE", - /* 113 */ "CACHELAST", - /* 114 */ "PARTITIONS", - /* 115 */ "UNSIGNED", - /* 116 */ "TAGS", - /* 117 */ "USING", - /* 118 */ "NULL", - /* 119 */ "NOW", - /* 120 */ "SELECT", - /* 121 */ "UNION", - /* 122 */ "ALL", - /* 123 */ "DISTINCT", - /* 124 */ "FROM", - /* 125 */ "VARIABLE", - /* 126 */ "INTERVAL", - /* 127 */ "EVERY", - /* 128 */ "SESSION", - /* 129 */ "STATE_WINDOW", - /* 130 */ "FILL", - /* 131 */ "SLIDING", - /* 132 */ "ORDER", - /* 133 */ "BY", - /* 134 */ "ASC", - /* 135 */ "GROUP", - /* 136 */ "HAVING", - /* 137 */ "LIMIT", - /* 138 */ "OFFSET", - /* 139 */ "SLIMIT", - /* 140 */ "SOFFSET", - /* 141 */ "WHERE", - /* 142 */ "RESET", - /* 143 */ "QUERY", - /* 144 */ "SYNCDB", - /* 145 */ "ADD", - /* 146 */ "COLUMN", - /* 147 */ "MODIFY", - /* 148 */ "TAG", - /* 149 */ "CHANGE", - /* 150 */ "SET", - /* 151 */ "KILL", - /* 152 */ "CONNECTION", - /* 153 */ "STREAM", - /* 154 */ "COLON", - /* 155 */ "ABORT", - /* 156 */ "AFTER", - /* 157 */ "ATTACH", - /* 158 */ "BEFORE", - /* 159 */ "BEGIN", - /* 160 */ "CASCADE", - /* 161 */ "CLUSTER", - /* 162 */ "CONFLICT", - /* 163 */ "COPY", - /* 164 */ "DEFERRED", - /* 165 */ "DELIMITERS", - /* 166 */ "DETACH", - /* 167 */ "EACH", - /* 168 */ "END", - /* 169 */ "EXPLAIN", - /* 170 */ "FAIL", - /* 171 */ "FOR", - /* 172 */ "IGNORE", - /* 173 */ "IMMEDIATE", - /* 174 */ "INITIALLY", - /* 175 */ "INSTEAD", - /* 176 */ "MATCH", - /* 177 */ "KEY", - /* 178 */ "OF", - /* 179 */ "RAISE", - /* 180 */ "REPLACE", - /* 181 */ "RESTRICT", - /* 182 */ "ROW", - /* 183 */ "STATEMENT", - /* 184 */ "TRIGGER", - /* 185 */ "VIEW", - /* 186 */ "SEMI", - /* 187 */ "NONE", - /* 188 */ "PREV", - /* 189 */ "LINEAR", - /* 190 */ "IMPORT", - /* 191 */ "TBNAME", - /* 192 */ "JOIN", - /* 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", +static const char *const yyTokenName[] = { + /* 0 */ "$", + /* 1 */ "ID", + /* 2 */ "BOOL", + /* 3 */ "TINYINT", + /* 4 */ "SMALLINT", + /* 5 */ "INTEGER", + /* 6 */ "BIGINT", + /* 7 */ "FLOAT", + /* 8 */ "DOUBLE", + /* 9 */ "STRING", + /* 10 */ "TIMESTAMP", + /* 11 */ "BINARY", + /* 12 */ "NCHAR", + /* 13 */ "OR", + /* 14 */ "AND", + /* 15 */ "NOT", + /* 16 */ "EQ", + /* 17 */ "NE", + /* 18 */ "ISNULL", + /* 19 */ "NOTNULL", + /* 20 */ "IS", + /* 21 */ "LIKE", + /* 22 */ "GLOB", + /* 23 */ "BETWEEN", + /* 24 */ "IN", + /* 25 */ "GT", + /* 26 */ "GE", + /* 27 */ "LT", + /* 28 */ "LE", + /* 29 */ "BITAND", + /* 30 */ "BITOR", + /* 31 */ "LSHIFT", + /* 32 */ "RSHIFT", + /* 33 */ "PLUS", + /* 34 */ "MINUS", + /* 35 */ "DIVIDE", + /* 36 */ "TIMES", + /* 37 */ "STAR", + /* 38 */ "SLASH", + /* 39 */ "REM", + /* 40 */ "CONCAT", + /* 41 */ "UMINUS", + /* 42 */ "UPLUS", + /* 43 */ "BITNOT", + /* 44 */ "SHOW", + /* 45 */ "DATABASES", + /* 46 */ "TOPICS", + /* 47 */ "FUNCTIONS", + /* 48 */ "MNODES", + /* 49 */ "DNODES", + /* 50 */ "ACCOUNTS", + /* 51 */ "USERS", + /* 52 */ "MODULES", + /* 53 */ "QUERIES", + /* 54 */ "CONNECTIONS", + /* 55 */ "STREAMS", + /* 56 */ "VARIABLES", + /* 57 */ "SCORES", + /* 58 */ "GRANTS", + /* 59 */ "VNODES", + /* 60 */ "IPTOKEN", + /* 61 */ "DOT", + /* 62 */ "CREATE", + /* 63 */ "TABLE", + /* 64 */ "STABLE", + /* 65 */ "DATABASE", + /* 66 */ "TABLES", + /* 67 */ "STABLES", + /* 68 */ "VGROUPS", + /* 69 */ "DROP", + /* 70 */ "TOPIC", + /* 71 */ "FUNCTION", + /* 72 */ "DNODE", + /* 73 */ "USER", + /* 74 */ "ACCOUNT", + /* 75 */ "USE", + /* 76 */ "DESCRIBE", + /* 77 */ "DESC", + /* 78 */ "ALTER", + /* 79 */ "PASS", + /* 80 */ "PRIVILEGE", + /* 81 */ "LOCAL", + /* 82 */ "COMPACT", + /* 83 */ "LP", + /* 84 */ "RP", + /* 85 */ "IF", + /* 86 */ "EXISTS", + /* 87 */ "AS", + /* 88 */ "OUTPUTTYPE", + /* 89 */ "AGGREGATE", + /* 90 */ "BUFSIZE", + /* 91 */ "PPS", + /* 92 */ "TSERIES", + /* 93 */ "DBS", + /* 94 */ "STORAGE", + /* 95 */ "QTIME", + /* 96 */ "CONNS", + /* 97 */ "STATE", + /* 98 */ "COMMA", + /* 99 */ "KEEP", + /* 100 */ "CACHE", + /* 101 */ "REPLICA", + /* 102 */ "QUORUM", + /* 103 */ "DAYS", + /* 104 */ "MINROWS", + /* 105 */ "MAXROWS", + /* 106 */ "BLOCKS", + /* 107 */ "CTIME", + /* 108 */ "WAL", + /* 109 */ "FSYNC", + /* 110 */ "COMP", + /* 111 */ "PRECISION", + /* 112 */ "UPDATE", + /* 113 */ "CACHELAST", + /* 114 */ "PARTITIONS", + /* 115 */ "UNSIGNED", + /* 116 */ "TAGS", + /* 117 */ "USING", + /* 118 */ "NULL", + /* 119 */ "NOW", + /* 120 */ "SELECT", + /* 121 */ "UNION", + /* 122 */ "ALL", + /* 123 */ "DISTINCT", + /* 124 */ "FROM", + /* 125 */ "VARIABLE", + /* 126 */ "INTERVAL", + /* 127 */ "EVERY", + /* 128 */ "SESSION", + /* 129 */ "STATE_WINDOW", + /* 130 */ "FILL", + /* 131 */ "SLIDING", + /* 132 */ "ORDER", + /* 133 */ "BY", + /* 134 */ "ASC", + /* 135 */ "GROUP", + /* 136 */ "HAVING", + /* 137 */ "LIMIT", + /* 138 */ "OFFSET", + /* 139 */ "SLIMIT", + /* 140 */ "SOFFSET", + /* 141 */ "WHERE", + /* 142 */ "RESET", + /* 143 */ "QUERY", + /* 144 */ "SYNCDB", + /* 145 */ "ADD", + /* 146 */ "COLUMN", + /* 147 */ "MODIFY", + /* 148 */ "TAG", + /* 149 */ "CHANGE", + /* 150 */ "SET", + /* 151 */ "KILL", + /* 152 */ "CONNECTION", + /* 153 */ "STREAM", + /* 154 */ "COLON", + /* 155 */ "ABORT", + /* 156 */ "AFTER", + /* 157 */ "ATTACH", + /* 158 */ "BEFORE", + /* 159 */ "BEGIN", + /* 160 */ "CASCADE", + /* 161 */ "CLUSTER", + /* 162 */ "CONFLICT", + /* 163 */ "COPY", + /* 164 */ "DEFERRED", + /* 165 */ "DELIMITERS", + /* 166 */ "DETACH", + /* 167 */ "EACH", + /* 168 */ "END", + /* 169 */ "EXPLAIN", + /* 170 */ "FAIL", + /* 171 */ "FOR", + /* 172 */ "IGNORE", + /* 173 */ "IMMEDIATE", + /* 174 */ "INITIALLY", + /* 175 */ "INSTEAD", + /* 176 */ "MATCH", + /* 177 */ "KEY", + /* 178 */ "OF", + /* 179 */ "RAISE", + /* 180 */ "REPLACE", + /* 181 */ "RESTRICT", + /* 182 */ "ROW", + /* 183 */ "STATEMENT", + /* 184 */ "TRIGGER", + /* 185 */ "VIEW", + /* 186 */ "SEMI", + /* 187 */ "NONE", + /* 188 */ "PREV", + /* 189 */ "LINEAR", + /* 190 */ "IMPORT", + /* 191 */ "TBNAME", + /* 192 */ "JOIN", + /* 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", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ #ifndef NDEBUG /* For tracing reduce actions, the names of all rules are required. -*/ + */ static const char *const yyRuleName[] = { - /* 0 */ "program ::= cmd", - /* 1 */ "cmd ::= SHOW DATABASES", - /* 2 */ "cmd ::= SHOW TOPICS", - /* 3 */ "cmd ::= SHOW FUNCTIONS", - /* 4 */ "cmd ::= SHOW MNODES", - /* 5 */ "cmd ::= SHOW DNODES", - /* 6 */ "cmd ::= SHOW ACCOUNTS", - /* 7 */ "cmd ::= SHOW USERS", - /* 8 */ "cmd ::= SHOW MODULES", - /* 9 */ "cmd ::= SHOW QUERIES", - /* 10 */ "cmd ::= SHOW CONNECTIONS", - /* 11 */ "cmd ::= SHOW STREAMS", - /* 12 */ "cmd ::= SHOW VARIABLES", - /* 13 */ "cmd ::= SHOW SCORES", - /* 14 */ "cmd ::= SHOW GRANTS", - /* 15 */ "cmd ::= SHOW VNODES", - /* 16 */ "cmd ::= SHOW VNODES IPTOKEN", - /* 17 */ "dbPrefix ::=", - /* 18 */ "dbPrefix ::= ids DOT", - /* 19 */ "cpxName ::=", - /* 20 */ "cpxName ::= DOT ids", - /* 21 */ "cmd ::= SHOW CREATE TABLE ids cpxName", - /* 22 */ "cmd ::= SHOW CREATE STABLE ids cpxName", - /* 23 */ "cmd ::= SHOW CREATE DATABASE ids", - /* 24 */ "cmd ::= SHOW dbPrefix TABLES", - /* 25 */ "cmd ::= SHOW dbPrefix TABLES LIKE ids", - /* 26 */ "cmd ::= SHOW dbPrefix STABLES", - /* 27 */ "cmd ::= SHOW dbPrefix STABLES LIKE ids", - /* 28 */ "cmd ::= SHOW dbPrefix VGROUPS", - /* 29 */ "cmd ::= SHOW dbPrefix VGROUPS ids", - /* 30 */ "cmd ::= DROP TABLE ifexists ids cpxName", - /* 31 */ "cmd ::= DROP STABLE ifexists ids cpxName", - /* 32 */ "cmd ::= DROP DATABASE ifexists ids", - /* 33 */ "cmd ::= DROP TOPIC ifexists ids", - /* 34 */ "cmd ::= DROP FUNCTION ids", - /* 35 */ "cmd ::= DROP DNODE ids", - /* 36 */ "cmd ::= DROP USER ids", - /* 37 */ "cmd ::= DROP ACCOUNT ids", - /* 38 */ "cmd ::= USE ids", - /* 39 */ "cmd ::= DESCRIBE ids cpxName", - /* 40 */ "cmd ::= DESC ids cpxName", - /* 41 */ "cmd ::= ALTER USER ids PASS ids", - /* 42 */ "cmd ::= ALTER USER ids PRIVILEGE ids", - /* 43 */ "cmd ::= ALTER DNODE ids ids", - /* 44 */ "cmd ::= ALTER DNODE ids ids ids", - /* 45 */ "cmd ::= ALTER LOCAL ids", - /* 46 */ "cmd ::= ALTER LOCAL ids ids", - /* 47 */ "cmd ::= ALTER DATABASE ids alter_db_optr", - /* 48 */ "cmd ::= ALTER TOPIC ids alter_topic_optr", - /* 49 */ "cmd ::= ALTER ACCOUNT ids acct_optr", - /* 50 */ "cmd ::= ALTER ACCOUNT ids PASS ids acct_optr", - /* 51 */ "cmd ::= COMPACT VNODES IN LP exprlist RP", - /* 52 */ "ids ::= ID", - /* 53 */ "ids ::= STRING", - /* 54 */ "ifexists ::= IF EXISTS", - /* 55 */ "ifexists ::=", - /* 56 */ "ifnotexists ::= IF NOT EXISTS", - /* 57 */ "ifnotexists ::=", - /* 58 */ "cmd ::= CREATE DNODE ids", - /* 59 */ "cmd ::= CREATE ACCOUNT ids PASS ids acct_optr", - /* 60 */ "cmd ::= CREATE DATABASE ifnotexists ids db_optr", - /* 61 */ "cmd ::= CREATE TOPIC ifnotexists ids topic_optr", - /* 62 */ "cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize", - /* 63 */ "cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize", - /* 64 */ "cmd ::= CREATE USER ids PASS ids", - /* 65 */ "bufsize ::=", - /* 66 */ "bufsize ::= BUFSIZE INTEGER", - /* 67 */ "pps ::=", - /* 68 */ "pps ::= PPS INTEGER", - /* 69 */ "tseries ::=", - /* 70 */ "tseries ::= TSERIES INTEGER", - /* 71 */ "dbs ::=", - /* 72 */ "dbs ::= DBS INTEGER", - /* 73 */ "streams ::=", - /* 74 */ "streams ::= STREAMS INTEGER", - /* 75 */ "storage ::=", - /* 76 */ "storage ::= STORAGE INTEGER", - /* 77 */ "qtime ::=", - /* 78 */ "qtime ::= QTIME INTEGER", - /* 79 */ "users ::=", - /* 80 */ "users ::= USERS INTEGER", - /* 81 */ "conns ::=", - /* 82 */ "conns ::= CONNS INTEGER", - /* 83 */ "state ::=", - /* 84 */ "state ::= STATE ids", - /* 85 */ "acct_optr ::= pps tseries storage streams qtime dbs users conns state", - /* 86 */ "intitemlist ::= intitemlist COMMA intitem", - /* 87 */ "intitemlist ::= intitem", - /* 88 */ "intitem ::= INTEGER", - /* 89 */ "keep ::= KEEP intitemlist", - /* 90 */ "cache ::= CACHE INTEGER", - /* 91 */ "replica ::= REPLICA INTEGER", - /* 92 */ "quorum ::= QUORUM INTEGER", - /* 93 */ "days ::= DAYS INTEGER", - /* 94 */ "minrows ::= MINROWS INTEGER", - /* 95 */ "maxrows ::= MAXROWS INTEGER", - /* 96 */ "blocks ::= BLOCKS INTEGER", - /* 97 */ "ctime ::= CTIME INTEGER", - /* 98 */ "wal ::= WAL INTEGER", - /* 99 */ "fsync ::= FSYNC INTEGER", - /* 100 */ "comp ::= COMP INTEGER", - /* 101 */ "prec ::= PRECISION STRING", - /* 102 */ "update ::= UPDATE INTEGER", - /* 103 */ "cachelast ::= CACHELAST INTEGER", - /* 104 */ "partitions ::= PARTITIONS INTEGER", - /* 105 */ "db_optr ::=", - /* 106 */ "db_optr ::= db_optr cache", - /* 107 */ "db_optr ::= db_optr replica", - /* 108 */ "db_optr ::= db_optr quorum", - /* 109 */ "db_optr ::= db_optr days", - /* 110 */ "db_optr ::= db_optr minrows", - /* 111 */ "db_optr ::= db_optr maxrows", - /* 112 */ "db_optr ::= db_optr blocks", - /* 113 */ "db_optr ::= db_optr ctime", - /* 114 */ "db_optr ::= db_optr wal", - /* 115 */ "db_optr ::= db_optr fsync", - /* 116 */ "db_optr ::= db_optr comp", - /* 117 */ "db_optr ::= db_optr prec", - /* 118 */ "db_optr ::= db_optr keep", - /* 119 */ "db_optr ::= db_optr update", - /* 120 */ "db_optr ::= db_optr cachelast", - /* 121 */ "topic_optr ::= db_optr", - /* 122 */ "topic_optr ::= topic_optr partitions", - /* 123 */ "alter_db_optr ::=", - /* 124 */ "alter_db_optr ::= alter_db_optr replica", - /* 125 */ "alter_db_optr ::= alter_db_optr quorum", - /* 126 */ "alter_db_optr ::= alter_db_optr keep", - /* 127 */ "alter_db_optr ::= alter_db_optr blocks", - /* 128 */ "alter_db_optr ::= alter_db_optr comp", - /* 129 */ "alter_db_optr ::= alter_db_optr update", - /* 130 */ "alter_db_optr ::= alter_db_optr cachelast", - /* 131 */ "alter_topic_optr ::= alter_db_optr", - /* 132 */ "alter_topic_optr ::= alter_topic_optr partitions", - /* 133 */ "typename ::= ids", - /* 134 */ "typename ::= ids LP signed RP", - /* 135 */ "typename ::= ids UNSIGNED", - /* 136 */ "signed ::= INTEGER", - /* 137 */ "signed ::= PLUS INTEGER", - /* 138 */ "signed ::= MINUS INTEGER", - /* 139 */ "cmd ::= CREATE TABLE create_table_args", - /* 140 */ "cmd ::= CREATE TABLE create_stable_args", - /* 141 */ "cmd ::= CREATE STABLE create_stable_args", - /* 142 */ "cmd ::= CREATE TABLE create_table_list", - /* 143 */ "create_table_list ::= create_from_stable", - /* 144 */ "create_table_list ::= create_table_list create_from_stable", - /* 145 */ "create_table_args ::= ifnotexists ids cpxName LP columnlist RP", - /* 146 */ "create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP", - /* 147 */ "create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP", - /* 148 */ "create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP", - /* 149 */ "tagNamelist ::= tagNamelist COMMA ids", - /* 150 */ "tagNamelist ::= ids", - /* 151 */ "create_table_args ::= ifnotexists ids cpxName AS select", - /* 152 */ "columnlist ::= columnlist COMMA column", - /* 153 */ "columnlist ::= column", - /* 154 */ "column ::= ids typename", - /* 155 */ "tagitemlist ::= tagitemlist COMMA tagitem", - /* 156 */ "tagitemlist ::= tagitem", - /* 157 */ "tagitem ::= INTEGER", - /* 158 */ "tagitem ::= FLOAT", - /* 159 */ "tagitem ::= STRING", - /* 160 */ "tagitem ::= BOOL", - /* 161 */ "tagitem ::= NULL", - /* 162 */ "tagitem ::= NOW", - /* 163 */ "tagitem ::= MINUS INTEGER", - /* 164 */ "tagitem ::= MINUS FLOAT", - /* 165 */ "tagitem ::= PLUS INTEGER", - /* 166 */ "tagitem ::= PLUS FLOAT", - /* 167 */ "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", - /* 168 */ "select ::= LP select RP", - /* 169 */ "union ::= select", - /* 170 */ "union ::= union UNION ALL select", - /* 171 */ "cmd ::= union", - /* 172 */ "select ::= SELECT selcollist", - /* 173 */ "sclp ::= selcollist COMMA", - /* 174 */ "sclp ::=", - /* 175 */ "selcollist ::= sclp distinct expr as", - /* 176 */ "selcollist ::= sclp STAR", - /* 177 */ "as ::= AS ids", - /* 178 */ "as ::= ids", - /* 179 */ "as ::=", - /* 180 */ "distinct ::= DISTINCT", - /* 181 */ "distinct ::=", - /* 182 */ "from ::= FROM tablelist", - /* 183 */ "from ::= FROM sub", - /* 184 */ "sub ::= LP union RP", - /* 185 */ "sub ::= LP union RP ids", - /* 186 */ "sub ::= sub COMMA LP union RP ids", - /* 187 */ "tablelist ::= ids cpxName", - /* 188 */ "tablelist ::= ids cpxName ids", - /* 189 */ "tablelist ::= tablelist COMMA ids cpxName", - /* 190 */ "tablelist ::= tablelist COMMA ids cpxName ids", - /* 191 */ "tmvar ::= VARIABLE", - /* 192 */ "interval_option ::= intervalKey LP tmvar RP", - /* 193 */ "interval_option ::= intervalKey LP tmvar COMMA tmvar RP", - /* 194 */ "interval_option ::=", - /* 195 */ "intervalKey ::= INTERVAL", - /* 196 */ "intervalKey ::= EVERY", - /* 197 */ "session_option ::=", - /* 198 */ "session_option ::= SESSION LP ids cpxName COMMA tmvar RP", - /* 199 */ "windowstate_option ::=", - /* 200 */ "windowstate_option ::= STATE_WINDOW LP ids RP", - /* 201 */ "fill_opt ::=", - /* 202 */ "fill_opt ::= FILL LP ID COMMA tagitemlist RP", - /* 203 */ "fill_opt ::= FILL LP ID RP", - /* 204 */ "sliding_opt ::= SLIDING LP tmvar RP", - /* 205 */ "sliding_opt ::=", - /* 206 */ "orderby_opt ::=", - /* 207 */ "orderby_opt ::= ORDER BY sortlist", - /* 208 */ "sortlist ::= sortlist COMMA item sortorder", - /* 209 */ "sortlist ::= item sortorder", - /* 210 */ "item ::= ids cpxName", - /* 211 */ "sortorder ::= ASC", - /* 212 */ "sortorder ::= DESC", - /* 213 */ "sortorder ::=", - /* 214 */ "groupby_opt ::=", - /* 215 */ "groupby_opt ::= GROUP BY grouplist", - /* 216 */ "grouplist ::= grouplist COMMA item", - /* 217 */ "grouplist ::= item", - /* 218 */ "having_opt ::=", - /* 219 */ "having_opt ::= HAVING expr", - /* 220 */ "limit_opt ::=", - /* 221 */ "limit_opt ::= LIMIT signed", - /* 222 */ "limit_opt ::= LIMIT signed OFFSET signed", - /* 223 */ "limit_opt ::= LIMIT signed COMMA signed", - /* 224 */ "slimit_opt ::=", - /* 225 */ "slimit_opt ::= SLIMIT signed", - /* 226 */ "slimit_opt ::= SLIMIT signed SOFFSET signed", - /* 227 */ "slimit_opt ::= SLIMIT signed COMMA signed", - /* 228 */ "where_opt ::=", - /* 229 */ "where_opt ::= WHERE expr", - /* 230 */ "expr ::= LP expr RP", - /* 231 */ "expr ::= ID", - /* 232 */ "expr ::= ID DOT ID", - /* 233 */ "expr ::= ID DOT STAR", - /* 234 */ "expr ::= INTEGER", - /* 235 */ "expr ::= MINUS INTEGER", - /* 236 */ "expr ::= PLUS INTEGER", - /* 237 */ "expr ::= FLOAT", - /* 238 */ "expr ::= MINUS FLOAT", - /* 239 */ "expr ::= PLUS FLOAT", - /* 240 */ "expr ::= STRING", - /* 241 */ "expr ::= NOW", - /* 242 */ "expr ::= VARIABLE", - /* 243 */ "expr ::= PLUS VARIABLE", - /* 244 */ "expr ::= MINUS VARIABLE", - /* 245 */ "expr ::= BOOL", - /* 246 */ "expr ::= NULL", - /* 247 */ "expr ::= ID LP exprlist RP", - /* 248 */ "expr ::= ID LP STAR RP", - /* 249 */ "expr ::= expr IS NULL", - /* 250 */ "expr ::= expr IS NOT NULL", - /* 251 */ "expr ::= expr LT expr", - /* 252 */ "expr ::= expr GT expr", - /* 253 */ "expr ::= expr LE expr", - /* 254 */ "expr ::= expr GE expr", - /* 255 */ "expr ::= expr NE expr", - /* 256 */ "expr ::= expr EQ expr", - /* 257 */ "expr ::= expr BETWEEN expr AND expr", - /* 258 */ "expr ::= expr AND expr", - /* 259 */ "expr ::= expr OR expr", - /* 260 */ "expr ::= expr PLUS expr", - /* 261 */ "expr ::= expr MINUS expr", - /* 262 */ "expr ::= expr STAR expr", - /* 263 */ "expr ::= expr SLASH expr", - /* 264 */ "expr ::= expr REM expr", - /* 265 */ "expr ::= expr LIKE expr", - /* 266 */ "expr ::= expr IN LP exprlist RP", - /* 267 */ "exprlist ::= exprlist COMMA expritem", - /* 268 */ "exprlist ::= expritem", - /* 269 */ "expritem ::= expr", - /* 270 */ "expritem ::=", - /* 271 */ "cmd ::= RESET QUERY CACHE", - /* 272 */ "cmd ::= SYNCDB ids REPLICA", - /* 273 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist", - /* 274 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids", - /* 275 */ "cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist", - /* 276 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist", - /* 277 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids", - /* 278 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids", - /* 279 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem", - /* 280 */ "cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist", - /* 281 */ "cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist", - /* 282 */ "cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids", - /* 283 */ "cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist", - /* 284 */ "cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist", - /* 285 */ "cmd ::= ALTER STABLE ids cpxName DROP TAG ids", - /* 286 */ "cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids", - /* 287 */ "cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem", - /* 288 */ "cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist", - /* 289 */ "cmd ::= KILL CONNECTION INTEGER", - /* 290 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER", - /* 291 */ "cmd ::= KILL QUERY INTEGER COLON INTEGER", + /* 0 */ "program ::= cmd", + /* 1 */ "cmd ::= SHOW DATABASES", + /* 2 */ "cmd ::= SHOW TOPICS", + /* 3 */ "cmd ::= SHOW FUNCTIONS", + /* 4 */ "cmd ::= SHOW MNODES", + /* 5 */ "cmd ::= SHOW DNODES", + /* 6 */ "cmd ::= SHOW ACCOUNTS", + /* 7 */ "cmd ::= SHOW USERS", + /* 8 */ "cmd ::= SHOW MODULES", + /* 9 */ "cmd ::= SHOW QUERIES", + /* 10 */ "cmd ::= SHOW CONNECTIONS", + /* 11 */ "cmd ::= SHOW STREAMS", + /* 12 */ "cmd ::= SHOW VARIABLES", + /* 13 */ "cmd ::= SHOW SCORES", + /* 14 */ "cmd ::= SHOW GRANTS", + /* 15 */ "cmd ::= SHOW VNODES", + /* 16 */ "cmd ::= SHOW VNODES IPTOKEN", + /* 17 */ "dbPrefix ::=", + /* 18 */ "dbPrefix ::= ids DOT", + /* 19 */ "cpxName ::=", + /* 20 */ "cpxName ::= DOT ids", + /* 21 */ "cmd ::= SHOW CREATE TABLE ids cpxName", + /* 22 */ "cmd ::= SHOW CREATE STABLE ids cpxName", + /* 23 */ "cmd ::= SHOW CREATE DATABASE ids", + /* 24 */ "cmd ::= SHOW dbPrefix TABLES", + /* 25 */ "cmd ::= SHOW dbPrefix TABLES LIKE ids", + /* 26 */ "cmd ::= SHOW dbPrefix STABLES", + /* 27 */ "cmd ::= SHOW dbPrefix STABLES LIKE ids", + /* 28 */ "cmd ::= SHOW dbPrefix VGROUPS", + /* 29 */ "cmd ::= SHOW dbPrefix VGROUPS ids", + /* 30 */ "cmd ::= DROP TABLE ifexists ids cpxName", + /* 31 */ "cmd ::= DROP STABLE ifexists ids cpxName", + /* 32 */ "cmd ::= DROP DATABASE ifexists ids", + /* 33 */ "cmd ::= DROP TOPIC ifexists ids", + /* 34 */ "cmd ::= DROP FUNCTION ids", + /* 35 */ "cmd ::= DROP DNODE ids", + /* 36 */ "cmd ::= DROP USER ids", + /* 37 */ "cmd ::= DROP ACCOUNT ids", + /* 38 */ "cmd ::= USE ids", + /* 39 */ "cmd ::= DESCRIBE ids cpxName", + /* 40 */ "cmd ::= DESC ids cpxName", + /* 41 */ "cmd ::= ALTER USER ids PASS ids", + /* 42 */ "cmd ::= ALTER USER ids PRIVILEGE ids", + /* 43 */ "cmd ::= ALTER DNODE ids ids", + /* 44 */ "cmd ::= ALTER DNODE ids ids ids", + /* 45 */ "cmd ::= ALTER LOCAL ids", + /* 46 */ "cmd ::= ALTER LOCAL ids ids", + /* 47 */ "cmd ::= ALTER DATABASE ids alter_db_optr", + /* 48 */ "cmd ::= ALTER TOPIC ids alter_topic_optr", + /* 49 */ "cmd ::= ALTER ACCOUNT ids acct_optr", + /* 50 */ "cmd ::= ALTER ACCOUNT ids PASS ids acct_optr", + /* 51 */ "cmd ::= COMPACT VNODES IN LP exprlist RP", + /* 52 */ "ids ::= ID", + /* 53 */ "ids ::= STRING", + /* 54 */ "ifexists ::= IF EXISTS", + /* 55 */ "ifexists ::=", + /* 56 */ "ifnotexists ::= IF NOT EXISTS", + /* 57 */ "ifnotexists ::=", + /* 58 */ "cmd ::= CREATE DNODE ids", + /* 59 */ "cmd ::= CREATE ACCOUNT ids PASS ids acct_optr", + /* 60 */ "cmd ::= CREATE DATABASE ifnotexists ids db_optr", + /* 61 */ "cmd ::= CREATE TOPIC ifnotexists ids topic_optr", + /* 62 */ "cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize", + /* 63 */ "cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize", + /* 64 */ "cmd ::= CREATE USER ids PASS ids", + /* 65 */ "bufsize ::=", + /* 66 */ "bufsize ::= BUFSIZE INTEGER", + /* 67 */ "pps ::=", + /* 68 */ "pps ::= PPS INTEGER", + /* 69 */ "tseries ::=", + /* 70 */ "tseries ::= TSERIES INTEGER", + /* 71 */ "dbs ::=", + /* 72 */ "dbs ::= DBS INTEGER", + /* 73 */ "streams ::=", + /* 74 */ "streams ::= STREAMS INTEGER", + /* 75 */ "storage ::=", + /* 76 */ "storage ::= STORAGE INTEGER", + /* 77 */ "qtime ::=", + /* 78 */ "qtime ::= QTIME INTEGER", + /* 79 */ "users ::=", + /* 80 */ "users ::= USERS INTEGER", + /* 81 */ "conns ::=", + /* 82 */ "conns ::= CONNS INTEGER", + /* 83 */ "state ::=", + /* 84 */ "state ::= STATE ids", + /* 85 */ "acct_optr ::= pps tseries storage streams qtime dbs users conns state", + /* 86 */ "intitemlist ::= intitemlist COMMA intitem", + /* 87 */ "intitemlist ::= intitem", + /* 88 */ "intitem ::= INTEGER", + /* 89 */ "keep ::= KEEP intitemlist", + /* 90 */ "cache ::= CACHE INTEGER", + /* 91 */ "replica ::= REPLICA INTEGER", + /* 92 */ "quorum ::= QUORUM INTEGER", + /* 93 */ "days ::= DAYS INTEGER", + /* 94 */ "minrows ::= MINROWS INTEGER", + /* 95 */ "maxrows ::= MAXROWS INTEGER", + /* 96 */ "blocks ::= BLOCKS INTEGER", + /* 97 */ "ctime ::= CTIME INTEGER", + /* 98 */ "wal ::= WAL INTEGER", + /* 99 */ "fsync ::= FSYNC INTEGER", + /* 100 */ "comp ::= COMP INTEGER", + /* 101 */ "prec ::= PRECISION STRING", + /* 102 */ "update ::= UPDATE INTEGER", + /* 103 */ "cachelast ::= CACHELAST INTEGER", + /* 104 */ "partitions ::= PARTITIONS INTEGER", + /* 105 */ "db_optr ::=", + /* 106 */ "db_optr ::= db_optr cache", + /* 107 */ "db_optr ::= db_optr replica", + /* 108 */ "db_optr ::= db_optr quorum", + /* 109 */ "db_optr ::= db_optr days", + /* 110 */ "db_optr ::= db_optr minrows", + /* 111 */ "db_optr ::= db_optr maxrows", + /* 112 */ "db_optr ::= db_optr blocks", + /* 113 */ "db_optr ::= db_optr ctime", + /* 114 */ "db_optr ::= db_optr wal", + /* 115 */ "db_optr ::= db_optr fsync", + /* 116 */ "db_optr ::= db_optr comp", + /* 117 */ "db_optr ::= db_optr prec", + /* 118 */ "db_optr ::= db_optr keep", + /* 119 */ "db_optr ::= db_optr update", + /* 120 */ "db_optr ::= db_optr cachelast", + /* 121 */ "topic_optr ::= db_optr", + /* 122 */ "topic_optr ::= topic_optr partitions", + /* 123 */ "alter_db_optr ::=", + /* 124 */ "alter_db_optr ::= alter_db_optr replica", + /* 125 */ "alter_db_optr ::= alter_db_optr quorum", + /* 126 */ "alter_db_optr ::= alter_db_optr keep", + /* 127 */ "alter_db_optr ::= alter_db_optr blocks", + /* 128 */ "alter_db_optr ::= alter_db_optr comp", + /* 129 */ "alter_db_optr ::= alter_db_optr update", + /* 130 */ "alter_db_optr ::= alter_db_optr cachelast", + /* 131 */ "alter_topic_optr ::= alter_db_optr", + /* 132 */ "alter_topic_optr ::= alter_topic_optr partitions", + /* 133 */ "typename ::= ids", + /* 134 */ "typename ::= ids LP signed RP", + /* 135 */ "typename ::= ids UNSIGNED", + /* 136 */ "signed ::= INTEGER", + /* 137 */ "signed ::= PLUS INTEGER", + /* 138 */ "signed ::= MINUS INTEGER", + /* 139 */ "cmd ::= CREATE TABLE create_table_args", + /* 140 */ "cmd ::= CREATE TABLE create_stable_args", + /* 141 */ "cmd ::= CREATE STABLE create_stable_args", + /* 142 */ "cmd ::= CREATE TABLE create_table_list", + /* 143 */ "create_table_list ::= create_from_stable", + /* 144 */ "create_table_list ::= create_table_list create_from_stable", + /* 145 */ "create_table_args ::= ifnotexists ids cpxName LP columnlist RP", + /* 146 */ "create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP", + /* 147 */ "create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP", + /* 148 */ "create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP", + /* 149 */ "tagNamelist ::= tagNamelist COMMA ids", + /* 150 */ "tagNamelist ::= ids", + /* 151 */ "create_table_args ::= ifnotexists ids cpxName AS select", + /* 152 */ "columnlist ::= columnlist COMMA column", + /* 153 */ "columnlist ::= column", + /* 154 */ "column ::= ids typename", + /* 155 */ "tagitemlist ::= tagitemlist COMMA tagitem", + /* 156 */ "tagitemlist ::= tagitem", + /* 157 */ "tagitem ::= INTEGER", + /* 158 */ "tagitem ::= FLOAT", + /* 159 */ "tagitem ::= STRING", + /* 160 */ "tagitem ::= BOOL", + /* 161 */ "tagitem ::= NULL", + /* 162 */ "tagitem ::= NOW", + /* 163 */ "tagitem ::= MINUS INTEGER", + /* 164 */ "tagitem ::= MINUS FLOAT", + /* 165 */ "tagitem ::= PLUS INTEGER", + /* 166 */ "tagitem ::= PLUS FLOAT", + /* 167 */ "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", + /* 168 */ "select ::= LP select RP", + /* 169 */ "union ::= select", + /* 170 */ "union ::= union UNION ALL select", + /* 171 */ "cmd ::= union", + /* 172 */ "select ::= SELECT selcollist", + /* 173 */ "sclp ::= selcollist COMMA", + /* 174 */ "sclp ::=", + /* 175 */ "selcollist ::= sclp distinct expr as", + /* 176 */ "selcollist ::= sclp STAR", + /* 177 */ "as ::= AS ids", + /* 178 */ "as ::= ids", + /* 179 */ "as ::=", + /* 180 */ "distinct ::= DISTINCT", + /* 181 */ "distinct ::=", + /* 182 */ "from ::= FROM tablelist", + /* 183 */ "from ::= FROM sub", + /* 184 */ "sub ::= LP union RP", + /* 185 */ "sub ::= LP union RP ids", + /* 186 */ "sub ::= sub COMMA LP union RP ids", + /* 187 */ "tablelist ::= ids cpxName", + /* 188 */ "tablelist ::= ids cpxName ids", + /* 189 */ "tablelist ::= tablelist COMMA ids cpxName", + /* 190 */ "tablelist ::= tablelist COMMA ids cpxName ids", + /* 191 */ "tmvar ::= VARIABLE", + /* 192 */ "interval_option ::= intervalKey LP tmvar RP", + /* 193 */ "interval_option ::= intervalKey LP tmvar COMMA tmvar RP", + /* 194 */ "interval_option ::=", + /* 195 */ "intervalKey ::= INTERVAL", + /* 196 */ "intervalKey ::= EVERY", + /* 197 */ "session_option ::=", + /* 198 */ "session_option ::= SESSION LP ids cpxName COMMA tmvar RP", + /* 199 */ "windowstate_option ::=", + /* 200 */ "windowstate_option ::= STATE_WINDOW LP ids RP", + /* 201 */ "fill_opt ::=", + /* 202 */ "fill_opt ::= FILL LP ID COMMA tagitemlist RP", + /* 203 */ "fill_opt ::= FILL LP ID RP", + /* 204 */ "sliding_opt ::= SLIDING LP tmvar RP", + /* 205 */ "sliding_opt ::=", + /* 206 */ "orderby_opt ::=", + /* 207 */ "orderby_opt ::= ORDER BY sortlist", + /* 208 */ "sortlist ::= sortlist COMMA item sortorder", + /* 209 */ "sortlist ::= item sortorder", + /* 210 */ "item ::= ids cpxName", + /* 211 */ "sortorder ::= ASC", + /* 212 */ "sortorder ::= DESC", + /* 213 */ "sortorder ::=", + /* 214 */ "groupby_opt ::=", + /* 215 */ "groupby_opt ::= GROUP BY grouplist", + /* 216 */ "grouplist ::= grouplist COMMA item", + /* 217 */ "grouplist ::= item", + /* 218 */ "having_opt ::=", + /* 219 */ "having_opt ::= HAVING expr", + /* 220 */ "limit_opt ::=", + /* 221 */ "limit_opt ::= LIMIT signed", + /* 222 */ "limit_opt ::= LIMIT signed OFFSET signed", + /* 223 */ "limit_opt ::= LIMIT signed COMMA signed", + /* 224 */ "slimit_opt ::=", + /* 225 */ "slimit_opt ::= SLIMIT signed", + /* 226 */ "slimit_opt ::= SLIMIT signed SOFFSET signed", + /* 227 */ "slimit_opt ::= SLIMIT signed COMMA signed", + /* 228 */ "where_opt ::=", + /* 229 */ "where_opt ::= WHERE expr", + /* 230 */ "expr ::= LP expr RP", + /* 231 */ "expr ::= ID", + /* 232 */ "expr ::= ID DOT ID", + /* 233 */ "expr ::= ID DOT STAR", + /* 234 */ "expr ::= INTEGER", + /* 235 */ "expr ::= MINUS INTEGER", + /* 236 */ "expr ::= PLUS INTEGER", + /* 237 */ "expr ::= FLOAT", + /* 238 */ "expr ::= MINUS FLOAT", + /* 239 */ "expr ::= PLUS FLOAT", + /* 240 */ "expr ::= STRING", + /* 241 */ "expr ::= NOW", + /* 242 */ "expr ::= VARIABLE", + /* 243 */ "expr ::= PLUS VARIABLE", + /* 244 */ "expr ::= MINUS VARIABLE", + /* 245 */ "expr ::= BOOL", + /* 246 */ "expr ::= NULL", + /* 247 */ "expr ::= ID LP exprlist RP", + /* 248 */ "expr ::= ID LP STAR RP", + /* 249 */ "expr ::= expr IS NULL", + /* 250 */ "expr ::= expr IS NOT NULL", + /* 251 */ "expr ::= expr LT expr", + /* 252 */ "expr ::= expr GT expr", + /* 253 */ "expr ::= expr LE expr", + /* 254 */ "expr ::= expr GE expr", + /* 255 */ "expr ::= expr NE expr", + /* 256 */ "expr ::= expr EQ expr", + /* 257 */ "expr ::= expr BETWEEN expr AND expr", + /* 258 */ "expr ::= expr AND expr", + /* 259 */ "expr ::= expr OR expr", + /* 260 */ "expr ::= expr PLUS expr", + /* 261 */ "expr ::= expr MINUS expr", + /* 262 */ "expr ::= expr STAR expr", + /* 263 */ "expr ::= expr SLASH expr", + /* 264 */ "expr ::= expr REM expr", + /* 265 */ "expr ::= expr LIKE expr", + /* 266 */ "expr ::= expr IN LP exprlist RP", + /* 267 */ "exprlist ::= exprlist COMMA expritem", + /* 268 */ "exprlist ::= expritem", + /* 269 */ "expritem ::= expr", + /* 270 */ "expritem ::=", + /* 271 */ "cmd ::= RESET QUERY CACHE", + /* 272 */ "cmd ::= SYNCDB ids REPLICA", + /* 273 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist", + /* 274 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids", + /* 275 */ "cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist", + /* 276 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist", + /* 277 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids", + /* 278 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids", + /* 279 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem", + /* 280 */ "cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist", + /* 281 */ "cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist", + /* 282 */ "cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids", + /* 283 */ "cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist", + /* 284 */ "cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist", + /* 285 */ "cmd ::= ALTER STABLE ids cpxName DROP TAG ids", + /* 286 */ "cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids", + /* 287 */ "cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem", + /* 288 */ "cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist", + /* 289 */ "cmd ::= KILL CONNECTION INTEGER", + /* 290 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER", + /* 291 */ "cmd ::= KILL QUERY INTEGER COLON INTEGER", }; #endif /* NDEBUG */ @@ -1608,7 +1608,7 @@ static int yyGrowStack(yyParser *p){ #endif p->yystksz = newSize; } - return pNew==0; + return pNew==0; } #endif @@ -1622,12 +1622,12 @@ static int yyGrowStack(yyParser *p){ #endif /* Initialize a new parser that has already been allocated. -*/ + */ void ParseInit(void *yypRawParser ParseCTX_PDECL){ yyParser *yypParser = (yyParser*)yypRawParser; ParseCTX_STORE #ifdef YYTRACKMAXSTACKDEPTH - yypParser->yyhwm = 0; + yypParser->yyhwm = 0; #endif #if YYSTACKDEPTH<=0 yypParser->yytos = NULL; @@ -1650,7 +1650,7 @@ void ParseInit(void *yypRawParser ParseCTX_PDECL){ } #ifndef Parse_ENGINEALWAYSONSTACK -/* +/* ** This function allocates a new parser. ** The only argument is a pointer to a function which works like ** malloc. @@ -1677,38 +1677,38 @@ void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE) ParseCTX_PDECL){ /* The following function deletes the "minor type" or semantic value ** associated with a symbol. The symbol can be either a terminal ** or nonterminal. "yymajor" is the symbol code, and "yypminor" is -** a pointer to the value to be deleted. The code used to do the +** a pointer to the value to be deleted. The code used to do the ** deletions is derived from the %destructor and/or %token_destructor ** directives of the input grammar. */ static void yy_destructor( - yyParser *yypParser, /* The parser */ - YYCODETYPE yymajor, /* Type code for object to destroy */ - YYMINORTYPE *yypminor /* The object to be destroyed */ + yyParser *yypParser, /* The parser */ + YYCODETYPE yymajor, /* Type code for object to destroy */ + YYMINORTYPE *yypminor /* The object to be destroyed */ ){ ParseARG_FETCH - ParseCTX_FETCH - switch( yymajor ){ - /* Here is inserted the actions which take place when a + ParseCTX_FETCH + switch( yymajor ){ + /* Here is inserted the actions which take place when a ** terminal or non-terminal is destroyed. This can happen ** when the symbol is popped from the stack during a - ** reduce or during error processing or when a parser is + ** reduce or during error processing or when a parser is ** being destroyed before it is finished parsing. ** ** Note: during a reduce, the only symbols destroyed are those ** which appear on the RHS of the rule, but which are *not* used ** inside the C code. - */ -/********* Begin destructor definitions ***************************************/ + */ + /********* Begin destructor definitions ***************************************/ case 205: /* exprlist */ case 249: /* selcollist */ case 263: /* sclp */ -{ + { #line 760 "sql.y" -tSqlExprListDestroy((yypminor->yy403)); + tSqlExprListDestroy((yypminor->yy403)); #line 1709 "sql.c" -} - break; + } + break; case 220: /* intitemlist */ case 222: /* keep */ case 243: /* columnlist */ @@ -1719,60 +1719,60 @@ tSqlExprListDestroy((yypminor->yy403)); case 259: /* orderby_opt */ case 271: /* sortlist */ case 275: /* grouplist */ -{ + { #line 258 "sql.y" -taosArrayDestroy((yypminor->yy403)); + taosArrayDestroy((yypminor->yy403)); #line 1725 "sql.c" -} - break; + } + break; case 241: /* create_table_list */ -{ + { #line 366 "sql.y" -destroyCreateTableSql((yypminor->yy56)); + destroyCreateTableSql((yypminor->yy56)); #line 1732 "sql.c" -} - break; + } + break; case 246: /* select */ -{ + { #line 486 "sql.y" -destroySqlNode((yypminor->yy224)); + destroySqlNode((yypminor->yy224)); #line 1739 "sql.c" -} - break; + } + break; case 250: /* from */ case 267: /* tablelist */ case 268: /* sub */ -{ + { #line 541 "sql.y" -destroyRelationInfo((yypminor->yy114)); + destroyRelationInfo((yypminor->yy114)); #line 1748 "sql.c" -} - break; + } + break; case 251: /* where_opt */ case 258: /* having_opt */ case 265: /* expr */ case 276: /* expritem */ -{ + { #line 693 "sql.y" -tSqlExprDestroy((yypminor->yy260)); + tSqlExprDestroy((yypminor->yy260)); #line 1758 "sql.c" -} - break; + } + break; case 262: /* union */ -{ + { #line 494 "sql.y" -destroyAllSqlNode((yypminor->yy403)); + destroyAllSqlNode((yypminor->yy403)); #line 1765 "sql.c" -} - break; + } + break; case 272: /* sortitem */ -{ + { #line 626 "sql.y" -tVariantDestroy(&(yypminor->yy488)); + tVariantDestroy(&(yypminor->yy488)); #line 1772 "sql.c" -} - break; -/********* End destructor definitions *****************************************/ + } + break; + /********* End destructor definitions *****************************************/ default: break; /* If no destructor action specified: do nothing */ } } @@ -1791,8 +1791,8 @@ static void yy_pop_parser_stack(yyParser *pParser){ #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sPopping %s\n", - yyTracePrompt, - yyTokenName[yytos->major]); + yyTracePrompt, + yyTokenName[yytos->major]); } #endif yy_destructor(pParser, yytos->major, &yytos->minor); @@ -1810,7 +1810,7 @@ void ParseFinalize(void *p){ } #ifndef Parse_ENGINEALWAYSONSTACK -/* +/* ** Deallocate and destroy a parser. Destructors are called for ** all stack elements before shutting the parser down. ** @@ -1819,8 +1819,8 @@ void ParseFinalize(void *p){ ** assumed that the input pointer is never NULL. */ void ParseFree( - void *p, /* The parser to be deleted */ - void (*freeProc)(void*) /* Function used to reclaim memory */ + void *p, /* The parser to be deleted */ + void (*freeProc)(void*) /* Function used to reclaim memory */ ){ #ifndef YYPARSEFREENEVERNULL if( p==0 ) return; @@ -1882,8 +1882,8 @@ int ParseCoverage(FILE *out){ ** look-ahead token iLookAhead. */ static YYACTIONTYPE yy_find_shift_action( - YYCODETYPE iLookAhead, /* The look-ahead token */ - YYACTIONTYPE stateno /* Current state number */ + YYCODETYPE iLookAhead, /* The look-ahead token */ + YYACTIONTYPE stateno /* Current state number */ ){ int i; @@ -1910,7 +1910,7 @@ static YYACTIONTYPE yy_find_shift_action( #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n", - yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]); + yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]); } #endif assert( yyFallback[iFallback]==0 ); /* Fallback loop must terminate */ @@ -1926,8 +1926,8 @@ static YYACTIONTYPE yy_find_shift_action( #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n", - yyTracePrompt, yyTokenName[iLookAhead], - yyTokenName[YYWILDCARD]); + yyTracePrompt, yyTokenName[iLookAhead], + yyTokenName[YYWILDCARD]); } #endif /* NDEBUG */ return yy_action[j]; @@ -1947,8 +1947,8 @@ static YYACTIONTYPE yy_find_shift_action( ** look-ahead token iLookAhead. */ static YYACTIONTYPE yy_find_reduce_action( - YYACTIONTYPE stateno, /* Current state number */ - YYCODETYPE iLookAhead /* The look-ahead token */ + YYACTIONTYPE stateno, /* Current state number */ + YYCODETYPE iLookAhead /* The look-ahead token */ ){ int i; #ifdef YYERRORSYMBOL @@ -1976,20 +1976,20 @@ static YYACTIONTYPE yy_find_reduce_action( ** The following routine is called if the stack overflows. */ static void yyStackOverflow(yyParser *yypParser){ - ParseARG_FETCH - ParseCTX_FETCH + ParseARG_FETCH + ParseCTX_FETCH #ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt); - } + if( yyTraceFILE ){ + fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt); + } #endif - while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser); - /* Here code is inserted which will execute if the parser + while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser); + /* Here code is inserted which will execute if the parser ** stack every overflows */ -/******** Begin %stack_overflow code ******************************************/ -/******** End %stack_overflow code ********************************************/ - ParseARG_STORE /* Suppress warning about unused %extra_argument var */ - ParseCTX_STORE + /******** Begin %stack_overflow code ******************************************/ + /******** End %stack_overflow code ********************************************/ + ParseARG_STORE /* Suppress warning about unused %extra_argument var */ + ParseCTX_STORE } /* @@ -2000,12 +2000,12 @@ static void yyTraceShift(yyParser *yypParser, int yyNewState, const char *zTag){ if( yyTraceFILE ){ if( yyNewStateyytos->major], - yyNewState); + yyTracePrompt, zTag, yyTokenName[yypParser->yytos->major], + yyNewState); }else{ fprintf(yyTraceFILE,"%s%s '%s', pending reduce %d\n", - yyTracePrompt, zTag, yyTokenName[yypParser->yytos->major], - yyNewState - YY_MIN_REDUCE); + yyTracePrompt, zTag, yyTokenName[yypParser->yytos->major], + yyNewState - YY_MIN_REDUCE); } } } @@ -2017,10 +2017,10 @@ static void yyTraceShift(yyParser *yypParser, int yyNewState, const char *zTag){ ** Perform a shift action. */ static void yy_shift( - yyParser *yypParser, /* The parser to be shifted */ - YYACTIONTYPE yyNewState, /* The new state to shift in */ - YYCODETYPE yyMajor, /* The major token to shift in */ - ParseTOKENTYPE yyMinor /* The minor token to shift in */ + yyParser *yypParser, /* The parser to be shifted */ + YYACTIONTYPE yyNewState, /* The new state to shift in */ + YYCODETYPE yyMajor, /* The major token to shift in */ + ParseTOKENTYPE yyMinor /* The minor token to shift in */ ){ yyStackEntry *yytos; yypParser->yytos++; @@ -2030,7 +2030,7 @@ static void yy_shift( assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack) ); } #endif -#if YYSTACKDEPTH>0 +#if YYSTACKDEPTH>0 if( yypParser->yytos>yypParser->yystackEnd ){ yypParser->yytos--; yyStackOverflow(yypParser); @@ -2058,595 +2058,595 @@ static void yy_shift( /* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side ** of that rule */ static const YYCODETYPE yyRuleInfoLhs[] = { - 196, /* (0) program ::= cmd */ - 197, /* (1) cmd ::= SHOW DATABASES */ - 197, /* (2) cmd ::= SHOW TOPICS */ - 197, /* (3) cmd ::= SHOW FUNCTIONS */ - 197, /* (4) cmd ::= SHOW MNODES */ - 197, /* (5) cmd ::= SHOW DNODES */ - 197, /* (6) cmd ::= SHOW ACCOUNTS */ - 197, /* (7) cmd ::= SHOW USERS */ - 197, /* (8) cmd ::= SHOW MODULES */ - 197, /* (9) cmd ::= SHOW QUERIES */ - 197, /* (10) cmd ::= SHOW CONNECTIONS */ - 197, /* (11) cmd ::= SHOW STREAMS */ - 197, /* (12) cmd ::= SHOW VARIABLES */ - 197, /* (13) cmd ::= SHOW SCORES */ - 197, /* (14) cmd ::= SHOW GRANTS */ - 197, /* (15) cmd ::= SHOW VNODES */ - 197, /* (16) cmd ::= SHOW VNODES IPTOKEN */ - 198, /* (17) dbPrefix ::= */ - 198, /* (18) dbPrefix ::= ids DOT */ - 200, /* (19) cpxName ::= */ - 200, /* (20) cpxName ::= DOT ids */ - 197, /* (21) cmd ::= SHOW CREATE TABLE ids cpxName */ - 197, /* (22) cmd ::= SHOW CREATE STABLE ids cpxName */ - 197, /* (23) cmd ::= SHOW CREATE DATABASE ids */ - 197, /* (24) cmd ::= SHOW dbPrefix TABLES */ - 197, /* (25) cmd ::= SHOW dbPrefix TABLES LIKE ids */ - 197, /* (26) cmd ::= SHOW dbPrefix STABLES */ - 197, /* (27) cmd ::= SHOW dbPrefix STABLES LIKE ids */ - 197, /* (28) cmd ::= SHOW dbPrefix VGROUPS */ - 197, /* (29) cmd ::= SHOW dbPrefix VGROUPS ids */ - 197, /* (30) cmd ::= DROP TABLE ifexists ids cpxName */ - 197, /* (31) cmd ::= DROP STABLE ifexists ids cpxName */ - 197, /* (32) cmd ::= DROP DATABASE ifexists ids */ - 197, /* (33) cmd ::= DROP TOPIC ifexists ids */ - 197, /* (34) cmd ::= DROP FUNCTION ids */ - 197, /* (35) cmd ::= DROP DNODE ids */ - 197, /* (36) cmd ::= DROP USER ids */ - 197, /* (37) cmd ::= DROP ACCOUNT ids */ - 197, /* (38) cmd ::= USE ids */ - 197, /* (39) cmd ::= DESCRIBE ids cpxName */ - 197, /* (40) cmd ::= DESC ids cpxName */ - 197, /* (41) cmd ::= ALTER USER ids PASS ids */ - 197, /* (42) cmd ::= ALTER USER ids PRIVILEGE ids */ - 197, /* (43) cmd ::= ALTER DNODE ids ids */ - 197, /* (44) cmd ::= ALTER DNODE ids ids ids */ - 197, /* (45) cmd ::= ALTER LOCAL ids */ - 197, /* (46) cmd ::= ALTER LOCAL ids ids */ - 197, /* (47) cmd ::= ALTER DATABASE ids alter_db_optr */ - 197, /* (48) cmd ::= ALTER TOPIC ids alter_topic_optr */ - 197, /* (49) cmd ::= ALTER ACCOUNT ids acct_optr */ - 197, /* (50) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ - 197, /* (51) cmd ::= COMPACT VNODES IN LP exprlist RP */ - 199, /* (52) ids ::= ID */ - 199, /* (53) ids ::= STRING */ - 201, /* (54) ifexists ::= IF EXISTS */ - 201, /* (55) ifexists ::= */ - 206, /* (56) ifnotexists ::= IF NOT EXISTS */ - 206, /* (57) ifnotexists ::= */ - 197, /* (58) cmd ::= CREATE DNODE ids */ - 197, /* (59) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ - 197, /* (60) cmd ::= CREATE DATABASE ifnotexists ids db_optr */ - 197, /* (61) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ - 197, /* (62) cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ - 197, /* (63) cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ - 197, /* (64) cmd ::= CREATE USER ids PASS ids */ - 210, /* (65) bufsize ::= */ - 210, /* (66) bufsize ::= BUFSIZE INTEGER */ - 211, /* (67) pps ::= */ - 211, /* (68) pps ::= PPS INTEGER */ - 212, /* (69) tseries ::= */ - 212, /* (70) tseries ::= TSERIES INTEGER */ - 213, /* (71) dbs ::= */ - 213, /* (72) dbs ::= DBS INTEGER */ - 214, /* (73) streams ::= */ - 214, /* (74) streams ::= STREAMS INTEGER */ - 215, /* (75) storage ::= */ - 215, /* (76) storage ::= STORAGE INTEGER */ - 216, /* (77) qtime ::= */ - 216, /* (78) qtime ::= QTIME INTEGER */ - 217, /* (79) users ::= */ - 217, /* (80) users ::= USERS INTEGER */ - 218, /* (81) conns ::= */ - 218, /* (82) conns ::= CONNS INTEGER */ - 219, /* (83) state ::= */ - 219, /* (84) state ::= STATE ids */ - 204, /* (85) acct_optr ::= pps tseries storage streams qtime dbs users conns state */ - 220, /* (86) intitemlist ::= intitemlist COMMA intitem */ - 220, /* (87) intitemlist ::= intitem */ - 221, /* (88) intitem ::= INTEGER */ - 222, /* (89) keep ::= KEEP intitemlist */ - 223, /* (90) cache ::= CACHE INTEGER */ - 224, /* (91) replica ::= REPLICA INTEGER */ - 225, /* (92) quorum ::= QUORUM INTEGER */ - 226, /* (93) days ::= DAYS INTEGER */ - 227, /* (94) minrows ::= MINROWS INTEGER */ - 228, /* (95) maxrows ::= MAXROWS INTEGER */ - 229, /* (96) blocks ::= BLOCKS INTEGER */ - 230, /* (97) ctime ::= CTIME INTEGER */ - 231, /* (98) wal ::= WAL INTEGER */ - 232, /* (99) fsync ::= FSYNC INTEGER */ - 233, /* (100) comp ::= COMP INTEGER */ - 234, /* (101) prec ::= PRECISION STRING */ - 235, /* (102) update ::= UPDATE INTEGER */ - 236, /* (103) cachelast ::= CACHELAST INTEGER */ - 237, /* (104) partitions ::= PARTITIONS INTEGER */ - 207, /* (105) db_optr ::= */ - 207, /* (106) db_optr ::= db_optr cache */ - 207, /* (107) db_optr ::= db_optr replica */ - 207, /* (108) db_optr ::= db_optr quorum */ - 207, /* (109) db_optr ::= db_optr days */ - 207, /* (110) db_optr ::= db_optr minrows */ - 207, /* (111) db_optr ::= db_optr maxrows */ - 207, /* (112) db_optr ::= db_optr blocks */ - 207, /* (113) db_optr ::= db_optr ctime */ - 207, /* (114) db_optr ::= db_optr wal */ - 207, /* (115) db_optr ::= db_optr fsync */ - 207, /* (116) db_optr ::= db_optr comp */ - 207, /* (117) db_optr ::= db_optr prec */ - 207, /* (118) db_optr ::= db_optr keep */ - 207, /* (119) db_optr ::= db_optr update */ - 207, /* (120) db_optr ::= db_optr cachelast */ - 208, /* (121) topic_optr ::= db_optr */ - 208, /* (122) topic_optr ::= topic_optr partitions */ - 202, /* (123) alter_db_optr ::= */ - 202, /* (124) alter_db_optr ::= alter_db_optr replica */ - 202, /* (125) alter_db_optr ::= alter_db_optr quorum */ - 202, /* (126) alter_db_optr ::= alter_db_optr keep */ - 202, /* (127) alter_db_optr ::= alter_db_optr blocks */ - 202, /* (128) alter_db_optr ::= alter_db_optr comp */ - 202, /* (129) alter_db_optr ::= alter_db_optr update */ - 202, /* (130) alter_db_optr ::= alter_db_optr cachelast */ - 203, /* (131) alter_topic_optr ::= alter_db_optr */ - 203, /* (132) alter_topic_optr ::= alter_topic_optr partitions */ - 209, /* (133) typename ::= ids */ - 209, /* (134) typename ::= ids LP signed RP */ - 209, /* (135) typename ::= ids UNSIGNED */ - 238, /* (136) signed ::= INTEGER */ - 238, /* (137) signed ::= PLUS INTEGER */ - 238, /* (138) signed ::= MINUS INTEGER */ - 197, /* (139) cmd ::= CREATE TABLE create_table_args */ - 197, /* (140) cmd ::= CREATE TABLE create_stable_args */ - 197, /* (141) cmd ::= CREATE STABLE create_stable_args */ - 197, /* (142) cmd ::= CREATE TABLE create_table_list */ - 241, /* (143) create_table_list ::= create_from_stable */ - 241, /* (144) create_table_list ::= create_table_list create_from_stable */ - 239, /* (145) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ - 240, /* (146) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ - 242, /* (147) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ - 242, /* (148) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */ - 245, /* (149) tagNamelist ::= tagNamelist COMMA ids */ - 245, /* (150) tagNamelist ::= ids */ - 239, /* (151) create_table_args ::= ifnotexists ids cpxName AS select */ - 243, /* (152) columnlist ::= columnlist COMMA column */ - 243, /* (153) columnlist ::= column */ - 247, /* (154) column ::= ids typename */ - 244, /* (155) tagitemlist ::= tagitemlist COMMA tagitem */ - 244, /* (156) tagitemlist ::= tagitem */ - 248, /* (157) tagitem ::= INTEGER */ - 248, /* (158) tagitem ::= FLOAT */ - 248, /* (159) tagitem ::= STRING */ - 248, /* (160) tagitem ::= BOOL */ - 248, /* (161) tagitem ::= NULL */ - 248, /* (162) tagitem ::= NOW */ - 248, /* (163) tagitem ::= MINUS INTEGER */ - 248, /* (164) tagitem ::= MINUS FLOAT */ - 248, /* (165) tagitem ::= PLUS INTEGER */ - 248, /* (166) tagitem ::= PLUS FLOAT */ - 246, /* (167) 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 */ - 246, /* (168) select ::= LP select RP */ - 262, /* (169) union ::= select */ - 262, /* (170) union ::= union UNION ALL select */ - 197, /* (171) cmd ::= union */ - 246, /* (172) select ::= SELECT selcollist */ - 263, /* (173) sclp ::= selcollist COMMA */ - 263, /* (174) sclp ::= */ - 249, /* (175) selcollist ::= sclp distinct expr as */ - 249, /* (176) selcollist ::= sclp STAR */ - 266, /* (177) as ::= AS ids */ - 266, /* (178) as ::= ids */ - 266, /* (179) as ::= */ - 264, /* (180) distinct ::= DISTINCT */ - 264, /* (181) distinct ::= */ - 250, /* (182) from ::= FROM tablelist */ - 250, /* (183) from ::= FROM sub */ - 268, /* (184) sub ::= LP union RP */ - 268, /* (185) sub ::= LP union RP ids */ - 268, /* (186) sub ::= sub COMMA LP union RP ids */ - 267, /* (187) tablelist ::= ids cpxName */ - 267, /* (188) tablelist ::= ids cpxName ids */ - 267, /* (189) tablelist ::= tablelist COMMA ids cpxName */ - 267, /* (190) tablelist ::= tablelist COMMA ids cpxName ids */ - 269, /* (191) tmvar ::= VARIABLE */ - 252, /* (192) interval_option ::= intervalKey LP tmvar RP */ - 252, /* (193) interval_option ::= intervalKey LP tmvar COMMA tmvar RP */ - 252, /* (194) interval_option ::= */ - 270, /* (195) intervalKey ::= INTERVAL */ - 270, /* (196) intervalKey ::= EVERY */ - 254, /* (197) session_option ::= */ - 254, /* (198) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ - 255, /* (199) windowstate_option ::= */ - 255, /* (200) windowstate_option ::= STATE_WINDOW LP ids RP */ - 256, /* (201) fill_opt ::= */ - 256, /* (202) fill_opt ::= FILL LP ID COMMA tagitemlist RP */ - 256, /* (203) fill_opt ::= FILL LP ID RP */ - 253, /* (204) sliding_opt ::= SLIDING LP tmvar RP */ - 253, /* (205) sliding_opt ::= */ - 259, /* (206) orderby_opt ::= */ - 259, /* (207) orderby_opt ::= ORDER BY sortlist */ - 271, /* (208) sortlist ::= sortlist COMMA item sortorder */ - 271, /* (209) sortlist ::= item sortorder */ - 273, /* (210) item ::= ids cpxName */ - 274, /* (211) sortorder ::= ASC */ - 274, /* (212) sortorder ::= DESC */ - 274, /* (213) sortorder ::= */ - 257, /* (214) groupby_opt ::= */ - 257, /* (215) groupby_opt ::= GROUP BY grouplist */ - 275, /* (216) grouplist ::= grouplist COMMA item */ - 275, /* (217) grouplist ::= item */ - 258, /* (218) having_opt ::= */ - 258, /* (219) having_opt ::= HAVING expr */ - 261, /* (220) limit_opt ::= */ - 261, /* (221) limit_opt ::= LIMIT signed */ - 261, /* (222) limit_opt ::= LIMIT signed OFFSET signed */ - 261, /* (223) limit_opt ::= LIMIT signed COMMA signed */ - 260, /* (224) slimit_opt ::= */ - 260, /* (225) slimit_opt ::= SLIMIT signed */ - 260, /* (226) slimit_opt ::= SLIMIT signed SOFFSET signed */ - 260, /* (227) slimit_opt ::= SLIMIT signed COMMA signed */ - 251, /* (228) where_opt ::= */ - 251, /* (229) where_opt ::= WHERE expr */ - 265, /* (230) expr ::= LP expr RP */ - 265, /* (231) expr ::= ID */ - 265, /* (232) expr ::= ID DOT ID */ - 265, /* (233) expr ::= ID DOT STAR */ - 265, /* (234) expr ::= INTEGER */ - 265, /* (235) expr ::= MINUS INTEGER */ - 265, /* (236) expr ::= PLUS INTEGER */ - 265, /* (237) expr ::= FLOAT */ - 265, /* (238) expr ::= MINUS FLOAT */ - 265, /* (239) expr ::= PLUS FLOAT */ - 265, /* (240) expr ::= STRING */ - 265, /* (241) expr ::= NOW */ - 265, /* (242) expr ::= VARIABLE */ - 265, /* (243) expr ::= PLUS VARIABLE */ - 265, /* (244) expr ::= MINUS VARIABLE */ - 265, /* (245) expr ::= BOOL */ - 265, /* (246) expr ::= NULL */ - 265, /* (247) expr ::= ID LP exprlist RP */ - 265, /* (248) expr ::= ID LP STAR RP */ - 265, /* (249) expr ::= expr IS NULL */ - 265, /* (250) expr ::= expr IS NOT NULL */ - 265, /* (251) expr ::= expr LT expr */ - 265, /* (252) expr ::= expr GT expr */ - 265, /* (253) expr ::= expr LE expr */ - 265, /* (254) expr ::= expr GE expr */ - 265, /* (255) expr ::= expr NE expr */ - 265, /* (256) expr ::= expr EQ expr */ - 265, /* (257) expr ::= expr BETWEEN expr AND expr */ - 265, /* (258) expr ::= expr AND expr */ - 265, /* (259) expr ::= expr OR expr */ - 265, /* (260) expr ::= expr PLUS expr */ - 265, /* (261) expr ::= expr MINUS expr */ - 265, /* (262) expr ::= expr STAR expr */ - 265, /* (263) expr ::= expr SLASH expr */ - 265, /* (264) expr ::= expr REM expr */ - 265, /* (265) expr ::= expr LIKE expr */ - 265, /* (266) expr ::= expr IN LP exprlist RP */ - 205, /* (267) exprlist ::= exprlist COMMA expritem */ - 205, /* (268) exprlist ::= expritem */ - 276, /* (269) expritem ::= expr */ - 276, /* (270) expritem ::= */ - 197, /* (271) cmd ::= RESET QUERY CACHE */ - 197, /* (272) cmd ::= SYNCDB ids REPLICA */ - 197, /* (273) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ - 197, /* (274) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ - 197, /* (275) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */ - 197, /* (276) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ - 197, /* (277) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ - 197, /* (278) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ - 197, /* (279) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ - 197, /* (280) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */ - 197, /* (281) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ - 197, /* (282) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ - 197, /* (283) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */ - 197, /* (284) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ - 197, /* (285) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ - 197, /* (286) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ - 197, /* (287) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */ - 197, /* (288) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */ - 197, /* (289) cmd ::= KILL CONNECTION INTEGER */ - 197, /* (290) cmd ::= KILL STREAM INTEGER COLON INTEGER */ - 197, /* (291) cmd ::= KILL QUERY INTEGER COLON INTEGER */ + 196, /* (0) program ::= cmd */ + 197, /* (1) cmd ::= SHOW DATABASES */ + 197, /* (2) cmd ::= SHOW TOPICS */ + 197, /* (3) cmd ::= SHOW FUNCTIONS */ + 197, /* (4) cmd ::= SHOW MNODES */ + 197, /* (5) cmd ::= SHOW DNODES */ + 197, /* (6) cmd ::= SHOW ACCOUNTS */ + 197, /* (7) cmd ::= SHOW USERS */ + 197, /* (8) cmd ::= SHOW MODULES */ + 197, /* (9) cmd ::= SHOW QUERIES */ + 197, /* (10) cmd ::= SHOW CONNECTIONS */ + 197, /* (11) cmd ::= SHOW STREAMS */ + 197, /* (12) cmd ::= SHOW VARIABLES */ + 197, /* (13) cmd ::= SHOW SCORES */ + 197, /* (14) cmd ::= SHOW GRANTS */ + 197, /* (15) cmd ::= SHOW VNODES */ + 197, /* (16) cmd ::= SHOW VNODES IPTOKEN */ + 198, /* (17) dbPrefix ::= */ + 198, /* (18) dbPrefix ::= ids DOT */ + 200, /* (19) cpxName ::= */ + 200, /* (20) cpxName ::= DOT ids */ + 197, /* (21) cmd ::= SHOW CREATE TABLE ids cpxName */ + 197, /* (22) cmd ::= SHOW CREATE STABLE ids cpxName */ + 197, /* (23) cmd ::= SHOW CREATE DATABASE ids */ + 197, /* (24) cmd ::= SHOW dbPrefix TABLES */ + 197, /* (25) cmd ::= SHOW dbPrefix TABLES LIKE ids */ + 197, /* (26) cmd ::= SHOW dbPrefix STABLES */ + 197, /* (27) cmd ::= SHOW dbPrefix STABLES LIKE ids */ + 197, /* (28) cmd ::= SHOW dbPrefix VGROUPS */ + 197, /* (29) cmd ::= SHOW dbPrefix VGROUPS ids */ + 197, /* (30) cmd ::= DROP TABLE ifexists ids cpxName */ + 197, /* (31) cmd ::= DROP STABLE ifexists ids cpxName */ + 197, /* (32) cmd ::= DROP DATABASE ifexists ids */ + 197, /* (33) cmd ::= DROP TOPIC ifexists ids */ + 197, /* (34) cmd ::= DROP FUNCTION ids */ + 197, /* (35) cmd ::= DROP DNODE ids */ + 197, /* (36) cmd ::= DROP USER ids */ + 197, /* (37) cmd ::= DROP ACCOUNT ids */ + 197, /* (38) cmd ::= USE ids */ + 197, /* (39) cmd ::= DESCRIBE ids cpxName */ + 197, /* (40) cmd ::= DESC ids cpxName */ + 197, /* (41) cmd ::= ALTER USER ids PASS ids */ + 197, /* (42) cmd ::= ALTER USER ids PRIVILEGE ids */ + 197, /* (43) cmd ::= ALTER DNODE ids ids */ + 197, /* (44) cmd ::= ALTER DNODE ids ids ids */ + 197, /* (45) cmd ::= ALTER LOCAL ids */ + 197, /* (46) cmd ::= ALTER LOCAL ids ids */ + 197, /* (47) cmd ::= ALTER DATABASE ids alter_db_optr */ + 197, /* (48) cmd ::= ALTER TOPIC ids alter_topic_optr */ + 197, /* (49) cmd ::= ALTER ACCOUNT ids acct_optr */ + 197, /* (50) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ + 197, /* (51) cmd ::= COMPACT VNODES IN LP exprlist RP */ + 199, /* (52) ids ::= ID */ + 199, /* (53) ids ::= STRING */ + 201, /* (54) ifexists ::= IF EXISTS */ + 201, /* (55) ifexists ::= */ + 206, /* (56) ifnotexists ::= IF NOT EXISTS */ + 206, /* (57) ifnotexists ::= */ + 197, /* (58) cmd ::= CREATE DNODE ids */ + 197, /* (59) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ + 197, /* (60) cmd ::= CREATE DATABASE ifnotexists ids db_optr */ + 197, /* (61) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ + 197, /* (62) cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ + 197, /* (63) cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ + 197, /* (64) cmd ::= CREATE USER ids PASS ids */ + 210, /* (65) bufsize ::= */ + 210, /* (66) bufsize ::= BUFSIZE INTEGER */ + 211, /* (67) pps ::= */ + 211, /* (68) pps ::= PPS INTEGER */ + 212, /* (69) tseries ::= */ + 212, /* (70) tseries ::= TSERIES INTEGER */ + 213, /* (71) dbs ::= */ + 213, /* (72) dbs ::= DBS INTEGER */ + 214, /* (73) streams ::= */ + 214, /* (74) streams ::= STREAMS INTEGER */ + 215, /* (75) storage ::= */ + 215, /* (76) storage ::= STORAGE INTEGER */ + 216, /* (77) qtime ::= */ + 216, /* (78) qtime ::= QTIME INTEGER */ + 217, /* (79) users ::= */ + 217, /* (80) users ::= USERS INTEGER */ + 218, /* (81) conns ::= */ + 218, /* (82) conns ::= CONNS INTEGER */ + 219, /* (83) state ::= */ + 219, /* (84) state ::= STATE ids */ + 204, /* (85) acct_optr ::= pps tseries storage streams qtime dbs users conns state */ + 220, /* (86) intitemlist ::= intitemlist COMMA intitem */ + 220, /* (87) intitemlist ::= intitem */ + 221, /* (88) intitem ::= INTEGER */ + 222, /* (89) keep ::= KEEP intitemlist */ + 223, /* (90) cache ::= CACHE INTEGER */ + 224, /* (91) replica ::= REPLICA INTEGER */ + 225, /* (92) quorum ::= QUORUM INTEGER */ + 226, /* (93) days ::= DAYS INTEGER */ + 227, /* (94) minrows ::= MINROWS INTEGER */ + 228, /* (95) maxrows ::= MAXROWS INTEGER */ + 229, /* (96) blocks ::= BLOCKS INTEGER */ + 230, /* (97) ctime ::= CTIME INTEGER */ + 231, /* (98) wal ::= WAL INTEGER */ + 232, /* (99) fsync ::= FSYNC INTEGER */ + 233, /* (100) comp ::= COMP INTEGER */ + 234, /* (101) prec ::= PRECISION STRING */ + 235, /* (102) update ::= UPDATE INTEGER */ + 236, /* (103) cachelast ::= CACHELAST INTEGER */ + 237, /* (104) partitions ::= PARTITIONS INTEGER */ + 207, /* (105) db_optr ::= */ + 207, /* (106) db_optr ::= db_optr cache */ + 207, /* (107) db_optr ::= db_optr replica */ + 207, /* (108) db_optr ::= db_optr quorum */ + 207, /* (109) db_optr ::= db_optr days */ + 207, /* (110) db_optr ::= db_optr minrows */ + 207, /* (111) db_optr ::= db_optr maxrows */ + 207, /* (112) db_optr ::= db_optr blocks */ + 207, /* (113) db_optr ::= db_optr ctime */ + 207, /* (114) db_optr ::= db_optr wal */ + 207, /* (115) db_optr ::= db_optr fsync */ + 207, /* (116) db_optr ::= db_optr comp */ + 207, /* (117) db_optr ::= db_optr prec */ + 207, /* (118) db_optr ::= db_optr keep */ + 207, /* (119) db_optr ::= db_optr update */ + 207, /* (120) db_optr ::= db_optr cachelast */ + 208, /* (121) topic_optr ::= db_optr */ + 208, /* (122) topic_optr ::= topic_optr partitions */ + 202, /* (123) alter_db_optr ::= */ + 202, /* (124) alter_db_optr ::= alter_db_optr replica */ + 202, /* (125) alter_db_optr ::= alter_db_optr quorum */ + 202, /* (126) alter_db_optr ::= alter_db_optr keep */ + 202, /* (127) alter_db_optr ::= alter_db_optr blocks */ + 202, /* (128) alter_db_optr ::= alter_db_optr comp */ + 202, /* (129) alter_db_optr ::= alter_db_optr update */ + 202, /* (130) alter_db_optr ::= alter_db_optr cachelast */ + 203, /* (131) alter_topic_optr ::= alter_db_optr */ + 203, /* (132) alter_topic_optr ::= alter_topic_optr partitions */ + 209, /* (133) typename ::= ids */ + 209, /* (134) typename ::= ids LP signed RP */ + 209, /* (135) typename ::= ids UNSIGNED */ + 238, /* (136) signed ::= INTEGER */ + 238, /* (137) signed ::= PLUS INTEGER */ + 238, /* (138) signed ::= MINUS INTEGER */ + 197, /* (139) cmd ::= CREATE TABLE create_table_args */ + 197, /* (140) cmd ::= CREATE TABLE create_stable_args */ + 197, /* (141) cmd ::= CREATE STABLE create_stable_args */ + 197, /* (142) cmd ::= CREATE TABLE create_table_list */ + 241, /* (143) create_table_list ::= create_from_stable */ + 241, /* (144) create_table_list ::= create_table_list create_from_stable */ + 239, /* (145) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ + 240, /* (146) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ + 242, /* (147) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ + 242, /* (148) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */ + 245, /* (149) tagNamelist ::= tagNamelist COMMA ids */ + 245, /* (150) tagNamelist ::= ids */ + 239, /* (151) create_table_args ::= ifnotexists ids cpxName AS select */ + 243, /* (152) columnlist ::= columnlist COMMA column */ + 243, /* (153) columnlist ::= column */ + 247, /* (154) column ::= ids typename */ + 244, /* (155) tagitemlist ::= tagitemlist COMMA tagitem */ + 244, /* (156) tagitemlist ::= tagitem */ + 248, /* (157) tagitem ::= INTEGER */ + 248, /* (158) tagitem ::= FLOAT */ + 248, /* (159) tagitem ::= STRING */ + 248, /* (160) tagitem ::= BOOL */ + 248, /* (161) tagitem ::= NULL */ + 248, /* (162) tagitem ::= NOW */ + 248, /* (163) tagitem ::= MINUS INTEGER */ + 248, /* (164) tagitem ::= MINUS FLOAT */ + 248, /* (165) tagitem ::= PLUS INTEGER */ + 248, /* (166) tagitem ::= PLUS FLOAT */ + 246, /* (167) 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 */ + 246, /* (168) select ::= LP select RP */ + 262, /* (169) union ::= select */ + 262, /* (170) union ::= union UNION ALL select */ + 197, /* (171) cmd ::= union */ + 246, /* (172) select ::= SELECT selcollist */ + 263, /* (173) sclp ::= selcollist COMMA */ + 263, /* (174) sclp ::= */ + 249, /* (175) selcollist ::= sclp distinct expr as */ + 249, /* (176) selcollist ::= sclp STAR */ + 266, /* (177) as ::= AS ids */ + 266, /* (178) as ::= ids */ + 266, /* (179) as ::= */ + 264, /* (180) distinct ::= DISTINCT */ + 264, /* (181) distinct ::= */ + 250, /* (182) from ::= FROM tablelist */ + 250, /* (183) from ::= FROM sub */ + 268, /* (184) sub ::= LP union RP */ + 268, /* (185) sub ::= LP union RP ids */ + 268, /* (186) sub ::= sub COMMA LP union RP ids */ + 267, /* (187) tablelist ::= ids cpxName */ + 267, /* (188) tablelist ::= ids cpxName ids */ + 267, /* (189) tablelist ::= tablelist COMMA ids cpxName */ + 267, /* (190) tablelist ::= tablelist COMMA ids cpxName ids */ + 269, /* (191) tmvar ::= VARIABLE */ + 252, /* (192) interval_option ::= intervalKey LP tmvar RP */ + 252, /* (193) interval_option ::= intervalKey LP tmvar COMMA tmvar RP */ + 252, /* (194) interval_option ::= */ + 270, /* (195) intervalKey ::= INTERVAL */ + 270, /* (196) intervalKey ::= EVERY */ + 254, /* (197) session_option ::= */ + 254, /* (198) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ + 255, /* (199) windowstate_option ::= */ + 255, /* (200) windowstate_option ::= STATE_WINDOW LP ids RP */ + 256, /* (201) fill_opt ::= */ + 256, /* (202) fill_opt ::= FILL LP ID COMMA tagitemlist RP */ + 256, /* (203) fill_opt ::= FILL LP ID RP */ + 253, /* (204) sliding_opt ::= SLIDING LP tmvar RP */ + 253, /* (205) sliding_opt ::= */ + 259, /* (206) orderby_opt ::= */ + 259, /* (207) orderby_opt ::= ORDER BY sortlist */ + 271, /* (208) sortlist ::= sortlist COMMA item sortorder */ + 271, /* (209) sortlist ::= item sortorder */ + 273, /* (210) item ::= ids cpxName */ + 274, /* (211) sortorder ::= ASC */ + 274, /* (212) sortorder ::= DESC */ + 274, /* (213) sortorder ::= */ + 257, /* (214) groupby_opt ::= */ + 257, /* (215) groupby_opt ::= GROUP BY grouplist */ + 275, /* (216) grouplist ::= grouplist COMMA item */ + 275, /* (217) grouplist ::= item */ + 258, /* (218) having_opt ::= */ + 258, /* (219) having_opt ::= HAVING expr */ + 261, /* (220) limit_opt ::= */ + 261, /* (221) limit_opt ::= LIMIT signed */ + 261, /* (222) limit_opt ::= LIMIT signed OFFSET signed */ + 261, /* (223) limit_opt ::= LIMIT signed COMMA signed */ + 260, /* (224) slimit_opt ::= */ + 260, /* (225) slimit_opt ::= SLIMIT signed */ + 260, /* (226) slimit_opt ::= SLIMIT signed SOFFSET signed */ + 260, /* (227) slimit_opt ::= SLIMIT signed COMMA signed */ + 251, /* (228) where_opt ::= */ + 251, /* (229) where_opt ::= WHERE expr */ + 265, /* (230) expr ::= LP expr RP */ + 265, /* (231) expr ::= ID */ + 265, /* (232) expr ::= ID DOT ID */ + 265, /* (233) expr ::= ID DOT STAR */ + 265, /* (234) expr ::= INTEGER */ + 265, /* (235) expr ::= MINUS INTEGER */ + 265, /* (236) expr ::= PLUS INTEGER */ + 265, /* (237) expr ::= FLOAT */ + 265, /* (238) expr ::= MINUS FLOAT */ + 265, /* (239) expr ::= PLUS FLOAT */ + 265, /* (240) expr ::= STRING */ + 265, /* (241) expr ::= NOW */ + 265, /* (242) expr ::= VARIABLE */ + 265, /* (243) expr ::= PLUS VARIABLE */ + 265, /* (244) expr ::= MINUS VARIABLE */ + 265, /* (245) expr ::= BOOL */ + 265, /* (246) expr ::= NULL */ + 265, /* (247) expr ::= ID LP exprlist RP */ + 265, /* (248) expr ::= ID LP STAR RP */ + 265, /* (249) expr ::= expr IS NULL */ + 265, /* (250) expr ::= expr IS NOT NULL */ + 265, /* (251) expr ::= expr LT expr */ + 265, /* (252) expr ::= expr GT expr */ + 265, /* (253) expr ::= expr LE expr */ + 265, /* (254) expr ::= expr GE expr */ + 265, /* (255) expr ::= expr NE expr */ + 265, /* (256) expr ::= expr EQ expr */ + 265, /* (257) expr ::= expr BETWEEN expr AND expr */ + 265, /* (258) expr ::= expr AND expr */ + 265, /* (259) expr ::= expr OR expr */ + 265, /* (260) expr ::= expr PLUS expr */ + 265, /* (261) expr ::= expr MINUS expr */ + 265, /* (262) expr ::= expr STAR expr */ + 265, /* (263) expr ::= expr SLASH expr */ + 265, /* (264) expr ::= expr REM expr */ + 265, /* (265) expr ::= expr LIKE expr */ + 265, /* (266) expr ::= expr IN LP exprlist RP */ + 205, /* (267) exprlist ::= exprlist COMMA expritem */ + 205, /* (268) exprlist ::= expritem */ + 276, /* (269) expritem ::= expr */ + 276, /* (270) expritem ::= */ + 197, /* (271) cmd ::= RESET QUERY CACHE */ + 197, /* (272) cmd ::= SYNCDB ids REPLICA */ + 197, /* (273) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ + 197, /* (274) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ + 197, /* (275) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */ + 197, /* (276) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ + 197, /* (277) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ + 197, /* (278) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ + 197, /* (279) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ + 197, /* (280) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */ + 197, /* (281) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ + 197, /* (282) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ + 197, /* (283) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */ + 197, /* (284) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ + 197, /* (285) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ + 197, /* (286) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ + 197, /* (287) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */ + 197, /* (288) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */ + 197, /* (289) cmd ::= KILL CONNECTION INTEGER */ + 197, /* (290) cmd ::= KILL STREAM INTEGER COLON INTEGER */ + 197, /* (291) cmd ::= KILL QUERY INTEGER COLON INTEGER */ }; /* For rule J, yyRuleInfoNRhs[J] contains the negative of the number ** of symbols on the right-hand side of that rule. */ static const signed char yyRuleInfoNRhs[] = { - -1, /* (0) program ::= cmd */ - -2, /* (1) cmd ::= SHOW DATABASES */ - -2, /* (2) cmd ::= SHOW TOPICS */ - -2, /* (3) cmd ::= SHOW FUNCTIONS */ - -2, /* (4) cmd ::= SHOW MNODES */ - -2, /* (5) cmd ::= SHOW DNODES */ - -2, /* (6) cmd ::= SHOW ACCOUNTS */ - -2, /* (7) cmd ::= SHOW USERS */ - -2, /* (8) cmd ::= SHOW MODULES */ - -2, /* (9) cmd ::= SHOW QUERIES */ - -2, /* (10) cmd ::= SHOW CONNECTIONS */ - -2, /* (11) cmd ::= SHOW STREAMS */ - -2, /* (12) cmd ::= SHOW VARIABLES */ - -2, /* (13) cmd ::= SHOW SCORES */ - -2, /* (14) cmd ::= SHOW GRANTS */ - -2, /* (15) cmd ::= SHOW VNODES */ - -3, /* (16) cmd ::= SHOW VNODES IPTOKEN */ + -1, /* (0) program ::= cmd */ + -2, /* (1) cmd ::= SHOW DATABASES */ + -2, /* (2) cmd ::= SHOW TOPICS */ + -2, /* (3) cmd ::= SHOW FUNCTIONS */ + -2, /* (4) cmd ::= SHOW MNODES */ + -2, /* (5) cmd ::= SHOW DNODES */ + -2, /* (6) cmd ::= SHOW ACCOUNTS */ + -2, /* (7) cmd ::= SHOW USERS */ + -2, /* (8) cmd ::= SHOW MODULES */ + -2, /* (9) cmd ::= SHOW QUERIES */ + -2, /* (10) cmd ::= SHOW CONNECTIONS */ + -2, /* (11) cmd ::= SHOW STREAMS */ + -2, /* (12) cmd ::= SHOW VARIABLES */ + -2, /* (13) cmd ::= SHOW SCORES */ + -2, /* (14) cmd ::= SHOW GRANTS */ + -2, /* (15) cmd ::= SHOW VNODES */ + -3, /* (16) cmd ::= SHOW VNODES IPTOKEN */ 0, /* (17) dbPrefix ::= */ - -2, /* (18) dbPrefix ::= ids DOT */ + -2, /* (18) dbPrefix ::= ids DOT */ 0, /* (19) cpxName ::= */ - -2, /* (20) cpxName ::= DOT ids */ - -5, /* (21) cmd ::= SHOW CREATE TABLE ids cpxName */ - -5, /* (22) cmd ::= SHOW CREATE STABLE ids cpxName */ - -4, /* (23) cmd ::= SHOW CREATE DATABASE ids */ - -3, /* (24) cmd ::= SHOW dbPrefix TABLES */ - -5, /* (25) cmd ::= SHOW dbPrefix TABLES LIKE ids */ - -3, /* (26) cmd ::= SHOW dbPrefix STABLES */ - -5, /* (27) cmd ::= SHOW dbPrefix STABLES LIKE ids */ - -3, /* (28) cmd ::= SHOW dbPrefix VGROUPS */ - -4, /* (29) cmd ::= SHOW dbPrefix VGROUPS ids */ - -5, /* (30) cmd ::= DROP TABLE ifexists ids cpxName */ - -5, /* (31) cmd ::= DROP STABLE ifexists ids cpxName */ - -4, /* (32) cmd ::= DROP DATABASE ifexists ids */ - -4, /* (33) cmd ::= DROP TOPIC ifexists ids */ - -3, /* (34) cmd ::= DROP FUNCTION ids */ - -3, /* (35) cmd ::= DROP DNODE ids */ - -3, /* (36) cmd ::= DROP USER ids */ - -3, /* (37) cmd ::= DROP ACCOUNT ids */ - -2, /* (38) cmd ::= USE ids */ - -3, /* (39) cmd ::= DESCRIBE ids cpxName */ - -3, /* (40) cmd ::= DESC ids cpxName */ - -5, /* (41) cmd ::= ALTER USER ids PASS ids */ - -5, /* (42) cmd ::= ALTER USER ids PRIVILEGE ids */ - -4, /* (43) cmd ::= ALTER DNODE ids ids */ - -5, /* (44) cmd ::= ALTER DNODE ids ids ids */ - -3, /* (45) cmd ::= ALTER LOCAL ids */ - -4, /* (46) cmd ::= ALTER LOCAL ids ids */ - -4, /* (47) cmd ::= ALTER DATABASE ids alter_db_optr */ - -4, /* (48) cmd ::= ALTER TOPIC ids alter_topic_optr */ - -4, /* (49) cmd ::= ALTER ACCOUNT ids acct_optr */ - -6, /* (50) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ - -6, /* (51) cmd ::= COMPACT VNODES IN LP exprlist RP */ - -1, /* (52) ids ::= ID */ - -1, /* (53) ids ::= STRING */ - -2, /* (54) ifexists ::= IF EXISTS */ + -2, /* (20) cpxName ::= DOT ids */ + -5, /* (21) cmd ::= SHOW CREATE TABLE ids cpxName */ + -5, /* (22) cmd ::= SHOW CREATE STABLE ids cpxName */ + -4, /* (23) cmd ::= SHOW CREATE DATABASE ids */ + -3, /* (24) cmd ::= SHOW dbPrefix TABLES */ + -5, /* (25) cmd ::= SHOW dbPrefix TABLES LIKE ids */ + -3, /* (26) cmd ::= SHOW dbPrefix STABLES */ + -5, /* (27) cmd ::= SHOW dbPrefix STABLES LIKE ids */ + -3, /* (28) cmd ::= SHOW dbPrefix VGROUPS */ + -4, /* (29) cmd ::= SHOW dbPrefix VGROUPS ids */ + -5, /* (30) cmd ::= DROP TABLE ifexists ids cpxName */ + -5, /* (31) cmd ::= DROP STABLE ifexists ids cpxName */ + -4, /* (32) cmd ::= DROP DATABASE ifexists ids */ + -4, /* (33) cmd ::= DROP TOPIC ifexists ids */ + -3, /* (34) cmd ::= DROP FUNCTION ids */ + -3, /* (35) cmd ::= DROP DNODE ids */ + -3, /* (36) cmd ::= DROP USER ids */ + -3, /* (37) cmd ::= DROP ACCOUNT ids */ + -2, /* (38) cmd ::= USE ids */ + -3, /* (39) cmd ::= DESCRIBE ids cpxName */ + -3, /* (40) cmd ::= DESC ids cpxName */ + -5, /* (41) cmd ::= ALTER USER ids PASS ids */ + -5, /* (42) cmd ::= ALTER USER ids PRIVILEGE ids */ + -4, /* (43) cmd ::= ALTER DNODE ids ids */ + -5, /* (44) cmd ::= ALTER DNODE ids ids ids */ + -3, /* (45) cmd ::= ALTER LOCAL ids */ + -4, /* (46) cmd ::= ALTER LOCAL ids ids */ + -4, /* (47) cmd ::= ALTER DATABASE ids alter_db_optr */ + -4, /* (48) cmd ::= ALTER TOPIC ids alter_topic_optr */ + -4, /* (49) cmd ::= ALTER ACCOUNT ids acct_optr */ + -6, /* (50) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ + -6, /* (51) cmd ::= COMPACT VNODES IN LP exprlist RP */ + -1, /* (52) ids ::= ID */ + -1, /* (53) ids ::= STRING */ + -2, /* (54) ifexists ::= IF EXISTS */ 0, /* (55) ifexists ::= */ - -3, /* (56) ifnotexists ::= IF NOT EXISTS */ + -3, /* (56) ifnotexists ::= IF NOT EXISTS */ 0, /* (57) ifnotexists ::= */ - -3, /* (58) cmd ::= CREATE DNODE ids */ - -6, /* (59) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ - -5, /* (60) cmd ::= CREATE DATABASE ifnotexists ids db_optr */ - -5, /* (61) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ - -8, /* (62) cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ - -9, /* (63) cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ - -5, /* (64) cmd ::= CREATE USER ids PASS ids */ + -3, /* (58) cmd ::= CREATE DNODE ids */ + -6, /* (59) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ + -5, /* (60) cmd ::= CREATE DATABASE ifnotexists ids db_optr */ + -5, /* (61) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ + -8, /* (62) cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ + -9, /* (63) cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ + -5, /* (64) cmd ::= CREATE USER ids PASS ids */ 0, /* (65) bufsize ::= */ - -2, /* (66) bufsize ::= BUFSIZE INTEGER */ + -2, /* (66) bufsize ::= BUFSIZE INTEGER */ 0, /* (67) pps ::= */ - -2, /* (68) pps ::= PPS INTEGER */ + -2, /* (68) pps ::= PPS INTEGER */ 0, /* (69) tseries ::= */ - -2, /* (70) tseries ::= TSERIES INTEGER */ + -2, /* (70) tseries ::= TSERIES INTEGER */ 0, /* (71) dbs ::= */ - -2, /* (72) dbs ::= DBS INTEGER */ + -2, /* (72) dbs ::= DBS INTEGER */ 0, /* (73) streams ::= */ - -2, /* (74) streams ::= STREAMS INTEGER */ + -2, /* (74) streams ::= STREAMS INTEGER */ 0, /* (75) storage ::= */ - -2, /* (76) storage ::= STORAGE INTEGER */ + -2, /* (76) storage ::= STORAGE INTEGER */ 0, /* (77) qtime ::= */ - -2, /* (78) qtime ::= QTIME INTEGER */ + -2, /* (78) qtime ::= QTIME INTEGER */ 0, /* (79) users ::= */ - -2, /* (80) users ::= USERS INTEGER */ + -2, /* (80) users ::= USERS INTEGER */ 0, /* (81) conns ::= */ - -2, /* (82) conns ::= CONNS INTEGER */ + -2, /* (82) conns ::= CONNS INTEGER */ 0, /* (83) state ::= */ - -2, /* (84) state ::= STATE ids */ - -9, /* (85) acct_optr ::= pps tseries storage streams qtime dbs users conns state */ - -3, /* (86) intitemlist ::= intitemlist COMMA intitem */ - -1, /* (87) intitemlist ::= intitem */ - -1, /* (88) intitem ::= INTEGER */ - -2, /* (89) keep ::= KEEP intitemlist */ - -2, /* (90) cache ::= CACHE INTEGER */ - -2, /* (91) replica ::= REPLICA INTEGER */ - -2, /* (92) quorum ::= QUORUM INTEGER */ - -2, /* (93) days ::= DAYS INTEGER */ - -2, /* (94) minrows ::= MINROWS INTEGER */ - -2, /* (95) maxrows ::= MAXROWS INTEGER */ - -2, /* (96) blocks ::= BLOCKS INTEGER */ - -2, /* (97) ctime ::= CTIME INTEGER */ - -2, /* (98) wal ::= WAL INTEGER */ - -2, /* (99) fsync ::= FSYNC INTEGER */ - -2, /* (100) comp ::= COMP INTEGER */ - -2, /* (101) prec ::= PRECISION STRING */ - -2, /* (102) update ::= UPDATE INTEGER */ - -2, /* (103) cachelast ::= CACHELAST INTEGER */ - -2, /* (104) partitions ::= PARTITIONS INTEGER */ + -2, /* (84) state ::= STATE ids */ + -9, /* (85) acct_optr ::= pps tseries storage streams qtime dbs users conns state */ + -3, /* (86) intitemlist ::= intitemlist COMMA intitem */ + -1, /* (87) intitemlist ::= intitem */ + -1, /* (88) intitem ::= INTEGER */ + -2, /* (89) keep ::= KEEP intitemlist */ + -2, /* (90) cache ::= CACHE INTEGER */ + -2, /* (91) replica ::= REPLICA INTEGER */ + -2, /* (92) quorum ::= QUORUM INTEGER */ + -2, /* (93) days ::= DAYS INTEGER */ + -2, /* (94) minrows ::= MINROWS INTEGER */ + -2, /* (95) maxrows ::= MAXROWS INTEGER */ + -2, /* (96) blocks ::= BLOCKS INTEGER */ + -2, /* (97) ctime ::= CTIME INTEGER */ + -2, /* (98) wal ::= WAL INTEGER */ + -2, /* (99) fsync ::= FSYNC INTEGER */ + -2, /* (100) comp ::= COMP INTEGER */ + -2, /* (101) prec ::= PRECISION STRING */ + -2, /* (102) update ::= UPDATE INTEGER */ + -2, /* (103) cachelast ::= CACHELAST INTEGER */ + -2, /* (104) partitions ::= PARTITIONS INTEGER */ 0, /* (105) db_optr ::= */ - -2, /* (106) db_optr ::= db_optr cache */ - -2, /* (107) db_optr ::= db_optr replica */ - -2, /* (108) db_optr ::= db_optr quorum */ - -2, /* (109) db_optr ::= db_optr days */ - -2, /* (110) db_optr ::= db_optr minrows */ - -2, /* (111) db_optr ::= db_optr maxrows */ - -2, /* (112) db_optr ::= db_optr blocks */ - -2, /* (113) db_optr ::= db_optr ctime */ - -2, /* (114) db_optr ::= db_optr wal */ - -2, /* (115) db_optr ::= db_optr fsync */ - -2, /* (116) db_optr ::= db_optr comp */ - -2, /* (117) db_optr ::= db_optr prec */ - -2, /* (118) db_optr ::= db_optr keep */ - -2, /* (119) db_optr ::= db_optr update */ - -2, /* (120) db_optr ::= db_optr cachelast */ - -1, /* (121) topic_optr ::= db_optr */ - -2, /* (122) topic_optr ::= topic_optr partitions */ + -2, /* (106) db_optr ::= db_optr cache */ + -2, /* (107) db_optr ::= db_optr replica */ + -2, /* (108) db_optr ::= db_optr quorum */ + -2, /* (109) db_optr ::= db_optr days */ + -2, /* (110) db_optr ::= db_optr minrows */ + -2, /* (111) db_optr ::= db_optr maxrows */ + -2, /* (112) db_optr ::= db_optr blocks */ + -2, /* (113) db_optr ::= db_optr ctime */ + -2, /* (114) db_optr ::= db_optr wal */ + -2, /* (115) db_optr ::= db_optr fsync */ + -2, /* (116) db_optr ::= db_optr comp */ + -2, /* (117) db_optr ::= db_optr prec */ + -2, /* (118) db_optr ::= db_optr keep */ + -2, /* (119) db_optr ::= db_optr update */ + -2, /* (120) db_optr ::= db_optr cachelast */ + -1, /* (121) topic_optr ::= db_optr */ + -2, /* (122) topic_optr ::= topic_optr partitions */ 0, /* (123) alter_db_optr ::= */ - -2, /* (124) alter_db_optr ::= alter_db_optr replica */ - -2, /* (125) alter_db_optr ::= alter_db_optr quorum */ - -2, /* (126) alter_db_optr ::= alter_db_optr keep */ - -2, /* (127) alter_db_optr ::= alter_db_optr blocks */ - -2, /* (128) alter_db_optr ::= alter_db_optr comp */ - -2, /* (129) alter_db_optr ::= alter_db_optr update */ - -2, /* (130) alter_db_optr ::= alter_db_optr cachelast */ - -1, /* (131) alter_topic_optr ::= alter_db_optr */ - -2, /* (132) alter_topic_optr ::= alter_topic_optr partitions */ - -1, /* (133) typename ::= ids */ - -4, /* (134) typename ::= ids LP signed RP */ - -2, /* (135) typename ::= ids UNSIGNED */ - -1, /* (136) signed ::= INTEGER */ - -2, /* (137) signed ::= PLUS INTEGER */ - -2, /* (138) signed ::= MINUS INTEGER */ - -3, /* (139) cmd ::= CREATE TABLE create_table_args */ - -3, /* (140) cmd ::= CREATE TABLE create_stable_args */ - -3, /* (141) cmd ::= CREATE STABLE create_stable_args */ - -3, /* (142) cmd ::= CREATE TABLE create_table_list */ - -1, /* (143) create_table_list ::= create_from_stable */ - -2, /* (144) create_table_list ::= create_table_list create_from_stable */ - -6, /* (145) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ - -10, /* (146) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ - -10, /* (147) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ - -13, /* (148) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */ - -3, /* (149) tagNamelist ::= tagNamelist COMMA ids */ - -1, /* (150) tagNamelist ::= ids */ - -5, /* (151) create_table_args ::= ifnotexists ids cpxName AS select */ - -3, /* (152) columnlist ::= columnlist COMMA column */ - -1, /* (153) columnlist ::= column */ - -2, /* (154) column ::= ids typename */ - -3, /* (155) tagitemlist ::= tagitemlist COMMA tagitem */ - -1, /* (156) tagitemlist ::= tagitem */ - -1, /* (157) tagitem ::= INTEGER */ - -1, /* (158) tagitem ::= FLOAT */ - -1, /* (159) tagitem ::= STRING */ - -1, /* (160) tagitem ::= BOOL */ - -1, /* (161) tagitem ::= NULL */ - -1, /* (162) tagitem ::= NOW */ - -2, /* (163) tagitem ::= MINUS INTEGER */ - -2, /* (164) tagitem ::= MINUS FLOAT */ - -2, /* (165) tagitem ::= PLUS INTEGER */ - -2, /* (166) tagitem ::= PLUS FLOAT */ - -14, /* (167) 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 */ - -3, /* (168) select ::= LP select RP */ - -1, /* (169) union ::= select */ - -4, /* (170) union ::= union UNION ALL select */ - -1, /* (171) cmd ::= union */ - -2, /* (172) select ::= SELECT selcollist */ - -2, /* (173) sclp ::= selcollist COMMA */ + -2, /* (124) alter_db_optr ::= alter_db_optr replica */ + -2, /* (125) alter_db_optr ::= alter_db_optr quorum */ + -2, /* (126) alter_db_optr ::= alter_db_optr keep */ + -2, /* (127) alter_db_optr ::= alter_db_optr blocks */ + -2, /* (128) alter_db_optr ::= alter_db_optr comp */ + -2, /* (129) alter_db_optr ::= alter_db_optr update */ + -2, /* (130) alter_db_optr ::= alter_db_optr cachelast */ + -1, /* (131) alter_topic_optr ::= alter_db_optr */ + -2, /* (132) alter_topic_optr ::= alter_topic_optr partitions */ + -1, /* (133) typename ::= ids */ + -4, /* (134) typename ::= ids LP signed RP */ + -2, /* (135) typename ::= ids UNSIGNED */ + -1, /* (136) signed ::= INTEGER */ + -2, /* (137) signed ::= PLUS INTEGER */ + -2, /* (138) signed ::= MINUS INTEGER */ + -3, /* (139) cmd ::= CREATE TABLE create_table_args */ + -3, /* (140) cmd ::= CREATE TABLE create_stable_args */ + -3, /* (141) cmd ::= CREATE STABLE create_stable_args */ + -3, /* (142) cmd ::= CREATE TABLE create_table_list */ + -1, /* (143) create_table_list ::= create_from_stable */ + -2, /* (144) create_table_list ::= create_table_list create_from_stable */ + -6, /* (145) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ + -10, /* (146) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ + -10, /* (147) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ + -13, /* (148) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */ + -3, /* (149) tagNamelist ::= tagNamelist COMMA ids */ + -1, /* (150) tagNamelist ::= ids */ + -5, /* (151) create_table_args ::= ifnotexists ids cpxName AS select */ + -3, /* (152) columnlist ::= columnlist COMMA column */ + -1, /* (153) columnlist ::= column */ + -2, /* (154) column ::= ids typename */ + -3, /* (155) tagitemlist ::= tagitemlist COMMA tagitem */ + -1, /* (156) tagitemlist ::= tagitem */ + -1, /* (157) tagitem ::= INTEGER */ + -1, /* (158) tagitem ::= FLOAT */ + -1, /* (159) tagitem ::= STRING */ + -1, /* (160) tagitem ::= BOOL */ + -1, /* (161) tagitem ::= NULL */ + -1, /* (162) tagitem ::= NOW */ + -2, /* (163) tagitem ::= MINUS INTEGER */ + -2, /* (164) tagitem ::= MINUS FLOAT */ + -2, /* (165) tagitem ::= PLUS INTEGER */ + -2, /* (166) tagitem ::= PLUS FLOAT */ + -14, /* (167) 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 */ + -3, /* (168) select ::= LP select RP */ + -1, /* (169) union ::= select */ + -4, /* (170) union ::= union UNION ALL select */ + -1, /* (171) cmd ::= union */ + -2, /* (172) select ::= SELECT selcollist */ + -2, /* (173) sclp ::= selcollist COMMA */ 0, /* (174) sclp ::= */ - -4, /* (175) selcollist ::= sclp distinct expr as */ - -2, /* (176) selcollist ::= sclp STAR */ - -2, /* (177) as ::= AS ids */ - -1, /* (178) as ::= ids */ + -4, /* (175) selcollist ::= sclp distinct expr as */ + -2, /* (176) selcollist ::= sclp STAR */ + -2, /* (177) as ::= AS ids */ + -1, /* (178) as ::= ids */ 0, /* (179) as ::= */ - -1, /* (180) distinct ::= DISTINCT */ + -1, /* (180) distinct ::= DISTINCT */ 0, /* (181) distinct ::= */ - -2, /* (182) from ::= FROM tablelist */ - -2, /* (183) from ::= FROM sub */ - -3, /* (184) sub ::= LP union RP */ - -4, /* (185) sub ::= LP union RP ids */ - -6, /* (186) sub ::= sub COMMA LP union RP ids */ - -2, /* (187) tablelist ::= ids cpxName */ - -3, /* (188) tablelist ::= ids cpxName ids */ - -4, /* (189) tablelist ::= tablelist COMMA ids cpxName */ - -5, /* (190) tablelist ::= tablelist COMMA ids cpxName ids */ - -1, /* (191) tmvar ::= VARIABLE */ - -4, /* (192) interval_option ::= intervalKey LP tmvar RP */ - -6, /* (193) interval_option ::= intervalKey LP tmvar COMMA tmvar RP */ + -2, /* (182) from ::= FROM tablelist */ + -2, /* (183) from ::= FROM sub */ + -3, /* (184) sub ::= LP union RP */ + -4, /* (185) sub ::= LP union RP ids */ + -6, /* (186) sub ::= sub COMMA LP union RP ids */ + -2, /* (187) tablelist ::= ids cpxName */ + -3, /* (188) tablelist ::= ids cpxName ids */ + -4, /* (189) tablelist ::= tablelist COMMA ids cpxName */ + -5, /* (190) tablelist ::= tablelist COMMA ids cpxName ids */ + -1, /* (191) tmvar ::= VARIABLE */ + -4, /* (192) interval_option ::= intervalKey LP tmvar RP */ + -6, /* (193) interval_option ::= intervalKey LP tmvar COMMA tmvar RP */ 0, /* (194) interval_option ::= */ - -1, /* (195) intervalKey ::= INTERVAL */ - -1, /* (196) intervalKey ::= EVERY */ + -1, /* (195) intervalKey ::= INTERVAL */ + -1, /* (196) intervalKey ::= EVERY */ 0, /* (197) session_option ::= */ - -7, /* (198) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ + -7, /* (198) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ 0, /* (199) windowstate_option ::= */ - -4, /* (200) windowstate_option ::= STATE_WINDOW LP ids RP */ + -4, /* (200) windowstate_option ::= STATE_WINDOW LP ids RP */ 0, /* (201) fill_opt ::= */ - -6, /* (202) fill_opt ::= FILL LP ID COMMA tagitemlist RP */ - -4, /* (203) fill_opt ::= FILL LP ID RP */ - -4, /* (204) sliding_opt ::= SLIDING LP tmvar RP */ + -6, /* (202) fill_opt ::= FILL LP ID COMMA tagitemlist RP */ + -4, /* (203) fill_opt ::= FILL LP ID RP */ + -4, /* (204) sliding_opt ::= SLIDING LP tmvar RP */ 0, /* (205) sliding_opt ::= */ 0, /* (206) orderby_opt ::= */ - -3, /* (207) orderby_opt ::= ORDER BY sortlist */ - -4, /* (208) sortlist ::= sortlist COMMA item sortorder */ - -2, /* (209) sortlist ::= item sortorder */ - -2, /* (210) item ::= ids cpxName */ - -1, /* (211) sortorder ::= ASC */ - -1, /* (212) sortorder ::= DESC */ + -3, /* (207) orderby_opt ::= ORDER BY sortlist */ + -4, /* (208) sortlist ::= sortlist COMMA item sortorder */ + -2, /* (209) sortlist ::= item sortorder */ + -2, /* (210) item ::= ids cpxName */ + -1, /* (211) sortorder ::= ASC */ + -1, /* (212) sortorder ::= DESC */ 0, /* (213) sortorder ::= */ 0, /* (214) groupby_opt ::= */ - -3, /* (215) groupby_opt ::= GROUP BY grouplist */ - -3, /* (216) grouplist ::= grouplist COMMA item */ - -1, /* (217) grouplist ::= item */ + -3, /* (215) groupby_opt ::= GROUP BY grouplist */ + -3, /* (216) grouplist ::= grouplist COMMA item */ + -1, /* (217) grouplist ::= item */ 0, /* (218) having_opt ::= */ - -2, /* (219) having_opt ::= HAVING expr */ + -2, /* (219) having_opt ::= HAVING expr */ 0, /* (220) limit_opt ::= */ - -2, /* (221) limit_opt ::= LIMIT signed */ - -4, /* (222) limit_opt ::= LIMIT signed OFFSET signed */ - -4, /* (223) limit_opt ::= LIMIT signed COMMA signed */ + -2, /* (221) limit_opt ::= LIMIT signed */ + -4, /* (222) limit_opt ::= LIMIT signed OFFSET signed */ + -4, /* (223) limit_opt ::= LIMIT signed COMMA signed */ 0, /* (224) slimit_opt ::= */ - -2, /* (225) slimit_opt ::= SLIMIT signed */ - -4, /* (226) slimit_opt ::= SLIMIT signed SOFFSET signed */ - -4, /* (227) slimit_opt ::= SLIMIT signed COMMA signed */ + -2, /* (225) slimit_opt ::= SLIMIT signed */ + -4, /* (226) slimit_opt ::= SLIMIT signed SOFFSET signed */ + -4, /* (227) slimit_opt ::= SLIMIT signed COMMA signed */ 0, /* (228) where_opt ::= */ - -2, /* (229) where_opt ::= WHERE expr */ - -3, /* (230) expr ::= LP expr RP */ - -1, /* (231) expr ::= ID */ - -3, /* (232) expr ::= ID DOT ID */ - -3, /* (233) expr ::= ID DOT STAR */ - -1, /* (234) expr ::= INTEGER */ - -2, /* (235) expr ::= MINUS INTEGER */ - -2, /* (236) expr ::= PLUS INTEGER */ - -1, /* (237) expr ::= FLOAT */ - -2, /* (238) expr ::= MINUS FLOAT */ - -2, /* (239) expr ::= PLUS FLOAT */ - -1, /* (240) expr ::= STRING */ - -1, /* (241) expr ::= NOW */ - -1, /* (242) expr ::= VARIABLE */ - -2, /* (243) expr ::= PLUS VARIABLE */ - -2, /* (244) expr ::= MINUS VARIABLE */ - -1, /* (245) expr ::= BOOL */ - -1, /* (246) expr ::= NULL */ - -4, /* (247) expr ::= ID LP exprlist RP */ - -4, /* (248) expr ::= ID LP STAR RP */ - -3, /* (249) expr ::= expr IS NULL */ - -4, /* (250) expr ::= expr IS NOT NULL */ - -3, /* (251) expr ::= expr LT expr */ - -3, /* (252) expr ::= expr GT expr */ - -3, /* (253) expr ::= expr LE expr */ - -3, /* (254) expr ::= expr GE expr */ - -3, /* (255) expr ::= expr NE expr */ - -3, /* (256) expr ::= expr EQ expr */ - -5, /* (257) expr ::= expr BETWEEN expr AND expr */ - -3, /* (258) expr ::= expr AND expr */ - -3, /* (259) expr ::= expr OR expr */ - -3, /* (260) expr ::= expr PLUS expr */ - -3, /* (261) expr ::= expr MINUS expr */ - -3, /* (262) expr ::= expr STAR expr */ - -3, /* (263) expr ::= expr SLASH expr */ - -3, /* (264) expr ::= expr REM expr */ - -3, /* (265) expr ::= expr LIKE expr */ - -5, /* (266) expr ::= expr IN LP exprlist RP */ - -3, /* (267) exprlist ::= exprlist COMMA expritem */ - -1, /* (268) exprlist ::= expritem */ - -1, /* (269) expritem ::= expr */ + -2, /* (229) where_opt ::= WHERE expr */ + -3, /* (230) expr ::= LP expr RP */ + -1, /* (231) expr ::= ID */ + -3, /* (232) expr ::= ID DOT ID */ + -3, /* (233) expr ::= ID DOT STAR */ + -1, /* (234) expr ::= INTEGER */ + -2, /* (235) expr ::= MINUS INTEGER */ + -2, /* (236) expr ::= PLUS INTEGER */ + -1, /* (237) expr ::= FLOAT */ + -2, /* (238) expr ::= MINUS FLOAT */ + -2, /* (239) expr ::= PLUS FLOAT */ + -1, /* (240) expr ::= STRING */ + -1, /* (241) expr ::= NOW */ + -1, /* (242) expr ::= VARIABLE */ + -2, /* (243) expr ::= PLUS VARIABLE */ + -2, /* (244) expr ::= MINUS VARIABLE */ + -1, /* (245) expr ::= BOOL */ + -1, /* (246) expr ::= NULL */ + -4, /* (247) expr ::= ID LP exprlist RP */ + -4, /* (248) expr ::= ID LP STAR RP */ + -3, /* (249) expr ::= expr IS NULL */ + -4, /* (250) expr ::= expr IS NOT NULL */ + -3, /* (251) expr ::= expr LT expr */ + -3, /* (252) expr ::= expr GT expr */ + -3, /* (253) expr ::= expr LE expr */ + -3, /* (254) expr ::= expr GE expr */ + -3, /* (255) expr ::= expr NE expr */ + -3, /* (256) expr ::= expr EQ expr */ + -5, /* (257) expr ::= expr BETWEEN expr AND expr */ + -3, /* (258) expr ::= expr AND expr */ + -3, /* (259) expr ::= expr OR expr */ + -3, /* (260) expr ::= expr PLUS expr */ + -3, /* (261) expr ::= expr MINUS expr */ + -3, /* (262) expr ::= expr STAR expr */ + -3, /* (263) expr ::= expr SLASH expr */ + -3, /* (264) expr ::= expr REM expr */ + -3, /* (265) expr ::= expr LIKE expr */ + -5, /* (266) expr ::= expr IN LP exprlist RP */ + -3, /* (267) exprlist ::= exprlist COMMA expritem */ + -1, /* (268) exprlist ::= expritem */ + -1, /* (269) expritem ::= expr */ 0, /* (270) expritem ::= */ - -3, /* (271) cmd ::= RESET QUERY CACHE */ - -3, /* (272) cmd ::= SYNCDB ids REPLICA */ - -7, /* (273) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ - -7, /* (274) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ - -7, /* (275) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */ - -7, /* (276) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ - -7, /* (277) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ - -8, /* (278) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ - -9, /* (279) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ - -7, /* (280) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */ - -7, /* (281) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ - -7, /* (282) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ - -7, /* (283) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */ - -7, /* (284) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ - -7, /* (285) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ - -8, /* (286) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ - -9, /* (287) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */ - -7, /* (288) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */ - -3, /* (289) cmd ::= KILL CONNECTION INTEGER */ - -5, /* (290) cmd ::= KILL STREAM INTEGER COLON INTEGER */ - -5, /* (291) cmd ::= KILL QUERY INTEGER COLON INTEGER */ + -3, /* (271) cmd ::= RESET QUERY CACHE */ + -3, /* (272) cmd ::= SYNCDB ids REPLICA */ + -7, /* (273) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ + -7, /* (274) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ + -7, /* (275) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */ + -7, /* (276) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ + -7, /* (277) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ + -8, /* (278) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ + -9, /* (279) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ + -7, /* (280) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */ + -7, /* (281) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ + -7, /* (282) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ + -7, /* (283) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */ + -7, /* (284) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ + -7, /* (285) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ + -8, /* (286) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ + -9, /* (287) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */ + -7, /* (288) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */ + -3, /* (289) cmd ::= KILL CONNECTION INTEGER */ + -5, /* (290) cmd ::= KILL STREAM INTEGER COLON INTEGER */ + -5, /* (291) cmd ::= KILL QUERY INTEGER COLON INTEGER */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -2662,1575 +2662,1575 @@ static void yy_accept(yyParser*); /* Forward Declaration */ ** means that the extra parameters have no performance impact. */ static YYACTIONTYPE yy_reduce( - yyParser *yypParser, /* The parser */ - unsigned int yyruleno, /* Number of the rule by which to reduce */ - int yyLookahead, /* Lookahead token, or YYNOCODE if none */ - ParseTOKENTYPE yyLookaheadToken /* Value of the lookahead token */ - ParseCTX_PDECL /* %extra_context */ + yyParser *yypParser, /* The parser */ + unsigned int yyruleno, /* Number of the rule by which to reduce */ + int yyLookahead, /* Lookahead token, or YYNOCODE if none */ + ParseTOKENTYPE yyLookaheadToken /* Value of the lookahead token */ + ParseCTX_PDECL /* %extra_context */ ){ int yygoto; /* The next state */ YYACTIONTYPE yyact; /* The next action */ yyStackEntry *yymsp; /* The top of the parser's stack */ int yysize; /* Amount to pop the stack */ ParseARG_FETCH - (void)yyLookahead; + (void)yyLookahead; (void)yyLookaheadToken; yymsp = yypParser->yytos; switch( yyruleno ){ - /* Beginning here are the reduction cases. A typical example + /* Beginning here are the reduction cases. A typical example ** follows: ** case 0: ** #line ** { ... } // User supplied code ** #line ** break; - */ -/********** Begin reduce actions **********************************************/ - YYMINORTYPE yylhsminor; - case 0: /* program ::= cmd */ - case 139: /* cmd ::= CREATE TABLE create_table_args */ yytestcase(yyruleno==139); - case 140: /* cmd ::= CREATE TABLE create_stable_args */ yytestcase(yyruleno==140); - case 141: /* cmd ::= CREATE STABLE create_stable_args */ yytestcase(yyruleno==141); + */ + /********** Begin reduce actions **********************************************/ + YYMINORTYPE yylhsminor; + case 0: /* program ::= cmd */ + case 139: /* cmd ::= CREATE TABLE create_table_args */ yytestcase(yyruleno==139); + case 140: /* cmd ::= CREATE TABLE create_stable_args */ yytestcase(yyruleno==140); + case 141: /* cmd ::= CREATE STABLE create_stable_args */ yytestcase(yyruleno==141); #line 63 "sql.y" -{} + {} #line 2697 "sql.c" - break; - case 1: /* cmd ::= SHOW DATABASES */ + break; + case 1: /* cmd ::= SHOW DATABASES */ #line 66 "sql.y" -{ setShowOptions(pInfo, TSDB_MGMT_TABLE_DB, 0, 0);} + { setShowOptions(pInfo, TSDB_MGMT_TABLE_DB, 0, 0);} #line 2702 "sql.c" - break; - case 2: /* cmd ::= SHOW TOPICS */ + break; + case 2: /* cmd ::= SHOW TOPICS */ #line 67 "sql.y" -{ setShowOptions(pInfo, TSDB_MGMT_TABLE_TP, 0, 0);} + { setShowOptions(pInfo, TSDB_MGMT_TABLE_TP, 0, 0);} #line 2707 "sql.c" - break; - case 3: /* cmd ::= SHOW FUNCTIONS */ + break; + case 3: /* cmd ::= SHOW FUNCTIONS */ #line 68 "sql.y" -{ setShowOptions(pInfo, TSDB_MGMT_TABLE_FUNCTION, 0, 0);} + { setShowOptions(pInfo, TSDB_MGMT_TABLE_FUNCTION, 0, 0);} #line 2712 "sql.c" - break; - case 4: /* cmd ::= SHOW MNODES */ + break; + case 4: /* cmd ::= SHOW MNODES */ #line 69 "sql.y" -{ setShowOptions(pInfo, TSDB_MGMT_TABLE_MNODE, 0, 0);} + { setShowOptions(pInfo, TSDB_MGMT_TABLE_MNODE, 0, 0);} #line 2717 "sql.c" - break; - case 5: /* cmd ::= SHOW DNODES */ + break; + case 5: /* cmd ::= SHOW DNODES */ #line 70 "sql.y" -{ setShowOptions(pInfo, TSDB_MGMT_TABLE_DNODE, 0, 0);} + { setShowOptions(pInfo, TSDB_MGMT_TABLE_DNODE, 0, 0);} #line 2722 "sql.c" - break; - case 6: /* cmd ::= SHOW ACCOUNTS */ + break; + case 6: /* cmd ::= SHOW ACCOUNTS */ #line 71 "sql.y" -{ setShowOptions(pInfo, TSDB_MGMT_TABLE_ACCT, 0, 0);} + { setShowOptions(pInfo, TSDB_MGMT_TABLE_ACCT, 0, 0);} #line 2727 "sql.c" - break; - case 7: /* cmd ::= SHOW USERS */ + break; + case 7: /* cmd ::= SHOW USERS */ #line 72 "sql.y" -{ setShowOptions(pInfo, TSDB_MGMT_TABLE_USER, 0, 0);} + { setShowOptions(pInfo, TSDB_MGMT_TABLE_USER, 0, 0);} #line 2732 "sql.c" - break; - case 8: /* cmd ::= SHOW MODULES */ + break; + case 8: /* cmd ::= SHOW MODULES */ #line 74 "sql.y" -{ setShowOptions(pInfo, TSDB_MGMT_TABLE_MODULE, 0, 0); } + { setShowOptions(pInfo, TSDB_MGMT_TABLE_MODULE, 0, 0); } #line 2737 "sql.c" - break; - case 9: /* cmd ::= SHOW QUERIES */ + break; + case 9: /* cmd ::= SHOW QUERIES */ #line 75 "sql.y" -{ setShowOptions(pInfo, TSDB_MGMT_TABLE_QUERIES, 0, 0); } + { setShowOptions(pInfo, TSDB_MGMT_TABLE_QUERIES, 0, 0); } #line 2742 "sql.c" - break; - case 10: /* cmd ::= SHOW CONNECTIONS */ + break; + case 10: /* cmd ::= SHOW CONNECTIONS */ #line 76 "sql.y" -{ setShowOptions(pInfo, TSDB_MGMT_TABLE_CONNS, 0, 0);} + { setShowOptions(pInfo, TSDB_MGMT_TABLE_CONNS, 0, 0);} #line 2747 "sql.c" - break; - case 11: /* cmd ::= SHOW STREAMS */ + break; + case 11: /* cmd ::= SHOW STREAMS */ #line 77 "sql.y" -{ setShowOptions(pInfo, TSDB_MGMT_TABLE_STREAMS, 0, 0); } + { setShowOptions(pInfo, TSDB_MGMT_TABLE_STREAMS, 0, 0); } #line 2752 "sql.c" - break; - case 12: /* cmd ::= SHOW VARIABLES */ + break; + case 12: /* cmd ::= SHOW VARIABLES */ #line 78 "sql.y" -{ setShowOptions(pInfo, TSDB_MGMT_TABLE_VARIABLES, 0, 0); } + { setShowOptions(pInfo, TSDB_MGMT_TABLE_VARIABLES, 0, 0); } #line 2757 "sql.c" - break; - case 13: /* cmd ::= SHOW SCORES */ + break; + case 13: /* cmd ::= SHOW SCORES */ #line 79 "sql.y" -{ setShowOptions(pInfo, TSDB_MGMT_TABLE_SCORES, 0, 0); } + { setShowOptions(pInfo, TSDB_MGMT_TABLE_SCORES, 0, 0); } #line 2762 "sql.c" - break; - case 14: /* cmd ::= SHOW GRANTS */ + break; + case 14: /* cmd ::= SHOW GRANTS */ #line 80 "sql.y" -{ setShowOptions(pInfo, TSDB_MGMT_TABLE_GRANTS, 0, 0); } + { setShowOptions(pInfo, TSDB_MGMT_TABLE_GRANTS, 0, 0); } #line 2767 "sql.c" - break; - case 15: /* cmd ::= SHOW VNODES */ + break; + case 15: /* cmd ::= SHOW VNODES */ #line 82 "sql.y" -{ setShowOptions(pInfo, TSDB_MGMT_TABLE_VNODES, 0, 0); } + { setShowOptions(pInfo, TSDB_MGMT_TABLE_VNODES, 0, 0); } #line 2772 "sql.c" - break; - case 16: /* cmd ::= SHOW VNODES IPTOKEN */ + break; + case 16: /* cmd ::= SHOW VNODES IPTOKEN */ #line 83 "sql.y" -{ setShowOptions(pInfo, TSDB_MGMT_TABLE_VNODES, &yymsp[0].minor.yy0, 0); } + { setShowOptions(pInfo, TSDB_MGMT_TABLE_VNODES, &yymsp[0].minor.yy0, 0); } #line 2777 "sql.c" - break; - case 17: /* dbPrefix ::= */ + break; + case 17: /* dbPrefix ::= */ #line 87 "sql.y" -{yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.type = 0;} + {yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.type = 0;} #line 2782 "sql.c" - break; - case 18: /* dbPrefix ::= ids DOT */ + break; + case 18: /* dbPrefix ::= ids DOT */ #line 88 "sql.y" -{yylhsminor.yy0 = yymsp[-1].minor.yy0; } + {yylhsminor.yy0 = yymsp[-1].minor.yy0; } #line 2787 "sql.c" - yymsp[-1].minor.yy0 = yylhsminor.yy0; - break; - case 19: /* cpxName ::= */ + yymsp[-1].minor.yy0 = yylhsminor.yy0; + break; + case 19: /* cpxName ::= */ #line 91 "sql.y" -{yymsp[1].minor.yy0.n = 0; } + {yymsp[1].minor.yy0.n = 0; } #line 2793 "sql.c" - break; - case 20: /* cpxName ::= DOT ids */ + break; + case 20: /* cpxName ::= DOT ids */ #line 92 "sql.y" -{yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; yymsp[-1].minor.yy0.n += 1; } + {yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; yymsp[-1].minor.yy0.n += 1; } #line 2798 "sql.c" - break; - case 21: /* cmd ::= SHOW CREATE TABLE ids cpxName */ + break; + case 21: /* cmd ::= SHOW CREATE TABLE ids cpxName */ #line 94 "sql.y" -{ - yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; - setDCLSqlElems(pInfo, TSDB_SQL_SHOW_CREATE_TABLE, 1, &yymsp[-1].minor.yy0); -} + { + yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; + setDCLSqlElems(pInfo, TSDB_SQL_SHOW_CREATE_TABLE, 1, &yymsp[-1].minor.yy0); + } #line 2806 "sql.c" - break; - case 22: /* cmd ::= SHOW CREATE STABLE ids cpxName */ + break; + case 22: /* cmd ::= SHOW CREATE STABLE ids cpxName */ #line 98 "sql.y" -{ - yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; - setDCLSqlElems(pInfo, TSDB_SQL_SHOW_CREATE_STABLE, 1, &yymsp[-1].minor.yy0); -} + { + yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; + setDCLSqlElems(pInfo, TSDB_SQL_SHOW_CREATE_STABLE, 1, &yymsp[-1].minor.yy0); + } #line 2814 "sql.c" - break; - case 23: /* cmd ::= SHOW CREATE DATABASE ids */ + break; + case 23: /* cmd ::= SHOW CREATE DATABASE ids */ #line 103 "sql.y" -{ - setDCLSqlElems(pInfo, TSDB_SQL_SHOW_CREATE_DATABASE, 1, &yymsp[0].minor.yy0); -} + { + setDCLSqlElems(pInfo, TSDB_SQL_SHOW_CREATE_DATABASE, 1, &yymsp[0].minor.yy0); + } #line 2821 "sql.c" - break; - case 24: /* cmd ::= SHOW dbPrefix TABLES */ + break; + case 24: /* cmd ::= SHOW dbPrefix TABLES */ #line 107 "sql.y" -{ - setShowOptions(pInfo, TSDB_MGMT_TABLE_TABLE, &yymsp[-1].minor.yy0, 0); -} + { + setShowOptions(pInfo, TSDB_MGMT_TABLE_TABLE, &yymsp[-1].minor.yy0, 0); + } #line 2828 "sql.c" - break; - case 25: /* cmd ::= SHOW dbPrefix TABLES LIKE ids */ + break; + case 25: /* cmd ::= SHOW dbPrefix TABLES LIKE ids */ #line 111 "sql.y" -{ - setShowOptions(pInfo, TSDB_MGMT_TABLE_TABLE, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0); -} + { + setShowOptions(pInfo, TSDB_MGMT_TABLE_TABLE, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0); + } #line 2835 "sql.c" - break; - case 26: /* cmd ::= SHOW dbPrefix STABLES */ + break; + case 26: /* cmd ::= SHOW dbPrefix STABLES */ #line 115 "sql.y" -{ - setShowOptions(pInfo, TSDB_MGMT_TABLE_METRIC, &yymsp[-1].minor.yy0, 0); -} + { + setShowOptions(pInfo, TSDB_MGMT_TABLE_METRIC, &yymsp[-1].minor.yy0, 0); + } #line 2842 "sql.c" - break; - case 27: /* cmd ::= SHOW dbPrefix STABLES LIKE ids */ + break; + case 27: /* cmd ::= SHOW dbPrefix STABLES LIKE ids */ #line 119 "sql.y" -{ - SStrToken token; - tSetDbName(&token, &yymsp[-3].minor.yy0); - setShowOptions(pInfo, TSDB_MGMT_TABLE_METRIC, &token, &yymsp[0].minor.yy0); -} + { + SStrToken token; + tSetDbName(&token, &yymsp[-3].minor.yy0); + setShowOptions(pInfo, TSDB_MGMT_TABLE_METRIC, &token, &yymsp[0].minor.yy0); + } #line 2851 "sql.c" - break; - case 28: /* cmd ::= SHOW dbPrefix VGROUPS */ + break; + case 28: /* cmd ::= SHOW dbPrefix VGROUPS */ #line 125 "sql.y" -{ - SStrToken token; - tSetDbName(&token, &yymsp[-1].minor.yy0); - setShowOptions(pInfo, TSDB_MGMT_TABLE_VGROUP, &token, 0); -} + { + SStrToken token; + tSetDbName(&token, &yymsp[-1].minor.yy0); + setShowOptions(pInfo, TSDB_MGMT_TABLE_VGROUP, &token, 0); + } #line 2860 "sql.c" - break; - case 29: /* cmd ::= SHOW dbPrefix VGROUPS ids */ + break; + case 29: /* cmd ::= SHOW dbPrefix VGROUPS ids */ #line 131 "sql.y" -{ - SStrToken token; - tSetDbName(&token, &yymsp[-2].minor.yy0); - setShowOptions(pInfo, TSDB_MGMT_TABLE_VGROUP, &token, &yymsp[0].minor.yy0); -} + { + SStrToken token; + tSetDbName(&token, &yymsp[-2].minor.yy0); + setShowOptions(pInfo, TSDB_MGMT_TABLE_VGROUP, &token, &yymsp[0].minor.yy0); + } #line 2869 "sql.c" - break; - case 30: /* cmd ::= DROP TABLE ifexists ids cpxName */ + break; + case 30: /* cmd ::= DROP TABLE ifexists ids cpxName */ #line 138 "sql.y" -{ - yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; - setDropDbTableInfo(pInfo, TSDB_SQL_DROP_TABLE, &yymsp[-1].minor.yy0, &yymsp[-2].minor.yy0, -1, -1); -} + { + yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; + setDropDbTableInfo(pInfo, TSDB_SQL_DROP_TABLE, &yymsp[-1].minor.yy0, &yymsp[-2].minor.yy0, -1, -1); + } #line 2877 "sql.c" - break; - case 31: /* cmd ::= DROP STABLE ifexists ids cpxName */ + break; + case 31: /* cmd ::= DROP STABLE ifexists ids cpxName */ #line 144 "sql.y" -{ - yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; - setDropDbTableInfo(pInfo, TSDB_SQL_DROP_TABLE, &yymsp[-1].minor.yy0, &yymsp[-2].minor.yy0, -1, TSDB_SUPER_TABLE); -} + { + yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; + setDropDbTableInfo(pInfo, TSDB_SQL_DROP_TABLE, &yymsp[-1].minor.yy0, &yymsp[-2].minor.yy0, -1, TSDB_SUPER_TABLE); + } #line 2885 "sql.c" - break; - case 32: /* cmd ::= DROP DATABASE ifexists ids */ + break; + case 32: /* cmd ::= DROP DATABASE ifexists ids */ #line 149 "sql.y" -{ setDropDbTableInfo(pInfo, TSDB_SQL_DROP_DB, &yymsp[0].minor.yy0, &yymsp[-1].minor.yy0, TSDB_DB_TYPE_DEFAULT, -1); } + { setDropDbTableInfo(pInfo, TSDB_SQL_DROP_DB, &yymsp[0].minor.yy0, &yymsp[-1].minor.yy0, TSDB_DB_TYPE_DEFAULT, -1); } #line 2890 "sql.c" - break; - case 33: /* cmd ::= DROP TOPIC ifexists ids */ + break; + case 33: /* cmd ::= DROP TOPIC ifexists ids */ #line 150 "sql.y" -{ setDropDbTableInfo(pInfo, TSDB_SQL_DROP_DB, &yymsp[0].minor.yy0, &yymsp[-1].minor.yy0, TSDB_DB_TYPE_TOPIC, -1); } + { setDropDbTableInfo(pInfo, TSDB_SQL_DROP_DB, &yymsp[0].minor.yy0, &yymsp[-1].minor.yy0, TSDB_DB_TYPE_TOPIC, -1); } #line 2895 "sql.c" - break; - case 34: /* cmd ::= DROP FUNCTION ids */ + break; + case 34: /* cmd ::= DROP FUNCTION ids */ #line 151 "sql.y" -{ setDropFuncInfo(pInfo, TSDB_SQL_DROP_FUNCTION, &yymsp[0].minor.yy0); } + { setDropFuncInfo(pInfo, TSDB_SQL_DROP_FUNCTION, &yymsp[0].minor.yy0); } #line 2900 "sql.c" - break; - case 35: /* cmd ::= DROP DNODE ids */ + break; + case 35: /* cmd ::= DROP DNODE ids */ #line 153 "sql.y" -{ setDCLSqlElems(pInfo, TSDB_SQL_DROP_DNODE, 1, &yymsp[0].minor.yy0); } + { setDCLSqlElems(pInfo, TSDB_SQL_DROP_DNODE, 1, &yymsp[0].minor.yy0); } #line 2905 "sql.c" - break; - case 36: /* cmd ::= DROP USER ids */ + break; + case 36: /* cmd ::= DROP USER ids */ #line 154 "sql.y" -{ setDCLSqlElems(pInfo, TSDB_SQL_DROP_USER, 1, &yymsp[0].minor.yy0); } + { setDCLSqlElems(pInfo, TSDB_SQL_DROP_USER, 1, &yymsp[0].minor.yy0); } #line 2910 "sql.c" - break; - case 37: /* cmd ::= DROP ACCOUNT ids */ + break; + case 37: /* cmd ::= DROP ACCOUNT ids */ #line 155 "sql.y" -{ setDCLSqlElems(pInfo, TSDB_SQL_DROP_ACCT, 1, &yymsp[0].minor.yy0); } + { setDCLSqlElems(pInfo, TSDB_SQL_DROP_ACCT, 1, &yymsp[0].minor.yy0); } #line 2915 "sql.c" - break; - case 38: /* cmd ::= USE ids */ + break; + case 38: /* cmd ::= USE ids */ #line 158 "sql.y" -{ setDCLSqlElems(pInfo, TSDB_SQL_USE_DB, 1, &yymsp[0].minor.yy0);} + { setDCLSqlElems(pInfo, TSDB_SQL_USE_DB, 1, &yymsp[0].minor.yy0);} #line 2920 "sql.c" - break; - case 39: /* cmd ::= DESCRIBE ids cpxName */ - case 40: /* cmd ::= DESC ids cpxName */ yytestcase(yyruleno==40); + break; + case 39: /* cmd ::= DESCRIBE ids cpxName */ + case 40: /* cmd ::= DESC ids cpxName */ yytestcase(yyruleno==40); #line 161 "sql.y" -{ - yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; - setDCLSqlElems(pInfo, TSDB_SQL_DESCRIBE_TABLE, 1, &yymsp[-1].minor.yy0); -} + { + yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; + setDCLSqlElems(pInfo, TSDB_SQL_DESCRIBE_TABLE, 1, &yymsp[-1].minor.yy0); + } #line 2929 "sql.c" - break; - case 41: /* cmd ::= ALTER USER ids PASS ids */ + break; + case 41: /* cmd ::= ALTER USER ids PASS ids */ #line 172 "sql.y" -{ setAlterUserSql(pInfo, TSDB_ALTER_USER_PASSWD, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, NULL); } + { setAlterUserSql(pInfo, TSDB_ALTER_USER_PASSWD, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, NULL); } #line 2934 "sql.c" - break; - case 42: /* cmd ::= ALTER USER ids PRIVILEGE ids */ + break; + case 42: /* cmd ::= ALTER USER ids PRIVILEGE ids */ #line 173 "sql.y" -{ setAlterUserSql(pInfo, TSDB_ALTER_USER_PRIVILEGES, &yymsp[-2].minor.yy0, NULL, &yymsp[0].minor.yy0);} + { setAlterUserSql(pInfo, TSDB_ALTER_USER_PRIVILEGES, &yymsp[-2].minor.yy0, NULL, &yymsp[0].minor.yy0);} #line 2939 "sql.c" - break; - case 43: /* cmd ::= ALTER DNODE ids ids */ + break; + case 43: /* cmd ::= ALTER DNODE ids ids */ #line 174 "sql.y" -{ setDCLSqlElems(pInfo, TSDB_SQL_CFG_DNODE, 2, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } + { setDCLSqlElems(pInfo, TSDB_SQL_CFG_DNODE, 2, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } #line 2944 "sql.c" - break; - case 44: /* cmd ::= ALTER DNODE ids ids ids */ + break; + case 44: /* cmd ::= ALTER DNODE ids ids ids */ #line 175 "sql.y" -{ setDCLSqlElems(pInfo, TSDB_SQL_CFG_DNODE, 3, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } + { setDCLSqlElems(pInfo, TSDB_SQL_CFG_DNODE, 3, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } #line 2949 "sql.c" - break; - case 45: /* cmd ::= ALTER LOCAL ids */ + break; + case 45: /* cmd ::= ALTER LOCAL ids */ #line 176 "sql.y" -{ setDCLSqlElems(pInfo, TSDB_SQL_CFG_LOCAL, 1, &yymsp[0].minor.yy0); } + { setDCLSqlElems(pInfo, TSDB_SQL_CFG_LOCAL, 1, &yymsp[0].minor.yy0); } #line 2954 "sql.c" - break; - case 46: /* cmd ::= ALTER LOCAL ids ids */ + break; + case 46: /* cmd ::= ALTER LOCAL ids ids */ #line 177 "sql.y" -{ setDCLSqlElems(pInfo, TSDB_SQL_CFG_LOCAL, 2, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } + { setDCLSqlElems(pInfo, TSDB_SQL_CFG_LOCAL, 2, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } #line 2959 "sql.c" - break; - case 47: /* cmd ::= ALTER DATABASE ids alter_db_optr */ - case 48: /* cmd ::= ALTER TOPIC ids alter_topic_optr */ yytestcase(yyruleno==48); + break; + case 47: /* cmd ::= ALTER DATABASE ids alter_db_optr */ + case 48: /* cmd ::= ALTER TOPIC ids alter_topic_optr */ yytestcase(yyruleno==48); #line 178 "sql.y" -{ SStrToken t = {0}; setCreateDbInfo(pInfo, TSDB_SQL_ALTER_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy246, &t);} + { SStrToken t = {0}; setCreateDbInfo(pInfo, TSDB_SQL_ALTER_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy246, &t);} #line 2965 "sql.c" - break; - case 49: /* cmd ::= ALTER ACCOUNT ids acct_optr */ + break; + case 49: /* cmd ::= ALTER ACCOUNT ids acct_optr */ #line 181 "sql.y" -{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-1].minor.yy0, NULL, &yymsp[0].minor.yy377);} + { setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-1].minor.yy0, NULL, &yymsp[0].minor.yy377);} #line 2970 "sql.c" - break; - case 50: /* cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ + break; + case 50: /* cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ #line 182 "sql.y" -{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy377);} + { setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy377);} #line 2975 "sql.c" - break; - case 51: /* cmd ::= COMPACT VNODES IN LP exprlist RP */ + break; + case 51: /* cmd ::= COMPACT VNODES IN LP exprlist RP */ #line 186 "sql.y" -{ setCompactVnodeSql(pInfo, TSDB_SQL_COMPACT_VNODE, yymsp[-1].minor.yy403);} + { setCompactVnodeSql(pInfo, TSDB_SQL_COMPACT_VNODE, yymsp[-1].minor.yy403);} #line 2980 "sql.c" - break; - case 52: /* ids ::= ID */ - case 53: /* ids ::= STRING */ yytestcase(yyruleno==53); + break; + case 52: /* ids ::= ID */ + case 53: /* ids ::= STRING */ yytestcase(yyruleno==53); #line 192 "sql.y" -{yylhsminor.yy0 = yymsp[0].minor.yy0; } + {yylhsminor.yy0 = yymsp[0].minor.yy0; } #line 2986 "sql.c" - yymsp[0].minor.yy0 = yylhsminor.yy0; - break; - case 54: /* ifexists ::= IF EXISTS */ + yymsp[0].minor.yy0 = yylhsminor.yy0; + break; + case 54: /* ifexists ::= IF EXISTS */ #line 196 "sql.y" -{ yymsp[-1].minor.yy0.n = 1;} + { yymsp[-1].minor.yy0.n = 1;} #line 2992 "sql.c" - break; - case 55: /* ifexists ::= */ - case 57: /* ifnotexists ::= */ yytestcase(yyruleno==57); - case 181: /* distinct ::= */ yytestcase(yyruleno==181); + break; + case 55: /* ifexists ::= */ + case 57: /* ifnotexists ::= */ yytestcase(yyruleno==57); + case 181: /* distinct ::= */ yytestcase(yyruleno==181); #line 197 "sql.y" -{ yymsp[1].minor.yy0.n = 0;} + { yymsp[1].minor.yy0.n = 0;} #line 2999 "sql.c" - break; - case 56: /* ifnotexists ::= IF NOT EXISTS */ + break; + case 56: /* ifnotexists ::= IF NOT EXISTS */ #line 200 "sql.y" -{ yymsp[-2].minor.yy0.n = 1;} + { yymsp[-2].minor.yy0.n = 1;} #line 3004 "sql.c" - break; - case 58: /* cmd ::= CREATE DNODE ids */ + break; + case 58: /* cmd ::= CREATE DNODE ids */ #line 205 "sql.y" -{ setDCLSqlElems(pInfo, TSDB_SQL_CREATE_DNODE, 1, &yymsp[0].minor.yy0);} + { setDCLSqlElems(pInfo, TSDB_SQL_CREATE_DNODE, 1, &yymsp[0].minor.yy0);} #line 3009 "sql.c" - break; - case 59: /* cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ + break; + case 59: /* cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ #line 207 "sql.y" -{ setCreateAcctSql(pInfo, TSDB_SQL_CREATE_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy377);} + { setCreateAcctSql(pInfo, TSDB_SQL_CREATE_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy377);} #line 3014 "sql.c" - break; - case 60: /* cmd ::= CREATE DATABASE ifnotexists ids db_optr */ - case 61: /* cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ yytestcase(yyruleno==61); + break; + case 60: /* cmd ::= CREATE DATABASE ifnotexists ids db_optr */ + case 61: /* cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ yytestcase(yyruleno==61); #line 208 "sql.y" -{ setCreateDbInfo(pInfo, TSDB_SQL_CREATE_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy246, &yymsp[-2].minor.yy0);} + { setCreateDbInfo(pInfo, TSDB_SQL_CREATE_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy246, &yymsp[-2].minor.yy0);} #line 3020 "sql.c" - break; - case 62: /* cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ + break; + case 62: /* cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ #line 210 "sql.y" -{ setCreateFuncInfo(pInfo, TSDB_SQL_CREATE_FUNCTION, &yymsp[-5].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy363, &yymsp[0].minor.yy0, 1);} + { setCreateFuncInfo(pInfo, TSDB_SQL_CREATE_FUNCTION, &yymsp[-5].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy363, &yymsp[0].minor.yy0, 1);} #line 3025 "sql.c" - break; - case 63: /* cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ + break; + case 63: /* cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ #line 211 "sql.y" -{ setCreateFuncInfo(pInfo, TSDB_SQL_CREATE_FUNCTION, &yymsp[-5].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy363, &yymsp[0].minor.yy0, 2);} + { setCreateFuncInfo(pInfo, TSDB_SQL_CREATE_FUNCTION, &yymsp[-5].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy363, &yymsp[0].minor.yy0, 2);} #line 3030 "sql.c" - break; - case 64: /* cmd ::= CREATE USER ids PASS ids */ + break; + case 64: /* cmd ::= CREATE USER ids PASS ids */ #line 212 "sql.y" -{ setCreateUserSql(pInfo, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);} + { setCreateUserSql(pInfo, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);} #line 3035 "sql.c" - break; - case 65: /* bufsize ::= */ - case 67: /* pps ::= */ yytestcase(yyruleno==67); - case 69: /* tseries ::= */ yytestcase(yyruleno==69); - case 71: /* dbs ::= */ yytestcase(yyruleno==71); - case 73: /* streams ::= */ yytestcase(yyruleno==73); - case 75: /* storage ::= */ yytestcase(yyruleno==75); - case 77: /* qtime ::= */ yytestcase(yyruleno==77); - case 79: /* users ::= */ yytestcase(yyruleno==79); - case 81: /* conns ::= */ yytestcase(yyruleno==81); - case 83: /* state ::= */ yytestcase(yyruleno==83); + break; + case 65: /* bufsize ::= */ + case 67: /* pps ::= */ yytestcase(yyruleno==67); + case 69: /* tseries ::= */ yytestcase(yyruleno==69); + case 71: /* dbs ::= */ yytestcase(yyruleno==71); + case 73: /* streams ::= */ yytestcase(yyruleno==73); + case 75: /* storage ::= */ yytestcase(yyruleno==75); + case 77: /* qtime ::= */ yytestcase(yyruleno==77); + case 79: /* users ::= */ yytestcase(yyruleno==79); + case 81: /* conns ::= */ yytestcase(yyruleno==81); + case 83: /* state ::= */ yytestcase(yyruleno==83); #line 214 "sql.y" -{ yymsp[1].minor.yy0.n = 0; } + { yymsp[1].minor.yy0.n = 0; } #line 3049 "sql.c" - break; - case 66: /* bufsize ::= BUFSIZE INTEGER */ - case 68: /* pps ::= PPS INTEGER */ yytestcase(yyruleno==68); - case 70: /* tseries ::= TSERIES INTEGER */ yytestcase(yyruleno==70); - case 72: /* dbs ::= DBS INTEGER */ yytestcase(yyruleno==72); - case 74: /* streams ::= STREAMS INTEGER */ yytestcase(yyruleno==74); - case 76: /* storage ::= STORAGE INTEGER */ yytestcase(yyruleno==76); - case 78: /* qtime ::= QTIME INTEGER */ yytestcase(yyruleno==78); - case 80: /* users ::= USERS INTEGER */ yytestcase(yyruleno==80); - case 82: /* conns ::= CONNS INTEGER */ yytestcase(yyruleno==82); - case 84: /* state ::= STATE ids */ yytestcase(yyruleno==84); + break; + case 66: /* bufsize ::= BUFSIZE INTEGER */ + case 68: /* pps ::= PPS INTEGER */ yytestcase(yyruleno==68); + case 70: /* tseries ::= TSERIES INTEGER */ yytestcase(yyruleno==70); + case 72: /* dbs ::= DBS INTEGER */ yytestcase(yyruleno==72); + case 74: /* streams ::= STREAMS INTEGER */ yytestcase(yyruleno==74); + case 76: /* storage ::= STORAGE INTEGER */ yytestcase(yyruleno==76); + case 78: /* qtime ::= QTIME INTEGER */ yytestcase(yyruleno==78); + case 80: /* users ::= USERS INTEGER */ yytestcase(yyruleno==80); + case 82: /* conns ::= CONNS INTEGER */ yytestcase(yyruleno==82); + case 84: /* state ::= STATE ids */ yytestcase(yyruleno==84); #line 215 "sql.y" -{ yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } + { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } #line 3063 "sql.c" - break; - case 85: /* acct_optr ::= pps tseries storage streams qtime dbs users conns state */ + break; + case 85: /* acct_optr ::= pps tseries storage streams qtime dbs users conns state */ #line 245 "sql.y" -{ - yylhsminor.yy377.maxUsers = (yymsp[-2].minor.yy0.n>0)?atoi(yymsp[-2].minor.yy0.z):-1; - yylhsminor.yy377.maxDbs = (yymsp[-3].minor.yy0.n>0)?atoi(yymsp[-3].minor.yy0.z):-1; - yylhsminor.yy377.maxTimeSeries = (yymsp[-7].minor.yy0.n>0)?atoi(yymsp[-7].minor.yy0.z):-1; - yylhsminor.yy377.maxStreams = (yymsp[-5].minor.yy0.n>0)?atoi(yymsp[-5].minor.yy0.z):-1; - yylhsminor.yy377.maxPointsPerSecond = (yymsp[-8].minor.yy0.n>0)?atoi(yymsp[-8].minor.yy0.z):-1; - yylhsminor.yy377.maxStorage = (yymsp[-6].minor.yy0.n>0)?strtoll(yymsp[-6].minor.yy0.z, NULL, 10):-1; - yylhsminor.yy377.maxQueryTime = (yymsp[-4].minor.yy0.n>0)?strtoll(yymsp[-4].minor.yy0.z, NULL, 10):-1; - yylhsminor.yy377.maxConnections = (yymsp[-1].minor.yy0.n>0)?atoi(yymsp[-1].minor.yy0.z):-1; - yylhsminor.yy377.stat = yymsp[0].minor.yy0; -} + { + yylhsminor.yy377.maxUsers = (yymsp[-2].minor.yy0.n>0)?atoi(yymsp[-2].minor.yy0.z):-1; + yylhsminor.yy377.maxDbs = (yymsp[-3].minor.yy0.n>0)?atoi(yymsp[-3].minor.yy0.z):-1; + yylhsminor.yy377.maxTimeSeries = (yymsp[-7].minor.yy0.n>0)?atoi(yymsp[-7].minor.yy0.z):-1; + yylhsminor.yy377.maxStreams = (yymsp[-5].minor.yy0.n>0)?atoi(yymsp[-5].minor.yy0.z):-1; + yylhsminor.yy377.maxPointsPerSecond = (yymsp[-8].minor.yy0.n>0)?atoi(yymsp[-8].minor.yy0.z):-1; + yylhsminor.yy377.maxStorage = (yymsp[-6].minor.yy0.n>0)?strtoll(yymsp[-6].minor.yy0.z, NULL, 10):-1; + yylhsminor.yy377.maxQueryTime = (yymsp[-4].minor.yy0.n>0)?strtoll(yymsp[-4].minor.yy0.z, NULL, 10):-1; + yylhsminor.yy377.maxConnections = (yymsp[-1].minor.yy0.n>0)?atoi(yymsp[-1].minor.yy0.z):-1; + yylhsminor.yy377.stat = yymsp[0].minor.yy0; + } #line 3078 "sql.c" - yymsp[-8].minor.yy377 = yylhsminor.yy377; - break; - case 86: /* intitemlist ::= intitemlist COMMA intitem */ - case 155: /* tagitemlist ::= tagitemlist COMMA tagitem */ yytestcase(yyruleno==155); + yymsp[-8].minor.yy377 = yylhsminor.yy377; + break; + case 86: /* intitemlist ::= intitemlist COMMA intitem */ + case 155: /* tagitemlist ::= tagitemlist COMMA tagitem */ yytestcase(yyruleno==155); #line 261 "sql.y" -{ yylhsminor.yy403 = tVariantListAppend(yymsp[-2].minor.yy403, &yymsp[0].minor.yy488, -1); } + { yylhsminor.yy403 = tVariantListAppend(yymsp[-2].minor.yy403, &yymsp[0].minor.yy488, -1); } #line 3085 "sql.c" - yymsp[-2].minor.yy403 = yylhsminor.yy403; - break; - case 87: /* intitemlist ::= intitem */ - case 156: /* tagitemlist ::= tagitem */ yytestcase(yyruleno==156); + yymsp[-2].minor.yy403 = yylhsminor.yy403; + break; + case 87: /* intitemlist ::= intitem */ + case 156: /* tagitemlist ::= tagitem */ yytestcase(yyruleno==156); #line 262 "sql.y" -{ yylhsminor.yy403 = tVariantListAppend(NULL, &yymsp[0].minor.yy488, -1); } + { yylhsminor.yy403 = tVariantListAppend(NULL, &yymsp[0].minor.yy488, -1); } #line 3092 "sql.c" - yymsp[0].minor.yy403 = yylhsminor.yy403; - break; - case 88: /* intitem ::= INTEGER */ - case 157: /* tagitem ::= INTEGER */ yytestcase(yyruleno==157); - case 158: /* tagitem ::= FLOAT */ yytestcase(yyruleno==158); - case 159: /* tagitem ::= STRING */ yytestcase(yyruleno==159); - case 160: /* tagitem ::= BOOL */ yytestcase(yyruleno==160); + yymsp[0].minor.yy403 = yylhsminor.yy403; + break; + case 88: /* intitem ::= INTEGER */ + case 157: /* tagitem ::= INTEGER */ yytestcase(yyruleno==157); + case 158: /* tagitem ::= FLOAT */ yytestcase(yyruleno==158); + case 159: /* tagitem ::= STRING */ yytestcase(yyruleno==159); + case 160: /* tagitem ::= BOOL */ yytestcase(yyruleno==160); #line 264 "sql.y" -{ toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yylhsminor.yy488, &yymsp[0].minor.yy0); } + { toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yylhsminor.yy488, &yymsp[0].minor.yy0); } #line 3102 "sql.c" - yymsp[0].minor.yy488 = yylhsminor.yy488; - break; - case 89: /* keep ::= KEEP intitemlist */ + yymsp[0].minor.yy488 = yylhsminor.yy488; + break; + case 89: /* keep ::= KEEP intitemlist */ #line 268 "sql.y" -{ yymsp[-1].minor.yy403 = yymsp[0].minor.yy403; } + { yymsp[-1].minor.yy403 = yymsp[0].minor.yy403; } #line 3108 "sql.c" - break; - case 90: /* cache ::= CACHE INTEGER */ - case 91: /* replica ::= REPLICA INTEGER */ yytestcase(yyruleno==91); - case 92: /* quorum ::= QUORUM INTEGER */ yytestcase(yyruleno==92); - case 93: /* days ::= DAYS INTEGER */ yytestcase(yyruleno==93); - case 94: /* minrows ::= MINROWS INTEGER */ yytestcase(yyruleno==94); - case 95: /* maxrows ::= MAXROWS INTEGER */ yytestcase(yyruleno==95); - case 96: /* blocks ::= BLOCKS INTEGER */ yytestcase(yyruleno==96); - case 97: /* ctime ::= CTIME INTEGER */ yytestcase(yyruleno==97); - case 98: /* wal ::= WAL INTEGER */ yytestcase(yyruleno==98); - case 99: /* fsync ::= FSYNC INTEGER */ yytestcase(yyruleno==99); - case 100: /* comp ::= COMP INTEGER */ yytestcase(yyruleno==100); - case 101: /* prec ::= PRECISION STRING */ yytestcase(yyruleno==101); - case 102: /* update ::= UPDATE INTEGER */ yytestcase(yyruleno==102); - case 103: /* cachelast ::= CACHELAST INTEGER */ yytestcase(yyruleno==103); - case 104: /* partitions ::= PARTITIONS INTEGER */ yytestcase(yyruleno==104); + break; + case 90: /* cache ::= CACHE INTEGER */ + case 91: /* replica ::= REPLICA INTEGER */ yytestcase(yyruleno==91); + case 92: /* quorum ::= QUORUM INTEGER */ yytestcase(yyruleno==92); + case 93: /* days ::= DAYS INTEGER */ yytestcase(yyruleno==93); + case 94: /* minrows ::= MINROWS INTEGER */ yytestcase(yyruleno==94); + case 95: /* maxrows ::= MAXROWS INTEGER */ yytestcase(yyruleno==95); + case 96: /* blocks ::= BLOCKS INTEGER */ yytestcase(yyruleno==96); + case 97: /* ctime ::= CTIME INTEGER */ yytestcase(yyruleno==97); + case 98: /* wal ::= WAL INTEGER */ yytestcase(yyruleno==98); + case 99: /* fsync ::= FSYNC INTEGER */ yytestcase(yyruleno==99); + case 100: /* comp ::= COMP INTEGER */ yytestcase(yyruleno==100); + case 101: /* prec ::= PRECISION STRING */ yytestcase(yyruleno==101); + case 102: /* update ::= UPDATE INTEGER */ yytestcase(yyruleno==102); + case 103: /* cachelast ::= CACHELAST INTEGER */ yytestcase(yyruleno==103); + case 104: /* partitions ::= PARTITIONS INTEGER */ yytestcase(yyruleno==104); #line 270 "sql.y" -{ yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } + { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } #line 3127 "sql.c" - break; - case 105: /* db_optr ::= */ + break; + case 105: /* db_optr ::= */ #line 287 "sql.y" -{setDefaultCreateDbOption(&yymsp[1].minor.yy246); yymsp[1].minor.yy246.dbType = TSDB_DB_TYPE_DEFAULT;} + {setDefaultCreateDbOption(&yymsp[1].minor.yy246); yymsp[1].minor.yy246.dbType = TSDB_DB_TYPE_DEFAULT;} #line 3132 "sql.c" - break; - case 106: /* db_optr ::= db_optr cache */ + break; + case 106: /* db_optr ::= db_optr cache */ #line 289 "sql.y" -{ yylhsminor.yy246 = yymsp[-1].minor.yy246; yylhsminor.yy246.cacheBlockSize = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + { yylhsminor.yy246 = yymsp[-1].minor.yy246; yylhsminor.yy246.cacheBlockSize = strtol(yymsp[0].minor.yy0.z, NULL, 10); } #line 3137 "sql.c" - yymsp[-1].minor.yy246 = yylhsminor.yy246; - break; - case 107: /* db_optr ::= db_optr replica */ - case 124: /* alter_db_optr ::= alter_db_optr replica */ yytestcase(yyruleno==124); + yymsp[-1].minor.yy246 = yylhsminor.yy246; + break; + case 107: /* db_optr ::= db_optr replica */ + case 124: /* alter_db_optr ::= alter_db_optr replica */ yytestcase(yyruleno==124); #line 290 "sql.y" -{ yylhsminor.yy246 = yymsp[-1].minor.yy246; yylhsminor.yy246.replica = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + { yylhsminor.yy246 = yymsp[-1].minor.yy246; yylhsminor.yy246.replica = strtol(yymsp[0].minor.yy0.z, NULL, 10); } #line 3144 "sql.c" - yymsp[-1].minor.yy246 = yylhsminor.yy246; - break; - case 108: /* db_optr ::= db_optr quorum */ - case 125: /* alter_db_optr ::= alter_db_optr quorum */ yytestcase(yyruleno==125); + yymsp[-1].minor.yy246 = yylhsminor.yy246; + break; + case 108: /* db_optr ::= db_optr quorum */ + case 125: /* alter_db_optr ::= alter_db_optr quorum */ yytestcase(yyruleno==125); #line 291 "sql.y" -{ yylhsminor.yy246 = yymsp[-1].minor.yy246; yylhsminor.yy246.quorum = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + { yylhsminor.yy246 = yymsp[-1].minor.yy246; yylhsminor.yy246.quorum = strtol(yymsp[0].minor.yy0.z, NULL, 10); } #line 3151 "sql.c" - yymsp[-1].minor.yy246 = yylhsminor.yy246; - break; - case 109: /* db_optr ::= db_optr days */ + yymsp[-1].minor.yy246 = yylhsminor.yy246; + break; + case 109: /* db_optr ::= db_optr days */ #line 292 "sql.y" -{ yylhsminor.yy246 = yymsp[-1].minor.yy246; yylhsminor.yy246.daysPerFile = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + { yylhsminor.yy246 = yymsp[-1].minor.yy246; yylhsminor.yy246.daysPerFile = strtol(yymsp[0].minor.yy0.z, NULL, 10); } #line 3157 "sql.c" - yymsp[-1].minor.yy246 = yylhsminor.yy246; - break; - case 110: /* db_optr ::= db_optr minrows */ + yymsp[-1].minor.yy246 = yylhsminor.yy246; + break; + case 110: /* db_optr ::= db_optr minrows */ #line 293 "sql.y" -{ yylhsminor.yy246 = yymsp[-1].minor.yy246; yylhsminor.yy246.minRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } + { yylhsminor.yy246 = yymsp[-1].minor.yy246; yylhsminor.yy246.minRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } #line 3163 "sql.c" - yymsp[-1].minor.yy246 = yylhsminor.yy246; - break; - case 111: /* db_optr ::= db_optr maxrows */ + yymsp[-1].minor.yy246 = yylhsminor.yy246; + break; + case 111: /* db_optr ::= db_optr maxrows */ #line 294 "sql.y" -{ yylhsminor.yy246 = yymsp[-1].minor.yy246; yylhsminor.yy246.maxRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } + { yylhsminor.yy246 = yymsp[-1].minor.yy246; yylhsminor.yy246.maxRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } #line 3169 "sql.c" - yymsp[-1].minor.yy246 = yylhsminor.yy246; - break; - case 112: /* db_optr ::= db_optr blocks */ - case 127: /* alter_db_optr ::= alter_db_optr blocks */ yytestcase(yyruleno==127); + yymsp[-1].minor.yy246 = yylhsminor.yy246; + break; + case 112: /* db_optr ::= db_optr blocks */ + case 127: /* alter_db_optr ::= alter_db_optr blocks */ yytestcase(yyruleno==127); #line 295 "sql.y" -{ yylhsminor.yy246 = yymsp[-1].minor.yy246; yylhsminor.yy246.numOfBlocks = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + { yylhsminor.yy246 = yymsp[-1].minor.yy246; yylhsminor.yy246.numOfBlocks = strtol(yymsp[0].minor.yy0.z, NULL, 10); } #line 3176 "sql.c" - yymsp[-1].minor.yy246 = yylhsminor.yy246; - break; - case 113: /* db_optr ::= db_optr ctime */ + yymsp[-1].minor.yy246 = yylhsminor.yy246; + break; + case 113: /* db_optr ::= db_optr ctime */ #line 296 "sql.y" -{ yylhsminor.yy246 = yymsp[-1].minor.yy246; yylhsminor.yy246.commitTime = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + { yylhsminor.yy246 = yymsp[-1].minor.yy246; yylhsminor.yy246.commitTime = strtol(yymsp[0].minor.yy0.z, NULL, 10); } #line 3182 "sql.c" - yymsp[-1].minor.yy246 = yylhsminor.yy246; - break; - case 114: /* db_optr ::= db_optr wal */ + yymsp[-1].minor.yy246 = yylhsminor.yy246; + break; + case 114: /* db_optr ::= db_optr wal */ #line 297 "sql.y" -{ yylhsminor.yy246 = yymsp[-1].minor.yy246; yylhsminor.yy246.walLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + { yylhsminor.yy246 = yymsp[-1].minor.yy246; yylhsminor.yy246.walLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } #line 3188 "sql.c" - yymsp[-1].minor.yy246 = yylhsminor.yy246; - break; - case 115: /* db_optr ::= db_optr fsync */ + yymsp[-1].minor.yy246 = yylhsminor.yy246; + break; + case 115: /* db_optr ::= db_optr fsync */ #line 298 "sql.y" -{ yylhsminor.yy246 = yymsp[-1].minor.yy246; yylhsminor.yy246.fsyncPeriod = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + { yylhsminor.yy246 = yymsp[-1].minor.yy246; yylhsminor.yy246.fsyncPeriod = strtol(yymsp[0].minor.yy0.z, NULL, 10); } #line 3194 "sql.c" - yymsp[-1].minor.yy246 = yylhsminor.yy246; - break; - case 116: /* db_optr ::= db_optr comp */ - case 128: /* alter_db_optr ::= alter_db_optr comp */ yytestcase(yyruleno==128); + yymsp[-1].minor.yy246 = yylhsminor.yy246; + break; + case 116: /* db_optr ::= db_optr comp */ + case 128: /* alter_db_optr ::= alter_db_optr comp */ yytestcase(yyruleno==128); #line 299 "sql.y" -{ yylhsminor.yy246 = yymsp[-1].minor.yy246; yylhsminor.yy246.compressionLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + { yylhsminor.yy246 = yymsp[-1].minor.yy246; yylhsminor.yy246.compressionLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } #line 3201 "sql.c" - yymsp[-1].minor.yy246 = yylhsminor.yy246; - break; - case 117: /* db_optr ::= db_optr prec */ + yymsp[-1].minor.yy246 = yylhsminor.yy246; + break; + case 117: /* db_optr ::= db_optr prec */ #line 300 "sql.y" -{ yylhsminor.yy246 = yymsp[-1].minor.yy246; yylhsminor.yy246.precision = yymsp[0].minor.yy0; } + { yylhsminor.yy246 = yymsp[-1].minor.yy246; yylhsminor.yy246.precision = yymsp[0].minor.yy0; } #line 3207 "sql.c" - yymsp[-1].minor.yy246 = yylhsminor.yy246; - break; - case 118: /* db_optr ::= db_optr keep */ - case 126: /* alter_db_optr ::= alter_db_optr keep */ yytestcase(yyruleno==126); + yymsp[-1].minor.yy246 = yylhsminor.yy246; + break; + case 118: /* db_optr ::= db_optr keep */ + case 126: /* alter_db_optr ::= alter_db_optr keep */ yytestcase(yyruleno==126); #line 301 "sql.y" -{ yylhsminor.yy246 = yymsp[-1].minor.yy246; yylhsminor.yy246.keep = yymsp[0].minor.yy403; } + { yylhsminor.yy246 = yymsp[-1].minor.yy246; yylhsminor.yy246.keep = yymsp[0].minor.yy403; } #line 3214 "sql.c" - yymsp[-1].minor.yy246 = yylhsminor.yy246; - break; - case 119: /* db_optr ::= db_optr update */ - case 129: /* alter_db_optr ::= alter_db_optr update */ yytestcase(yyruleno==129); + yymsp[-1].minor.yy246 = yylhsminor.yy246; + break; + case 119: /* db_optr ::= db_optr update */ + case 129: /* alter_db_optr ::= alter_db_optr update */ yytestcase(yyruleno==129); #line 302 "sql.y" -{ yylhsminor.yy246 = yymsp[-1].minor.yy246; yylhsminor.yy246.update = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + { yylhsminor.yy246 = yymsp[-1].minor.yy246; yylhsminor.yy246.update = strtol(yymsp[0].minor.yy0.z, NULL, 10); } #line 3221 "sql.c" - yymsp[-1].minor.yy246 = yylhsminor.yy246; - break; - case 120: /* db_optr ::= db_optr cachelast */ - case 130: /* alter_db_optr ::= alter_db_optr cachelast */ yytestcase(yyruleno==130); + yymsp[-1].minor.yy246 = yylhsminor.yy246; + break; + case 120: /* db_optr ::= db_optr cachelast */ + case 130: /* alter_db_optr ::= alter_db_optr cachelast */ yytestcase(yyruleno==130); #line 303 "sql.y" -{ yylhsminor.yy246 = yymsp[-1].minor.yy246; yylhsminor.yy246.cachelast = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + { yylhsminor.yy246 = yymsp[-1].minor.yy246; yylhsminor.yy246.cachelast = strtol(yymsp[0].minor.yy0.z, NULL, 10); } #line 3228 "sql.c" - yymsp[-1].minor.yy246 = yylhsminor.yy246; - break; - case 121: /* topic_optr ::= db_optr */ - case 131: /* alter_topic_optr ::= alter_db_optr */ yytestcase(yyruleno==131); + yymsp[-1].minor.yy246 = yylhsminor.yy246; + break; + case 121: /* topic_optr ::= db_optr */ + case 131: /* alter_topic_optr ::= alter_db_optr */ yytestcase(yyruleno==131); #line 307 "sql.y" -{ yylhsminor.yy246 = yymsp[0].minor.yy246; yylhsminor.yy246.dbType = TSDB_DB_TYPE_TOPIC; } + { yylhsminor.yy246 = yymsp[0].minor.yy246; yylhsminor.yy246.dbType = TSDB_DB_TYPE_TOPIC; } #line 3235 "sql.c" - yymsp[0].minor.yy246 = yylhsminor.yy246; - break; - case 122: /* topic_optr ::= topic_optr partitions */ - case 132: /* alter_topic_optr ::= alter_topic_optr partitions */ yytestcase(yyruleno==132); + yymsp[0].minor.yy246 = yylhsminor.yy246; + break; + case 122: /* topic_optr ::= topic_optr partitions */ + case 132: /* alter_topic_optr ::= alter_topic_optr partitions */ yytestcase(yyruleno==132); #line 308 "sql.y" -{ yylhsminor.yy246 = yymsp[-1].minor.yy246; yylhsminor.yy246.partitions = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + { yylhsminor.yy246 = yymsp[-1].minor.yy246; yylhsminor.yy246.partitions = strtol(yymsp[0].minor.yy0.z, NULL, 10); } #line 3242 "sql.c" - yymsp[-1].minor.yy246 = yylhsminor.yy246; - break; - case 123: /* alter_db_optr ::= */ + yymsp[-1].minor.yy246 = yylhsminor.yy246; + break; + case 123: /* alter_db_optr ::= */ #line 311 "sql.y" -{ setDefaultCreateDbOption(&yymsp[1].minor.yy246); yymsp[1].minor.yy246.dbType = TSDB_DB_TYPE_DEFAULT;} + { setDefaultCreateDbOption(&yymsp[1].minor.yy246); yymsp[1].minor.yy246.dbType = TSDB_DB_TYPE_DEFAULT;} #line 3248 "sql.c" - break; - case 133: /* typename ::= ids */ + break; + case 133: /* typename ::= ids */ #line 331 "sql.y" -{ - yymsp[0].minor.yy0.type = 0; - tSetColumnType (&yylhsminor.yy363, &yymsp[0].minor.yy0); -} + { + yymsp[0].minor.yy0.type = 0; + tSetColumnType (&yylhsminor.yy363, &yymsp[0].minor.yy0); + } #line 3256 "sql.c" - yymsp[0].minor.yy363 = yylhsminor.yy363; - break; - case 134: /* typename ::= ids LP signed RP */ + yymsp[0].minor.yy363 = yylhsminor.yy363; + break; + case 134: /* typename ::= ids LP signed RP */ #line 337 "sql.y" -{ - if (yymsp[-1].minor.yy387 <= 0) { - yymsp[-3].minor.yy0.type = 0; - tSetColumnType(&yylhsminor.yy363, &yymsp[-3].minor.yy0); - } else { - yymsp[-3].minor.yy0.type = -yymsp[-1].minor.yy387; // negative value of name length - tSetColumnType(&yylhsminor.yy363, &yymsp[-3].minor.yy0); - } -} + { + if (yymsp[-1].minor.yy387 <= 0) { + yymsp[-3].minor.yy0.type = 0; + tSetColumnType(&yylhsminor.yy363, &yymsp[-3].minor.yy0); + } else { + yymsp[-3].minor.yy0.type = -yymsp[-1].minor.yy387; // negative value of name length + tSetColumnType(&yylhsminor.yy363, &yymsp[-3].minor.yy0); + } + } #line 3270 "sql.c" - yymsp[-3].minor.yy363 = yylhsminor.yy363; - break; - case 135: /* typename ::= ids UNSIGNED */ + yymsp[-3].minor.yy363 = yylhsminor.yy363; + break; + case 135: /* typename ::= ids UNSIGNED */ #line 348 "sql.y" -{ - 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.yy363, &yymsp[-1].minor.yy0); -} + { + 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.yy363, &yymsp[-1].minor.yy0); + } #line 3280 "sql.c" - yymsp[-1].minor.yy363 = yylhsminor.yy363; - break; - case 136: /* signed ::= INTEGER */ + yymsp[-1].minor.yy363 = yylhsminor.yy363; + break; + case 136: /* signed ::= INTEGER */ #line 355 "sql.y" -{ yylhsminor.yy387 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + { yylhsminor.yy387 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } #line 3286 "sql.c" - yymsp[0].minor.yy387 = yylhsminor.yy387; - break; - case 137: /* signed ::= PLUS INTEGER */ + yymsp[0].minor.yy387 = yylhsminor.yy387; + break; + case 137: /* signed ::= PLUS INTEGER */ #line 356 "sql.y" -{ yymsp[-1].minor.yy387 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + { yymsp[-1].minor.yy387 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } #line 3292 "sql.c" - break; - case 138: /* signed ::= MINUS INTEGER */ + break; + case 138: /* signed ::= MINUS INTEGER */ #line 357 "sql.y" -{ yymsp[-1].minor.yy387 = -strtol(yymsp[0].minor.yy0.z, NULL, 10);} + { yymsp[-1].minor.yy387 = -strtol(yymsp[0].minor.yy0.z, NULL, 10);} #line 3297 "sql.c" - break; - case 142: /* cmd ::= CREATE TABLE create_table_list */ + break; + case 142: /* cmd ::= CREATE TABLE create_table_list */ #line 363 "sql.y" -{ pInfo->type = TSDB_SQL_CREATE_TABLE; pInfo->pCreateTableInfo = yymsp[0].minor.yy56;} + { pInfo->type = TSDB_SQL_CREATE_TABLE; pInfo->pCreateTableInfo = yymsp[0].minor.yy56;} #line 3302 "sql.c" - break; - case 143: /* create_table_list ::= create_from_stable */ + break; + case 143: /* create_table_list ::= create_from_stable */ #line 367 "sql.y" -{ - SCreateTableSql* pCreateTable = calloc(1, sizeof(SCreateTableSql)); - pCreateTable->childTableInfo = taosArrayInit(4, sizeof(SCreatedTableInfo)); + { + SCreateTableSql* pCreateTable = calloc(1, sizeof(SCreateTableSql)); + pCreateTable->childTableInfo = taosArrayInit(4, sizeof(SCreatedTableInfo)); - taosArrayPush(pCreateTable->childTableInfo, &yymsp[0].minor.yy84); - pCreateTable->type = TSQL_CREATE_TABLE_FROM_STABLE; - yylhsminor.yy56 = pCreateTable; -} + taosArrayPush(pCreateTable->childTableInfo, &yymsp[0].minor.yy84); + pCreateTable->type = TSQL_CREATE_TABLE_FROM_STABLE; + yylhsminor.yy56 = pCreateTable; + } #line 3314 "sql.c" - yymsp[0].minor.yy56 = yylhsminor.yy56; - break; - case 144: /* create_table_list ::= create_table_list create_from_stable */ + yymsp[0].minor.yy56 = yylhsminor.yy56; + break; + case 144: /* create_table_list ::= create_table_list create_from_stable */ #line 376 "sql.y" -{ - taosArrayPush(yymsp[-1].minor.yy56->childTableInfo, &yymsp[0].minor.yy84); - yylhsminor.yy56 = yymsp[-1].minor.yy56; -} + { + taosArrayPush(yymsp[-1].minor.yy56->childTableInfo, &yymsp[0].minor.yy84); + yylhsminor.yy56 = yymsp[-1].minor.yy56; + } #line 3323 "sql.c" - yymsp[-1].minor.yy56 = yylhsminor.yy56; - break; - case 145: /* create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ + yymsp[-1].minor.yy56 = yylhsminor.yy56; + break; + case 145: /* create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ #line 382 "sql.y" -{ - yylhsminor.yy56 = tSetCreateTableInfo(yymsp[-1].minor.yy403, NULL, NULL, TSQL_CREATE_TABLE); - setSqlInfo(pInfo, yylhsminor.yy56, NULL, TSDB_SQL_CREATE_TABLE); + { + yylhsminor.yy56 = tSetCreateTableInfo(yymsp[-1].minor.yy403, NULL, NULL, TSQL_CREATE_TABLE); + setSqlInfo(pInfo, yylhsminor.yy56, 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[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; + setCreatedTableName(pInfo, &yymsp[-4].minor.yy0, &yymsp[-5].minor.yy0); + } #line 3335 "sql.c" - yymsp[-5].minor.yy56 = yylhsminor.yy56; - break; - case 146: /* create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ + yymsp[-5].minor.yy56 = yylhsminor.yy56; + break; + case 146: /* create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ #line 392 "sql.y" -{ - yylhsminor.yy56 = tSetCreateTableInfo(yymsp[-5].minor.yy403, yymsp[-1].minor.yy403, NULL, TSQL_CREATE_STABLE); - setSqlInfo(pInfo, yylhsminor.yy56, NULL, TSDB_SQL_CREATE_TABLE); + { + yylhsminor.yy56 = tSetCreateTableInfo(yymsp[-5].minor.yy403, yymsp[-1].minor.yy403, NULL, TSQL_CREATE_STABLE); + setSqlInfo(pInfo, yylhsminor.yy56, 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[-8].minor.yy0.n += yymsp[-7].minor.yy0.n; + setCreatedTableName(pInfo, &yymsp[-8].minor.yy0, &yymsp[-9].minor.yy0); + } #line 3347 "sql.c" - yymsp[-9].minor.yy56 = yylhsminor.yy56; - break; - case 147: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ + yymsp[-9].minor.yy56 = yylhsminor.yy56; + break; + case 147: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ #line 403 "sql.y" -{ - yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; - yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n; - yylhsminor.yy84 = createNewChildTableInfo(&yymsp[-5].minor.yy0, NULL, yymsp[-1].minor.yy403, &yymsp[-8].minor.yy0, &yymsp[-9].minor.yy0); -} + { + yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; + yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n; + yylhsminor.yy84 = createNewChildTableInfo(&yymsp[-5].minor.yy0, NULL, yymsp[-1].minor.yy403, &yymsp[-8].minor.yy0, &yymsp[-9].minor.yy0); + } #line 3357 "sql.c" - yymsp[-9].minor.yy84 = yylhsminor.yy84; - break; - case 148: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */ + yymsp[-9].minor.yy84 = yylhsminor.yy84; + break; + case 148: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */ #line 409 "sql.y" -{ - yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n; - yymsp[-11].minor.yy0.n += yymsp[-10].minor.yy0.n; - yylhsminor.yy84 = createNewChildTableInfo(&yymsp[-8].minor.yy0, yymsp[-5].minor.yy403, yymsp[-1].minor.yy403, &yymsp[-11].minor.yy0, &yymsp[-12].minor.yy0); -} + { + yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n; + yymsp[-11].minor.yy0.n += yymsp[-10].minor.yy0.n; + yylhsminor.yy84 = createNewChildTableInfo(&yymsp[-8].minor.yy0, yymsp[-5].minor.yy403, yymsp[-1].minor.yy403, &yymsp[-11].minor.yy0, &yymsp[-12].minor.yy0); + } #line 3367 "sql.c" - yymsp[-12].minor.yy84 = yylhsminor.yy84; - break; - case 149: /* tagNamelist ::= tagNamelist COMMA ids */ + yymsp[-12].minor.yy84 = yylhsminor.yy84; + break; + case 149: /* tagNamelist ::= tagNamelist COMMA ids */ #line 417 "sql.y" -{taosArrayPush(yymsp[-2].minor.yy403, &yymsp[0].minor.yy0); yylhsminor.yy403 = yymsp[-2].minor.yy403; } + {taosArrayPush(yymsp[-2].minor.yy403, &yymsp[0].minor.yy0); yylhsminor.yy403 = yymsp[-2].minor.yy403; } #line 3373 "sql.c" - yymsp[-2].minor.yy403 = yylhsminor.yy403; - break; - case 150: /* tagNamelist ::= ids */ + yymsp[-2].minor.yy403 = yylhsminor.yy403; + break; + case 150: /* tagNamelist ::= ids */ #line 418 "sql.y" -{yylhsminor.yy403 = taosArrayInit(4, sizeof(SStrToken)); taosArrayPush(yylhsminor.yy403, &yymsp[0].minor.yy0);} + {yylhsminor.yy403 = taosArrayInit(4, sizeof(SStrToken)); taosArrayPush(yylhsminor.yy403, &yymsp[0].minor.yy0);} #line 3379 "sql.c" - yymsp[0].minor.yy403 = yylhsminor.yy403; - break; - case 151: /* create_table_args ::= ifnotexists ids cpxName AS select */ + yymsp[0].minor.yy403 = yylhsminor.yy403; + break; + case 151: /* create_table_args ::= ifnotexists ids cpxName AS select */ #line 422 "sql.y" -{ - yylhsminor.yy56 = tSetCreateTableInfo(NULL, NULL, yymsp[0].minor.yy224, TSQL_CREATE_STREAM); - setSqlInfo(pInfo, yylhsminor.yy56, NULL, TSDB_SQL_CREATE_TABLE); + { + yylhsminor.yy56 = tSetCreateTableInfo(NULL, NULL, yymsp[0].minor.yy224, TSQL_CREATE_STREAM); + setSqlInfo(pInfo, yylhsminor.yy56, 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[-3].minor.yy0.n += yymsp[-2].minor.yy0.n; + setCreatedTableName(pInfo, &yymsp[-3].minor.yy0, &yymsp[-4].minor.yy0); + } #line 3391 "sql.c" - yymsp[-4].minor.yy56 = yylhsminor.yy56; - break; - case 152: /* columnlist ::= columnlist COMMA column */ + yymsp[-4].minor.yy56 = yylhsminor.yy56; + break; + case 152: /* columnlist ::= columnlist COMMA column */ #line 433 "sql.y" -{taosArrayPush(yymsp[-2].minor.yy403, &yymsp[0].minor.yy363); yylhsminor.yy403 = yymsp[-2].minor.yy403; } + {taosArrayPush(yymsp[-2].minor.yy403, &yymsp[0].minor.yy363); yylhsminor.yy403 = yymsp[-2].minor.yy403; } #line 3397 "sql.c" - yymsp[-2].minor.yy403 = yylhsminor.yy403; - break; - case 153: /* columnlist ::= column */ + yymsp[-2].minor.yy403 = yylhsminor.yy403; + break; + case 153: /* columnlist ::= column */ #line 434 "sql.y" -{yylhsminor.yy403 = taosArrayInit(4, sizeof(TAOS_FIELD)); taosArrayPush(yylhsminor.yy403, &yymsp[0].minor.yy363);} + {yylhsminor.yy403 = taosArrayInit(4, sizeof(TAOS_FIELD)); taosArrayPush(yylhsminor.yy403, &yymsp[0].minor.yy363);} #line 3403 "sql.c" - yymsp[0].minor.yy403 = yylhsminor.yy403; - break; - case 154: /* column ::= ids typename */ + yymsp[0].minor.yy403 = yylhsminor.yy403; + break; + case 154: /* column ::= ids typename */ #line 438 "sql.y" -{ - tSetColumnInfo(&yylhsminor.yy363, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy363); -} + { + tSetColumnInfo(&yylhsminor.yy363, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy363); + } #line 3411 "sql.c" - yymsp[-1].minor.yy363 = yylhsminor.yy363; - break; - case 161: /* tagitem ::= NULL */ + yymsp[-1].minor.yy363 = yylhsminor.yy363; + break; + case 161: /* tagitem ::= NULL */ #line 453 "sql.y" -{ yymsp[0].minor.yy0.type = 0; tVariantCreate(&yylhsminor.yy488, &yymsp[0].minor.yy0); } + { yymsp[0].minor.yy0.type = 0; tVariantCreate(&yylhsminor.yy488, &yymsp[0].minor.yy0); } #line 3417 "sql.c" - yymsp[0].minor.yy488 = yylhsminor.yy488; - break; - case 162: /* tagitem ::= NOW */ + yymsp[0].minor.yy488 = yylhsminor.yy488; + break; + case 162: /* tagitem ::= NOW */ #line 454 "sql.y" -{ yymsp[0].minor.yy0.type = TSDB_DATA_TYPE_TIMESTAMP; tVariantCreate(&yylhsminor.yy488, &yymsp[0].minor.yy0);} + { yymsp[0].minor.yy0.type = TSDB_DATA_TYPE_TIMESTAMP; tVariantCreate(&yylhsminor.yy488, &yymsp[0].minor.yy0);} #line 3423 "sql.c" - yymsp[0].minor.yy488 = yylhsminor.yy488; - break; - case 163: /* tagitem ::= MINUS INTEGER */ - case 164: /* tagitem ::= MINUS FLOAT */ yytestcase(yyruleno==164); - case 165: /* tagitem ::= PLUS INTEGER */ yytestcase(yyruleno==165); - case 166: /* tagitem ::= PLUS FLOAT */ yytestcase(yyruleno==166); + yymsp[0].minor.yy488 = yylhsminor.yy488; + break; + case 163: /* tagitem ::= MINUS INTEGER */ + case 164: /* tagitem ::= MINUS FLOAT */ yytestcase(yyruleno==164); + case 165: /* tagitem ::= PLUS INTEGER */ yytestcase(yyruleno==165); + case 166: /* tagitem ::= PLUS FLOAT */ yytestcase(yyruleno==166); #line 456 "sql.y" -{ - 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.yy488, &yymsp[-1].minor.yy0); -} + { + 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.yy488, &yymsp[-1].minor.yy0); + } #line 3437 "sql.c" - yymsp[-1].minor.yy488 = yylhsminor.yy488; - break; - case 167: /* 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 */ + yymsp[-1].minor.yy488 = yylhsminor.yy488; + break; + case 167: /* 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 */ #line 487 "sql.y" -{ - yylhsminor.yy224 = 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.yy224 = 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); + } #line 3445 "sql.c" - yymsp[-13].minor.yy224 = yylhsminor.yy224; - break; - case 168: /* select ::= LP select RP */ + yymsp[-13].minor.yy224 = yylhsminor.yy224; + break; + case 168: /* select ::= LP select RP */ #line 491 "sql.y" -{yymsp[-2].minor.yy224 = yymsp[-1].minor.yy224;} + {yymsp[-2].minor.yy224 = yymsp[-1].minor.yy224;} #line 3451 "sql.c" - break; - case 169: /* union ::= select */ + break; + case 169: /* union ::= select */ #line 495 "sql.y" -{ yylhsminor.yy403 = setSubclause(NULL, yymsp[0].minor.yy224); } + { yylhsminor.yy403 = setSubclause(NULL, yymsp[0].minor.yy224); } #line 3456 "sql.c" - yymsp[0].minor.yy403 = yylhsminor.yy403; - break; - case 170: /* union ::= union UNION ALL select */ + yymsp[0].minor.yy403 = yylhsminor.yy403; + break; + case 170: /* union ::= union UNION ALL select */ #line 496 "sql.y" -{ yylhsminor.yy403 = appendSelectClause(yymsp[-3].minor.yy403, yymsp[0].minor.yy224); } + { yylhsminor.yy403 = appendSelectClause(yymsp[-3].minor.yy403, yymsp[0].minor.yy224); } #line 3462 "sql.c" - yymsp[-3].minor.yy403 = yylhsminor.yy403; - break; - case 171: /* cmd ::= union */ + yymsp[-3].minor.yy403 = yylhsminor.yy403; + break; + case 171: /* cmd ::= union */ #line 498 "sql.y" -{ setSqlInfo(pInfo, yymsp[0].minor.yy403, NULL, TSDB_SQL_SELECT); } + { setSqlInfo(pInfo, yymsp[0].minor.yy403, NULL, TSDB_SQL_SELECT); } #line 3468 "sql.c" - break; - case 172: /* select ::= SELECT selcollist */ + break; + case 172: /* select ::= SELECT selcollist */ #line 505 "sql.y" -{ - yylhsminor.yy224 = tSetQuerySqlNode(&yymsp[-1].minor.yy0, yymsp[0].minor.yy403, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); -} + { + yylhsminor.yy224 = tSetQuerySqlNode(&yymsp[-1].minor.yy0, yymsp[0].minor.yy403, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + } #line 3475 "sql.c" - yymsp[-1].minor.yy224 = yylhsminor.yy224; - break; - case 173: /* sclp ::= selcollist COMMA */ + yymsp[-1].minor.yy224 = yylhsminor.yy224; + break; + case 173: /* sclp ::= selcollist COMMA */ #line 517 "sql.y" -{yylhsminor.yy403 = yymsp[-1].minor.yy403;} + {yylhsminor.yy403 = yymsp[-1].minor.yy403;} #line 3481 "sql.c" - yymsp[-1].minor.yy403 = yylhsminor.yy403; - break; - case 174: /* sclp ::= */ - case 206: /* orderby_opt ::= */ yytestcase(yyruleno==206); + yymsp[-1].minor.yy403 = yylhsminor.yy403; + break; + case 174: /* sclp ::= */ + case 206: /* orderby_opt ::= */ yytestcase(yyruleno==206); #line 518 "sql.y" -{yymsp[1].minor.yy403 = 0;} + {yymsp[1].minor.yy403 = 0;} #line 3488 "sql.c" - break; - case 175: /* selcollist ::= sclp distinct expr as */ + break; + case 175: /* selcollist ::= sclp distinct expr as */ #line 519 "sql.y" -{ - yylhsminor.yy403 = 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.yy403 = 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); + } #line 3495 "sql.c" - yymsp[-3].minor.yy403 = yylhsminor.yy403; - break; - case 176: /* selcollist ::= sclp STAR */ + yymsp[-3].minor.yy403 = yylhsminor.yy403; + break; + case 176: /* selcollist ::= sclp STAR */ #line 523 "sql.y" -{ - tSqlExpr *pNode = tSqlExprCreateIdValue(pInfo, NULL, TK_ALL); - yylhsminor.yy403 = tSqlExprListAppend(yymsp[-1].minor.yy403, pNode, 0, 0); -} + { + tSqlExpr *pNode = tSqlExprCreateIdValue(pInfo, NULL, TK_ALL); + yylhsminor.yy403 = tSqlExprListAppend(yymsp[-1].minor.yy403, pNode, 0, 0); + } #line 3504 "sql.c" - yymsp[-1].minor.yy403 = yylhsminor.yy403; - break; - case 177: /* as ::= AS ids */ + yymsp[-1].minor.yy403 = yylhsminor.yy403; + break; + case 177: /* as ::= AS ids */ #line 531 "sql.y" -{ yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } + { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } #line 3510 "sql.c" - break; - case 178: /* as ::= ids */ + break; + case 178: /* as ::= ids */ #line 532 "sql.y" -{ yylhsminor.yy0 = yymsp[0].minor.yy0; } + { yylhsminor.yy0 = yymsp[0].minor.yy0; } #line 3515 "sql.c" - yymsp[0].minor.yy0 = yylhsminor.yy0; - break; - case 179: /* as ::= */ + yymsp[0].minor.yy0 = yylhsminor.yy0; + break; + case 179: /* as ::= */ #line 533 "sql.y" -{ yymsp[1].minor.yy0.n = 0; } + { yymsp[1].minor.yy0.n = 0; } #line 3521 "sql.c" - break; - case 180: /* distinct ::= DISTINCT */ + break; + case 180: /* distinct ::= DISTINCT */ #line 536 "sql.y" -{ yylhsminor.yy0 = yymsp[0].minor.yy0; } + { yylhsminor.yy0 = yymsp[0].minor.yy0; } #line 3526 "sql.c" - yymsp[0].minor.yy0 = yylhsminor.yy0; - break; - case 182: /* from ::= FROM tablelist */ - case 183: /* from ::= FROM sub */ yytestcase(yyruleno==183); + yymsp[0].minor.yy0 = yylhsminor.yy0; + break; + case 182: /* from ::= FROM tablelist */ + case 183: /* from ::= FROM sub */ yytestcase(yyruleno==183); #line 542 "sql.y" -{yymsp[-1].minor.yy114 = yymsp[0].minor.yy114;} + {yymsp[-1].minor.yy114 = yymsp[0].minor.yy114;} #line 3533 "sql.c" - break; - case 184: /* sub ::= LP union RP */ + break; + case 184: /* sub ::= LP union RP */ #line 547 "sql.y" -{yymsp[-2].minor.yy114 = addSubqueryElem(NULL, yymsp[-1].minor.yy403, NULL);} + {yymsp[-2].minor.yy114 = addSubqueryElem(NULL, yymsp[-1].minor.yy403, NULL);} #line 3538 "sql.c" - break; - case 185: /* sub ::= LP union RP ids */ + break; + case 185: /* sub ::= LP union RP ids */ #line 548 "sql.y" -{yymsp[-3].minor.yy114 = addSubqueryElem(NULL, yymsp[-2].minor.yy403, &yymsp[0].minor.yy0);} + {yymsp[-3].minor.yy114 = addSubqueryElem(NULL, yymsp[-2].minor.yy403, &yymsp[0].minor.yy0);} #line 3543 "sql.c" - break; - case 186: /* sub ::= sub COMMA LP union RP ids */ + break; + case 186: /* sub ::= sub COMMA LP union RP ids */ #line 549 "sql.y" -{yylhsminor.yy114 = addSubqueryElem(yymsp[-5].minor.yy114, yymsp[-2].minor.yy403, &yymsp[0].minor.yy0);} + {yylhsminor.yy114 = addSubqueryElem(yymsp[-5].minor.yy114, yymsp[-2].minor.yy403, &yymsp[0].minor.yy0);} #line 3548 "sql.c" - yymsp[-5].minor.yy114 = yylhsminor.yy114; - break; - case 187: /* tablelist ::= ids cpxName */ + yymsp[-5].minor.yy114 = yylhsminor.yy114; + break; + case 187: /* tablelist ::= ids cpxName */ #line 553 "sql.y" -{ - yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; - yylhsminor.yy114 = setTableNameList(NULL, &yymsp[-1].minor.yy0, NULL); -} + { + yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; + yylhsminor.yy114 = setTableNameList(NULL, &yymsp[-1].minor.yy0, NULL); + } #line 3557 "sql.c" - yymsp[-1].minor.yy114 = yylhsminor.yy114; - break; - case 188: /* tablelist ::= ids cpxName ids */ + yymsp[-1].minor.yy114 = yylhsminor.yy114; + break; + case 188: /* tablelist ::= ids cpxName ids */ #line 558 "sql.y" -{ - yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n; - yylhsminor.yy114 = setTableNameList(NULL, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); -} + { + yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n; + yylhsminor.yy114 = setTableNameList(NULL, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); + } #line 3566 "sql.c" - yymsp[-2].minor.yy114 = yylhsminor.yy114; - break; - case 189: /* tablelist ::= tablelist COMMA ids cpxName */ + yymsp[-2].minor.yy114 = yylhsminor.yy114; + break; + case 189: /* tablelist ::= tablelist COMMA ids cpxName */ #line 563 "sql.y" -{ - yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; - yylhsminor.yy114 = setTableNameList(yymsp[-3].minor.yy114, &yymsp[-1].minor.yy0, NULL); -} + { + yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; + yylhsminor.yy114 = setTableNameList(yymsp[-3].minor.yy114, &yymsp[-1].minor.yy0, NULL); + } #line 3575 "sql.c" - yymsp[-3].minor.yy114 = yylhsminor.yy114; - break; - case 190: /* tablelist ::= tablelist COMMA ids cpxName ids */ + yymsp[-3].minor.yy114 = yylhsminor.yy114; + break; + case 190: /* tablelist ::= tablelist COMMA ids cpxName ids */ #line 568 "sql.y" -{ - yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n; - yylhsminor.yy114 = setTableNameList(yymsp[-4].minor.yy114, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); -} + { + yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n; + yylhsminor.yy114 = setTableNameList(yymsp[-4].minor.yy114, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); + } #line 3584 "sql.c" - yymsp[-4].minor.yy114 = yylhsminor.yy114; - break; - case 191: /* tmvar ::= VARIABLE */ + yymsp[-4].minor.yy114 = yylhsminor.yy114; + break; + case 191: /* tmvar ::= VARIABLE */ #line 575 "sql.y" -{yylhsminor.yy0 = yymsp[0].minor.yy0;} + {yylhsminor.yy0 = yymsp[0].minor.yy0;} #line 3590 "sql.c" - yymsp[0].minor.yy0 = yylhsminor.yy0; - break; - case 192: /* interval_option ::= intervalKey LP tmvar RP */ + yymsp[0].minor.yy0 = yylhsminor.yy0; + break; + case 192: /* interval_option ::= intervalKey LP tmvar RP */ #line 578 "sql.y" -{yylhsminor.yy222.interval = yymsp[-1].minor.yy0; yylhsminor.yy222.offset.n = 0; yylhsminor.yy222.token = yymsp[-3].minor.yy202;} + {yylhsminor.yy222.interval = yymsp[-1].minor.yy0; yylhsminor.yy222.offset.n = 0; yylhsminor.yy222.token = yymsp[-3].minor.yy202;} #line 3596 "sql.c" - yymsp[-3].minor.yy222 = yylhsminor.yy222; - break; - case 193: /* interval_option ::= intervalKey LP tmvar COMMA tmvar RP */ + yymsp[-3].minor.yy222 = yylhsminor.yy222; + break; + case 193: /* interval_option ::= intervalKey LP tmvar COMMA tmvar RP */ #line 579 "sql.y" -{yylhsminor.yy222.interval = yymsp[-3].minor.yy0; yylhsminor.yy222.offset = yymsp[-1].minor.yy0; yylhsminor.yy222.token = yymsp[-5].minor.yy202;} + {yylhsminor.yy222.interval = yymsp[-3].minor.yy0; yylhsminor.yy222.offset = yymsp[-1].minor.yy0; yylhsminor.yy222.token = yymsp[-5].minor.yy202;} #line 3602 "sql.c" - yymsp[-5].minor.yy222 = yylhsminor.yy222; - break; - case 194: /* interval_option ::= */ + yymsp[-5].minor.yy222 = yylhsminor.yy222; + break; + case 194: /* interval_option ::= */ #line 580 "sql.y" -{memset(&yymsp[1].minor.yy222, 0, sizeof(yymsp[1].minor.yy222));} + {memset(&yymsp[1].minor.yy222, 0, sizeof(yymsp[1].minor.yy222));} #line 3608 "sql.c" - break; - case 195: /* intervalKey ::= INTERVAL */ + break; + case 195: /* intervalKey ::= INTERVAL */ #line 583 "sql.y" -{yymsp[0].minor.yy202 = TK_INTERVAL;} + {yymsp[0].minor.yy202 = TK_INTERVAL;} #line 3613 "sql.c" - break; - case 196: /* intervalKey ::= EVERY */ + break; + case 196: /* intervalKey ::= EVERY */ #line 584 "sql.y" -{yymsp[0].minor.yy202 = TK_EVERY; } + {yymsp[0].minor.yy202 = TK_EVERY; } #line 3618 "sql.c" - break; - case 197: /* session_option ::= */ + break; + case 197: /* session_option ::= */ #line 587 "sql.y" -{yymsp[1].minor.yy365.col.n = 0; yymsp[1].minor.yy365.gap.n = 0;} + {yymsp[1].minor.yy365.col.n = 0; yymsp[1].minor.yy365.gap.n = 0;} #line 3623 "sql.c" - break; - case 198: /* session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ + break; + case 198: /* session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ #line 588 "sql.y" -{ - yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - yymsp[-6].minor.yy365.col = yymsp[-4].minor.yy0; - yymsp[-6].minor.yy365.gap = yymsp[-1].minor.yy0; -} + { + yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; + yymsp[-6].minor.yy365.col = yymsp[-4].minor.yy0; + yymsp[-6].minor.yy365.gap = yymsp[-1].minor.yy0; + } #line 3632 "sql.c" - break; - case 199: /* windowstate_option ::= */ + break; + case 199: /* windowstate_option ::= */ #line 595 "sql.y" -{ yymsp[1].minor.yy544.col.n = 0; yymsp[1].minor.yy544.col.z = NULL;} + { yymsp[1].minor.yy544.col.n = 0; yymsp[1].minor.yy544.col.z = NULL;} #line 3637 "sql.c" - break; - case 200: /* windowstate_option ::= STATE_WINDOW LP ids RP */ + break; + case 200: /* windowstate_option ::= STATE_WINDOW LP ids RP */ #line 596 "sql.y" -{ yymsp[-3].minor.yy544.col = yymsp[-1].minor.yy0; } + { yymsp[-3].minor.yy544.col = yymsp[-1].minor.yy0; } #line 3642 "sql.c" - break; - case 201: /* fill_opt ::= */ + break; + case 201: /* fill_opt ::= */ #line 600 "sql.y" -{ yymsp[1].minor.yy403 = 0; } + { yymsp[1].minor.yy403 = 0; } #line 3647 "sql.c" - break; - case 202: /* fill_opt ::= FILL LP ID COMMA tagitemlist RP */ + break; + case 202: /* fill_opt ::= FILL LP ID COMMA tagitemlist RP */ #line 601 "sql.y" -{ - tVariant A = {0}; - toTSDBType(yymsp[-3].minor.yy0.type); - tVariantCreate(&A, &yymsp[-3].minor.yy0); + { + tVariant A = {0}; + toTSDBType(yymsp[-3].minor.yy0.type); + tVariantCreate(&A, &yymsp[-3].minor.yy0); - tVariantListInsert(yymsp[-1].minor.yy403, &A, -1, 0); - yymsp[-5].minor.yy403 = yymsp[-1].minor.yy403; -} + tVariantListInsert(yymsp[-1].minor.yy403, &A, -1, 0); + yymsp[-5].minor.yy403 = yymsp[-1].minor.yy403; + } #line 3659 "sql.c" - break; - case 203: /* fill_opt ::= FILL LP ID RP */ + break; + case 203: /* fill_opt ::= FILL LP ID RP */ #line 610 "sql.y" -{ - toTSDBType(yymsp[-1].minor.yy0.type); - yymsp[-3].minor.yy403 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1); -} + { + toTSDBType(yymsp[-1].minor.yy0.type); + yymsp[-3].minor.yy403 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1); + } #line 3667 "sql.c" - break; - case 204: /* sliding_opt ::= SLIDING LP tmvar RP */ + break; + case 204: /* sliding_opt ::= SLIDING LP tmvar RP */ #line 616 "sql.y" -{yymsp[-3].minor.yy0 = yymsp[-1].minor.yy0; } + {yymsp[-3].minor.yy0 = yymsp[-1].minor.yy0; } #line 3672 "sql.c" - break; - case 205: /* sliding_opt ::= */ + break; + case 205: /* sliding_opt ::= */ #line 617 "sql.y" -{yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.z = NULL; yymsp[1].minor.yy0.type = 0; } + {yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.z = NULL; yymsp[1].minor.yy0.type = 0; } #line 3677 "sql.c" - break; - case 207: /* orderby_opt ::= ORDER BY sortlist */ + break; + case 207: /* orderby_opt ::= ORDER BY sortlist */ #line 629 "sql.y" -{yymsp[-2].minor.yy403 = yymsp[0].minor.yy403;} + {yymsp[-2].minor.yy403 = yymsp[0].minor.yy403;} #line 3682 "sql.c" - break; - case 208: /* sortlist ::= sortlist COMMA item sortorder */ + break; + case 208: /* sortlist ::= sortlist COMMA item sortorder */ #line 631 "sql.y" -{ - yylhsminor.yy403 = tVariantListAppend(yymsp[-3].minor.yy403, &yymsp[-1].minor.yy488, yymsp[0].minor.yy70); -} + { + yylhsminor.yy403 = tVariantListAppend(yymsp[-3].minor.yy403, &yymsp[-1].minor.yy488, yymsp[0].minor.yy70); + } #line 3689 "sql.c" - yymsp[-3].minor.yy403 = yylhsminor.yy403; - break; - case 209: /* sortlist ::= item sortorder */ + yymsp[-3].minor.yy403 = yylhsminor.yy403; + break; + case 209: /* sortlist ::= item sortorder */ #line 635 "sql.y" -{ - yylhsminor.yy403 = tVariantListAppend(NULL, &yymsp[-1].minor.yy488, yymsp[0].minor.yy70); -} + { + yylhsminor.yy403 = tVariantListAppend(NULL, &yymsp[-1].minor.yy488, yymsp[0].minor.yy70); + } #line 3697 "sql.c" - yymsp[-1].minor.yy403 = yylhsminor.yy403; - break; - case 210: /* item ::= ids cpxName */ + yymsp[-1].minor.yy403 = yylhsminor.yy403; + break; + case 210: /* item ::= ids cpxName */ #line 640 "sql.y" -{ - toTSDBType(yymsp[-1].minor.yy0.type); - yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; + { + toTSDBType(yymsp[-1].minor.yy0.type); + yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; - tVariantCreate(&yylhsminor.yy488, &yymsp[-1].minor.yy0); -} + tVariantCreate(&yylhsminor.yy488, &yymsp[-1].minor.yy0); + } #line 3708 "sql.c" - yymsp[-1].minor.yy488 = yylhsminor.yy488; - break; - case 211: /* sortorder ::= ASC */ + yymsp[-1].minor.yy488 = yylhsminor.yy488; + break; + case 211: /* sortorder ::= ASC */ #line 648 "sql.y" -{ yymsp[0].minor.yy70 = TSDB_ORDER_ASC; } + { yymsp[0].minor.yy70 = TSDB_ORDER_ASC; } #line 3714 "sql.c" - break; - case 212: /* sortorder ::= DESC */ + break; + case 212: /* sortorder ::= DESC */ #line 649 "sql.y" -{ yymsp[0].minor.yy70 = TSDB_ORDER_DESC;} + { yymsp[0].minor.yy70 = TSDB_ORDER_DESC;} #line 3719 "sql.c" - break; - case 213: /* sortorder ::= */ + break; + case 213: /* sortorder ::= */ #line 650 "sql.y" -{ yymsp[1].minor.yy70 = TSDB_ORDER_ASC; } + { yymsp[1].minor.yy70 = TSDB_ORDER_ASC; } #line 3724 "sql.c" - break; - case 214: /* groupby_opt ::= */ + break; + case 214: /* groupby_opt ::= */ #line 658 "sql.y" -{ yymsp[1].minor.yy403 = 0;} + { yymsp[1].minor.yy403 = 0;} #line 3729 "sql.c" - break; - case 215: /* groupby_opt ::= GROUP BY grouplist */ + break; + case 215: /* groupby_opt ::= GROUP BY grouplist */ #line 659 "sql.y" -{ yymsp[-2].minor.yy403 = yymsp[0].minor.yy403;} + { yymsp[-2].minor.yy403 = yymsp[0].minor.yy403;} #line 3734 "sql.c" - break; - case 216: /* grouplist ::= grouplist COMMA item */ + break; + case 216: /* grouplist ::= grouplist COMMA item */ #line 661 "sql.y" -{ - yylhsminor.yy403 = tVariantListAppend(yymsp[-2].minor.yy403, &yymsp[0].minor.yy488, -1); -} + { + yylhsminor.yy403 = tVariantListAppend(yymsp[-2].minor.yy403, &yymsp[0].minor.yy488, -1); + } #line 3741 "sql.c" - yymsp[-2].minor.yy403 = yylhsminor.yy403; - break; - case 217: /* grouplist ::= item */ + yymsp[-2].minor.yy403 = yylhsminor.yy403; + break; + case 217: /* grouplist ::= item */ #line 665 "sql.y" -{ - yylhsminor.yy403 = tVariantListAppend(NULL, &yymsp[0].minor.yy488, -1); -} + { + yylhsminor.yy403 = tVariantListAppend(NULL, &yymsp[0].minor.yy488, -1); + } #line 3749 "sql.c" - yymsp[0].minor.yy403 = yylhsminor.yy403; - break; - case 218: /* having_opt ::= */ - case 228: /* where_opt ::= */ yytestcase(yyruleno==228); - case 270: /* expritem ::= */ yytestcase(yyruleno==270); + yymsp[0].minor.yy403 = yylhsminor.yy403; + break; + case 218: /* having_opt ::= */ + case 228: /* where_opt ::= */ yytestcase(yyruleno==228); + case 270: /* expritem ::= */ yytestcase(yyruleno==270); #line 672 "sql.y" -{yymsp[1].minor.yy260 = 0;} + {yymsp[1].minor.yy260 = 0;} #line 3757 "sql.c" - break; - case 219: /* having_opt ::= HAVING expr */ - case 229: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==229); + break; + case 219: /* having_opt ::= HAVING expr */ + case 229: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==229); #line 673 "sql.y" -{yymsp[-1].minor.yy260 = yymsp[0].minor.yy260;} + {yymsp[-1].minor.yy260 = yymsp[0].minor.yy260;} #line 3763 "sql.c" - break; - case 220: /* limit_opt ::= */ - case 224: /* slimit_opt ::= */ yytestcase(yyruleno==224); + break; + case 220: /* limit_opt ::= */ + case 224: /* slimit_opt ::= */ yytestcase(yyruleno==224); #line 677 "sql.y" -{yymsp[1].minor.yy404.limit = -1; yymsp[1].minor.yy404.offset = 0;} + {yymsp[1].minor.yy404.limit = -1; yymsp[1].minor.yy404.offset = 0;} #line 3769 "sql.c" - break; - case 221: /* limit_opt ::= LIMIT signed */ - case 225: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==225); + break; + case 221: /* limit_opt ::= LIMIT signed */ + case 225: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==225); #line 678 "sql.y" -{yymsp[-1].minor.yy404.limit = yymsp[0].minor.yy387; yymsp[-1].minor.yy404.offset = 0;} + {yymsp[-1].minor.yy404.limit = yymsp[0].minor.yy387; yymsp[-1].minor.yy404.offset = 0;} #line 3775 "sql.c" - break; - case 222: /* limit_opt ::= LIMIT signed OFFSET signed */ + break; + case 222: /* limit_opt ::= LIMIT signed OFFSET signed */ #line 680 "sql.y" -{ yymsp[-3].minor.yy404.limit = yymsp[-2].minor.yy387; yymsp[-3].minor.yy404.offset = yymsp[0].minor.yy387;} + { yymsp[-3].minor.yy404.limit = yymsp[-2].minor.yy387; yymsp[-3].minor.yy404.offset = yymsp[0].minor.yy387;} #line 3780 "sql.c" - break; - case 223: /* limit_opt ::= LIMIT signed COMMA signed */ + break; + case 223: /* limit_opt ::= LIMIT signed COMMA signed */ #line 682 "sql.y" -{ yymsp[-3].minor.yy404.limit = yymsp[0].minor.yy387; yymsp[-3].minor.yy404.offset = yymsp[-2].minor.yy387;} + { yymsp[-3].minor.yy404.limit = yymsp[0].minor.yy387; yymsp[-3].minor.yy404.offset = yymsp[-2].minor.yy387;} #line 3785 "sql.c" - break; - case 226: /* slimit_opt ::= SLIMIT signed SOFFSET signed */ + break; + case 226: /* slimit_opt ::= SLIMIT signed SOFFSET signed */ #line 688 "sql.y" -{yymsp[-3].minor.yy404.limit = yymsp[-2].minor.yy387; yymsp[-3].minor.yy404.offset = yymsp[0].minor.yy387;} + {yymsp[-3].minor.yy404.limit = yymsp[-2].minor.yy387; yymsp[-3].minor.yy404.offset = yymsp[0].minor.yy387;} #line 3790 "sql.c" - break; - case 227: /* slimit_opt ::= SLIMIT signed COMMA signed */ + break; + case 227: /* slimit_opt ::= SLIMIT signed COMMA signed */ #line 690 "sql.y" -{yymsp[-3].minor.yy404.limit = yymsp[0].minor.yy387; yymsp[-3].minor.yy404.offset = yymsp[-2].minor.yy387;} + {yymsp[-3].minor.yy404.limit = yymsp[0].minor.yy387; yymsp[-3].minor.yy404.offset = yymsp[-2].minor.yy387;} #line 3795 "sql.c" - break; - case 230: /* expr ::= LP expr RP */ + break; + case 230: /* expr ::= LP expr RP */ #line 703 "sql.y" -{yylhsminor.yy260 = 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);} + {yylhsminor.yy260 = 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);} #line 3800 "sql.c" - yymsp[-2].minor.yy260 = yylhsminor.yy260; - break; - case 231: /* expr ::= ID */ + yymsp[-2].minor.yy260 = yylhsminor.yy260; + break; + case 231: /* expr ::= ID */ #line 705 "sql.y" -{ yylhsminor.yy260 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_ID);} + { yylhsminor.yy260 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_ID);} #line 3806 "sql.c" - yymsp[0].minor.yy260 = yylhsminor.yy260; - break; - case 232: /* expr ::= ID DOT ID */ + yymsp[0].minor.yy260 = yylhsminor.yy260; + break; + case 232: /* expr ::= ID DOT ID */ #line 706 "sql.y" -{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy260 = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ID);} + { yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy260 = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ID);} #line 3812 "sql.c" - yymsp[-2].minor.yy260 = yylhsminor.yy260; - break; - case 233: /* expr ::= ID DOT STAR */ + yymsp[-2].minor.yy260 = yylhsminor.yy260; + break; + case 233: /* expr ::= ID DOT STAR */ #line 707 "sql.y" -{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy260 = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ALL);} + { yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy260 = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ALL);} #line 3818 "sql.c" - yymsp[-2].minor.yy260 = yylhsminor.yy260; - break; - case 234: /* expr ::= INTEGER */ + yymsp[-2].minor.yy260 = yylhsminor.yy260; + break; + case 234: /* expr ::= INTEGER */ #line 709 "sql.y" -{ yylhsminor.yy260 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_INTEGER);} + { yylhsminor.yy260 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_INTEGER);} #line 3824 "sql.c" - yymsp[0].minor.yy260 = yylhsminor.yy260; - break; - case 235: /* expr ::= MINUS INTEGER */ - case 236: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==236); + yymsp[0].minor.yy260 = yylhsminor.yy260; + break; + case 235: /* expr ::= MINUS INTEGER */ + case 236: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==236); #line 710 "sql.y" -{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy260 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_INTEGER);} + { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy260 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_INTEGER);} #line 3831 "sql.c" - yymsp[-1].minor.yy260 = yylhsminor.yy260; - break; - case 237: /* expr ::= FLOAT */ + yymsp[-1].minor.yy260 = yylhsminor.yy260; + break; + case 237: /* expr ::= FLOAT */ #line 712 "sql.y" -{ yylhsminor.yy260 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_FLOAT);} + { yylhsminor.yy260 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_FLOAT);} #line 3837 "sql.c" - yymsp[0].minor.yy260 = yylhsminor.yy260; - break; - case 238: /* expr ::= MINUS FLOAT */ - case 239: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==239); + yymsp[0].minor.yy260 = yylhsminor.yy260; + break; + case 238: /* expr ::= MINUS FLOAT */ + case 239: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==239); #line 713 "sql.y" -{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yylhsminor.yy260 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_FLOAT);} + { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yylhsminor.yy260 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_FLOAT);} #line 3844 "sql.c" - yymsp[-1].minor.yy260 = yylhsminor.yy260; - break; - case 240: /* expr ::= STRING */ + yymsp[-1].minor.yy260 = yylhsminor.yy260; + break; + case 240: /* expr ::= STRING */ #line 715 "sql.y" -{ yylhsminor.yy260 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING);} + { yylhsminor.yy260 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING);} #line 3850 "sql.c" - yymsp[0].minor.yy260 = yylhsminor.yy260; - break; - case 241: /* expr ::= NOW */ + yymsp[0].minor.yy260 = yylhsminor.yy260; + break; + case 241: /* expr ::= NOW */ #line 716 "sql.y" -{ yylhsminor.yy260 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_NOW); } + { yylhsminor.yy260 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_NOW); } #line 3856 "sql.c" - yymsp[0].minor.yy260 = yylhsminor.yy260; - break; - case 242: /* expr ::= VARIABLE */ + yymsp[0].minor.yy260 = yylhsminor.yy260; + break; + case 242: /* expr ::= VARIABLE */ #line 717 "sql.y" -{ yylhsminor.yy260 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_VARIABLE);} + { yylhsminor.yy260 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_VARIABLE);} #line 3862 "sql.c" - yymsp[0].minor.yy260 = yylhsminor.yy260; - break; - case 243: /* expr ::= PLUS VARIABLE */ - case 244: /* expr ::= MINUS VARIABLE */ yytestcase(yyruleno==244); + yymsp[0].minor.yy260 = yylhsminor.yy260; + break; + case 243: /* expr ::= PLUS VARIABLE */ + case 244: /* expr ::= MINUS VARIABLE */ yytestcase(yyruleno==244); #line 718 "sql.y" -{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_VARIABLE; yylhsminor.yy260 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_VARIABLE);} + { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_VARIABLE; yylhsminor.yy260 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_VARIABLE);} #line 3869 "sql.c" - yymsp[-1].minor.yy260 = yylhsminor.yy260; - break; - case 245: /* expr ::= BOOL */ + yymsp[-1].minor.yy260 = yylhsminor.yy260; + break; + case 245: /* expr ::= BOOL */ #line 720 "sql.y" -{ yylhsminor.yy260 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_BOOL);} + { yylhsminor.yy260 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_BOOL);} #line 3875 "sql.c" - yymsp[0].minor.yy260 = yylhsminor.yy260; - break; - case 246: /* expr ::= NULL */ + yymsp[0].minor.yy260 = yylhsminor.yy260; + break; + case 246: /* expr ::= NULL */ #line 721 "sql.y" -{ yylhsminor.yy260 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_NULL);} + { yylhsminor.yy260 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_NULL);} #line 3881 "sql.c" - yymsp[0].minor.yy260 = yylhsminor.yy260; - break; - case 247: /* expr ::= ID LP exprlist RP */ + yymsp[0].minor.yy260 = yylhsminor.yy260; + break; + case 247: /* expr ::= ID LP exprlist RP */ #line 724 "sql.y" -{ tStrTokenAppend(pInfo->funcs, &yymsp[-3].minor.yy0); yylhsminor.yy260 = tSqlExprCreateFunction(yymsp[-1].minor.yy403, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } + { tStrTokenAppend(pInfo->funcs, &yymsp[-3].minor.yy0); yylhsminor.yy260 = tSqlExprCreateFunction(yymsp[-1].minor.yy403, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } #line 3887 "sql.c" - yymsp[-3].minor.yy260 = yylhsminor.yy260; - break; - case 248: /* expr ::= ID LP STAR RP */ + yymsp[-3].minor.yy260 = yylhsminor.yy260; + break; + case 248: /* expr ::= ID LP STAR RP */ #line 727 "sql.y" -{ tStrTokenAppend(pInfo->funcs, &yymsp[-3].minor.yy0); yylhsminor.yy260 = tSqlExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } + { tStrTokenAppend(pInfo->funcs, &yymsp[-3].minor.yy0); yylhsminor.yy260 = tSqlExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } #line 3893 "sql.c" - yymsp[-3].minor.yy260 = yylhsminor.yy260; - break; - case 249: /* expr ::= expr IS NULL */ + yymsp[-3].minor.yy260 = yylhsminor.yy260; + break; + case 249: /* expr ::= expr IS NULL */ #line 730 "sql.y" -{yylhsminor.yy260 = tSqlExprCreate(yymsp[-2].minor.yy260, NULL, TK_ISNULL);} + {yylhsminor.yy260 = tSqlExprCreate(yymsp[-2].minor.yy260, NULL, TK_ISNULL);} #line 3899 "sql.c" - yymsp[-2].minor.yy260 = yylhsminor.yy260; - break; - case 250: /* expr ::= expr IS NOT NULL */ + yymsp[-2].minor.yy260 = yylhsminor.yy260; + break; + case 250: /* expr ::= expr IS NOT NULL */ #line 731 "sql.y" -{yylhsminor.yy260 = tSqlExprCreate(yymsp[-3].minor.yy260, NULL, TK_NOTNULL);} + {yylhsminor.yy260 = tSqlExprCreate(yymsp[-3].minor.yy260, NULL, TK_NOTNULL);} #line 3905 "sql.c" - yymsp[-3].minor.yy260 = yylhsminor.yy260; - break; - case 251: /* expr ::= expr LT expr */ + yymsp[-3].minor.yy260 = yylhsminor.yy260; + break; + case 251: /* expr ::= expr LT expr */ #line 734 "sql.y" -{yylhsminor.yy260 = tSqlExprCreate(yymsp[-2].minor.yy260, yymsp[0].minor.yy260, TK_LT);} + {yylhsminor.yy260 = tSqlExprCreate(yymsp[-2].minor.yy260, yymsp[0].minor.yy260, TK_LT);} #line 3911 "sql.c" - yymsp[-2].minor.yy260 = yylhsminor.yy260; - break; - case 252: /* expr ::= expr GT expr */ + yymsp[-2].minor.yy260 = yylhsminor.yy260; + break; + case 252: /* expr ::= expr GT expr */ #line 735 "sql.y" -{yylhsminor.yy260 = tSqlExprCreate(yymsp[-2].minor.yy260, yymsp[0].minor.yy260, TK_GT);} + {yylhsminor.yy260 = tSqlExprCreate(yymsp[-2].minor.yy260, yymsp[0].minor.yy260, TK_GT);} #line 3917 "sql.c" - yymsp[-2].minor.yy260 = yylhsminor.yy260; - break; - case 253: /* expr ::= expr LE expr */ + yymsp[-2].minor.yy260 = yylhsminor.yy260; + break; + case 253: /* expr ::= expr LE expr */ #line 736 "sql.y" -{yylhsminor.yy260 = tSqlExprCreate(yymsp[-2].minor.yy260, yymsp[0].minor.yy260, TK_LE);} + {yylhsminor.yy260 = tSqlExprCreate(yymsp[-2].minor.yy260, yymsp[0].minor.yy260, TK_LE);} #line 3923 "sql.c" - yymsp[-2].minor.yy260 = yylhsminor.yy260; - break; - case 254: /* expr ::= expr GE expr */ + yymsp[-2].minor.yy260 = yylhsminor.yy260; + break; + case 254: /* expr ::= expr GE expr */ #line 737 "sql.y" -{yylhsminor.yy260 = tSqlExprCreate(yymsp[-2].minor.yy260, yymsp[0].minor.yy260, TK_GE);} + {yylhsminor.yy260 = tSqlExprCreate(yymsp[-2].minor.yy260, yymsp[0].minor.yy260, TK_GE);} #line 3929 "sql.c" - yymsp[-2].minor.yy260 = yylhsminor.yy260; - break; - case 255: /* expr ::= expr NE expr */ + yymsp[-2].minor.yy260 = yylhsminor.yy260; + break; + case 255: /* expr ::= expr NE expr */ #line 738 "sql.y" -{yylhsminor.yy260 = tSqlExprCreate(yymsp[-2].minor.yy260, yymsp[0].minor.yy260, TK_NE);} + {yylhsminor.yy260 = tSqlExprCreate(yymsp[-2].minor.yy260, yymsp[0].minor.yy260, TK_NE);} #line 3935 "sql.c" - yymsp[-2].minor.yy260 = yylhsminor.yy260; - break; - case 256: /* expr ::= expr EQ expr */ + yymsp[-2].minor.yy260 = yylhsminor.yy260; + break; + case 256: /* expr ::= expr EQ expr */ #line 739 "sql.y" -{yylhsminor.yy260 = tSqlExprCreate(yymsp[-2].minor.yy260, yymsp[0].minor.yy260, TK_EQ);} + {yylhsminor.yy260 = tSqlExprCreate(yymsp[-2].minor.yy260, yymsp[0].minor.yy260, TK_EQ);} #line 3941 "sql.c" - yymsp[-2].minor.yy260 = yylhsminor.yy260; - break; - case 257: /* expr ::= expr BETWEEN expr AND expr */ + yymsp[-2].minor.yy260 = yylhsminor.yy260; + break; + case 257: /* expr ::= expr BETWEEN expr AND expr */ #line 741 "sql.y" -{ tSqlExpr* X2 = tSqlExprClone(yymsp[-4].minor.yy260); yylhsminor.yy260 = tSqlExprCreate(tSqlExprCreate(yymsp[-4].minor.yy260, yymsp[-2].minor.yy260, TK_GE), tSqlExprCreate(X2, yymsp[0].minor.yy260, TK_LE), TK_AND);} + { tSqlExpr* X2 = tSqlExprClone(yymsp[-4].minor.yy260); yylhsminor.yy260 = tSqlExprCreate(tSqlExprCreate(yymsp[-4].minor.yy260, yymsp[-2].minor.yy260, TK_GE), tSqlExprCreate(X2, yymsp[0].minor.yy260, TK_LE), TK_AND);} #line 3947 "sql.c" - yymsp[-4].minor.yy260 = yylhsminor.yy260; - break; - case 258: /* expr ::= expr AND expr */ + yymsp[-4].minor.yy260 = yylhsminor.yy260; + break; + case 258: /* expr ::= expr AND expr */ #line 743 "sql.y" -{yylhsminor.yy260 = tSqlExprCreate(yymsp[-2].minor.yy260, yymsp[0].minor.yy260, TK_AND);} + {yylhsminor.yy260 = tSqlExprCreate(yymsp[-2].minor.yy260, yymsp[0].minor.yy260, TK_AND);} #line 3953 "sql.c" - yymsp[-2].minor.yy260 = yylhsminor.yy260; - break; - case 259: /* expr ::= expr OR expr */ + yymsp[-2].minor.yy260 = yylhsminor.yy260; + break; + case 259: /* expr ::= expr OR expr */ #line 744 "sql.y" -{yylhsminor.yy260 = tSqlExprCreate(yymsp[-2].minor.yy260, yymsp[0].minor.yy260, TK_OR); } + {yylhsminor.yy260 = tSqlExprCreate(yymsp[-2].minor.yy260, yymsp[0].minor.yy260, TK_OR); } #line 3959 "sql.c" - yymsp[-2].minor.yy260 = yylhsminor.yy260; - break; - case 260: /* expr ::= expr PLUS expr */ + yymsp[-2].minor.yy260 = yylhsminor.yy260; + break; + case 260: /* expr ::= expr PLUS expr */ #line 747 "sql.y" -{yylhsminor.yy260 = tSqlExprCreate(yymsp[-2].minor.yy260, yymsp[0].minor.yy260, TK_PLUS); } + {yylhsminor.yy260 = tSqlExprCreate(yymsp[-2].minor.yy260, yymsp[0].minor.yy260, TK_PLUS); } #line 3965 "sql.c" - yymsp[-2].minor.yy260 = yylhsminor.yy260; - break; - case 261: /* expr ::= expr MINUS expr */ + yymsp[-2].minor.yy260 = yylhsminor.yy260; + break; + case 261: /* expr ::= expr MINUS expr */ #line 748 "sql.y" -{yylhsminor.yy260 = tSqlExprCreate(yymsp[-2].minor.yy260, yymsp[0].minor.yy260, TK_MINUS); } + {yylhsminor.yy260 = tSqlExprCreate(yymsp[-2].minor.yy260, yymsp[0].minor.yy260, TK_MINUS); } #line 3971 "sql.c" - yymsp[-2].minor.yy260 = yylhsminor.yy260; - break; - case 262: /* expr ::= expr STAR expr */ + yymsp[-2].minor.yy260 = yylhsminor.yy260; + break; + case 262: /* expr ::= expr STAR expr */ #line 749 "sql.y" -{yylhsminor.yy260 = tSqlExprCreate(yymsp[-2].minor.yy260, yymsp[0].minor.yy260, TK_STAR); } + {yylhsminor.yy260 = tSqlExprCreate(yymsp[-2].minor.yy260, yymsp[0].minor.yy260, TK_STAR); } #line 3977 "sql.c" - yymsp[-2].minor.yy260 = yylhsminor.yy260; - break; - case 263: /* expr ::= expr SLASH expr */ + yymsp[-2].minor.yy260 = yylhsminor.yy260; + break; + case 263: /* expr ::= expr SLASH expr */ #line 750 "sql.y" -{yylhsminor.yy260 = tSqlExprCreate(yymsp[-2].minor.yy260, yymsp[0].minor.yy260, TK_DIVIDE);} + {yylhsminor.yy260 = tSqlExprCreate(yymsp[-2].minor.yy260, yymsp[0].minor.yy260, TK_DIVIDE);} #line 3983 "sql.c" - yymsp[-2].minor.yy260 = yylhsminor.yy260; - break; - case 264: /* expr ::= expr REM expr */ + yymsp[-2].minor.yy260 = yylhsminor.yy260; + break; + case 264: /* expr ::= expr REM expr */ #line 751 "sql.y" -{yylhsminor.yy260 = tSqlExprCreate(yymsp[-2].minor.yy260, yymsp[0].minor.yy260, TK_REM); } + {yylhsminor.yy260 = tSqlExprCreate(yymsp[-2].minor.yy260, yymsp[0].minor.yy260, TK_REM); } #line 3989 "sql.c" - yymsp[-2].minor.yy260 = yylhsminor.yy260; - break; - case 265: /* expr ::= expr LIKE expr */ + yymsp[-2].minor.yy260 = yylhsminor.yy260; + break; + case 265: /* expr ::= expr LIKE expr */ #line 754 "sql.y" -{yylhsminor.yy260 = tSqlExprCreate(yymsp[-2].minor.yy260, yymsp[0].minor.yy260, TK_LIKE); } + {yylhsminor.yy260 = tSqlExprCreate(yymsp[-2].minor.yy260, yymsp[0].minor.yy260, TK_LIKE); } #line 3995 "sql.c" - yymsp[-2].minor.yy260 = yylhsminor.yy260; - break; - case 266: /* expr ::= expr IN LP exprlist RP */ + yymsp[-2].minor.yy260 = yylhsminor.yy260; + break; + case 266: /* expr ::= expr IN LP exprlist RP */ #line 757 "sql.y" -{yylhsminor.yy260 = tSqlExprCreate(yymsp[-4].minor.yy260, (tSqlExpr*)yymsp[-1].minor.yy403, TK_IN); } + {yylhsminor.yy260 = tSqlExprCreate(yymsp[-4].minor.yy260, (tSqlExpr*)yymsp[-1].minor.yy403, TK_IN); } #line 4001 "sql.c" - yymsp[-4].minor.yy260 = yylhsminor.yy260; - break; - case 267: /* exprlist ::= exprlist COMMA expritem */ + yymsp[-4].minor.yy260 = yylhsminor.yy260; + break; + case 267: /* exprlist ::= exprlist COMMA expritem */ #line 765 "sql.y" -{yylhsminor.yy403 = tSqlExprListAppend(yymsp[-2].minor.yy403,yymsp[0].minor.yy260,0, 0);} + {yylhsminor.yy403 = tSqlExprListAppend(yymsp[-2].minor.yy403,yymsp[0].minor.yy260,0, 0);} #line 4007 "sql.c" - yymsp[-2].minor.yy403 = yylhsminor.yy403; - break; - case 268: /* exprlist ::= expritem */ + yymsp[-2].minor.yy403 = yylhsminor.yy403; + break; + case 268: /* exprlist ::= expritem */ #line 766 "sql.y" -{yylhsminor.yy403 = tSqlExprListAppend(0,yymsp[0].minor.yy260,0, 0);} + {yylhsminor.yy403 = tSqlExprListAppend(0,yymsp[0].minor.yy260,0, 0);} #line 4013 "sql.c" - yymsp[0].minor.yy403 = yylhsminor.yy403; - break; - case 269: /* expritem ::= expr */ + yymsp[0].minor.yy403 = yylhsminor.yy403; + break; + case 269: /* expritem ::= expr */ #line 767 "sql.y" -{yylhsminor.yy260 = yymsp[0].minor.yy260;} + {yylhsminor.yy260 = yymsp[0].minor.yy260;} #line 4019 "sql.c" - yymsp[0].minor.yy260 = yylhsminor.yy260; - break; - case 271: /* cmd ::= RESET QUERY CACHE */ + yymsp[0].minor.yy260 = yylhsminor.yy260; + break; + case 271: /* cmd ::= RESET QUERY CACHE */ #line 771 "sql.y" -{ setDCLSqlElems(pInfo, TSDB_SQL_RESET_CACHE, 0);} + { setDCLSqlElems(pInfo, TSDB_SQL_RESET_CACHE, 0);} #line 4025 "sql.c" - break; - case 272: /* cmd ::= SYNCDB ids REPLICA */ + break; + case 272: /* cmd ::= SYNCDB ids REPLICA */ #line 774 "sql.y" -{ setDCLSqlElems(pInfo, TSDB_SQL_SYNC_DB_REPLICA, 1, &yymsp[-1].minor.yy0);} + { setDCLSqlElems(pInfo, TSDB_SQL_SYNC_DB_REPLICA, 1, &yymsp[-1].minor.yy0);} #line 4030 "sql.c" - break; - case 273: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ + break; + case 273: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ #line 777 "sql.y" -{ - yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy403, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, -1); - setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); -} + { + yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy403, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, -1); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); + } #line 4039 "sql.c" - break; - case 274: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ + break; + case 274: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ #line 783 "sql.y" -{ - yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; + { + yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - toTSDBType(yymsp[0].minor.yy0.type); - SArray* K = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1); + toTSDBType(yymsp[0].minor.yy0.type); + SArray* K = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1); - SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, K, TSDB_ALTER_TABLE_DROP_COLUMN, -1); - setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); -} + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, K, TSDB_ALTER_TABLE_DROP_COLUMN, -1); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); + } #line 4052 "sql.c" - break; - case 275: /* cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */ + break; + case 275: /* cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */ #line 793 "sql.y" -{ - yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy403, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, -1); - setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); -} + { + yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy403, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, -1); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); + } #line 4061 "sql.c" - break; - case 276: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ + break; + case 276: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ #line 800 "sql.y" -{ - yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy403, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, -1); - setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); -} + { + yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy403, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, -1); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); + } #line 4070 "sql.c" - break; - case 277: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ + break; + case 277: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ #line 805 "sql.y" -{ - yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; + { + yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - toTSDBType(yymsp[0].minor.yy0.type); - SArray* A = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1); + toTSDBType(yymsp[0].minor.yy0.type); + SArray* A = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1); - SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN, -1); - setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); -} + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN, -1); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); + } #line 4083 "sql.c" - break; - case 278: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ + break; + case 278: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ #line 815 "sql.y" -{ - yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; + { + yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; - toTSDBType(yymsp[-1].minor.yy0.type); - SArray* A = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1); + toTSDBType(yymsp[-1].minor.yy0.type); + SArray* A = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1); - toTSDBType(yymsp[0].minor.yy0.type); - A = tVariantListAppendToken(A, &yymsp[0].minor.yy0, -1); + toTSDBType(yymsp[0].minor.yy0.type); + A = tVariantListAppendToken(A, &yymsp[0].minor.yy0, -1); - SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-5].minor.yy0, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN, -1); - setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); -} + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-5].minor.yy0, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN, -1); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); + } #line 4099 "sql.c" - break; - case 279: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ + break; + case 279: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ #line 828 "sql.y" -{ - yymsp[-6].minor.yy0.n += yymsp[-5].minor.yy0.n; + { + yymsp[-6].minor.yy0.n += yymsp[-5].minor.yy0.n; - toTSDBType(yymsp[-2].minor.yy0.type); - SArray* A = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1); - A = tVariantListAppend(A, &yymsp[0].minor.yy488, -1); + toTSDBType(yymsp[-2].minor.yy0.type); + SArray* A = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1); + A = tVariantListAppend(A, &yymsp[0].minor.yy488, -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); -} + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-6].minor.yy0, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, -1); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); + } #line 4113 "sql.c" - break; - case 280: /* cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */ + break; + case 280: /* cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */ #line 839 "sql.y" -{ - yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy403, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, -1); - setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); -} + { + yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy403, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, -1); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); + } #line 4122 "sql.c" - break; - case 281: /* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ + break; + case 281: /* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ #line 846 "sql.y" -{ - yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy403, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, TSDB_SUPER_TABLE); - setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); -} + { + yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy403, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, TSDB_SUPER_TABLE); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); + } #line 4131 "sql.c" - break; - case 282: /* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ + break; + case 282: /* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ #line 852 "sql.y" -{ - yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; + { + yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - toTSDBType(yymsp[0].minor.yy0.type); - SArray* K = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1); + toTSDBType(yymsp[0].minor.yy0.type); + SArray* K = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1); - SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, K, TSDB_ALTER_TABLE_DROP_COLUMN, TSDB_SUPER_TABLE); - setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); -} + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, K, TSDB_ALTER_TABLE_DROP_COLUMN, TSDB_SUPER_TABLE); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); + } #line 4144 "sql.c" - break; - case 283: /* cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */ + break; + case 283: /* cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */ #line 862 "sql.y" -{ - yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy403, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, TSDB_SUPER_TABLE); - setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); -} + { + yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy403, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, TSDB_SUPER_TABLE); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); + } #line 4153 "sql.c" - break; - case 284: /* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ + break; + case 284: /* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ #line 869 "sql.y" -{ - yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy403, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, TSDB_SUPER_TABLE); - setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); -} + { + yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy403, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, TSDB_SUPER_TABLE); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); + } #line 4162 "sql.c" - break; - case 285: /* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ + break; + case 285: /* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ #line 874 "sql.y" -{ - yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; + { + yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - toTSDBType(yymsp[0].minor.yy0.type); - SArray* A = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1); + toTSDBType(yymsp[0].minor.yy0.type); + SArray* A = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1); - SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN, TSDB_SUPER_TABLE); - setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); -} + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN, TSDB_SUPER_TABLE); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); + } #line 4175 "sql.c" - break; - case 286: /* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ + break; + case 286: /* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ #line 884 "sql.y" -{ - yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; + { + yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; - toTSDBType(yymsp[-1].minor.yy0.type); - SArray* A = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1); + toTSDBType(yymsp[-1].minor.yy0.type); + SArray* A = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1); - toTSDBType(yymsp[0].minor.yy0.type); - A = tVariantListAppendToken(A, &yymsp[0].minor.yy0, -1); + toTSDBType(yymsp[0].minor.yy0.type); + A = tVariantListAppendToken(A, &yymsp[0].minor.yy0, -1); - SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-5].minor.yy0, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN, TSDB_SUPER_TABLE); - setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); -} + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-5].minor.yy0, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN, TSDB_SUPER_TABLE); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); + } #line 4191 "sql.c" - break; - case 287: /* cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */ + break; + case 287: /* cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */ #line 897 "sql.y" -{ - yymsp[-6].minor.yy0.n += yymsp[-5].minor.yy0.n; + { + yymsp[-6].minor.yy0.n += yymsp[-5].minor.yy0.n; - toTSDBType(yymsp[-2].minor.yy0.type); - SArray* A = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1); - A = tVariantListAppend(A, &yymsp[0].minor.yy488, -1); + toTSDBType(yymsp[-2].minor.yy0.type); + SArray* A = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1); + A = tVariantListAppend(A, &yymsp[0].minor.yy488, -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); -} + 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); + } #line 4205 "sql.c" - break; - case 288: /* cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */ + break; + case 288: /* cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */ #line 908 "sql.y" -{ - yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy403, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, TSDB_SUPER_TABLE); - setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); -} + { + yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy403, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, TSDB_SUPER_TABLE); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); + } #line 4214 "sql.c" - break; - case 289: /* cmd ::= KILL CONNECTION INTEGER */ + break; + case 289: /* cmd ::= KILL CONNECTION INTEGER */ #line 915 "sql.y" -{setKillSql(pInfo, TSDB_SQL_KILL_CONNECTION, &yymsp[0].minor.yy0);} + {setKillSql(pInfo, TSDB_SQL_KILL_CONNECTION, &yymsp[0].minor.yy0);} #line 4219 "sql.c" - break; - case 290: /* cmd ::= KILL STREAM INTEGER COLON INTEGER */ + break; + case 290: /* cmd ::= KILL STREAM INTEGER COLON INTEGER */ #line 916 "sql.y" -{yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_STREAM, &yymsp[-2].minor.yy0);} + {yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_STREAM, &yymsp[-2].minor.yy0);} #line 4224 "sql.c" - break; - case 291: /* cmd ::= KILL QUERY INTEGER COLON INTEGER */ + break; + case 291: /* cmd ::= KILL QUERY INTEGER COLON INTEGER */ #line 917 "sql.y" -{yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_QUERY, &yymsp[-2].minor.yy0);} + {yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_QUERY, &yymsp[-2].minor.yy0);} #line 4229 "sql.c" - break; - default: - break; -/********** End reduce actions ************************************************/ + break; + default: + break; + /********** End reduce actions ************************************************/ }; assert( yyrulenoyytos>yypParser->yystack ) yy_pop_parser_stack(yypParser); /* Here code is inserted which will be executed whenever the ** parser fails */ -/************ Begin %parse_failure code ***************************************/ -/************ End %parse_failure code *****************************************/ + /************ Begin %parse_failure code ***************************************/ + /************ End %parse_failure code *****************************************/ ParseARG_STORE /* Suppress warning about unused %extra_argument variable */ - ParseCTX_STORE + ParseCTX_STORE } #endif /* YYNOERRORRECOVERY */ @@ -4280,17 +4280,17 @@ static void yy_parse_failed( ** The following code executes when a syntax error first occurs. */ static void yy_syntax_error( - yyParser *yypParser, /* The parser */ - int yymajor, /* The major type of the error token */ - ParseTOKENTYPE yyminor /* The minor type of the error token */ + yyParser *yypParser, /* The parser */ + int yymajor, /* The major type of the error token */ + ParseTOKENTYPE yyminor /* The minor type of the error token */ ){ ParseARG_FETCH - ParseCTX_FETCH + ParseCTX_FETCH #define TOKEN yyminor /************ Begin %syntax_error code ****************************************/ #line 37 "sql.y" - pInfo->valid = false; + pInfo->valid = false; int32_t outputBufLen = tListLen(pInfo->msg); int32_t len = 0; @@ -4299,11 +4299,11 @@ static void yy_syntax_error( int32_t sqlLen = strlen(&TOKEN.z[0]); if (sqlLen + sizeof(msg)/sizeof(msg[0]) + 1 > outputBufLen) { - char tmpstr[128] = {0}; - memcpy(tmpstr, &TOKEN.z[0], sizeof(tmpstr)/sizeof(tmpstr[0]) - 1); - len = sprintf(pInfo->msg, msg, tmpstr); + char tmpstr[128] = {0}; + memcpy(tmpstr, &TOKEN.z[0], sizeof(tmpstr)/sizeof(tmpstr[0]) - 1); + len = sprintf(pInfo->msg, msg, tmpstr); } else { - len = sprintf(pInfo->msg, msg, &TOKEN.z[0]); + len = sprintf(pInfo->msg, msg, &TOKEN.z[0]); } } else { @@ -4312,21 +4312,21 @@ static void yy_syntax_error( assert(len <= outputBufLen); #line 4314 "sql.c" -/************ End %syntax_error code ******************************************/ + /************ End %syntax_error code ******************************************/ ParseARG_STORE /* Suppress warning about unused %extra_argument variable */ - ParseCTX_STORE + ParseCTX_STORE } /* ** The following is executed when the parser accepts */ static void yy_accept( - yyParser *yypParser /* The parser */ + yyParser *yypParser /* The parser */ ){ ParseARG_FETCH - ParseCTX_FETCH + ParseCTX_FETCH #ifndef NDEBUG - if( yyTraceFILE ){ + if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt); } #endif @@ -4339,9 +4339,9 @@ static void yy_accept( /*********** Begin %parse_accept code *****************************************/ #line 61 "sql.y" #line 4341 "sql.c" -/*********** End %parse_accept code *******************************************/ + /*********** End %parse_accept code *******************************************/ ParseARG_STORE /* Suppress warning about unused %extra_argument variable */ - ParseCTX_STORE + ParseCTX_STORE } /* The main parser program. @@ -4364,10 +4364,10 @@ static void yy_accept( ** None. */ void Parse( - void *yyp, /* The parser */ - int yymajor, /* The major token code number */ - ParseTOKENTYPE yyminor /* The value for the token */ - ParseARG_PDECL /* Optional %extra_argument parameter */ + void *yyp, /* The parser */ + int yymajor, /* The major token code number */ + ParseTOKENTYPE yyminor /* The value for the token */ + ParseARG_PDECL /* Optional %extra_argument parameter */ ){ YYMINORTYPE yyminorunion; YYACTIONTYPE yyact; /* The parser action. */ @@ -4379,9 +4379,9 @@ void Parse( #endif yyParser *yypParser = (yyParser*)yyp; /* The parser */ ParseCTX_FETCH - ParseARG_STORE + ParseARG_STORE - assert( yypParser->yytos!=0 ); + assert( yypParser->yytos!=0 ); #if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY) yyendofinput = (yymajor==0); #endif @@ -4411,14 +4411,14 @@ void Parse( int yysize = yyRuleInfoNRhs[yyruleno]; if( yysize ){ fprintf(yyTraceFILE, "%sReduce %d [%s]%s, pop back to state %d.\n", - yyTracePrompt, - yyruleno, yyRuleName[yyruleno], - yyrulenoyytos[yysize].stateno); + yyTracePrompt, + yyruleno, yyRuleName[yyruleno], + yyrulenoyytos[yysize].stateno); }else{ fprintf(yyTraceFILE, "%sReduce %d [%s]%s.\n", - yyTracePrompt, yyruleno, yyRuleName[yyruleno], - yyrulenoyytos - yypParser->yystack)>yypParser->yyhwm ){ yypParser->yyhwm++; assert( yypParser->yyhwm == - (int)(yypParser->yytos - yypParser->yystack)); + (int)(yypParser->yytos - yypParser->yystack)); } #endif -#if YYSTACKDEPTH>0 +#if YYSTACKDEPTH>0 if( yypParser->yytos>=yypParser->yystackEnd ){ yyStackOverflow(yypParser); break; @@ -4473,7 +4473,7 @@ void Parse( #ifdef YYERRORSYMBOL /* A syntax error has occurred. ** The response to an error depends upon whether or not the - ** grammar defines an error token "ERROR". + ** grammar defines an error token "ERROR". ** ** This is what we do if the grammar does define ERROR: ** @@ -4498,7 +4498,7 @@ void Parse( #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sDiscard input token %s\n", - yyTracePrompt,yyTokenName[yymajor]); + yyTracePrompt,yyTokenName[yymajor]); } #endif yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion); @@ -4588,4 +4588,4 @@ int ParseFallback(int iToken){ (void)iToken; return 0; #endif -} +} \ No newline at end of file diff --git a/src/sync/src/syncRetrieve.c b/src/sync/src/syncRetrieve.c index c86ab8549974712658ad3d381c4141427c000762..623d6e3cc0c20ef3c69b4ebfb6752616c1ff56b0 100644 --- a/src/sync/src/syncRetrieve.c +++ b/src/sync/src/syncRetrieve.c @@ -233,7 +233,7 @@ static int64_t syncProcessLastWal(SSyncPeer *pPeer, char *wname, int64_t index) int32_t once = 0; // last WAL has once ever been processed int64_t offset = 0; uint64_t fversion = 0; - char fname[TSDB_FILENAME_LEN * 2] = {0}; // full path to wal file + char fname[TSDB_FILENAME_LEN * 3] = {0}; // full path to wal file // get full path to wal file snprintf(fname, sizeof(fname), "%s/%s", pNode->path, wname); diff --git a/src/tsdb/inc/tsdbMeta.h b/src/tsdb/inc/tsdbMeta.h index a13b522eece382fc9c8f0d1de471e2f1c9421840..941b958c04beee4bda98275edd4a6b58e13eb32f 100644 --- a/src/tsdb/inc/tsdbMeta.h +++ b/src/tsdb/inc/tsdbMeta.h @@ -41,6 +41,7 @@ typedef struct STable { int16_t restoreColumnNum; bool hasRestoreLastColumn; int lastColSVersion; + int16_t cacheLastConfigVersion; T_REF_DECLARE() } STable; diff --git a/src/tsdb/inc/tsdbint.h b/src/tsdb/inc/tsdbint.h index 532907ae01be576e40feea2969761846f07170b3..3b0937861d6d256f28818157b4517efecd2f11c7 100644 --- a/src/tsdb/inc/tsdbint.h +++ b/src/tsdb/inc/tsdbint.h @@ -79,8 +79,8 @@ struct STsdbRepo { STsdbCfg save_config; // save apply config bool config_changed; // config changed flag pthread_mutex_t save_mutex; // protect save config - - uint8_t hasCachedLastColumn; + + int16_t cacheLastConfigVersion; STsdbAppH appH; STsdbStat stat; @@ -110,7 +110,8 @@ int tsdbUnlockRepo(STsdbRepo* pRepo); STsdbMeta* tsdbGetMeta(STsdbRepo* pRepo); int tsdbCheckCommit(STsdbRepo* pRepo); int tsdbRestoreInfo(STsdbRepo* pRepo); -int tsdbCacheLastData(STsdbRepo *pRepo, STsdbCfg* oldCfg); +UNUSED_FUNC int tsdbCacheLastData(STsdbRepo *pRepo, STsdbCfg* oldCfg); +int32_t tsdbLoadLastCache(STsdbRepo *pRepo, STable* pTable); void tsdbGetRootDir(int repoid, char dirName[]); void tsdbGetDataDir(int repoid, char dirName[]); diff --git a/src/tsdb/src/tsdbCommit.c b/src/tsdb/src/tsdbCommit.c index adb7fae0ab7e81eb2718e13eee8485192644de74..6790e93782c312dae125cafd7821347b032983f1 100644 --- a/src/tsdb/src/tsdbCommit.c +++ b/src/tsdb/src/tsdbCommit.c @@ -223,7 +223,7 @@ int tsdbWriteBlockIdx(SDFile *pHeadf, SArray *pIdxA, void **ppBuf) { SBlockIdx *pBlkIdx; size_t nidx = taosArrayGetSize(pIdxA); int tlen = 0, size; - int64_t offset; + int64_t offset = 0; if (nidx <= 0) { // All data are deleted diff --git a/src/tsdb/src/tsdbCommitQueue.c b/src/tsdb/src/tsdbCommitQueue.c index 59fb4f334d3006eb7e8807ce193d61905f2322d2..dccb85af55b8f76739f16621a0959c29fb373b4a 100644 --- a/src/tsdb/src/tsdbCommitQueue.c +++ b/src/tsdb/src/tsdbCommitQueue.c @@ -146,7 +146,9 @@ static void tsdbApplyRepoConfig(STsdbRepo *pRepo) { if (oldCfg.cacheLastRow != pRepo->config.cacheLastRow) { if (tsdbLockRepo(pRepo) < 0) return; - tsdbCacheLastData(pRepo, &oldCfg); + // tsdbCacheLastData(pRepo, &oldCfg); + // lazy load last cache when query or update + ++pRepo->cacheLastConfigVersion; tsdbUnlockRepo(pRepo); } diff --git a/src/tsdb/src/tsdbCompact.c b/src/tsdb/src/tsdbCompact.c index 9b890ec113600420c179f4d13159706d79dd322a..a898b1f7ee8ea8806880b69d34224153e6322210 100644 --- a/src/tsdb/src/tsdbCompact.c +++ b/src/tsdb/src/tsdbCompact.c @@ -64,7 +64,9 @@ int tsdbCompact(STsdbRepo *pRepo) { return tsdbAsyncCompact(pRepo); } void *tsdbCompactImpl(STsdbRepo *pRepo) { // Check if there are files in TSDB FS to compact if (REPO_FS(pRepo)->cstatus->pmf == NULL) { - tsdbInfo("vgId:%d no file to compact in FS", REPO_ID(pRepo)); + pRepo->compactState = TSDB_NO_COMPACT; + tsem_post(&(pRepo->readyToCommit)); + tsdbInfo("vgId:%d compact over, no file to compact in FS", REPO_ID(pRepo)); return NULL; } diff --git a/src/tsdb/src/tsdbMain.c b/src/tsdb/src/tsdbMain.c index 9cb04738534da529e7f31b4ec39f473b6e722061..6ed638995af5eb617a7cfae45d4618e62b7eb4bf 100644 --- a/src/tsdb/src/tsdbMain.c +++ b/src/tsdb/src/tsdbMain.c @@ -562,7 +562,7 @@ static STsdbRepo *tsdbNewRepo(STsdbCfg *pCfg, STsdbAppH *pAppH) { return NULL; } pRepo->config_changed = false; - atomic_store_8(&pRepo->hasCachedLastColumn, 0); + pRepo->cacheLastConfigVersion = 0; code = tsem_init(&(pRepo->readyToCommit), 0, 1); if (code != 0) { @@ -711,7 +711,7 @@ static int tsdbRestoreLastColumns(STsdbRepo *pRepo, STable *pTable, SReadH* pRea tsdbGetBlockStatis(pReadh, pBlockStatis, (int)numColumns); loadStatisData = true; } - + TSDB_WLOCK_TABLE(pTable); // lock when update pTable->lastCols[] for (int16_t i = 0; i < numColumns && numColumns > pTable->restoreColumnNum; ++i) { STColumn *pCol = schemaColAt(pSchema, i); // ignore loaded columns @@ -760,6 +760,7 @@ static int tsdbRestoreLastColumns(STsdbRepo *pRepo, STable *pTable, SReadH* pRea break; } } + TSDB_WUNLOCK_TABLE(pTable); } out: @@ -774,7 +775,6 @@ out: } static int tsdbRestoreLastRow(STsdbRepo *pRepo, STable *pTable, SReadH* pReadh, SBlockIdx *pIdx) { - ASSERT(pTable->lastRow == NULL); if (tsdbLoadBlockInfo(pReadh, NULL) < 0) { return -1; } @@ -788,21 +788,32 @@ static int tsdbRestoreLastRow(STsdbRepo *pRepo, STable *pTable, SReadH* pReadh, // Get the data in row STSchema *pSchema = tsdbGetTableSchema(pTable); - pTable->lastRow = taosTMalloc(memRowMaxBytesFromSchema(pSchema)); - if (pTable->lastRow == NULL) { + SMemRow lastRow = taosTMalloc(memRowMaxBytesFromSchema(pSchema)); + if (lastRow == NULL) { terrno = TSDB_CODE_TDB_OUT_OF_MEMORY; return -1; } - memRowSetType(pTable->lastRow, SMEM_ROW_DATA); - tdInitDataRow(memRowDataBody(pTable->lastRow), pSchema); + memRowSetType(lastRow, SMEM_ROW_DATA); + tdInitDataRow(memRowDataBody(lastRow), pSchema); for (int icol = 0; icol < schemaNCols(pSchema); icol++) { STColumn *pCol = schemaColAt(pSchema, icol); SDataCol *pDataCol = pReadh->pDCols[0]->cols + icol; - tdAppendColVal(memRowDataBody(pTable->lastRow), tdGetColDataOfRow(pDataCol, pBlock->numOfRows - 1), pCol->type, + tdAppendColVal(memRowDataBody(lastRow), tdGetColDataOfRow(pDataCol, pBlock->numOfRows - 1), pCol->type, pCol->offset); } - pTable->lastKey = memRowKey(pTable->lastRow); + TSKEY lastKey = memRowKey(lastRow); + + // during the load data in file, new data would be inserted and last row has been updated + TSDB_WLOCK_TABLE(pTable); + if (pTable->lastRow == NULL) { + pTable->lastKey = lastKey; + pTable->lastRow = lastRow; + TSDB_WUNLOCK_TABLE(pTable); + } else { + TSDB_WUNLOCK_TABLE(pTable); + taosTZfree(lastRow); + } return 0; } @@ -874,14 +885,105 @@ int tsdbRestoreInfo(STsdbRepo *pRepo) { tsdbDestroyReadH(&readh); - if (CACHE_LAST_NULL_COLUMN(pCfg)) { - atomic_store_8(&pRepo->hasCachedLastColumn, 1); + // if (CACHE_LAST_NULL_COLUMN(pCfg)) { + // atomic_store_8(&pRepo->hasCachedLastColumn, 1); + // } + + return 0; +} + +int32_t tsdbLoadLastCache(STsdbRepo *pRepo, STable *pTable) { + SFSIter fsiter; + SReadH readh; + SDFileSet *pSet; + int cacheLastRowTableNum = 0; + int cacheLastColTableNum = 0; + + bool cacheLastRow = CACHE_LAST_ROW(&(pRepo->config)); + bool cacheLastCol = CACHE_LAST_NULL_COLUMN(&(pRepo->config)); + + tsdbDebug("tsdbLoadLastCache for %s, cacheLastRow:%d, cacheLastCol:%d", pTable->name->data, cacheLastRow, cacheLastCol); + + pTable->cacheLastConfigVersion = pRepo->cacheLastConfigVersion; + + if (!cacheLastRow && pTable->lastRow != NULL) { + taosTZfree(pTable->lastRow); + pTable->lastRow = NULL; } + if (!cacheLastCol && pTable->lastCols != NULL) { + tsdbFreeLastColumns(pTable); + } + + if (!cacheLastRow && !cacheLastCol) { + return 0; + } + + cacheLastRowTableNum = (cacheLastRow && pTable->lastRow == NULL) ? 1 : 0; + cacheLastColTableNum = (cacheLastCol && pTable->lastCols == NULL) ? 1 : 0; + + if (cacheLastRowTableNum == 0 && cacheLastColTableNum == 0) { + return 0; + } + + if (tsdbInitReadH(&readh, pRepo) < 0) { + return -1; + } + + tsdbRLockFS(REPO_FS(pRepo)); + tsdbFSIterInit(&fsiter, REPO_FS(pRepo), TSDB_FS_ITER_BACKWARD); + + while ((cacheLastRowTableNum > 0 || cacheLastColTableNum > 0) && (pSet = tsdbFSIterNext(&fsiter)) != NULL) { + if (tsdbSetAndOpenReadFSet(&readh, pSet) < 0) { + tsdbUnLockFS(REPO_FS(pRepo)); + tsdbDestroyReadH(&readh); + return -1; + } + + if (tsdbLoadBlockIdx(&readh) < 0) { + tsdbUnLockFS(REPO_FS(pRepo)); + tsdbDestroyReadH(&readh); + return -1; + } + + // tsdbDebug("tsdbRestoreInfo restore vgId:%d,table:%s", REPO_ID(pRepo), pTable->name->data); + + if (tsdbSetReadTable(&readh, pTable) < 0) { + tsdbUnLockFS(REPO_FS(pRepo)); + tsdbDestroyReadH(&readh); + return -1; + } + + SBlockIdx *pIdx = readh.pBlkIdx; + + if (pIdx && (cacheLastRowTableNum > 0) && (pTable->lastRow == NULL)) { + if (tsdbRestoreLastRow(pRepo, pTable, &readh, pIdx) != 0) { + tsdbUnLockFS(REPO_FS(pRepo)); + tsdbDestroyReadH(&readh); + return -1; + } + cacheLastRowTableNum -= 1; + } + + // restore NULL columns + if (pIdx && (cacheLastColTableNum > 0) && !pTable->hasRestoreLastColumn) { + if (tsdbRestoreLastColumns(pRepo, pTable, &readh) != 0) { + tsdbUnLockFS(REPO_FS(pRepo)); + tsdbDestroyReadH(&readh); + return -1; + } + if (pTable->hasRestoreLastColumn) { + cacheLastColTableNum -= 1; + } + } + } + + tsdbUnLockFS(REPO_FS(pRepo)); + tsdbDestroyReadH(&readh); return 0; } -int tsdbCacheLastData(STsdbRepo *pRepo, STsdbCfg* oldCfg) { +UNUSED_FUNC int tsdbCacheLastData(STsdbRepo *pRepo, STsdbCfg* oldCfg) { bool cacheLastRow = false, cacheLastCol = false; SFSIter fsiter; SReadH readh; @@ -915,9 +1017,9 @@ int tsdbCacheLastData(STsdbRepo *pRepo, STsdbCfg* oldCfg) { // if close last option,need to free data if (need_free_last_row || need_free_last_col) { - if (need_free_last_col) { - atomic_store_8(&pRepo->hasCachedLastColumn, 0); - } + // if (need_free_last_col) { + // atomic_store_8(&pRepo->hasCachedLastColumn, 0); + // } tsdbInfo("free cache last data since cacheLast option changed"); for (int i = 1; i <= maxTableIdx; i++) { STable *pTable = pMeta->tables[i]; @@ -995,9 +1097,9 @@ int tsdbCacheLastData(STsdbRepo *pRepo, STsdbCfg* oldCfg) { tsdbDestroyReadH(&readh); - if (cacheLastCol) { - atomic_store_8(&pRepo->hasCachedLastColumn, 1); - } + // if (cacheLastCol) { + // atomic_store_8(&pRepo->hasCachedLastColumn, 1); + // } return 0; } diff --git a/src/tsdb/src/tsdbMemTable.c b/src/tsdb/src/tsdbMemTable.c index 54211d79f3836db9a0daca365c85616648ec53ca..c5ee4b0b6f78e3a489c640954722fe6b79facbd4 100644 --- a/src/tsdb/src/tsdbMemTable.c +++ b/src/tsdb/src/tsdbMemTable.c @@ -996,7 +996,8 @@ static void updateTableLatestColumn(STsdbRepo *pRepo, STable *pTable, SMemRow ro if ((value == NULL) || isNull(value, pTCol->type)) { continue; } - + // lock + TSDB_WLOCK_TABLE(pTable); SDataCol *pDataCol = &(pLatestCols[idx]); if (pDataCol->pData == NULL) { pDataCol->pData = malloc(pTCol->bytes); @@ -1012,6 +1013,8 @@ static void updateTableLatestColumn(STsdbRepo *pRepo, STable *pTable, SMemRow ro memcpy(pDataCol->pData, value, bytes); //tsdbInfo("updateTableLatestColumn vgId:%d cache column %d for %d,%s", REPO_ID(pRepo), j, pDataCol->bytes, (char*)pDataCol->pData); pDataCol->ts = memRowKey(row); + // unlock + TSDB_WUNLOCK_TABLE(pTable); } } @@ -1058,5 +1061,8 @@ static int tsdbUpdateTableLatestInfo(STsdbRepo *pRepo, STable *pTable, SMemRow r updateTableLatestColumn(pRepo, pTable, row); } } + + pTable->cacheLastConfigVersion = pRepo->cacheLastConfigVersion; + return 0; } diff --git a/src/tsdb/src/tsdbMeta.c b/src/tsdb/src/tsdbMeta.c index e604b07cc1dd0d37574235263a018baecbe670c1..3bff7741c51516fc6ad0c30715eb1edd6f8a31c3 100644 --- a/src/tsdb/src/tsdbMeta.c +++ b/src/tsdb/src/tsdbMeta.c @@ -346,7 +346,7 @@ int tsdbUpdateTableTagValue(STsdbRepo *repo, SUpdateTableTagValMsg *pMsg) { tsdbError( "vgId:%d failed to update tag value of table %s since version out of date, client tag version %d server tag " "version %d", - REPO_ID(pRepo), TABLE_CHAR_NAME(pTable), pMsg->tversion, schemaVersion(pTable->tagSchema)); + REPO_ID(pRepo), TABLE_CHAR_NAME(pTable), pMsg->tversion, schemaVersion(pTable->pSuper->tagSchema)); terrno = TSDB_CODE_TDB_TAG_VER_OUT_OF_DATE; return -1; } @@ -627,27 +627,30 @@ int16_t tsdbGetLastColumnsIndexByColId(STable* pTable, int16_t colId) { } int tsdbInitColIdCacheWithSchema(STable* pTable, STSchema* pSchema) { - ASSERT(pTable->lastCols == NULL); + TSDB_WLOCK_TABLE(pTable); + if (pTable->lastCols == NULL) { + int16_t numOfColumn = pSchema->numOfCols; - int16_t numOfColumn = pSchema->numOfCols; + pTable->lastCols = (SDataCol *)malloc(numOfColumn * sizeof(SDataCol)); + if (pTable->lastCols == NULL) { + TSDB_WUNLOCK_TABLE(pTable); + return -1; + } - pTable->lastCols = (SDataCol*)malloc(numOfColumn * sizeof(SDataCol)); - if (pTable->lastCols == NULL) { - return -1; - } + for (int16_t i = 0; i < numOfColumn; ++i) { + STColumn *pCol = schemaColAt(pSchema, i); + SDataCol *pDataCol = &(pTable->lastCols[i]); + pDataCol->bytes = 0; + pDataCol->pData = NULL; + pDataCol->colId = pCol->colId; + } - for (int16_t i = 0; i < numOfColumn; ++i) { - STColumn *pCol = schemaColAt(pSchema, i); - SDataCol* pDataCol = &(pTable->lastCols[i]); - pDataCol->bytes = 0; - pDataCol->pData = NULL; - pDataCol->colId = pCol->colId; + pTable->lastColSVersion = schemaVersion(pSchema); + pTable->maxColNum = numOfColumn; + pTable->restoreColumnNum = 0; + pTable->hasRestoreLastColumn = false; } - - pTable->lastColSVersion = schemaVersion(pSchema); - pTable->maxColNum = numOfColumn; - pTable->restoreColumnNum = 0; - pTable->hasRestoreLastColumn = false; + TSDB_WUNLOCK_TABLE(pTable); return 0; } @@ -797,6 +800,7 @@ static STable *tsdbNewTable() { pTable->lastCols = NULL; pTable->restoreColumnNum = 0; + pTable->cacheLastConfigVersion = 0; pTable->maxColNum = 0; pTable->hasRestoreLastColumn = false; pTable->lastColSVersion = -1; diff --git a/src/tsdb/src/tsdbRead.c b/src/tsdb/src/tsdbRead.c index 705ede0cf105c3aee49dc42fb2f312dba6b67806..5d5f9d191ab19616b5bdc3b865fb73668ff278be 100644 --- a/src/tsdb/src/tsdbRead.c +++ b/src/tsdb/src/tsdbRead.c @@ -156,6 +156,7 @@ typedef struct STableGroupSupporter { static STimeWindow updateLastrowForEachGroup(STableGroupInfo *groupList); static int32_t checkForCachedLastRow(STsdbQueryHandle* pQueryHandle, STableGroupInfo *groupList); static int32_t checkForCachedLast(STsdbQueryHandle* pQueryHandle); +static int32_t lazyLoadCacheLast(STsdbQueryHandle* pQueryHandle); static int32_t tsdbGetCachedLastRow(STable* pTable, SMemRow* pRes, TSKEY* lastKey); static void changeQueryHandleForInterpQuery(TsdbQueryHandleT pHandle); @@ -589,6 +590,28 @@ void tsdbResetQueryHandleForNewTable(TsdbQueryHandleT queryHandle, STsdbQueryCon pQueryHandle->next = doFreeColumnInfoData(pQueryHandle->next); } +static int32_t lazyLoadCacheLast(STsdbQueryHandle* pQueryHandle) { + STsdbRepo* pRepo = pQueryHandle->pTsdb; + + size_t numOfTables = taosArrayGetSize(pQueryHandle->pTableCheckInfo); + int32_t code = 0; + for (size_t i = 0; i < numOfTables; ++i) { + STableCheckInfo* pCheckInfo = taosArrayGet(pQueryHandle->pTableCheckInfo, i); + STable* pTable = pCheckInfo->pTableObj; + if (pTable->cacheLastConfigVersion == pRepo->cacheLastConfigVersion) { + continue; + } + code = tsdbLoadLastCache(pRepo, pTable); + if (code != 0) { + tsdbError("%p uid:%" PRId64 ", tid:%d, failed to load last cache since %s", pQueryHandle, pTable->tableId.uid, + pTable->tableId.tid, tstrerror(terrno)); + break; + } + } + + return code; +} + TsdbQueryHandleT tsdbQueryLastRow(STsdbRepo *tsdb, STsdbQueryCond *pCond, STableGroupInfo *groupList, uint64_t qId, SMemRef* pMemRef) { pCond->twindow = updateLastrowForEachGroup(groupList); @@ -602,6 +625,8 @@ TsdbQueryHandleT tsdbQueryLastRow(STsdbRepo *tsdb, STsdbQueryCond *pCond, STable return NULL; } + lazyLoadCacheLast(pQueryHandle); + int32_t code = checkForCachedLastRow(pQueryHandle, groupList); if (code != TSDB_CODE_SUCCESS) { // set the numOfTables to be 0 terrno = code; @@ -616,13 +641,14 @@ TsdbQueryHandleT tsdbQueryLastRow(STsdbRepo *tsdb, STsdbQueryCond *pCond, STable return pQueryHandle; } - TsdbQueryHandleT tsdbQueryCacheLast(STsdbRepo *tsdb, STsdbQueryCond *pCond, STableGroupInfo *groupList, uint64_t qId, SMemRef* pMemRef) { STsdbQueryHandle *pQueryHandle = (STsdbQueryHandle*) tsdbQueryTables(tsdb, pCond, groupList, qId, pMemRef); if (pQueryHandle == NULL) { return NULL; } + lazyLoadCacheLast(pQueryHandle); + int32_t code = checkForCachedLast(pQueryHandle); if (code != TSDB_CODE_SUCCESS) { // set the numOfTables to be 0 terrno = code; @@ -1526,7 +1552,7 @@ static void mergeTwoRowFromMem(STsdbQueryHandle* pQueryHandle, int32_t capacity, int16_t offset; bool isRow1DataRow = isDataRow(row1); - bool isRow2DataRow; + bool isRow2DataRow = false; bool isChosenRowDataRow; int32_t chosen_itr; void *value; @@ -2781,6 +2807,9 @@ static bool loadCachedLast(STsdbQueryHandle* pQueryHandle) { } int32_t i = 0, j = 0; + + // lock pTable->lastCols[i] as it would be released when schema update(tsdbUpdateLastColSchema) + TSDB_RLOCK_TABLE(pTable); while(i < tgNumOfCols && j < numOfCols) { pColInfo = taosArrayGet(pQueryHandle->pColumns, i); if (pTable->lastCols[j].colId < pColInfo->info.colId) { @@ -2867,6 +2896,7 @@ static bool loadCachedLast(STsdbQueryHandle* pQueryHandle) { i++; j++; } + TSDB_RUNLOCK_TABLE(pTable); // leave the real ts column as the last row, because last function only (not stable) use the last row as res if (priKey != TSKEY_INITIAL_VAL) { @@ -3198,7 +3228,9 @@ int32_t checkForCachedLast(STsdbQueryHandle* pQueryHandle) { int32_t code = 0; - if (pQueryHandle->pTsdb && atomic_load_8(&pQueryHandle->pTsdb->hasCachedLastColumn)){ + STsdbRepo* pRepo = pQueryHandle->pTsdb; + + if (pRepo && CACHE_LAST_NULL_COLUMN(&(pRepo->config))) { pQueryHandle->cachelastrow = TSDB_CACHED_TYPE_LAST; } @@ -3621,6 +3653,9 @@ static bool tableFilterFp(const void* pNode, void* param) { return (val != NULL) && (!isNull(val, pInfo->sch.type)); } } else if (pInfo->optr == TSDB_RELATION_IN) { + if(val == NULL) { + return false; + } int type = pInfo->sch.type; if (type == TSDB_DATA_TYPE_BOOL || IS_SIGNED_NUMERIC_TYPE(type) || type == TSDB_DATA_TYPE_TIMESTAMP) { int64_t v; diff --git a/src/util/inc/tconfig.h b/src/util/inc/tconfig.h index d6a1cb113a43874ee77b096e75959e02e4aa6747..2a2ac7dacf378d90bb925e97c32887c487fc3313 100644 --- a/src/util/inc/tconfig.h +++ b/src/util/inc/tconfig.h @@ -20,7 +20,7 @@ extern "C" { #endif -#define TSDB_CFG_MAX_NUM 120 +#define TSDB_CFG_MAX_NUM 121 #define TSDB_CFG_PRINT_LEN 23 #define TSDB_CFG_OPTION_LEN 24 #define TSDB_CFG_VALUE_LEN 41 diff --git a/src/util/src/talgo.c b/src/util/src/talgo.c index 54b7e00eb7dd6f31ac8c8e6afa89790846abac5b..352cd3c05e4d588900b676b605964e068c4ed191 100644 --- a/src/util/src/talgo.c +++ b/src/util/src/talgo.c @@ -230,7 +230,7 @@ void taosheapadjust(void *base, int32_t size, int32_t start, int32_t end, const { int32_t parent; int32_t child; - char *buf; + char *buf = NULL; if (base && size > 0 && compar) { parent = start; diff --git a/src/util/src/tcompare.c b/src/util/src/tcompare.c index 47cc75131802fce5c72e7fdd3ae6675d34917a8c..73a430e5dc91195f18b36fc7daffded1c23f5b1b 100644 --- a/src/util/src/tcompare.c +++ b/src/util/src/tcompare.c @@ -357,14 +357,20 @@ int32_t compareFindItemInSet(const void *pLeft, const void* pRight) { int32_t compareWStrPatternComp(const void* pLeft, const void* pRight) { SPatternCompareInfo pInfo = {'%', '_'}; + size_t size = varDataLen(pLeft)/TSDB_NCHAR_SIZE; assert(varDataLen(pRight) <= TSDB_MAX_FIELD_LEN * TSDB_NCHAR_SIZE); wchar_t *pattern = calloc(varDataLen(pRight) + 1, sizeof(wchar_t)); + wchar_t *str = calloc(size + 1, sizeof(wchar_t)); + memcpy(pattern, varDataVal(pRight), varDataLen(pRight)); + memcpy(str, varDataVal(pLeft), size * sizeof(wchar_t)); + + int32_t ret = WCSPatternMatch(pattern, str, size, &pInfo); - int32_t ret = WCSPatternMatch(pattern, varDataVal(pLeft), varDataLen(pLeft)/TSDB_NCHAR_SIZE, &pInfo); free(pattern); + free(str); return (ret == TSDB_PATTERN_MATCH) ? 0 : 1; } diff --git a/src/util/src/tlog.c b/src/util/src/tlog.c index 0d335ca2664ffee75a79144b97181a5b625df66d..a2eea5aa7d99a43f2cf7f0552e843ce9a52034c0 100644 --- a/src/util/src/tlog.c +++ b/src/util/src/tlog.c @@ -566,7 +566,7 @@ static int32_t taosPushLogBuffer(SLogBuff *tLogBuff, char *msg, int32_t msgLen) int32_t end = 0; int32_t remainSize = 0; static int64_t lostLine = 0; - char tmpBuf[40] = {0}; + char tmpBuf[60] = {0}; int32_t tmpBufLen = 0; if (tLogBuff == NULL || tLogBuff->stop) return -1; diff --git a/tests/pytest/fulltest.sh b/tests/pytest/fulltest.sh index 18c00fdafdfcdec3a6008cd0c99f4c3142a068f4..d7f211962fc025b70ccf8df3655e37872c552921 100755 --- a/tests/pytest/fulltest.sh +++ b/tests/pytest/fulltest.sh @@ -269,6 +269,7 @@ python3 ./test.py -f query/queryCnameDisplay.py python3 ./test.py -f query/operator_cost.py python3 test.py -f query/nestedQuery/queryWithSpread.py python3 ./test.py -f query/bug6586.py +python3 ./test.py -f query/bug5903.py #stream python3 ./test.py -f stream/metric_1.py diff --git a/tests/pytest/query/bug5903.py b/tests/pytest/query/bug5903.py new file mode 100644 index 0000000000000000000000000000000000000000..a973efbbdf7a0868a4db7910bf57bd5eef8dae06 --- /dev/null +++ b/tests/pytest/query/bug5903.py @@ -0,0 +1,36 @@ +################################################################### +# Copyright (c) 2016 by TAOS Technologies, Inc. +# All rights reserved. +# +# This file is proprietary and confidential to TAOS Technologies. +# No part of this file may be reproduced, stored, transmitted, +# disclosed or used in any form or by any means other than as +# expressly provided by the written permission from Jianhui Tao +# +################################################################### + +# -*- coding: utf-8 -*- + +from util.log import * +from util.cases import * +from util.sql import * + +class TDTestCase: + def init(self, conn, logSql): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), logSql) + + def run(self): + # TD-5903 show db.vgroups xxx. xxx is invalid content, but still returns results. + + tdSql.execute("create database if not exists test_5903") + tdSql.execute("show test_5903.vgroups") + tdSql.error("show test_5903.vgroups xxx") + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) diff --git a/tests/pytest/query/query.py b/tests/pytest/query/query.py index 7bec22b925ba41fd28a01dda84705d7263305382..81ee262ae8d6e3367d351ed98dcdbd083ec1f4fe 100644 --- a/tests/pytest/query/query.py +++ b/tests/pytest/query/query.py @@ -148,6 +148,22 @@ class TDTestCase: tdLog.info("case for bug_6387") self.bug_6387() + #JIRA TS-583 + tdLog.info("case for JIRA TS-583") + tdSql.execute("create database test2") + tdSql.execute("use test2") + tdSql.execute("create table stb(ts timestamp, c1 int) tags(t1 binary(120))") + tdSql.execute("create table t0 using stb tags('abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz')") + + tdSql.query("show create table t0") + tdSql.checkRows(1) + + tdSql.execute("create table stb2(ts timestamp, c1 int) tags(t1 nchar(120))") + tdSql.execute("create table t1 using stb2 tags('abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz')") + + tdSql.query("show create table t1") + tdSql.checkRows(1) + def stop(self): tdSql.close() tdLog.success("%s successfully executed" % __file__) diff --git a/tests/pytest/query/udf.py b/tests/pytest/query/udf.py index 14429a53f44b1393c9f179cc405ed61fb59e8b02..e9fc42c72edc9d6eee5592852960ddb8d53d124a 100644 --- a/tests/pytest/query/udf.py +++ b/tests/pytest/query/udf.py @@ -73,21 +73,18 @@ class TDTestCase: tdSql.error(sql) sql = 'select abs_max(c2) from db.stb' tdSql.query(sql) - tdSql.checkData(0,0,1410065607) + tdSql.checkData(0,0,10000000199) 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 + 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) - # UDF bug no 3 -> values of abs_max will error for boundary number - # 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) - - # tdSql.query("select sum_double(id) , abs_max(number) from st") - # tdSql.checkData(0,0,44) - # tdSql.checkData(0,0,9223372036854775807) + # 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") + # 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 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) - # UDF bug no 6 -> group by work error - tdLog.info("======= UDF work with group by =======") + # 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 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;") + 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) + 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 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) + # inner and outer nest query - # 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 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 add_one(id) from (select add_one(id) id from tb1)") + tdSql.checkRows(5) + tdSql.checkData(0,0,2) + tdSql.checkData(1,0,3) + + 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)") - # 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.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) + 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() @@ -366,4 +611,4 @@ class TDTestCase: tdCases.addWindows(__file__, TDTestCase()) -tdCases.addLinux(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) \ No newline at end of file diff --git a/tests/pytest/table/create.py b/tests/pytest/table/create.py index ecd4d011418ed7eca0d028262159c5614c0f490c..54e821246c79b429542316c2f2d3c232a798c03b 100644 --- a/tests/pytest/table/create.py +++ b/tests/pytest/table/create.py @@ -61,6 +61,9 @@ class TDTestCase: tdSql.execute("use db2") tdSql.execute("create table stb(ts timestamp, c int) tags(t int)") tdSql.error("insert into db2.tb6 using db2.stb tags(1) values(now 1) tb2 using db2. tags( )values(now 2)") + + # case for TD-10691 + tdSql.error("create table ttb1(ts timestamp, file int )") def stop(self): tdSql.close() diff --git a/tests/pytest/tools/taosdemoTestTblAlt.py b/tests/pytest/tools/taosdemoTestTblAlt.py index bdc6769bdb8ab437fc1a4d2a4478768e35402048..89c1b92e140cb1e19b549d3248693153e116c52e 100644 --- a/tests/pytest/tools/taosdemoTestTblAlt.py +++ b/tests/pytest/tools/taosdemoTestTblAlt.py @@ -54,29 +54,36 @@ class TDTestCase: binPath = buildPath + "/build/bin/" if(threadID == 0): - print("%staosdemo -y -t %d -n %d -b INT,INT,INT,INT -m t" % + print("%staosdemo -y -t %d -n %d -b INT,INT,INT,INT" % (binPath, self.numberOfTables, self.numberOfRecords)) os.system("%staosdemo -y -t %d -n %d -b INT,INT,INT,INT" % (binPath, self.numberOfTables, self.numberOfRecords)) if(threadID == 1): time.sleep(2) print("use test") - while True: + max_try = 100 + count = 0 + while (count < max_try): try: tdSql.execute("use test") break except Exception as e: tdLog.info("use database test failed") - time.sleep(1) + time.sleep(2) + count += 1 + print("try %d times" % count) continue # check if all the tables have heen created - while True: + count = 0 + while (count < max_try): try: tdSql.query("show tables") except Exception as e: tdLog.info("show tables test failed") - time.sleep(1) + time.sleep(2) + count += 1 + print("try %d times" % count) continue rows = tdSql.queryRows @@ -85,13 +92,17 @@ class TDTestCase: break time.sleep(1) # check if there are any records in the last created table - while True: + count = 0 + while (count < max_try): print("query started") + print("try %d times" % count) try: - tdSql.query("select * from test.t7") + tdSql.query("select * from test.d7") except Exception as e: tdLog.info("select * test failed") time.sleep(2) + count += 1 + print("try %d times" % count) continue rows = tdSql.queryRows @@ -102,8 +113,8 @@ class TDTestCase: print("alter table test.meters add column c10 int") tdSql.execute("alter table test.meters add column c10 int") - print("insert into test.t7 values (now, 1, 2, 3, 4, 0)") - tdSql.execute("insert into test.t7 values (now, 1, 2, 3, 4, 0)") + print("insert into test.d7 values (now, 1, 2, 3, 4, 0)") + tdSql.execute("insert into test.d7 values (now, 1, 2, 3, 4, 0)") def run(self): tdSql.prepare() diff --git a/tests/script/api/batchprepare.c b/tests/script/api/batchprepare.c index 72bb9471db8e2c3043306c332c608f1b4f1df836..a3a5a331007ab9f05f779dcf8f165ff6f6e50f9e 100644 --- a/tests/script/api/batchprepare.c +++ b/tests/script/api/batchprepare.c @@ -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); diff --git a/tests/script/general/parser/udf_dll.sim b/tests/script/general/parser/udf_dll.sim index 6252eb42a1c9ae6f1fee7f0187dd0a5fe019238a..cdbdfd815ed8f4fec5d17649f84b2e9837bf5813 100644 --- a/tests/script/general/parser/udf_dll.sim +++ b/tests/script/general/parser/udf_dll.sim @@ -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 bigint; sql show functions; if $rows != 2 then return -1 diff --git a/tests/script/general/parser/udf_dll_stable.sim b/tests/script/general/parser/udf_dll_stable.sim index aa92a28a9d9d70fe69f9579d227aeace67498ce4..07784d794d2fbdf7203045e688db27735c590af3 100644 --- a/tests/script/general/parser/udf_dll_stable.sim +++ b/tests/script/general/parser/udf_dll_stable.sim @@ -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 bigint; sql show functions; if $rows != 3 then return -1 diff --git a/tests/script/sh/abs_max.c b/tests/script/sh/abs_max.c index fb9a9ab627c5b078d6b7c27a70797f9f01580045..9faea60374766e47f82a70880fe2b1376bbc12dc 100644 --- a/tests/script/sh/abs_max.c +++ b/tests/script/sh/abs_max.c @@ -1,11 +1,12 @@ #include #include #include +#include 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); + int64_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 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; - int 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; + int64_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 diff --git a/tests/script/sh/add_one.c b/tests/script/sh/add_one.c index e12cf8f26f6ddad67f9f7b091c033de46a3f6f50..de2a7d168c88d1a13bf5cbe6a327ea451ddb2546 100644 --- a/tests/script/sh/add_one.c +++ b/tests/script/sh/add_one.c @@ -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 #include #include +#include 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); + int64_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=*(int64_t *)dataOutput; *numOfOutput=0; for(i=0;iptr)=*(int*)dataOutput*2; - *(int*)dataOutput=*(int*)(buf->ptr); - printf("sum_double finalize, dataoutput:%d, numOfOutput:%d\n", *(int *)dataOutput, *numOfOutput); + int64_t r = 0; + // printf("sum_double_finalize dataoutput:%p:%"PRId64", numOfOutput:%d, buf:%p\n", dataOutput, *(int64_t*)dataOutput, *numOfOutput, buf); + // *numOfOutput=1; + *(int64_t*)(buf->ptr)=*(int64_t*)dataOutput*2; + *(int64_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, int32_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; + int64_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, *((int*)data + i)); - sum +=*((int*)data + i); + // printf("sum_double_merge %d - %"PRId64"\n", i, *((int64_t*)data + i)); + sum +=*((int64_t*)data + i); } - *(int*)dataOutput+=sum; + *(int64_t*)dataOutput+=sum; if (numOfRows > 0) { *numOfOutput=1; } else { *numOfOutput=0; } - printf("sum_double_merge, dataoutput:%d, numOfOutput:%d\n", *(int *)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(int64_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 diff --git a/tests/tsim/inc/sim.h b/tests/tsim/inc/sim.h index 2e19dde3d9c52c20705d131f471a2e0e389589e4..d9a7e13138b125f92d0611614f74abf268eaee70 100644 --- a/tests/tsim/inc/sim.h +++ b/tests/tsim/inc/sim.h @@ -135,7 +135,7 @@ typedef struct _script_t { int32_t numOfLines; // number of lines in the script int32_t bgScriptLen; char fileName[MAX_FILE_NAME_LEN]; // script file name - char error[MAX_ERROR_LEN]; + char error[TSDB_MAX_BINARY_LEN + 100]; char * optionBuffer; SCmdLine *lines; // command list SVariable variables[MAX_VAR_LEN]; @@ -178,4 +178,4 @@ bool simExecuteLineInsertCmd(SScript *script, char *option); bool simExecuteLineInsertErrorCmd(SScript *script, char *option); void simVisuallizeOption(SScript *script, char *src, char *dst); -#endif \ No newline at end of file +#endif