diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index d4526a8839dc41d91fd717d542c543b806db5fce..f7bc93987b10d350fa7cfb9605db2bb3a3eaee9e 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -39,7 +39,7 @@ IF (TD_LINUX_64 AND JEMALLOC_ENABLED) PREFIX "jemalloc" SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/jemalloc BUILD_IN_SOURCE 1 - CONFIGURE_COMMAND ./autogen.sh COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/build/ + CONFIGURE_COMMAND ./autogen.sh COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/build/ --disable-initial-exec-tls BUILD_COMMAND ${MAKE} ) INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/build/include) diff --git a/docs/en/02-intro/index.md b/docs/en/02-intro/index.md index 1dc27ae0a06dc94a6dbadec914041353811a9c5f..7ae487802a1e47e02fb8fcec671417b27aa0736b 100644 --- a/docs/en/02-intro/index.md +++ b/docs/en/02-intro/index.md @@ -105,12 +105,11 @@ As a high-performance, scalable and SQL supported time-series database, TDengine ## Comparison with other databases -- [Writing Performance Comparison of TDengine and InfluxDB ](https://tdengine.com/2022/02/23/4975.html) -- [Query Performance Comparison of TDengine and InfluxDB](https://tdengine.com/2022/02/24/5120.html) -- [TDengine vs InfluxDB、OpenTSDB、Cassandra、MySQL、ClickHouse](https://www.tdengine.com/downloads/TDengine_Testing_Report_en.pdf) -- [TDengine vs OpenTSDB](https://tdengine.com/2019/09/12/710.html) -- [TDengine vs Cassandra](https://tdengine.com/2019/09/12/708.html) -- [TDengine vs InfluxDB](https://tdengine.com/2019/09/12/706.html) +- [Writing Performance Comparison of TDengine and InfluxDB ](https://tdengine.com/performance-comparison-of-tdengine-and-influxdb/) +- [Query Performance Comparison of TDengine and InfluxDB](https://tdengine.com/query-performance-comparison-test-report-tdengine-vs-influxdb/) +- [TDengine vs OpenTSDB](https://tdengine.com/performance-tdengine-vs-opentsdb/) +- [TDengine vs Cassandra](https://tdengine.com/performance-tdengine-vs-cassandra/) +- [TDengine vs InfluxDB](https://tdengine.com/performance-tdengine-vs-influxdb/) -If you want to learn some basics about time-series databases, please check [here](https://tdengine.com/tsdb). +If you want to learn some basics about time-series databases, please check [here](https://tdengine.com/tsdb/). diff --git a/docs/en/12-taos-sql/01-data-type.md b/docs/en/12-taos-sql/01-data-type.md index 3f5a49e3135771c6c1e62bcf158a99ee30f1ed9d..d2155784542a5ffaab1963170c63949c92174680 100644 --- a/docs/en/12-taos-sql/01-data-type.md +++ b/docs/en/12-taos-sql/01-data-type.md @@ -26,7 +26,7 @@ In TDengine, the data types below can be used when specifying a column or tag. | 3 | BIGINT | 8 | Long integer, the value range is [-2^63+1, 2^63-1], while -2^63 is treated as NULL | | 4 | FLOAT | 4 | Floating point number, the effective number of digits is 6-7, the value range is [-3.4E38, 3.4E38] | | 5 | DOUBLE | 8 | Double precision floating point number, the effective number of digits is 15-16, the value range is [-1.7E308, 1.7E308] | -| 6 | BINARY | User Defined | Single-byte string for ASCII visible characters. Length must be specified when defining a column or tag of binary type. The string length can be up to 16374 bytes. The string value must be quoted with single quotes. The literal single quote inside the string must be preceded with back slash like `\'` | +| 6 | BINARY | User Defined | Single-byte string for ASCII visible characters. Length must be specified when defining a column or tag of binary type. The string length can be up to 16374 bytes (65517 bytes since version 2.6.0.34). The string value must be quoted with single quotes. The literal single quote inside the string must be preceded with back slash like `\'` | | 7 | SMALLINT | 2 | Short integer, the value range is [-32767, 32767], while -32768 is treated as NULL | | 8 | TINYINT | 1 | Single-byte integer, the value range is [-127, 127], while -128 is treated as NULL | | 9 | BOOL | 1 | Bool, the value range is {true, false} | diff --git a/docs/en/12-taos-sql/03-table.md b/docs/en/12-taos-sql/03-table.md index f065a8e2396583bb7a512446b513ed60056ad55e..0b009dcb7019ca8595d18c8e40612d2d8449e7a6 100644 --- a/docs/en/12-taos-sql/03-table.md +++ b/docs/en/12-taos-sql/03-table.md @@ -14,7 +14,7 @@ CREATE TABLE [IF NOT EXISTS] tb_name (timestamp_field_name TIMESTAMP, field1_nam 1. The first column of a table MUST be of type TIMESTAMP. It is automatically set as the primary key. 2. The maximum length of the table name is 192 bytes. -3. The maximum length of each row is 48k bytes, please note that the extra 2 bytes used by each BINARY/NCHAR column are also counted. +3. The maximum length of each row is 48k bytes (64k bytes since version 2.6.0.34), please note that the extra 2 bytes used by each BINARY/NCHAR column are also counted. 4. The name of the subtable can only consist of characters from the English alphabet, digits and underscore. Table names can't start with a digit. Table names are case insensitive. 5. The maximum length in bytes must be specified when using BINARY or NCHAR types. 6. Escape character "\`" can be used to avoid the conflict between table names and reserved keywords, above rules will be bypassed when using escape character on table names, but the upper limit for the name length is still valid. The table names specified using escape character are case sensitive. Only ASCII visible characters can be used with escape character. diff --git a/docs/en/12-taos-sql/10-function.md b/docs/en/12-taos-sql/10-function.md index c49fb428ef0c93f52b5e4048f5e05ad807910adf..4e07de2663d58ae7ca774868b6a87ce7c6072a88 100644 --- a/docs/en/12-taos-sql/10-function.md +++ b/docs/en/12-taos-sql/10-function.md @@ -569,18 +569,23 @@ Query OK, 2 row(s) in set (0.000793s) ### PERCENTILE ``` -SELECT PERCENTILE(field_name, P) FROM { tb_name } [WHERE clause]; +SELECT PERCENTILE(field_name, P [, P1] ...) FROM { tb_name } [WHERE clause]; ``` **Description**: The value whose rank in a specific column matches the specified percentage. If such a value matching the specified percentage doesn't exist in the column, an interpolation value will be returned. -**Return value type**: Double precision floating point +**Return value type**: This function takes 2 minumum and 11 maximum parameters, and it can simultaneously return 10 percentiles at most. If 2 parameters are given, a single percentile is returned and the value type is DOUBLE. + If more than 2 parameters are given, the return value type is a VARCHAR string, the format of which is a JSON ARRAY containing all return values. **Applicable column types**: Data types except for timestamp, binary, nchar and bool **Applicable table types**: table -**More explanations**: _P_ is in range [0,100], when _P_ is 0, the result is same as using function MIN; when _P_ is 100, the result is same as function MAX. +**More explanations**: + +- _P_ is in range [0,100], when _P_ is 0, the result is same as using function MIN; when _P_ is 100, the result is same as function MAX. +- When calculating multiple percentiles of a specific column, a single PERCENTILE function with multiple parameters is adviced, as this can largely reduce the query response time. + For example, using SELECT percentile(col, 90, 95, 99) FROM table will perform better than SELECT percentile(col, 90), percentile(col, 95), percentile(col, 99) from table. **Examples**: diff --git a/docs/en/14-reference/03-connector/python.mdx b/docs/en/14-reference/03-connector/python.mdx index c992d4fcf6803f914aa778b22d8c8c18d22d4bfb..298aa22bf9923aa1db1b3245be0e6203799b5f2e 100644 --- a/docs/en/14-reference/03-connector/python.mdx +++ b/docs/en/14-reference/03-connector/python.mdx @@ -33,7 +33,7 @@ We recommend using the latest version of `taospy`, regardless of the version of ### Preparation -1. Install Python. Python >= 3.6 is recommended. If Python is not available on your system, refer to the [Python BeginnersGuide](https://wiki.python.org/moin/BeginnersGuide/Download) to install it. +1. Install Python. Python >= 3.6.2 is recommended. If Python is not available on your system, refer to the [Python BeginnersGuide](https://wiki.python.org/moin/BeginnersGuide/Download) to install it. 2. Install [pip](https://pypi.org/project/pip/). In most cases, the Python installer comes with the pip utility. If not, please refer to [pip documentation](https://pip.pypa.io/en/stable/installation/) to install it. If you use a native connection, you will also need to [Install Client Driver](/reference/connector#Install-Client-Driver). The client install package includes the TDengine client dynamic link library (`libtaos.so` or `taos.dll`) and the TDengine CLI. diff --git a/docs/en/14-reference/12-config/index.md b/docs/en/14-reference/12-config/index.md index b6b535429b00796b5d2636c467153415a4281e59..68f06719a5ab8d0e97baff4c4237955c3b38b739 100644 --- a/docs/en/14-reference/12-config/index.md +++ b/docs/en/14-reference/12-config/index.md @@ -186,6 +186,16 @@ TDengine uses 13 continuous ports, both TCP and UDP, starting with the port spec | Default Value | 100,000 | | Note | After version 2.3.0.0 | +### maxSqlGroups + +| 属性 | 说明 | +| -------- | -------------------------------- | --- | +| 适用范围 | Server and Client | +| 含义 | The maximus number of groups when group by or interval | +| 取值范围 | [500,000 - 10,000,000] | +| 缺省值 | 1,000,000 | +| 补充说明 | After version 2.6.0.21 | | + ## Locale Parameters ### timezone diff --git a/docs/en/20-third-party/11-kafka.md b/docs/en/20-third-party/11-kafka.md index 6720af8bf81ea2f4fce415a54847453f578ababf..f692c3cb52b4b75731ebdabe2f19f432318602c4 100644 --- a/docs/en/20-third-party/11-kafka.md +++ b/docs/en/20-third-party/11-kafka.md @@ -76,7 +76,7 @@ Development: false ### Install from source code ``` -git clone https://github.com:taosdata/kafka-connect-tdengine.git +git clone --branch master https://github.com:taosdata/kafka-connect-tdengine.git cd kafka-connect-tdengine mvn clean package unzip -d $CONFLUENT_HOME/share/java/ target/components/packages/taosdata-kafka-connect-tdengine-*.zip diff --git a/docs/en/25-application/01-telegraf.md b/docs/en/25-application/01-telegraf.md index f535344236415fc44e6246daa62f04d2b5bbc0f5..ca9429335be44dd870652b50e9277800e4b7f540 100644 --- a/docs/en/25-application/01-telegraf.md +++ b/docs/en/25-application/01-telegraf.md @@ -72,7 +72,7 @@ sudo systemctl start telegraf Log in to the Grafana interface using a web browser at `IP:3000`, with the system's initial username and password being `admin/admin`. Click on the gear icon on the left and select `Plugins`, you should find the TDengine data source plugin icon. -Click on the plus icon on the left and select `Import` to get the data from `https://github.com/taosdata/grafanaplugin/blob/master/examples/telegraf/grafana/dashboards/telegraf-dashboard-v0.1.0.json`, download the dashboard JSON file and import it. You will then see the dashboard in the following screen. +Click on the plus icon on the left and select `Import` to get the data from `https://github.com/taosdata/grafanaplugin/blob/master/examples/telegraf/grafana/dashboards/telegraf-dashboard-v2.json`, download the dashboard JSON file and import it. You will then see the dashboard in the following screen. ![TDengine Database IT-DevOps-Solutions-telegraf-dashboard](./IT-DevOps-Solutions-telegraf-dashboard.webp) diff --git a/docs/zh/12-taos-sql/01-data-type.md b/docs/zh/12-taos-sql/01-data-type.md index b8c9cc95547a8ea8b6b5f0d2d0e049dd20232db5..df603d60dc539aa20c92ac196fb09bae3093945e 100644 --- a/docs/zh/12-taos-sql/01-data-type.md +++ b/docs/zh/12-taos-sql/01-data-type.md @@ -27,7 +27,7 @@ CREATE DATABASE db_name PRECISION 'ns'; | 3 | BIGINT | 8 | 长整型,范围 [-2^63+1, 2^63-1], -2^63 用作 NULL | | 4 | FLOAT | 4 | 浮点型,有效位数 6-7,范围 [-3.4E38, 3.4E38] | | 5 | DOUBLE | 8 | 双精度浮点型,有效位数 15-16,范围 [-1.7E308, 1.7E308] | -| 6 | BINARY | 自定义 | 记录单字节字符串,建议只用于处理 ASCII 可见字符,中文等多字节字符需使用 nchar。理论上,最长可以有 16374 字节。binary 仅支持字符串输入,字符串两端需使用单引号引用。使用时须指定大小,如 binary(20) 定义了最长为 20 个单字节字符的字符串,每个字符占 1 byte 的存储空间,总共固定占用 20 bytes 的空间,此时如果用户字符串超出 20 字节将会报错。对于字符串内的单引号,可以用转义字符反斜线加单引号来表示,即 `\’`。 | +| 6 | BINARY | 自定义 | 记录单字节字符串,建议只用于处理 ASCII 可见字符,中文等多字节字符需使用 nchar。理论上,最长可以有 16374 字节(从 2.6.0.34 版本开始最长支持 65517 字节)。binary 仅支持字符串输入,字符串两端需使用单引号引用。使用时须指定大小,如 binary(20) 定义了最长为 20 个单字节字符的字符串,每个字符占 1 byte 的存储空间,总共固定占用 20 bytes 的空间,此时如果用户字符串超出 20 字节将会报错。对于字符串内的单引号,可以用转义字符反斜线加单引号来表示,即 `\’`。 | | 7 | SMALLINT | 2 | 短整型, 范围 [-32767, 32767], -32768 用作 NULL | | 8 | TINYINT | 1 | 单字节整型,范围 [-127, 127], -128 用作 NULL | | 9 | BOOL | 1 | 布尔型,{true, false} | diff --git a/docs/zh/12-taos-sql/03-table.md b/docs/zh/12-taos-sql/03-table.md index d7235f312933ec46ed427d5da7e2c5a229fa2926..a0528c56b1c4ff44233bbe6e990ffe18fa4604bb 100644 --- a/docs/zh/12-taos-sql/03-table.md +++ b/docs/zh/12-taos-sql/03-table.md @@ -12,7 +12,7 @@ CREATE TABLE [IF NOT EXISTS] tb_name (timestamp_field_name TIMESTAMP, field1_nam 1. 表的第一个字段必须是 TIMESTAMP,并且系统自动将其设为主键; 2. 表名最大长度为 192; -3. 表的每行长度不能超过 48KB;(注意:每个 BINARY/NCHAR 类型的列还会额外占用 2 个字节的存储位置) +3. 表的每行长度不能超过 48KB;(注意:每个 BINARY/NCHAR 类型的列还会额外占用 2 个字节的存储位置。从 2.6.0.34 版本开始支持 64KB) 4. 子表名只能由字母、数字和下划线组成,且不能以数字开头,不区分大小写 5. 使用数据类型 binary 或 nchar,需指定其最长的字节数,如 binary(20),表示 20 字节; 6. 为了兼容支持更多形式的表名,TDengine 引入新的转义符 "\`",可以让表名与关键词不冲突,同时不受限于上述表名称合法性约束检查。但是同样具有长度限制要求。使用转义字符以后,不再对转义字符中的内容进行大小写统一。 diff --git a/docs/zh/12-taos-sql/10-function.md b/docs/zh/12-taos-sql/10-function.md index c134a54a532f222e7eb5bb2e5d6969966f49d433..8b1d522eb7e7fe34992bf08ef66ba892f09b83ad 100644 --- a/docs/zh/12-taos-sql/10-function.md +++ b/docs/zh/12-taos-sql/10-function.md @@ -564,18 +564,22 @@ Query OK, 2 row(s) in set (0.000793s) ### PERCENTILE ``` -SELECT PERCENTILE(field_name, P) FROM { tb_name } [WHERE clause]; +SELECT PERCENTILE(field_name, P [, P1] ...) FROM { tb_name } [WHERE clause]; ``` **功能说明**:统计表中某列的值百分比分位数。 -**返回数据类型**: 双精度浮点数 Double。 +**返回数据类型**:该函数最小参数个数为 2 个,最大参数个数为 11 个。可以最多同时返回 10 个百分比分位数。当参数个数为 2 时, 返回一个分位数,类型为DOUBLE,当参数个数大于 2 时,返回类型为VARCHAR, 格式为包含多个返回值的JSON数组。 **应用字段**:不能应用在 timestamp、binary、nchar、bool 类型字段。 **适用于**:表。 -**使用说明**:*P*值取值范围 0≤*P*≤100,为 0 的时候等同于 MIN,为 100 的时候等同于 MAX。 +**使用说明**: + +- *P*值取值范围 0≤*P*≤100,为 0 的时候等同于 MIN,为 100 的时候等同于 MAX。 +- 同时计算针对同一列的多个分位数时,建议使用一个PERCENTILE函数和多个参数的方式,能很大程度上降低查询的响应时间。 + 比如,使用查询SELECT percentile(col, 90, 95, 99) FROM table, 性能会优于SELECT percentile(col, 90), percentile(col, 95), percentile(col, 99) from table。 **示例**: diff --git a/docs/zh/14-reference/03-connector/python.mdx b/docs/zh/14-reference/03-connector/python.mdx index 5e2af7d516456e9e7f034ea012da003471776c70..95fb2543e727dac28bac8ec331affe9638d7c33b 100644 --- a/docs/zh/14-reference/03-connector/python.mdx +++ b/docs/zh/14-reference/03-connector/python.mdx @@ -33,7 +33,7 @@ Python 连接器的源码托管在 [GitHub](https://github.com/taosdata/taos-con ### 准备 -1. 安装 Python。建议使用 Python >= 3.6。如果系统上还没有 Python 可参考 [Python BeginnersGuide](https://wiki.python.org/moin/BeginnersGuide/Download) 安装。 +1. 安装 Python。建议使用 Python >= 3.6.2。如果系统上还没有 Python 可参考 [Python BeginnersGuide](https://wiki.python.org/moin/BeginnersGuide/Download) 安装。 2. 安装 [pip](https://pypi.org/project/pip/)。大部分情况下 Python 的安装包都自带了 pip 工具, 如果没有请参考 [pip docuemntation](https://pip.pypa.io/en/stable/installation/) 安装。 3. 如果使用原生连接,还需[安装客户端驱动](../#安装客户端驱动)。客户端软件包含了 TDengine 客户端动态链接库(libtaos.so 或 taos.dll) 和 TDengine CLI。 diff --git a/docs/zh/14-reference/12-config/index.md b/docs/zh/14-reference/12-config/index.md index 2d1866d5dd1874164d03ffdfb382010c8345ad63..f9947b50e288509213bedd38b8adfe253bf165e9 100644 --- a/docs/zh/14-reference/12-config/index.md +++ b/docs/zh/14-reference/12-config/index.md @@ -186,6 +186,16 @@ taos --dump-config | 缺省值 | 10 万 | | 补充说明 | 2.3 版本新增。 | | +### maxSqlGroups + +| 属性 | 说明 | +| -------- | -------------------------------- | --- | +| 适用范围 | 服务端和客户端均适用 | +| 含义 | GROUP BY最大支持的分组数或者INTERVAL最大的时间窗口数 | +| 取值范围 | 最小值为 50 万,最大值 1000 万 | +| 缺省值 | 100 万 | +| 补充说明 | 2.6 版本新增。 | | + ## 区域相关 ### timezone diff --git a/docs/zh/20-third-party/11-kafka.md b/docs/zh/20-third-party/11-kafka.md index 2536e090494b5efbb93f0f53649eefe18d855b43..17e82a4d5ed67653f9f4550fc360aecb4e1deaf3 100644 --- a/docs/zh/20-third-party/11-kafka.md +++ b/docs/zh/20-third-party/11-kafka.md @@ -78,7 +78,7 @@ Development: false ### 从源码安装 ``` -git clone https://github.com:taosdata/kafka-connect-tdengine.git +git clone --branch master https://github.com:taosdata/kafka-connect-tdengine.git cd kafka-connect-tdengine mvn clean package unzip -d $CONFLUENT_HOME/share/java/ target/components/packages/taosdata-kafka-connect-tdengine-*.zip diff --git a/docs/zh/25-application/01-telegraf.md b/docs/zh/25-application/01-telegraf.md index 4a15f31af33709844f51f8fd8d297ef7050337d5..a21e75f7b89e7dc3355441f19e036724a9db2cd2 100644 --- a/docs/zh/25-application/01-telegraf.md +++ b/docs/zh/25-application/01-telegraf.md @@ -72,7 +72,7 @@ sudo systemctl start telegraf 使用 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 文件后导入。之后可以看到如下界面的仪表盘: +点击左侧加号图标并选择 `Import`,从 `https://github.com/taosdata/grafanaplugin/blob/master/examples/telegraf/grafana/dashboards/telegraf-dashboard-v2.json` 下载 dashboard JSON 文件后导入。之后可以看到如下界面的仪表盘: ![TDengine Database IT-DevOps-Solutions-telegraf-dashboard](./IT-DevOps-Solutions-telegraf-dashboard.webp) diff --git a/packaging/release.sh b/packaging/release.sh index 117be9911a74b2ae971e3b45ee759a8981c9773c..c8cc2baa4a73c1c2606c51b3ebc823a58122d158 100755 --- a/packaging/release.sh +++ b/packaging/release.sh @@ -267,7 +267,7 @@ if [ "$osType" != "Darwin" ]; then [ -z "$taos_tools_ver" ] && taos_tools_ver="0.1.0" ${csudo}./make-taos-tools-deb.sh ${top_dir} \ - ${compile_dir} ${output_dir} ${taos_tools_ver} ${cpuType} ${osType} ${verMode} ${verType} + ${compile_dir} ${output_dir} ${taos_tools_ver} ${cpuType} ${osType} ${verMode} ${verType} ${verNumberComp} fi fi else @@ -292,7 +292,7 @@ if [ "$osType" != "Darwin" ]; then [ -z "$taos_tools_ver" ] && taos_tools_ver="0.1.0" ${csudo}./make-taos-tools-rpm.sh ${top_dir} \ - ${compile_dir} ${output_dir} ${taos_tools_ver} ${cpuType} ${osType} ${verMode} ${verType} + ${compile_dir} ${output_dir} ${taos_tools_ver} ${cpuType} ${osType} ${verMode} ${verType} ${verNumberComp} fi fi else diff --git a/packaging/tools/install.sh b/packaging/tools/install.sh index 6e64d77525f33c41b1c0af05ab624f9d15bdbf43..02ceeb883fce20e698cbf9bebf8f2a18b49dea0d 100755 --- a/packaging/tools/install.sh +++ b/packaging/tools/install.sh @@ -211,8 +211,8 @@ function install_bin() { [ -x ${install_main_dir}/bin/${clientName} ] && ${csudo}ln -s ${install_main_dir}/bin/${clientName} ${bin_link_dir}/${clientName} || : [ -x ${install_main_dir}/bin/${serverName} ] && ${csudo}ln -s ${install_main_dir}/bin/${serverName} ${bin_link_dir}/${serverName} || : [ -x ${install_main_dir}/bin/${adapterName} ] && ${csudo}ln -s ${install_main_dir}/bin/${adapterName} ${bin_link_dir}/${adapterName} || : - [ -x ${install_main_dir}/bin/${benchmarkName} ] && ${csudo}ln -s ${install_main_dir}/bin/${benchmarkName} ${bin_link_dir}/${demoName} || : - [ -x ${install_main_dir}/bin/${benchmarkName} ] && ${csudo}ln -s ${install_main_dir}/bin/${benchmarkName} ${bin_link_dir}/${benchmarkName} || : + [ -x ${install_main_dir}/bin/${benchmarkName} ] && ${csudo}ln -sf ${install_main_dir}/bin/${benchmarkName} ${bin_link_dir}/${demoName} || : + [ -x ${install_main_dir}/bin/${benchmarkName} ] && ${csudo}ln -sf ${install_main_dir}/bin/${benchmarkName} ${bin_link_dir}/${benchmarkName} || : # [ -x ${install_main_dir}/bin/${dumpName} ] && ${csudo}ln -s ${install_main_dir}/bin/${dumpName} ${bin_link_dir}/${dumpName} || : [ -x ${install_main_dir}/bin/TDinsight.sh ] && ${csudo}ln -s ${install_main_dir}/bin/TDinsight.sh ${bin_link_dir}/TDinsight.sh || : [ -x ${install_main_dir}/bin/remove.sh ] && ${csudo}ln -s ${install_main_dir}/bin/remove.sh ${bin_link_dir}/${uninstallScript} || : @@ -767,6 +767,34 @@ function is_version_compatible() { esac } +deb_erase() { + confirm="" + while [ "" == "${confirm}" ]; do + echo -e -n "${RED}Existing TDengine deb is detected, do you want to remove it? [yes|no] ${NC}:" + read confirm + if [ "yes" == "$confirm" ]; then + ${csudo}dpkg --remove tdengine ||: + break + elif [ "no" == "$confirm" ]; then + break + fi + done +} + +rpm_erase() { + confirm="" + while [ "" == "${confirm}" ]; do + echo -e -n "${RED}Existing TDengine rpm is detected, do you want to remove it? [yes|no] ${NC}:" + read confirm + if [ "yes" == "$confirm" ]; then + ${csudo}rpm -e tdengine ||: + break + elif [ "no" == "$confirm" ]; then + break + fi + done +} + function updateProduct() { # Check if version compatible if ! is_version_compatible; then @@ -779,6 +807,13 @@ function updateProduct() { echo "File ${tarName} does not exist" exit 1 fi + + if echo $osinfo | grep -qwi "centos"; then + rpm -q tdengine 2>&1 > /dev/null && rpm_erase tdengine ||: + elif echo $osinfo | grep -qwi "ubuntu"; then + dpkg -l tdengine 2>&1 |grep ii > /dev/null && deb_erase tdengine ||: + fi + tar -zxf ${tarName} install_jemalloc diff --git a/packaging/tools/makepkg.sh b/packaging/tools/makepkg.sh index 18a2f3af8c6b7f54cd0b92c88c0fb7fd63b2f386..a52da1c06038fd6225bc3a64801b17fab650a518 100755 --- a/packaging/tools/makepkg.sh +++ b/packaging/tools/makepkg.sh @@ -336,7 +336,8 @@ cd ${release_dir} # install_dir has been distinguishes cluster from edege, so comments this code pkg_name=${install_dir}-${osType}-${cpuType} -taostools_pkg_name=${taostools_install_dir}-${osType}-${cpuType} +versionCompFirst=$(echo ${versionComp} | awk -F '.' '{print $1}') +taostools_pkg_name=${taostools_install_dir}-${osType}-${cpuType}-comp${versionCompFirst} # if [ "$verMode" == "cluster" ]; then # pkg_name=${install_dir}-${osType}-${cpuType} diff --git a/src/client/inc/tsclient.h b/src/client/inc/tsclient.h index 3598d8f81fa2269d916f1953258cbe9373713165..c4d095dc67d1e01cebb56bbe38f3ff3f7a979221 100644 --- a/src/client/inc/tsclient.h +++ b/src/client/inc/tsclient.h @@ -907,7 +907,7 @@ static FORCE_INLINE int32_t tsParseOneColumnKV(SSchema *pSchema, SStrToken *pTok } else { int64_t tmpVal; if (tsParseTime(pToken, &tmpVal, str, msg, timePrec) != TSDB_CODE_SUCCESS) { - return tscInvalidOperationMsg(msg, "invalid timestamp", pToken->z); + return TSDB_CODE_TSC_INVALID_OPERATION; } tdAppendMemRowColVal(row, &tmpVal, true, colId, pSchema->type, toffset); } diff --git a/src/client/src/tscAsync.c b/src/client/src/tscAsync.c index c8ef467da4a15feebd3d76976679a3c22e8a091f..da99b3651f6eb01950742fa428acb1838fdf765d 100644 --- a/src/client/src/tscAsync.c +++ b/src/client/src/tscAsync.c @@ -259,13 +259,14 @@ static inline char *insertTags(char *sql, char *tags) { // nest call part2 = insertTags(sub_sql, tags); - free(sub_sql); if (part2 == NULL) { // unknown format, can not insert tags tscError("TAGS insertTags sub select sql failed. subsql=%s sql=%s", sub_sql, sql); + free(sub_sql); free(buf); return NULL; } + free(sub_sql); // new string is part1 + part2 + part 3 strncpy(buf, p, part1_end - p + 1); diff --git a/src/client/src/tscParseInsert.c b/src/client/src/tscParseInsert.c index 750d670d1be0f00d011f05e8ff960ef875d85519..6bf0b07328622e621287ad2a426aa53a2a1fb3fd 100644 --- a/src/client/src/tscParseInsert.c +++ b/src/client/src/tscParseInsert.c @@ -78,6 +78,9 @@ int tsParseTime(SStrToken *pToken, int64_t *pTime, char **next, char *err, int16 // do nothing } else if (pToken->type == TK_INTEGER) { useconds = taosStr2int64(pToken->z); + if (errno == ERANGE) { + return tscInvalidOperationMsg(err, "timestamp is out of range", pToken->z); + } } else { // strptime("2001-11-12 18:31:01", "%Y-%m-%d %H:%M:%S", &tm); if (taosParseTime(pToken->z, pTime, pToken->n, timePrec, tsDaylight) != TSDB_CODE_SUCCESS) { @@ -118,7 +121,7 @@ int tsParseTime(SStrToken *pToken, int64_t *pTime, char **next, char *err, int16 char unit = 0; if (parseAbsoluteDuration(valueToken.z, valueToken.n, &interval, &unit, timePrec) != TSDB_CODE_SUCCESS) { - return TSDB_CODE_TSC_INVALID_OPERATION; + return tscInvalidOperationMsg(err, "invalid timestamp", pToken->z); } if (sToken.type == TK_PLUS) { @@ -382,7 +385,7 @@ int32_t tsParseOneColumn(SSchema *pSchema, SStrToken *pToken, char *payload, cha } else { int64_t temp; if (tsParseTime(pToken, &temp, str, msg, timePrec) != TSDB_CODE_SUCCESS) { - return tscInvalidOperationMsg(msg, "invalid timestamp", pToken->z); + return TSDB_CODE_TSC_INVALID_OPERATION; } *((int64_t *)payload) = temp; @@ -400,6 +403,9 @@ int32_t tsParseOneColumn(SSchema *pSchema, SStrToken *pToken, char *payload, cha * Do not employ sort operation is not involved if server time is used. */ int32_t tsCheckTimestamp(STableDataBlocks *pDataBlocks, const char *start) { + if (isNull(start, TSDB_DATA_TYPE_TIMESTAMP)) { + return TSDB_CODE_TSC_VALUE_OUT_OF_RANGE; + } // once the data block is disordered, we do NOT keep previous timestamp any more if (!pDataBlocks->ordered) { return TSDB_CODE_SUCCESS; diff --git a/src/client/src/tscPrepare.c b/src/client/src/tscPrepare.c index c2de205767fb7b42d437fab7d2d940f676a1ffd9..1ae546d1884ccfe1da8d45c66e6df7c95ee06108 100644 --- a/src/client/src/tscPrepare.c +++ b/src/client/src/tscPrepare.c @@ -723,7 +723,7 @@ static FORCE_INLINE int doBindParam(STableDataBlocks* pBlock, char* data, SParam if ((*bind->length) > (uintptr_t)param->bytes) { return TSDB_CODE_TSC_INVALID_VALUE; } - short size = (short)*bind->length; + uint16_t size = (uint16_t)*bind->length; STR_WITH_SIZE_TO_VARSTR(data + param->offset, bind->buffer, size); return TSDB_CODE_SUCCESS; } @@ -777,7 +777,7 @@ static FORCE_INLINE int doBindParam(STableDataBlocks* pBlock, char* data, SParam return TSDB_CODE_TSC_INVALID_VALUE; } - short size = 0; + uint16_t size = 0; switch(param->type) { case TSDB_DATA_TYPE_BOOL: case TSDB_DATA_TYPE_TINYINT: @@ -808,7 +808,7 @@ static FORCE_INLINE int doBindParam(STableDataBlocks* pBlock, char* data, SParam tscError("column length is too big"); return TSDB_CODE_TSC_INVALID_VALUE; } - size = (short)*pBind->length; + size = (uint16_t)*pBind->length; STR_WITH_SIZE_TO_VARSTR(data + param->offset, pBind->buffer, size); return TSDB_CODE_SUCCESS; @@ -905,6 +905,12 @@ static int doBindBatchParam(STableDataBlocks* pBlock, SParamInfo* param, TAOS_MU if (pBind->is_null != NULL && pBind->is_null[i]) { setNull(data + param->offset, param->type, param->bytes); + if (param->offset == 0) { + if (tsCheckTimestamp(pBlock, data) != TSDB_CODE_SUCCESS) { + tscError("invalid timestamp"); + return TSDB_CODE_TSC_INVALID_VALUE; + } + } continue; } diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 6e3f6c265703396e3375c61e55cdcd2aa061b81f..98ff5beaa69a330ec1d83de3e692a42d0c6e14f8 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -1941,7 +1941,9 @@ static int32_t handleScalarTypeExpr(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32 size_t numOfNode = taosArrayGetSize(colList); for(int32_t k = 0; k < numOfNode; ++k) { SColIndex* pIndex = taosArrayGet(colList, k); - if (TSDB_COL_IS_TAG(pIndex->flag)) { + + if (TSDB_COL_IS_TAG(pIndex->flag) || (strcasecmp(pIndex->name, TSQL_TBNAME_L) == 0 && pQueryInfo->pUpstream && + taosArrayGetSize(pQueryInfo->pUpstream) == 0)) { tExprTreeDestroy(pNode, NULL); taosArrayDestroy(&colList); @@ -2682,7 +2684,7 @@ static int32_t setExprInfoForFunctions(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SS pExpr->base.param[0].i64 = TSDB_ORDER_DESC; pExpr->base.param[0].nType = TSDB_DATA_TYPE_INT; } - + // for all queries, the timestamp column needs to be loaded SSchema s = {.colId = PRIMARYKEY_TIMESTAMP_COL_INDEX, .bytes = TSDB_KEYSIZE, .type = TSDB_DATA_TYPE_TIMESTAMP,}; tscColumnListInsert(pQueryInfo->colList, PRIMARYKEY_TIMESTAMP_COL_INDEX, pExpr->base.uid, &s); @@ -3287,9 +3289,12 @@ int32_t addExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t col } else if (functionId == TSDB_FUNC_APERCT || functionId == TSDB_FUNC_TAIL) { size_t cnt = taosArrayGetSize(pItem->pNode->Expr.paramList); if (cnt != 2 && cnt != 3) valid = false; + } else if (functionId == TSDB_FUNC_PERCT) { + size_t cnt = taosArrayGetSize(pItem->pNode->Expr.paramList); + if (cnt < 2 || cnt > 11) valid = false; } else if (functionId == TSDB_FUNC_UNIQUE) { if (taosArrayGetSize(pItem->pNode->Expr.paramList) != 1) valid = false; - }else { + } else { if (taosArrayGetSize(pItem->pNode->Expr.paramList) != 2) valid = false; } if (!valid) { @@ -3330,7 +3335,7 @@ int32_t addExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t col } tVariant* pVariant = NULL; - if (functionId != TSDB_FUNC_UNIQUE) { + if (functionId != TSDB_FUNC_UNIQUE && functionId != TSDB_FUNC_PERCT) { // 3. valid the parameters if (pParamElem[1].pNode->tokenId == TK_ID) { return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg2); @@ -3346,7 +3351,31 @@ int32_t addExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t col char val[8] = {0}; SExprInfo* pExpr = NULL; - if (functionId == TSDB_FUNC_PERCT || functionId == TSDB_FUNC_APERCT) { + if (functionId == TSDB_FUNC_PERCT) { + int32_t numOfParams = (int32_t)taosArrayGetSize(pItem->pNode->Expr.paramList); + getResultDataInfo(pSchema->type, pSchema->bytes, functionId, numOfParams - 1, &resultType, &resultSize, &interResult, 0, + false, pUdfInfo); + pExpr = tscExprAppend(pQueryInfo, functionId, &idx, resultType, resultSize, getNewResColId(pCmd), + interResult, false); + + for (int32_t i = 1; i < numOfParams; ++i) { + pVariant = &pParamElem[i].pNode->value; + if (pVariant->nType != TSDB_DATA_TYPE_DOUBLE && pVariant->nType != TSDB_DATA_TYPE_BIGINT) { + return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg5); + } + tVariantDump(pVariant, val, TSDB_DATA_TYPE_DOUBLE, true); + + double dp = GET_DOUBLE_VAL(val); + if (dp < 0 || dp > TOP_BOTTOM_QUERY_LIMIT) { + return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg5); + } + + tscExprAddParams(&pExpr->base, val, TSDB_DATA_TYPE_DOUBLE, sizeof(double)); + } + + tscInsertPrimaryTsSourceColumn(pQueryInfo, pTableMetaInfo->pTableMeta->id.uid); + colIndex += 1; // the first column is ts + } else if (functionId == TSDB_FUNC_APERCT) { // param1 double if (pVariant->nType != TSDB_DATA_TYPE_DOUBLE && pVariant->nType != TSDB_DATA_TYPE_BIGINT) { return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg5); @@ -3986,9 +4015,7 @@ int32_t doGetColumnIndexByName(SStrToken* pToken, SQueryInfo* pQueryInfo, SColum const char* msg1 = "invalid column name"; int16_t tsWinColumnIndex; - if (isTablenameToken(pToken)) { - pIndex->columnIndex = TSDB_TBNAME_COLUMN_INDEX; - } else if (strlen(DEFAULT_PRIMARY_TIMESTAMP_COL_NAME) == pToken->n && + if (strlen(DEFAULT_PRIMARY_TIMESTAMP_COL_NAME) == pToken->n && strncmp(pToken->z, DEFAULT_PRIMARY_TIMESTAMP_COL_NAME, pToken->n) == 0) { pIndex->columnIndex = PRIMARYKEY_TIMESTAMP_COL_INDEX; // just make runtime happy, need fix java test case InsertSpecialCharacterJniTest } else if (isTimeWindowToken(pToken, &tsWinColumnIndex)) { @@ -4015,6 +4042,11 @@ int32_t doGetColumnIndexByName(SStrToken* pToken, SQueryInfo* pQueryInfo, SColum } } + // check tbname + if(pIndex->columnIndex == COLUMN_INDEX_INITIAL_VAL && isTablenameToken(pToken)) { + pIndex->columnIndex = TSDB_TBNAME_COLUMN_INDEX; + } + if (pIndex->columnIndex == COLUMN_INDEX_INITIAL_VAL) { return invalidOperationMsg(msg, msg1); } @@ -9675,7 +9707,7 @@ int32_t checkQueryRangeForFill(SSqlCmd* pCmd, SQueryInfo* pQueryInfo) { intervalRange = pQueryInfo->interval.interval; } // number of result is not greater than 10,000,000 - if ((timeRange == 0) || (timeRange / intervalRange) >= MAX_INTERVAL_TIME_WINDOW) { + if ((timeRange / intervalRange) >= MAX_INTERVAL_TIME_WINDOW) { return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg3); } @@ -10490,6 +10522,7 @@ int32_t validateSqlNode(SSqlObj* pSql, SSqlNode* pSqlNode, SQueryInfo* pQueryInf const char* msg8 = "condition missing for join query"; const char* msg9 = "not support 3 level select"; const char* msg10 = "limit user forbid query normal or child table, you can query from stable."; + const char* msg11 = "only support join on tables of the same database"; int32_t code = TSDB_CODE_SUCCESS; SSqlCmd* pCmd = &pSql->cmd; @@ -10684,6 +10717,17 @@ int32_t validateSqlNode(SSqlObj* pSql, SSqlNode* pSqlNode, SQueryInfo* pQueryInf int32_t joinQuery = (pSqlNode->from != NULL && taosArrayGetSize(pSqlNode->from->list) > 1); + if (joinQuery) { + // the code must be done after all table meta is loaded. + for (int32_t i = 0; i < (int32_t)numOfTables - 1; ++i) { + STableMetaInfo *tmi1 = pQueryInfo->pTableMetaInfo[i]; + STableMetaInfo *tmi2 = pQueryInfo->pTableMetaInfo[i + 1]; + if (tmi1 != NULL && tmi2 != NULL && strcmp(tmi1->name.dbname, tmi2->name.dbname) != 0) { + return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg11); + } + } + } + // parse the group by clause in the first place if (validateGroupbyNode(pQueryInfo, pSqlNode->pGroupby, pCmd) != TSDB_CODE_SUCCESS) { return TSDB_CODE_TSC_INVALID_OPERATION; diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index db68f77a18b706ca74e6c77495a4d59d7406a726..dc534c275b8729915ed67e38c2e74f191d5d62f4 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -1252,11 +1252,28 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) { pQueryMsg->tsBuf.tsOffset = htonl((int32_t)(pMsg - pCmd->payload)); if (pQueryInfo->tsBuf != NULL) { - // note: here used the idx instead of actual vnode id. - int32_t vnodeIndex = pTableMetaInfo->vgroupIndex; - code = dumpFileBlockByGroupId(pQueryInfo->tsBuf, vnodeIndex, pMsg, &pQueryMsg->tsBuf.tsLen, &pQueryMsg->tsBuf.tsNumOfBlocks); - if (code != TSDB_CODE_SUCCESS) { - goto _end; + bool qType = tscNonOrderedProjectionQueryOnSTable(pQueryInfo, 0); + if (qType) { + dumpFileBlockByGroupIndex(pQueryInfo->tsBuf, pTableMetaInfo->vgroupIndex, pMsg, &pQueryMsg->tsBuf.tsLen, &pQueryMsg->tsBuf.tsNumOfBlocks); + if (code != TSDB_CODE_SUCCESS) { + goto _end; + } + } else { + // note: here used the idx instead of actual vnode id. + int32_t vgId = 0; + if (pTableMetaInfo->pVgroupTables != NULL) { + int32_t vnodeIndex = pTableMetaInfo->vgroupIndex; + SVgroupTableInfo *pTableInfo = taosArrayGet(pTableMetaInfo->pVgroupTables, vnodeIndex); + vgId = pTableInfo->vgInfo.vgId; + } else { + vgId = query.vgId; + } + + code = dumpFileBlockByGroupId(pQueryInfo->tsBuf, vgId, pMsg, &pQueryMsg->tsBuf.tsLen, + &pQueryMsg->tsBuf.tsNumOfBlocks); + if (code != TSDB_CODE_SUCCESS) { + goto _end; + } } pMsg += pQueryMsg->tsBuf.tsLen; @@ -1317,8 +1334,6 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) { memcpy(pMsg, pSql->sqlstr, sqlLen); pMsg += sqlLen; - - pQueryMsg->extend = 1; STLV *tlv = (STLV *)pMsg; diff --git a/src/client/src/tscSubquery.c b/src/client/src/tscSubquery.c index 6d818a5821bffd99f0376f63b0fc0d5d4db8f399..49a4479ad4633d53dea6835099ae50284b2d1690 100644 --- a/src/client/src/tscSubquery.c +++ b/src/client/src/tscSubquery.c @@ -1631,6 +1631,8 @@ static void joinRetrieveFinalResCallback(void* param, TAOS_RES* tres, int numOfR SJoinSupporter* pSupporter = (SJoinSupporter*)param; int64_t handle = pSupporter->pObj; + tscDebug("***enter joinRetrieveFinalResCallback"); + SSqlObj* pParentSql = (SSqlObj*)taosAcquireRef(tscObjRef, handle); if (pParentSql == NULL) return; @@ -1639,7 +1641,7 @@ static void joinRetrieveFinalResCallback(void* param, TAOS_RES* tres, int numOfR SSqlRes* pRes = &pSql->res; SQueryInfo* pQueryInfo = tscGetQueryInfo(pCmd); - + if (pParentSql->res.code != TSDB_CODE_SUCCESS) { tscError("0x%"PRIx64" abort query due to other subquery failure. code:%d, global code:%d", pSql->self, numOfRows, pParentSql->res.code); if (quitAllSubquery(pSql, pParentSql, pSupporter)) { @@ -1682,10 +1684,16 @@ static void joinRetrieveFinalResCallback(void* param, TAOS_RES* tres, int numOfR numOfVgroups = pTableMetaInfo->vgroupList->numOfVgroups; } - if ((++pTableMetaInfo->vgroupIndex) < numOfVgroups) { + tscDebug("**clauseLimit:%" PRId64 " numOfClauseTotal:%" PRId64 " vgIdx:%d numOfVgroups:%d", + pParentSql->cmd.active->clauseLimit, pParentSql->res.numOfClauseTotal, pTableMetaInfo->vgroupIndex, numOfVgroups); + + if ((++pTableMetaInfo->vgroupIndex) < numOfVgroups && (pParentSql->cmd.active->clauseLimit < 0 || pParentSql->cmd.active->clauseLimit > pParentSql->res.numOfClauseTotal)) { tscDebug("0x%"PRIx64" no result in current vnode anymore, try next vnode, vgIndex:%d", pSql->self, pTableMetaInfo->vgroupIndex); pSql->cmd.command = TSDB_SQL_SELECT; pSql->fp = tscJoinQueryCallback; + pSql->cmd.active->clauseLimit = pParentSql->cmd.active->clauseLimit; + pSql->cmd.active->limit.limit = pParentSql->cmd.active->clauseLimit - pParentSql->res.numOfClauseTotal; + pSql->cmd.active->limit.offset = pSql->res.offset; tscBuildAndSendRequest(pSql, NULL); goto _return; @@ -1744,6 +1752,7 @@ void tscFetchDatablockForSubquery(SSqlObj* pSql) { bool hasData = true; bool reachLimit = false; + tscDebug("***enter tscFetchDatablockForSubquery"); { pthread_mutex_lock(&pSql->subState.mutex); assert(pSql->subState.numOfSub >= 1); @@ -1782,6 +1791,7 @@ void tscFetchDatablockForSubquery(SSqlObj* pSql) { // has data remains in client side, and continue to return data to app if (hasData) { + tscDebug("*hasData"); tscBuildResFromSubqueries(pSql); return; } @@ -1789,6 +1799,7 @@ void tscFetchDatablockForSubquery(SSqlObj* pSql) { // If at least one subquery is completed in current vnode, try the next vnode in case of multi-vnode // super table projection query. if (reachLimit) { + tscDebug("*reachLimit"); pSql->res.completed = true; freeJoinSubqueryObj(pSql); @@ -1847,8 +1858,11 @@ void tscFetchDatablockForSubquery(SSqlObj* pSql) { SQueryInfo* pQueryInfo = tscGetQueryInfo(&pSub->cmd); + tscDebug("**nonorderedPrj:%d resRow:%d numOfRows:%d com:%d numOfClauseTotal:%"PRId64 " clauseLimit:%" PRId64, + tscNonOrderedProjectionQueryOnSTable(pQueryInfo, 0), pSub->res.row, pSub->res.numOfRows, + pSub->res.completed, pSql->res.numOfClauseTotal, pSql->cmd.active->clauseLimit); if (tscNonOrderedProjectionQueryOnSTable(pQueryInfo, 0) && pSub->res.row >= pSub->res.numOfRows && - pSub->res.completed) { + pSub->res.completed && (pSql->cmd.active->clauseLimit < 0 || pSql->res.numOfClauseTotal < pSql->cmd.active->clauseLimit)) { STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0); assert(pQueryInfo->numOfTables == 1); @@ -1865,6 +1879,9 @@ void tscFetchDatablockForSubquery(SSqlObj* pSql) { pTableMetaInfo->vgroupIndex); pSub->cmd.command = TSDB_SQL_SELECT; pSub->fp = tscJoinQueryCallback; + pSub->cmd.active->clauseLimit = pSql->cmd.active->clauseLimit; + pSub->cmd.active->limit.limit = pSql->cmd.active->clauseLimit - pSql->res.numOfClauseTotal; + pSub->cmd.active->limit.offset = pSub->res.offset; tscBuildAndSendRequest(pSub, NULL); tryNextVnode = true; @@ -2132,6 +2149,8 @@ int32_t tscCreateJoinSubquery(SSqlObj *pSql, int16_t tableIndex, SJoinSupporter SQueryInfo *pNewQueryInfo = tscGetQueryInfo(&pNew->cmd); assert(pNewQueryInfo != NULL); + pNewQueryInfo->clauseLimit = -1; + pSupporter->colList = pNewQueryInfo->colList; pNewQueryInfo->colList = NULL; @@ -3027,6 +3046,11 @@ void tscHandleSubqueryError(SRetrieveSupport *trsupport, SSqlObj *pSql, int numO } SSqlObj *pParentSql = trsupport->pParentSql; + if (pParentSql->signature != pParentSql) { + tscError("query 0x%"PRIx64" parent sql obj %p not valid. parent id: 0x%"PRIx64, pSql->self, pParentSql, pParentSql->self); + return; + } + int32_t subqueryIndex = trsupport->subqueryIndex; assert(pSql != NULL); @@ -3133,6 +3157,11 @@ static void tscAllDataRetrievedFromDnode(SRetrieveSupport *trsupport, SSqlObj* p int32_t idx = trsupport->subqueryIndex; SSqlObj * pParentSql = trsupport->pParentSql; tOrderDescriptor *pDesc = trsupport->pOrderDescriptor; + + if (pParentSql->signature != pParentSql) { + tscError("query 0x%"PRIx64" parent sql obj %p not valid. parent id: 0x%"PRIx64, pSql->self, pParentSql, pParentSql->self); + return; + } SSubqueryState* pState = &pParentSql->subState; SQueryInfo *pQueryInfo = tscGetQueryInfo(&pSql->cmd); @@ -3794,6 +3823,7 @@ static void doBuildResFromSubqueries(SSqlObj* pSql) { pthread_mutex_unlock(&pSql->subState.mutex); } if (numOfRes == 0) { // no result any more, free all subquery objects + tscDebug("*******query complete"); pSql->res.completed = true; freeJoinSubqueryObj(pSql); return; @@ -3861,7 +3891,7 @@ static void doBuildResFromSubqueries(SSqlObj* pSql) { pthread_mutex_unlock(&pSql->subState.mutex); } pRes->numOfRows = numOfRes; - pRes->numOfClauseTotal += numOfRes; + //pRes->numOfClauseTotal += numOfRes; int32_t finalRowSize = 0; for(int32_t i = 0; i < tscNumOfFields(pQueryInfo); ++i) { @@ -3878,6 +3908,7 @@ static void doBuildResFromSubqueries(SSqlObj* pSql) { void tscBuildResFromSubqueries(SSqlObj *pSql) { SSqlRes* pRes = &pSql->res; + tscDebug("*enter tscBuildResFromSubqueries"); if (pRes->code != TSDB_CODE_SUCCESS) { tscAsyncResultOnError(pSql); return; diff --git a/src/client/src/tscSystem.c b/src/client/src/tscSystem.c index 50c7ceb733ed405b89b9fc8d4fe3491aa7fd89ec..a45aa6450566cfc22bb1d92b347b62f125a1d873 100644 --- a/src/client/src/tscSystem.c +++ b/src/client/src/tscSystem.c @@ -282,14 +282,15 @@ void taos_cleanup(void) { #endif } - int32_t id = tscObjRef; - tscObjRef = -1; - taosCloseRef(id); void* p = tscQhandle; tscQhandle = NULL; taosCleanUpScheduler(p); + int32_t id = tscObjRef; + tscObjRef = -1; + taosCloseRef(id); + id = tscRefId; tscRefId = -1; taosCloseRef(id); diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index ccac6b72eb87d201fe6dee9cb0a5855fbe6fe251..7a3f51f73ed7c3a124cb42fed286d11f66ad8830 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -2780,7 +2780,7 @@ void tscExprAddParams(SSqlExpr* pExpr, char* argument, int32_t type, int32_t byt tVariantCreateFromBinary(&pExpr->param[pExpr->numOfParams], argument, bytes, type); pExpr->numOfParams += 1; - assert(pExpr->numOfParams <= 3); + assert(pExpr->numOfParams <= 10); } SExprInfo* tscExprGet(SQueryInfo* pQueryInfo, int32_t idx) { @@ -4561,7 +4561,9 @@ int32_t tscErrorMsgWithCode(int32_t code, char* dstBuffer, const char* errMsg, c bool tscHasReachLimitation(SQueryInfo* pQueryInfo, SSqlRes* pRes) { assert(pQueryInfo != NULL && pQueryInfo->clauseLimit != 0); - return (pQueryInfo->clauseLimit > 0 && pRes->numOfClauseTotal >= pQueryInfo->clauseLimit); + bool reachLimit = (pQueryInfo->clauseLimit > 0 && pRes->numOfClauseTotal >= pQueryInfo->clauseLimit); + tscDebug("reachLimit:%d, limit:%" PRId64 " total:%" PRId64, reachLimit, pQueryInfo->clauseLimit, pRes->numOfClauseTotal); + return reachLimit; } char* tscGetErrorMsgPayload(SSqlCmd* pCmd) { return pCmd->payload; } diff --git a/src/common/inc/tname.h b/src/common/inc/tname.h index ef98b607d88d29ff03e6a673e82fe037e7b6e082..bed2ec1c5ec2a4a62eade260495a682f9360fed9 100644 --- a/src/common/inc/tname.h +++ b/src/common/inc/tname.h @@ -59,7 +59,7 @@ typedef struct SSqlExpr { // pQueryAttr->interBytesForGlobal int16_t numOfParams; // argument value of each function - tVariant param[3]; // parameters are not more than 3 + tVariant param[10]; // parameters are not more than 10 int32_t offset; // sub result column value of arithmetic expression. int16_t resColId; // result column id diff --git a/src/common/src/tdataformat.c b/src/common/src/tdataformat.c index d52b08ffd3cc443563264899e9d4eafbcce67d29..80463ab55002f9cd86d5e46bbc633cc22b22e83b 100644 --- a/src/common/src/tdataformat.c +++ b/src/common/src/tdataformat.c @@ -467,7 +467,11 @@ static void tdAppendDataRowToDataCol(SDataRow row, STSchema *pSchema, SDataCols while (dcol < pCols->numOfCols) { SDataCol *pDataCol = &(pCols->cols[dcol]); if (rcol >= schemaNCols(pSchema)) { - dataColAppendVal(pDataCol, getNullValue(pDataCol->type), pCols->numOfRows, pCols->maxPoints, rowOffset); + if (forceSetNull) { + dataColAppendVal(pDataCol, getNullValue(pDataCol->type), pCols->numOfRows, pCols->maxPoints, rowOffset); + } else { + break; + } dcol++; continue; } @@ -510,7 +514,11 @@ static void tdAppendKvRowToDataCol(SKVRow row, STSchema *pSchema, SDataCols *pCo while (dcol < pCols->numOfCols) { SDataCol *pDataCol = &(pCols->cols[dcol]); if (rcol >= nRowCols || rcol >= schemaNCols(pSchema)) { - dataColAppendVal(pDataCol, getNullValue(pDataCol->type), pCols->numOfRows, pCols->maxPoints, rowOffset); + if (forceSetNull) { + dataColAppendVal(pDataCol, getNullValue(pDataCol->type), pCols->numOfRows, pCols->maxPoints, rowOffset); + } else { + break; + } ++dcol; continue; } diff --git a/src/dnode/inc/dnodeInt.h b/src/dnode/inc/dnodeInt.h index 7abff373834a2f2ddf39dbffb1ebcaadc6991dc9..dd4a6b992e2e9b4a138fd75d4c9315871bd61a9e 100644 --- a/src/dnode/inc/dnodeInt.h +++ b/src/dnode/inc/dnodeInt.h @@ -24,6 +24,7 @@ extern "C" { #include "tlog.h" #include "trpc.h" #include "tglobal.h" +#include "tfs.h" #include "dnode.h" #include "vnode.h" diff --git a/src/dnode/src/dnodeSystem.c b/src/dnode/src/dnodeSystem.c index d41a2c6a8ae442f09b20c1dc55d06d5d5273cd88..4c6ebb01956f9880d8c4c4f73091a1588b7889ef 100644 --- a/src/dnode/src/dnodeSystem.c +++ b/src/dnode/src/dnodeSystem.c @@ -27,6 +27,7 @@ static void sigintHandler(int32_t signum, void *sigInfo, void *context); int32_t main(int32_t argc, char *argv[]) { int dump_config = 0; + int dump_cluster = 0; // Set global configuration file for (int32_t i = 1; i < argc; ++i) { @@ -61,8 +62,10 @@ int32_t main(int32_t argc, char *argv[]) { printf("buildinfo: %s\n", buildinfo); exit(EXIT_SUCCESS); } else if (strcmp(argv[i], "-k") == 0) { - grantParseParameter(); + grantParseParameter(argv[i]); exit(EXIT_SUCCESS); + } else if (strcmp(argv[i], "-u") == 0) { + dump_cluster = 1; } else if (strcmp(argv[i], "-A") == 0) { tsPrintAuth = 1; } @@ -115,6 +118,23 @@ int32_t main(int32_t argc, char *argv[]) { exit(EXIT_SUCCESS); } + if (0 != dump_cluster) { + taosInitGlobalCfg(); + if (!taosReadGlobalCfg()) { + printf("TDengine read global config failed\n"); + exit(EXIT_FAILURE); + } + if (tsDiskCfgNum > 0) { + if (tfsInit(tsDiskCfg, tsDiskCfgNum) < 0) { + printf("failed to init TFS since %s\n", tstrerror(terrno)); + exit(EXIT_FAILURE); + } + strncpy(tsDataDir, TFS_PRIMARY_PATH(), TSDB_FILENAME_LEN); + } + grantParseParameter("-u"); + exit(EXIT_SUCCESS); + } + if (tsem_init(&exitSem, 0, 0) != 0) { printf("failed to create exit semphore\n"); exit(EXIT_FAILURE); diff --git a/src/inc/tgrant.h b/src/inc/tgrant.h index f62a521b6cd157074ab18a4bf1a1a18f9120ac97..fb983bedc6098b254d6cfa23b2d197f0a74b0ec1 100644 --- a/src/inc/tgrant.h +++ b/src/inc/tgrant.h @@ -38,7 +38,7 @@ typedef enum { int32_t grantInit(); void grantCleanUp(); -void grantParseParameter(); +void grantParseParameter(const char* param); int32_t grantCheck(EGrantType grant); void grantReset(EGrantType grant, uint64_t value); void grantAdd(EGrantType grant, uint64_t value); diff --git a/src/kit/taos-tools b/src/kit/taos-tools index 261fcca698d0fe171bb6fed1913c0a922de388f3..41affde86d4ae7be340e31725650970326ac5b0d 160000 --- a/src/kit/taos-tools +++ b/src/kit/taos-tools @@ -1 +1 @@ -Subproject commit 261fcca698d0fe171bb6fed1913c0a922de388f3 +Subproject commit 41affde86d4ae7be340e31725650970326ac5b0d diff --git a/src/mnode/src/mnodeGrant.c b/src/mnode/src/mnodeGrant.c index 7329629ef92f61d29794807bd868cda354270548..dc3923a1000ceb0a2d368aaf371ad98b63cc4178 100644 --- a/src/mnode/src/mnodeGrant.c +++ b/src/mnode/src/mnodeGrant.c @@ -22,7 +22,7 @@ int32_t grantInit() { return TSDB_CODE_SUCCESS; } void grantCleanUp() {} -void grantParseParameter() { mError("can't parsed parameter k"); } +void grantParseParameter(const char* param) { mError("can't parse parameter %s", param); } int32_t grantCheck(EGrantType grant) { return TSDB_CODE_SUCCESS; } void grantReset(EGrantType grant, uint64_t value) {} void grantAdd(EGrantType grant, uint64_t value) {} diff --git a/src/plugins/taosadapter b/src/plugins/taosadapter index f3278c55e68b4b6195e3ef8841a1d81df6f50e08..251a4aa70270966258dd26f90ac3e7c39ca90f1a 160000 --- a/src/plugins/taosadapter +++ b/src/plugins/taosadapter @@ -1 +1 @@ -Subproject commit f3278c55e68b4b6195e3ef8841a1d81df6f50e08 +Subproject commit 251a4aa70270966258dd26f90ac3e7c39ca90f1a diff --git a/src/query/inc/qAggMain.h b/src/query/inc/qAggMain.h index 5fc940309c5b996304fe89afa20816826b61b784..d597b3c7643a4ccccb97bcecb66a5971231bf1b4 100644 --- a/src/query/inc/qAggMain.h +++ b/src/query/inc/qAggMain.h @@ -196,6 +196,7 @@ typedef struct SQLFunctionCtx { uint32_t order; // asc|desc int16_t inputType; int32_t inputBytes; + bool hasColDataInput; // the input data block has column data int16_t outputType; int32_t outputBytes; // size of results, determined by function and input column data type @@ -209,7 +210,7 @@ typedef struct SQLFunctionCtx { int64_t startTs; // timestamp range of current query when function is executed on a specific data block int64_t endTs; int32_t numOfParams; - tVariant param[4]; // input parameter, e.g., top(k, 20), the number of results for top query is kept in param + tVariant param[10]; // input parameter, e.g., top(k, 20), the number of results for top query is kept in param int64_t *ptsList; // corresponding timestamp array list void *ptsOutputBuf; // corresponding output buffer for timestamp of each result, e.g., top/bottom*/ SQLPreAggVal preAggVals; diff --git a/src/query/inc/qTsbuf.h b/src/query/inc/qTsbuf.h index 00cc4e897f130348b81a7d96419c1b292cacca8c..c56e36ad45f714eab82dd0ef50b853bf07c5ce85 100644 --- a/src/query/inc/qTsbuf.h +++ b/src/query/inc/qTsbuf.h @@ -110,7 +110,7 @@ int32_t tsBufMerge(STSBuf* pDestBuf, const STSBuf* pSrcBuf); STSBuf* tsBufClone(STSBuf* pTSBuf); -STSGroupBlockInfo* tsBufGetGroupBlockInfo(STSBuf* pTSBuf, int32_t id); +SArray* tsBufGetGroupBlockInfo(STSBuf* pTSBuf, int32_t id); void tsBufFlush(STSBuf* pTSBuf); void tsBufResetPos(STSBuf* pTSBuf); @@ -136,6 +136,8 @@ void tsBufGetGroupIdList(STSBuf* pTSBuf, int32_t* num, int32_t** id); int32_t dumpFileBlockByGroupId(STSBuf* pTSBuf, int32_t id, void* buf, int32_t* len, int32_t* numOfBlocks); +int32_t dumpFileBlockByGroupIndex(STSBuf* pTSBuf, int32_t groupIndex, void* pBuf, int32_t* len, int32_t* numOfBlocks); + STSElem tsBufFindElemStartPosByTag(STSBuf* pTSBuf, tVariant* pTag); bool tsBufIsValidElem(STSElem* pElem); diff --git a/src/query/inc/sql.y b/src/query/inc/sql.y index f833751685769de0bb0ad7a80c044703cc2a5877..dc6ec6278a20dccc7c33d3cebfc905d64ae75631 100644 --- a/src/query/inc/sql.y +++ b/src/query/inc/sql.y @@ -791,6 +791,9 @@ expr(A) ::= ID(X) LP exprlist(Y) RP(E). { tStrTokenAppend(pInfo->funcs, &X); A = // for parsing sql functions with wildcard for parameters. e.g., count(*)/first(*)/last(*) operation expr(A) ::= ID(X) LP STAR RP(Y). { tStrTokenAppend(pInfo->funcs, &X); A = tSqlExprCreateFunction(NULL, &X, &Y, X.type); } +// for parsing sql functions without parameters +expr(A) ::= ID(X) LP RP(Y). { tStrTokenAppend(pInfo->funcs, &X); A = tSqlExprCreateFunction(tSqlExprListAppend(0, 0, 0, 0), &X, &Y, X.type); } + // for parsing sql function CAST(column as typename) expr(A) ::= ID(X) LP expr(B) AS typename(C) RP(Y). { tStrTokenAppend(pInfo->funcs, &X); A = tSqlExprCreateFuncWithParams(pInfo, B, &C, &X, &Y, X.type); } @@ -855,7 +858,6 @@ expr(A) ::= expr(X) IN LP exprlist(Y) RP. {A = tSqlExprCreate(X, (tSqlExpr*)Y, exprlist(A) ::= exprlist(X) COMMA expritem(Y). {A = tSqlExprListAppend(X,Y,0, 0);} exprlist(A) ::= expritem(X). {A = tSqlExprListAppend(0,X,0, 0);} expritem(A) ::= expr(X). {A = X;} -expritem(A) ::= . {A = 0;} ///////////////////////////////////reset query cache////////////////////////////////////// cmd ::= RESET QUERY CACHE. { setDCLSqlElems(pInfo, TSDB_SQL_RESET_CACHE, 0);} diff --git a/src/query/src/qAggMain.c b/src/query/src/qAggMain.c index 949e80bc2f25131123f6f0072af1151f7f28665d..5a302e4f26dac5e5df27f2610d65ca4fd34f1beb 100644 --- a/src/query/src/qAggMain.c +++ b/src/query/src/qAggMain.c @@ -700,8 +700,13 @@ int32_t getResultDataInfo(int32_t dataType, int32_t dataBytes, int32_t functionI *bytes = sizeof(double); *interBytes = sizeof(SSpreadInfo); } else if (functionId == TSDB_FUNC_PERCT) { - *type = (int16_t)TSDB_DATA_TYPE_DOUBLE; - *bytes = sizeof(double); + if (param > 1) { + *type = (int16_t)TSDB_DATA_TYPE_BINARY; + *bytes = 512; + } else { + *type = (int16_t)TSDB_DATA_TYPE_DOUBLE; + *bytes = sizeof(double); + } *interBytes = sizeof(SPercentileInfo); } else if (functionId == TSDB_FUNC_LEASTSQR) { *type = TSDB_DATA_TYPE_BINARY; @@ -3096,7 +3101,7 @@ static void percentile_function(SQLFunctionCtx *pCtx) { } static void percentile_finalizer(SQLFunctionCtx *pCtx) { - double v = pCtx->param[0].nType == TSDB_DATA_TYPE_INT ? pCtx->param[0].i64 : pCtx->param[0].dKey; + double v = 0; SResultRowCellInfo *pResInfo = GET_RES_INFO(pCtx); SPercentileInfo* ppInfo = (SPercentileInfo *) GET_ROWCELL_INTERBUF(pResInfo); @@ -3107,7 +3112,25 @@ static void percentile_finalizer(SQLFunctionCtx *pCtx) { assert(ppInfo->numOfElems == 0); setNull(pCtx->pOutput, pCtx->outputType, pCtx->outputBytes); } else { - SET_DOUBLE_VAL((double *)pCtx->pOutput, getPercentile(pMemBucket, v)); + if (pCtx->numOfParams > 1) { + ((char *)varDataVal(pCtx->pOutput))[0] = '['; + size_t len = 1; + size_t maxBufLen = 512; + + for (int32_t i = 0; i < pCtx->numOfParams; ++i) { + v = pCtx->param[i].nType == TSDB_DATA_TYPE_INT ? pCtx->param[i].i64 : pCtx->param[i].dKey; + + if (i == pCtx->numOfParams - 1) { + len += snprintf((char *)varDataVal(pCtx->pOutput) + len, maxBufLen - len, "%lf]", getPercentile(pMemBucket, v)); + } else { + len += snprintf((char *)varDataVal(pCtx->pOutput) + len, maxBufLen - len, "%lf, ", getPercentile(pMemBucket, v)); + } + } + varDataSetLen(pCtx->pOutput, len); + } else { + v = pCtx->param[0].nType == TSDB_DATA_TYPE_INT ? pCtx->param[0].i64 : pCtx->param[0].dKey; + SET_DOUBLE_VAL((double *)pCtx->pOutput, getPercentile(pMemBucket, v)); + } } tMemBucketDestroy(pMemBucket); diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index ff80a36773462f783599ad6958a9b65dce16e49f..858673212cb2a8f039bfd07636449ae147e73ae4 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -52,6 +52,7 @@ enum { TS_JOIN_TS_EQUAL = 0, TS_JOIN_TS_NOT_EQUALS = 1, TS_JOIN_TAG_NOT_EQUALS = 2, + TS_JOIN_BLOCK_IGNORE = 3, }; typedef enum SResultTsInterpType { @@ -1322,6 +1323,7 @@ static void doSetInputDataBlockInfo(SOperatorInfo* pOperator, SQLFunctionCtx* pC pCtx[i].order = order; pCtx[i].size = pBlock->info.rows; pCtx[i].currentStage = (uint8_t)pOperator->pRuntimeEnv->scanFlag; + pCtx[i].hasColDataInput = false; setBlockStatisInfo(&pCtx[i], pBlock, &pOperator->pExpr[i].base.colInfo); } @@ -1349,6 +1351,7 @@ static void doSetInputDataBlock(SOperatorInfo* pOperator, SQLFunctionCtx* pCtx, pCtx[i].order = order; pCtx[i].size = pBlock->info.rows; pCtx[i].currentStage = (uint8_t)pOperator->pRuntimeEnv->scanFlag; + pCtx[i].hasColDataInput = (pBlock->pDataBlock != NULL); setBlockStatisInfo(&pCtx[i], pBlock, &pOperator->pExpr[i].base.colInfo); @@ -2129,6 +2132,9 @@ static bool functionNeedToExecute(SQueryRuntimeEnv* pRuntimeEnv, SQLFunctionCtx* } if (functionId == TSDB_FUNC_FIRST_DST || functionId == TSDB_FUNC_FIRST) { + if (pCtx->hasColDataInput == false) { + return false; + } // if param[2] is set value, input data come from client, order is no relation with pQueryAttr->order, so always // return true if (pCtx->param[2].nType == TSDB_DATA_TYPE_INT) return true; @@ -2137,6 +2143,9 @@ static bool functionNeedToExecute(SQueryRuntimeEnv* pRuntimeEnv, SQLFunctionCtx* // denote the order type if ((functionId == TSDB_FUNC_LAST_DST || functionId == TSDB_FUNC_LAST)) { + if (pCtx->hasColDataInput == false) { + return false; + } // if param[2] is set value, input data come from client, order is no relation with pQueryAttr->order, so always // return true if (pCtx->param[2].nType == TSDB_DATA_TYPE_INT) return true; @@ -2259,6 +2268,7 @@ static SQLFunctionCtx* createSQLFunctionCtx(SQueryRuntimeEnv* pRuntimeEnv, SExpr } else { pCtx->inputBytes = pSqlExpr->colBytes; } + pCtx->hasColDataInput = false; pCtx->ptsOutputBuf = NULL; @@ -3222,13 +3232,13 @@ static int32_t doTSJoinFilter(SQueryRuntimeEnv* pRuntimeEnv, TSKEY key, tVariant if (key < elem.ts) { return TS_JOIN_TS_NOT_EQUALS; } else if (key > elem.ts) { - longjmp(pRuntimeEnv->env, TSDB_CODE_QRY_INCONSISTAN); + return TS_JOIN_BLOCK_IGNORE; } } else { if (key > elem.ts) { return TS_JOIN_TS_NOT_EQUALS; } else if (key < elem.ts) { - longjmp(pRuntimeEnv->env, TSDB_CODE_QRY_INCONSISTAN); + return TS_JOIN_BLOCK_IGNORE; } } @@ -3413,6 +3423,9 @@ void filterColRowsInDataBlock(SQueryRuntimeEnv* pRuntimeEnv, SSDataBlock* pBlock } else if (ret == TS_JOIN_TS_NOT_EQUALS) { all = false; continue; + } else if (ret == TS_JOIN_BLOCK_IGNORE) { + all = false; + break; } else { assert(ret == TS_JOIN_TS_EQUAL); p[offset] = true; @@ -4542,9 +4555,9 @@ int32_t setTimestampListJoinInfo(SQueryRuntimeEnv* pRuntimeEnv, tVariant* pTag, if (!tsBufIsValidElem(&elem)) { if (pTag->nType == TSDB_DATA_TYPE_BINARY || pTag->nType == TSDB_DATA_TYPE_NCHAR || pTag->nType == TSDB_DATA_TYPE_JSON) { - qError("QInfo:0x%" PRIx64 " failed to find tag:%s in ts_comp", GET_QID(pRuntimeEnv), pTag->pz); + qDebug("QInfo:0x%" PRIx64 " tag not found in:%s in ts_comp", GET_QID(pRuntimeEnv), pTag->pz); } else { - qError("QInfo:0x%" PRIx64 " failed to find tag:%" PRId64 " in ts_comp", GET_QID(pRuntimeEnv), pTag->i64); + qDebug("QInfo:0x%" PRIx64 " tag not found in:%" PRId64 " in ts_comp", GET_QID(pRuntimeEnv), pTag->i64); } return -1; @@ -4966,8 +4979,10 @@ static void doOperatorExecProfOnce(SOperatorStackItem* item, SQueryProfEvent* ev } void calculateOperatorProfResults(SQInfo* pQInfo) { - if (pQInfo->summary.queryProfEvents == NULL) { - qDebug("QInfo:0x%" PRIx64 " query prof events array is null", pQInfo->qId); + if (pQInfo->summary.queryProfEvents == NULL || + pQInfo->summary.queryProfEvents->pData == NULL || + pQInfo->summary.queryProfEvents->size == 0) { + qDebug("QInfo:0x%" PRIx64 " query prof events array is null or array data invalid", pQInfo->qId); return; } @@ -9764,7 +9779,13 @@ int32_t createQueryFunc(SQueriedTableInfo* pTableInfo, int32_t numOfOutput, SExp } } - int32_t param = (int32_t)pExprs[i].base.param[0].i64; + int32_t param; + if (pExprs[i].base.functionId != TSDB_FUNC_PERCT) { + param = (int32_t)pExprs[i].base.param[0].i64; + } else { + param = pExprs[i].base.numOfParams; + } + if (pExprs[i].base.functionId > 0 && pExprs[i].base.functionId != TSDB_FUNC_SCALAR_EXPR && !isTimeWindowFunction(pExprs[i].base.functionId) && (type != pExprs[i].base.colType || bytes != pExprs[i].base.colBytes)) { diff --git a/src/query/src/qFill.c b/src/query/src/qFill.c index 021a0a8e51904fd67e836ecaa16d9161d327f8c1..755b59ef7daeeccb4264014445102ac5089654bb 100644 --- a/src/query/src/qFill.c +++ b/src/query/src/qFill.c @@ -399,6 +399,8 @@ void taosResetFillInfo(SFillInfo* pFillInfo, TSKEY startTimestamp) { pFillInfo->numOfRows = 0; pFillInfo->numOfCurrent = 0; pFillInfo->numOfTotal = 0; + //free prevValues so that the new group has no prevValues then fill(linear) of new group won't use old group values. + tfree(pFillInfo->prevValues); } void* taosDestroyFillInfo(SFillInfo* pFillInfo) { diff --git a/src/query/src/qFilter.c b/src/query/src/qFilter.c index 3387956730383141491e37323b316fd0b2ee215c..6de80af0b6136c61105233a9ba703f3584888635 100644 --- a/src/query/src/qFilter.c +++ b/src/query/src/qFilter.c @@ -3732,7 +3732,7 @@ int32_t filterGetTimeRange(SFilterInfo *info, STimeWindow *win) { SFilterRange tra; filterGetRangeRes(prev, &tra); - win->skey = tra.s; + win->skey = tra.s; win->ekey = tra.e; } @@ -3786,7 +3786,7 @@ int32_t filterConverNcharColumns(SFilterInfo* info, int32_t rows, bool *gotNchar } fi->data = nfi.data; - + *gotNchar = true; } } @@ -3820,22 +3820,27 @@ int32_t filterIsIndexedColumnQuery(SFilterInfo* info, int32_t idxId, bool *res) CHK_JMP(FILTER_GET_COL_FIELD_ID(FILTER_GET_COL_FIELD(info, 0)) != idxId); int32_t optr = FILTER_UNIT_OPTR(info->units); - + CHK_JMP(optr == TSDB_RELATION_LIKE || optr == TSDB_RELATION_IN || optr == TSDB_RELATION_MATCH || optr == TSDB_RELATION_ISNULL || optr == TSDB_RELATION_NOTNULL || optr == TSDB_RELATION_CONTAINS); *res = true; return TSDB_CODE_SUCCESS; - + _return: *res = false; - + return TSDB_CODE_SUCCESS; } int32_t filterGetIndexedColumnInfo(SFilterInfo* info, char** val, int32_t *order, int32_t *flag) { + if (FILTER_GET_FLAG(info->status, FI_STATUS_EMPTY)) { + *order = 0; + return TSDB_CODE_SUCCESS; + } + SFilterComUnit *cunit = info->cunits; uint8_t optr = cunit->optr; @@ -3853,7 +3858,7 @@ int32_t filterGetIndexedColumnInfo(SFilterInfo* info, char** val, int32_t *order if (cunit->valData2 == cunit->valData && optr != TSDB_RELATION_EQUAL) { FILTER_SET_FLAG(*flag, FI_ACTION_NO_NEED); } - + return TSDB_CODE_SUCCESS; } diff --git a/src/query/src/qTsbuf.c b/src/query/src/qTsbuf.c index 2c7e09b84408beae3814cdd943388eb031639257..2d0b70627d9e652bd5f6b3c4d00a82b90f331b4c 100644 --- a/src/query/src/qTsbuf.c +++ b/src/query/src/qTsbuf.c @@ -593,22 +593,22 @@ static void tsBufGetBlock(STSBuf* pTSBuf, int32_t groupIndex, int32_t blockIndex } STSCursor* pCur = &pTSBuf->cur; - if (pCur->vgroupIndex == groupIndex && ((pCur->blockIndex <= blockIndex && pCur->order == TSDB_ORDER_ASC) || - (pCur->blockIndex >= blockIndex && pCur->order == TSDB_ORDER_DESC))) { - int32_t i = 0; - bool decomp = false; - int32_t step = abs(blockIndex - pCur->blockIndex); - - while ((++i) <= step) { - if (readDataFromDisk(pTSBuf, pCur->order, decomp) == NULL) { - return; - } - } - } else { +// if (pCur->vgroupIndex == groupIndex && ((pCur->blockIndex <= blockIndex && pCur->order == TSDB_ORDER_ASC) || +// (pCur->blockIndex >= blockIndex && pCur->order == TSDB_ORDER_DESC))) { +// int32_t i = 0; +// bool decomp = false; +// int32_t step = abs(blockIndex - pCur->blockIndex); +// +// while ((++i) <= step) { +// if (readDataFromDisk(pTSBuf, pCur->order, decomp) == NULL) { +// return; +// } +// } +// } else { if (tsBufFindBlock(pTSBuf, pBlockInfo, blockIndex) == -1) { assert(false); } - } +// } STSBlock* pBlock = &pTSBuf->block; @@ -651,13 +651,16 @@ static int32_t doUpdateGroupInfo(STSBuf* pTSBuf, int64_t offset, STSGroupBlockIn return 0; } -STSGroupBlockInfo* tsBufGetGroupBlockInfo(STSBuf* pTSBuf, int32_t id) { - int32_t j = tsBufFindGroupById(pTSBuf->pData, pTSBuf->numOfGroups, id); - if (j == -1) { - return NULL; +SArray* tsBufGetGroupBlockInfo(STSBuf* pTSBuf, int32_t id) { + SArray* pList = taosArrayInit(4, sizeof(STSGroupBlockInfo)); + + for(int32_t i = 0; i < pTSBuf->numOfGroups; ++i) { + if (pTSBuf->pData[i].info.id == id) { + taosArrayPush(pList, &pTSBuf->pData[i].info); + } } - - return &pTSBuf->pData[j].info; + + return pList; } int32_t STSBufUpdateHeader(STSBuf* pTSBuf, STSBufFileHeader* pHeader) { @@ -1099,23 +1102,54 @@ void tsBufGetGroupIdList(STSBuf* pTSBuf, int32_t* num, int32_t** id) { } } -int32_t dumpFileBlockByGroupId(STSBuf* pTSBuf, int32_t groupIndex, void* buf, int32_t* len, int32_t* numOfBlocks) { +int32_t dumpFileBlockByGroupId(STSBuf* pTSBuf, int32_t groupId, void* buf, int32_t* len, int32_t* numOfBlocks) { + SArray* pList = tsBufGetGroupBlockInfo(pTSBuf, groupId); + + *len = 0; + *numOfBlocks = 0; + + char* p = buf; + for(int32_t i = 0; i < taosArrayGetSize(pList); ++i) { + STSGroupBlockInfo* pBlockInfo = taosArrayGet(pList, i); + + if (fseek(pTSBuf->f, pBlockInfo->offset, SEEK_SET) != 0) { + int code = TAOS_SYSTEM_ERROR(ferror(pTSBuf->f)); + // qError("%p: fseek failed: %s", pSql, tstrerror(code)); + return code; + } + + size_t s = fread(p, 1, pBlockInfo->compLen, pTSBuf->f); + if (s != pBlockInfo->compLen) { + int code = TAOS_SYSTEM_ERROR(ferror(pTSBuf->f)); + // tscError("%p: fread didn't return expected data: %s", pSql, tstrerror(code)); + return code; + } + + *len += pBlockInfo->compLen; + *numOfBlocks += pBlockInfo->numOfBlocks; + p += pBlockInfo->compLen; + } + + return TSDB_CODE_SUCCESS; +} + +int32_t dumpFileBlockByGroupIndex(STSBuf* pTSBuf, int32_t groupIndex, void* pBuf, int32_t* len, int32_t* numOfBlocks) { assert(groupIndex >= 0 && groupIndex < pTSBuf->numOfGroups); - STSGroupBlockInfo *pBlockInfo = &pTSBuf->pData[groupIndex].info; + STSGroupBlockInfo* pBlockInfo = &pTSBuf->pData[groupIndex].info; *len = 0; *numOfBlocks = 0; if (fseek(pTSBuf->f, pBlockInfo->offset, SEEK_SET) != 0) { int code = TAOS_SYSTEM_ERROR(ferror(pTSBuf->f)); -// qError("%p: fseek failed: %s", pSql, tstrerror(code)); + // qError("%p: fseek failed: %s", pSql, tstrerror(code)); return code; } - size_t s = fread(buf, 1, pBlockInfo->compLen, pTSBuf->f); + size_t s = fread(pBuf, 1, pBlockInfo->compLen, pTSBuf->f); if (s != pBlockInfo->compLen) { int code = TAOS_SYSTEM_ERROR(ferror(pTSBuf->f)); -// tscError("%p: fread didn't return expected data: %s", pSql, tstrerror(code)); + // tscError("%p: fread didn't return expected data: %s", pSql, tstrerror(code)); return code; } diff --git a/src/query/src/sql.c b/src/query/src/sql.c index 8fec34c9a44ea6be7cf8ebdf9fa6d79027f2911b..57494b74e97822e830a980e902d2e6c3d4036074 100644 --- a/src/query/src/sql.c +++ b/src/query/src/sql.c @@ -23,6 +23,7 @@ ** input grammar file: */ #include +#include /************ Begin %include sections from the grammar ************************/ #include @@ -76,8 +77,10 @@ ** zero the stack is dynamically sized using realloc() ** ParseARG_SDECL A static variable declaration for the %extra_argument ** ParseARG_PDECL A parameter declaration for the %extra_argument +** ParseARG_PARAM Code to pass %extra_argument as a subroutine parameter ** ParseARG_STORE Code to store %extra_argument into yypParser ** ParseARG_FETCH Code to extract %extra_argument from yypParser +** ParseCTX_* As ParseARG_ except for %extra_context ** YYERRORSYMBOL is the code number of the error symbol. If not ** defined, then do no error processing. ** YYNSTATE the combined number of states. @@ -97,51 +100,58 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned short int -#define YYNOCODE 295 +#define YYNOCODE 293 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SStrToken typedef union { int yyinit; ParseTOKENTYPE yy0; - SRelationInfo* yy52; - int32_t yy88; - tVariant yy134; - int64_t yy165; - SCreatedTableInfo yy192; - SIntervalVal yy196; - SArray* yy249; - SSqlNode* yy320; - SLimitVal yy342; - tSqlExpr* yy370; - SRangeVal yy384; - SWindowStateVal yy385; - int yy424; - TAOS_FIELD yy475; - SCreateDbInfo yy478; - SCreateTableSql* yy494; - SCreateAcctInfo yy547; - SSessionWindowVal yy559; + SLimitVal yy24; + SCreateTableSql* yy74; + SCreatedTableInfo yy110; + SWindowStateVal yy204; + SRangeVal yy214; + int yy274; + TAOS_FIELD yy307; + SArray* yy367; + SSessionWindowVal yy373; + tSqlExpr* yy378; + tVariant yy410; + SSqlNode* yy426; + int64_t yy443; + SIntervalVal yy478; + SRelationInfo* yy480; + SCreateAcctInfo yy563; + SCreateDbInfo yy564; + int32_t yy586; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 #endif #define ParseARG_SDECL SSqlInfo* pInfo; #define ParseARG_PDECL ,SSqlInfo* pInfo -#define ParseARG_FETCH SSqlInfo* pInfo = yypParser->pInfo -#define ParseARG_STORE yypParser->pInfo = pInfo +#define ParseARG_PARAM ,pInfo +#define ParseARG_FETCH SSqlInfo* pInfo=yypParser->pInfo; +#define ParseARG_STORE yypParser->pInfo=pInfo; +#define ParseCTX_SDECL +#define ParseCTX_PDECL +#define ParseCTX_PARAM +#define ParseCTX_FETCH +#define ParseCTX_STORE #define YYFALLBACK 1 #define YYNSTATE 418 #define YYNRULE 332 #define YYNTOKEN 207 #define YY_MAX_SHIFT 417 -#define YY_MIN_SHIFTREDUCE 651 -#define YY_MAX_SHIFTREDUCE 982 -#define YY_ERROR_ACTION 983 -#define YY_ACCEPT_ACTION 984 -#define YY_NO_ACTION 985 -#define YY_MIN_REDUCE 986 -#define YY_MAX_REDUCE 1317 +#define YY_MIN_SHIFTREDUCE 652 +#define YY_MAX_SHIFTREDUCE 983 +#define YY_ERROR_ACTION 984 +#define YY_ACCEPT_ACTION 985 +#define YY_NO_ACTION 986 +#define YY_MIN_REDUCE 987 +#define YY_MAX_REDUCE 1318 /************* End control #defines *******************************************/ +#define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) /* Define the yytestcase() macro to be a no-op if is not already defined ** otherwise. @@ -206,340 +216,340 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (944) +#define YY_ACTTAB_COUNT (946) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 230, 705, 293, 175, 1226, 65, 1227, 332, 705, 706, - /* 10 */ 1290, 270, 1292, 197, 43, 44, 706, 47, 48, 416, - /* 20 */ 255, 283, 32, 31, 30, 1140, 65, 46, 365, 51, + /* 0 */ 230, 706, 293, 175, 1227, 65, 1228, 332, 706, 707, + /* 10 */ 1292, 270, 1294, 197, 43, 44, 707, 47, 48, 416, + /* 20 */ 255, 283, 32, 31, 30, 1141, 65, 46, 365, 51, /* 30 */ 49, 52, 50, 37, 36, 35, 34, 33, 42, 41, - /* 40 */ 742, 24, 40, 39, 38, 43, 44, 1174, 47, 48, - /* 50 */ 263, 1290, 283, 32, 31, 30, 314, 1147, 46, 365, + /* 40 */ 743, 24, 40, 39, 38, 43, 44, 1175, 47, 48, + /* 50 */ 263, 1292, 283, 32, 31, 30, 314, 1148, 46, 365, /* 60 */ 51, 49, 52, 50, 37, 36, 35, 34, 33, 42, - /* 70 */ 41, 273, 276, 40, 39, 38, 313, 312, 1147, 40, - /* 80 */ 39, 38, 43, 44, 1149, 47, 48, 409, 1076, 283, + /* 70 */ 41, 273, 276, 40, 39, 38, 313, 312, 1148, 40, + /* 80 */ 39, 38, 43, 44, 1150, 47, 48, 409, 1077, 283, /* 90 */ 32, 31, 30, 361, 95, 46, 365, 51, 49, 52, /* 100 */ 50, 37, 36, 35, 34, 33, 42, 41, 228, 400, - /* 110 */ 40, 39, 38, 43, 44, 1312, 47, 48, 1290, 1171, - /* 120 */ 283, 32, 31, 30, 1132, 64, 46, 365, 51, 49, + /* 110 */ 40, 39, 38, 43, 44, 1313, 47, 48, 1292, 1172, + /* 120 */ 283, 32, 31, 30, 1133, 64, 46, 365, 51, 49, /* 130 */ 52, 50, 37, 36, 35, 34, 33, 42, 41, 190, - /* 140 */ 791, 40, 39, 38, 911, 268, 914, 43, 45, 853, - /* 150 */ 47, 48, 1150, 856, 283, 32, 31, 30, 322, 905, + /* 140 */ 792, 40, 39, 38, 912, 268, 915, 43, 45, 854, + /* 150 */ 47, 48, 1151, 857, 283, 32, 31, 30, 322, 906, /* 160 */ 46, 365, 51, 49, 52, 50, 37, 36, 35, 34, /* 170 */ 33, 42, 41, 390, 389, 40, 39, 38, 44, 229, - /* 180 */ 47, 48, 318, 319, 283, 32, 31, 30, 82, 1290, + /* 180 */ 47, 48, 318, 319, 283, 32, 31, 30, 1305, 1292, /* 190 */ 46, 365, 51, 49, 52, 50, 37, 36, 35, 34, - /* 200 */ 33, 42, 41, 705, 1304, 40, 39, 38, 47, 48, - /* 210 */ 275, 706, 283, 32, 31, 30, 361, 1150, 46, 365, + /* 200 */ 33, 42, 41, 706, 315, 40, 39, 38, 47, 48, + /* 210 */ 1238, 707, 283, 32, 31, 30, 361, 286, 46, 365, /* 220 */ 51, 49, 52, 50, 37, 36, 35, 34, 33, 42, - /* 230 */ 41, 101, 83, 40, 39, 38, 73, 359, 408, 407, + /* 230 */ 41, 866, 867, 40, 39, 38, 73, 359, 408, 407, /* 240 */ 358, 406, 357, 405, 356, 355, 354, 404, 353, 403, - /* 250 */ 402, 315, 652, 653, 654, 655, 656, 657, 658, 659, - /* 260 */ 660, 661, 662, 663, 664, 665, 169, 919, 262, 286, - /* 270 */ 74, 266, 13, 984, 417, 25, 411, 1107, 1095, 1096, - /* 280 */ 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, - /* 290 */ 1108, 1109, 244, 1165, 254, 921, 705, 115, 909, 1237, - /* 300 */ 912, 246, 915, 298, 706, 114, 93, 156, 155, 154, - /* 310 */ 245, 264, 302, 301, 292, 373, 101, 37, 36, 35, - /* 320 */ 34, 33, 42, 41, 112, 1165, 40, 39, 38, 3, - /* 330 */ 212, 259, 260, 1134, 73, 367, 408, 407, 1165, 406, - /* 340 */ 29, 405, 1280, 306, 1224, 404, 1225, 403, 402, 287, - /* 350 */ 1236, 285, 1290, 376, 375, 74, 265, 1129, 1130, 61, - /* 360 */ 1133, 51, 49, 52, 50, 37, 36, 35, 34, 33, - /* 370 */ 42, 41, 865, 866, 40, 39, 38, 293, 305, 819, - /* 380 */ 91, 293, 816, 53, 817, 57, 818, 256, 198, 254, - /* 390 */ 921, 295, 366, 909, 294, 912, 291, 915, 385, 384, - /* 400 */ 5, 68, 201, 65, 234, 415, 413, 679, 680, 200, - /* 410 */ 122, 127, 118, 126, 1290, 288, 289, 364, 235, 922, - /* 420 */ 916, 918, 910, 280, 913, 141, 259, 260, 1290, 349, - /* 430 */ 92, 279, 284, 236, 1115, 29, 1113, 1114, 400, 1120, - /* 440 */ 363, 1116, 277, 1290, 917, 1117, 271, 1118, 1119, 1150, - /* 450 */ 139, 133, 144, 336, 107, 1146, 106, 282, 1233, 143, - /* 460 */ 247, 149, 153, 142, 1131, 65, 65, 65, 42, 41, - /* 470 */ 1290, 146, 40, 39, 38, 65, 65, 65, 53, 221, - /* 480 */ 219, 217, 6, 1232, 248, 65, 65, 226, 216, 160, - /* 490 */ 159, 158, 157, 272, 1290, 230, 230, 1290, 65, 1293, - /* 500 */ 168, 166, 165, 820, 290, 1290, 1290, 1293, 1293, 837, - /* 510 */ 274, 377, 378, 391, 922, 916, 918, 1147, 1147, 1147, - /* 520 */ 379, 380, 386, 152, 151, 150, 249, 1147, 1147, 1147, - /* 530 */ 387, 388, 250, 1037, 251, 293, 1290, 1147, 1147, 917, - /* 540 */ 211, 1276, 1290, 392, 1290, 920, 1148, 1, 199, 1275, - /* 550 */ 1147, 1290, 885, 1274, 257, 258, 98, 370, 232, 1290, - /* 560 */ 233, 237, 231, 1290, 1290, 1290, 238, 239, 1290, 834, - /* 570 */ 1290, 1290, 1290, 241, 99, 85, 1290, 1290, 242, 109, - /* 580 */ 243, 108, 240, 1290, 227, 110, 1047, 307, 1290, 1038, - /* 590 */ 1290, 862, 1290, 211, 1290, 309, 211, 10, 363, 841, - /* 600 */ 96, 66, 317, 316, 872, 177, 873, 801, 340, 803, - /* 610 */ 342, 802, 884, 309, 956, 335, 343, 86, 77, 60, - /* 620 */ 54, 66, 66, 77, 113, 77, 923, 369, 9, 281, - /* 630 */ 704, 15, 132, 14, 131, 17, 826, 16, 827, 824, - /* 640 */ 9, 825, 382, 381, 9, 19, 138, 18, 137, 89, - /* 650 */ 368, 21, 193, 20, 171, 303, 173, 174, 1145, 1173, - /* 660 */ 26, 1184, 1181, 1182, 1166, 310, 1186, 926, 176, 181, - /* 670 */ 908, 328, 1216, 192, 1215, 1214, 1213, 1317, 1141, 167, - /* 680 */ 170, 790, 194, 1139, 195, 410, 321, 196, 1053, 852, - /* 690 */ 345, 346, 347, 1163, 348, 351, 352, 75, 224, 267, - /* 700 */ 323, 71, 362, 1046, 374, 27, 325, 1311, 129, 1310, - /* 710 */ 84, 1307, 202, 383, 1303, 135, 1302, 1299, 203, 1073, - /* 720 */ 72, 67, 76, 87, 225, 337, 182, 28, 185, 183, - /* 730 */ 333, 1034, 145, 331, 1032, 147, 148, 1030, 1029, 329, - /* 740 */ 1028, 261, 214, 215, 1025, 184, 1024, 1023, 1022, 327, - /* 750 */ 1021, 324, 1020, 1019, 218, 220, 1009, 222, 1006, 223, - /* 760 */ 320, 1002, 94, 350, 401, 90, 308, 140, 1143, 97, - /* 770 */ 102, 393, 326, 394, 395, 396, 397, 398, 399, 172, - /* 780 */ 981, 88, 278, 296, 344, 297, 980, 299, 300, 979, - /* 790 */ 252, 962, 253, 961, 123, 1051, 1050, 124, 304, 309, - /* 800 */ 339, 11, 100, 829, 58, 311, 103, 80, 1027, 1026, - /* 810 */ 1018, 210, 1074, 204, 205, 206, 207, 208, 161, 209, - /* 820 */ 162, 163, 1017, 4, 1111, 186, 164, 338, 1075, 1008, - /* 830 */ 1007, 861, 859, 59, 187, 188, 189, 191, 1122, 2, - /* 840 */ 855, 854, 81, 858, 863, 178, 180, 874, 179, 269, - /* 850 */ 868, 104, 69, 870, 105, 330, 368, 334, 341, 70, - /* 860 */ 22, 23, 111, 12, 55, 114, 56, 62, 120, 116, - /* 870 */ 117, 119, 720, 63, 755, 753, 752, 751, 749, 747, - /* 880 */ 121, 744, 709, 125, 360, 7, 953, 951, 925, 954, - /* 890 */ 924, 952, 927, 8, 371, 372, 78, 128, 66, 793, - /* 900 */ 79, 130, 134, 136, 792, 789, 736, 823, 734, 726, - /* 910 */ 732, 728, 730, 724, 722, 822, 758, 757, 756, 754, - /* 920 */ 750, 748, 746, 745, 213, 707, 681, 669, 678, 676, - /* 930 */ 986, 985, 412, 985, 985, 985, 985, 985, 985, 985, - /* 940 */ 985, 985, 985, 414, + /* 250 */ 402, 1166, 653, 654, 655, 656, 657, 658, 659, 660, + /* 260 */ 661, 662, 663, 664, 665, 666, 169, 920, 262, 264, + /* 270 */ 112, 266, 1, 199, 985, 417, 411, 1108, 1096, 1097, + /* 280 */ 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, + /* 290 */ 1109, 1110, 254, 922, 141, 1237, 910, 287, 913, 285, + /* 300 */ 916, 376, 375, 1130, 1131, 61, 1134, 400, 25, 51, + /* 310 */ 49, 52, 50, 37, 36, 35, 34, 33, 42, 41, + /* 320 */ 706, 271, 40, 39, 38, 244, 1166, 1234, 707, 259, + /* 330 */ 260, 280, 820, 367, 246, 817, 298, 818, 29, 819, + /* 340 */ 156, 155, 154, 245, 306, 302, 301, 65, 373, 101, + /* 350 */ 37, 36, 35, 34, 33, 42, 41, 1282, 1233, 40, + /* 360 */ 39, 38, 272, 92, 5, 68, 201, 1292, 288, 289, + /* 370 */ 152, 151, 150, 200, 122, 127, 118, 126, 193, 42, + /* 380 */ 41, 53, 926, 40, 39, 38, 65, 292, 74, 115, + /* 390 */ 254, 922, 274, 349, 910, 226, 913, 1132, 916, 1148, + /* 400 */ 234, 1116, 65, 1114, 1115, 1292, 1121, 1295, 1117, 57, + /* 410 */ 1292, 305, 1118, 91, 1119, 1120, 279, 923, 917, 919, + /* 420 */ 256, 911, 284, 914, 295, 1135, 171, 259, 260, 293, + /* 430 */ 73, 377, 408, 407, 886, 406, 29, 405, 1148, 65, + /* 440 */ 198, 404, 918, 403, 402, 364, 391, 378, 293, 139, + /* 450 */ 133, 144, 65, 235, 1148, 13, 821, 290, 143, 366, + /* 460 */ 149, 153, 142, 1292, 221, 219, 217, 294, 363, 291, + /* 470 */ 146, 385, 384, 216, 160, 159, 158, 157, 65, 53, + /* 480 */ 230, 65, 303, 101, 379, 282, 230, 65, 114, 93, + /* 490 */ 1292, 1148, 1295, 65, 885, 173, 1292, 380, 1295, 415, + /* 500 */ 413, 680, 681, 363, 1148, 336, 107, 838, 106, 236, + /* 510 */ 6, 168, 166, 165, 247, 923, 917, 919, 248, 1292, + /* 520 */ 335, 249, 74, 386, 1292, 250, 387, 251, 1292, 370, + /* 530 */ 1148, 1292, 388, 1148, 65, 1292, 1278, 1292, 392, 1148, + /* 540 */ 918, 1277, 1276, 257, 921, 1148, 1292, 258, 232, 293, + /* 550 */ 26, 1292, 1292, 1292, 174, 233, 237, 1292, 1292, 231, + /* 560 */ 1149, 238, 239, 241, 110, 1292, 1292, 242, 243, 1292, + /* 570 */ 240, 1292, 1292, 1292, 227, 275, 277, 1292, 1292, 96, + /* 580 */ 1292, 1038, 1151, 1151, 1292, 1166, 1147, 1225, 211, 1226, + /* 590 */ 109, 1048, 108, 1039, 3, 212, 835, 842, 211, 307, + /* 600 */ 211, 98, 99, 265, 317, 316, 863, 873, 874, 82, + /* 610 */ 85, 802, 340, 66, 804, 342, 803, 281, 958, 924, + /* 620 */ 177, 77, 54, 369, 10, 66, 66, 1146, 77, 113, + /* 630 */ 77, 343, 9, 9, 60, 15, 705, 14, 89, 928, + /* 640 */ 309, 309, 132, 17, 131, 16, 368, 827, 1174, 828, + /* 650 */ 9, 1185, 86, 83, 19, 825, 18, 826, 909, 382, + /* 660 */ 381, 1182, 138, 21, 137, 20, 1183, 1167, 310, 1187, + /* 670 */ 791, 176, 181, 328, 1217, 1216, 1215, 1214, 192, 194, + /* 680 */ 1142, 1140, 195, 196, 1054, 345, 346, 347, 1318, 348, + /* 690 */ 351, 352, 75, 224, 71, 167, 410, 362, 1047, 374, + /* 700 */ 853, 1312, 129, 1311, 1308, 202, 383, 27, 1304, 135, + /* 710 */ 1303, 1300, 203, 87, 321, 267, 323, 325, 1074, 1164, + /* 720 */ 182, 72, 84, 67, 337, 183, 28, 76, 225, 184, + /* 730 */ 333, 1035, 331, 185, 329, 145, 327, 186, 1033, 147, + /* 740 */ 148, 1031, 1030, 1029, 261, 214, 215, 1026, 1025, 1024, + /* 750 */ 1023, 1022, 1021, 324, 320, 1020, 218, 94, 220, 1010, + /* 760 */ 222, 1007, 223, 1003, 350, 401, 170, 140, 90, 308, + /* 770 */ 1144, 97, 102, 326, 393, 394, 395, 396, 397, 398, + /* 780 */ 399, 88, 172, 982, 278, 297, 344, 981, 296, 300, + /* 790 */ 980, 252, 299, 963, 962, 123, 253, 1052, 1051, 124, + /* 800 */ 304, 339, 309, 11, 100, 58, 1028, 830, 311, 103, + /* 810 */ 80, 862, 206, 1027, 1075, 208, 204, 205, 207, 161, + /* 820 */ 209, 162, 1019, 210, 163, 1018, 338, 1112, 1009, 1076, + /* 830 */ 164, 856, 189, 187, 188, 59, 191, 1008, 4, 860, + /* 840 */ 1123, 2, 855, 81, 178, 859, 864, 875, 179, 180, + /* 850 */ 869, 104, 269, 871, 105, 330, 69, 368, 334, 12, + /* 860 */ 111, 55, 70, 22, 23, 56, 341, 62, 114, 120, + /* 870 */ 116, 117, 721, 756, 754, 119, 753, 752, 750, 748, + /* 880 */ 745, 710, 63, 121, 360, 125, 955, 953, 7, 956, + /* 890 */ 927, 954, 925, 929, 8, 372, 78, 128, 371, 130, + /* 900 */ 66, 824, 823, 79, 134, 136, 794, 793, 790, 737, + /* 910 */ 735, 727, 733, 729, 731, 725, 723, 759, 758, 757, + /* 920 */ 755, 751, 749, 747, 746, 213, 708, 682, 670, 679, + /* 930 */ 987, 677, 986, 986, 986, 986, 986, 986, 986, 986, + /* 940 */ 986, 986, 986, 412, 986, 414, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 281, 1, 210, 210, 289, 210, 291, 292, 1, 9, - /* 10 */ 291, 1, 293, 221, 14, 15, 9, 17, 18, 210, - /* 20 */ 211, 21, 22, 23, 24, 210, 210, 27, 28, 29, + /* 0 */ 280, 1, 209, 209, 288, 209, 290, 291, 1, 9, + /* 10 */ 290, 1, 292, 220, 14, 15, 9, 17, 18, 209, + /* 20 */ 210, 21, 22, 23, 24, 209, 209, 27, 28, 29, /* 30 */ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - /* 40 */ 5, 281, 42, 43, 44, 14, 15, 210, 17, 18, - /* 50 */ 255, 291, 21, 22, 23, 24, 286, 262, 27, 28, + /* 40 */ 5, 280, 42, 43, 44, 14, 15, 209, 17, 18, + /* 50 */ 254, 290, 21, 22, 23, 24, 285, 261, 27, 28, /* 60 */ 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - /* 70 */ 39, 255, 257, 42, 43, 44, 283, 284, 262, 42, - /* 80 */ 43, 44, 14, 15, 263, 17, 18, 232, 233, 21, + /* 70 */ 39, 254, 256, 42, 43, 44, 282, 283, 261, 42, + /* 80 */ 43, 44, 14, 15, 262, 17, 18, 231, 232, 21, /* 90 */ 22, 23, 24, 92, 94, 27, 28, 29, 30, 31, - /* 100 */ 32, 33, 34, 35, 36, 37, 38, 39, 281, 98, - /* 110 */ 42, 43, 44, 14, 15, 263, 17, 18, 291, 282, + /* 100 */ 32, 33, 34, 35, 36, 37, 38, 39, 280, 98, + /* 110 */ 42, 43, 44, 14, 15, 262, 17, 18, 290, 281, /* 120 */ 21, 22, 23, 24, 0, 94, 27, 28, 29, 30, - /* 130 */ 31, 32, 33, 34, 35, 36, 37, 38, 39, 268, - /* 140 */ 5, 42, 43, 44, 5, 256, 7, 14, 15, 5, - /* 150 */ 17, 18, 263, 9, 21, 22, 23, 24, 287, 91, + /* 130 */ 31, 32, 33, 34, 35, 36, 37, 38, 39, 267, + /* 140 */ 5, 42, 43, 44, 5, 255, 7, 14, 15, 5, + /* 150 */ 17, 18, 262, 9, 21, 22, 23, 24, 286, 91, /* 160 */ 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - /* 170 */ 37, 38, 39, 38, 39, 42, 43, 44, 15, 281, - /* 180 */ 17, 18, 38, 39, 21, 22, 23, 24, 105, 291, + /* 170 */ 37, 38, 39, 38, 39, 42, 43, 44, 15, 280, + /* 180 */ 17, 18, 38, 39, 21, 22, 23, 24, 262, 290, /* 190 */ 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - /* 200 */ 37, 38, 39, 1, 263, 42, 43, 44, 17, 18, - /* 210 */ 256, 9, 21, 22, 23, 24, 92, 263, 27, 28, + /* 200 */ 37, 38, 39, 1, 285, 42, 43, 44, 17, 18, + /* 210 */ 249, 9, 21, 22, 23, 24, 92, 75, 27, 28, /* 220 */ 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - /* 230 */ 39, 90, 149, 42, 43, 44, 106, 107, 108, 109, + /* 230 */ 39, 135, 136, 42, 43, 44, 106, 107, 108, 109, /* 240 */ 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - /* 250 */ 120, 286, 50, 51, 52, 53, 54, 55, 56, 57, - /* 260 */ 58, 59, 60, 61, 62, 63, 64, 128, 66, 75, - /* 270 */ 129, 127, 90, 208, 209, 49, 74, 234, 235, 236, - /* 280 */ 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - /* 290 */ 247, 248, 66, 260, 1, 2, 1, 218, 5, 250, - /* 300 */ 7, 75, 9, 153, 9, 123, 124, 81, 82, 83, - /* 310 */ 84, 278, 162, 163, 75, 89, 90, 33, 34, 35, - /* 320 */ 36, 37, 38, 39, 218, 260, 42, 43, 44, 214, - /* 330 */ 215, 38, 39, 254, 106, 42, 108, 109, 260, 111, - /* 340 */ 47, 113, 281, 278, 289, 117, 291, 119, 120, 155, - /* 350 */ 250, 157, 291, 159, 160, 129, 278, 251, 252, 253, - /* 360 */ 254, 29, 30, 31, 32, 33, 34, 35, 36, 37, - /* 370 */ 38, 39, 135, 136, 42, 43, 44, 210, 152, 2, - /* 380 */ 154, 210, 5, 90, 7, 90, 9, 161, 221, 1, - /* 390 */ 2, 165, 221, 5, 155, 7, 157, 9, 159, 160, - /* 400 */ 67, 68, 69, 210, 281, 70, 71, 72, 73, 76, - /* 410 */ 77, 78, 79, 80, 291, 38, 39, 25, 281, 126, - /* 420 */ 127, 128, 5, 217, 7, 85, 38, 39, 291, 96, - /* 430 */ 218, 217, 217, 281, 234, 47, 236, 237, 98, 239, - /* 440 */ 48, 241, 256, 291, 151, 245, 250, 247, 248, 263, - /* 450 */ 67, 68, 69, 288, 289, 262, 291, 65, 250, 76, - /* 460 */ 281, 78, 79, 80, 252, 210, 210, 210, 38, 39, - /* 470 */ 291, 88, 42, 43, 44, 210, 210, 210, 90, 67, - /* 480 */ 68, 69, 90, 250, 281, 210, 210, 281, 76, 77, - /* 490 */ 78, 79, 80, 250, 291, 281, 281, 291, 210, 293, - /* 500 */ 67, 68, 69, 126, 127, 291, 291, 293, 293, 42, - /* 510 */ 255, 255, 255, 250, 126, 127, 128, 262, 262, 262, - /* 520 */ 255, 255, 255, 85, 86, 87, 281, 262, 262, 262, - /* 530 */ 255, 255, 281, 216, 281, 210, 291, 262, 262, 151, - /* 540 */ 223, 281, 291, 255, 291, 128, 221, 219, 220, 281, - /* 550 */ 262, 291, 83, 281, 281, 281, 91, 16, 281, 291, - /* 560 */ 281, 281, 281, 291, 291, 291, 281, 281, 291, 105, - /* 570 */ 291, 291, 291, 281, 91, 105, 291, 291, 281, 289, - /* 580 */ 281, 291, 281, 291, 281, 264, 216, 91, 291, 216, - /* 590 */ 291, 91, 291, 223, 291, 130, 223, 133, 48, 132, - /* 600 */ 279, 105, 38, 39, 91, 105, 91, 91, 91, 91, - /* 610 */ 91, 91, 143, 130, 91, 65, 87, 147, 105, 90, - /* 620 */ 105, 105, 105, 105, 105, 105, 91, 25, 105, 1, - /* 630 */ 91, 156, 156, 158, 158, 156, 5, 158, 7, 5, - /* 640 */ 105, 7, 38, 39, 105, 156, 156, 158, 158, 90, - /* 650 */ 48, 156, 258, 158, 210, 210, 210, 210, 210, 210, - /* 660 */ 280, 210, 210, 210, 260, 260, 210, 126, 210, 210, - /* 670 */ 42, 210, 290, 265, 290, 290, 290, 266, 260, 65, - /* 680 */ 212, 122, 210, 210, 210, 92, 285, 210, 210, 128, - /* 690 */ 210, 210, 210, 277, 210, 210, 210, 210, 210, 285, - /* 700 */ 285, 210, 210, 210, 210, 150, 285, 210, 210, 210, - /* 710 */ 148, 210, 210, 210, 210, 210, 210, 210, 210, 210, - /* 720 */ 210, 210, 210, 146, 210, 141, 276, 145, 273, 275, - /* 730 */ 144, 210, 210, 139, 210, 210, 210, 210, 210, 138, - /* 740 */ 210, 210, 210, 210, 210, 274, 210, 210, 210, 137, - /* 750 */ 210, 140, 210, 210, 210, 210, 210, 210, 210, 210, - /* 760 */ 134, 210, 125, 97, 121, 213, 212, 104, 212, 212, - /* 770 */ 212, 103, 212, 56, 100, 102, 60, 101, 99, 133, - /* 780 */ 5, 212, 212, 164, 212, 5, 5, 164, 5, 5, - /* 790 */ 212, 108, 212, 107, 218, 222, 222, 218, 153, 130, - /* 800 */ 87, 90, 131, 91, 90, 105, 105, 105, 212, 212, - /* 810 */ 212, 224, 231, 230, 229, 225, 228, 226, 213, 227, - /* 820 */ 213, 213, 212, 214, 249, 272, 213, 259, 233, 212, - /* 830 */ 212, 91, 128, 267, 271, 270, 269, 266, 249, 219, - /* 840 */ 5, 5, 90, 128, 91, 90, 105, 91, 90, 1, - /* 850 */ 91, 90, 105, 91, 90, 90, 48, 1, 87, 105, - /* 860 */ 142, 142, 94, 90, 90, 123, 90, 95, 77, 87, - /* 870 */ 85, 94, 5, 95, 9, 5, 5, 5, 5, 5, - /* 880 */ 94, 5, 93, 85, 16, 90, 9, 9, 91, 9, - /* 890 */ 91, 9, 126, 90, 28, 64, 17, 158, 105, 5, - /* 900 */ 17, 158, 158, 158, 5, 91, 5, 128, 5, 5, - /* 910 */ 5, 5, 5, 5, 5, 128, 5, 5, 5, 5, - /* 920 */ 5, 5, 5, 5, 105, 93, 73, 65, 9, 9, - /* 930 */ 0, 294, 22, 294, 294, 294, 294, 294, 294, 294, - /* 940 */ 294, 294, 294, 22, 294, 294, 294, 294, 294, 294, - /* 950 */ 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, - /* 960 */ 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, - /* 970 */ 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, - /* 980 */ 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, - /* 990 */ 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, - /* 1000 */ 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, - /* 1010 */ 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, - /* 1020 */ 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, - /* 1030 */ 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, - /* 1040 */ 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, - /* 1050 */ 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, - /* 1060 */ 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, - /* 1070 */ 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, - /* 1080 */ 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, - /* 1090 */ 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, - /* 1100 */ 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, - /* 1110 */ 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, - /* 1120 */ 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, - /* 1130 */ 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, - /* 1140 */ 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, - /* 1150 */ 294, + /* 250 */ 120, 259, 50, 51, 52, 53, 54, 55, 56, 57, + /* 260 */ 58, 59, 60, 61, 62, 63, 64, 128, 66, 277, + /* 270 */ 217, 127, 218, 219, 207, 208, 74, 233, 234, 235, + /* 280 */ 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + /* 290 */ 246, 247, 1, 2, 85, 249, 5, 155, 7, 157, + /* 300 */ 9, 159, 160, 250, 251, 252, 253, 98, 49, 29, + /* 310 */ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + /* 320 */ 1, 249, 42, 43, 44, 66, 259, 249, 9, 38, + /* 330 */ 39, 216, 2, 42, 75, 5, 153, 7, 47, 9, + /* 340 */ 81, 82, 83, 84, 277, 162, 163, 209, 89, 90, + /* 350 */ 33, 34, 35, 36, 37, 38, 39, 280, 249, 42, + /* 360 */ 43, 44, 249, 217, 67, 68, 69, 290, 38, 39, + /* 370 */ 85, 86, 87, 76, 77, 78, 79, 80, 257, 38, + /* 380 */ 39, 90, 91, 42, 43, 44, 209, 75, 129, 217, + /* 390 */ 1, 2, 254, 96, 5, 280, 7, 251, 9, 261, + /* 400 */ 280, 233, 209, 235, 236, 290, 238, 292, 240, 90, + /* 410 */ 290, 152, 244, 154, 246, 247, 216, 126, 127, 128, + /* 420 */ 161, 5, 216, 7, 165, 253, 209, 38, 39, 209, + /* 430 */ 106, 254, 108, 109, 83, 111, 47, 113, 261, 209, + /* 440 */ 220, 117, 151, 119, 120, 25, 249, 254, 209, 67, + /* 450 */ 68, 69, 209, 280, 261, 90, 126, 127, 76, 220, + /* 460 */ 78, 79, 80, 290, 67, 68, 69, 155, 48, 157, + /* 470 */ 88, 159, 160, 76, 77, 78, 79, 80, 209, 90, + /* 480 */ 280, 209, 209, 90, 254, 65, 280, 209, 123, 124, + /* 490 */ 290, 261, 292, 209, 143, 209, 290, 254, 292, 70, + /* 500 */ 71, 72, 73, 48, 261, 287, 288, 42, 290, 280, + /* 510 */ 90, 67, 68, 69, 280, 126, 127, 128, 280, 290, + /* 520 */ 65, 280, 129, 254, 290, 280, 254, 280, 290, 16, + /* 530 */ 261, 290, 254, 261, 209, 290, 280, 290, 254, 261, + /* 540 */ 151, 280, 280, 280, 128, 261, 290, 280, 280, 209, + /* 550 */ 279, 290, 290, 290, 209, 280, 280, 290, 290, 280, + /* 560 */ 220, 280, 280, 280, 263, 290, 290, 280, 280, 290, + /* 570 */ 280, 290, 290, 290, 280, 255, 255, 290, 290, 278, + /* 580 */ 290, 215, 262, 262, 290, 259, 261, 288, 222, 290, + /* 590 */ 288, 215, 290, 215, 213, 214, 105, 132, 222, 91, + /* 600 */ 222, 91, 91, 277, 38, 39, 91, 91, 91, 105, + /* 610 */ 105, 91, 91, 105, 91, 91, 91, 1, 91, 91, + /* 620 */ 105, 105, 105, 25, 133, 105, 105, 209, 105, 105, + /* 630 */ 105, 87, 105, 105, 90, 156, 91, 158, 90, 126, + /* 640 */ 130, 130, 156, 156, 158, 158, 48, 5, 209, 7, + /* 650 */ 105, 209, 147, 149, 156, 5, 158, 7, 42, 38, + /* 660 */ 39, 209, 156, 156, 158, 158, 209, 259, 259, 209, + /* 670 */ 122, 209, 209, 209, 289, 289, 289, 289, 264, 209, + /* 680 */ 259, 209, 209, 209, 209, 209, 209, 209, 265, 209, + /* 690 */ 209, 209, 209, 209, 209, 65, 92, 209, 209, 209, + /* 700 */ 128, 209, 209, 209, 209, 209, 209, 150, 209, 209, + /* 710 */ 209, 209, 209, 146, 284, 284, 284, 284, 209, 276, + /* 720 */ 275, 209, 148, 209, 141, 274, 145, 209, 209, 273, + /* 730 */ 144, 209, 139, 272, 138, 209, 137, 271, 209, 209, + /* 740 */ 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, + /* 750 */ 209, 209, 209, 140, 134, 209, 209, 125, 209, 209, + /* 760 */ 209, 209, 209, 209, 97, 121, 211, 104, 212, 211, + /* 770 */ 211, 211, 211, 211, 103, 56, 100, 102, 60, 101, + /* 780 */ 99, 211, 133, 5, 211, 5, 211, 5, 164, 5, + /* 790 */ 5, 211, 164, 108, 107, 217, 211, 221, 221, 217, + /* 800 */ 153, 87, 130, 90, 131, 90, 211, 91, 105, 105, + /* 810 */ 105, 91, 224, 211, 230, 225, 229, 228, 227, 212, + /* 820 */ 226, 212, 211, 223, 212, 211, 258, 248, 211, 232, + /* 830 */ 212, 5, 268, 270, 269, 266, 265, 211, 213, 128, + /* 840 */ 248, 218, 5, 90, 90, 128, 91, 91, 90, 105, + /* 850 */ 91, 90, 1, 91, 90, 90, 105, 48, 1, 90, + /* 860 */ 94, 90, 105, 142, 142, 90, 87, 95, 123, 77, + /* 870 */ 87, 85, 5, 9, 5, 94, 5, 5, 5, 5, + /* 880 */ 5, 93, 95, 94, 16, 85, 9, 9, 90, 9, + /* 890 */ 91, 9, 91, 126, 90, 64, 17, 158, 28, 158, + /* 900 */ 105, 128, 128, 17, 158, 158, 5, 5, 91, 5, + /* 910 */ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + /* 920 */ 5, 5, 5, 5, 5, 105, 93, 73, 65, 9, + /* 930 */ 0, 9, 293, 293, 293, 293, 293, 293, 293, 293, + /* 940 */ 293, 293, 293, 22, 293, 22, 293, 293, 293, 293, + /* 950 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 960 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 970 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 980 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 990 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 1000 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 1010 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 1020 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 1030 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 1040 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 1050 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 1060 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 1070 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 1080 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 1090 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 1100 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 1110 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 1120 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 1130 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 1140 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 1150 */ 293, 293, 293, }; #define YY_SHIFT_COUNT (417) #define YY_SHIFT_MIN (0) #define YY_SHIFT_MAX (930) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 226, 130, 130, 228, 228, 1, 293, 388, 388, 388, - /* 10 */ 295, 7, 7, 7, 7, 7, 7, 7, 7, 7, - /* 20 */ 7, 7, 10, 10, 0, 202, 388, 388, 388, 388, - /* 30 */ 388, 388, 388, 388, 388, 388, 388, 388, 388, 388, - /* 40 */ 388, 388, 388, 388, 388, 388, 388, 388, 388, 388, - /* 50 */ 388, 388, 388, 388, 377, 377, 377, 141, 141, 237, - /* 60 */ 7, 124, 7, 7, 7, 7, 7, 340, 1, 10, - /* 70 */ 10, 11, 11, 35, 944, 944, 944, 377, 377, 377, - /* 80 */ 144, 144, 135, 135, 135, 135, 135, 135, 182, 135, - /* 90 */ 7, 7, 7, 7, 7, 7, 467, 7, 7, 7, - /* 100 */ 141, 141, 7, 7, 7, 7, 469, 469, 469, 469, - /* 110 */ 464, 141, 7, 7, 7, 7, 7, 7, 7, 7, + /* 0 */ 259, 130, 130, 324, 324, 1, 291, 389, 389, 389, + /* 10 */ 319, 7, 7, 7, 7, 7, 7, 7, 7, 7, + /* 20 */ 7, 7, 10, 10, 0, 202, 389, 389, 389, 389, + /* 30 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, + /* 40 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, + /* 50 */ 389, 389, 389, 389, 330, 330, 330, 393, 393, 96, + /* 60 */ 7, 124, 7, 7, 7, 7, 7, 209, 1, 10, + /* 70 */ 10, 11, 11, 35, 946, 946, 946, 330, 330, 330, + /* 80 */ 144, 144, 135, 135, 135, 135, 135, 135, 365, 135, + /* 90 */ 7, 7, 7, 7, 7, 7, 465, 7, 7, 7, + /* 100 */ 393, 393, 7, 7, 7, 7, 351, 351, 351, 351, + /* 110 */ 491, 393, 7, 7, 7, 7, 7, 7, 7, 7, /* 120 */ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, /* 130 */ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, /* 140 */ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, /* 150 */ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, /* 160 */ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - /* 170 */ 555, 614, 593, 614, 614, 614, 614, 561, 561, 561, - /* 180 */ 561, 614, 577, 562, 584, 582, 586, 594, 601, 612, - /* 190 */ 611, 626, 555, 637, 614, 614, 614, 666, 666, 643, - /* 200 */ 1, 1, 614, 614, 663, 668, 717, 674, 673, 716, - /* 210 */ 676, 679, 643, 35, 614, 614, 593, 593, 614, 593, - /* 220 */ 614, 593, 614, 614, 944, 944, 31, 68, 99, 99, - /* 230 */ 99, 133, 163, 191, 332, 332, 332, 332, 332, 332, - /* 240 */ 284, 284, 284, 284, 333, 383, 412, 430, 430, 430, - /* 250 */ 430, 430, 194, 239, 392, 335, 150, 37, 37, 139, - /* 260 */ 417, 438, 433, 496, 465, 483, 564, 500, 513, 515, - /* 270 */ 550, 83, 470, 516, 517, 518, 519, 520, 529, 523, - /* 280 */ 535, 602, 628, 541, 539, 475, 476, 479, 631, 634, - /* 290 */ 604, 489, 490, 559, 495, 646, 775, 619, 780, 781, - /* 300 */ 623, 783, 784, 683, 686, 645, 669, 713, 711, 671, - /* 310 */ 712, 714, 700, 701, 740, 702, 704, 715, 835, 836, - /* 320 */ 752, 753, 755, 756, 758, 759, 741, 761, 762, 764, - /* 330 */ 848, 765, 747, 718, 808, 856, 754, 719, 768, 773, - /* 340 */ 713, 774, 771, 776, 742, 782, 785, 772, 777, 791, - /* 350 */ 867, 778, 786, 865, 870, 871, 872, 873, 874, 876, - /* 360 */ 789, 868, 798, 877, 878, 795, 797, 799, 880, 882, - /* 370 */ 766, 803, 866, 831, 879, 739, 743, 793, 793, 793, - /* 380 */ 793, 779, 787, 883, 744, 745, 793, 793, 793, 894, - /* 390 */ 899, 814, 793, 901, 903, 904, 905, 906, 907, 908, - /* 400 */ 909, 911, 912, 913, 914, 915, 916, 917, 918, 819, - /* 410 */ 832, 853, 919, 910, 920, 921, 862, 930, + /* 170 */ 557, 630, 604, 630, 630, 630, 630, 572, 572, 572, + /* 180 */ 572, 630, 567, 574, 583, 581, 586, 593, 596, 599, + /* 190 */ 613, 620, 557, 632, 630, 630, 630, 667, 667, 644, + /* 200 */ 1, 1, 630, 630, 663, 671, 719, 676, 675, 718, + /* 210 */ 678, 681, 644, 35, 630, 630, 604, 604, 630, 604, + /* 220 */ 630, 604, 630, 630, 946, 946, 31, 68, 99, 99, + /* 230 */ 99, 133, 163, 191, 280, 280, 280, 280, 280, 280, + /* 240 */ 317, 317, 317, 317, 297, 382, 397, 341, 341, 341, + /* 250 */ 341, 341, 142, 312, 420, 429, 183, 37, 37, 139, + /* 260 */ 416, 285, 444, 508, 510, 511, 566, 515, 516, 517, + /* 270 */ 455, 504, 505, 520, 521, 523, 524, 525, 544, 527, + /* 280 */ 528, 598, 616, 513, 545, 479, 486, 487, 642, 650, + /* 290 */ 621, 498, 506, 548, 507, 649, 778, 624, 780, 782, + /* 300 */ 628, 784, 785, 685, 687, 647, 672, 714, 713, 673, + /* 310 */ 716, 715, 703, 704, 720, 705, 711, 717, 826, 837, + /* 320 */ 753, 755, 754, 756, 758, 759, 744, 761, 762, 764, + /* 330 */ 851, 765, 751, 721, 809, 857, 757, 722, 766, 769, + /* 340 */ 714, 771, 779, 775, 745, 783, 786, 772, 781, 792, + /* 350 */ 867, 787, 789, 864, 869, 871, 872, 873, 874, 875, + /* 360 */ 788, 868, 800, 877, 878, 798, 799, 801, 880, 882, + /* 370 */ 767, 804, 870, 831, 879, 739, 741, 795, 795, 795, + /* 380 */ 795, 773, 774, 886, 746, 747, 795, 795, 795, 901, + /* 390 */ 902, 817, 795, 904, 905, 906, 907, 908, 909, 910, + /* 400 */ 911, 912, 913, 914, 915, 916, 917, 918, 919, 820, + /* 410 */ 833, 854, 920, 921, 922, 923, 863, 930, }; #define YY_REDUCE_COUNT (225) -#define YY_REDUCE_MIN (-285) -#define YY_REDUCE_MAX (620) +#define YY_REDUCE_MIN (-284) +#define YY_REDUCE_MAX (626) static const short yy_reduce_ofst[] = { - /* 0 */ 65, 43, 43, 200, 200, 106, 206, 214, 215, -281, - /* 10 */ -207, -205, -184, 255, 256, 257, 265, 266, 267, 275, - /* 20 */ 276, 288, -285, 165, -163, -191, -240, -173, -102, 61, - /* 30 */ 123, 137, 152, 179, 203, 245, 251, 253, 260, 268, - /* 40 */ 272, 273, 274, 277, 279, 280, 281, 285, 286, 292, - /* 50 */ 297, 299, 301, 303, -111, -46, 186, 33, 78, -129, - /* 60 */ -185, 79, -208, 167, 171, 325, 193, 317, 212, 55, - /* 70 */ 290, 370, 373, -145, 321, 328, 115, -179, -148, -59, - /* 80 */ -230, -35, 49, 100, 196, 208, 233, 243, 394, 263, - /* 90 */ 444, 445, 446, 447, 448, 449, 380, 451, 452, 453, - /* 100 */ 404, 405, 456, 458, 459, 461, 382, 384, 385, 386, - /* 110 */ 408, 418, 472, 473, 474, 477, 478, 480, 481, 482, - /* 120 */ 484, 485, 486, 487, 488, 491, 492, 493, 494, 497, - /* 130 */ 498, 499, 501, 502, 503, 504, 505, 506, 507, 508, - /* 140 */ 509, 510, 511, 512, 514, 521, 522, 524, 525, 526, - /* 150 */ 527, 528, 530, 531, 532, 533, 534, 536, 537, 538, - /* 160 */ 540, 542, 543, 544, 545, 546, 547, 548, 549, 551, - /* 170 */ 411, 468, 552, 554, 556, 557, 558, 401, 414, 415, - /* 180 */ 421, 560, 416, 450, 454, 471, 455, 553, 563, 565, - /* 190 */ 567, 566, 571, 568, 569, 570, 572, 573, 574, 575, - /* 200 */ 576, 579, 578, 580, 581, 583, 585, 590, 588, 591, - /* 210 */ 592, 587, 589, 595, 596, 597, 605, 607, 598, 608, - /* 220 */ 610, 613, 617, 618, 620, 609, + /* 0 */ 67, 44, 44, 168, 168, 53, 115, 200, 206, -280, + /* 10 */ -206, -204, -183, 138, 177, 193, 230, 243, 269, 272, + /* 20 */ 278, 284, -284, 218, -162, -190, -239, -172, -101, 77, + /* 30 */ 120, 173, 229, 234, 238, 241, 245, 247, 256, 261, + /* 40 */ 262, 263, 267, 268, 275, 276, 279, 281, 282, 283, + /* 50 */ 287, 288, 290, 294, -110, 320, 321, -8, 326, -128, + /* 60 */ -184, 172, -207, 220, 239, 340, 325, 366, 146, 299, + /* 70 */ 302, 376, 378, -144, 301, 54, 381, -178, -147, -74, + /* 80 */ -229, -81, -39, 46, 72, 78, 109, 113, 121, 197, + /* 90 */ 217, 273, 286, 345, 418, 439, 271, 442, 452, 457, + /* 100 */ 408, 409, 460, 462, 463, 464, 385, 386, 387, 388, + /* 110 */ 414, 421, 470, 472, 473, 474, 475, 476, 477, 478, + /* 120 */ 480, 481, 482, 483, 484, 485, 488, 489, 490, 492, + /* 130 */ 493, 494, 495, 496, 497, 499, 500, 501, 502, 503, + /* 140 */ 509, 512, 514, 518, 519, 522, 526, 529, 530, 531, + /* 150 */ 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + /* 160 */ 542, 543, 546, 547, 549, 550, 551, 552, 553, 554, + /* 170 */ 423, 555, 556, 558, 559, 560, 561, 430, 431, 432, + /* 180 */ 433, 562, 443, 445, 451, 456, 461, 466, 563, 565, + /* 190 */ 564, 569, 571, 568, 570, 573, 575, 576, 577, 579, + /* 200 */ 578, 582, 580, 585, 584, 587, 589, 588, 591, 590, + /* 210 */ 594, 600, 592, 597, 595, 602, 607, 609, 611, 612, + /* 220 */ 614, 618, 617, 626, 623, 625, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 983, 1110, 1048, 1121, 1035, 1045, 1295, 1295, 1295, 1295, - /* 10 */ 983, 983, 983, 983, 983, 983, 983, 983, 983, 983, - /* 20 */ 983, 983, 983, 983, 1175, 1003, 983, 983, 983, 983, - /* 30 */ 983, 983, 983, 983, 983, 983, 983, 983, 983, 983, - /* 40 */ 983, 983, 983, 983, 983, 983, 983, 983, 983, 983, - /* 50 */ 983, 983, 983, 983, 983, 983, 983, 983, 983, 1199, - /* 60 */ 983, 1045, 983, 983, 983, 983, 983, 1056, 1045, 983, - /* 70 */ 983, 1056, 1056, 983, 1170, 1094, 1112, 983, 983, 983, - /* 80 */ 983, 983, 983, 983, 983, 983, 983, 983, 1142, 983, - /* 90 */ 983, 983, 983, 983, 983, 983, 1177, 1183, 1180, 983, - /* 100 */ 983, 983, 1185, 983, 983, 983, 1221, 1221, 1221, 1221, - /* 110 */ 1168, 983, 983, 983, 983, 983, 983, 983, 983, 983, - /* 120 */ 983, 983, 983, 983, 983, 983, 983, 983, 983, 983, - /* 130 */ 983, 983, 983, 983, 983, 983, 983, 983, 983, 983, - /* 140 */ 983, 983, 983, 983, 983, 1033, 983, 1031, 983, 983, - /* 150 */ 983, 983, 983, 983, 983, 983, 983, 983, 983, 983, - /* 160 */ 983, 983, 983, 983, 983, 983, 983, 983, 983, 1001, - /* 170 */ 1238, 1005, 1043, 1005, 1005, 1005, 1005, 983, 983, 983, - /* 180 */ 983, 1005, 1230, 1234, 1211, 1228, 1222, 1206, 1204, 1202, - /* 190 */ 1210, 1195, 1238, 1144, 1005, 1005, 1005, 1054, 1054, 1049, - /* 200 */ 1045, 1045, 1005, 1005, 1072, 1070, 1068, 1060, 1066, 1062, - /* 210 */ 1064, 1058, 1036, 983, 1005, 1005, 1043, 1043, 1005, 1043, - /* 220 */ 1005, 1043, 1005, 1005, 1094, 1112, 1294, 983, 1239, 1229, - /* 230 */ 1294, 983, 1271, 1270, 1285, 1284, 1283, 1269, 1268, 1267, - /* 240 */ 1263, 1266, 1265, 1264, 983, 983, 983, 1282, 1281, 1279, - /* 250 */ 1278, 1277, 983, 983, 1241, 983, 983, 1273, 1272, 983, - /* 260 */ 983, 983, 983, 983, 983, 983, 1192, 983, 983, 983, - /* 270 */ 1217, 1235, 1231, 983, 983, 983, 983, 983, 983, 983, - /* 280 */ 983, 1242, 983, 983, 983, 983, 983, 983, 983, 983, - /* 290 */ 1156, 983, 983, 1123, 983, 983, 983, 983, 983, 983, - /* 300 */ 983, 983, 983, 983, 983, 983, 1167, 983, 983, 983, - /* 310 */ 983, 983, 1179, 1178, 983, 983, 983, 983, 983, 983, - /* 320 */ 983, 983, 983, 983, 983, 983, 983, 983, 983, 983, - /* 330 */ 983, 983, 1223, 983, 1218, 983, 1212, 983, 983, 983, - /* 340 */ 1135, 983, 983, 983, 983, 1052, 983, 983, 983, 983, - /* 350 */ 983, 983, 983, 983, 983, 983, 983, 983, 983, 983, - /* 360 */ 983, 983, 983, 983, 983, 983, 983, 983, 983, 983, - /* 370 */ 983, 983, 983, 983, 983, 983, 983, 1313, 1308, 1309, - /* 380 */ 1306, 983, 983, 983, 983, 983, 1305, 1300, 1301, 983, - /* 390 */ 983, 983, 1298, 983, 983, 983, 983, 983, 983, 983, - /* 400 */ 983, 983, 983, 983, 983, 983, 983, 983, 983, 1078, - /* 410 */ 983, 983, 983, 1012, 983, 1010, 983, 983, + /* 0 */ 984, 1111, 1049, 1122, 1036, 1046, 984, 984, 984, 984, + /* 10 */ 984, 984, 984, 984, 984, 984, 984, 984, 984, 984, + /* 20 */ 984, 984, 984, 984, 1176, 1004, 984, 984, 984, 984, + /* 30 */ 984, 984, 984, 984, 984, 984, 984, 984, 984, 984, + /* 40 */ 984, 984, 984, 984, 984, 984, 984, 984, 984, 984, + /* 50 */ 984, 984, 984, 984, 984, 984, 984, 984, 984, 1200, + /* 60 */ 984, 1046, 984, 984, 984, 984, 984, 1057, 1046, 984, + /* 70 */ 984, 1057, 1057, 984, 1171, 1095, 1113, 984, 984, 984, + /* 80 */ 984, 984, 984, 984, 984, 984, 984, 984, 1143, 984, + /* 90 */ 984, 984, 984, 984, 984, 984, 1178, 1184, 1181, 984, + /* 100 */ 984, 984, 1186, 984, 984, 984, 1222, 1222, 1222, 1222, + /* 110 */ 1169, 984, 984, 984, 984, 984, 984, 984, 984, 984, + /* 120 */ 984, 984, 984, 984, 984, 984, 984, 984, 984, 984, + /* 130 */ 984, 984, 984, 984, 984, 984, 984, 984, 984, 984, + /* 140 */ 984, 984, 984, 984, 984, 1034, 984, 1032, 984, 984, + /* 150 */ 984, 984, 984, 984, 984, 984, 984, 984, 984, 984, + /* 160 */ 984, 984, 984, 984, 984, 984, 984, 984, 984, 1002, + /* 170 */ 1239, 1006, 1044, 1006, 1006, 1006, 1006, 984, 984, 984, + /* 180 */ 984, 1006, 1231, 1235, 1212, 1229, 1223, 1207, 1205, 1203, + /* 190 */ 1211, 1196, 1239, 1145, 1006, 1006, 1006, 1055, 1055, 1050, + /* 200 */ 1046, 1046, 1006, 1006, 1073, 1071, 1069, 1061, 1067, 1063, + /* 210 */ 1065, 1059, 1037, 984, 1006, 1006, 1044, 1044, 1006, 1044, + /* 220 */ 1006, 1044, 1006, 1006, 1095, 1113, 1296, 984, 1240, 1230, + /* 230 */ 1296, 984, 1273, 1272, 1287, 1286, 1285, 1271, 1270, 1269, + /* 240 */ 1265, 1268, 1267, 1266, 984, 984, 984, 1284, 1283, 1281, + /* 250 */ 1280, 1279, 984, 984, 1242, 984, 984, 1275, 1274, 984, + /* 260 */ 984, 984, 984, 984, 984, 984, 1193, 984, 984, 984, + /* 270 */ 1218, 1236, 1232, 984, 984, 984, 984, 984, 984, 984, + /* 280 */ 984, 1243, 984, 984, 984, 984, 984, 984, 984, 984, + /* 290 */ 1157, 984, 984, 1124, 984, 984, 984, 984, 984, 984, + /* 300 */ 984, 984, 984, 984, 984, 984, 1168, 984, 984, 984, + /* 310 */ 984, 984, 1180, 1179, 984, 984, 984, 984, 984, 984, + /* 320 */ 984, 984, 984, 984, 984, 984, 984, 984, 984, 984, + /* 330 */ 984, 984, 1224, 984, 1219, 984, 1213, 984, 984, 984, + /* 340 */ 1136, 984, 984, 984, 984, 1053, 984, 984, 984, 984, + /* 350 */ 984, 984, 984, 984, 984, 984, 984, 984, 984, 984, + /* 360 */ 984, 984, 984, 984, 984, 984, 984, 984, 984, 984, + /* 370 */ 984, 984, 984, 984, 984, 984, 984, 1314, 1309, 1310, + /* 380 */ 1307, 984, 984, 984, 984, 984, 1306, 1301, 1302, 984, + /* 390 */ 984, 984, 1299, 984, 984, 984, 984, 984, 984, 984, + /* 400 */ 984, 984, 984, 984, 984, 984, 984, 984, 984, 1079, + /* 410 */ 984, 984, 984, 1013, 984, 1011, 984, 984, }; /********** End of lemon-generated parsing tables *****************************/ @@ -805,6 +815,7 @@ 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 */ #if YYSTACKDEPTH<=0 int yystksz; /* Current side of the stack */ yyStackEntry *yystack; /* The parser's stack */ @@ -1059,93 +1070,92 @@ static const char *const yyTokenName[] = { /* 204 */ "INTO", /* 205 */ "VALUES", /* 206 */ "FILE", - /* 207 */ "error", - /* 208 */ "program", - /* 209 */ "cmd", - /* 210 */ "ids", - /* 211 */ "dbPrefix", - /* 212 */ "cpxName", - /* 213 */ "ifexists", - /* 214 */ "alter_db_optr", - /* 215 */ "alter_topic_optr", - /* 216 */ "acct_optr", - /* 217 */ "exprlist", - /* 218 */ "ifnotexists", - /* 219 */ "db_optr", - /* 220 */ "topic_optr", - /* 221 */ "typename", - /* 222 */ "bufsize", - /* 223 */ "pps", - /* 224 */ "tseries", - /* 225 */ "dbs", - /* 226 */ "streams", - /* 227 */ "storage", - /* 228 */ "qtime", - /* 229 */ "users", - /* 230 */ "conns", - /* 231 */ "state", - /* 232 */ "intitemlist", - /* 233 */ "intitem", - /* 234 */ "keep", - /* 235 */ "cache", - /* 236 */ "replica", - /* 237 */ "quorum", - /* 238 */ "days", - /* 239 */ "minrows", - /* 240 */ "maxrows", - /* 241 */ "blocks", - /* 242 */ "ctime", - /* 243 */ "wal", - /* 244 */ "fsync", - /* 245 */ "comp", - /* 246 */ "prec", - /* 247 */ "update", - /* 248 */ "cachelast", - /* 249 */ "partitions", - /* 250 */ "signed", - /* 251 */ "create_table_args", - /* 252 */ "create_stable_args", - /* 253 */ "create_table_list", - /* 254 */ "create_from_stable", - /* 255 */ "columnlist", - /* 256 */ "tagitemlist", - /* 257 */ "tagNamelist", - /* 258 */ "to_opt", - /* 259 */ "split_opt", - /* 260 */ "select", - /* 261 */ "to_split", - /* 262 */ "column", - /* 263 */ "tagitem", - /* 264 */ "selcollist", - /* 265 */ "from", - /* 266 */ "where_opt", - /* 267 */ "range_option", - /* 268 */ "interval_option", - /* 269 */ "sliding_opt", - /* 270 */ "session_option", - /* 271 */ "windowstate_option", - /* 272 */ "fill_opt", - /* 273 */ "groupby_opt", - /* 274 */ "having_opt", - /* 275 */ "orderby_opt", - /* 276 */ "slimit_opt", - /* 277 */ "limit_opt", - /* 278 */ "union", - /* 279 */ "sclp", - /* 280 */ "distinct", - /* 281 */ "expr", - /* 282 */ "as", - /* 283 */ "tablelist", - /* 284 */ "sub", - /* 285 */ "tmvar", - /* 286 */ "timestamp", - /* 287 */ "intervalKey", - /* 288 */ "sortlist", - /* 289 */ "item", - /* 290 */ "sortorder", - /* 291 */ "arrow", - /* 292 */ "grouplist", - /* 293 */ "expritem", + /* 207 */ "program", + /* 208 */ "cmd", + /* 209 */ "ids", + /* 210 */ "dbPrefix", + /* 211 */ "cpxName", + /* 212 */ "ifexists", + /* 213 */ "alter_db_optr", + /* 214 */ "alter_topic_optr", + /* 215 */ "acct_optr", + /* 216 */ "exprlist", + /* 217 */ "ifnotexists", + /* 218 */ "db_optr", + /* 219 */ "topic_optr", + /* 220 */ "typename", + /* 221 */ "bufsize", + /* 222 */ "pps", + /* 223 */ "tseries", + /* 224 */ "dbs", + /* 225 */ "streams", + /* 226 */ "storage", + /* 227 */ "qtime", + /* 228 */ "users", + /* 229 */ "conns", + /* 230 */ "state", + /* 231 */ "intitemlist", + /* 232 */ "intitem", + /* 233 */ "keep", + /* 234 */ "cache", + /* 235 */ "replica", + /* 236 */ "quorum", + /* 237 */ "days", + /* 238 */ "minrows", + /* 239 */ "maxrows", + /* 240 */ "blocks", + /* 241 */ "ctime", + /* 242 */ "wal", + /* 243 */ "fsync", + /* 244 */ "comp", + /* 245 */ "prec", + /* 246 */ "update", + /* 247 */ "cachelast", + /* 248 */ "partitions", + /* 249 */ "signed", + /* 250 */ "create_table_args", + /* 251 */ "create_stable_args", + /* 252 */ "create_table_list", + /* 253 */ "create_from_stable", + /* 254 */ "columnlist", + /* 255 */ "tagitemlist", + /* 256 */ "tagNamelist", + /* 257 */ "to_opt", + /* 258 */ "split_opt", + /* 259 */ "select", + /* 260 */ "to_split", + /* 261 */ "column", + /* 262 */ "tagitem", + /* 263 */ "selcollist", + /* 264 */ "from", + /* 265 */ "where_opt", + /* 266 */ "range_option", + /* 267 */ "interval_option", + /* 268 */ "sliding_opt", + /* 269 */ "session_option", + /* 270 */ "windowstate_option", + /* 271 */ "fill_opt", + /* 272 */ "groupby_opt", + /* 273 */ "having_opt", + /* 274 */ "orderby_opt", + /* 275 */ "slimit_opt", + /* 276 */ "limit_opt", + /* 277 */ "union", + /* 278 */ "sclp", + /* 279 */ "distinct", + /* 280 */ "expr", + /* 281 */ "as", + /* 282 */ "tablelist", + /* 283 */ "sub", + /* 284 */ "tmvar", + /* 285 */ "timestamp", + /* 286 */ "intervalKey", + /* 287 */ "sortlist", + /* 288 */ "item", + /* 289 */ "sortorder", + /* 290 */ "arrow", + /* 291 */ "grouplist", + /* 292 */ "expritem", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -1427,42 +1437,42 @@ static const char *const yyRuleName[] = { /* 271 */ "expr ::= NULL", /* 272 */ "expr ::= ID LP exprlist RP", /* 273 */ "expr ::= ID LP STAR RP", - /* 274 */ "expr ::= ID LP expr AS typename RP", - /* 275 */ "expr ::= expr IS NULL", - /* 276 */ "expr ::= expr IS NOT NULL", - /* 277 */ "expr ::= expr LT expr", - /* 278 */ "expr ::= expr GT expr", - /* 279 */ "expr ::= expr LE expr", - /* 280 */ "expr ::= expr GE expr", - /* 281 */ "expr ::= expr NE expr", - /* 282 */ "expr ::= expr EQ expr", - /* 283 */ "expr ::= expr BETWEEN expr AND expr", - /* 284 */ "expr ::= expr AND expr", - /* 285 */ "expr ::= expr OR expr", - /* 286 */ "expr ::= expr PLUS expr", - /* 287 */ "expr ::= expr MINUS expr", - /* 288 */ "expr ::= expr STAR expr", - /* 289 */ "expr ::= expr SLASH expr", - /* 290 */ "expr ::= expr REM expr", - /* 291 */ "expr ::= expr BITAND expr", - /* 292 */ "expr ::= expr BITOR expr", - /* 293 */ "expr ::= expr BITXOR expr", - /* 294 */ "expr ::= BITNOT expr", - /* 295 */ "expr ::= expr LSHIFT expr", - /* 296 */ "expr ::= expr RSHIFT expr", - /* 297 */ "expr ::= expr LIKE expr", - /* 298 */ "expr ::= expr MATCH expr", - /* 299 */ "expr ::= expr NMATCH expr", - /* 300 */ "expr ::= ID CONTAINS STRING", - /* 301 */ "expr ::= ID DOT ID CONTAINS STRING", - /* 302 */ "arrow ::= ID ARROW STRING", - /* 303 */ "arrow ::= ID DOT ID ARROW STRING", - /* 304 */ "expr ::= arrow", - /* 305 */ "expr ::= expr IN LP exprlist RP", - /* 306 */ "exprlist ::= exprlist COMMA expritem", - /* 307 */ "exprlist ::= expritem", - /* 308 */ "expritem ::= expr", - /* 309 */ "expritem ::=", + /* 274 */ "expr ::= ID LP RP", + /* 275 */ "expr ::= ID LP expr AS typename RP", + /* 276 */ "expr ::= expr IS NULL", + /* 277 */ "expr ::= expr IS NOT NULL", + /* 278 */ "expr ::= expr LT expr", + /* 279 */ "expr ::= expr GT expr", + /* 280 */ "expr ::= expr LE expr", + /* 281 */ "expr ::= expr GE expr", + /* 282 */ "expr ::= expr NE expr", + /* 283 */ "expr ::= expr EQ expr", + /* 284 */ "expr ::= expr BETWEEN expr AND expr", + /* 285 */ "expr ::= expr AND expr", + /* 286 */ "expr ::= expr OR expr", + /* 287 */ "expr ::= expr PLUS expr", + /* 288 */ "expr ::= expr MINUS expr", + /* 289 */ "expr ::= expr STAR expr", + /* 290 */ "expr ::= expr SLASH expr", + /* 291 */ "expr ::= expr REM expr", + /* 292 */ "expr ::= expr BITAND expr", + /* 293 */ "expr ::= expr BITOR expr", + /* 294 */ "expr ::= expr BITXOR expr", + /* 295 */ "expr ::= BITNOT expr", + /* 296 */ "expr ::= expr LSHIFT expr", + /* 297 */ "expr ::= expr RSHIFT expr", + /* 298 */ "expr ::= expr LIKE expr", + /* 299 */ "expr ::= expr MATCH expr", + /* 300 */ "expr ::= expr NMATCH expr", + /* 301 */ "expr ::= ID CONTAINS STRING", + /* 302 */ "expr ::= ID DOT ID CONTAINS STRING", + /* 303 */ "arrow ::= ID ARROW STRING", + /* 304 */ "arrow ::= ID DOT ID ARROW STRING", + /* 305 */ "expr ::= arrow", + /* 306 */ "expr ::= expr IN LP exprlist RP", + /* 307 */ "exprlist ::= exprlist COMMA expritem", + /* 308 */ "exprlist ::= expritem", + /* 309 */ "expritem ::= expr", /* 310 */ "cmd ::= RESET QUERY CACHE", /* 311 */ "cmd ::= SYNCDB ids REPLICA", /* 312 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist", @@ -1533,28 +1543,29 @@ static int yyGrowStack(yyParser *p){ /* Initialize a new parser that has already been allocated. */ -void ParseInit(void *yypParser){ - yyParser *pParser = (yyParser*)yypParser; +void ParseInit(void *yypRawParser ParseCTX_PDECL){ + yyParser *yypParser = (yyParser*)yypRawParser; + ParseCTX_STORE #ifdef YYTRACKMAXSTACKDEPTH - pParser->yyhwm = 0; + yypParser->yyhwm = 0; #endif #if YYSTACKDEPTH<=0 - pParser->yytos = NULL; - pParser->yystack = NULL; - pParser->yystksz = 0; - if( yyGrowStack(pParser) ){ - pParser->yystack = &pParser->yystk0; - pParser->yystksz = 1; + yypParser->yytos = NULL; + yypParser->yystack = NULL; + yypParser->yystksz = 0; + if( yyGrowStack(yypParser) ){ + yypParser->yystack = &yypParser->yystk0; + yypParser->yystksz = 1; } #endif #ifndef YYNOERRORRECOVERY - pParser->yyerrcnt = -1; + yypParser->yyerrcnt = -1; #endif - pParser->yytos = pParser->yystack; - pParser->yystack[0].stateno = 0; - pParser->yystack[0].major = 0; + yypParser->yytos = yypParser->yystack; + yypParser->yystack[0].stateno = 0; + yypParser->yystack[0].major = 0; #if YYSTACKDEPTH>0 - pParser->yystackEnd = &pParser->yystack[YYSTACKDEPTH-1]; + yypParser->yystackEnd = &yypParser->yystack[YYSTACKDEPTH-1]; #endif } @@ -1571,11 +1582,14 @@ void ParseInit(void *yypParser){ ** A pointer to a parser. This pointer is used in subsequent calls ** to Parse and ParseFree. */ -void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE)){ - yyParser *pParser; - pParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) ); - if( pParser ) ParseInit(pParser); - return pParser; +void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE) ParseCTX_PDECL){ + yyParser *yypParser; + yypParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) ); + if( yypParser ){ + ParseCTX_STORE + ParseInit(yypParser ParseCTX_PARAM); + } + return (void*)yypParser; } #endif /* Parse_ENGINEALWAYSONSTACK */ @@ -1592,7 +1606,8 @@ static void yy_destructor( YYCODETYPE yymajor, /* Type code for object to destroy */ YYMINORTYPE *yypminor /* The object to be destroyed */ ){ - ParseARG_FETCH; + ParseARG_FETCH + ParseCTX_FETCH switch( yymajor ){ /* Here is inserted the actions which take place when a ** terminal or non-terminal is destroyed. This can happen @@ -1605,57 +1620,57 @@ static void yy_destructor( ** inside the C code. */ /********* Begin destructor definitions ***************************************/ - case 217: /* exprlist */ - case 264: /* selcollist */ - case 279: /* sclp */ + case 216: /* exprlist */ + case 263: /* selcollist */ + case 278: /* sclp */ { -tSqlExprListDestroy((yypminor->yy249)); +tSqlExprListDestroy((yypminor->yy367)); } break; - case 232: /* intitemlist */ - case 234: /* keep */ - case 255: /* columnlist */ - case 256: /* tagitemlist */ - case 257: /* tagNamelist */ - case 272: /* fill_opt */ - case 273: /* groupby_opt */ - case 275: /* orderby_opt */ - case 288: /* sortlist */ - case 292: /* grouplist */ -{ -taosArrayDestroy(&(yypminor->yy249)); + case 231: /* intitemlist */ + case 233: /* keep */ + case 254: /* columnlist */ + case 255: /* tagitemlist */ + case 256: /* tagNamelist */ + case 271: /* fill_opt */ + case 272: /* groupby_opt */ + case 274: /* orderby_opt */ + case 287: /* sortlist */ + case 291: /* grouplist */ +{ +taosArrayDestroy(&(yypminor->yy367)); } break; - case 253: /* create_table_list */ + case 252: /* create_table_list */ { -destroyCreateTableSql((yypminor->yy494)); +destroyCreateTableSql((yypminor->yy74)); } break; - case 260: /* select */ + case 259: /* select */ { -destroySqlNode((yypminor->yy320)); +destroySqlNode((yypminor->yy426)); } break; - case 265: /* from */ - case 283: /* tablelist */ - case 284: /* sub */ + case 264: /* from */ + case 282: /* tablelist */ + case 283: /* sub */ { -destroyRelationInfo((yypminor->yy52)); +destroyRelationInfo((yypminor->yy480)); } break; - case 266: /* where_opt */ - case 274: /* having_opt */ - case 281: /* expr */ - case 286: /* timestamp */ - case 291: /* arrow */ - case 293: /* expritem */ + case 265: /* where_opt */ + case 273: /* having_opt */ + case 280: /* expr */ + case 285: /* timestamp */ + case 290: /* arrow */ + case 292: /* expritem */ { -tSqlExprDestroy((yypminor->yy370)); +tSqlExprDestroy((yypminor->yy378)); } break; - case 278: /* union */ + case 277: /* union */ { -destroyAllSqlNode((yypminor->yy249)); +destroyAllSqlNode((yypminor->yy367)); } break; /********* End destructor definitions *****************************************/ @@ -1767,13 +1782,12 @@ int ParseCoverage(FILE *out){ ** Find the appropriate action for a parser given the terminal ** look-ahead token iLookAhead. */ -static unsigned int yy_find_shift_action( - yyParser *pParser, /* The parser */ - YYCODETYPE iLookAhead /* The look-ahead token */ +static YYACTIONTYPE yy_find_shift_action( + YYCODETYPE iLookAhead, /* The look-ahead token */ + YYACTIONTYPE stateno /* Current state number */ ){ int i; - int stateno = pParser->yytos->stateno; - + if( stateno>YY_MAX_SHIFT ) return stateno; assert( stateno <= YY_SHIFT_COUNT ); #if defined(YYCOVERAGE) @@ -1781,11 +1795,12 @@ static unsigned int yy_find_shift_action( #endif do{ i = yy_shift_ofst[stateno]; - assert( i>=0 && i+YYNTOKEN<=sizeof(yy_lookahead)/sizeof(yy_lookahead[0]) ); + assert( i>=0 ); + /* assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD ); */ assert( iLookAhead!=YYNOCODE ); assert( iLookAhead < YYNTOKEN ); i += iLookAhead; - if( yy_lookahead[i]!=iLookAhead ){ + if( i>=YY_NLOOKAHEAD || yy_lookahead[i]!=iLookAhead ){ #ifdef YYFALLBACK YYCODETYPE iFallback; /* Fallback token */ if( iLookAhead=YY_ACTTAB_COUNT j0 ){ #ifndef NDEBUG @@ -1835,8 +1851,8 @@ static unsigned int yy_find_shift_action( ** Find the appropriate action for a parser given the non-terminal ** look-ahead token iLookAhead. */ -static int yy_find_reduce_action( - int stateno, /* Current state number */ +static YYACTIONTYPE yy_find_reduce_action( + YYACTIONTYPE stateno, /* Current state number */ YYCODETYPE iLookAhead /* The look-ahead token */ ){ int i; @@ -1865,7 +1881,8 @@ static int yy_find_reduce_action( ** The following routine is called if the stack overflows. */ static void yyStackOverflow(yyParser *yypParser){ - ParseARG_FETCH; + ParseARG_FETCH + ParseCTX_FETCH #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt); @@ -1876,7 +1893,8 @@ static void yyStackOverflow(yyParser *yypParser){ ** stack every overflows */ /******** Begin %stack_overflow code ******************************************/ /******** End %stack_overflow code ********************************************/ - ParseARG_STORE; /* Suppress warning about unused %extra_argument var */ + ParseARG_STORE /* Suppress warning about unused %extra_argument var */ + ParseCTX_STORE } /* @@ -1905,8 +1923,8 @@ static void yyTraceShift(yyParser *yypParser, int yyNewState, const char *zTag){ */ static void yy_shift( yyParser *yypParser, /* The parser to be shifted */ - int yyNewState, /* The new state to shift in */ - int yyMajor, /* The major token to shift in */ + 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; @@ -1936,8 +1954,8 @@ static void yy_shift( yyNewState += YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE; } yytos = yypParser->yytos; - yytos->stateno = (YYACTIONTYPE)yyNewState; - yytos->major = (YYCODETYPE)yyMajor; + yytos->stateno = yyNewState; + yytos->major = yyMajor; yytos->minor.yy0 = yyMinor; yyTraceShift(yypParser, yyNewState, "Shift"); } @@ -1949,338 +1967,338 @@ static const struct { YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */ signed char nrhs; /* Negative of the number of RHS symbols in the rule */ } yyRuleInfo[] = { - { 208, -1 }, /* (0) program ::= cmd */ - { 209, -2 }, /* (1) cmd ::= SHOW DATABASES */ - { 209, -2 }, /* (2) cmd ::= SHOW TOPICS */ - { 209, -2 }, /* (3) cmd ::= SHOW FUNCTIONS */ - { 209, -2 }, /* (4) cmd ::= SHOW MNODES */ - { 209, -2 }, /* (5) cmd ::= SHOW DNODES */ - { 209, -2 }, /* (6) cmd ::= SHOW ACCOUNTS */ - { 209, -2 }, /* (7) cmd ::= SHOW USERS */ - { 209, -2 }, /* (8) cmd ::= SHOW MODULES */ - { 209, -2 }, /* (9) cmd ::= SHOW QUERIES */ - { 209, -2 }, /* (10) cmd ::= SHOW CONNECTIONS */ - { 209, -2 }, /* (11) cmd ::= SHOW STREAMS */ - { 209, -2 }, /* (12) cmd ::= SHOW VARIABLES */ - { 209, -2 }, /* (13) cmd ::= SHOW SCORES */ - { 209, -2 }, /* (14) cmd ::= SHOW GRANTS */ - { 209, -2 }, /* (15) cmd ::= SHOW VNODES */ - { 209, -3 }, /* (16) cmd ::= SHOW VNODES ids */ - { 211, 0 }, /* (17) dbPrefix ::= */ - { 211, -2 }, /* (18) dbPrefix ::= ids DOT */ - { 212, 0 }, /* (19) cpxName ::= */ - { 212, -2 }, /* (20) cpxName ::= DOT ids */ - { 209, -5 }, /* (21) cmd ::= SHOW CREATE TABLE ids cpxName */ - { 209, -5 }, /* (22) cmd ::= SHOW CREATE STABLE ids cpxName */ - { 209, -4 }, /* (23) cmd ::= SHOW CREATE DATABASE ids */ - { 209, -3 }, /* (24) cmd ::= SHOW dbPrefix TABLES */ - { 209, -5 }, /* (25) cmd ::= SHOW dbPrefix TABLES LIKE STRING */ - { 209, -3 }, /* (26) cmd ::= SHOW dbPrefix STABLES */ - { 209, -5 }, /* (27) cmd ::= SHOW dbPrefix STABLES LIKE STRING */ - { 209, -3 }, /* (28) cmd ::= SHOW dbPrefix VGROUPS */ - { 209, -3 }, /* (29) cmd ::= SHOW dbPrefix ALIVE */ - { 209, -3 }, /* (30) cmd ::= SHOW CLUSTER ALIVE */ - { 209, -5 }, /* (31) cmd ::= DROP TABLE ifexists ids cpxName */ - { 209, -5 }, /* (32) cmd ::= DROP STABLE ifexists ids cpxName */ - { 209, -4 }, /* (33) cmd ::= DROP DATABASE ifexists ids */ - { 209, -4 }, /* (34) cmd ::= DROP TOPIC ifexists ids */ - { 209, -3 }, /* (35) cmd ::= DROP FUNCTION ids */ - { 209, -3 }, /* (36) cmd ::= DROP DNODE ids */ - { 209, -3 }, /* (37) cmd ::= DROP USER ids */ - { 209, -3 }, /* (38) cmd ::= DROP ACCOUNT ids */ - { 209, -2 }, /* (39) cmd ::= USE ids */ - { 209, -3 }, /* (40) cmd ::= DESCRIBE ids cpxName */ - { 209, -3 }, /* (41) cmd ::= DESC ids cpxName */ - { 209, -5 }, /* (42) cmd ::= ALTER USER ids PASS ids */ - { 209, -5 }, /* (43) cmd ::= ALTER USER ids PRIVILEGE ids */ - { 209, -5 }, /* (44) cmd ::= ALTER USER ids TAGS ids */ - { 209, -4 }, /* (45) cmd ::= ALTER DNODE ids ids */ - { 209, -5 }, /* (46) cmd ::= ALTER DNODE ids ids ids */ - { 209, -3 }, /* (47) cmd ::= ALTER LOCAL ids */ - { 209, -4 }, /* (48) cmd ::= ALTER LOCAL ids ids */ - { 209, -4 }, /* (49) cmd ::= ALTER DATABASE ids alter_db_optr */ - { 209, -4 }, /* (50) cmd ::= ALTER TOPIC ids alter_topic_optr */ - { 209, -4 }, /* (51) cmd ::= ALTER ACCOUNT ids acct_optr */ - { 209, -6 }, /* (52) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ - { 209, -6 }, /* (53) cmd ::= COMPACT VNODES IN LP exprlist RP */ - { 210, -1 }, /* (54) ids ::= ID */ - { 210, -1 }, /* (55) ids ::= STRING */ - { 213, -2 }, /* (56) ifexists ::= IF EXISTS */ - { 213, 0 }, /* (57) ifexists ::= */ - { 218, -3 }, /* (58) ifnotexists ::= IF NOT EXISTS */ - { 218, 0 }, /* (59) ifnotexists ::= */ - { 209, -3 }, /* (60) cmd ::= CREATE DNODE ids */ - { 209, -6 }, /* (61) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ - { 209, -5 }, /* (62) cmd ::= CREATE DATABASE ifnotexists ids db_optr */ - { 209, -5 }, /* (63) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ - { 209, -8 }, /* (64) cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ - { 209, -9 }, /* (65) cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ - { 209, -5 }, /* (66) cmd ::= CREATE USER ids PASS ids */ - { 209, -7 }, /* (67) cmd ::= CREATE USER ids PASS ids TAGS ids */ - { 222, 0 }, /* (68) bufsize ::= */ - { 222, -2 }, /* (69) bufsize ::= BUFSIZE INTEGER */ - { 223, 0 }, /* (70) pps ::= */ - { 223, -2 }, /* (71) pps ::= PPS INTEGER */ - { 224, 0 }, /* (72) tseries ::= */ - { 224, -2 }, /* (73) tseries ::= TSERIES INTEGER */ - { 225, 0 }, /* (74) dbs ::= */ - { 225, -2 }, /* (75) dbs ::= DBS INTEGER */ - { 226, 0 }, /* (76) streams ::= */ - { 226, -2 }, /* (77) streams ::= STREAMS INTEGER */ - { 227, 0 }, /* (78) storage ::= */ - { 227, -2 }, /* (79) storage ::= STORAGE INTEGER */ - { 228, 0 }, /* (80) qtime ::= */ - { 228, -2 }, /* (81) qtime ::= QTIME INTEGER */ - { 229, 0 }, /* (82) users ::= */ - { 229, -2 }, /* (83) users ::= USERS INTEGER */ - { 230, 0 }, /* (84) conns ::= */ - { 230, -2 }, /* (85) conns ::= CONNS INTEGER */ - { 231, 0 }, /* (86) state ::= */ - { 231, -2 }, /* (87) state ::= STATE ids */ - { 216, -9 }, /* (88) acct_optr ::= pps tseries storage streams qtime dbs users conns state */ - { 232, -3 }, /* (89) intitemlist ::= intitemlist COMMA intitem */ - { 232, -1 }, /* (90) intitemlist ::= intitem */ - { 233, -1 }, /* (91) intitem ::= INTEGER */ - { 234, -2 }, /* (92) keep ::= KEEP intitemlist */ - { 235, -2 }, /* (93) cache ::= CACHE INTEGER */ - { 236, -2 }, /* (94) replica ::= REPLICA INTEGER */ - { 237, -2 }, /* (95) quorum ::= QUORUM INTEGER */ - { 238, -2 }, /* (96) days ::= DAYS INTEGER */ - { 239, -2 }, /* (97) minrows ::= MINROWS INTEGER */ - { 240, -2 }, /* (98) maxrows ::= MAXROWS INTEGER */ - { 241, -2 }, /* (99) blocks ::= BLOCKS INTEGER */ - { 242, -2 }, /* (100) ctime ::= CTIME INTEGER */ - { 243, -2 }, /* (101) wal ::= WAL INTEGER */ - { 244, -2 }, /* (102) fsync ::= FSYNC INTEGER */ - { 245, -2 }, /* (103) comp ::= COMP INTEGER */ - { 246, -2 }, /* (104) prec ::= PRECISION STRING */ - { 247, -2 }, /* (105) update ::= UPDATE INTEGER */ - { 248, -2 }, /* (106) cachelast ::= CACHELAST INTEGER */ - { 249, -2 }, /* (107) partitions ::= PARTITIONS INTEGER */ - { 219, 0 }, /* (108) db_optr ::= */ - { 219, -2 }, /* (109) db_optr ::= db_optr cache */ - { 219, -2 }, /* (110) db_optr ::= db_optr replica */ - { 219, -2 }, /* (111) db_optr ::= db_optr quorum */ - { 219, -2 }, /* (112) db_optr ::= db_optr days */ - { 219, -2 }, /* (113) db_optr ::= db_optr minrows */ - { 219, -2 }, /* (114) db_optr ::= db_optr maxrows */ - { 219, -2 }, /* (115) db_optr ::= db_optr blocks */ - { 219, -2 }, /* (116) db_optr ::= db_optr ctime */ - { 219, -2 }, /* (117) db_optr ::= db_optr wal */ - { 219, -2 }, /* (118) db_optr ::= db_optr fsync */ - { 219, -2 }, /* (119) db_optr ::= db_optr comp */ - { 219, -2 }, /* (120) db_optr ::= db_optr prec */ - { 219, -2 }, /* (121) db_optr ::= db_optr keep */ - { 219, -2 }, /* (122) db_optr ::= db_optr update */ - { 219, -2 }, /* (123) db_optr ::= db_optr cachelast */ - { 220, -1 }, /* (124) topic_optr ::= db_optr */ - { 220, -2 }, /* (125) topic_optr ::= topic_optr partitions */ - { 214, 0 }, /* (126) alter_db_optr ::= */ - { 214, -2 }, /* (127) alter_db_optr ::= alter_db_optr replica */ - { 214, -2 }, /* (128) alter_db_optr ::= alter_db_optr quorum */ - { 214, -2 }, /* (129) alter_db_optr ::= alter_db_optr keep */ - { 214, -2 }, /* (130) alter_db_optr ::= alter_db_optr blocks */ - { 214, -2 }, /* (131) alter_db_optr ::= alter_db_optr comp */ - { 214, -2 }, /* (132) alter_db_optr ::= alter_db_optr update */ - { 214, -2 }, /* (133) alter_db_optr ::= alter_db_optr cachelast */ - { 214, -2 }, /* (134) alter_db_optr ::= alter_db_optr minrows */ - { 215, -1 }, /* (135) alter_topic_optr ::= alter_db_optr */ - { 215, -2 }, /* (136) alter_topic_optr ::= alter_topic_optr partitions */ - { 221, -1 }, /* (137) typename ::= ids */ - { 221, -4 }, /* (138) typename ::= ids LP signed RP */ - { 221, -2 }, /* (139) typename ::= ids UNSIGNED */ - { 250, -1 }, /* (140) signed ::= INTEGER */ - { 250, -2 }, /* (141) signed ::= PLUS INTEGER */ - { 250, -2 }, /* (142) signed ::= MINUS INTEGER */ - { 209, -3 }, /* (143) cmd ::= CREATE TABLE create_table_args */ - { 209, -3 }, /* (144) cmd ::= CREATE TABLE create_stable_args */ - { 209, -3 }, /* (145) cmd ::= CREATE STABLE create_stable_args */ - { 209, -3 }, /* (146) cmd ::= CREATE TABLE create_table_list */ - { 253, -1 }, /* (147) create_table_list ::= create_from_stable */ - { 253, -2 }, /* (148) create_table_list ::= create_table_list create_from_stable */ - { 251, -6 }, /* (149) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ - { 252, -10 }, /* (150) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ - { 254, -10 }, /* (151) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ - { 254, -13 }, /* (152) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */ - { 257, -3 }, /* (153) tagNamelist ::= tagNamelist COMMA ids */ - { 257, -1 }, /* (154) tagNamelist ::= ids */ - { 251, -7 }, /* (155) create_table_args ::= ifnotexists ids cpxName to_opt split_opt AS select */ - { 258, 0 }, /* (156) to_opt ::= */ - { 258, -3 }, /* (157) to_opt ::= TO ids cpxName */ - { 259, 0 }, /* (158) split_opt ::= */ - { 259, -2 }, /* (159) split_opt ::= SPLIT ids */ - { 255, -3 }, /* (160) columnlist ::= columnlist COMMA column */ - { 255, -1 }, /* (161) columnlist ::= column */ - { 262, -2 }, /* (162) column ::= ids typename */ - { 256, -3 }, /* (163) tagitemlist ::= tagitemlist COMMA tagitem */ - { 256, -1 }, /* (164) tagitemlist ::= tagitem */ - { 263, -1 }, /* (165) tagitem ::= INTEGER */ - { 263, -1 }, /* (166) tagitem ::= FLOAT */ - { 263, -1 }, /* (167) tagitem ::= STRING */ - { 263, -1 }, /* (168) tagitem ::= BOOL */ - { 263, -1 }, /* (169) tagitem ::= NULL */ - { 263, -1 }, /* (170) tagitem ::= NOW */ - { 263, -3 }, /* (171) tagitem ::= NOW PLUS VARIABLE */ - { 263, -3 }, /* (172) tagitem ::= NOW MINUS VARIABLE */ - { 263, -2 }, /* (173) tagitem ::= MINUS INTEGER */ - { 263, -2 }, /* (174) tagitem ::= MINUS FLOAT */ - { 263, -2 }, /* (175) tagitem ::= PLUS INTEGER */ - { 263, -2 }, /* (176) tagitem ::= PLUS FLOAT */ - { 260, -15 }, /* (177) select ::= SELECT selcollist from where_opt range_option interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */ - { 260, -3 }, /* (178) select ::= LP select RP */ - { 278, -1 }, /* (179) union ::= select */ - { 278, -4 }, /* (180) union ::= union UNION ALL select */ - { 209, -1 }, /* (181) cmd ::= union */ - { 260, -2 }, /* (182) select ::= SELECT selcollist */ - { 279, -2 }, /* (183) sclp ::= selcollist COMMA */ - { 279, 0 }, /* (184) sclp ::= */ - { 264, -4 }, /* (185) selcollist ::= sclp distinct expr as */ - { 264, -2 }, /* (186) selcollist ::= sclp STAR */ - { 282, -2 }, /* (187) as ::= AS ids */ - { 282, -1 }, /* (188) as ::= ids */ - { 282, 0 }, /* (189) as ::= */ - { 280, -1 }, /* (190) distinct ::= DISTINCT */ - { 280, 0 }, /* (191) distinct ::= */ - { 265, -2 }, /* (192) from ::= FROM tablelist */ - { 265, -2 }, /* (193) from ::= FROM sub */ - { 284, -3 }, /* (194) sub ::= LP union RP */ - { 284, -4 }, /* (195) sub ::= LP union RP ids */ - { 284, -6 }, /* (196) sub ::= sub COMMA LP union RP ids */ - { 283, -2 }, /* (197) tablelist ::= ids cpxName */ - { 283, -3 }, /* (198) tablelist ::= ids cpxName ids */ - { 283, -4 }, /* (199) tablelist ::= tablelist COMMA ids cpxName */ - { 283, -5 }, /* (200) tablelist ::= tablelist COMMA ids cpxName ids */ - { 285, -1 }, /* (201) tmvar ::= VARIABLE */ - { 286, -1 }, /* (202) timestamp ::= INTEGER */ - { 286, -2 }, /* (203) timestamp ::= MINUS INTEGER */ - { 286, -2 }, /* (204) timestamp ::= PLUS INTEGER */ - { 286, -1 }, /* (205) timestamp ::= STRING */ - { 286, -1 }, /* (206) timestamp ::= NOW */ - { 286, -3 }, /* (207) timestamp ::= NOW PLUS VARIABLE */ - { 286, -3 }, /* (208) timestamp ::= NOW MINUS VARIABLE */ - { 267, 0 }, /* (209) range_option ::= */ - { 267, -6 }, /* (210) range_option ::= RANGE LP timestamp COMMA timestamp RP */ - { 268, -4 }, /* (211) interval_option ::= intervalKey LP tmvar RP */ - { 268, -6 }, /* (212) interval_option ::= intervalKey LP tmvar COMMA tmvar RP */ - { 268, 0 }, /* (213) interval_option ::= */ - { 287, -1 }, /* (214) intervalKey ::= INTERVAL */ - { 287, -1 }, /* (215) intervalKey ::= EVERY */ - { 270, 0 }, /* (216) session_option ::= */ - { 270, -7 }, /* (217) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ - { 271, 0 }, /* (218) windowstate_option ::= */ - { 271, -4 }, /* (219) windowstate_option ::= STATE_WINDOW LP ids RP */ - { 272, 0 }, /* (220) fill_opt ::= */ - { 272, -6 }, /* (221) fill_opt ::= FILL LP ID COMMA tagitemlist RP */ - { 272, -4 }, /* (222) fill_opt ::= FILL LP ID RP */ - { 269, -4 }, /* (223) sliding_opt ::= SLIDING LP tmvar RP */ - { 269, 0 }, /* (224) sliding_opt ::= */ - { 275, 0 }, /* (225) orderby_opt ::= */ - { 275, -3 }, /* (226) orderby_opt ::= ORDER BY sortlist */ - { 288, -4 }, /* (227) sortlist ::= sortlist COMMA item sortorder */ - { 288, -4 }, /* (228) sortlist ::= sortlist COMMA arrow sortorder */ - { 288, -2 }, /* (229) sortlist ::= item sortorder */ - { 288, -2 }, /* (230) sortlist ::= arrow sortorder */ - { 289, -1 }, /* (231) item ::= ID */ - { 289, -3 }, /* (232) item ::= ID DOT ID */ - { 290, -1 }, /* (233) sortorder ::= ASC */ - { 290, -1 }, /* (234) sortorder ::= DESC */ - { 290, 0 }, /* (235) sortorder ::= */ - { 273, 0 }, /* (236) groupby_opt ::= */ - { 273, -3 }, /* (237) groupby_opt ::= GROUP BY grouplist */ - { 292, -3 }, /* (238) grouplist ::= grouplist COMMA item */ - { 292, -3 }, /* (239) grouplist ::= grouplist COMMA arrow */ - { 292, -1 }, /* (240) grouplist ::= item */ - { 292, -1 }, /* (241) grouplist ::= arrow */ - { 274, 0 }, /* (242) having_opt ::= */ - { 274, -2 }, /* (243) having_opt ::= HAVING expr */ - { 277, 0 }, /* (244) limit_opt ::= */ - { 277, -2 }, /* (245) limit_opt ::= LIMIT signed */ - { 277, -4 }, /* (246) limit_opt ::= LIMIT signed OFFSET signed */ - { 277, -4 }, /* (247) limit_opt ::= LIMIT signed COMMA signed */ - { 276, 0 }, /* (248) slimit_opt ::= */ - { 276, -2 }, /* (249) slimit_opt ::= SLIMIT signed */ - { 276, -4 }, /* (250) slimit_opt ::= SLIMIT signed SOFFSET signed */ - { 276, -4 }, /* (251) slimit_opt ::= SLIMIT signed COMMA signed */ - { 266, 0 }, /* (252) where_opt ::= */ - { 266, -2 }, /* (253) where_opt ::= WHERE expr */ - { 281, -3 }, /* (254) expr ::= LP expr RP */ - { 281, -1 }, /* (255) expr ::= ID */ - { 281, -3 }, /* (256) expr ::= ID DOT ID */ - { 281, -3 }, /* (257) expr ::= ID DOT STAR */ - { 281, -1 }, /* (258) expr ::= INTEGER */ - { 281, -2 }, /* (259) expr ::= MINUS INTEGER */ - { 281, -2 }, /* (260) expr ::= PLUS INTEGER */ - { 281, -1 }, /* (261) expr ::= FLOAT */ - { 281, -2 }, /* (262) expr ::= MINUS FLOAT */ - { 281, -2 }, /* (263) expr ::= PLUS FLOAT */ - { 281, -1 }, /* (264) expr ::= STRING */ - { 281, -1 }, /* (265) expr ::= NOW */ - { 281, -1 }, /* (266) expr ::= TODAY */ - { 281, -1 }, /* (267) expr ::= VARIABLE */ - { 281, -2 }, /* (268) expr ::= PLUS VARIABLE */ - { 281, -2 }, /* (269) expr ::= MINUS VARIABLE */ - { 281, -1 }, /* (270) expr ::= BOOL */ - { 281, -1 }, /* (271) expr ::= NULL */ - { 281, -4 }, /* (272) expr ::= ID LP exprlist RP */ - { 281, -4 }, /* (273) expr ::= ID LP STAR RP */ - { 281, -6 }, /* (274) expr ::= ID LP expr AS typename RP */ - { 281, -3 }, /* (275) expr ::= expr IS NULL */ - { 281, -4 }, /* (276) expr ::= expr IS NOT NULL */ - { 281, -3 }, /* (277) expr ::= expr LT expr */ - { 281, -3 }, /* (278) expr ::= expr GT expr */ - { 281, -3 }, /* (279) expr ::= expr LE expr */ - { 281, -3 }, /* (280) expr ::= expr GE expr */ - { 281, -3 }, /* (281) expr ::= expr NE expr */ - { 281, -3 }, /* (282) expr ::= expr EQ expr */ - { 281, -5 }, /* (283) expr ::= expr BETWEEN expr AND expr */ - { 281, -3 }, /* (284) expr ::= expr AND expr */ - { 281, -3 }, /* (285) expr ::= expr OR expr */ - { 281, -3 }, /* (286) expr ::= expr PLUS expr */ - { 281, -3 }, /* (287) expr ::= expr MINUS expr */ - { 281, -3 }, /* (288) expr ::= expr STAR expr */ - { 281, -3 }, /* (289) expr ::= expr SLASH expr */ - { 281, -3 }, /* (290) expr ::= expr REM expr */ - { 281, -3 }, /* (291) expr ::= expr BITAND expr */ - { 281, -3 }, /* (292) expr ::= expr BITOR expr */ - { 281, -3 }, /* (293) expr ::= expr BITXOR expr */ - { 281, -2 }, /* (294) expr ::= BITNOT expr */ - { 281, -3 }, /* (295) expr ::= expr LSHIFT expr */ - { 281, -3 }, /* (296) expr ::= expr RSHIFT expr */ - { 281, -3 }, /* (297) expr ::= expr LIKE expr */ - { 281, -3 }, /* (298) expr ::= expr MATCH expr */ - { 281, -3 }, /* (299) expr ::= expr NMATCH expr */ - { 281, -3 }, /* (300) expr ::= ID CONTAINS STRING */ - { 281, -5 }, /* (301) expr ::= ID DOT ID CONTAINS STRING */ - { 291, -3 }, /* (302) arrow ::= ID ARROW STRING */ - { 291, -5 }, /* (303) arrow ::= ID DOT ID ARROW STRING */ - { 281, -1 }, /* (304) expr ::= arrow */ - { 281, -5 }, /* (305) expr ::= expr IN LP exprlist RP */ - { 217, -3 }, /* (306) exprlist ::= exprlist COMMA expritem */ - { 217, -1 }, /* (307) exprlist ::= expritem */ - { 293, -1 }, /* (308) expritem ::= expr */ - { 293, 0 }, /* (309) expritem ::= */ - { 209, -3 }, /* (310) cmd ::= RESET QUERY CACHE */ - { 209, -3 }, /* (311) cmd ::= SYNCDB ids REPLICA */ - { 209, -7 }, /* (312) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ - { 209, -7 }, /* (313) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ - { 209, -7 }, /* (314) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */ - { 209, -7 }, /* (315) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ - { 209, -7 }, /* (316) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ - { 209, -8 }, /* (317) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ - { 209, -9 }, /* (318) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ - { 209, -7 }, /* (319) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */ - { 209, -7 }, /* (320) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ - { 209, -7 }, /* (321) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ - { 209, -7 }, /* (322) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */ - { 209, -7 }, /* (323) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ - { 209, -7 }, /* (324) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ - { 209, -8 }, /* (325) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ - { 209, -9 }, /* (326) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */ - { 209, -7 }, /* (327) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */ - { 209, -3 }, /* (328) cmd ::= KILL CONNECTION INTEGER */ - { 209, -5 }, /* (329) cmd ::= KILL STREAM INTEGER COLON INTEGER */ - { 209, -5 }, /* (330) cmd ::= KILL QUERY INTEGER COLON INTEGER */ - { 209, -6 }, /* (331) cmd ::= DELETE FROM ifexists ids cpxName where_opt */ + { 207, -1 }, /* (0) program ::= cmd */ + { 208, -2 }, /* (1) cmd ::= SHOW DATABASES */ + { 208, -2 }, /* (2) cmd ::= SHOW TOPICS */ + { 208, -2 }, /* (3) cmd ::= SHOW FUNCTIONS */ + { 208, -2 }, /* (4) cmd ::= SHOW MNODES */ + { 208, -2 }, /* (5) cmd ::= SHOW DNODES */ + { 208, -2 }, /* (6) cmd ::= SHOW ACCOUNTS */ + { 208, -2 }, /* (7) cmd ::= SHOW USERS */ + { 208, -2 }, /* (8) cmd ::= SHOW MODULES */ + { 208, -2 }, /* (9) cmd ::= SHOW QUERIES */ + { 208, -2 }, /* (10) cmd ::= SHOW CONNECTIONS */ + { 208, -2 }, /* (11) cmd ::= SHOW STREAMS */ + { 208, -2 }, /* (12) cmd ::= SHOW VARIABLES */ + { 208, -2 }, /* (13) cmd ::= SHOW SCORES */ + { 208, -2 }, /* (14) cmd ::= SHOW GRANTS */ + { 208, -2 }, /* (15) cmd ::= SHOW VNODES */ + { 208, -3 }, /* (16) cmd ::= SHOW VNODES ids */ + { 210, 0 }, /* (17) dbPrefix ::= */ + { 210, -2 }, /* (18) dbPrefix ::= ids DOT */ + { 211, 0 }, /* (19) cpxName ::= */ + { 211, -2 }, /* (20) cpxName ::= DOT ids */ + { 208, -5 }, /* (21) cmd ::= SHOW CREATE TABLE ids cpxName */ + { 208, -5 }, /* (22) cmd ::= SHOW CREATE STABLE ids cpxName */ + { 208, -4 }, /* (23) cmd ::= SHOW CREATE DATABASE ids */ + { 208, -3 }, /* (24) cmd ::= SHOW dbPrefix TABLES */ + { 208, -5 }, /* (25) cmd ::= SHOW dbPrefix TABLES LIKE STRING */ + { 208, -3 }, /* (26) cmd ::= SHOW dbPrefix STABLES */ + { 208, -5 }, /* (27) cmd ::= SHOW dbPrefix STABLES LIKE STRING */ + { 208, -3 }, /* (28) cmd ::= SHOW dbPrefix VGROUPS */ + { 208, -3 }, /* (29) cmd ::= SHOW dbPrefix ALIVE */ + { 208, -3 }, /* (30) cmd ::= SHOW CLUSTER ALIVE */ + { 208, -5 }, /* (31) cmd ::= DROP TABLE ifexists ids cpxName */ + { 208, -5 }, /* (32) cmd ::= DROP STABLE ifexists ids cpxName */ + { 208, -4 }, /* (33) cmd ::= DROP DATABASE ifexists ids */ + { 208, -4 }, /* (34) cmd ::= DROP TOPIC ifexists ids */ + { 208, -3 }, /* (35) cmd ::= DROP FUNCTION ids */ + { 208, -3 }, /* (36) cmd ::= DROP DNODE ids */ + { 208, -3 }, /* (37) cmd ::= DROP USER ids */ + { 208, -3 }, /* (38) cmd ::= DROP ACCOUNT ids */ + { 208, -2 }, /* (39) cmd ::= USE ids */ + { 208, -3 }, /* (40) cmd ::= DESCRIBE ids cpxName */ + { 208, -3 }, /* (41) cmd ::= DESC ids cpxName */ + { 208, -5 }, /* (42) cmd ::= ALTER USER ids PASS ids */ + { 208, -5 }, /* (43) cmd ::= ALTER USER ids PRIVILEGE ids */ + { 208, -5 }, /* (44) cmd ::= ALTER USER ids TAGS ids */ + { 208, -4 }, /* (45) cmd ::= ALTER DNODE ids ids */ + { 208, -5 }, /* (46) cmd ::= ALTER DNODE ids ids ids */ + { 208, -3 }, /* (47) cmd ::= ALTER LOCAL ids */ + { 208, -4 }, /* (48) cmd ::= ALTER LOCAL ids ids */ + { 208, -4 }, /* (49) cmd ::= ALTER DATABASE ids alter_db_optr */ + { 208, -4 }, /* (50) cmd ::= ALTER TOPIC ids alter_topic_optr */ + { 208, -4 }, /* (51) cmd ::= ALTER ACCOUNT ids acct_optr */ + { 208, -6 }, /* (52) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ + { 208, -6 }, /* (53) cmd ::= COMPACT VNODES IN LP exprlist RP */ + { 209, -1 }, /* (54) ids ::= ID */ + { 209, -1 }, /* (55) ids ::= STRING */ + { 212, -2 }, /* (56) ifexists ::= IF EXISTS */ + { 212, 0 }, /* (57) ifexists ::= */ + { 217, -3 }, /* (58) ifnotexists ::= IF NOT EXISTS */ + { 217, 0 }, /* (59) ifnotexists ::= */ + { 208, -3 }, /* (60) cmd ::= CREATE DNODE ids */ + { 208, -6 }, /* (61) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ + { 208, -5 }, /* (62) cmd ::= CREATE DATABASE ifnotexists ids db_optr */ + { 208, -5 }, /* (63) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ + { 208, -8 }, /* (64) cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ + { 208, -9 }, /* (65) cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ + { 208, -5 }, /* (66) cmd ::= CREATE USER ids PASS ids */ + { 208, -7 }, /* (67) cmd ::= CREATE USER ids PASS ids TAGS ids */ + { 221, 0 }, /* (68) bufsize ::= */ + { 221, -2 }, /* (69) bufsize ::= BUFSIZE INTEGER */ + { 222, 0 }, /* (70) pps ::= */ + { 222, -2 }, /* (71) pps ::= PPS INTEGER */ + { 223, 0 }, /* (72) tseries ::= */ + { 223, -2 }, /* (73) tseries ::= TSERIES INTEGER */ + { 224, 0 }, /* (74) dbs ::= */ + { 224, -2 }, /* (75) dbs ::= DBS INTEGER */ + { 225, 0 }, /* (76) streams ::= */ + { 225, -2 }, /* (77) streams ::= STREAMS INTEGER */ + { 226, 0 }, /* (78) storage ::= */ + { 226, -2 }, /* (79) storage ::= STORAGE INTEGER */ + { 227, 0 }, /* (80) qtime ::= */ + { 227, -2 }, /* (81) qtime ::= QTIME INTEGER */ + { 228, 0 }, /* (82) users ::= */ + { 228, -2 }, /* (83) users ::= USERS INTEGER */ + { 229, 0 }, /* (84) conns ::= */ + { 229, -2 }, /* (85) conns ::= CONNS INTEGER */ + { 230, 0 }, /* (86) state ::= */ + { 230, -2 }, /* (87) state ::= STATE ids */ + { 215, -9 }, /* (88) acct_optr ::= pps tseries storage streams qtime dbs users conns state */ + { 231, -3 }, /* (89) intitemlist ::= intitemlist COMMA intitem */ + { 231, -1 }, /* (90) intitemlist ::= intitem */ + { 232, -1 }, /* (91) intitem ::= INTEGER */ + { 233, -2 }, /* (92) keep ::= KEEP intitemlist */ + { 234, -2 }, /* (93) cache ::= CACHE INTEGER */ + { 235, -2 }, /* (94) replica ::= REPLICA INTEGER */ + { 236, -2 }, /* (95) quorum ::= QUORUM INTEGER */ + { 237, -2 }, /* (96) days ::= DAYS INTEGER */ + { 238, -2 }, /* (97) minrows ::= MINROWS INTEGER */ + { 239, -2 }, /* (98) maxrows ::= MAXROWS INTEGER */ + { 240, -2 }, /* (99) blocks ::= BLOCKS INTEGER */ + { 241, -2 }, /* (100) ctime ::= CTIME INTEGER */ + { 242, -2 }, /* (101) wal ::= WAL INTEGER */ + { 243, -2 }, /* (102) fsync ::= FSYNC INTEGER */ + { 244, -2 }, /* (103) comp ::= COMP INTEGER */ + { 245, -2 }, /* (104) prec ::= PRECISION STRING */ + { 246, -2 }, /* (105) update ::= UPDATE INTEGER */ + { 247, -2 }, /* (106) cachelast ::= CACHELAST INTEGER */ + { 248, -2 }, /* (107) partitions ::= PARTITIONS INTEGER */ + { 218, 0 }, /* (108) db_optr ::= */ + { 218, -2 }, /* (109) db_optr ::= db_optr cache */ + { 218, -2 }, /* (110) db_optr ::= db_optr replica */ + { 218, -2 }, /* (111) db_optr ::= db_optr quorum */ + { 218, -2 }, /* (112) db_optr ::= db_optr days */ + { 218, -2 }, /* (113) db_optr ::= db_optr minrows */ + { 218, -2 }, /* (114) db_optr ::= db_optr maxrows */ + { 218, -2 }, /* (115) db_optr ::= db_optr blocks */ + { 218, -2 }, /* (116) db_optr ::= db_optr ctime */ + { 218, -2 }, /* (117) db_optr ::= db_optr wal */ + { 218, -2 }, /* (118) db_optr ::= db_optr fsync */ + { 218, -2 }, /* (119) db_optr ::= db_optr comp */ + { 218, -2 }, /* (120) db_optr ::= db_optr prec */ + { 218, -2 }, /* (121) db_optr ::= db_optr keep */ + { 218, -2 }, /* (122) db_optr ::= db_optr update */ + { 218, -2 }, /* (123) db_optr ::= db_optr cachelast */ + { 219, -1 }, /* (124) topic_optr ::= db_optr */ + { 219, -2 }, /* (125) topic_optr ::= topic_optr partitions */ + { 213, 0 }, /* (126) alter_db_optr ::= */ + { 213, -2 }, /* (127) alter_db_optr ::= alter_db_optr replica */ + { 213, -2 }, /* (128) alter_db_optr ::= alter_db_optr quorum */ + { 213, -2 }, /* (129) alter_db_optr ::= alter_db_optr keep */ + { 213, -2 }, /* (130) alter_db_optr ::= alter_db_optr blocks */ + { 213, -2 }, /* (131) alter_db_optr ::= alter_db_optr comp */ + { 213, -2 }, /* (132) alter_db_optr ::= alter_db_optr update */ + { 213, -2 }, /* (133) alter_db_optr ::= alter_db_optr cachelast */ + { 213, -2 }, /* (134) alter_db_optr ::= alter_db_optr minrows */ + { 214, -1 }, /* (135) alter_topic_optr ::= alter_db_optr */ + { 214, -2 }, /* (136) alter_topic_optr ::= alter_topic_optr partitions */ + { 220, -1 }, /* (137) typename ::= ids */ + { 220, -4 }, /* (138) typename ::= ids LP signed RP */ + { 220, -2 }, /* (139) typename ::= ids UNSIGNED */ + { 249, -1 }, /* (140) signed ::= INTEGER */ + { 249, -2 }, /* (141) signed ::= PLUS INTEGER */ + { 249, -2 }, /* (142) signed ::= MINUS INTEGER */ + { 208, -3 }, /* (143) cmd ::= CREATE TABLE create_table_args */ + { 208, -3 }, /* (144) cmd ::= CREATE TABLE create_stable_args */ + { 208, -3 }, /* (145) cmd ::= CREATE STABLE create_stable_args */ + { 208, -3 }, /* (146) cmd ::= CREATE TABLE create_table_list */ + { 252, -1 }, /* (147) create_table_list ::= create_from_stable */ + { 252, -2 }, /* (148) create_table_list ::= create_table_list create_from_stable */ + { 250, -6 }, /* (149) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ + { 251, -10 }, /* (150) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ + { 253, -10 }, /* (151) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ + { 253, -13 }, /* (152) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */ + { 256, -3 }, /* (153) tagNamelist ::= tagNamelist COMMA ids */ + { 256, -1 }, /* (154) tagNamelist ::= ids */ + { 250, -7 }, /* (155) create_table_args ::= ifnotexists ids cpxName to_opt split_opt AS select */ + { 257, 0 }, /* (156) to_opt ::= */ + { 257, -3 }, /* (157) to_opt ::= TO ids cpxName */ + { 258, 0 }, /* (158) split_opt ::= */ + { 258, -2 }, /* (159) split_opt ::= SPLIT ids */ + { 254, -3 }, /* (160) columnlist ::= columnlist COMMA column */ + { 254, -1 }, /* (161) columnlist ::= column */ + { 261, -2 }, /* (162) column ::= ids typename */ + { 255, -3 }, /* (163) tagitemlist ::= tagitemlist COMMA tagitem */ + { 255, -1 }, /* (164) tagitemlist ::= tagitem */ + { 262, -1 }, /* (165) tagitem ::= INTEGER */ + { 262, -1 }, /* (166) tagitem ::= FLOAT */ + { 262, -1 }, /* (167) tagitem ::= STRING */ + { 262, -1 }, /* (168) tagitem ::= BOOL */ + { 262, -1 }, /* (169) tagitem ::= NULL */ + { 262, -1 }, /* (170) tagitem ::= NOW */ + { 262, -3 }, /* (171) tagitem ::= NOW PLUS VARIABLE */ + { 262, -3 }, /* (172) tagitem ::= NOW MINUS VARIABLE */ + { 262, -2 }, /* (173) tagitem ::= MINUS INTEGER */ + { 262, -2 }, /* (174) tagitem ::= MINUS FLOAT */ + { 262, -2 }, /* (175) tagitem ::= PLUS INTEGER */ + { 262, -2 }, /* (176) tagitem ::= PLUS FLOAT */ + { 259, -15 }, /* (177) select ::= SELECT selcollist from where_opt range_option interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */ + { 259, -3 }, /* (178) select ::= LP select RP */ + { 277, -1 }, /* (179) union ::= select */ + { 277, -4 }, /* (180) union ::= union UNION ALL select */ + { 208, -1 }, /* (181) cmd ::= union */ + { 259, -2 }, /* (182) select ::= SELECT selcollist */ + { 278, -2 }, /* (183) sclp ::= selcollist COMMA */ + { 278, 0 }, /* (184) sclp ::= */ + { 263, -4 }, /* (185) selcollist ::= sclp distinct expr as */ + { 263, -2 }, /* (186) selcollist ::= sclp STAR */ + { 281, -2 }, /* (187) as ::= AS ids */ + { 281, -1 }, /* (188) as ::= ids */ + { 281, 0 }, /* (189) as ::= */ + { 279, -1 }, /* (190) distinct ::= DISTINCT */ + { 279, 0 }, /* (191) distinct ::= */ + { 264, -2 }, /* (192) from ::= FROM tablelist */ + { 264, -2 }, /* (193) from ::= FROM sub */ + { 283, -3 }, /* (194) sub ::= LP union RP */ + { 283, -4 }, /* (195) sub ::= LP union RP ids */ + { 283, -6 }, /* (196) sub ::= sub COMMA LP union RP ids */ + { 282, -2 }, /* (197) tablelist ::= ids cpxName */ + { 282, -3 }, /* (198) tablelist ::= ids cpxName ids */ + { 282, -4 }, /* (199) tablelist ::= tablelist COMMA ids cpxName */ + { 282, -5 }, /* (200) tablelist ::= tablelist COMMA ids cpxName ids */ + { 284, -1 }, /* (201) tmvar ::= VARIABLE */ + { 285, -1 }, /* (202) timestamp ::= INTEGER */ + { 285, -2 }, /* (203) timestamp ::= MINUS INTEGER */ + { 285, -2 }, /* (204) timestamp ::= PLUS INTEGER */ + { 285, -1 }, /* (205) timestamp ::= STRING */ + { 285, -1 }, /* (206) timestamp ::= NOW */ + { 285, -3 }, /* (207) timestamp ::= NOW PLUS VARIABLE */ + { 285, -3 }, /* (208) timestamp ::= NOW MINUS VARIABLE */ + { 266, 0 }, /* (209) range_option ::= */ + { 266, -6 }, /* (210) range_option ::= RANGE LP timestamp COMMA timestamp RP */ + { 267, -4 }, /* (211) interval_option ::= intervalKey LP tmvar RP */ + { 267, -6 }, /* (212) interval_option ::= intervalKey LP tmvar COMMA tmvar RP */ + { 267, 0 }, /* (213) interval_option ::= */ + { 286, -1 }, /* (214) intervalKey ::= INTERVAL */ + { 286, -1 }, /* (215) intervalKey ::= EVERY */ + { 269, 0 }, /* (216) session_option ::= */ + { 269, -7 }, /* (217) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ + { 270, 0 }, /* (218) windowstate_option ::= */ + { 270, -4 }, /* (219) windowstate_option ::= STATE_WINDOW LP ids RP */ + { 271, 0 }, /* (220) fill_opt ::= */ + { 271, -6 }, /* (221) fill_opt ::= FILL LP ID COMMA tagitemlist RP */ + { 271, -4 }, /* (222) fill_opt ::= FILL LP ID RP */ + { 268, -4 }, /* (223) sliding_opt ::= SLIDING LP tmvar RP */ + { 268, 0 }, /* (224) sliding_opt ::= */ + { 274, 0 }, /* (225) orderby_opt ::= */ + { 274, -3 }, /* (226) orderby_opt ::= ORDER BY sortlist */ + { 287, -4 }, /* (227) sortlist ::= sortlist COMMA item sortorder */ + { 287, -4 }, /* (228) sortlist ::= sortlist COMMA arrow sortorder */ + { 287, -2 }, /* (229) sortlist ::= item sortorder */ + { 287, -2 }, /* (230) sortlist ::= arrow sortorder */ + { 288, -1 }, /* (231) item ::= ID */ + { 288, -3 }, /* (232) item ::= ID DOT ID */ + { 289, -1 }, /* (233) sortorder ::= ASC */ + { 289, -1 }, /* (234) sortorder ::= DESC */ + { 289, 0 }, /* (235) sortorder ::= */ + { 272, 0 }, /* (236) groupby_opt ::= */ + { 272, -3 }, /* (237) groupby_opt ::= GROUP BY grouplist */ + { 291, -3 }, /* (238) grouplist ::= grouplist COMMA item */ + { 291, -3 }, /* (239) grouplist ::= grouplist COMMA arrow */ + { 291, -1 }, /* (240) grouplist ::= item */ + { 291, -1 }, /* (241) grouplist ::= arrow */ + { 273, 0 }, /* (242) having_opt ::= */ + { 273, -2 }, /* (243) having_opt ::= HAVING expr */ + { 276, 0 }, /* (244) limit_opt ::= */ + { 276, -2 }, /* (245) limit_opt ::= LIMIT signed */ + { 276, -4 }, /* (246) limit_opt ::= LIMIT signed OFFSET signed */ + { 276, -4 }, /* (247) limit_opt ::= LIMIT signed COMMA signed */ + { 275, 0 }, /* (248) slimit_opt ::= */ + { 275, -2 }, /* (249) slimit_opt ::= SLIMIT signed */ + { 275, -4 }, /* (250) slimit_opt ::= SLIMIT signed SOFFSET signed */ + { 275, -4 }, /* (251) slimit_opt ::= SLIMIT signed COMMA signed */ + { 265, 0 }, /* (252) where_opt ::= */ + { 265, -2 }, /* (253) where_opt ::= WHERE expr */ + { 280, -3 }, /* (254) expr ::= LP expr RP */ + { 280, -1 }, /* (255) expr ::= ID */ + { 280, -3 }, /* (256) expr ::= ID DOT ID */ + { 280, -3 }, /* (257) expr ::= ID DOT STAR */ + { 280, -1 }, /* (258) expr ::= INTEGER */ + { 280, -2 }, /* (259) expr ::= MINUS INTEGER */ + { 280, -2 }, /* (260) expr ::= PLUS INTEGER */ + { 280, -1 }, /* (261) expr ::= FLOAT */ + { 280, -2 }, /* (262) expr ::= MINUS FLOAT */ + { 280, -2 }, /* (263) expr ::= PLUS FLOAT */ + { 280, -1 }, /* (264) expr ::= STRING */ + { 280, -1 }, /* (265) expr ::= NOW */ + { 280, -1 }, /* (266) expr ::= TODAY */ + { 280, -1 }, /* (267) expr ::= VARIABLE */ + { 280, -2 }, /* (268) expr ::= PLUS VARIABLE */ + { 280, -2 }, /* (269) expr ::= MINUS VARIABLE */ + { 280, -1 }, /* (270) expr ::= BOOL */ + { 280, -1 }, /* (271) expr ::= NULL */ + { 280, -4 }, /* (272) expr ::= ID LP exprlist RP */ + { 280, -4 }, /* (273) expr ::= ID LP STAR RP */ + { 280, -3 }, /* (274) expr ::= ID LP RP */ + { 280, -6 }, /* (275) expr ::= ID LP expr AS typename RP */ + { 280, -3 }, /* (276) expr ::= expr IS NULL */ + { 280, -4 }, /* (277) expr ::= expr IS NOT NULL */ + { 280, -3 }, /* (278) expr ::= expr LT expr */ + { 280, -3 }, /* (279) expr ::= expr GT expr */ + { 280, -3 }, /* (280) expr ::= expr LE expr */ + { 280, -3 }, /* (281) expr ::= expr GE expr */ + { 280, -3 }, /* (282) expr ::= expr NE expr */ + { 280, -3 }, /* (283) expr ::= expr EQ expr */ + { 280, -5 }, /* (284) expr ::= expr BETWEEN expr AND expr */ + { 280, -3 }, /* (285) expr ::= expr AND expr */ + { 280, -3 }, /* (286) expr ::= expr OR expr */ + { 280, -3 }, /* (287) expr ::= expr PLUS expr */ + { 280, -3 }, /* (288) expr ::= expr MINUS expr */ + { 280, -3 }, /* (289) expr ::= expr STAR expr */ + { 280, -3 }, /* (290) expr ::= expr SLASH expr */ + { 280, -3 }, /* (291) expr ::= expr REM expr */ + { 280, -3 }, /* (292) expr ::= expr BITAND expr */ + { 280, -3 }, /* (293) expr ::= expr BITOR expr */ + { 280, -3 }, /* (294) expr ::= expr BITXOR expr */ + { 280, -2 }, /* (295) expr ::= BITNOT expr */ + { 280, -3 }, /* (296) expr ::= expr LSHIFT expr */ + { 280, -3 }, /* (297) expr ::= expr RSHIFT expr */ + { 280, -3 }, /* (298) expr ::= expr LIKE expr */ + { 280, -3 }, /* (299) expr ::= expr MATCH expr */ + { 280, -3 }, /* (300) expr ::= expr NMATCH expr */ + { 280, -3 }, /* (301) expr ::= ID CONTAINS STRING */ + { 280, -5 }, /* (302) expr ::= ID DOT ID CONTAINS STRING */ + { 290, -3 }, /* (303) arrow ::= ID ARROW STRING */ + { 290, -5 }, /* (304) arrow ::= ID DOT ID ARROW STRING */ + { 280, -1 }, /* (305) expr ::= arrow */ + { 280, -5 }, /* (306) expr ::= expr IN LP exprlist RP */ + { 216, -3 }, /* (307) exprlist ::= exprlist COMMA expritem */ + { 216, -1 }, /* (308) exprlist ::= expritem */ + { 292, -1 }, /* (309) expritem ::= expr */ + { 208, -3 }, /* (310) cmd ::= RESET QUERY CACHE */ + { 208, -3 }, /* (311) cmd ::= SYNCDB ids REPLICA */ + { 208, -7 }, /* (312) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ + { 208, -7 }, /* (313) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ + { 208, -7 }, /* (314) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */ + { 208, -7 }, /* (315) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ + { 208, -7 }, /* (316) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ + { 208, -8 }, /* (317) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ + { 208, -9 }, /* (318) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ + { 208, -7 }, /* (319) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */ + { 208, -7 }, /* (320) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ + { 208, -7 }, /* (321) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ + { 208, -7 }, /* (322) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */ + { 208, -7 }, /* (323) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ + { 208, -7 }, /* (324) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ + { 208, -8 }, /* (325) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ + { 208, -9 }, /* (326) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */ + { 208, -7 }, /* (327) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */ + { 208, -3 }, /* (328) cmd ::= KILL CONNECTION INTEGER */ + { 208, -5 }, /* (329) cmd ::= KILL STREAM INTEGER COLON INTEGER */ + { 208, -5 }, /* (330) cmd ::= KILL QUERY INTEGER COLON INTEGER */ + { 208, -6 }, /* (331) cmd ::= DELETE FROM ifexists ids cpxName where_opt */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -2295,17 +2313,18 @@ static void yy_accept(yyParser*); /* Forward Declaration */ ** only called from one place, optimizing compilers will in-line it, which ** means that the extra parameters have no performance impact. */ -static void yy_reduce( +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 */ ){ int yygoto; /* The next state */ - int yyact; /* The next action */ + YYACTIONTYPE yyact; /* The next action */ yyStackEntry *yymsp; /* The top of the parser's stack */ int yysize; /* Amount to pop the stack */ - ParseARG_FETCH; + ParseARG_FETCH (void)yyLookahead; (void)yyLookaheadToken; yymsp = yypParser->yytos; @@ -2336,13 +2355,19 @@ static void yy_reduce( #if YYSTACKDEPTH>0 if( yypParser->yytos>=yypParser->yystackEnd ){ yyStackOverflow(yypParser); - return; + /* The call to yyStackOverflow() above pops the stack until it is + ** empty, causing the main parser loop to exit. So the return value + ** is never used and does not matter. */ + return 0; } #else if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){ if( yyGrowStack(yypParser) ){ yyStackOverflow(yypParser); - return; + /* The call to yyStackOverflow() above pops the stack until it is + ** empty, causing the main parser loop to exit. So the return value + ** is never used and does not matter. */ + return 0; } yymsp = yypParser->yytos; } @@ -2549,16 +2574,16 @@ static void yy_reduce( break; case 49: /* cmd ::= ALTER DATABASE ids alter_db_optr */ case 50: /* cmd ::= ALTER TOPIC ids alter_topic_optr */ yytestcase(yyruleno==50); -{ SStrToken t = {0}; setCreateDbInfo(pInfo, TSDB_SQL_ALTER_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy478, &t);} +{ SStrToken t = {0}; setCreateDbInfo(pInfo, TSDB_SQL_ALTER_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy564, &t);} break; case 51: /* cmd ::= ALTER ACCOUNT ids acct_optr */ -{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-1].minor.yy0, NULL, &yymsp[0].minor.yy547);} +{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-1].minor.yy0, NULL, &yymsp[0].minor.yy563);} break; case 52: /* cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ -{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy547);} +{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy563);} break; case 53: /* cmd ::= COMPACT VNODES IN LP exprlist RP */ -{ setCompactVnodeSql(pInfo, TSDB_SQL_COMPACT_VNODE, yymsp[-1].minor.yy249);} +{ setCompactVnodeSql(pInfo, TSDB_SQL_COMPACT_VNODE, yymsp[-1].minor.yy367);} break; case 54: /* ids ::= ID */ case 55: /* ids ::= STRING */ yytestcase(yyruleno==55); @@ -2580,17 +2605,17 @@ static void yy_reduce( { setDCLSqlElems(pInfo, TSDB_SQL_CREATE_DNODE, 1, &yymsp[0].minor.yy0);} break; case 61: /* cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ -{ setCreateAcctSql(pInfo, TSDB_SQL_CREATE_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy547);} +{ setCreateAcctSql(pInfo, TSDB_SQL_CREATE_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy563);} break; case 62: /* cmd ::= CREATE DATABASE ifnotexists ids db_optr */ case 63: /* cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ yytestcase(yyruleno==63); -{ setCreateDbInfo(pInfo, TSDB_SQL_CREATE_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy478, &yymsp[-2].minor.yy0);} +{ setCreateDbInfo(pInfo, TSDB_SQL_CREATE_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy564, &yymsp[-2].minor.yy0);} break; case 64: /* cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ -{ setCreateFuncInfo(pInfo, TSDB_SQL_CREATE_FUNCTION, &yymsp[-5].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy475, &yymsp[0].minor.yy0, 1);} +{ setCreateFuncInfo(pInfo, TSDB_SQL_CREATE_FUNCTION, &yymsp[-5].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy307, &yymsp[0].minor.yy0, 1);} break; case 65: /* cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ -{ setCreateFuncInfo(pInfo, TSDB_SQL_CREATE_FUNCTION, &yymsp[-5].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy475, &yymsp[0].minor.yy0, 2);} +{ setCreateFuncInfo(pInfo, TSDB_SQL_CREATE_FUNCTION, &yymsp[-5].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy307, &yymsp[0].minor.yy0, 2);} break; case 66: /* cmd ::= CREATE USER ids PASS ids */ { setCreateUserSql(pInfo, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, NULL);} @@ -2624,38 +2649,38 @@ static void yy_reduce( break; case 88: /* acct_optr ::= pps tseries storage streams qtime dbs users conns state */ { - yylhsminor.yy547.maxUsers = (yymsp[-2].minor.yy0.n>0)?atoi(yymsp[-2].minor.yy0.z):-1; - yylhsminor.yy547.maxDbs = (yymsp[-3].minor.yy0.n>0)?atoi(yymsp[-3].minor.yy0.z):-1; - yylhsminor.yy547.maxTimeSeries = (yymsp[-7].minor.yy0.n>0)?atoi(yymsp[-7].minor.yy0.z):-1; - yylhsminor.yy547.maxStreams = (yymsp[-5].minor.yy0.n>0)?atoi(yymsp[-5].minor.yy0.z):-1; - yylhsminor.yy547.maxPointsPerSecond = (yymsp[-8].minor.yy0.n>0)?atoi(yymsp[-8].minor.yy0.z):-1; - yylhsminor.yy547.maxStorage = (yymsp[-6].minor.yy0.n>0)?strtoll(yymsp[-6].minor.yy0.z, NULL, 10):-1; - yylhsminor.yy547.maxQueryTime = (yymsp[-4].minor.yy0.n>0)?strtoll(yymsp[-4].minor.yy0.z, NULL, 10):-1; - yylhsminor.yy547.maxConnections = (yymsp[-1].minor.yy0.n>0)?atoi(yymsp[-1].minor.yy0.z):-1; - yylhsminor.yy547.stat = yymsp[0].minor.yy0; + yylhsminor.yy563.maxUsers = (yymsp[-2].minor.yy0.n>0)?atoi(yymsp[-2].minor.yy0.z):-1; + yylhsminor.yy563.maxDbs = (yymsp[-3].minor.yy0.n>0)?atoi(yymsp[-3].minor.yy0.z):-1; + yylhsminor.yy563.maxTimeSeries = (yymsp[-7].minor.yy0.n>0)?atoi(yymsp[-7].minor.yy0.z):-1; + yylhsminor.yy563.maxStreams = (yymsp[-5].minor.yy0.n>0)?atoi(yymsp[-5].minor.yy0.z):-1; + yylhsminor.yy563.maxPointsPerSecond = (yymsp[-8].minor.yy0.n>0)?atoi(yymsp[-8].minor.yy0.z):-1; + yylhsminor.yy563.maxStorage = (yymsp[-6].minor.yy0.n>0)?strtoll(yymsp[-6].minor.yy0.z, NULL, 10):-1; + yylhsminor.yy563.maxQueryTime = (yymsp[-4].minor.yy0.n>0)?strtoll(yymsp[-4].minor.yy0.z, NULL, 10):-1; + yylhsminor.yy563.maxConnections = (yymsp[-1].minor.yy0.n>0)?atoi(yymsp[-1].minor.yy0.z):-1; + yylhsminor.yy563.stat = yymsp[0].minor.yy0; } - yymsp[-8].minor.yy547 = yylhsminor.yy547; + yymsp[-8].minor.yy563 = yylhsminor.yy563; break; case 89: /* intitemlist ::= intitemlist COMMA intitem */ case 163: /* tagitemlist ::= tagitemlist COMMA tagitem */ yytestcase(yyruleno==163); -{ yylhsminor.yy249 = tVariantListAppend(yymsp[-2].minor.yy249, &yymsp[0].minor.yy134, -1); } - yymsp[-2].minor.yy249 = yylhsminor.yy249; +{ yylhsminor.yy367 = tVariantListAppend(yymsp[-2].minor.yy367, &yymsp[0].minor.yy410, -1); } + yymsp[-2].minor.yy367 = yylhsminor.yy367; break; case 90: /* intitemlist ::= intitem */ case 164: /* tagitemlist ::= tagitem */ yytestcase(yyruleno==164); -{ yylhsminor.yy249 = tVariantListAppend(NULL, &yymsp[0].minor.yy134, -1); } - yymsp[0].minor.yy249 = yylhsminor.yy249; +{ yylhsminor.yy367 = tVariantListAppend(NULL, &yymsp[0].minor.yy410, -1); } + yymsp[0].minor.yy367 = yylhsminor.yy367; break; case 91: /* intitem ::= INTEGER */ case 165: /* tagitem ::= INTEGER */ yytestcase(yyruleno==165); case 166: /* tagitem ::= FLOAT */ yytestcase(yyruleno==166); case 167: /* tagitem ::= STRING */ yytestcase(yyruleno==167); case 168: /* tagitem ::= BOOL */ yytestcase(yyruleno==168); -{ toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yylhsminor.yy134, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy134 = yylhsminor.yy134; +{ toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yylhsminor.yy410, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy410 = yylhsminor.yy410; break; case 92: /* keep ::= KEEP intitemlist */ -{ yymsp[-1].minor.yy249 = yymsp[0].minor.yy249; } +{ yymsp[-1].minor.yy367 = yymsp[0].minor.yy367; } break; case 93: /* cache ::= CACHE INTEGER */ case 94: /* replica ::= REPLICA INTEGER */ yytestcase(yyruleno==94); @@ -2675,204 +2700,204 @@ static void yy_reduce( { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } break; case 108: /* db_optr ::= */ -{setDefaultCreateDbOption(&yymsp[1].minor.yy478); yymsp[1].minor.yy478.dbType = TSDB_DB_TYPE_DEFAULT;} +{setDefaultCreateDbOption(&yymsp[1].minor.yy564); yymsp[1].minor.yy564.dbType = TSDB_DB_TYPE_DEFAULT;} break; case 109: /* db_optr ::= db_optr cache */ -{ yylhsminor.yy478 = yymsp[-1].minor.yy478; yylhsminor.yy478.cacheBlockSize = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy478 = yylhsminor.yy478; +{ yylhsminor.yy564 = yymsp[-1].minor.yy564; yylhsminor.yy564.cacheBlockSize = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy564 = yylhsminor.yy564; break; case 110: /* db_optr ::= db_optr replica */ case 127: /* alter_db_optr ::= alter_db_optr replica */ yytestcase(yyruleno==127); -{ yylhsminor.yy478 = yymsp[-1].minor.yy478; yylhsminor.yy478.replica = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy478 = yylhsminor.yy478; +{ yylhsminor.yy564 = yymsp[-1].minor.yy564; yylhsminor.yy564.replica = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy564 = yylhsminor.yy564; break; case 111: /* db_optr ::= db_optr quorum */ case 128: /* alter_db_optr ::= alter_db_optr quorum */ yytestcase(yyruleno==128); -{ yylhsminor.yy478 = yymsp[-1].minor.yy478; yylhsminor.yy478.quorum = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy478 = yylhsminor.yy478; +{ yylhsminor.yy564 = yymsp[-1].minor.yy564; yylhsminor.yy564.quorum = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy564 = yylhsminor.yy564; break; case 112: /* db_optr ::= db_optr days */ -{ yylhsminor.yy478 = yymsp[-1].minor.yy478; yylhsminor.yy478.daysPerFile = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy478 = yylhsminor.yy478; +{ yylhsminor.yy564 = yymsp[-1].minor.yy564; yylhsminor.yy564.daysPerFile = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy564 = yylhsminor.yy564; break; case 113: /* db_optr ::= db_optr minrows */ -{ yylhsminor.yy478 = yymsp[-1].minor.yy478; yylhsminor.yy478.minRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } - yymsp[-1].minor.yy478 = yylhsminor.yy478; +{ yylhsminor.yy564 = yymsp[-1].minor.yy564; yylhsminor.yy564.minRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } + yymsp[-1].minor.yy564 = yylhsminor.yy564; break; case 114: /* db_optr ::= db_optr maxrows */ -{ yylhsminor.yy478 = yymsp[-1].minor.yy478; yylhsminor.yy478.maxRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } - yymsp[-1].minor.yy478 = yylhsminor.yy478; +{ yylhsminor.yy564 = yymsp[-1].minor.yy564; yylhsminor.yy564.maxRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } + yymsp[-1].minor.yy564 = yylhsminor.yy564; break; case 115: /* db_optr ::= db_optr blocks */ case 130: /* alter_db_optr ::= alter_db_optr blocks */ yytestcase(yyruleno==130); -{ yylhsminor.yy478 = yymsp[-1].minor.yy478; yylhsminor.yy478.numOfBlocks = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy478 = yylhsminor.yy478; +{ yylhsminor.yy564 = yymsp[-1].minor.yy564; yylhsminor.yy564.numOfBlocks = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy564 = yylhsminor.yy564; break; case 116: /* db_optr ::= db_optr ctime */ -{ yylhsminor.yy478 = yymsp[-1].minor.yy478; yylhsminor.yy478.commitTime = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy478 = yylhsminor.yy478; +{ yylhsminor.yy564 = yymsp[-1].minor.yy564; yylhsminor.yy564.commitTime = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy564 = yylhsminor.yy564; break; case 117: /* db_optr ::= db_optr wal */ -{ yylhsminor.yy478 = yymsp[-1].minor.yy478; yylhsminor.yy478.walLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy478 = yylhsminor.yy478; +{ yylhsminor.yy564 = yymsp[-1].minor.yy564; yylhsminor.yy564.walLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy564 = yylhsminor.yy564; break; case 118: /* db_optr ::= db_optr fsync */ -{ yylhsminor.yy478 = yymsp[-1].minor.yy478; yylhsminor.yy478.fsyncPeriod = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy478 = yylhsminor.yy478; +{ yylhsminor.yy564 = yymsp[-1].minor.yy564; yylhsminor.yy564.fsyncPeriod = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy564 = yylhsminor.yy564; break; case 119: /* db_optr ::= db_optr comp */ case 131: /* alter_db_optr ::= alter_db_optr comp */ yytestcase(yyruleno==131); -{ yylhsminor.yy478 = yymsp[-1].minor.yy478; yylhsminor.yy478.compressionLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy478 = yylhsminor.yy478; +{ yylhsminor.yy564 = yymsp[-1].minor.yy564; yylhsminor.yy564.compressionLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy564 = yylhsminor.yy564; break; case 120: /* db_optr ::= db_optr prec */ -{ yylhsminor.yy478 = yymsp[-1].minor.yy478; yylhsminor.yy478.precision = yymsp[0].minor.yy0; } - yymsp[-1].minor.yy478 = yylhsminor.yy478; +{ yylhsminor.yy564 = yymsp[-1].minor.yy564; yylhsminor.yy564.precision = yymsp[0].minor.yy0; } + yymsp[-1].minor.yy564 = yylhsminor.yy564; break; case 121: /* db_optr ::= db_optr keep */ case 129: /* alter_db_optr ::= alter_db_optr keep */ yytestcase(yyruleno==129); -{ yylhsminor.yy478 = yymsp[-1].minor.yy478; yylhsminor.yy478.keep = yymsp[0].minor.yy249; } - yymsp[-1].minor.yy478 = yylhsminor.yy478; +{ yylhsminor.yy564 = yymsp[-1].minor.yy564; yylhsminor.yy564.keep = yymsp[0].minor.yy367; } + yymsp[-1].minor.yy564 = yylhsminor.yy564; break; case 122: /* db_optr ::= db_optr update */ case 132: /* alter_db_optr ::= alter_db_optr update */ yytestcase(yyruleno==132); -{ yylhsminor.yy478 = yymsp[-1].minor.yy478; yylhsminor.yy478.update = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy478 = yylhsminor.yy478; +{ yylhsminor.yy564 = yymsp[-1].minor.yy564; yylhsminor.yy564.update = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy564 = yylhsminor.yy564; break; case 123: /* db_optr ::= db_optr cachelast */ case 133: /* alter_db_optr ::= alter_db_optr cachelast */ yytestcase(yyruleno==133); -{ yylhsminor.yy478 = yymsp[-1].minor.yy478; yylhsminor.yy478.cachelast = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy478 = yylhsminor.yy478; +{ yylhsminor.yy564 = yymsp[-1].minor.yy564; yylhsminor.yy564.cachelast = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy564 = yylhsminor.yy564; break; case 124: /* topic_optr ::= db_optr */ case 135: /* alter_topic_optr ::= alter_db_optr */ yytestcase(yyruleno==135); -{ yylhsminor.yy478 = yymsp[0].minor.yy478; yylhsminor.yy478.dbType = TSDB_DB_TYPE_TOPIC; } - yymsp[0].minor.yy478 = yylhsminor.yy478; +{ yylhsminor.yy564 = yymsp[0].minor.yy564; yylhsminor.yy564.dbType = TSDB_DB_TYPE_TOPIC; } + yymsp[0].minor.yy564 = yylhsminor.yy564; break; case 125: /* topic_optr ::= topic_optr partitions */ case 136: /* alter_topic_optr ::= alter_topic_optr partitions */ yytestcase(yyruleno==136); -{ yylhsminor.yy478 = yymsp[-1].minor.yy478; yylhsminor.yy478.partitions = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy478 = yylhsminor.yy478; +{ yylhsminor.yy564 = yymsp[-1].minor.yy564; yylhsminor.yy564.partitions = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy564 = yylhsminor.yy564; break; case 126: /* alter_db_optr ::= */ -{ setDefaultCreateDbOption(&yymsp[1].minor.yy478); yymsp[1].minor.yy478.dbType = TSDB_DB_TYPE_DEFAULT;} +{ setDefaultCreateDbOption(&yymsp[1].minor.yy564); yymsp[1].minor.yy564.dbType = TSDB_DB_TYPE_DEFAULT;} break; case 134: /* alter_db_optr ::= alter_db_optr minrows */ -{ yylhsminor.yy478 = yymsp[-1].minor.yy478; yylhsminor.yy478.minRowsPerBlock = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy478 = yylhsminor.yy478; +{ yylhsminor.yy564 = yymsp[-1].minor.yy564; yylhsminor.yy564.minRowsPerBlock = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy564 = yylhsminor.yy564; break; case 137: /* typename ::= ids */ { yymsp[0].minor.yy0.type = 0; - tSetColumnType (&yylhsminor.yy475, &yymsp[0].minor.yy0); + tSetColumnType (&yylhsminor.yy307, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy475 = yylhsminor.yy475; + yymsp[0].minor.yy307 = yylhsminor.yy307; break; case 138: /* typename ::= ids LP signed RP */ { - if (yymsp[-1].minor.yy165 <= 0) { + if (yymsp[-1].minor.yy443 <= 0) { yymsp[-3].minor.yy0.type = 0; - tSetColumnType(&yylhsminor.yy475, &yymsp[-3].minor.yy0); + tSetColumnType(&yylhsminor.yy307, &yymsp[-3].minor.yy0); } else { - yymsp[-3].minor.yy0.type = -yymsp[-1].minor.yy165; // negative value of name length - tSetColumnType(&yylhsminor.yy475, &yymsp[-3].minor.yy0); + yymsp[-3].minor.yy0.type = -yymsp[-1].minor.yy443; // negative value of name length + tSetColumnType(&yylhsminor.yy307, &yymsp[-3].minor.yy0); } } - yymsp[-3].minor.yy475 = yylhsminor.yy475; + yymsp[-3].minor.yy307 = yylhsminor.yy307; break; case 139: /* typename ::= ids UNSIGNED */ { yymsp[-1].minor.yy0.type = 0; yymsp[-1].minor.yy0.n = ((yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z); - tSetColumnType (&yylhsminor.yy475, &yymsp[-1].minor.yy0); + tSetColumnType (&yylhsminor.yy307, &yymsp[-1].minor.yy0); } - yymsp[-1].minor.yy475 = yylhsminor.yy475; + yymsp[-1].minor.yy307 = yylhsminor.yy307; break; case 140: /* signed ::= INTEGER */ -{ yylhsminor.yy165 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[0].minor.yy165 = yylhsminor.yy165; +{ yylhsminor.yy443 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[0].minor.yy443 = yylhsminor.yy443; break; case 141: /* signed ::= PLUS INTEGER */ -{ yymsp[-1].minor.yy165 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } +{ yymsp[-1].minor.yy443 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } break; case 142: /* signed ::= MINUS INTEGER */ -{ yymsp[-1].minor.yy165 = -strtol(yymsp[0].minor.yy0.z, NULL, 10);} +{ yymsp[-1].minor.yy443 = -strtol(yymsp[0].minor.yy0.z, NULL, 10);} break; case 146: /* cmd ::= CREATE TABLE create_table_list */ -{ pInfo->type = TSDB_SQL_CREATE_TABLE; pInfo->pCreateTableInfo = yymsp[0].minor.yy494;} +{ pInfo->type = TSDB_SQL_CREATE_TABLE; pInfo->pCreateTableInfo = yymsp[0].minor.yy74;} break; case 147: /* create_table_list ::= create_from_stable */ { SCreateTableSql* pCreateTable = calloc(1, sizeof(SCreateTableSql)); pCreateTable->childTableInfo = taosArrayInit(4, sizeof(SCreatedTableInfo)); - taosArrayPush(pCreateTable->childTableInfo, &yymsp[0].minor.yy192); + taosArrayPush(pCreateTable->childTableInfo, &yymsp[0].minor.yy110); pCreateTable->type = TSQL_CREATE_TABLE_FROM_STABLE; - yylhsminor.yy494 = pCreateTable; + yylhsminor.yy74 = pCreateTable; } - yymsp[0].minor.yy494 = yylhsminor.yy494; + yymsp[0].minor.yy74 = yylhsminor.yy74; break; case 148: /* create_table_list ::= create_table_list create_from_stable */ { - taosArrayPush(yymsp[-1].minor.yy494->childTableInfo, &yymsp[0].minor.yy192); - yylhsminor.yy494 = yymsp[-1].minor.yy494; + taosArrayPush(yymsp[-1].minor.yy74->childTableInfo, &yymsp[0].minor.yy110); + yylhsminor.yy74 = yymsp[-1].minor.yy74; } - yymsp[-1].minor.yy494 = yylhsminor.yy494; + yymsp[-1].minor.yy74 = yylhsminor.yy74; break; case 149: /* create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ { - yylhsminor.yy494 = tSetCreateTableInfo(yymsp[-1].minor.yy249, NULL, NULL, TSQL_CREATE_TABLE); - setSqlInfo(pInfo, yylhsminor.yy494, NULL, TSDB_SQL_CREATE_TABLE); + yylhsminor.yy74 = tSetCreateTableInfo(yymsp[-1].minor.yy367, NULL, NULL, TSQL_CREATE_TABLE); + setSqlInfo(pInfo, yylhsminor.yy74, NULL, TSDB_SQL_CREATE_TABLE); yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; setCreatedTableName(pInfo, &yymsp[-4].minor.yy0, &yymsp[-5].minor.yy0); } - yymsp[-5].minor.yy494 = yylhsminor.yy494; + yymsp[-5].minor.yy74 = yylhsminor.yy74; break; case 150: /* create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ { - yylhsminor.yy494 = tSetCreateTableInfo(yymsp[-5].minor.yy249, yymsp[-1].minor.yy249, NULL, TSQL_CREATE_STABLE); - setSqlInfo(pInfo, yylhsminor.yy494, NULL, TSDB_SQL_CREATE_TABLE); + yylhsminor.yy74 = tSetCreateTableInfo(yymsp[-5].minor.yy367, yymsp[-1].minor.yy367, NULL, TSQL_CREATE_STABLE); + setSqlInfo(pInfo, yylhsminor.yy74, NULL, TSDB_SQL_CREATE_TABLE); yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n; setCreatedTableName(pInfo, &yymsp[-8].minor.yy0, &yymsp[-9].minor.yy0); } - yymsp[-9].minor.yy494 = yylhsminor.yy494; + yymsp[-9].minor.yy74 = yylhsminor.yy74; break; case 151: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ { yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n; - yylhsminor.yy192 = createNewChildTableInfo(&yymsp[-5].minor.yy0, NULL, yymsp[-1].minor.yy249, &yymsp[-8].minor.yy0, &yymsp[-9].minor.yy0); + yylhsminor.yy110 = createNewChildTableInfo(&yymsp[-5].minor.yy0, NULL, yymsp[-1].minor.yy367, &yymsp[-8].minor.yy0, &yymsp[-9].minor.yy0); } - yymsp[-9].minor.yy192 = yylhsminor.yy192; + yymsp[-9].minor.yy110 = yylhsminor.yy110; break; case 152: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */ { yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n; yymsp[-11].minor.yy0.n += yymsp[-10].minor.yy0.n; - yylhsminor.yy192 = createNewChildTableInfo(&yymsp[-8].minor.yy0, yymsp[-5].minor.yy249, yymsp[-1].minor.yy249, &yymsp[-11].minor.yy0, &yymsp[-12].minor.yy0); + yylhsminor.yy110 = createNewChildTableInfo(&yymsp[-8].minor.yy0, yymsp[-5].minor.yy367, yymsp[-1].minor.yy367, &yymsp[-11].minor.yy0, &yymsp[-12].minor.yy0); } - yymsp[-12].minor.yy192 = yylhsminor.yy192; + yymsp[-12].minor.yy110 = yylhsminor.yy110; break; case 153: /* tagNamelist ::= tagNamelist COMMA ids */ -{taosArrayPush(yymsp[-2].minor.yy249, &yymsp[0].minor.yy0); yylhsminor.yy249 = yymsp[-2].minor.yy249; } - yymsp[-2].minor.yy249 = yylhsminor.yy249; +{taosArrayPush(yymsp[-2].minor.yy367, &yymsp[0].minor.yy0); yylhsminor.yy367 = yymsp[-2].minor.yy367; } + yymsp[-2].minor.yy367 = yylhsminor.yy367; break; case 154: /* tagNamelist ::= ids */ -{yylhsminor.yy249 = taosArrayInit(4, sizeof(SStrToken)); taosArrayPush(yylhsminor.yy249, &yymsp[0].minor.yy0);} - yymsp[0].minor.yy249 = yylhsminor.yy249; +{yylhsminor.yy367 = taosArrayInit(4, sizeof(SStrToken)); taosArrayPush(yylhsminor.yy367, &yymsp[0].minor.yy0);} + yymsp[0].minor.yy367 = yylhsminor.yy367; break; case 155: /* create_table_args ::= ifnotexists ids cpxName to_opt split_opt AS select */ { - yylhsminor.yy494 = tSetCreateTableInfo(NULL, NULL, yymsp[0].minor.yy320, TSQL_CREATE_STREAM); - setSqlInfo(pInfo, yylhsminor.yy494, NULL, TSDB_SQL_CREATE_TABLE); + yylhsminor.yy74 = tSetCreateTableInfo(NULL, NULL, yymsp[0].minor.yy426, TSQL_CREATE_STREAM); + setSqlInfo(pInfo, yylhsminor.yy74, NULL, TSDB_SQL_CREATE_TABLE); setCreatedStreamOpt(pInfo, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0); yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; setCreatedTableName(pInfo, &yymsp[-5].minor.yy0, &yymsp[-6].minor.yy0); } - yymsp[-6].minor.yy494 = yylhsminor.yy494; + yymsp[-6].minor.yy74 = yylhsminor.yy74; break; case 156: /* to_opt ::= */ case 158: /* split_opt ::= */ yytestcase(yyruleno==158); @@ -2888,37 +2913,37 @@ static void yy_reduce( { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0;} break; case 160: /* columnlist ::= columnlist COMMA column */ -{taosArrayPush(yymsp[-2].minor.yy249, &yymsp[0].minor.yy475); yylhsminor.yy249 = yymsp[-2].minor.yy249; } - yymsp[-2].minor.yy249 = yylhsminor.yy249; +{taosArrayPush(yymsp[-2].minor.yy367, &yymsp[0].minor.yy307); yylhsminor.yy367 = yymsp[-2].minor.yy367; } + yymsp[-2].minor.yy367 = yylhsminor.yy367; break; case 161: /* columnlist ::= column */ -{yylhsminor.yy249 = taosArrayInit(4, sizeof(TAOS_FIELD)); taosArrayPush(yylhsminor.yy249, &yymsp[0].minor.yy475);} - yymsp[0].minor.yy249 = yylhsminor.yy249; +{yylhsminor.yy367 = taosArrayInit(4, sizeof(TAOS_FIELD)); taosArrayPush(yylhsminor.yy367, &yymsp[0].minor.yy307);} + yymsp[0].minor.yy367 = yylhsminor.yy367; break; case 162: /* column ::= ids typename */ { - tSetColumnInfo(&yylhsminor.yy475, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy475); + tSetColumnInfo(&yylhsminor.yy307, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy307); } - yymsp[-1].minor.yy475 = yylhsminor.yy475; + yymsp[-1].minor.yy307 = yylhsminor.yy307; break; case 169: /* tagitem ::= NULL */ -{ yymsp[0].minor.yy0.type = 0; tVariantCreate(&yylhsminor.yy134, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy134 = yylhsminor.yy134; +{ yymsp[0].minor.yy0.type = 0; tVariantCreate(&yylhsminor.yy410, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy410 = yylhsminor.yy410; break; case 170: /* tagitem ::= NOW */ -{ yymsp[0].minor.yy0.type = TSDB_DATA_TYPE_TIMESTAMP; tVariantCreateExt(&yylhsminor.yy134, &yymsp[0].minor.yy0, TK_NOW, true);} - yymsp[0].minor.yy134 = yylhsminor.yy134; +{ yymsp[0].minor.yy0.type = TSDB_DATA_TYPE_TIMESTAMP; tVariantCreateExt(&yylhsminor.yy410, &yymsp[0].minor.yy0, TK_NOW, true);} + yymsp[0].minor.yy410 = yylhsminor.yy410; break; case 171: /* tagitem ::= NOW PLUS VARIABLE */ { yymsp[0].minor.yy0.type = TSDB_DATA_TYPE_TIMESTAMP; - tVariantCreateExt(&yymsp[-2].minor.yy134, &yymsp[0].minor.yy0, TK_PLUS, true); + tVariantCreateExt(&yymsp[-2].minor.yy410, &yymsp[0].minor.yy0, TK_PLUS, true); } break; case 172: /* tagitem ::= NOW MINUS VARIABLE */ { yymsp[0].minor.yy0.type = TSDB_DATA_TYPE_TIMESTAMP; - tVariantCreateExt(&yymsp[-2].minor.yy134, &yymsp[0].minor.yy0, TK_MINUS, true); + tVariantCreateExt(&yymsp[-2].minor.yy410, &yymsp[0].minor.yy0, TK_MINUS, true); } break; case 173: /* tagitem ::= MINUS INTEGER */ @@ -2929,56 +2954,56 @@ static void yy_reduce( yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = yymsp[0].minor.yy0.type; toTSDBType(yymsp[-1].minor.yy0.type); - tVariantCreate(&yylhsminor.yy134, &yymsp[-1].minor.yy0); + tVariantCreate(&yylhsminor.yy410, &yymsp[-1].minor.yy0); } - yymsp[-1].minor.yy134 = yylhsminor.yy134; + yymsp[-1].minor.yy410 = yylhsminor.yy410; break; case 177: /* select ::= SELECT selcollist from where_opt range_option interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */ { - yylhsminor.yy320 = tSetQuerySqlNode(&yymsp[-14].minor.yy0, yymsp[-13].minor.yy249, yymsp[-12].minor.yy52, yymsp[-11].minor.yy370, yymsp[-4].minor.yy249, yymsp[-2].minor.yy249, &yymsp[-9].minor.yy196, &yymsp[-7].minor.yy559, &yymsp[-6].minor.yy385, &yymsp[-8].minor.yy0, yymsp[-5].minor.yy249, &yymsp[0].minor.yy342, &yymsp[-1].minor.yy342, yymsp[-3].minor.yy370, &yymsp[-10].minor.yy384); + yylhsminor.yy426 = tSetQuerySqlNode(&yymsp[-14].minor.yy0, yymsp[-13].minor.yy367, yymsp[-12].minor.yy480, yymsp[-11].minor.yy378, yymsp[-4].minor.yy367, yymsp[-2].minor.yy367, &yymsp[-9].minor.yy478, &yymsp[-7].minor.yy373, &yymsp[-6].minor.yy204, &yymsp[-8].minor.yy0, yymsp[-5].minor.yy367, &yymsp[0].minor.yy24, &yymsp[-1].minor.yy24, yymsp[-3].minor.yy378, &yymsp[-10].minor.yy214); } - yymsp[-14].minor.yy320 = yylhsminor.yy320; + yymsp[-14].minor.yy426 = yylhsminor.yy426; break; case 178: /* select ::= LP select RP */ -{yymsp[-2].minor.yy320 = yymsp[-1].minor.yy320;} +{yymsp[-2].minor.yy426 = yymsp[-1].minor.yy426;} break; case 179: /* union ::= select */ -{ yylhsminor.yy249 = setSubclause(NULL, yymsp[0].minor.yy320); } - yymsp[0].minor.yy249 = yylhsminor.yy249; +{ yylhsminor.yy367 = setSubclause(NULL, yymsp[0].minor.yy426); } + yymsp[0].minor.yy367 = yylhsminor.yy367; break; case 180: /* union ::= union UNION ALL select */ -{ yylhsminor.yy249 = appendSelectClause(yymsp[-3].minor.yy249, yymsp[0].minor.yy320); } - yymsp[-3].minor.yy249 = yylhsminor.yy249; +{ yylhsminor.yy367 = appendSelectClause(yymsp[-3].minor.yy367, yymsp[0].minor.yy426); } + yymsp[-3].minor.yy367 = yylhsminor.yy367; break; case 181: /* cmd ::= union */ -{ setSqlInfo(pInfo, yymsp[0].minor.yy249, NULL, TSDB_SQL_SELECT); } +{ setSqlInfo(pInfo, yymsp[0].minor.yy367, NULL, TSDB_SQL_SELECT); } break; case 182: /* select ::= SELECT selcollist */ { - yylhsminor.yy320 = tSetQuerySqlNode(&yymsp[-1].minor.yy0, yymsp[0].minor.yy249, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + yylhsminor.yy426 = tSetQuerySqlNode(&yymsp[-1].minor.yy0, yymsp[0].minor.yy367, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); } - yymsp[-1].minor.yy320 = yylhsminor.yy320; + yymsp[-1].minor.yy426 = yylhsminor.yy426; break; case 183: /* sclp ::= selcollist COMMA */ -{yylhsminor.yy249 = yymsp[-1].minor.yy249;} - yymsp[-1].minor.yy249 = yylhsminor.yy249; +{yylhsminor.yy367 = yymsp[-1].minor.yy367;} + yymsp[-1].minor.yy367 = yylhsminor.yy367; break; case 184: /* sclp ::= */ case 225: /* orderby_opt ::= */ yytestcase(yyruleno==225); -{yymsp[1].minor.yy249 = 0;} +{yymsp[1].minor.yy367 = 0;} break; case 185: /* selcollist ::= sclp distinct expr as */ { - yylhsminor.yy249 = tSqlExprListAppend(yymsp[-3].minor.yy249, yymsp[-1].minor.yy370, yymsp[-2].minor.yy0.n? &yymsp[-2].minor.yy0:0, yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0); + yylhsminor.yy367 = tSqlExprListAppend(yymsp[-3].minor.yy367, yymsp[-1].minor.yy378, yymsp[-2].minor.yy0.n? &yymsp[-2].minor.yy0:0, yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0); } - yymsp[-3].minor.yy249 = yylhsminor.yy249; + yymsp[-3].minor.yy367 = yylhsminor.yy367; break; case 186: /* selcollist ::= sclp STAR */ { tSqlExpr *pNode = tSqlExprCreateIdValue(pInfo, NULL, TK_ALL); - yylhsminor.yy249 = tSqlExprListAppend(yymsp[-1].minor.yy249, pNode, 0, 0); + yylhsminor.yy367 = tSqlExprListAppend(yymsp[-1].minor.yy367, pNode, 0, 0); } - yymsp[-1].minor.yy249 = yylhsminor.yy249; + yymsp[-1].minor.yy367 = yylhsminor.yy367; break; case 187: /* as ::= AS ids */ { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } @@ -2996,114 +3021,114 @@ static void yy_reduce( break; case 192: /* from ::= FROM tablelist */ case 193: /* from ::= FROM sub */ yytestcase(yyruleno==193); -{yymsp[-1].minor.yy52 = yymsp[0].minor.yy52;} +{yymsp[-1].minor.yy480 = yymsp[0].minor.yy480;} break; case 194: /* sub ::= LP union RP */ -{yymsp[-2].minor.yy52 = addSubqueryElem(NULL, yymsp[-1].minor.yy249, NULL);} +{yymsp[-2].minor.yy480 = addSubqueryElem(NULL, yymsp[-1].minor.yy367, NULL);} break; case 195: /* sub ::= LP union RP ids */ -{yymsp[-3].minor.yy52 = addSubqueryElem(NULL, yymsp[-2].minor.yy249, &yymsp[0].minor.yy0);} +{yymsp[-3].minor.yy480 = addSubqueryElem(NULL, yymsp[-2].minor.yy367, &yymsp[0].minor.yy0);} break; case 196: /* sub ::= sub COMMA LP union RP ids */ -{yylhsminor.yy52 = addSubqueryElem(yymsp[-5].minor.yy52, yymsp[-2].minor.yy249, &yymsp[0].minor.yy0);} - yymsp[-5].minor.yy52 = yylhsminor.yy52; +{yylhsminor.yy480 = addSubqueryElem(yymsp[-5].minor.yy480, yymsp[-2].minor.yy367, &yymsp[0].minor.yy0);} + yymsp[-5].minor.yy480 = yylhsminor.yy480; break; case 197: /* tablelist ::= ids cpxName */ { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; - yylhsminor.yy52 = setTableNameList(NULL, &yymsp[-1].minor.yy0, NULL); + yylhsminor.yy480 = setTableNameList(NULL, &yymsp[-1].minor.yy0, NULL); } - yymsp[-1].minor.yy52 = yylhsminor.yy52; + yymsp[-1].minor.yy480 = yylhsminor.yy480; break; case 198: /* tablelist ::= ids cpxName ids */ { yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n; - yylhsminor.yy52 = setTableNameList(NULL, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); + yylhsminor.yy480 = setTableNameList(NULL, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy52 = yylhsminor.yy52; + yymsp[-2].minor.yy480 = yylhsminor.yy480; break; case 199: /* tablelist ::= tablelist COMMA ids cpxName */ { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; - yylhsminor.yy52 = setTableNameList(yymsp[-3].minor.yy52, &yymsp[-1].minor.yy0, NULL); + yylhsminor.yy480 = setTableNameList(yymsp[-3].minor.yy480, &yymsp[-1].minor.yy0, NULL); } - yymsp[-3].minor.yy52 = yylhsminor.yy52; + yymsp[-3].minor.yy480 = yylhsminor.yy480; break; case 200: /* tablelist ::= tablelist COMMA ids cpxName ids */ { yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n; - yylhsminor.yy52 = setTableNameList(yymsp[-4].minor.yy52, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); + yylhsminor.yy480 = setTableNameList(yymsp[-4].minor.yy480, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } - yymsp[-4].minor.yy52 = yylhsminor.yy52; + yymsp[-4].minor.yy480 = yylhsminor.yy480; break; case 201: /* tmvar ::= VARIABLE */ {yylhsminor.yy0 = yymsp[0].minor.yy0;} yymsp[0].minor.yy0 = yylhsminor.yy0; break; case 202: /* timestamp ::= INTEGER */ -{ yylhsminor.yy370 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_INTEGER);} - yymsp[0].minor.yy370 = yylhsminor.yy370; +{ yylhsminor.yy378 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_INTEGER);} + yymsp[0].minor.yy378 = yylhsminor.yy378; break; case 203: /* timestamp ::= MINUS INTEGER */ case 204: /* timestamp ::= PLUS INTEGER */ yytestcase(yyruleno==204); -{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy370 = tSqlExprCreateTimestamp(&yymsp[-1].minor.yy0, TK_INTEGER);} - yymsp[-1].minor.yy370 = yylhsminor.yy370; +{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy378 = tSqlExprCreateTimestamp(&yymsp[-1].minor.yy0, TK_INTEGER);} + yymsp[-1].minor.yy378 = yylhsminor.yy378; break; case 205: /* timestamp ::= STRING */ -{ yylhsminor.yy370 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_STRING);} - yymsp[0].minor.yy370 = yylhsminor.yy370; +{ yylhsminor.yy378 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_STRING);} + yymsp[0].minor.yy378 = yylhsminor.yy378; break; case 206: /* timestamp ::= NOW */ -{ yylhsminor.yy370 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_NOW); } - yymsp[0].minor.yy370 = yylhsminor.yy370; +{ yylhsminor.yy378 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_NOW); } + yymsp[0].minor.yy378 = yylhsminor.yy378; break; case 207: /* timestamp ::= NOW PLUS VARIABLE */ -{yymsp[-2].minor.yy370 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_PLUS); } +{yymsp[-2].minor.yy378 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_PLUS); } break; case 208: /* timestamp ::= NOW MINUS VARIABLE */ -{yymsp[-2].minor.yy370 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_MINUS); } +{yymsp[-2].minor.yy378 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_MINUS); } break; case 209: /* range_option ::= */ -{yymsp[1].minor.yy384.start = 0; yymsp[1].minor.yy384.end = 0;} +{yymsp[1].minor.yy214.start = 0; yymsp[1].minor.yy214.end = 0;} break; case 210: /* range_option ::= RANGE LP timestamp COMMA timestamp RP */ -{yymsp[-5].minor.yy384.start = yymsp[-3].minor.yy370; yymsp[-5].minor.yy384.end = yymsp[-1].minor.yy370;} +{yymsp[-5].minor.yy214.start = yymsp[-3].minor.yy378; yymsp[-5].minor.yy214.end = yymsp[-1].minor.yy378;} break; case 211: /* interval_option ::= intervalKey LP tmvar RP */ -{yylhsminor.yy196.interval = yymsp[-1].minor.yy0; yylhsminor.yy196.offset.n = 0; yylhsminor.yy196.token = yymsp[-3].minor.yy88;} - yymsp[-3].minor.yy196 = yylhsminor.yy196; +{yylhsminor.yy478.interval = yymsp[-1].minor.yy0; yylhsminor.yy478.offset.n = 0; yylhsminor.yy478.token = yymsp[-3].minor.yy586;} + yymsp[-3].minor.yy478 = yylhsminor.yy478; break; case 212: /* interval_option ::= intervalKey LP tmvar COMMA tmvar RP */ -{yylhsminor.yy196.interval = yymsp[-3].minor.yy0; yylhsminor.yy196.offset = yymsp[-1].minor.yy0; yylhsminor.yy196.token = yymsp[-5].minor.yy88;} - yymsp[-5].minor.yy196 = yylhsminor.yy196; +{yylhsminor.yy478.interval = yymsp[-3].minor.yy0; yylhsminor.yy478.offset = yymsp[-1].minor.yy0; yylhsminor.yy478.token = yymsp[-5].minor.yy586;} + yymsp[-5].minor.yy478 = yylhsminor.yy478; break; case 213: /* interval_option ::= */ -{memset(&yymsp[1].minor.yy196, 0, sizeof(yymsp[1].minor.yy196));} +{memset(&yymsp[1].minor.yy478, 0, sizeof(yymsp[1].minor.yy478));} break; case 214: /* intervalKey ::= INTERVAL */ -{yymsp[0].minor.yy88 = TK_INTERVAL;} +{yymsp[0].minor.yy586 = TK_INTERVAL;} break; case 215: /* intervalKey ::= EVERY */ -{yymsp[0].minor.yy88 = TK_EVERY; } +{yymsp[0].minor.yy586 = TK_EVERY; } break; case 216: /* session_option ::= */ -{yymsp[1].minor.yy559.col.n = 0; yymsp[1].minor.yy559.gap.n = 0;} +{yymsp[1].minor.yy373.col.n = 0; yymsp[1].minor.yy373.gap.n = 0;} break; case 217: /* session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - yymsp[-6].minor.yy559.col = yymsp[-4].minor.yy0; - yymsp[-6].minor.yy559.gap = yymsp[-1].minor.yy0; + yymsp[-6].minor.yy373.col = yymsp[-4].minor.yy0; + yymsp[-6].minor.yy373.gap = yymsp[-1].minor.yy0; } break; case 218: /* windowstate_option ::= */ -{ yymsp[1].minor.yy385.col.n = 0; yymsp[1].minor.yy385.col.z = NULL;} +{ yymsp[1].minor.yy204.col.n = 0; yymsp[1].minor.yy204.col.z = NULL;} break; case 219: /* windowstate_option ::= STATE_WINDOW LP ids RP */ -{ yymsp[-3].minor.yy385.col = yymsp[-1].minor.yy0; } +{ yymsp[-3].minor.yy204.col = yymsp[-1].minor.yy0; } break; case 220: /* fill_opt ::= */ -{ yymsp[1].minor.yy249 = 0; } +{ yymsp[1].minor.yy367 = 0; } break; case 221: /* fill_opt ::= FILL LP ID COMMA tagitemlist RP */ { @@ -3111,14 +3136,14 @@ static void yy_reduce( toTSDBType(yymsp[-3].minor.yy0.type); tVariantCreate(&A, &yymsp[-3].minor.yy0); - tVariantListInsert(yymsp[-1].minor.yy249, &A, -1, 0); - yymsp[-5].minor.yy249 = yymsp[-1].minor.yy249; + tVariantListInsert(yymsp[-1].minor.yy367, &A, -1, 0); + yymsp[-5].minor.yy367 = yymsp[-1].minor.yy367; } break; case 222: /* fill_opt ::= FILL LP ID RP */ { toTSDBType(yymsp[-1].minor.yy0.type); - yymsp[-3].minor.yy249 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1, true); + yymsp[-3].minor.yy367 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1, true); } break; case 223: /* sliding_opt ::= SLIDING LP tmvar RP */ @@ -3128,321 +3153,324 @@ static void yy_reduce( {yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.z = NULL; yymsp[1].minor.yy0.type = 0; } break; case 226: /* orderby_opt ::= ORDER BY sortlist */ -{yymsp[-2].minor.yy249 = yymsp[0].minor.yy249;} +{yymsp[-2].minor.yy367 = yymsp[0].minor.yy367;} break; case 227: /* sortlist ::= sortlist COMMA item sortorder */ { - yylhsminor.yy249 = commonItemAppend(yymsp[-3].minor.yy249, &yymsp[-1].minor.yy134, NULL, false, yymsp[0].minor.yy424); + yylhsminor.yy367 = commonItemAppend(yymsp[-3].minor.yy367, &yymsp[-1].minor.yy410, NULL, false, yymsp[0].minor.yy274); } - yymsp[-3].minor.yy249 = yylhsminor.yy249; + yymsp[-3].minor.yy367 = yylhsminor.yy367; break; case 228: /* sortlist ::= sortlist COMMA arrow sortorder */ { - yylhsminor.yy249 = commonItemAppend(yymsp[-3].minor.yy249, NULL, yymsp[-1].minor.yy370, true, yymsp[0].minor.yy424); + yylhsminor.yy367 = commonItemAppend(yymsp[-3].minor.yy367, NULL, yymsp[-1].minor.yy378, true, yymsp[0].minor.yy274); } - yymsp[-3].minor.yy249 = yylhsminor.yy249; + yymsp[-3].minor.yy367 = yylhsminor.yy367; break; case 229: /* sortlist ::= item sortorder */ { - yylhsminor.yy249 = commonItemAppend(NULL, &yymsp[-1].minor.yy134, NULL, false, yymsp[0].minor.yy424); + yylhsminor.yy367 = commonItemAppend(NULL, &yymsp[-1].minor.yy410, NULL, false, yymsp[0].minor.yy274); } - yymsp[-1].minor.yy249 = yylhsminor.yy249; + yymsp[-1].minor.yy367 = yylhsminor.yy367; break; case 230: /* sortlist ::= arrow sortorder */ { - yylhsminor.yy249 = commonItemAppend(NULL, NULL, yymsp[-1].minor.yy370, true, yymsp[0].minor.yy424); + yylhsminor.yy367 = commonItemAppend(NULL, NULL, yymsp[-1].minor.yy378, true, yymsp[0].minor.yy274); } - yymsp[-1].minor.yy249 = yylhsminor.yy249; + yymsp[-1].minor.yy367 = yylhsminor.yy367; break; case 231: /* item ::= ID */ { toTSDBType(yymsp[0].minor.yy0.type); - tVariantCreate(&yylhsminor.yy134, &yymsp[0].minor.yy0); + tVariantCreate(&yylhsminor.yy410, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy134 = yylhsminor.yy134; + yymsp[0].minor.yy410 = yylhsminor.yy410; break; case 232: /* item ::= ID DOT ID */ { toTSDBType(yymsp[-2].minor.yy0.type); yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); - tVariantCreate(&yylhsminor.yy134, &yymsp[-2].minor.yy0); + tVariantCreate(&yylhsminor.yy410, &yymsp[-2].minor.yy0); } - yymsp[-2].minor.yy134 = yylhsminor.yy134; + yymsp[-2].minor.yy410 = yylhsminor.yy410; break; case 233: /* sortorder ::= ASC */ -{ yymsp[0].minor.yy424 = TSDB_ORDER_ASC; } +{ yymsp[0].minor.yy274 = TSDB_ORDER_ASC; } break; case 234: /* sortorder ::= DESC */ -{ yymsp[0].minor.yy424 = TSDB_ORDER_DESC;} +{ yymsp[0].minor.yy274 = TSDB_ORDER_DESC;} break; case 235: /* sortorder ::= */ -{ yymsp[1].minor.yy424 = TSDB_ORDER_ASC; } +{ yymsp[1].minor.yy274 = TSDB_ORDER_ASC; } break; case 236: /* groupby_opt ::= */ -{ yymsp[1].minor.yy249 = 0;} +{ yymsp[1].minor.yy367 = 0;} break; case 237: /* groupby_opt ::= GROUP BY grouplist */ -{ yymsp[-2].minor.yy249 = yymsp[0].minor.yy249;} +{ yymsp[-2].minor.yy367 = yymsp[0].minor.yy367;} break; case 238: /* grouplist ::= grouplist COMMA item */ { - yylhsminor.yy249 = commonItemAppend(yymsp[-2].minor.yy249, &yymsp[0].minor.yy134, NULL, false, -1); + yylhsminor.yy367 = commonItemAppend(yymsp[-2].minor.yy367, &yymsp[0].minor.yy410, NULL, false, -1); } - yymsp[-2].minor.yy249 = yylhsminor.yy249; + yymsp[-2].minor.yy367 = yylhsminor.yy367; break; case 239: /* grouplist ::= grouplist COMMA arrow */ { - yylhsminor.yy249 = commonItemAppend(yymsp[-2].minor.yy249, NULL, yymsp[0].minor.yy370, true, -1); + yylhsminor.yy367 = commonItemAppend(yymsp[-2].minor.yy367, NULL, yymsp[0].minor.yy378, true, -1); } - yymsp[-2].minor.yy249 = yylhsminor.yy249; + yymsp[-2].minor.yy367 = yylhsminor.yy367; break; case 240: /* grouplist ::= item */ { - yylhsminor.yy249 = commonItemAppend(NULL, &yymsp[0].minor.yy134, NULL, false, -1); + yylhsminor.yy367 = commonItemAppend(NULL, &yymsp[0].minor.yy410, NULL, false, -1); } - yymsp[0].minor.yy249 = yylhsminor.yy249; + yymsp[0].minor.yy367 = yylhsminor.yy367; break; case 241: /* grouplist ::= arrow */ { - yylhsminor.yy249 = commonItemAppend(NULL, NULL, yymsp[0].minor.yy370, true, -1); + yylhsminor.yy367 = commonItemAppend(NULL, NULL, yymsp[0].minor.yy378, true, -1); } - yymsp[0].minor.yy249 = yylhsminor.yy249; + yymsp[0].minor.yy367 = yylhsminor.yy367; break; case 242: /* having_opt ::= */ case 252: /* where_opt ::= */ yytestcase(yyruleno==252); - case 309: /* expritem ::= */ yytestcase(yyruleno==309); -{yymsp[1].minor.yy370 = 0;} +{yymsp[1].minor.yy378 = 0;} break; case 243: /* having_opt ::= HAVING expr */ case 253: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==253); -{yymsp[-1].minor.yy370 = yymsp[0].minor.yy370;} +{yymsp[-1].minor.yy378 = yymsp[0].minor.yy378;} break; case 244: /* limit_opt ::= */ case 248: /* slimit_opt ::= */ yytestcase(yyruleno==248); -{yymsp[1].minor.yy342.limit = -1; yymsp[1].minor.yy342.offset = 0;} +{yymsp[1].minor.yy24.limit = -1; yymsp[1].minor.yy24.offset = 0;} break; case 245: /* limit_opt ::= LIMIT signed */ case 249: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==249); -{yymsp[-1].minor.yy342.limit = yymsp[0].minor.yy165; yymsp[-1].minor.yy342.offset = 0;} +{yymsp[-1].minor.yy24.limit = yymsp[0].minor.yy443; yymsp[-1].minor.yy24.offset = 0;} break; case 246: /* limit_opt ::= LIMIT signed OFFSET signed */ -{ yymsp[-3].minor.yy342.limit = yymsp[-2].minor.yy165; yymsp[-3].minor.yy342.offset = yymsp[0].minor.yy165;} +{ yymsp[-3].minor.yy24.limit = yymsp[-2].minor.yy443; yymsp[-3].minor.yy24.offset = yymsp[0].minor.yy443;} break; case 247: /* limit_opt ::= LIMIT signed COMMA signed */ -{ yymsp[-3].minor.yy342.limit = yymsp[0].minor.yy165; yymsp[-3].minor.yy342.offset = yymsp[-2].minor.yy165;} +{ yymsp[-3].minor.yy24.limit = yymsp[0].minor.yy443; yymsp[-3].minor.yy24.offset = yymsp[-2].minor.yy443;} break; case 250: /* slimit_opt ::= SLIMIT signed SOFFSET signed */ -{yymsp[-3].minor.yy342.limit = yymsp[-2].minor.yy165; yymsp[-3].minor.yy342.offset = yymsp[0].minor.yy165;} +{yymsp[-3].minor.yy24.limit = yymsp[-2].minor.yy443; yymsp[-3].minor.yy24.offset = yymsp[0].minor.yy443;} break; case 251: /* slimit_opt ::= SLIMIT signed COMMA signed */ -{yymsp[-3].minor.yy342.limit = yymsp[0].minor.yy165; yymsp[-3].minor.yy342.offset = yymsp[-2].minor.yy165;} +{yymsp[-3].minor.yy24.limit = yymsp[0].minor.yy443; yymsp[-3].minor.yy24.offset = yymsp[-2].minor.yy443;} break; case 254: /* expr ::= LP expr RP */ -{yylhsminor.yy370 = yymsp[-1].minor.yy370; yylhsminor.yy370->exprToken.z = yymsp[-2].minor.yy0.z; yylhsminor.yy370->exprToken.n = (yymsp[0].minor.yy0.z - yymsp[-2].minor.yy0.z + 1);} - yymsp[-2].minor.yy370 = yylhsminor.yy370; +{yylhsminor.yy378 = yymsp[-1].minor.yy378; yylhsminor.yy378->exprToken.z = yymsp[-2].minor.yy0.z; yylhsminor.yy378->exprToken.n = (yymsp[0].minor.yy0.z - yymsp[-2].minor.yy0.z + 1);} + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; case 255: /* expr ::= ID */ -{ yylhsminor.yy370 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_ID);} - yymsp[0].minor.yy370 = yylhsminor.yy370; +{ yylhsminor.yy378 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_ID);} + yymsp[0].minor.yy378 = yylhsminor.yy378; break; case 256: /* expr ::= ID DOT ID */ -{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy370 = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ID);} - yymsp[-2].minor.yy370 = yylhsminor.yy370; +{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy378 = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ID);} + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; case 257: /* expr ::= ID DOT STAR */ -{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy370 = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ALL);} - yymsp[-2].minor.yy370 = yylhsminor.yy370; +{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy378 = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ALL);} + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; case 258: /* expr ::= INTEGER */ -{ yylhsminor.yy370 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_INTEGER);} - yymsp[0].minor.yy370 = yylhsminor.yy370; +{ yylhsminor.yy378 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_INTEGER);} + yymsp[0].minor.yy378 = yylhsminor.yy378; break; case 259: /* expr ::= MINUS INTEGER */ case 260: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==260); -{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy370 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_INTEGER);} - yymsp[-1].minor.yy370 = yylhsminor.yy370; +{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy378 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_INTEGER);} + yymsp[-1].minor.yy378 = yylhsminor.yy378; break; case 261: /* expr ::= FLOAT */ -{ yylhsminor.yy370 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_FLOAT);} - yymsp[0].minor.yy370 = yylhsminor.yy370; +{ yylhsminor.yy378 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_FLOAT);} + yymsp[0].minor.yy378 = yylhsminor.yy378; break; case 262: /* expr ::= MINUS FLOAT */ case 263: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==263); -{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yylhsminor.yy370 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_FLOAT);} - yymsp[-1].minor.yy370 = yylhsminor.yy370; +{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yylhsminor.yy378 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_FLOAT);} + yymsp[-1].minor.yy378 = yylhsminor.yy378; break; case 264: /* expr ::= STRING */ -{ yylhsminor.yy370 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING);} - yymsp[0].minor.yy370 = yylhsminor.yy370; +{ yylhsminor.yy378 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING);} + yymsp[0].minor.yy378 = yylhsminor.yy378; break; case 265: /* expr ::= NOW */ -{ yylhsminor.yy370 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_NOW); } - yymsp[0].minor.yy370 = yylhsminor.yy370; +{ yylhsminor.yy378 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_NOW); } + yymsp[0].minor.yy378 = yylhsminor.yy378; break; case 266: /* expr ::= TODAY */ -{ yylhsminor.yy370 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_TODAY); } - yymsp[0].minor.yy370 = yylhsminor.yy370; +{ yylhsminor.yy378 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_TODAY); } + yymsp[0].minor.yy378 = yylhsminor.yy378; break; case 267: /* expr ::= VARIABLE */ -{ yylhsminor.yy370 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_VARIABLE);} - yymsp[0].minor.yy370 = yylhsminor.yy370; +{ yylhsminor.yy378 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_VARIABLE);} + yymsp[0].minor.yy378 = yylhsminor.yy378; break; case 268: /* expr ::= PLUS VARIABLE */ case 269: /* expr ::= MINUS VARIABLE */ yytestcase(yyruleno==269); -{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_VARIABLE; yylhsminor.yy370 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_VARIABLE);} - yymsp[-1].minor.yy370 = yylhsminor.yy370; +{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_VARIABLE; yylhsminor.yy378 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_VARIABLE);} + yymsp[-1].minor.yy378 = yylhsminor.yy378; break; case 270: /* expr ::= BOOL */ -{ yylhsminor.yy370 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_BOOL);} - yymsp[0].minor.yy370 = yylhsminor.yy370; +{ yylhsminor.yy378 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_BOOL);} + yymsp[0].minor.yy378 = yylhsminor.yy378; break; case 271: /* expr ::= NULL */ -{ yylhsminor.yy370 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_NULL);} - yymsp[0].minor.yy370 = yylhsminor.yy370; +{ yylhsminor.yy378 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_NULL);} + yymsp[0].minor.yy378 = yylhsminor.yy378; break; case 272: /* expr ::= ID LP exprlist RP */ -{ tStrTokenAppend(pInfo->funcs, &yymsp[-3].minor.yy0); yylhsminor.yy370 = tSqlExprCreateFunction(yymsp[-1].minor.yy249, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } - yymsp[-3].minor.yy370 = yylhsminor.yy370; +{ tStrTokenAppend(pInfo->funcs, &yymsp[-3].minor.yy0); yylhsminor.yy378 = tSqlExprCreateFunction(yymsp[-1].minor.yy367, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } + yymsp[-3].minor.yy378 = yylhsminor.yy378; break; case 273: /* expr ::= ID LP STAR RP */ -{ tStrTokenAppend(pInfo->funcs, &yymsp[-3].minor.yy0); yylhsminor.yy370 = tSqlExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } - yymsp[-3].minor.yy370 = yylhsminor.yy370; +{ tStrTokenAppend(pInfo->funcs, &yymsp[-3].minor.yy0); yylhsminor.yy378 = tSqlExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } + yymsp[-3].minor.yy378 = yylhsminor.yy378; + break; + case 274: /* expr ::= ID LP RP */ +{ tStrTokenAppend(pInfo->funcs, &yymsp[-2].minor.yy0); yylhsminor.yy378 = tSqlExprCreateFunction(tSqlExprListAppend(0, 0, 0, 0), &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-2].minor.yy0.type); } + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 274: /* expr ::= ID LP expr AS typename RP */ -{ tStrTokenAppend(pInfo->funcs, &yymsp[-5].minor.yy0); yylhsminor.yy370 = tSqlExprCreateFuncWithParams(pInfo, yymsp[-3].minor.yy370, &yymsp[-1].minor.yy475, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, yymsp[-5].minor.yy0.type); } - yymsp[-5].minor.yy370 = yylhsminor.yy370; + case 275: /* expr ::= ID LP expr AS typename RP */ +{ tStrTokenAppend(pInfo->funcs, &yymsp[-5].minor.yy0); yylhsminor.yy378 = tSqlExprCreateFuncWithParams(pInfo, yymsp[-3].minor.yy378, &yymsp[-1].minor.yy307, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, yymsp[-5].minor.yy0.type); } + yymsp[-5].minor.yy378 = yylhsminor.yy378; break; - case 275: /* expr ::= expr IS NULL */ -{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, NULL, TK_ISNULL);} - yymsp[-2].minor.yy370 = yylhsminor.yy370; + case 276: /* expr ::= expr IS NULL */ +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, NULL, TK_ISNULL);} + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 276: /* expr ::= expr IS NOT NULL */ -{yylhsminor.yy370 = tSqlExprCreate(yymsp[-3].minor.yy370, NULL, TK_NOTNULL);} - yymsp[-3].minor.yy370 = yylhsminor.yy370; + case 277: /* expr ::= expr IS NOT NULL */ +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-3].minor.yy378, NULL, TK_NOTNULL);} + yymsp[-3].minor.yy378 = yylhsminor.yy378; break; - case 277: /* expr ::= expr LT expr */ -{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_LT);} - yymsp[-2].minor.yy370 = yylhsminor.yy370; + case 278: /* expr ::= expr LT expr */ +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_LT);} + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 278: /* expr ::= expr GT expr */ -{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_GT);} - yymsp[-2].minor.yy370 = yylhsminor.yy370; + case 279: /* expr ::= expr GT expr */ +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_GT);} + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 279: /* expr ::= expr LE expr */ -{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_LE);} - yymsp[-2].minor.yy370 = yylhsminor.yy370; + case 280: /* expr ::= expr LE expr */ +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_LE);} + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 280: /* expr ::= expr GE expr */ -{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_GE);} - yymsp[-2].minor.yy370 = yylhsminor.yy370; + case 281: /* expr ::= expr GE expr */ +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_GE);} + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 281: /* expr ::= expr NE expr */ -{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_NE);} - yymsp[-2].minor.yy370 = yylhsminor.yy370; + case 282: /* expr ::= expr NE expr */ +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_NE);} + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 282: /* expr ::= expr EQ expr */ -{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_EQ);} - yymsp[-2].minor.yy370 = yylhsminor.yy370; + case 283: /* expr ::= expr EQ expr */ +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_EQ);} + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 283: /* expr ::= expr BETWEEN expr AND expr */ -{ tSqlExpr* X2 = tSqlExprClone(yymsp[-4].minor.yy370); yylhsminor.yy370 = tSqlExprCreate(tSqlExprCreate(yymsp[-4].minor.yy370, yymsp[-2].minor.yy370, TK_GE), tSqlExprCreate(X2, yymsp[0].minor.yy370, TK_LE), TK_AND);} - yymsp[-4].minor.yy370 = yylhsminor.yy370; + case 284: /* expr ::= expr BETWEEN expr AND expr */ +{ tSqlExpr* X2 = tSqlExprClone(yymsp[-4].minor.yy378); yylhsminor.yy378 = tSqlExprCreate(tSqlExprCreate(yymsp[-4].minor.yy378, yymsp[-2].minor.yy378, TK_GE), tSqlExprCreate(X2, yymsp[0].minor.yy378, TK_LE), TK_AND);} + yymsp[-4].minor.yy378 = yylhsminor.yy378; break; - case 284: /* expr ::= expr AND expr */ -{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_AND);} - yymsp[-2].minor.yy370 = yylhsminor.yy370; + case 285: /* expr ::= expr AND expr */ +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_AND);} + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 285: /* expr ::= expr OR expr */ -{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_OR); } - yymsp[-2].minor.yy370 = yylhsminor.yy370; + case 286: /* expr ::= expr OR expr */ +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_OR); } + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 286: /* expr ::= expr PLUS expr */ -{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_PLUS); } - yymsp[-2].minor.yy370 = yylhsminor.yy370; + case 287: /* expr ::= expr PLUS expr */ +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_PLUS); } + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 287: /* expr ::= expr MINUS expr */ -{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_MINUS); } - yymsp[-2].minor.yy370 = yylhsminor.yy370; + case 288: /* expr ::= expr MINUS expr */ +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_MINUS); } + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 288: /* expr ::= expr STAR expr */ -{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_STAR); } - yymsp[-2].minor.yy370 = yylhsminor.yy370; + case 289: /* expr ::= expr STAR expr */ +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_STAR); } + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 289: /* expr ::= expr SLASH expr */ -{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_DIVIDE);} - yymsp[-2].minor.yy370 = yylhsminor.yy370; + case 290: /* expr ::= expr SLASH expr */ +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_DIVIDE);} + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 290: /* expr ::= expr REM expr */ -{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_REM); } - yymsp[-2].minor.yy370 = yylhsminor.yy370; + case 291: /* expr ::= expr REM expr */ +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_REM); } + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 291: /* expr ::= expr BITAND expr */ -{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_BITAND);} - yymsp[-2].minor.yy370 = yylhsminor.yy370; + case 292: /* expr ::= expr BITAND expr */ +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_BITAND);} + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 292: /* expr ::= expr BITOR expr */ -{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_BITOR); } - yymsp[-2].minor.yy370 = yylhsminor.yy370; + case 293: /* expr ::= expr BITOR expr */ +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_BITOR); } + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 293: /* expr ::= expr BITXOR expr */ -{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_BITXOR);} - yymsp[-2].minor.yy370 = yylhsminor.yy370; + case 294: /* expr ::= expr BITXOR expr */ +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_BITXOR);} + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 294: /* expr ::= BITNOT expr */ -{yymsp[-1].minor.yy370 = tSqlExprCreate(yymsp[0].minor.yy370, NULL, TK_BITNOT);} + case 295: /* expr ::= BITNOT expr */ +{yymsp[-1].minor.yy378 = tSqlExprCreate(yymsp[0].minor.yy378, NULL, TK_BITNOT);} break; - case 295: /* expr ::= expr LSHIFT expr */ -{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_LSHIFT);} - yymsp[-2].minor.yy370 = yylhsminor.yy370; + case 296: /* expr ::= expr LSHIFT expr */ +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_LSHIFT);} + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 296: /* expr ::= expr RSHIFT expr */ -{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_RSHIFT);} - yymsp[-2].minor.yy370 = yylhsminor.yy370; + case 297: /* expr ::= expr RSHIFT expr */ +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_RSHIFT);} + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 297: /* expr ::= expr LIKE expr */ -{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_LIKE); } - yymsp[-2].minor.yy370 = yylhsminor.yy370; + case 298: /* expr ::= expr LIKE expr */ +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_LIKE); } + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 298: /* expr ::= expr MATCH expr */ -{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_MATCH); } - yymsp[-2].minor.yy370 = yylhsminor.yy370; + case 299: /* expr ::= expr MATCH expr */ +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_MATCH); } + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 299: /* expr ::= expr NMATCH expr */ -{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_NMATCH); } - yymsp[-2].minor.yy370 = yylhsminor.yy370; + case 300: /* expr ::= expr NMATCH expr */ +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_NMATCH); } + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 300: /* expr ::= ID CONTAINS STRING */ -{ tSqlExpr* S = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ID); tSqlExpr* M = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING); yylhsminor.yy370 = tSqlExprCreate(S, M, TK_CONTAINS); } - yymsp[-2].minor.yy370 = yylhsminor.yy370; + case 301: /* expr ::= ID CONTAINS STRING */ +{ tSqlExpr* S = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ID); tSqlExpr* M = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING); yylhsminor.yy378 = tSqlExprCreate(S, M, TK_CONTAINS); } + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 301: /* expr ::= ID DOT ID CONTAINS STRING */ -{ yymsp[-4].minor.yy0.n += (1+yymsp[-2].minor.yy0.n); tSqlExpr* S = tSqlExprCreateIdValue(pInfo, &yymsp[-4].minor.yy0, TK_ID); tSqlExpr* M = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING); yylhsminor.yy370 = tSqlExprCreate(S, M, TK_CONTAINS); } - yymsp[-4].minor.yy370 = yylhsminor.yy370; + case 302: /* expr ::= ID DOT ID CONTAINS STRING */ +{ yymsp[-4].minor.yy0.n += (1+yymsp[-2].minor.yy0.n); tSqlExpr* S = tSqlExprCreateIdValue(pInfo, &yymsp[-4].minor.yy0, TK_ID); tSqlExpr* M = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING); yylhsminor.yy378 = tSqlExprCreate(S, M, TK_CONTAINS); } + yymsp[-4].minor.yy378 = yylhsminor.yy378; break; - case 302: /* arrow ::= ID ARROW STRING */ -{tSqlExpr* S = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ID); tSqlExpr* M = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING); yylhsminor.yy370 = tSqlExprCreate(S, M, TK_ARROW); } - yymsp[-2].minor.yy370 = yylhsminor.yy370; + case 303: /* arrow ::= ID ARROW STRING */ +{tSqlExpr* S = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ID); tSqlExpr* M = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING); yylhsminor.yy378 = tSqlExprCreate(S, M, TK_ARROW); } + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 303: /* arrow ::= ID DOT ID ARROW STRING */ -{yymsp[-4].minor.yy0.n += (1+yymsp[-2].minor.yy0.n); tSqlExpr* S = tSqlExprCreateIdValue(pInfo, &yymsp[-4].minor.yy0, TK_ID); tSqlExpr* M = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING); yylhsminor.yy370 = tSqlExprCreate(S, M, TK_ARROW); } - yymsp[-4].minor.yy370 = yylhsminor.yy370; + case 304: /* arrow ::= ID DOT ID ARROW STRING */ +{yymsp[-4].minor.yy0.n += (1+yymsp[-2].minor.yy0.n); tSqlExpr* S = tSqlExprCreateIdValue(pInfo, &yymsp[-4].minor.yy0, TK_ID); tSqlExpr* M = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING); yylhsminor.yy378 = tSqlExprCreate(S, M, TK_ARROW); } + yymsp[-4].minor.yy378 = yylhsminor.yy378; break; - case 304: /* expr ::= arrow */ - case 308: /* expritem ::= expr */ yytestcase(yyruleno==308); -{yylhsminor.yy370 = yymsp[0].minor.yy370;} - yymsp[0].minor.yy370 = yylhsminor.yy370; + case 305: /* expr ::= arrow */ + case 309: /* expritem ::= expr */ yytestcase(yyruleno==309); +{yylhsminor.yy378 = yymsp[0].minor.yy378;} + yymsp[0].minor.yy378 = yylhsminor.yy378; break; - case 305: /* expr ::= expr IN LP exprlist RP */ -{yylhsminor.yy370 = tSqlExprCreate(yymsp[-4].minor.yy370, (tSqlExpr*)yymsp[-1].minor.yy249, TK_IN); } - yymsp[-4].minor.yy370 = yylhsminor.yy370; + case 306: /* expr ::= expr IN LP exprlist RP */ +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-4].minor.yy378, (tSqlExpr*)yymsp[-1].minor.yy367, TK_IN); } + yymsp[-4].minor.yy378 = yylhsminor.yy378; break; - case 306: /* exprlist ::= exprlist COMMA expritem */ -{yylhsminor.yy249 = tSqlExprListAppend(yymsp[-2].minor.yy249,yymsp[0].minor.yy370,0, 0);} - yymsp[-2].minor.yy249 = yylhsminor.yy249; + case 307: /* exprlist ::= exprlist COMMA expritem */ +{yylhsminor.yy367 = tSqlExprListAppend(yymsp[-2].minor.yy367,yymsp[0].minor.yy378,0, 0);} + yymsp[-2].minor.yy367 = yylhsminor.yy367; break; - case 307: /* exprlist ::= expritem */ -{yylhsminor.yy249 = tSqlExprListAppend(0,yymsp[0].minor.yy370,0, 0);} - yymsp[0].minor.yy249 = yylhsminor.yy249; + case 308: /* exprlist ::= expritem */ +{yylhsminor.yy367 = tSqlExprListAppend(0,yymsp[0].minor.yy378,0, 0);} + yymsp[0].minor.yy367 = yylhsminor.yy367; break; case 310: /* cmd ::= RESET QUERY CACHE */ { setDCLSqlElems(pInfo, TSDB_SQL_RESET_CACHE, 0);} @@ -3453,7 +3481,7 @@ static void yy_reduce( case 312: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy249, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, -1); + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy367, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; @@ -3471,14 +3499,14 @@ static void yy_reduce( case 314: /* cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy249, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, -1); + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy367, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; case 315: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy249, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, -1); + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy367, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; @@ -3513,7 +3541,7 @@ static void yy_reduce( toTSDBType(yymsp[-2].minor.yy0.type); SArray* A = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1, false); - A = tVariantListAppend(A, &yymsp[0].minor.yy134, -1); + A = tVariantListAppend(A, &yymsp[0].minor.yy410, -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); @@ -3522,14 +3550,14 @@ static void yy_reduce( case 319: /* cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy249, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, -1); + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy367, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; case 320: /* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy249, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, TSDB_SUPER_TABLE); + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy367, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; @@ -3547,14 +3575,14 @@ static void yy_reduce( case 322: /* cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy249, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, TSDB_SUPER_TABLE); + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy367, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; case 323: /* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy249, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, TSDB_SUPER_TABLE); + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy367, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; @@ -3589,7 +3617,7 @@ static void yy_reduce( toTSDBType(yymsp[-2].minor.yy0.type); SArray* A = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1, false); - A = tVariantListAppend(A, &yymsp[0].minor.yy134, -1); + A = tVariantListAppend(A, &yymsp[0].minor.yy410, -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); @@ -3598,7 +3626,7 @@ static void yy_reduce( case 327: /* cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy249, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, TSDB_SUPER_TABLE); + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy367, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; @@ -3614,7 +3642,7 @@ static void yy_reduce( case 331: /* cmd ::= DELETE FROM ifexists ids cpxName where_opt */ { yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n; - SDelData * pDelData = tGetDelData(&yymsp[-2].minor.yy0, &yymsp[-3].minor.yy0, yymsp[0].minor.yy370); + SDelData * pDelData = tGetDelData(&yymsp[-2].minor.yy0, &yymsp[-3].minor.yy0, yymsp[0].minor.yy378); setSqlInfo(pInfo, pDelData, NULL, TSDB_SQL_DELETE_DATA); } break; @@ -3639,6 +3667,7 @@ static void yy_reduce( yymsp->stateno = (YYACTIONTYPE)yyact; yymsp->major = (YYCODETYPE)yygoto; yyTraceShift(yypParser, yyact, "... then shift"); + return yyact; } /* @@ -3648,7 +3677,8 @@ static void yy_reduce( static void yy_parse_failed( yyParser *yypParser /* The parser */ ){ - ParseARG_FETCH; + ParseARG_FETCH + ParseCTX_FETCH #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt); @@ -3659,7 +3689,8 @@ static void yy_parse_failed( ** parser fails */ /************ Begin %parse_failure code ***************************************/ /************ End %parse_failure code *****************************************/ - ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ + ParseARG_STORE /* Suppress warning about unused %extra_argument variable */ + ParseCTX_STORE } #endif /* YYNOERRORRECOVERY */ @@ -3671,7 +3702,8 @@ static void yy_syntax_error( int yymajor, /* The major type of the error token */ ParseTOKENTYPE yyminor /* The minor type of the error token */ ){ - ParseARG_FETCH; + ParseARG_FETCH + ParseCTX_FETCH #define TOKEN yyminor /************ Begin %syntax_error code ****************************************/ @@ -3697,7 +3729,8 @@ static void yy_syntax_error( assert(len <= outputBufLen); /************ End %syntax_error code ******************************************/ - ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ + ParseARG_STORE /* Suppress warning about unused %extra_argument variable */ + ParseCTX_STORE } /* @@ -3706,7 +3739,8 @@ static void yy_syntax_error( static void yy_accept( yyParser *yypParser /* The parser */ ){ - ParseARG_FETCH; + ParseARG_FETCH + ParseCTX_FETCH #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt); @@ -3721,7 +3755,8 @@ static void yy_accept( /*********** Begin %parse_accept code *****************************************/ /*********** End %parse_accept code *******************************************/ - ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ + ParseARG_STORE /* Suppress warning about unused %extra_argument variable */ + ParseCTX_STORE } /* The main parser program. @@ -3750,45 +3785,47 @@ void Parse( ParseARG_PDECL /* Optional %extra_argument parameter */ ){ YYMINORTYPE yyminorunion; - unsigned int yyact; /* The parser action. */ + YYACTIONTYPE yyact; /* The parser action. */ #if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY) int yyendofinput; /* True if we are at the end of input */ #endif #ifdef YYERRORSYMBOL int yyerrorhit = 0; /* True if yymajor has invoked an error */ #endif - yyParser *yypParser; /* The parser */ + yyParser *yypParser = (yyParser*)yyp; /* The parser */ + ParseCTX_FETCH + ParseARG_STORE - yypParser = (yyParser*)yyp; assert( yypParser->yytos!=0 ); #if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY) yyendofinput = (yymajor==0); #endif - ParseARG_STORE; + yyact = yypParser->yytos->stateno; #ifndef NDEBUG if( yyTraceFILE ){ - int stateno = yypParser->yytos->stateno; - if( stateno < YY_MIN_REDUCE ){ + if( yyact < YY_MIN_REDUCE ){ fprintf(yyTraceFILE,"%sInput '%s' in state %d\n", - yyTracePrompt,yyTokenName[yymajor],stateno); + yyTracePrompt,yyTokenName[yymajor],yyact); }else{ fprintf(yyTraceFILE,"%sInput '%s' with pending reduce %d\n", - yyTracePrompt,yyTokenName[yymajor],stateno-YY_MIN_REDUCE); + yyTracePrompt,yyTokenName[yymajor],yyact-YY_MIN_REDUCE); } } #endif do{ - yyact = yy_find_shift_action(yypParser,(YYCODETYPE)yymajor); + assert( yyact==yypParser->yytos->stateno ); + yyact = yy_find_shift_action((YYCODETYPE)yymajor,yyact); if( yyact >= YY_MIN_REDUCE ){ - yy_reduce(yypParser,yyact-YY_MIN_REDUCE,yymajor,yyminor); + yyact = yy_reduce(yypParser,yyact-YY_MIN_REDUCE,yymajor, + yyminor ParseCTX_PARAM); }else if( yyact <= YY_MAX_SHIFTREDUCE ){ - yy_shift(yypParser,yyact,yymajor,yyminor); + yy_shift(yypParser,yyact,(YYCODETYPE)yymajor,yyminor); #ifndef YYNOERRORRECOVERY yypParser->yyerrcnt--; #endif - yymajor = YYNOCODE; + break; }else if( yyact==YY_ACCEPT_ACTION ){ yypParser->yytos--; yy_accept(yypParser); @@ -3839,10 +3876,9 @@ void Parse( yymajor = YYNOCODE; }else{ while( yypParser->yytos >= yypParser->yystack - && yymx != YYERRORSYMBOL && (yyact = yy_find_reduce_action( yypParser->yytos->stateno, - YYERRORSYMBOL)) >= YY_MIN_REDUCE + YYERRORSYMBOL)) > YY_MAX_SHIFTREDUCE ){ yy_pop_parser_stack(yypParser); } @@ -3859,6 +3895,8 @@ void Parse( } yypParser->yyerrcnt = 3; yyerrorhit = 1; + if( yymajor==YYNOCODE ) break; + yyact = yypParser->yytos->stateno; #elif defined(YYNOERRORRECOVERY) /* If the YYNOERRORRECOVERY macro is defined, then do not attempt to ** do any kind of error recovery. Instead, simply invoke the syntax @@ -3869,8 +3907,7 @@ void Parse( */ yy_syntax_error(yypParser,yymajor, yyminor); yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); - yymajor = YYNOCODE; - + break; #else /* YYERRORSYMBOL is not defined */ /* This is what we do if the grammar does not define ERROR: ** @@ -3892,10 +3929,10 @@ void Parse( yypParser->yyerrcnt = -1; #endif } - yymajor = YYNOCODE; + break; #endif } - }while( yymajor!=YYNOCODE && yypParser->yytos>yypParser->yystack ); + }while( yypParser->yytos>yypParser->yystack ); #ifndef NDEBUG if( yyTraceFILE ){ yyStackEntry *i; @@ -3910,3 +3947,18 @@ void Parse( #endif return; } + +/* +** Return the fallback token corresponding to canonical token iToken, or +** 0 if iToken has no fallback. +*/ +int ParseFallback(int iToken){ +#ifdef YYFALLBACK + if( iToken<(int)(sizeof(yyFallback)/sizeof(yyFallback[0])) ){ + return yyFallback[iToken]; + } +#else + (void)iToken; +#endif + return 0; +} diff --git a/src/query/tests/CMakeLists.txt b/src/query/tests/CMakeLists.txt index 5143c0fdc161fcc29278d5f772ced1c2717de064..6f19d2b139423e7683bd6a5c9e58b25247a4c245 100644 --- a/src/query/tests/CMakeLists.txt +++ b/src/query/tests/CMakeLists.txt @@ -30,11 +30,11 @@ IF (HEADER_GTEST_INCLUDE_DIR AND (LIB_GTEST_STATIC_DIR OR LIB_GTEST_SHARED_DIR)) ENDIF() ENDIF() -SET_SOURCE_FILES_PROPERTIES(./astTest.cpp PROPERTIES COMPILE_FLAGS -w) -SET_SOURCE_FILES_PROPERTIES(./histogramTest.cpp PROPERTIES COMPILE_FLAGS -w) -SET_SOURCE_FILES_PROPERTIES(./percentileTest.cpp PROPERTIES COMPILE_FLAGS -w) -SET_SOURCE_FILES_PROPERTIES(./apercentileTest.cpp PROPERTIES COMPILE_FLAGS -w) -SET_SOURCE_FILES_PROPERTIES(./resultBufferTest.cpp PROPERTIES COMPILE_FLAGS -w) +#SET_SOURCE_FILES_PROPERTIES(./astTest.cpp PROPERTIES COMPILE_FLAGS -w) +#SET_SOURCE_FILES_PROPERTIES(./histogramTest.cpp PROPERTIES COMPILE_FLAGS -w) +#SET_SOURCE_FILES_PROPERTIES(./percentileTest.cpp PROPERTIES COMPILE_FLAGS -w) +#SET_SOURCE_FILES_PROPERTIES(./apercentileTest.cpp PROPERTIES COMPILE_FLAGS -w) +#SET_SOURCE_FILES_PROPERTIES(./resultBufferTest.cpp PROPERTIES COMPILE_FLAGS -w) SET_SOURCE_FILES_PROPERTIES(./tsBufTest.cpp PROPERTIES COMPILE_FLAGS -w) -SET_SOURCE_FILES_PROPERTIES(./unitTest.cpp PROPERTIES COMPILE_FLAGS -w) -SET_SOURCE_FILES_PROPERTIES(./rangeMergeTest.cpp PROPERTIES COMPILE_FLAGS -w) +#SET_SOURCE_FILES_PROPERTIES(./unitTest.cpp PROPERTIES COMPILE_FLAGS -w) +#SET_SOURCE_FILES_PROPERTIES(./rangeMergeTest.cpp PROPERTIES COMPILE_FLAGS -w) diff --git a/src/query/tests/apercentileTest.cpp b/src/query/tests/apercentileTest.cpp index 12450846f39788019c560e1f726af4ab21f236bd..246b0a4e09a7b430c9f5390bf2728f137a63a1c4 100644 --- a/src/query/tests/apercentileTest.cpp +++ b/src/query/tests/apercentileTest.cpp @@ -291,13 +291,13 @@ void tdigestTest() { for (int32_t j = 0; j < typeTimes; ++j) { printf("DMode:%d,Type:%d,randP:%d -", dataMode[i], dataTypes[j], randPers[p]); for (int32_t m = 0; m < numTimes; ++m) { - printf(" %d:%f", totalNum[m], useTime[0][i][j][m][p]); + printf(" %ld:%f", totalNum[m], useTime[0][i][j][m][p]); } printf("\n"); printf("HMode:%d,Type:%d,randP:%d -", dataMode[i], dataTypes[j], randPers[p]); for (int32_t m = 0; m < numTimes; ++m) { - printf(" %d:%f", totalNum[m], useTime[1][i][j][m][p]); + printf(" %ld:%f", totalNum[m], useTime[1][i][j][m][p]); } printf("\n"); } @@ -307,13 +307,13 @@ void tdigestTest() { for (int32_t j = 0; j < typeTimes; ++j) { printf("DMode:%d,Type:%d,randL:%d -", dataMode[i], dataTypes[j], randLimits[p]); for (int64_t m = 0; m < numTimes; ++m) { - printf(" %d:%f", totalNum[m], useTime[0][i][j][m][p]); + printf(" %ld:%f", totalNum[m], useTime[0][i][j][m][p]); } printf("\n"); printf("HMode:%d,Type:%d,randL:%d -", dataMode[i], dataTypes[j], randLimits[p]); for (int64_t m = 0; m < numTimes; ++m) { - printf(" %d:%f", totalNum[m], useTime[1][i][j][m][p]); + printf(" %ld:%f", totalNum[m], useTime[1][i][j][m][p]); } printf("\n"); } @@ -322,13 +322,13 @@ void tdigestTest() { for (int32_t j = 0; j < typeTimes; ++j) { printf("DMode:%d,Type:%d -", dataMode[i], dataTypes[j]); for (int64_t m = 0; m < numTimes; ++m) { - printf(" %d:%f", totalNum[m], useTime[0][i][j][m][0]); + printf(" %ld:%f", totalNum[m], useTime[0][i][j][m][0]); } printf("\n"); printf("HMode:%d,Type:%d -", dataMode[i], dataTypes[j]); for (int64_t m = 0; m < numTimes; ++m) { - printf(" %d:%f", totalNum[m], useTime[1][i][j][m][0]); + printf(" %ld:%f", totalNum[m], useTime[1][i][j][m][0]); } printf("\n"); } diff --git a/src/query/tests/histogramTest.cpp b/src/query/tests/histogramTest.cpp index 70c334631c39eed88913b58edf06d9d5520b6f2c..72bfbbcdf70e1fd50696c3891557b0edec5b6c25 100644 --- a/src/query/tests/histogramTest.cpp +++ b/src/query/tests/histogramTest.cpp @@ -35,7 +35,7 @@ void doHistogramAddTest() { (int64_t)systemTime.tv_sec * 1000L + (uint64_t)systemTime.tv_usec / 1000; printf("total elapsed time: %ld\n", et - st); - printf("elements: %d, slot:%d \n", pHisto->numOfElems, pHisto->numOfEntries); + printf("elements: %ld, slot:%d \n", pHisto->numOfElems, pHisto->numOfEntries); tHistogramPrint(pHisto); printf("%ld\n", tHistogramSum(pHisto, 1.5)); diff --git a/src/query/tests/tsBufTest.cpp b/src/query/tests/tsBufTest.cpp index 04c5a152520d08329408253af271c4d43c5c0fe3..a525766a142327469c94964a00931568e95b604e 100644 --- a/src/query/tests/tsBufTest.cpp +++ b/src/query/tests/tsBufTest.cpp @@ -497,19 +497,103 @@ void mergeIdenticalVnodeBufferTest() { tsBufDestroy(pTSBuf1); tsBufDestroy(pTSBuf2); } + +void mergeMultiBlockFromOneGroupTest() { + STSBuf* pTSBuf1 = tsBufCreate(true, TSDB_ORDER_ASC); + STSBuf* pTSBuf2 = tsBufCreate(true, TSDB_ORDER_ASC); + + tVariant t = {0}; + t.nType = TSDB_DATA_TYPE_BIGINT; + + int32_t step = 30; + int32_t num = 1000; + int32_t numOfTags = 2; + + // vnodeId:0 + int64_t start = 10000; + for (int32_t i = 0; i < numOfTags; ++i) { + int64_t* list = createTsList(num, start, step); + t.i64 = i; + + tsBufAppend(pTSBuf1, 12, &t, (const char*)list, num * sizeof(int64_t)); + free(list); + + start += step * num; + } + + tsBufFlush(pTSBuf1); + + for (int32_t i = numOfTags; i < numOfTags * 2; ++i) { + int64_t* list = createTsList(num, start, step); + + t.i64 = i; + tsBufAppend(pTSBuf1, 77, &t, (const char*)list, num * sizeof(int64_t)); + free(list); + + start += step * num; + } + + tsBufFlush(pTSBuf1); + + start = 10000; + for (int32_t i = 911; i < 912; ++i) { + int64_t* list = createTsList(num, start, step); + t.i64 = i; + + tsBufAppend(pTSBuf1, 12, &t, (const char*)list, num * sizeof(int64_t)); + free(list); + + start += step * num; + } + tsBufFlush(pTSBuf1); + + char* p = (char*) malloc(1024768); + int32_t len = 0; + int32_t numOfBlocks = 0; + + dumpFileBlockByGroupId(pTSBuf1, 12, p, &len, &numOfBlocks); + + STSBuf* pNew = tsBufCreateFromCompBlocks(p, numOfBlocks, len, 1, 12); + printf("%p\n", pNew); + + tsBufDisplay(pNew); + +// tsBufMerge(pTSBuf1, pTSBuf2); +// EXPECT_EQ(pTSBuf1->numOfGroups, 2); +// EXPECT_EQ(pTSBuf1->numOfTotal, numOfTags * 2 * num); +// +// tsBufResetPos(pTSBuf1); +// +// int32_t count = 0; +// while (tsBufNextPos(pTSBuf1)) { +// STSElem elem = tsBufGetElem(pTSBuf1); +// +// if (count++ < numOfTags * num) { +// EXPECT_EQ(elem.id, 12); +// } else { +// EXPECT_EQ(elem.id, 77); +// } +// +// printf("%d-%" PRIu64 "-%" PRIu64 "\n", elem.id, elem.tag->i64, elem.ts); +// } +// +// tsBufDestroy(pTSBuf1); +// tsBufDestroy(pTSBuf2); +} } // namespace //TODO add binary tag value test case TEST(testCase, tsBufTest) { - simpleTest(); - largeTSTest(); - multiTagsTest(); - multiVnodeTagsTest(); - loadDataTest(); - invalidFileTest(); +// simpleTest(); +// largeTSTest(); +// multiTagsTest(); +// multiVnodeTagsTest(); +// loadDataTest(); +// invalidFileTest(); // randomIncTsTest(); - TSTraverse(); - mergeDiffVnodeBufferTest(); - mergeIdenticalVnodeBufferTest(); +// TSTraverse(); +// mergeDiffVnodeBufferTest(); +// mergeIdenticalVnodeBufferTest(); + mergeMultiBlockFromOneGroupTest(); } diff --git a/src/rpc/src/rpcMain.c b/src/rpc/src/rpcMain.c index c53062a98a6aacaf3b20494a896c5645cedf2102..9275003e898835379fc912badb7e0a6fdad70e49 100644 --- a/src/rpc/src/rpcMain.c +++ b/src/rpc/src/rpcMain.c @@ -270,7 +270,8 @@ void *rpcOpen(const SRpcInit *pInit) { if (pInit->label) tstrncpy(pRpc->label, pInit->label, sizeof(pRpc->label)); pRpc->connType = pInit->connType; if (pRpc->connType == TAOS_CONN_CLIENT) { - pRpc->numOfThreads = pInit->numOfThreads; + pRpc->numOfThreads = + pInit->numOfThreads > TSDB_MAX_RPC_THREADS * 2 ? TSDB_MAX_RPC_THREADS * 2 : pInit->numOfThreads; } else { pRpc->numOfThreads = pInit->numOfThreads > TSDB_MAX_RPC_THREADS ? TSDB_MAX_RPC_THREADS : pInit->numOfThreads; } diff --git a/tests/develop-test/2-query/ts_2523.py b/tests/develop-test/2-query/ts_2523.py new file mode 100644 index 0000000000000000000000000000000000000000..12e4bc7071eb93252d3ab07b996f17b9fad11211 --- /dev/null +++ b/tests/develop-test/2-query/ts_2523.py @@ -0,0 +1,61 @@ +################################################################### +# Copyright (c) 2021 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 -*- + +import sys +from util.log import * +from util.cases import * +from util.sql import * + + +class TDTestCase: + def caseDescription(self): + ''' + case1: [TS-2523]join not supported on tables of different databases + ''' + return + + def init(self, conn, logSql): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), logSql) + self._conn = conn + + def run(self): + print("running {}".format(__file__)) + tdSql.execute("drop database if exists d1") + tdSql.execute("create database if not exists d1") + tdSql.execute('use d1') + + tdSql.execute('create stable st(ts timestamp , value int ) tags (ind int)') + tdSql.execute('insert into tb1 using st tags(1) values(now ,1)') + tdSql.execute('insert into tb1 using st tags(1) values(now+1s ,2)') + tdSql.execute('insert into tb1 using st tags(1) values(now+2s ,3)') + tdSql.execute("drop database if exists d2") + tdSql.execute("create database if not exists d2") + tdSql.execute('use d2') + + tdSql.execute('create stable st(ts timestamp , value int ) tags (ind int)') + tdSql.execute('insert into tb1 using st tags(1) values(now ,1)') + tdSql.execute('insert into tb1 using st tags(1) values(now+1s ,2)') + tdSql.execute('insert into tb1 using st tags(1) values(now+2s ,3)') + + tdSql.error('select t1.value, t2.value from d1.st t1, d2.st t2 where t1.ts=t2.ts and t1.ind = t2.ind'); + + tdSql.execute('drop database d1') + tdSql.execute('drop database d2') + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/sml_json_alltypes.py b/tests/develop-test/5-taos-tools/taosbenchmark/sml_json_alltypes.py index 8d50201aa77028349c37b1ec755cc0d80c8ee7bc..b3ca26ac043e2a57cff48a3097d83e732c0b22a4 100644 --- a/tests/develop-test/5-taos-tools/taosbenchmark/sml_json_alltypes.py +++ b/tests/develop-test/5-taos-tools/taosbenchmark/sml_json_alltypes.py @@ -19,10 +19,9 @@ from util.dnodes import * class TDTestCase: def caseDescription(self): - ''' + """ [TD-11510] taosBenchmark test cases - ''' - return + """ def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) @@ -31,19 +30,26 @@ class TDTestCase: def getPath(self, tool="taosBenchmark"): selfPath = os.path.dirname(os.path.realpath(__file__)) - if ("community" in selfPath): - projPath = selfPath[:selfPath.find("community")] + if "community" in selfPath: + projPath = selfPath[: selfPath.find("community")] + elif "src" in selfPath: + projPath = selfPath[: selfPath.find("src")] + elif "/tools/" in selfPath: + projPath = selfPath[: selfPath.find("/tools/")] + elif "/tests/" in selfPath: + projPath = selfPath[: selfPath.find("/tests/")] else: - projPath = selfPath[:selfPath.find("tests")] + tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath)) + projPath = "/usr/local/taos/bin/" paths = [] - for root, dirs, files in os.walk(projPath): - if ((tool) in files): + for root, dummy, files in os.walk(projPath): + if (tool) in files: rootRealPath = os.path.dirname(os.path.realpath(root)) - if ("packaging" not in rootRealPath): + if "packaging" not in rootRealPath: paths.append(os.path.join(root, tool)) break - if (len(paths) == 0): + if len(paths) == 0: tdLog.exit("taosBenchmark not found!") return else: @@ -51,31 +57,45 @@ class TDTestCase: return paths[0] def run(self): + tdSql.query("select client_version()") + client_ver = "".join(tdSql.queryResult[0]) + major_ver = client_ver.split(".")[0] + binPath = self.getPath() - cmd = "%s -f ./5-taos-tools/taosbenchmark/json/sml_json_alltypes.json" %binPath + cmd = "%s -f ./5-taos-tools/taosbenchmark/json/sml_json_alltypes.json" % binPath tdLog.info("%s" % cmd) os.system("%s" % cmd) tdSql.execute("reset query cache") tdSql.query("describe db.stb1") tdSql.checkData(1, 1, "BOOL") tdSql.query("describe db.stb2") - tdSql.checkData(1, 1, "TINYINT") + tdSql.checkData(1, 1, "DOUBLE") tdSql.query("describe db.stb3") - tdSql.checkData(1, 1, "SMALLINT") + tdSql.checkData(1, 1, "DOUBLE") tdSql.query("describe db.stb4") - tdSql.checkData(1, 1, "INT") + tdSql.checkData(1, 1, "DOUBLE") tdSql.query("describe db.stb5") - tdSql.checkData(1, 1, "BIGINT") + tdSql.checkData(1, 1, "DOUBLE") tdSql.query("describe db.stb6") - tdSql.checkData(1, 1, "FLOAT") + tdSql.checkData(1, 1, "DOUBLE") tdSql.query("describe db.stb7") tdSql.checkData(1, 1, "DOUBLE") tdSql.query("describe db.stb8") - tdSql.checkData(1, 1, "BINARY") - tdSql.checkData(1, 2, 8) + if major_ver == "3": + tdSql.checkData(1, 1, "VARCHAR") + tdSql.checkData(1, 2, 16) + else: + tdSql.checkData(1, 1, "NCHAR") + tdSql.checkData(1, 2, 8) + tdSql.query("describe db.stb9") - tdSql.checkData(1, 1, "NCHAR") - tdSql.checkData(1, 2, 8) + if major_ver == "3": + tdSql.checkData(1, 1, "VARCHAR") + tdSql.checkData(1, 2, 16) + else: + tdSql.checkData(1, 1, "NCHAR") + tdSql.checkData(1, 2, 8) + tdSql.query("select count(*) from db.stb1") tdSql.checkData(0, 0, 160) tdSql.query("select count(*) from db.stb2") @@ -101,4 +121,4 @@ class TDTestCase: tdCases.addWindows(__file__, TDTestCase()) -tdCases.addLinux(__file__, TDTestCase()) \ No newline at end of file +tdCases.addLinux(__file__, TDTestCase()) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 0318f05f788612b2d5fb218f994c51ea6222c4f5..a13f77d43bb8ff0b95ba5dde75f226828fea48df 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -4,7 +4,7 @@ 290,,pytest,python3 test.py -f update/merge_commit_data.py 241,,pytest,python3 test.py -f update/merge_commit_data2.py 224,,pytest,python3 test.py -f query/queryNullValueTest.py -221,,pytest,python3 test.py -f query/nestedQuery/nestedQuery.py +#221,,pytest,python3 test.py -f query/nestedQuery/nestedQuery.py 220,,pytest,python3 test.py -f update/merge_commit_data2_update0.py 208,,pytest,python3 test.py -f update/merge_commit_last.py 203,,pytest,python3 test.py -f update/merge_commit_last-0.py @@ -191,13 +191,14 @@ 38,,script,./test.sh -f unique/arbitrator/sync_replica2_dropDb.sim 38,,script,./test.sh -f general/table/delete_reuse2.sim 38,,script,./test.sh -f general/insert/insert_drop.sim +38,,script,./test.sh -f general/insert/insert_update2.sim 37,,script,./test.sh -f unique/mnode/mgmt30.sim 37,,script,./test.sh -f unique/column/replica3.sim 37,,script,./test.sh -f unique/arbitrator/offline_replica2_createTable_online.sim 37,,script,./test.sh -f unique/arbitrator/offline_replica2_alterTable_online.sim 37,,script,./test.sh -f general/table/delete_reuse1.sim 37,,script,./test.sh -f general/db/delete_reuse2.sim -36,,docs-examples-test,eval sh -c \"if [ `uname -m` != aarch64 ]; then ./test_rust.sh; fi\" +# 36,,docs-examples-test,eval sh -c \"if [ `uname -m` != aarch64 ]; then ./test_rust.sh; fi\" 36,,script,./test.sh -f unique/stable/replica3_vnode3.sim 36,,script,./test.sh -f unique/stable/dnode2_stop.sim 36,,script,./test.sh -f unique/arbitrator/sync_replica2_alterTable_add.sim @@ -561,10 +562,10 @@ 11,,pytest,python3 test.py -f import_merge/importBlock1Sub.py 10,,docs-examples-test,./test_python.sh 10,,system-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/taosdemoTestInsertWithJsonStmt-otherPara.py -10,,system-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/taosdemoTestInsertWithJsonStmt.py +#10,,system-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/taosdemoTestInsertWithJsonStmt.py 10,,system-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/taosdemoTestInsertWithJson-autoCreate.py 10,,system-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/taosdemoTestInsertWithJson-otherPara.py -10,,system-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/taosdemoTestInsertWithJson-childTable.py +#10,,system-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/taosdemoTestInsertWithJson-childTable.py 10,,system-test,python3 ./test.py -f 2-query/TD-12344.py 10,,script,./test.sh -f unique/stable/replica2_vnode3.sim 10,,pytest,python3 testCompress.py @@ -641,6 +642,7 @@ 6,,pytest,python3 test.py -f functions/function_elapsed.py 6,,pytest,python3 test.py -f alter/alterColMultiTimes.py 6,,develop-test,python3 ./test.py -f 2-query/ts_2016.py +6,,develop-test,python3 ./test.py -f 2-query/ts_2523.py 6,,develop-test,python3 ./test.py -f 2-query/escape.py 6,,develop-test,python3 ./test.py -f 2-query/TD-14763.py 5,,system-test,python3 ./test.py -f 4-taosAdapter/taosAdapter_insert.py diff --git a/tests/parallel_test/run_case.sh b/tests/parallel_test/run_case.sh index 50b8b5fcfe9a6b8afb3f6d2adfa1ff129c294559..8522207b9cb64091ef47f6203f18908787052006 100755 --- a/tests/parallel_test/run_case.sh +++ b/tests/parallel_test/run_case.sh @@ -50,6 +50,12 @@ mkdir -p /var/lib/taos/subscribe cd $CONTAINER_TESTDIR/tests/$exec_dir ulimit -c unlimited +#define taospy 2.7.3 +pip3 list|grep taospy +pip3 uninstall taospy -y +pip3 install taospy==2.7.3 + + $TIMEOUT_CMD $cmd RET=$? diff --git a/tests/parallel_test/run_container.sh b/tests/parallel_test/run_container.sh index 31e0ccd51b9271a42134fbd3194227b79dfdc17f..8d5ae4e99052e991f69b9213be25b11d0297c814 100755 --- a/tests/parallel_test/run_container.sh +++ b/tests/parallel_test/run_container.sh @@ -96,7 +96,6 @@ docker run \ -v $REPDIR/packaging:$CONTAINER_TESTDIR/packaging:ro \ -v $REPDIR/README.md:$CONTAINER_TESTDIR/README.md:ro \ -v $REPDIR/docs:$CONTAINER_TESTDIR/docs \ - -v $REPDIR/src/connector/python/taos:/usr/local/lib/python3.8/site-packages/taos:ro \ -e LD_LIBRARY_PATH=/home/debug/build/lib:/home/debug/build/lib64 \ --rm --ulimit core=-1 taos_test:v1.0 $CONTAINER_TESTDIR/tests/parallel_test/run_case.sh -d "$exec_dir" -c "$cmd" $timeout_param ret=$? diff --git a/tests/pytest/functions/function_percentile.py b/tests/pytest/functions/function_percentile.py index 9b5e209d33d1f8e97c5baf83898dd62746c11dd8..451e590df0d80d18b03f1af6f36c79144641856b 100644 --- a/tests/pytest/functions/function_percentile.py +++ b/tests/pytest/functions/function_percentile.py @@ -26,32 +26,45 @@ class TDTestCase: self.rowNum = 10 self.ts = 1537146000000 - + def run(self): tdSql.prepare() - intData = [] + intData = [] floatData = [] - tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, + tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned)''') for i in range(self.rowNum): - tdSql.execute("insert into test values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)" + tdSql.execute("insert into test values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)" % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1)) - intData.append(i + 1) - floatData.append(i + 0.1) + intData.append(i + 1) + floatData.append(i + 0.1) - # percentile verifacation + # percentile verifacation tdSql.error("select percentile(ts 20) from test") tdSql.error("select apercentile(ts 20) from test") tdSql.error("select percentile(col7 20) from test") tdSql.error("select apercentile(col7 20) from test") - tdSql.error("select percentile(col8 20) from test") + tdSql.error("select percentile(col8 20) from test") tdSql.error("select apercentile(col8 20) from test") tdSql.error("select percentile(col9 20) from test") - tdSql.error("select apercentile(col9 20) from test") + tdSql.error("select apercentile(col9 20) from test") + + tdSql.error(f'select percentile(col1) from test') + tdSql.error(f'select percentile(col1, -1) from test') + tdSql.error(f'select percentile(col1, 101) from test') + tdSql.error(f'select percentile(col1, col2) from test') + tdSql.error(f'select percentile(1, col1) from test') + tdSql.error(f'select percentile(col1, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 101) from test') + + tdSql.query(f'select percentile(col1, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100) from test') + tdSql.checkData(0, 0, '[1.900000, 2.800000, 3.700000, 4.600000, 5.500000, 6.400000, 7.300000, 8.200000, 9.100000, 10.000000]') + + tdSql.query(f'select percentile(col1, 9.9, 19.9, 29.9, 39.9, 49.9, 59.9, 69.9, 79.9, 89.9, 99.9) from test') + tdSql.checkData(0, 0, '[1.891000, 2.791000, 3.691000, 4.591000, 5.491000, 6.391000, 7.291000, 8.191000, 9.091000, 9.991000]') - tdSql.query("select percentile(col1, 0) from test") + tdSql.query("select percentile(col1, 0) from test") tdSql.checkData(0, 0, np.percentile(intData, 0)) tdSql.query("select apercentile(col1, 0) from test") print("apercentile result: %s" % tdSql.getData(0, 0)) @@ -62,7 +75,7 @@ class TDTestCase: tdSql.query("select percentile(col1, 100) from test") tdSql.checkData(0, 0, np.percentile(intData, 100)) tdSql.query("select apercentile(col1, 100) from test") - print("apercentile result: %s" % tdSql.getData(0, 0)) + print("apercentile result: %s" % tdSql.getData(0, 0)) tdSql.query("select percentile(col2, 0) from test") tdSql.checkData(0, 0, np.percentile(intData, 0)) @@ -73,7 +86,7 @@ class TDTestCase: tdSql.query("select apercentile(col2, 50) from test") print("apercentile result: %s" % tdSql.getData(0, 0)) tdSql.query("select percentile(col2, 100) from test") - tdSql.checkData(0, 0, np.percentile(intData, 100)) + tdSql.checkData(0, 0, np.percentile(intData, 100)) tdSql.query("select apercentile(col2, 100) from test") print("apercentile result: %s" % tdSql.getData(0, 0)) @@ -99,11 +112,11 @@ class TDTestCase: tdSql.query("select apercentile(col4, 50) from test") print("apercentile result: %s" % tdSql.getData(0, 0)) tdSql.query("select percentile(col4, 100) from test") - tdSql.checkData(0, 0, np.percentile(intData, 100)) + tdSql.checkData(0, 0, np.percentile(intData, 100)) tdSql.query("select apercentile(col4, 100) from test") print("apercentile result: %s" % tdSql.getData(0, 0)) - tdSql.query("select percentile(col11, 0) from test") + tdSql.query("select percentile(col11, 0) from test") tdSql.checkData(0, 0, np.percentile(intData, 0)) tdSql.query("select apercentile(col11, 0) from test") print("apercentile result: %s" % tdSql.getData(0, 0)) @@ -114,7 +127,7 @@ class TDTestCase: tdSql.query("select percentile(col11, 100) from test") tdSql.checkData(0, 0, np.percentile(intData, 100)) tdSql.query("select apercentile(col11, 100) from test") - print("apercentile result: %s" % tdSql.getData(0, 0)) + print("apercentile result: %s" % tdSql.getData(0, 0)) tdSql.query("select percentile(col12, 0) from test") tdSql.checkData(0, 0, np.percentile(intData, 0)) @@ -125,7 +138,7 @@ class TDTestCase: tdSql.query("select apercentile(col12, 50) from test") print("apercentile result: %s" % tdSql.getData(0, 0)) tdSql.query("select percentile(col12, 100) from test") - tdSql.checkData(0, 0, np.percentile(intData, 100)) + tdSql.checkData(0, 0, np.percentile(intData, 100)) tdSql.query("select apercentile(col12, 100) from test") print("apercentile result: %s" % tdSql.getData(0, 0)) @@ -151,11 +164,11 @@ class TDTestCase: tdSql.query("select apercentile(col14, 50) from test") print("apercentile result: %s" % tdSql.getData(0, 0)) tdSql.query("select percentile(col14, 100) from test") - tdSql.checkData(0, 0, np.percentile(intData, 100)) + tdSql.checkData(0, 0, np.percentile(intData, 100)) tdSql.query("select apercentile(col14, 100) from test") print("apercentile result: %s" % tdSql.getData(0, 0)) - tdSql.query("select percentile(col5, 0) from test") + tdSql.query("select percentile(col5, 0) from test") print("query result: %s" % tdSql.getData(0, 0)) print("array result: %s" % np.percentile(floatData, 0)) tdSql.query("select apercentile(col5, 0) from test") @@ -164,12 +177,12 @@ class TDTestCase: print("query result: %s" % tdSql.getData(0, 0)) print("array result: %s" % np.percentile(floatData, 50)) tdSql.query("select apercentile(col5, 50) from test") - print("apercentile result: %s" % tdSql.getData(0, 0)) + print("apercentile result: %s" % tdSql.getData(0, 0)) tdSql.query("select percentile(col5, 100) from test") print("query result: %s" % tdSql.getData(0, 0)) - print("array result: %s" % np.percentile(floatData, 100)) + print("array result: %s" % np.percentile(floatData, 100)) tdSql.query("select apercentile(col5, 100) from test") - print("apercentile result: %s" % tdSql.getData(0, 0)) + print("apercentile result: %s" % tdSql.getData(0, 0)) tdSql.query("select percentile(col6, 0) from test") tdSql.checkData(0, 0, np.percentile(floatData, 0)) @@ -180,17 +193,17 @@ class TDTestCase: tdSql.query("select apercentile(col6, 50) from test") print("apercentile result: %s" % tdSql.getData(0, 0)) tdSql.query("select percentile(col6, 100) from test") - tdSql.checkData(0, 0, np.percentile(floatData, 100)) + tdSql.checkData(0, 0, np.percentile(floatData, 100)) tdSql.query("select apercentile(col6, 100) from test") - print("apercentile result: %s" % tdSql.getData(0, 0)) + print("apercentile result: %s" % tdSql.getData(0, 0)) tdSql.execute("create table meters (ts timestamp, voltage int) tags(loc nchar(20))") tdSql.execute("create table t0 using meters tags('beijing')") tdSql.execute("create table t1 using meters tags('shanghai')") for i in range(self.rowNum): - tdSql.execute("insert into t0 values(%d, %d)" % (self.ts + i, i + 1)) - tdSql.execute("insert into t1 values(%d, %d)" % (self.ts + i, i + 1)) - + tdSql.execute("insert into t0 values(%d, %d)" % (self.ts + i, i + 1)) + tdSql.execute("insert into t1 values(%d, %d)" % (self.ts + i, i + 1)) + tdSql.error("select percentile(voltage, 20) from meters") tdSql.query("select apercentile(voltage, 20) from meters") print("apercentile result: %s" % tdSql.getData(0, 0)) @@ -204,7 +217,7 @@ class TDTestCase: tdSql.checkData(0, 0, -100.00) - + def stop(self): tdSql.close() tdLog.success("%s successfully executed" % __file__) diff --git a/tests/pytest/tools/insert-tblimit1-tboffset.json b/tests/pytest/tools/insert-tblimit1-tboffset.json index bef719c5eee3a36faca3edc9f3fd606c4c665ebc..20a2f7417bab80aa1e722a0a71d7d16990229f10 100644 --- a/tests/pytest/tools/insert-tblimit1-tboffset.json +++ b/tests/pytest/tools/insert-tblimit1-tboffset.json @@ -49,8 +49,8 @@ "sample_format": "csv", "sample_file": "./sample.csv", "tags_file": "", - "columns": [{"type": "INT"}], - "tags": [{"type": "TINYINT", "count":1}] + "columns": [{"type": "INT"}, {"type": "DOUBLE", "count":10}, {"type": "BINARY", "len": 16, "count":3}, {"type": "BINARY", "len": 32, "count":6}], + "tags": [{"type": "TINYINT", "count":2}, {"type": "BINARY", "len": 16, "count":5}] }] }] } diff --git a/tests/pytest/tools/taosdemoAllTest/sml/insert-sml-timestamp.json b/tests/pytest/tools/taosdemoAllTest/sml/insert-sml-timestamp.json index e7704b87fe677abacdf94c71724cf15177a01790..5eb727aa404ff30ae302c00862f9b2348e626bab 100644 --- a/tests/pytest/tools/taosdemoAllTest/sml/insert-sml-timestamp.json +++ b/tests/pytest/tools/taosdemoAllTest/sml/insert-sml-timestamp.json @@ -91,7 +91,7 @@ "batch_create_tbl_num": 100, "data_source": "rand", "insert_mode": "sml", - "line_protocol": "json" , + "line_protocol": "taosjson" , "insert_rows":50, "childtable_limit": -1, "childtable_offset":0, diff --git a/tests/script/fullGeneralSuite.sim b/tests/script/fullGeneralSuite.sim index e2ab5e6ffcd9dd499fda37ac3433023d85d4a446..16abdc9d6ff48c28d7536ce004d5c9b36fb8bc8a 100644 --- a/tests/script/fullGeneralSuite.sim +++ b/tests/script/fullGeneralSuite.sim @@ -91,6 +91,7 @@ run general/import/large.sim run general/import/replica1.sim run general/insert/basic.sim run general/insert/insert_drop.sim +run general/insert/insert_update2.sim run general/insert/query_block1_memory.sim run general/insert/query_block2_memory.sim run general/insert/query_block1_file.sim diff --git a/tests/script/general/insert/basic.sim b/tests/script/general/insert/basic.sim index 88eb30a1ad819a26cdc9d61cb692fde9f1446cd7..e14de01df39c0934d123ce4b1256d7d2877996dd 100644 --- a/tests/script/general/insert/basic.sim +++ b/tests/script/general/insert/basic.sim @@ -39,6 +39,9 @@ while $x < 5 $x = $x + 1 endw +print =============== step 3 (TS-2405 NULL timestamp) +sql_error insert into $tb values (9223372036854775808 , 100) + sql select * from $tb print $rows points data are retrieved diff --git a/tests/script/general/insert/insert_update2.sim b/tests/script/general/insert/insert_update2.sim new file mode 100644 index 0000000000000000000000000000000000000000..523ff2d525dfbc714638577f0515644e6b8c5d07 --- /dev/null +++ b/tests/script/general/insert/insert_update2.sim @@ -0,0 +1,218 @@ +system sh/stop_dnodes.sh + +system sh/deploy.sh -n dnode1 -i 1 +system sh/cfg.sh -n dnode1 -c walLevel -v 1 +system sh/exec.sh -n dnode1 -s start + +sleep 2000 +sql connect + +### 4096*0.8 - 1 = 3275 +$rowSuperBlk = 3275 +### 4096 - 3275 -1 - 1 = 819 +$rowSubBlk = 819 +$ts0 = 1672372800000 +$ts1 = 1672372900000 +$ts2 = 1672686800000 + +$i = 0 +$db = db0 +$stb1 = stb1 +$tb1 = tb1 +$stb2 = stb2 +$tb2 = tb2 + +print ====== create database +sql drop database if exists $db +sql create database $db update 2 keep 1000 days 10 +print ====== create tables +sql use $db +sql create table $stb1 (ts timestamp, c1 bigint, c2 bigint, c3 bigint) tags(t1 int) +sql create table $stb2 (ts timestamp, c1 bigint, c2 bigint, c3 bigint, c4 bigint, c5 bigint, c6 bigint, c7 bigint, c8 bigint, c9 bigint, c10 bigint, c11 bigint, c12 bigint, c13 bigint, c14 bigint, c15 bigint, c16 bigint, c17 bigint, c18 bigint, c19 bigint, c20 bigint, c21 bigint, c22 bigint, c23 bigint, c24 bigint, c25 bigint, c26 bigint, c27 bigint, c28 bigint, c29 bigint, c30 bigint) tags(t1 int) +sql create table $tb1 using $stb1 tags(1) +sql create table $tb2 using $stb2 tags(2) +print ====== tables created + + +print ========== step 1: merge dataRow in mem + +$i = 0 +while $i < $rowSuperBlk + $xs = $i * 10 + $ts = $ts2 + $xs + sql insert into $tb1 (ts,c1) values ( $ts , $i ) + $i = $i + 1 +endw + +sql insert into $tb1 values ( $ts0 , 1,NULL,0) +sql insert into $tb1 values ( $ts0 , NULL,1,1) + +sql select * from $tb1 where ts = $ts0 +if $rows != 1 then + return -1 +endi +if $data01 != 1 then + return -1 +endi +if $data02 != 1 then + return -1 +endi +if $data03 != 1 then + return -1 +endi + +print ========== step 2: merge kvRow in mem +$i = 0 +while $i < $rowSuperBlk + $xs = $i * 10 + $ts = $ts2 + $xs + sql insert into $tb2 (ts,c1) values ( $ts , $i ) + $i = $i + 1 +endw + +sql insert into $tb2 (ts,c3,c8,c10) values ( $ts0 , 1,NULL,0) +sql insert into $tb2 (ts,c3,c8,c10) values ( $ts0 , NULL,1,1) + +sql select ts,c1,c3,c8,c10 from $tb2 where ts = $ts0 +if $rows != 1 then + return -1 +endi +if $data01 != NULL then + return -1 +endi +if $data02 != 1 then + return -1 +endi +if $data03 != 1 then + return -1 +endi +if $data04 != 1 then + return -1 +endi + +print ================== restart server to commit data into disk +system sh/exec.sh -n dnode1 -s stop -x SIGINT +sleep 2000 +system sh/exec.sh -n dnode1 -s start +print ================== server restart completed +sleep 2000 + +print ========== step 3: merge dataRow in file +sql insert into $tb1 values ( $ts0 , 2,NULL,NULL) +print ========== step 4: merge kvRow in file +sql insert into $tb2 (ts,c3,c8,c10) values ( $ts0 , 2,NULL,NULL) + +print ================== restart server to commit data into disk +system sh/exec.sh -n dnode1 -s stop -x SIGINT +sleep 2000 +system sh/exec.sh -n dnode1 -s start +print ================== server restart completed +sleep 2000 + +sql select * from $tb1 where ts = $ts0 +if $rows != 1 then + return -1 +endi +if $data01 != 2 then + return -1 +endi +if $data02 != 1 then + return -1 +endi +if $data03 != 1 then + return -1 +endi + +sql select ts,c1,c3,c8,c10 from $tb2 where ts = $ts0 +if $rows != 1 then + return -1 +endi +if $data01 != NULL then + return -1 +endi +if $data02 != 2 then + return -1 +endi +if $data03 != 1 then + return -1 +endi +if $data04 != 1 then + return -1 +endi + + +print ========== step 5: merge dataRow in file/mem +$i = 0 +while $i < $rowSubBlk + $xs = $i * 1 + $ts = $ts1 + $xs + sql insert into $tb1 (ts,c1) values ( $ts , $i ) + $i = $i + 1 +endw +print ========== step 6: merge kvRow in file/mem +$i = 0 +while $i < $rowSubBlk + $xs = $i * 1 + $ts = $ts1 + $xs + sql insert into $tb2 (ts,c1) values ( $ts , $i ) + $i = $i + 1 +endw + +print ================== restart server to commit data into disk +system sh/exec.sh -n dnode1 -s stop -x SIGINT +sleep 2000 +system sh/exec.sh -n dnode1 -s start +print ================== server restart completed +sleep 2000 + +sql insert into $tb1 values ( $ts0 , NULL,NULL,3) +sql insert into $tb2 (ts,c3,c8) values ( $ts0 , 3,NULL) +$tsN = $ts0 + 1 +sql insert into $tb1 values ( $tsN , 1,NULL,0) +sql insert into $tb2 (ts,c3,c8) values ( $tsN , 100,200) +$tsN = $ts0 + 2 +sql insert into $tb1 values ( $tsN , 1,NULL,0) +sql insert into $tb2 (ts,c3,c8) values ( $tsN , 100,200) + +print ================== restart server to commit data into disk +system sh/exec.sh -n dnode1 -s stop -x SIGINT +sleep 2000 +system sh/exec.sh -n dnode1 -s start +print ================== server restart completed +sleep 2000 + + +sql select * from $tb1 where ts = $ts0 +if $rows != 1 then + return -1 +endi +if $data01 != 2 then + return -1 +endi +if $data02 != 1 then + return -1 +endi +if $data03 != 3 then + return -1 +endi + +sql select ts,c1,c3,c8,c10 from $tb2 where ts = $ts0 +if $rows != 1 then + return -1 +endi +if $data01 != NULL then + return -1 +endi +if $data02 != 3 then + return -1 +endi +if $data03 != 1 then + return -1 +endi + +### this check for fix TS-2306 +if $data04 != 1 then + return -1 +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/insert/testSuite.sim b/tests/script/general/insert/testSuite.sim index da44167be57a6a2083c49c73a02999ba647f513e..93a956150927aadcbd77a286c793872d19209ac6 100644 --- a/tests/script/general/insert/testSuite.sim +++ b/tests/script/general/insert/testSuite.sim @@ -1,5 +1,6 @@ run general/insert/basic.sim run general/insert/insert_drop.sim +run general/insert/insert_update2.sim run general/insert/query_block1_memory.sim run general/insert/query_block2_memory.sim run general/insert/query_block1_file.sim diff --git a/tests/script/general/parser/fill_stb.sim b/tests/script/general/parser/fill_stb.sim index ba8ddbdf6ac6e9035398b3ac7c26861c02771e99..07011d1c66ee9781db2e8af61e81caf36f48658c 100644 --- a/tests/script/general/parser/fill_stb.sim +++ b/tests/script/general/parser/fill_stb.sim @@ -430,6 +430,20 @@ if $data69 != 6 then return -1 endi +## TD-2679 +print ============== td2679 +sql create database td2679 +sql use td2679 +sql create table st(ts timestamp, f int) tags (t int) +$ts = 1676768465000 +sql insert into ct1 using st tags(1) values($ts , null)($ts + 1s, 1)($ts + 2s, null) +sql insert into ct2 using st tags(2) values($ts + 3s, null)($ts + 4s, 4)($ts + 5s, null) +sql select max(f) from st where ts>='2023-02-19 09:01:04.000' and ts <= '2023-02-19 09:01:10.000' interval(1s) fill(linear) group by tbname; +print $rows , $data60 , $data61 , $data70 , $data71 +if $data71 != NULL then + return -1 +endi +sql drop database td2679 print =============== clear sql drop database $db sql show databases @@ -437,4 +451,4 @@ if $rows != 0 then return -1 endi -system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/jenkins/basic.txt b/tests/script/jenkins/basic.txt index 56c24e6444e57f18654458cdcd27902f45ac59e3..b2c001c83b2340b1a4bf523fb2036cae6364e5f6 100644 --- a/tests/script/jenkins/basic.txt +++ b/tests/script/jenkins/basic.txt @@ -25,6 +25,7 @@ cd ../../../debug; make # ./test.sh -f general/http/grafana.sim ./test.sh -f general/insert/basic.sim ./test.sh -f general/insert/insert_drop.sim +./test.sh -f general/insert/insert_update2.sim ./test.sh -f general/insert/query_block1_memory.sim ./test.sh -f general/insert/query_block2_memory.sim ./test.sh -f general/insert/query_block1_file.sim diff --git a/tests/script/jenkins/simple.txt b/tests/script/jenkins/simple.txt index a0a2f5191768b70638aa45fa9ad97f73c91d4d86..ec5a1e57346ffb3df2b21156db00d1390d24d459 100644 --- a/tests/script/jenkins/simple.txt +++ b/tests/script/jenkins/simple.txt @@ -92,6 +92,7 @@ cd ../../../debug; make ./test.sh -f general/insert/basic.sim ./test.sh -f general/insert/insert_drop.sim +./test.sh -f general/insert/insert_update2.sim ./test.sh -f general/insert/query_block1_memory.sim ./test.sh -f general/insert/query_block2_memory.sim ./test.sh -f general/insert/query_block1_file.sim diff --git a/tests/script/jenkins/wbasic.txt b/tests/script/jenkins/wbasic.txt index 22fee77344371a634086ebf2a37a9bf5b03a7f6b..8fbdbe4ae01e7e5513eda26b07b8603e9648aa11 100644 --- a/tests/script/jenkins/wbasic.txt +++ b/tests/script/jenkins/wbasic.txt @@ -98,6 +98,7 @@ wtest.bat -f general/import/replica1.sim wtest.bat -f general/insert/basic.sim wtest.bat -f general/insert/insert_drop.sim +wtest.bat -f general/insert/insert_update2.sim wtest.bat -f general/insert/query_block1_memory.sim wtest.bat -f general/insert/query_block2_memory.sim wtest.bat -f general/insert/query_block1_file.sim diff --git a/tests/script/regressionSuite.sim b/tests/script/regressionSuite.sim index 528dbbe04044ba4007d00edd68f31286f32ee889..1a9860168a099684cab04bfeb79e27f20c4e2ceb 100644 --- a/tests/script/regressionSuite.sim +++ b/tests/script/regressionSuite.sim @@ -91,6 +91,7 @@ run general/import/large.sim run general/import/replica1.sim run general/insert/basic.sim run general/insert/insert_drop.sim +run general/insert/insert_update2.sim run general/insert/query_block1_memory.sim run general/insert/query_block2_memory.sim run general/insert/query_block1_file.sim diff --git a/tests/system-test/1-insert/stmt_error.py b/tests/system-test/1-insert/stmt_error.py index cefc99f2295f2faf94766db9e345582b7ac1f555..a5ed032611ee86fddb0cf5344c5633c6642ac2d0 100644 --- a/tests/system-test/1-insert/stmt_error.py +++ b/tests/system-test/1-insert/stmt_error.py @@ -45,7 +45,7 @@ class TDTestCase: conn.execute( "create table if not exists log(ts timestamp, bo bool, nil tinyint, ti tinyint, si smallint, ii int,\ bi bigint, tu tinyint unsigned, su smallint unsigned, iu int unsigned, bu bigint unsigned, \ - ff float, dd double, bb binary(100), nn nchar(100), tt timestamp)", + ff float, dd double, bb binary(65059), nn nchar(100), tt timestamp)", ) conn.load_table_info("log") @@ -65,7 +65,10 @@ class TDTestCase: params[10].bigint_unsigned(9) params[11].float(10.1) params[12].double(10.11) - params[13].binary("hello") + binaryStr = '123456789' + for i in range(1301): + binaryStr += "1234567890abcdefghij1234567890abcdefghij12345hello" + params[13].binary(binaryStr) params[14].nchar("stmt") params[15].timestamp(1626861392589, PrecisionEnum.Milliseconds) @@ -88,7 +91,7 @@ class TDTestCase: #float == may not work as expected # assert row[10] == c_float(10.1) assert row[12] == 10.11 - assert row[13] == "hello" + assert row[13][65054:] == "hello" assert row[14] == "stmt" conn.execute("drop database if exists %s" % dbname) @@ -164,6 +167,48 @@ class TDTestCase: conn.execute("drop database if exists %s" % dbname) conn.close() raise err + + def test_stmt_insert_error_null_timestamp(self,conn): + + dbname = "pytest_taos_stmt_error_null_ts" + try: + conn.execute("drop database if exists %s" % dbname) + conn.execute("create database if not exists %s" % dbname) + conn.execute("alter database %s keep 36500" % dbname) + conn.select_db(dbname) + + conn.execute("create stable STB(ts timestamp, n int) tags(b int)") + + stmt = conn.statement("insert into ? using STB tags(?) values(?, ?)") + params = new_bind_params(1) + params[0].int(4); + stmt.set_tbname_tags("ct", params); + + multi_params = new_multi_binds(2); + multi_params[0].timestamp([9223372036854775808]) + multi_params[1].int([123]) + stmt.bind_param_batch(multi_params) + + stmt.execute() + result = stmt.use_result() + + result.close() + stmt.close() + + stmt = conn.statement("select * from STB") + stmt.execute() + result = stmt.use_result() + print(result.affected_rows) + row = result.next() + print(row) + + result.close() + stmt.close() + conn.close() + + except Exception as err: + conn.close() + raise err def run(self): @@ -173,9 +218,18 @@ class TDTestCase: except Exception as error : if str(error)=='[0x0200]: invalid operation: only ? allowed in values': - tdLog.info('=========stmt error occured for bind part colum ==============') + tdLog.info('=========stmt error occured for bind part column ==============') else: tdLog.exit("expect error not occured") + + try: + self.test_stmt_insert_error_null_timestamp(self.conn()) + tdLog.exit("expect error not occured - 1") + except Exception as error : + if str(error)=='[0x0200]: invalid operation: bind column type mismatch or invalid': + tdLog.info('=========stmt error occured for bind part column(NULL Timestamp) ==============') + else: + tdLog.exit("expect error not occured - 2") def stop(self): tdSql.close() diff --git a/tests/system-test/5-taos-tools/taosbenchmark/taosdemoTestInsertWithJsonSml-otherPara.py b/tests/system-test/5-taos-tools/taosbenchmark/taosdemoTestInsertWithJsonSml-otherPara.py index 72c806d8889b708d3498d6164841d32c95a49a0f..930ce8337edd2890fc5924a368738696463d8d4e 100644 --- a/tests/system-test/5-taos-tools/taosbenchmark/taosdemoTestInsertWithJsonSml-otherPara.py +++ b/tests/system-test/5-taos-tools/taosbenchmark/taosdemoTestInsertWithJsonSml-otherPara.py @@ -74,8 +74,6 @@ class TDTestCase: tdSql.checkData(0, 0, 1) tdSql.query("select count(*) from stb0") tdSql.checkData(0, 0, 10) - tdSql.query("select count(*) from stb1") - tdSql.checkData(0, 0, 10) # insert: doesn‘t currently supported sample json assert os.system("%staosBenchmark -f 5-taos-tools/taosbenchmark/sml/insert-sample-sml.json -y " % binPath) != 0