diff --git a/Jenkinsfile b/Jenkinsfile index ebac32cb241af1a35556262690544f84ca94d9fc..73bb832d8ea4c16d65f6fff88cb8844415c19f9c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -41,13 +41,10 @@ def pre_test(){ cd ${WKC} git checkout develop - git reset --hard HEAD~10 - git pull - git fetch - git checkout ${CHANGE_BRANCH} - git reset --hard HEAD~10 + git reset --hard HEAD~10 >/dev/null git pull - git merge develop + git fetch origin +refs/pull/${CHANGE_ID}/merge + git checkout -qf FETCH_HEAD cd ${WK} git reset --hard HEAD~10 git checkout develop @@ -87,11 +84,14 @@ pipeline { steps { pre_test() - sh ''' - cd ${WKC}/tests - find pytest -name '*'sql|xargs rm -rf - ./test-all.sh p1 - date''' + timeout(time: 90, unit: 'MINUTES'){ + sh ''' + cd ${WKC}/tests + find pytest -name '*'sql|xargs rm -rf + ./test-all.sh p1 + date''' + } + } } stage('python_2') { @@ -112,12 +112,14 @@ pipeline { } stage('test_b1') { agent{label 'b1'} - steps { - pre_test() - sh ''' - cd ${WKC}/tests - ./test-all.sh b1fq - date''' + steps { + timeout(time: 90, unit: 'MINUTES'){ + pre_test() + sh ''' + cd ${WKC}/tests + ./test-all.sh b1fq + date''' + } } } @@ -137,12 +139,14 @@ pipeline { ./handle_crash_gen_val_log.sh ''' } - sh ''' - date - cd ${WKC}/tests - ./test-all.sh b2fq - date - ''' + timeout(time: 90, unit: 'MINUTES'){ + sh ''' + date + cd ${WKC}/tests + ./test-all.sh b2fq + date + ''' + } } } @@ -157,12 +161,14 @@ pipeline { ./valgrind-test.sh 2>&1 > mem-error-out.log ./handle_val_log.sh ''' - } - sh ''' - date - cd ${WKC}/tests - ./test-all.sh b3fq - date''' + } + timeout(time: 90, unit: 'MINUTES'){ + sh ''' + date + cd ${WKC}/tests + ./test-all.sh b3fq + date''' + } } } diff --git a/documentation20/webdocs/assets/tdengine-jdbc-connector.png b/documentation20/webdocs/assets/tdengine-jdbc-connector.png new file mode 100644 index 0000000000000000000000000000000000000000..fdf1dd3fcc5ee222c4a8753efa2c95c5257314bf Binary files /dev/null and b/documentation20/webdocs/assets/tdengine-jdbc-connector.png differ diff --git a/documentation20/webdocs/markdowndocs/Queries-ch.md b/documentation20/webdocs/markdowndocs/Queries-ch.md index 960bb39e6323fe590905de62d2a1021adb19d176..839809ccba1914a9d5cfa9005be9f32e94f19924 100644 --- a/documentation20/webdocs/markdowndocs/Queries-ch.md +++ b/documentation20/webdocs/markdowndocs/Queries-ch.md @@ -9,7 +9,7 @@ TDengine 采用 SQL 作为查询语言。应用程序可以通过 C/C++, Java, Go, Python 连接器发送 SQL 语句,用户可以通过 TDengine 提供的命令行(Command Line Interface, CLI)工具 TAOS Shell 手动执行 SQL 即席查询(Ad-Hoc Query)。TDengine 支持如下查询功能: - 单列、多列数据查询 -- 标签和数值的多种过滤条件:\>, \<, =, \<>, like 等 +- 标签和数值的多种过滤条件:>, <, =, <>, like 等 - 聚合结果的分组(Group by)、排序(Order by)、约束输出(Limit/Offset) - 数值列及聚合结果的四则运算 - 时间戳对齐的连接查询(Join Query: 隐式连接)操作 diff --git a/documentation20/webdocs/markdowndocs/administrator-ch.md b/documentation20/webdocs/markdowndocs/administrator-ch.md index 9eee5b2b69cad573f62a1fa4890ff73c43026bd1..a343f7e97079566208b707b36e46b219f26772e2 100644 --- a/documentation20/webdocs/markdowndocs/administrator-ch.md +++ b/documentation20/webdocs/markdowndocs/administrator-ch.md @@ -124,10 +124,10 @@ taosd -C 对于一个应用场景,可能有多种数据特征的数据并存,最佳的设计是将具有相同数据特征的表放在一个库里,这样一个应用有多个库,而每个库可以配置不同的存储参数,从而保证系统有最优的性能。TDengine允许应用在创建库时指定上述存储参数,如果指定,该参数就将覆盖对应的系统配置参数。举例,有下述SQL: ``` - create database demo days 10 cache 32 blocks 8 replica 3; + create database demo days 10 cache 32 blocks 8 replica 3 update 1; ``` -该SQL创建了一个库demo, 每个数据文件存储10天数据,内存块为32兆字节,每个VNODE占用8个内存块,副本数为3,而其他参数与系统配置完全一致。 +该SQL创建了一个库demo, 每个数据文件存储10天数据,内存块为32兆字节,每个VNODE占用8个内存块,副本数为3,允许更新,而其他参数与系统配置完全一致。 TDengine集群中加入一个新的dnode时,涉及集群相关的一些参数必须与已有集群的配置相同,否则不能成功加入到集群中。会进行校验的参数如下: diff --git a/documentation20/webdocs/markdowndocs/advanced features-ch.md b/documentation20/webdocs/markdowndocs/advanced features-ch.md index cdd9ee81048f0968fb02f036b20e003c66835a4c..0ca8428ecee2c5ef162810737f77cb9cf4b9412b 100644 --- a/documentation20/webdocs/markdowndocs/advanced features-ch.md +++ b/documentation20/webdocs/markdowndocs/advanced features-ch.md @@ -197,7 +197,7 @@ select * from meters where ts > now - 1d and current > 10; 且`restart`是 **false**(**0**),用户程序就不会读到之前已经读取的数据了。 `taos_subscribe`的最后一个参数是以毫秒为单位的轮询周期。 -在同步模式下,如过前后两次调用`taos_consume`的时间间隔小于此时间, +在同步模式下,如果前后两次调用`taos_consume`的时间间隔小于此时间, `taos_consume`会阻塞,直到间隔超过此时间。 异步模式下,这个时间是两次调用回调函数的最小时间间隔。 @@ -414,7 +414,7 @@ TDengine通过查询函数向用户提供毫秒级的数据获取能力。直接 TDengine分配固定大小的内存空间作为缓存空间,缓存空间可根据应用的需求和硬件资源配置。通过适当的设置缓存空间,TDengine可以提供极高性能的写入和查询的支持。TDengine中每个虚拟节点(virtual node)创建时分配独立的缓存池。每个虚拟节点管理自己的缓存池,不同虚拟节点间不共享缓存池。每个虚拟节点内部所属的全部表共享该虚拟节点的缓存池。 -TDengine将内存池按块划分进行管理,数据在内存块里按照列式存储。一个vnode的内存池是在vnode创建时按块分配好的,而且每个内存块按照先进先出的原则进行管理。一张表所需要的内存块是从vnode的内存池中进行分配的,块的大小由系统配置参数cache决定。每张表最大内存块的数目由配置参数tblocks决定,每张表平均的内存块的个数由配置参数ablocks决定。因此对于一个vnode, 总的内存大小为: `cache * ablocks * tables`。内存块参数cache不宜过小,一个cache block需要能存储至少几十条以上记录,才会有效率。参数ablocks最小为2,保证每张表平均至少能分配两个内存块。 +TDengine将内存池按块划分进行管理,数据在内存块里是以行(row)的形式存储。一个vnode的内存池是在vnode创建时按块分配好,而且每个内存块按照先进先出的原则进行管理。在创建内存池时,块的大小由系统配置参数cache决定;每个vnode中内存块的数目则由配置参数blocks决定。因此对于一个vnode,总的内存大小为:`cache * blocks`。一个cache block需要保证每张表能存储至少几十条以上记录,才会有效率。 你可以通过函数last_row快速获取一张表或一张超级表的最后一条记录,这样很便于在大屏显示各设备的实时状态或采集值。例如: diff --git a/documentation20/webdocs/markdowndocs/cluster-ch.md b/documentation20/webdocs/markdowndocs/cluster-ch.md index f3f6f2b3005e1dc101fce817520a7e96bdfc0e31..f6019b1a5aabdaea095eafc1919c46432ec88c77 100644 --- a/documentation20/webdocs/markdowndocs/cluster-ch.md +++ b/documentation20/webdocs/markdowndocs/cluster-ch.md @@ -225,7 +225,7 @@ SHOW MNODES; ## Arbitrator的使用 -如果副本数为偶数,当一个vnode group里一半vnode不工作时,是无法从中选出master的。同理,一半mnode不工作时,是无法选出mnode的master的,因为存在“split brain”问题。为解决这个问题,TDengine引入了arbitrator的概念。Arbitrator模拟一个vnode或mnode在工作,但只简单的负责网络连接,不处理任何数据插入或访问。只要包含arbitrator在内,超过半数的vnode或mnode工作,那么该vnode group或mnode组就可以正常的提供数据插入或查询服务。比如对于副本数为2的情形,如果一个节点A离线,但另外一个节点B正常,而且能连接到arbitrator, 那么节点B就能正常工作。 +如果副本数为偶数,当一个vnode group里一半vnode不工作时,是无法从中选出master的。同理,一半mnode不工作时,是无法选出mnode的master的,因为存在“split brain”问题。为解决这个问题,TDengine引入了Arbitrator的概念。Arbitrator模拟一个vnode或mnode在工作,但只简单的负责网络连接,不处理任何数据插入或访问。只要包含Arbitrator在内,超过半数的vnode或mnode工作,那么该vnode group或mnode组就可以正常的提供数据插入或查询服务。比如对于副本数为2的情形,如果一个节点A离线,但另外一个节点B正常,而且能连接到Arbitrator,那么节点B就能正常工作。 -TDengine提供一个执行程序tarbitrator, 找任何一台Linux服务器运行它即可。请点击[安装包下载](https://www.taosdata.com/cn/all-downloads/),在TDengine Arbitrator Linux一节中,选择适合的版本下载并安装。该程序对系统资源几乎没有要求,只需要保证有网络连接即可。该应用的命令行参数`-p`可以指定其对外服务的端口号,缺省是6042。配置每个taosd实例时,可以在配置文件taos.cfg里将参数arbitrator设置为arbitrator的End Point。如果该参数配置了,当副本数为偶数时,系统将自动连接配置的arbitrator。如果副本数为奇数,即使配置了arbitrator, 系统也不会去建立连接。 +TDengine提供一个执行程序,名为 tarbitrator,找任何一台Linux服务器运行它即可。请点击[安装包下载](https://www.taosdata.com/cn/all-downloads/),在TDengine Arbitrator Linux一节中,选择适合的版本下载并安装。该程序对系统资源几乎没有要求,只需要保证有网络连接即可。该应用的命令行参数`-p`可以指定其对外服务的端口号,缺省是6042。配置每个taosd实例时,可以在配置文件taos.cfg里将参数arbitrator设置为Arbitrator的End Point。如果该参数配置了,当副本数为偶数时,系统将自动连接配置的Arbitrator。如果副本数为奇数,即使配置了Arbitrator,系统也不会去建立连接。 diff --git a/documentation20/webdocs/markdowndocs/cluster.md b/documentation20/webdocs/markdowndocs/cluster.md deleted file mode 100644 index 8cf7065f72eb7da75a949fd644b00346523c15ed..0000000000000000000000000000000000000000 --- a/documentation20/webdocs/markdowndocs/cluster.md +++ /dev/null @@ -1,146 +0,0 @@ -#集群安装、管理 - -多个taosd的运行实例可以组成一个集群,以保证TDengine的高可靠运行,并提供水平扩展能力。要了解TDengine 2.0的集群管理,需要对集群的基本概念有所了解,请看TDengine 2.0整体架构一章。 - -集群的每个节点是由End Point来唯一标识的,End Point是由FQDN(Fully Qualified Domain Name)外加Port组成,比如 h1.taosdata.com:6030。一般FQDN就是服务器的hostname,可通过Linux命令“hostname"获取。端口是这个节点对外服务的端口号,缺省是6030,但可以通过taos.cfg里配置参数serverPort进行修改。 - -TDengine的集群管理极其简单,除添加和删除节点需要人工干预之外,其他全部是自动完成,最大程度的降低了运维的工作量。本章对集群管理的操作做详细的描述。 - -##安装、创建第一个节点 - -集群是由一个一个dnode组成的,是从一个dnode的创建开始的。创建第一个节点很简单,就按照["立即开始“](https://www.taosdata.com/cn/getting-started/)一章的方法进行安装、启动即可。 - -启动后,请执行taos, 启动taos shell,从shell里执行命令"show dnodes;",如下所示: - ``` -Welcome to the TDengine shell from Linux, Client Version:2.0.0.0 -Copyright (c) 2017 by TAOS Data, Inc. All rights reserved. - -taos> show dnodes; - id | end_point | vnodes | cores | status | role | create_time | -===================================================================================== - 1 | h1.taos.com:6030 | 0 | 2 | ready | any | 2020-07-31 03:49:29.202 | -Query OK, 1 row(s) in set (0.006385s) - -taos> - ``` -上述命令里,可以看到这个刚启动的这个节点的End Point是:h1.taos.com:6030 - -## 安装、创建后续节点 - -将新的节点添加到现有集群,具体有以下几步: - -1. 按照["立即开始“](https://www.taosdata.com/cn/getting-started/)一章的方法进行安装,但不要启动taosd - -2. 如果是使用涛思数据的官方安装包进行安装,在安装结束时,会询问集群的End Port, 输入第一个节点的End Point即可。如果是源码安装,请编辑配置文件taos.cfg(缺省是在/etc/taos/目录),增加一行: - - ``` - firstEp h1.taos.com:6030 - ``` - - 请注意将示例的“h1.taos.com:6030" 替换为你自己第一个节点的End Point - -3. 按照["立即开始“](https://www.taosdata.com/cn/getting-started/)一章的方法启动taosd - -4. 在Linux shell里执行命令"hostname"找出本机的FQDN, 假设为h2.taos.com。如果无法找到,可以查看taosd日志文件taosdlog.0里前面几行日志(一般在/var/log/taos目录),fqdn以及port都会打印出来。 - -5. 在第一个节点,使用CLI程序taos, 登录进TDengine系统, 使用命令: - - ``` - CREATE DNODE "h2.taos.com:6030"; - ``` - - 将新节点的End Point添加进集群的EP列表。**"fqdn:port"需要用双引号引起来**,否则出错。请注意将示例的“h2.taos.com:6030" 替换为你自己第一个节点的End Point - -6. 使用命令 - - ``` - SHOW DNODES; - ``` - - 查看新节点是否被成功加入。 - -按照上述步骤可以源源不断的将新的节点加入到集群。 - -**提示:** - -- firstEp, secondEp这两个参数仅仅在该节点第一次加入集群时有作用,加入集群后,该节点会保存最新的mnode的End Point列表,不再依赖这两个参数。 -- 两个没有配置first, second参数的dnode启动后,会独立运行起来。这个时候,无法将其中一个节点加入到另外一个节点,形成集群。**无法将两个独立的集群合并成为新的集群**。 - -##节点管理 - -###添加节点 -执行CLI程序taos, 使用root账号登录进系统, 执行: -``` -CREATE DNODE "fqdn:port"; -``` -将新节点的End Point添加进集群的EP列表。**"fqdn:port"需要用双引号引起来**,否则出错。一个节点对外服务的fqdn和port可以通过配置文件taos.cfg进行配置,缺省是自动获取。 - -###删除节点 -执行CLI程序taos, 使用root账号登录进TDengine系统,执行: -``` -DROP DNODE "fqdn:port"; -``` -其中fqdn是被删除的节点的FQDN,port是其对外服务器的端口号 - -###查看节点 -执行CLI程序taos,使用root账号登录进TDengine系统,执行: -``` -SHOW DNODES; -``` -它将列出集群中所有的dnode,每个dnode的fqdn:port, 状态(ready, offline等),vnode数目,还未使用的vnode数目等信息。在添加或删除一个节点后,可以使用该命令查看。 - -如果集群配置了Arbitrator,那么它也会在这个节点列表中显示出来,其role列的值会是“arb”。 - -###查看虚拟节点组 - -为充分利用多核技术,并提供scalability,数据需要分片处理。因此TDengine会将一个DB的数据切分成多份,存放在多个vnode里。这些vnode可能分布在多个dnode里,这样就实现了水平扩展。一个vnode仅仅属于一个DB,但一个DB可以有多个vnode。vnode的是mnode根据当前系统资源的情况,自动进行分配的,无需任何人工干预。 - -执行CLI程序taos,使用root账号登录进TDengine系统,执行: -``` -SHOW VGROUPS; -``` -##高可用性 -TDengine通过多副本的机制来提供系统的高可用性。副本数是与DB关联的,一个集群里可以有多个DB,根据运营的需求,每个DB可以配置不同的副本数。创建数据库时,通过参数replica 指定副本数(缺省为1)。如果副本数为1,系统的可靠性无法保证,只要数据所在的节点宕机,就将无法提供服务。集群的节点数必须大于等于副本数,否则创建表时将返回错误“more dnodes are needed"。比如下面的命令将创建副本数为3的数据库demo: -``` -CREATE DATABASE demo replica 3; -``` -一个DB里的数据会被切片分到多个vnode group,vnode group里的vnode数目就是DB的副本数,同一个vnode group里各vnode的数据是完全一致的。为保证高可用性,vnode group里的vnode一定要分布在不同的dnode里(实际部署时,需要在不同的物理机上),只要一个vgroup里超过半数的vnode处于工作状态,这个vgroup就能正常的对外服务。 - -一个dnode里可能有多个DB的数据,因此一个dnode离线时,可能会影响到多个DB。如果一个vnode group里的一半或一半以上的vnode不工作,那么该vnode group就无法对外服务,无法插入或读取数据,这样会影响到它所属的DB的一部分表的d读写操作。 - -因为vnode的引入,无法简单的给出结论:“集群中过半dnode工作,集群就应该工作”。但是对于简单的情形,很好下结论。比如副本数为3,只有三个dnode,那如果仅有一个节点不工作,整个集群还是可以正常工作的,但如果有两个节点不工作,那整个集群就无法正常工作了。 - -##Mnode的高可用 -TDengine集群是由mnode (taosd的一个模块,逻辑节点) 负责管理的,为保证mnode的高可用,可以配置多个mnode副本,副本数由系统配置参数numOfMnodes决定,有效范围为1-3。为保证元数据的强一致性,mnode副本之间是通过同步的方式进行数据复制的。 - -一个集群有多个dnode, 但一个dnode至多运行一个mnode实例。多个dnode情况下,哪个dnode可以作为mnode呢?这是完全由系统根据整个系统资源情况,自动指定的。用户可通过CLI程序taos,在TDengine的console里,执行如下命令: -``` -SHOW MNODES; -``` -来查看mnode列表,该列表将列出mnode所处的dnode的End Point和角色(master, slave, unsynced 或offline)。 -当集群中第一个节点启动时,该节点一定会运行一个mnode实例,否则该dnode无法正常工作,因为一个系统是必须有至少一个mnode的。如果numOfMnodes配置为2,启动第二个dnode时,该dnode也将运行一个mnode实例。 - -为保证mnode服务的高可用性,numOfMnodes必须设置为2或更大。因为mnode保存的元数据必须是强一致的,如果numOfMnodes大于2,复制参数quorum自动设为2,也就是说,至少要保证有两个副本写入数据成功,才通知客户端应用写入成功。 - -##负载均衡 - -有三种情况,将触发负载均衡,而且都无需人工干预。 - -- 当一个新节点添加进集群时,系统将自动触发负载均衡,一些节点上的数据将被自动转移到新节点上,无需任何人工干预。 -- 当一个节点从集群中移除时,系统将自动把该节点上的数据转移到其他节点,无需任何人工干预。 -- 如果一个节点过热(数据量过大),系统将自动进行负载均衡,将该节点的一些vnode自动挪到其他节点。 - -当上述三种情况发生时,系统将启动一各个节点的负载计算,从而决定如何挪动。 - -##节点离线处理 -如果一个节点离线,TDengine集群将自动检测到。有如下两种情况: -- 改节点离线超过一定时间(taos.cfg里配置参数offlineThreshold控制时长),系统将自动把该节点删除,产生系统报警信息,触发负载均衡流程。如果该被删除的节点重现上线时,它将无法加入集群,需要系统管理员重新将其添加进集群才会开始工作。 -- 离线后,在offlineThreshold的时长内重新上线,系统将自动启动数据恢复流程,等数据完全恢复后,该节点将开始正常工作。 - -##Arbitrator的使用 - -如果副本数为偶数,当一个vnode group里一半vnode不工作时,是无法从中选出master的。同理,一半mnode不工作时,是无法选出mnode的master的,因为存在“split brain”问题。为解决这个问题,TDengine引入了arbitrator的概念。Arbitrator模拟一个vnode或mnode在工作,但只简单的负责网络连接,不处理任何数据插入或访问。只要包含arbitrator在内,超过半数的vnode或mnode工作,那么该vnode group或mnode组就可以正常的提供数据插入或查询服务。比如对于副本数为2的情形,如果一个节点A离线,但另外一个节点B正常,而且能连接到arbitrator, 那么节点B就能正常工作。 - -TDengine安装包里带有一个执行程序tarbitrator, 找任何一台Linux服务器运行它即可。该程序对系统资源几乎没有要求,只需要保证有网络连接即可。该应用的命令行参数`-p`可以指定其对外服务的端口号,缺省是6030。配置每个taosd实例时,可以在配置文件taos.cfg里将参数arbitrator设置为Arbitrator的End Point。如果该参数配置了,当副本数为偶数时,系统将自动连接配置的Arbitrator。 - -在配置了Arbitrator的情况下,它也会显示在“show dnodes;”指令给出的节点列表中。 diff --git a/documentation20/webdocs/markdowndocs/connector-java-ch.md b/documentation20/webdocs/markdowndocs/connector-java-ch.md index 7ba573d2e44bb3848d13a2f6b7cb81038843a291..b8390e7af50569b62f031c5a3af3020d43b6f98a 100644 --- a/documentation20/webdocs/markdowndocs/connector-java-ch.md +++ b/documentation20/webdocs/markdowndocs/connector-java-ch.md @@ -1,62 +1,62 @@ # Java Connector -Java连接器支持的系统有: -| **CPU类型** | x64(64bit) | | | ARM64 | ARM32 | -| ------------ | ------------ | -------- | -------- | -------- | -------- | -| **OS类型** | Linux | Win64 | Win32 | Linux | Linux | -| **支持与否** | **支持** | **支持** | **支持** | **支持** | **支持** | +TDengine 提供了遵循 JDBC 标准(3.0)API 规范的 `taos-jdbcdriver` 实现,可在 maven 的中央仓库 [Sonatype Repository][1] 搜索下载。 -Java连接器的使用请参见视频教程。 +`taos-jdbcdriver` 的实现包括 2 种形式: JDBC-JNI 和 JDBC-RESTful(taos-jdbcdriver-2.0.17 开始支持 JDBC-RESTful)。 JDBC-JNI 通过调用客户端 libtaos.so(或 taos.dll )的本地方法实现, JDBC-RESTful 则在内部封装了 RESTful 接口实现。 -TDengine 为了方便 Java 应用使用,提供了遵循 JDBC 标准(3.0)API 规范的 `taos-jdbcdriver` 实现。目前可以通过 [Sonatype Repository][1] 搜索并下载。 +![tdengine-connector](../assets/tdengine-jdbc-connector.png) -由于 TDengine 是使用 c 语言开发的,使用 taos-jdbcdriver 驱动包时需要依赖系统对应的本地函数库。 +上图显示了 3 种 Java 应用使用连接器访问 TDengine 的方式: -* libtaos.so - 在 linux 系统中成功安装 TDengine 后,依赖的本地函数库 libtaos.so 文件会被自动拷贝至 /usr/lib/libtaos.so,该目录包含在 Linux 自动扫描路径上,无需单独指定。 - -* taos.dll - 在 windows 系统中安装完客户端之后,驱动包依赖的 taos.dll 文件会自动拷贝到系统默认搜索路径 C:/Windows/System32 下,同样无需要单独指定。 +* JDBC-JNI:Java 应用在物理节点1(pnode1)上使用 JDBC-JNI 的 API ,直接调用客户端 API(libtaos.so 或 taos.dll)将写入和查询请求发送到位于物理节点2(pnode2)上的 taosd 实例。 +* RESTful:应用将 SQL 发送给位于物理节点2(pnode2)上的 RESTful 连接器,再调用客户端 API(libtaos.so)。 +* JDBC-RESTful:Java 应用通过 JDBC-RESTful 的 API ,将 SQL 封装成一个 RESTful 请求,发送给物理节点2的 RESTful 连接器。 -> 注意:在 windows 环境开发时需要安装 TDengine 对应的 [windows 客户端][14],Linux 服务器安装完 TDengine 之后默认已安装 client,也可以单独安装 [Linux 客户端][15] 连接远程 TDengine Server。 +TDengine 的 JDBC 驱动实现尽可能与关系型数据库驱动保持一致,但时序空间数据库与关系对象型数据库服务的对象和技术特征存在差异,导致 `taos-jdbcdriver` 与传统的 JDBC driver 也存在一定差异。在使用时需要注意以下几点: -TDengine 的 JDBC 驱动实现尽可能的与关系型数据库驱动保持一致,但时序空间数据库与关系对象型数据库服务的对象和技术特征的差异导致 taos-jdbcdriver 并未完全实现 JDBC 标准规范。在使用时需要注意以下几点: - -* TDengine 不提供针对单条数据记录的删除和修改的操作,驱动中也没有支持相关方法。 -* 由于不支持删除和修改,所以也不支持事务操作。 +* TDengine 目前不支持针对单条数据记录的删除操作。 +* 目前不支持事务操作。 * 目前不支持表间的 union 操作。 -* 目前不支持嵌套查询(nested query),对每个 Connection 的实例,至多只能有一个打开的 ResultSet 实例;如果在 ResultSet还没关闭的情况下执行了新的查询,TSDBJDBCDriver 则会自动关闭上一个 ResultSet。 - -## TAOS-JDBCDriver 版本以及支持的 TDengine 版本和 JDK 版本 - -| taos-jdbcdriver 版本 | TDengine 版本 | JDK 版本 | -| --- | --- | --- | -| 2.0.12 及以上 | 2.0.8.0 及以上 | 1.8.x | -| 2.0.4 - 2.0.11 | 2.0.0.0 - 2.0.7.x | 1.8.x | -| 1.0.3 | 1.6.1.x 及以上 | 1.8.x | -| 1.0.2 | 1.6.1.x 及以上 | 1.8.x | -| 1.0.1 | 1.6.1.x 及以上 | 1.8.x | - -## TDengine DataType 和 Java DataType - -TDengine 目前支持时间戳、数字、字符、布尔类型,与 Java 对应类型转换如下: - -| TDengine DataType | Java DataType | -| --- | --- | -| TIMESTAMP | java.sql.Timestamp | -| INT | java.lang.Integer | -| BIGINT | java.lang.Long | -| FLOAT | java.lang.Float | -| DOUBLE | java.lang.Double | -| SMALLINT, TINYINT |java.lang.Short | -| BOOL | java.lang.Boolean | -| BINARY, NCHAR | java.lang.String | - -## 如何获取 TAOS-JDBCDriver +* 目前不支持嵌套查询(nested query)。 +* 对每个 Connection 的实例,至多只能有一个打开的 ResultSet 实例;如果在 ResultSet 还没关闭的情况下执行了新的查询,taos-jdbcdriver 会自动关闭上一个 ResultSet。 + + +## JDBC-JNI和JDBC-RESTful的对比 + + + + + + + + + + + + + + + + + + + + + + + + + + +
对比项JDBC-JNIJDBC-RESTful
支持的操作系统linux、windows全平台
是否需要安装 client需要不需要
server 升级后是否需要升级 client需要不需要
写入性能JDBC-RESTful 是 JDBC-JNI 的 50%~90%
查询性能JDBC-RESTful 与 JDBC-JNI 没有差别
+ + +## 如何获取 taos-jdbcdriver ### maven 仓库 目前 taos-jdbcdriver 已经发布到 [Sonatype Repository][1] 仓库,且各大仓库都已同步。 + * [sonatype][8] * [mvnrepository][9] * [maven.aliyun][10] @@ -67,30 +67,63 @@ maven 项目中使用如下 pom.xml 配置即可: com.taosdata.jdbc taos-jdbcdriver - 2.0.4 + 2.0.17 ``` ### 源码编译打包 -下载 [TDengine][3] 源码之后,进入 taos-jdbcdriver 源码目录 `src/connector/jdbc` 执行 `mvn clean package` 即可生成相应 jar 包。 +下载 [TDengine][3] 源码之后,进入 taos-jdbcdriver 源码目录 `src/connector/jdbc` 执行 `mvn clean package -Dmaven.test.skip=true` 即可生成相应 jar 包。 + -## 使用说明 + +## JDBC的使用说明 ### 获取连接 -#### 通过JdbcUrl获取连接 +#### 指定URL获取连接 + +通过指定URL获取连接,如下所示: + +```java +Class.forName("com.taosdata.jdbc.rs.RestfulDriver"); +String jdbcUrl = "jdbc:TAOS-RS://taosdemo.com:6041/test?user=root&password=taosdata"; +Connection conn = DriverManager.getConnection(jdbcUrl); +``` + +以上示例,使用 **JDBC-RESTful** 的 driver,建立了到 hostname 为 taosdemo.com,端口为 6041,数据库名为 test 的连接。这个 URL 中指定用户名(user)为 root,密码(password)为 taosdata。 + +使用 JDBC-RESTful 接口,不需要依赖本地函数库。与 JDBC-JNI 相比,仅需要: + +1. driverClass 指定为“com.taosdata.jdbc.rs.RestfulDriver”; +2. jdbcUrl 以“jdbc:TAOS-RS://”开头; +3. 使用 6041 作为连接端口。 + +如果希望获得更好的写入和查询性能,Java 应用可以使用 **JDBC-JNI** 的driver,如下所示: -通过指定的jdbcUrl获取连接,如下所示: ```java Class.forName("com.taosdata.jdbc.TSDBDriver"); String jdbcUrl = "jdbc:TAOS://taosdemo.com:6030/test?user=root&password=taosdata"; Connection conn = DriverManager.getConnection(jdbcUrl); ``` -以上示例,建立了到hostname为taosdemo.com,端口为6030(TDengine的默认端口),数据库名为test的连接。这个url中指定用户名(user)为root,密码(password)为taosdata。 + +以上示例,使用了 JDBC-JNI 的 driver,建立了到 hostname 为 taosdemo.com,端口为 6030(TDengine 的默认端口),数据库名为 test 的连接。这个 URL 中指定用户名(user)为 root,密码(password)为 taosdata。 + +**注意**:使用 JDBC-JNI 的 driver,taos-jdbcdriver 驱动包时需要依赖系统对应的本地函数库。 + +* libtaos.so + 在 linux 系统中成功安装 TDengine 后,依赖的本地函数库 libtaos.so 文件会被自动拷贝至 /usr/lib/libtaos.so,该目录包含在 Linux 自动扫描路径上,无需单独指定。 + +* taos.dll + 在 windows 系统中安装完客户端之后,驱动包依赖的 taos.dll 文件会自动拷贝到系统默认搜索路径 C:/Windows/System32 下,同样无需要单独指定。 + +> 在 windows 环境开发时需要安装 TDengine 对应的 [windows 客户端][14],Linux 服务器安装完 TDengine 之后默认已安装 client,也可以单独安装 [Linux 客户端][15] 连接远程 TDengine Server。 + +JDBC-JNI 的使用请参见视频教程。 TDengine 的 JDBC URL 规范格式为: -`jdbc:TAOS://[host_name]:[port]/[database_name]?[user={user}|&password={password}|&charset={charset}|&cfgdir={config_dir}|&locale={locale}|&timezone={timezone}]` +`jdbc:[TAOS|TAOS-RS]://[host_name]:[port]/[database_name]?[user={user}|&password={password}|&charset={charset}|&cfgdir={config_dir}|&locale={locale}|&timezone={timezone}]` + url中的配置参数如下: * user:登录 TDengine 用户名,默认值 root。 * password:用户登录密码,默认值 taosdata。 @@ -99,13 +132,17 @@ url中的配置参数如下: * locale:客户端语言环境,默认值系统当前 locale。 * timezone:客户端使用的时区,默认值为系统当前时区。 -#### 使用JdbcUrl和Properties获取连接 -除了通过指定的jdbcUrl获取连接,还可以使用Properties指定建立连接时的参数,如下所示: + +#### 指定URL和Properties获取连接 + +除了通过指定的 URL 获取连接,还可以使用 Properties 指定建立连接时的参数,如下所示: ```java public Connection getConn() throws Exception{ Class.forName("com.taosdata.jdbc.TSDBDriver"); + // Class.forName("com.taosdata.jdbc.rs.RestfulDriver"); String jdbcUrl = "jdbc:TAOS://taosdemo.com:6030/test?user=root&password=taosdata"; + // String jdbcUrl = "jdbc:TAOS-RS://taosdemo.com:6041/test?user=root&password=taosdata"; Properties connProps = new Properties(); connProps.setProperty(TSDBDriver.PROPERTY_KEY_CHARSET, "UTF-8"); connProps.setProperty(TSDBDriver.PROPERTY_KEY_LOCALE, "en_US.UTF-8"); @@ -114,9 +151,10 @@ public Connection getConn() throws Exception{ return conn; } ``` -以上示例,建立一个到hostname为taosdemo.com,端口为6030,数据库名为test的连接。这个连接在url中指定了用户名(user)为root,密码(password)为taosdata,并在connProps中指定了使用的字符集、语言环境、时区等信息。 -properties中的配置参数如下: +以上示例,建立一个到 hostname 为 taosdemo.com,端口为 6030,数据库名为 test 的连接。注释为使用 JDBC-RESTful 时的方法。这个连接在 url 中指定了用户名(user)为 root,密码(password)为 taosdata,并在 connProps 中指定了使用的字符集、语言环境、时区等信息。 + +properties 中的配置参数如下: * TSDBDriver.PROPERTY_KEY_USER:登录 TDengine 用户名,默认值 root。 * TSDBDriver.PROPERTY_KEY_PASSWORD:用户登录密码,默认值 taosdata。 * TSDBDriver.PROPERTY_KEY_CONFIG_DIR:客户端配置文件目录路径,Linux OS 上默认值 /etc/taos ,Windows OS 上默认值 C:/TDengine/cfg。 @@ -124,10 +162,14 @@ properties中的配置参数如下: * TSDBDriver.PROPERTY_KEY_LOCALE:客户端语言环境,默认值系统当前 locale。 * TSDBDriver.PROPERTY_KEY_TIME_ZONE:客户端使用的时区,默认值为系统当前时区。 + + #### 使用客户端配置文件建立连接 -当使用JDBC连接TDengine集群时,可以使用客户端配置文件,在客户端配置文件中指定集群的firstEp、secondEp参数。 + +当使用 JDBC-JNI 连接 TDengine 集群时,可以使用客户端配置文件,在客户端配置文件中指定集群的 firstEp、secondEp参数。 如下所示: -1. 在java中不指定hostname和port + +1. 在 Java 应用中不指定 hostname 和 port ```java public Connection getConn() throws Exception{ Class.forName("com.taosdata.jdbc.TSDBDriver"); @@ -140,7 +182,7 @@ public Connection getConn() throws Exception{ return conn; } ``` -2. 在配置文件中指定firstEp和secondEp +2. 在配置文件中指定 firstEp 和 secondEp ``` # first fully qualified domain name (FQDN) for TDengine system firstEp cluster_node1:6030 @@ -155,17 +197,19 @@ secondEp cluster_node2:6030 # locale en_US.UTF-8 ``` -以上示例,jdbc会使用客户端的配置文件,建立到hostname为cluster_node1,端口为6030,数据库名为test的连接。当集群中firstEp节点失效时,JDBC会尝试使用secondEp连接集群。 -TDengine中,只要保证firstEp和secondEp中一个节点有效,就可以正常建立到集群的连接。 +以上示例,jdbc 会使用客户端的配置文件,建立到 hostname 为 cluster_node1、端口为 6030、数据库名为 test 的连接。当集群中 firstEp 节点失效时,JDBC 会尝试使用 secondEp 连接集群。 +TDengine 中,只要保证 firstEp 和 secondEp 中一个节点有效,就可以正常建立到集群的连接。 -> 注意:这里的配置文件指的是调用JDBC Connector的应用程序所在机器上的配置文件,Linux OS 上默认值 /etc/taos/taos.cfg ,Windows OS 上默认值 C://TDengine/cfg/taos.cfg。 +> 注意:这里的配置文件指的是调用 JDBC Connector 的应用程序所在机器上的配置文件,Linux OS 上默认值 /etc/taos/taos.cfg ,Windows OS 上默认值 C://TDengine/cfg/taos.cfg。 #### 配置参数的优先级 -通过以上3种方式获取连接,如果配置参数在url、Properties、客户端配置文件中有重复,则参数的`优先级由高到低`分别如下: + +通过以上 3 种方式获取连接,如果配置参数在 url、Properties、客户端配置文件中有重复,则参数的`优先级由高到低`分别如下: 1. JDBC URL 参数,如上所述,可以在 JDBC URL 的参数中指定。 2. Properties connProps 3. 客户端配置文件 taos.cfg -例如:在url中指定了password为taosdata,在Properties中指定了password为taosdemo,那么,JDBC会使用url中的password建立连接。 + +例如:在 url 中指定了 password 为 taosdata,在 Properties 中指定了 password 为 taosdemo,那么,JDBC 会使用 url 中的 password 建立连接。 > 更多详细配置请参考[客户端配置][13] @@ -183,6 +227,7 @@ stmt.executeUpdate("use db"); // create table stmt.executeUpdate("create table if not exists tb (ts timestamp, temperature int, humidity float)"); ``` + > 注意:如果不使用 `use db` 指定数据库,则后续对表的操作都需要增加数据库名称作为前缀,如 db.tb。 ### 插入数据 @@ -193,6 +238,7 @@ int affectedRows = stmt.executeUpdate("insert into tb values(now, 23, 10.3) (now System.out.println("insert " + affectedRows + " rows."); ``` + > now 为系统内部函数,默认为服务器当前时间。 > `now + 1s` 代表服务器当前时间往后加 1 秒,数字后面代表时间单位:a(毫秒), s(秒), m(分), h(小时), d(天),w(周), n(月), y(年)。 @@ -214,6 +260,7 @@ while(resultSet.next()){ System.out.printf("%s, %d, %s\n", ts, temperature, humidity); } ``` + > 查询和操作关系型数据库一致,使用下标获取返回字段内容时从 1 开始,建议使用字段名称获取。 ### 订阅 @@ -248,7 +295,7 @@ while(true) { } ``` -`consume` 方法返回一个结果集,其中包含从上次 `consume` 到目前为止的所有新数据。请务必按需选择合理的调用 `consume` 的频率(如例子中的`Thread.sleep(1000)`),否则会给服务端造成不必要的压力。 +`consume` 方法返回一个结果集,其中包含从上次 `consume` 到目前为止的所有新数据。请务必按需选择合理的调用 `consume` 的频率(如例子中的 `Thread.sleep(1000)`),否则会给服务端造成不必要的压力。 #### 关闭订阅 @@ -265,8 +312,11 @@ resultSet.close(); stmt.close(); conn.close(); ``` + > `注意务必要将 connection 进行关闭`,否则会出现连接泄露。 + + ## 与连接池使用 **HikariCP** @@ -306,6 +356,7 @@ conn.close(); connection.close(); // put back to conneciton pool } ``` + > 通过 HikariDataSource.getConnection() 获取连接后,使用完成后需要调用 close() 方法,实际上它并不会关闭连接,只是放回连接池中。 > 更多 HikariCP 使用问题请查看[官方说明][5] @@ -356,6 +407,7 @@ public static void main(String[] args) throws Exception { connection.close(); // put back to conneciton pool } ``` + > 更多 druid 使用问题请查看[官方说明][6] **注意事项** @@ -370,10 +422,43 @@ server_status()| Query OK, 1 row(s) in set (0.000141s) ``` + + ## 与框架使用 * Spring JdbcTemplate 中使用 taos-jdbcdriver,可参考 [SpringJdbcTemplate][11] -* Springboot + Mybatis 中使用,可参考 [springbootdemo][12] +* Springboot + Mybatis 中使用,可参考 [springbootdemo + + + +## TAOS-JDBCDriver 版本以及支持的 TDengine 版本和 JDK 版本 + +| taos-jdbcdriver 版本 | TDengine 版本 | JDK 版本 | +| -------------------- | ----------------- | -------- | +| 2.0.12 及以上 | 2.0.8.0 及以上 | 1.8.x | +| 2.0.4 - 2.0.11 | 2.0.0.0 - 2.0.7.x | 1.8.x | +| 1.0.3 | 1.6.1.x 及以上 | 1.8.x | +| 1.0.2 | 1.6.1.x 及以上 | 1.8.x | +| 1.0.1 | 1.6.1.x 及以上 | 1.8.x | + + + +## TDengine DataType 和 Java DataType + +TDengine 目前支持时间戳、数字、字符、布尔类型,与 Java 对应类型转换如下: + +| TDengine DataType | Java DataType | +| ----------------- | ------------------ | +| TIMESTAMP | java.sql.Timestamp | +| INT | java.lang.Integer | +| BIGINT | java.lang.Long | +| FLOAT | java.lang.Float | +| DOUBLE | java.lang.Double | +| SMALLINT, TINYINT | java.lang.Short | +| BOOL | java.lang.Boolean | +| BINARY, NCHAR | java.lang.String | + + ## 常见问题 @@ -381,7 +466,7 @@ Query OK, 1 row(s) in set (0.000141s) **原因**:程序没有找到依赖的本地函数库 taos。 - **解决方法**:windows 下可以将 C:\TDengine\driver\taos.dll 拷贝到 C:\Windows\System32\ 目录下,linux 下将建立如下软链 ` ln -s /usr/local/taos/driver/libtaos.so.x.x.x.x /usr/lib/libtaos.so` 即可。 + **解决方法**:windows 下可以将 C:\TDengine\driver\taos.dll 拷贝到 C:\Windows\System32\ 目录下,linux 下将建立如下软链 `ln -s /usr/local/taos/driver/libtaos.so.x.x.x.x /usr/lib/libtaos.so` 即可。 * java.lang.UnsatisfiedLinkError: taos.dll Can't load AMD 64 bit on a IA 32-bit platform @@ -406,3 +491,4 @@ Query OK, 1 row(s) in set (0.000141s) [13]: https://www.taosdata.com/cn/documentation20/administrator/#%E5%AE%A2%E6%88%B7%E7%AB%AF%E9%85%8D%E7%BD%AE [14]: https://www.taosdata.com/cn/all-downloads/#TDengine-Windows-Client [15]: https://www.taosdata.com/cn/getting-started/#%E5%BF%AB%E9%80%9F%E4%B8%8A%E6%89%8B + diff --git a/documentation20/webdocs/markdowndocs/faq-ch.md b/documentation20/webdocs/markdowndocs/faq-ch.md index 79139078c13bda797299b470b417061c61169a10..cd6f0ae08caf19340b6cef9a9428abcb66c97dc6 100644 --- a/documentation20/webdocs/markdowndocs/faq-ch.md +++ b/documentation20/webdocs/markdowndocs/faq-ch.md @@ -85,7 +85,9 @@ TDengine还没有一组专用的validation queries。然而建议你使用系统 ## 9. 我可以删除或更新一条记录吗? -不能。因为TDengine是为联网设备采集的数据设计的,不容许修改。但TDengine提供数据保留策略,只要数据记录超过保留时长,就会被自动删除。 +TDengine 目前尚不支持删除功能,未来根据用户需求可能会支持。 + +从 2.0.8.0 开始,TDengine 支持更新已经写入数据的功能。使用更新功能需要在创建数据库时使用 UPDATE 1 参数,之后可以使用 INSERT INTO 命令更新已经写入的相同时间戳数据。UPDATE 参数不支持 ALTER DATABASE 命令修改。没有使用 UPDATE 1 参数创建的数据库,写入相同时间戳的数据不会修改之前的数据,也不会报错。 ## 10. 我怎么创建超过1024列的表? @@ -132,8 +134,3 @@ TDengine是根据hostname唯一标志一台机器的,在数据文件从机器A - 2.0.7.0 及以后的版本,到/var/lib/taos/dnode下,修复dnodeEps.json的dnodeId对应的FQDN,重启。确保机器内所有机器的此文件是完全相同的。 - 1.x 和 2.x 版本的存储结构不兼容,需要使用迁移工具或者自己开发应用导出导入数据。 -## 17. TDengine 是否支持删除或更新已经写入的数据? - -TDengine 目前尚不支持删除功能,未来根据用户需求可能会支持。 - -从 2.0.8.0 开始,TDengine 支持更新已经写入数据的功能。使用更新功能需要在创建数据库时使用 UPDATE 1 参数,之后可以使用 INSERT INTO 命令更新已经写入的相同时间戳数据。UPDATE 参数不支持 ALTER DATABASE 命令修改。没有使用 UPDATE 1 参数创建的数据库,写入相同时间戳的数据不会修改之前的数据,也不会报错。 \ No newline at end of file diff --git a/documentation20/webdocs/markdowndocs/insert-ch.md b/documentation20/webdocs/markdowndocs/insert-ch.md index 3fa48c1f508bedf7b4000ffe9f7ef8c96e42d606..7d380ac952dce5f57ff259159c33dd9e9b53edf3 100644 --- a/documentation20/webdocs/markdowndocs/insert-ch.md +++ b/documentation20/webdocs/markdowndocs/insert-ch.md @@ -222,7 +222,7 @@ MQTT是一流行的物联网数据传输协议,TDengine 可以很方便的接 ## EMQ Broker 直接写入 -EMQ是一开源的MQTT Broker软件,无需任何代码,只需要在EMQ Dashboard里使用“规则”做简单配置,即可将MQTT的数据直接写入TDengine。EMQ X 支持通过 发送到 Web 服务 的方式保存数据到 TDengine,也在企业版上提供原生的 TDEngine 驱动实现直接保存。详细使用方法请参考EMQ 官方文档。 +EMQ是一开源的MQTT Broker软件,无需任何代码,只需要在EMQ Dashboard里使用“规则”做简单配置,即可将MQTT的数据直接写入TDengine。EMQ X 支持通过 发送到 Web 服务 的方式保存数据到 TDengine,也在企业版上提供原生的 TDengine 驱动实现直接保存。详细使用方法请参考EMQ 官方文档。 ## HiveMQ Broker 直接写入 diff --git a/packaging/cfg/taos.cfg b/packaging/cfg/taos.cfg index 2908a8a21e503acd96c4d9d3976c9ee67bb86561..73004fe7b722d2fd2c15930f69a38d78aca4220d 100644 --- a/packaging/cfg/taos.cfg +++ b/packaging/cfg/taos.cfg @@ -265,9 +265,6 @@ # maximum display width of binary and nchar fields in the shell. The parts exceeding this limit will be hidden # maxBinaryDisplayWidth 30 -# enable/disable telemetry reporting -# telemetryReporting 1 - # enable/disable stream (continuous query) # stream 1 diff --git a/src/client/inc/tscSubquery.h b/src/client/inc/tscSubquery.h index 7529891635f47fb4f2b68ede5b48ed5640c8f00a..e1370513ef28b4eb86d4caf8c7b34481f334c512 100644 --- a/src/client/inc/tscSubquery.h +++ b/src/client/inc/tscSubquery.h @@ -47,7 +47,6 @@ void tscLockByThread(int64_t *lockedBy); void tscUnlockByThread(int64_t *lockedBy); - #ifdef __cplusplus } #endif diff --git a/src/client/inc/tsclient.h b/src/client/inc/tsclient.h index 652e5bdd47b5bfa3adfdb8b8f58e94399c4de810..085791e45c0920174d6091328c4c5ae4f570eac0 100644 --- a/src/client/inc/tsclient.h +++ b/src/client/inc/tsclient.h @@ -317,7 +317,8 @@ typedef struct STscObj { } STscObj; typedef struct SSubqueryState { - int32_t numOfRemain; // the number of remain unfinished subquery + pthread_mutex_t mutex; + int8_t *states; int32_t numOfSub; // the number of total sub-queries uint64_t numOfRetrievedRows; // total number of points in this query } SSubqueryState; diff --git a/src/client/src/tscLocalMerge.c b/src/client/src/tscLocalMerge.c index 6280cc520a9adf7b2d8686455b1524a8b356af83..c9c877c04319d43af7acad0ebe921a62800a20f0 100644 --- a/src/client/src/tscLocalMerge.c +++ b/src/client/src/tscLocalMerge.c @@ -1427,6 +1427,10 @@ int32_t tscDoLocalMerge(SSqlObj *pSql) { tscResetForNextRetrieve(pRes); if (pSql->signature != pSql || pRes == NULL || pRes->pLocalReducer == NULL) { // all data has been processed + if (pRes->code == TSDB_CODE_SUCCESS) { + return pRes->code; + } + tscError("%p local merge abort due to error occurs, code:%s", pSql, tstrerror(pRes->code)); return pRes->code; } diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 64268124da93b30de4109ac5134eb87c759725d2..98c5374212d36746421658a5bdaf2f20768d1cb3 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -264,6 +264,7 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) { case TSDB_SQL_DROP_DB: { const char* msg2 = "invalid name"; const char* msg3 = "param name too long"; + const char* msg4 = "table is not super table"; SStrToken* pzName = &pInfo->pDCLInfo->a[0]; if ((pInfo->type != TSDB_SQL_DROP_DNODE) && (tscValidateName(pzName) != TSDB_CODE_SUCCESS)) { @@ -285,6 +286,18 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) { if(code != TSDB_CODE_SUCCESS) { return code; } + + if (pInfo->pDCLInfo->tableType == TSDB_SUPER_TABLE) { + code = tscGetTableMeta(pSql, pTableMetaInfo); + if (code != TSDB_CODE_SUCCESS) { + return code; + } + + if (!UTIL_TABLE_IS_SUPER_TABLE(pTableMetaInfo)) { + return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg4); + } + } + } else if (pInfo->type == TSDB_SQL_DROP_DNODE) { pzName->n = strdequote(pzName->z); strncpy(pTableMetaInfo->name, pzName->z, pzName->n); @@ -4794,6 +4807,7 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { const char* msg17 = "invalid column name"; const char* msg18 = "primary timestamp column cannot be dropped"; const char* msg19 = "invalid new tag name"; + const char* msg20 = "table is not super table"; int32_t code = TSDB_CODE_SUCCESS; @@ -4819,6 +4833,10 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { STableMeta* pTableMeta = pTableMetaInfo->pTableMeta; + if (pAlterSQL->tableType == TSDB_SUPER_TABLE && !(UTIL_TABLE_IS_SUPER_TABLE(pTableMetaInfo))) { + return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg20); + } + if (pAlterSQL->type == TSDB_ALTER_TABLE_ADD_TAG_COLUMN || pAlterSQL->type == TSDB_ALTER_TABLE_DROP_TAG_COLUMN || pAlterSQL->type == TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN) { if (UTIL_TABLE_IS_NORMAL_TABLE(pTableMetaInfo)) { diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 537e81413fdd74f54d74c1bb887f28498b0b7379..953680c43e68a45f507501253a24afb2e260d940 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -2193,7 +2193,7 @@ int tscProcessDropTableRsp(SSqlObj *pSql) { tscDebug("%p remove table meta after drop table:%s, numOfRemain:%d", pSql, pTableMetaInfo->name, (int32_t) taosHashGetSize(tscTableMetaInfo)); - assert(pTableMetaInfo->pTableMeta == NULL); + pTableMetaInfo->pTableMeta = NULL; return 0; } diff --git a/src/client/src/tscSubquery.c b/src/client/src/tscSubquery.c index 2622246111894caf39f3c1c37923d1a7207935b6..ee9526e297f0b748df52e5e7b5cd552a2f39df34 100644 --- a/src/client/src/tscSubquery.c +++ b/src/client/src/tscSubquery.c @@ -55,6 +55,58 @@ static void skipRemainValue(STSBuf* pTSBuf, tVariant* tag1) { } } +static void subquerySetState(SSqlObj *pSql, SSubqueryState *subState, int idx, int8_t state) { + assert(idx < subState->numOfSub); + assert(subState->states); + + pthread_mutex_lock(&subState->mutex); + + tscDebug("subquery:%p,%d state set to %d", pSql, idx, state); + + subState->states[idx] = state; + + pthread_mutex_unlock(&subState->mutex); +} + +static bool allSubqueryDone(SSqlObj *pParentSql) { + bool done = true; + SSubqueryState *subState = &pParentSql->subState; + + //lock in caller + + for (int i = 0; i < subState->numOfSub; i++) { + if (0 == subState->states[i]) { + tscDebug("%p subquery:%p,%d is NOT finished, total:%d", pParentSql, pParentSql->pSubs[i], i, subState->numOfSub); + done = false; + break; + } else { + tscDebug("%p subquery:%p,%d is finished, total:%d", pParentSql, pParentSql->pSubs[i], i, subState->numOfSub); + } + } + + return done; +} + +static bool subAndCheckDone(SSqlObj *pSql, SSqlObj *pParentSql, int idx) { + SSubqueryState *subState = &pParentSql->subState; + + assert(idx < subState->numOfSub); + + pthread_mutex_lock(&subState->mutex); + + tscDebug("%p subquery:%p,%d state set to 1", pParentSql, pSql, idx); + + subState->states[idx] = 1; + + bool done = allSubqueryDone(pParentSql); + + pthread_mutex_unlock(&subState->mutex); + + return done; +} + + + static int64_t doTSBlockIntersect(SSqlObj* pSql, SJoinSupporter* pSupporter1, SJoinSupporter* pSupporter2, STimeWindow * win) { SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(&pSql->cmd, pSql->cmd.clauseIndex); @@ -367,10 +419,6 @@ static int32_t tscLaunchRealSubqueries(SSqlObj* pSql) { // scan all subquery, if one sub query has only ts, ignore it tscDebug("%p start to launch secondary subqueries, %d out of %d needs to query", pSql, numOfSub, pSql->subState.numOfSub); - //the subqueries that do not actually launch the secondary query to virtual node is set as completed. - SSubqueryState* pState = &pSql->subState; - pState->numOfRemain = numOfSub; - bool success = true; for (int32_t i = 0; i < pSql->subState.numOfSub; ++i) { @@ -403,6 +451,7 @@ static int32_t tscLaunchRealSubqueries(SSqlObj* pSql) { success = false; break; } + tscClearSubqueryInfo(&pNew->cmd); pSql->pSubs[i] = pNew; @@ -480,6 +529,8 @@ static int32_t tscLaunchRealSubqueries(SSqlObj* pSql) { } } + subquerySetState(pPrevSub, &pSql->subState, i, 0); + size_t numOfCols = taosArrayGetSize(pQueryInfo->colList); tscDebug("%p subquery:%p tableIndex:%d, vgroupIndex:%d, type:%d, exprInfo:%" PRIzu ", colList:%" PRIzu ", fieldsInfo:%d, name:%s", pSql, pNew, 0, pTableMetaInfo->vgroupIndex, pQueryInfo->type, taosArrayGetSize(pQueryInfo->exprList), @@ -517,20 +568,25 @@ void freeJoinSubqueryObj(SSqlObj* pSql) { SJoinSupporter* p = pSub->param; tscDestroyJoinSupporter(p); - if (pSub->res.code == TSDB_CODE_SUCCESS) { - taos_free_result(pSub); - } + taos_free_result(pSub); + pSql->pSubs[i] = NULL; } + if (pSql->subState.states) { + pthread_mutex_destroy(&pSql->subState.mutex); + } + + tfree(pSql->subState.states); + + pSql->subState.numOfSub = 0; } -static void quitAllSubquery(SSqlObj* pSqlObj, SJoinSupporter* pSupporter) { - assert(pSqlObj->subState.numOfRemain > 0); - - if (atomic_sub_fetch_32(&pSqlObj->subState.numOfRemain, 1) <= 0) { - tscError("%p all subquery return and query failed, global code:%s", pSqlObj, tstrerror(pSqlObj->res.code)); +static void quitAllSubquery(SSqlObj* pSqlSub, SSqlObj* pSqlObj, SJoinSupporter* pSupporter) { + if (subAndCheckDone(pSqlSub, pSqlObj, pSupporter->subqueryIndex)) { + tscError("%p all subquery return and query failed, global code:%s", pSqlObj, tstrerror(pSqlObj->res.code)); freeJoinSubqueryObj(pSqlObj); + return; } //tscDestroyJoinSupporter(pSupporter); @@ -777,6 +833,15 @@ static void tidTagRetrieveCallback(void* param, TAOS_RES* tres, int32_t numOfRow SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(pCmd, pCmd->clauseIndex); assert(TSDB_QUERY_HAS_TYPE(pQueryInfo->type, TSDB_QUERY_TYPE_TAG_FILTER_QUERY)); + if (pParentSql->res.code != TSDB_CODE_SUCCESS) { + tscError("%p abort query due to other subquery failure. code:%d, global code:%d", pSql, numOfRows, pParentSql->res.code); + quitAllSubquery(pSql, pParentSql, pSupporter); + + tscAsyncResultOnError(pParentSql); + + return; + } + // check for the error code firstly if (taos_errno(pSql) != TSDB_CODE_SUCCESS) { // todo retry if other subqueries are not failed @@ -785,7 +850,7 @@ static void tidTagRetrieveCallback(void* param, TAOS_RES* tres, int32_t numOfRow tscError("%p sub query failed, code:%s, index:%d", pSql, tstrerror(numOfRows), pSupporter->subqueryIndex); pParentSql->res.code = numOfRows; - quitAllSubquery(pParentSql, pSupporter); + quitAllSubquery(pSql, pParentSql, pSupporter); tscAsyncResultOnError(pParentSql); return; @@ -802,7 +867,7 @@ static void tidTagRetrieveCallback(void* param, TAOS_RES* tres, int32_t numOfRow tscError("%p failed to malloc memory", pSql); pParentSql->res.code = TAOS_SYSTEM_ERROR(errno); - quitAllSubquery(pParentSql, pSupporter); + quitAllSubquery(pSql, pParentSql, pSupporter); tscAsyncResultOnError(pParentSql); return; @@ -844,9 +909,10 @@ static void tidTagRetrieveCallback(void* param, TAOS_RES* tres, int32_t numOfRow // no data exists in next vnode, mark the query completed // only when there is no subquery exits any more, proceeds to get the intersect of the tuple sets. - if (atomic_sub_fetch_32(&pParentSql->subState.numOfRemain, 1) > 0) { + if (!subAndCheckDone(pSql, pParentSql, pSupporter->subqueryIndex)) { + tscDebug("%p tagRetrieve:%p,%d completed, total:%d", pParentSql, tres, pSupporter->subqueryIndex, pParentSql->subState.numOfSub); return; - } + } SArray *s1 = NULL, *s2 = NULL; int32_t code = getIntersectionOfTableTuple(pQueryInfo, pParentSql, &s1, &s2); @@ -891,8 +957,10 @@ static void tidTagRetrieveCallback(void* param, TAOS_RES* tres, int32_t numOfRow ((SJoinSupporter*)psub2->param)->pVgroupTables = tscVgroupTableInfoClone(pTableMetaInfo2->pVgroupTables); pParentSql->subState.numOfSub = 2; - pParentSql->subState.numOfRemain = pParentSql->subState.numOfSub; - + + memset(pParentSql->subState.states, 0, sizeof(pParentSql->subState.states[0]) * pParentSql->subState.numOfSub); + tscDebug("%p reset all sub states to 0", pParentSql); + for (int32_t m = 0; m < pParentSql->subState.numOfSub; ++m) { SSqlObj* sub = pParentSql->pSubs[m]; issueTSCompQuery(sub, sub->param, pParentSql); @@ -915,6 +983,15 @@ static void tsCompRetrieveCallback(void* param, TAOS_RES* tres, int32_t numOfRow SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(pCmd, pCmd->clauseIndex); assert(!TSDB_QUERY_HAS_TYPE(pQueryInfo->type, TSDB_QUERY_TYPE_JOIN_SEC_STAGE)); + if (pParentSql->res.code != TSDB_CODE_SUCCESS) { + tscError("%p abort query due to other subquery failure. code:%d, global code:%d", pSql, numOfRows, pParentSql->res.code); + quitAllSubquery(pSql, pParentSql, pSupporter); + + tscAsyncResultOnError(pParentSql); + + return; + } + // check for the error code firstly if (taos_errno(pSql) != TSDB_CODE_SUCCESS) { // todo retry if other subqueries are not failed yet @@ -922,7 +999,7 @@ static void tsCompRetrieveCallback(void* param, TAOS_RES* tres, int32_t numOfRow tscError("%p sub query failed, code:%s, index:%d", pSql, tstrerror(numOfRows), pSupporter->subqueryIndex); pParentSql->res.code = numOfRows; - quitAllSubquery(pParentSql, pSupporter); + quitAllSubquery(pSql, pParentSql, pSupporter); tscAsyncResultOnError(pParentSql); return; @@ -937,7 +1014,7 @@ static void tsCompRetrieveCallback(void* param, TAOS_RES* tres, int32_t numOfRow pParentSql->res.code = TAOS_SYSTEM_ERROR(errno); - quitAllSubquery(pParentSql, pSupporter); + quitAllSubquery(pSql, pParentSql, pSupporter); tscAsyncResultOnError(pParentSql); @@ -955,7 +1032,7 @@ static void tsCompRetrieveCallback(void* param, TAOS_RES* tres, int32_t numOfRow pParentSql->res.code = TAOS_SYSTEM_ERROR(errno); - quitAllSubquery(pParentSql, pSupporter); + quitAllSubquery(pSql, pParentSql, pSupporter); tscAsyncResultOnError(pParentSql); @@ -1009,9 +1086,9 @@ static void tsCompRetrieveCallback(void* param, TAOS_RES* tres, int32_t numOfRow return; } - if (atomic_sub_fetch_32(&pParentSql->subState.numOfRemain, 1) > 0) { + if (!subAndCheckDone(pSql, pParentSql, pSupporter->subqueryIndex)) { return; - } + } tscDebug("%p all subquery retrieve ts complete, do ts block intersect", pParentSql); @@ -1049,6 +1126,17 @@ static void joinRetrieveFinalResCallback(void* param, TAOS_RES* tres, int numOfR SSqlRes* pRes = &pSql->res; SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(pCmd, pCmd->clauseIndex); + + if (pParentSql->res.code != TSDB_CODE_SUCCESS) { + tscError("%p abort query due to other subquery failure. code:%d, global code:%d", pSql, numOfRows, pParentSql->res.code); + quitAllSubquery(pSql, pParentSql, pSupporter); + + tscAsyncResultOnError(pParentSql); + + return; + } + + if (taos_errno(pSql) != TSDB_CODE_SUCCESS) { assert(numOfRows == taos_errno(pSql)); @@ -1088,9 +1176,8 @@ static void joinRetrieveFinalResCallback(void* param, TAOS_RES* tres, int numOfR } } - assert(pState->numOfRemain > 0); - if (atomic_sub_fetch_32(&pState->numOfRemain, 1) > 0) { - tscDebug("%p sub:%p completed, remain:%d, total:%d", pParentSql, tres, pState->numOfRemain, pState->numOfSub); + if (!subAndCheckDone(pSql, pParentSql, pSupporter->subqueryIndex)) { + tscDebug("%p sub:%p,%d completed, total:%d", pParentSql, tres, pSupporter->subqueryIndex, pState->numOfSub); return; } @@ -1205,15 +1292,16 @@ void tscFetchDatablockForSubquery(SSqlObj* pSql) { } } - // get the number of subquery that need to retrieve the next vnode. + if (orderedPrjQuery) { for (int32_t i = 0; i < pSql->subState.numOfSub; ++i) { SSqlObj* pSub = pSql->pSubs[i]; if (pSub != NULL && pSub->res.row >= pSub->res.numOfRows && pSub->res.completed) { - pSql->subState.numOfRemain++; + subquerySetState(pSub, &pSql->subState, i, 0); } } } + for (int32_t i = 0; i < pSql->subState.numOfSub; ++i) { SSqlObj* pSub = pSql->pSubs[i]; @@ -1270,7 +1358,19 @@ void tscFetchDatablockForSubquery(SSqlObj* pSql) { // retrieve data from current vnode. tscDebug("%p retrieve data from %d subqueries", pSql, numOfFetch); SJoinSupporter* pSupporter = NULL; - pSql->subState.numOfRemain = numOfFetch; + + for (int32_t i = 0; i < pSql->subState.numOfSub; ++i) { + SSqlObj* pSql1 = pSql->pSubs[i]; + if (pSql1 == NULL) { + continue; + } + + SSqlRes* pRes1 = &pSql1->res; + + if (pRes1->row >= pRes1->numOfRows) { + subquerySetState(pSql1, &pSql->subState, i, 0); + } + } for (int32_t i = 0; i < pSql->subState.numOfSub; ++i) { SSqlObj* pSql1 = pSql->pSubs[i]; @@ -1372,7 +1472,8 @@ void tscJoinQueryCallback(void* param, TAOS_RES* tres, int code) { // retrieve actual query results from vnode during the second stage join subquery if (pParentSql->res.code != TSDB_CODE_SUCCESS) { tscError("%p abort query due to other subquery failure. code:%d, global code:%d", pSql, code, pParentSql->res.code); - quitAllSubquery(pParentSql, pSupporter); + quitAllSubquery(pSql, pParentSql, pSupporter); + tscAsyncResultOnError(pParentSql); return; @@ -1384,7 +1485,8 @@ void tscJoinQueryCallback(void* param, TAOS_RES* tres, int code) { tscError("%p abort query, code:%s, global code:%s", pSql, tstrerror(code), tstrerror(pParentSql->res.code)); pParentSql->res.code = code; - quitAllSubquery(pParentSql, pSupporter); + + quitAllSubquery(pSql, pParentSql, pSupporter); tscAsyncResultOnError(pParentSql); return; @@ -1408,9 +1510,9 @@ void tscJoinQueryCallback(void* param, TAOS_RES* tres, int code) { // In case of consequence query from other vnode, do not wait for other query response here. if (!(pTableMetaInfo->vgroupIndex > 0 && tscNonOrderedProjectionQueryOnSTable(pQueryInfo, 0))) { - if (atomic_sub_fetch_32(&pParentSql->subState.numOfRemain, 1) > 0) { + if (!subAndCheckDone(pSql, pParentSql, pSupporter->subqueryIndex)) { return; - } + } } tscSetupOutputColumnIndex(pParentSql); @@ -1422,6 +1524,7 @@ void tscJoinQueryCallback(void* param, TAOS_RES* tres, int code) { if (pTableMetaInfo->vgroupIndex > 0 && tscNonOrderedProjectionQueryOnSTable(pQueryInfo, 0)) { pSql->fp = joinRetrieveFinalResCallback; // continue retrieve data pSql->cmd.command = TSDB_SQL_FETCH; + tscProcessSql(pSql); } else { // first retrieve from vnode during the secondary stage sub-query // set the command flag must be after the semaphore been correctly set. @@ -1457,8 +1560,7 @@ int32_t tscCreateJoinSubquery(SSqlObj *pSql, int16_t tableIndex, SJoinSupporter return TSDB_CODE_TSC_OUT_OF_MEMORY; } - pSql->pSubs[pSql->subState.numOfRemain++] = pNew; - assert(pSql->subState.numOfRemain <= pSql->subState.numOfSub); + pSql->pSubs[tableIndex] = pNew; if (QUERY_IS_JOIN_QUERY(pQueryInfo->type)) { addGroupInfoForSubquery(pSql, pNew, 0, tableIndex); @@ -1590,6 +1692,19 @@ void tscHandleMasterJoinQuery(SSqlObj* pSql) { int32_t code = TSDB_CODE_SUCCESS; pSql->subState.numOfSub = pQueryInfo->numOfTables; + if (pSql->subState.states == NULL) { + pSql->subState.states = calloc(pSql->subState.numOfSub, sizeof(*pSql->subState.states)); + if (pSql->subState.states == NULL) { + code = TSDB_CODE_TSC_OUT_OF_MEMORY; + goto _error; + } + + pthread_mutex_init(&pSql->subState.mutex, NULL); + } + + memset(pSql->subState.states, 0, sizeof(*pSql->subState.states) * pSql->subState.numOfSub); + tscDebug("%p reset all sub states to 0", pSql); + bool hasEmptySub = false; tscDebug("%p start subquery, total:%d", pSql, pQueryInfo->numOfTables); @@ -1622,14 +1737,25 @@ void tscHandleMasterJoinQuery(SSqlObj* pSql) { pSql->cmd.command = TSDB_SQL_RETRIEVE_EMPTY_RESULT; (*pSql->fp)(pSql->param, pSql, 0); } else { + int fail = 0; for (int32_t i = 0; i < pSql->subState.numOfSub; ++i) { SSqlObj* pSub = pSql->pSubs[i]; + if (fail) { + (*pSub->fp)(pSub->param, pSub, 0); + continue; + } + if ((code = tscProcessSql(pSub)) != TSDB_CODE_SUCCESS) { - pSql->subState.numOfRemain = i - 1; // the already sent request will continue and do not go to the error process routine - break; + pRes->code = code; + (*pSub->fp)(pSub->param, pSub, 0); + fail = 1; } } + if(fail) { + return; + } + pSql->cmd.command = TSDB_SQL_TABLE_JOIN_RETRIEVE; } @@ -1728,7 +1854,21 @@ int32_t tscHandleMasterSTableQuery(SSqlObj *pSql) { return ret; } - pState->numOfRemain = pState->numOfSub; + if (pState->states == NULL) { + pState->states = calloc(pState->numOfSub, sizeof(*pState->states)); + if (pState->states == NULL) { + pRes->code = TSDB_CODE_TSC_OUT_OF_MEMORY; + tscAsyncResultOnError(pSql); + tfree(pMemoryBuf); + return ret; + } + + pthread_mutex_init(&pState->mutex, NULL); + } + + memset(pState->states, 0, sizeof(*pState->states) * pState->numOfSub); + tscDebug("%p reset all sub states to 0", pSql); + pRes->code = TSDB_CODE_SUCCESS; int32_t i = 0; @@ -1877,7 +2017,6 @@ void tscHandleSubqueryError(SRetrieveSupport *trsupport, SSqlObj *pSql, int numO assert(pSql != NULL); SSubqueryState* pState = &pParentSql->subState; - assert(pState->numOfRemain <= pState->numOfSub && pState->numOfRemain >= 0); // retrieved in subquery failed. OR query cancelled in retrieve phase. if (taos_errno(pSql) == TSDB_CODE_SUCCESS && pParentSql->res.code != TSDB_CODE_SUCCESS) { @@ -1908,14 +2047,12 @@ void tscHandleSubqueryError(SRetrieveSupport *trsupport, SSqlObj *pSql, int numO } } - int32_t remain = -1; - if ((remain = atomic_sub_fetch_32(&pState->numOfRemain, 1)) > 0) { - tscDebug("%p sub:%p orderOfSub:%d freed, finished subqueries:%d", pParentSql, pSql, trsupport->subqueryIndex, - pState->numOfSub - remain); + if (!subAndCheckDone(pSql, pParentSql, subqueryIndex)) { + tscDebug("%p sub:%p,%d freed, not finished, total:%d", pParentSql, pSql, trsupport->subqueryIndex, pState->numOfSub); tscFreeRetrieveSup(pSql); return; - } + } // all subqueries are failed tscError("%p retrieve from %d vnode(s) completed,code:%s.FAILED.", pParentSql, pState->numOfSub, @@ -1980,14 +2117,12 @@ static void tscAllDataRetrievedFromDnode(SRetrieveSupport *trsupport, SSqlObj* p return; } - int32_t remain = -1; - if ((remain = atomic_sub_fetch_32(&pParentSql->subState.numOfRemain, 1)) > 0) { - tscDebug("%p sub:%p orderOfSub:%d freed, finished subqueries:%d", pParentSql, pSql, trsupport->subqueryIndex, - pState->numOfSub - remain); + if (!subAndCheckDone(pSql, pParentSql, idx)) { + tscDebug("%p sub:%p orderOfSub:%d freed, not finished", pParentSql, pSql, trsupport->subqueryIndex); tscFreeRetrieveSup(pSql); return; - } + } // all sub-queries are returned, start to local merge process pDesc->pColumnModel->capacity = trsupport->pExtMemBuffer[idx]->numOfElemsPerPage; @@ -2033,7 +2168,6 @@ static void tscRetrieveFromDnodeCallBack(void *param, TAOS_RES *tres, int numOfR SSqlObj * pParentSql = trsupport->pParentSql; SSubqueryState* pState = &pParentSql->subState; - assert(pState->numOfRemain <= pState->numOfSub && pState->numOfRemain >= 0); STableMetaInfo *pTableMetaInfo = tscGetTableMetaInfoFromCmd(&pSql->cmd, 0, 0); SVgroupInfo *pVgroup = &pTableMetaInfo->vgroupList->vgroups[0]; @@ -2254,7 +2388,8 @@ static void multiVnodeInsertFinalize(void* param, TAOS_RES* tres, int numOfRows) } } - if (atomic_sub_fetch_32(&pParentObj->subState.numOfRemain, 1) > 0) { + if (!subAndCheckDone(tres, pParentObj, pSupporter->index)) { + tscDebug("%p insert:%p,%d completed, total:%d", pParentObj, tres, pSupporter->index, pParentObj->subState.numOfSub); return; } @@ -2288,6 +2423,8 @@ static void multiVnodeInsertFinalize(void* param, TAOS_RES* tres, int numOfRows) STableMetaInfo* pMasterTableMetaInfo = tscGetTableMetaInfoFromCmd(&pParentObj->cmd, pSql->cmd.clauseIndex, 0); tscAddTableMetaInfo(pQueryInfo, pMasterTableMetaInfo->name, NULL, NULL, NULL, NULL); + subquerySetState(pSql, &pParentObj->subState, i, 0); + tscDebug("%p, failed sub:%d, %p", pParentObj, i, pSql); } } @@ -2302,7 +2439,6 @@ static void multiVnodeInsertFinalize(void* param, TAOS_RES* tres, int numOfRows) } pParentObj->cmd.parseFinished = false; - pParentObj->subState.numOfRemain = numOfFailed; tscResetSqlCmdObj(&pParentObj->cmd); @@ -2378,7 +2514,19 @@ int32_t tscHandleMultivnodeInsert(SSqlObj *pSql) { // the number of already initialized subqueries int32_t numOfSub = 0; - pSql->subState.numOfRemain = pSql->subState.numOfSub; + if (pSql->subState.states == NULL) { + pSql->subState.states = calloc(pSql->subState.numOfSub, sizeof(*pSql->subState.states)); + if (pSql->subState.states == NULL) { + pRes->code = TSDB_CODE_TSC_OUT_OF_MEMORY; + goto _error; + } + + pthread_mutex_init(&pSql->subState.mutex, NULL); + } + + memset(pSql->subState.states, 0, sizeof(*pSql->subState.states) * pSql->subState.numOfSub); + tscDebug("%p reset all sub states to 0", pSql); + pSql->pSubs = calloc(pSql->subState.numOfSub, POINTER_BYTES); if (pSql->pSubs == NULL) { goto _error; diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index 02cd9b9692ffa3e72270b57a4f1dd2dc146f0257..438836468bcb44b8c7d90a055d7b0a47cd2622e5 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -441,6 +441,12 @@ static void tscFreeSubobj(SSqlObj* pSql) { pSql->pSubs[i] = NULL; } + if (pSql->subState.states) { + pthread_mutex_destroy(&pSql->subState.mutex); + } + + tfree(pSql->subState.states); + pSql->subState.numOfSub = 0; } diff --git a/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBDatabaseMetaData.java b/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBDatabaseMetaData.java index 4ea0fc79507dc1c0f5a963fba0e055491561a6b4..02556f6a73c9bc623c6c7a2c05ffea680596ac9a 100644 --- a/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBDatabaseMetaData.java +++ b/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBDatabaseMetaData.java @@ -535,6 +535,12 @@ public class TSDBDatabaseMetaData implements java.sql.DatabaseMetaData { return null; } + /** + * @Param catalog : database名称,"" 表示不属于任何database的table,null表示不使用database来缩小范围 + * @Param schemaPattern : schema名称,""表示 + * @Param tableNamePattern : 表名满足tableNamePattern的表, null表示返回所有表 + * @Param types : 表类型,null表示返回所有类型 + */ public ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types) throws SQLException { if (conn == null || conn.isClosed()) { throw new SQLException(TSDBConstants.FixErrMsg(TSDBConstants.JNI_CONNECTION_NULL)); @@ -544,10 +550,92 @@ public class TSDBDatabaseMetaData implements java.sql.DatabaseMetaData { if (catalog == null || catalog.isEmpty()) return null; - stmt.executeUpdate("use " + catalog); - ResultSet resultSet0 = stmt.executeQuery("show tables"); - GetTablesResultSet getTablesResultSet = new GetTablesResultSet(resultSet0, catalog, schemaPattern, tableNamePattern, types); - return getTablesResultSet; + ResultSet databases = stmt.executeQuery("show databases"); + String dbname = null; + while (databases.next()) { + dbname = databases.getString("name"); + if (dbname.equalsIgnoreCase(catalog)) + break; + } + databases.close(); + if (dbname == null) + return null; + + stmt.execute("use " + dbname); + DatabaseMetaDataResultSet resultSet = new DatabaseMetaDataResultSet(); + List columnMetaDataList = new ArrayList<>(); + ColumnMetaData col1 = new ColumnMetaData(); + col1.setColIndex(1); + col1.setColName("TABLE_CAT"); + col1.setColType(TSDBConstants.TSDB_DATA_TYPE_NCHAR); + columnMetaDataList.add(col1); + ColumnMetaData col2 = new ColumnMetaData(); + col2.setColIndex(2); + col2.setColName("TABLE_SCHEM"); + col2.setColType(TSDBConstants.TSDB_DATA_TYPE_NCHAR); + columnMetaDataList.add(col2); + ColumnMetaData col3 = new ColumnMetaData(); + col3.setColIndex(3); + col3.setColName("TABLE_NAME"); + col3.setColType(TSDBConstants.TSDB_DATA_TYPE_NCHAR); + columnMetaDataList.add(col3); + ColumnMetaData col4 = new ColumnMetaData(); + col4.setColIndex(4); + col4.setColName("TABLE_TYPE"); + col4.setColType(TSDBConstants.TSDB_DATA_TYPE_NCHAR); + columnMetaDataList.add(col4); + ColumnMetaData col5 = new ColumnMetaData(); + col5.setColIndex(5); + col5.setColName("REMARKS"); + col5.setColType(TSDBConstants.TSDB_DATA_TYPE_NCHAR); + columnMetaDataList.add(col5); + ColumnMetaData col6 = new ColumnMetaData(); + col6.setColIndex(6); + col6.setColName("TYPE_CAT"); + col6.setColType(TSDBConstants.TSDB_DATA_TYPE_NCHAR); + columnMetaDataList.add(col6); + ColumnMetaData col7 = new ColumnMetaData(); + col7.setColIndex(7); + col7.setColName("TYPE_SCHEM"); + col7.setColType(TSDBConstants.TSDB_DATA_TYPE_NCHAR); + columnMetaDataList.add(col7); + ColumnMetaData col8 = new ColumnMetaData(); + col8.setColIndex(8); + col8.setColName("TYPE_NAME"); + col8.setColType(TSDBConstants.TSDB_DATA_TYPE_NCHAR); + columnMetaDataList.add(col8); + ColumnMetaData col9 = new ColumnMetaData(); + col9.setColIndex(9); + col9.setColName("SELF_REFERENCING_COL_NAME"); + col9.setColType(TSDBConstants.TSDB_DATA_TYPE_NCHAR); + columnMetaDataList.add(col9); + ColumnMetaData col10 = new ColumnMetaData(); + col10.setColIndex(10); + col10.setColName("REF_GENERATION"); + col10.setColType(TSDBConstants.TSDB_DATA_TYPE_NCHAR); + columnMetaDataList.add(col10); + resultSet.setColumnMetaDataList(columnMetaDataList); + + List rowDataList = new ArrayList<>(); + ResultSet tables = stmt.executeQuery("show tables"); + while (tables.next()) { + TSDBResultSetRowData rowData = new TSDBResultSetRowData(10); + rowData.setString(2, tables.getString("table_name")); + rowData.setString(3, "TABLE"); + rowData.setString(4, ""); + rowDataList.add(rowData); + } + + ResultSet stables = stmt.executeQuery("show stables"); + while (stables.next()) { + TSDBResultSetRowData rowData = new TSDBResultSetRowData(10); + rowData.setString(2, stables.getString("name")); + rowData.setString(3, "TABLE"); + rowData.setString(4, "STABLE"); + rowDataList.add(rowData); + } + resultSet.setRowDataList(rowDataList); + return resultSet; } } @@ -560,125 +648,172 @@ public class TSDBDatabaseMetaData implements java.sql.DatabaseMetaData { throw new SQLException(TSDBConstants.FixErrMsg(TSDBConstants.JNI_CONNECTION_NULL)); try (Statement stmt = conn.createStatement()) { + DatabaseMetaDataResultSet resultSet = new DatabaseMetaDataResultSet(); + // set up ColumnMetaDataList + List columnMetaDataList = new ArrayList<>(24); + // TABLE_CAT + ColumnMetaData col1 = new ColumnMetaData(); + col1.setColIndex(1); + col1.setColName("TABLE_CAT"); + col1.setColType(TSDBConstants.TSDB_DATA_TYPE_NCHAR); + columnMetaDataList.add(col1); + resultSet.setColumnMetaDataList(columnMetaDataList); + + List rowDataList = new ArrayList<>(); ResultSet rs = stmt.executeQuery("show databases"); - return new CatalogResultSet(rs); + while (rs.next()) { + TSDBResultSetRowData rowData = new TSDBResultSetRowData(1); + rowData.setString(0, rs.getString("name")); + rowDataList.add(rowData); + } + resultSet.setRowDataList(rowDataList); + return resultSet; } } public ResultSet getTableTypes() throws SQLException { - DatabaseMetaDataResultSet resultSet = new DatabaseMetaDataResultSet(); + if (conn == null || conn.isClosed()) + throw new SQLException(TSDBConstants.FixErrMsg(TSDBConstants.JNI_CONNECTION_NULL)); + DatabaseMetaDataResultSet resultSet = new DatabaseMetaDataResultSet(); // set up ColumnMetaDataList - List columnMetaDataList = new ArrayList<>(1); + List columnMetaDataList = new ArrayList<>(); ColumnMetaData colMetaData = new ColumnMetaData(); colMetaData.setColIndex(0); colMetaData.setColName("TABLE_TYPE"); colMetaData.setColSize(10); - colMetaData.setColType(TSDBConstants.TSDB_DATA_TYPE_BINARY); + colMetaData.setColType(TSDBConstants.TSDB_DATA_TYPE_NCHAR); columnMetaDataList.add(colMetaData); + resultSet.setColumnMetaDataList(columnMetaDataList); // set up rowDataList - List rowDataList = new ArrayList<>(2); - TSDBResultSetRowData rowData = new TSDBResultSetRowData(); + List rowDataList = new ArrayList<>(); + TSDBResultSetRowData rowData = new TSDBResultSetRowData(1); rowData.setString(0, "TABLE"); rowDataList.add(rowData); - rowData = new TSDBResultSetRowData(); + rowData = new TSDBResultSetRowData(1); rowData.setString(0, "STABLE"); rowDataList.add(rowData); - - resultSet.setColumnMetaDataList(columnMetaDataList); resultSet.setRowDataList(rowDataList); + return resultSet; } - public ResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) - throws SQLException { + public ResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) throws SQLException { + if (conn == null || conn.isClosed()) + throw new SQLException(TSDBConstants.FixErrMsg(TSDBConstants.JNI_CONNECTION_NULL)); - /** add by zyyang **********/ - Statement stmt = null; - if (null != conn && !conn.isClosed()) { - stmt = conn.createStatement(); + try (Statement stmt = conn.createStatement()) { if (catalog == null || catalog.isEmpty()) return null; - stmt.executeUpdate("use " + catalog); + ResultSet databases = stmt.executeQuery("show databases"); + String dbname = null; + while (databases.next()) { + dbname = databases.getString("name"); + if (dbname.equalsIgnoreCase(catalog)) + break; + } + databases.close(); + if (dbname == null) + return null; + + stmt.execute("use " + dbname); DatabaseMetaDataResultSet resultSet = new DatabaseMetaDataResultSet(); // set up ColumnMetaDataList List columnMetaDataList = new ArrayList<>(24); + // TABLE_CAT + ColumnMetaData col1 = new ColumnMetaData(); + col1.setColIndex(1); + col1.setColName("TABLE_CAT"); + col1.setColType(TSDBConstants.TSDB_DATA_TYPE_NCHAR); + columnMetaDataList.add(col1); + // TABLE_SCHEM + ColumnMetaData col2 = new ColumnMetaData(); + col2.setColIndex(2); + col2.setColName("TABLE_SCHEM"); + col2.setColType(TSDBConstants.TSDB_DATA_TYPE_NCHAR); + columnMetaDataList.add(col2); + // TABLE_NAME + ColumnMetaData col3 = new ColumnMetaData(); + col3.setColIndex(3); + col3.setColName("TABLE_NAME"); + col3.setColSize(193); + col3.setColType(TSDBConstants.TSDB_DATA_TYPE_NCHAR); + columnMetaDataList.add(col3); + // COLUMN_NAME + ColumnMetaData col4 = new ColumnMetaData(); + col4.setColIndex(4); + col4.setColName("COLUMN_NAME"); + col4.setColSize(65); + col4.setColType(TSDBConstants.TSDB_DATA_TYPE_NCHAR); + columnMetaDataList.add(col4); + // DATA_TYPE + ColumnMetaData col5 = new ColumnMetaData(); + col5.setColIndex(5); + col5.setColName("DATA_TYPE"); + col5.setColType(TSDBConstants.TSDB_DATA_TYPE_INT); + columnMetaDataList.add(col5); + // TYPE_NAME + ColumnMetaData col6 = new ColumnMetaData(); + col6.setColIndex(6); + col6.setColName("TYPE_NAME"); + col6.setColType(TSDBConstants.TSDB_DATA_TYPE_NCHAR); + columnMetaDataList.add(col6); + // COLUMN_SIZE + ColumnMetaData col7 = new ColumnMetaData(); + col7.setColIndex(7); + col7.setColName("COLUMN_SIZE"); + col7.setColType(TSDBConstants.TSDB_DATA_TYPE_INT); + columnMetaDataList.add(col7); + // BUFFER_LENGTH ,not used columnMetaDataList.add(null); - columnMetaDataList.add(null); - // add TABLE_NAME - ColumnMetaData colMetaData = new ColumnMetaData(); - colMetaData.setColIndex(3); - colMetaData.setColName("TABLE_NAME"); - colMetaData.setColSize(193); - colMetaData.setColType(TSDBConstants.TSDB_DATA_TYPE_BINARY); - columnMetaDataList.add(colMetaData); - // add COLUMN_NAME - colMetaData = new ColumnMetaData(); - colMetaData.setColIndex(4); - colMetaData.setColName("COLUMN_NAME"); - colMetaData.setColSize(65); - colMetaData.setColType(TSDBConstants.TSDB_DATA_TYPE_BINARY); - columnMetaDataList.add(colMetaData); - // add DATA_TYPE - colMetaData = new ColumnMetaData(); - colMetaData.setColIndex(5); - colMetaData.setColName("DATA_TYPE"); - colMetaData.setColType(TSDBConstants.TSDB_DATA_TYPE_INT); - columnMetaDataList.add(colMetaData); - // add TYPE_NAME - colMetaData = new ColumnMetaData(); - colMetaData.setColIndex(6); - colMetaData.setColName("TYPE_NAME"); - colMetaData.setColType(TSDBConstants.TSDB_DATA_TYPE_BINARY); - columnMetaDataList.add(colMetaData); - // add COLUMN_SIZE - colMetaData = new ColumnMetaData(); - colMetaData.setColIndex(7); - colMetaData.setColName("COLUMN_SIZE"); - colMetaData.setColType(TSDBConstants.TSDB_DATA_TYPE_INT); - columnMetaDataList.add(colMetaData); - // add BUFFER_LENGTH ,not used - columnMetaDataList.add(null); - // add DECIMAL_DIGITS - colMetaData = new ColumnMetaData(); - colMetaData.setColIndex(9); - colMetaData.setColName("DECIMAL_DIGITS"); - colMetaData.setColType(TSDBConstants.TSDB_DATA_TYPE_INT); - columnMetaDataList.add(colMetaData); + // DECIMAL_DIGITS + ColumnMetaData col9 = new ColumnMetaData(); + col9.setColIndex(9); + col9.setColName("DECIMAL_DIGITS"); + col9.setColType(TSDBConstants.TSDB_DATA_TYPE_INT); + columnMetaDataList.add(col9); // add NUM_PREC_RADIX - colMetaData = new ColumnMetaData(); - colMetaData.setColIndex(10); - colMetaData.setColName("NUM_PREC_RADIX"); - colMetaData.setColType(TSDBConstants.TSDB_DATA_TYPE_INT); - columnMetaDataList.add(colMetaData); - // add NULLABLE - colMetaData = new ColumnMetaData(); - colMetaData.setColIndex(11); - colMetaData.setColName("NULLABLE"); - colMetaData.setColType(TSDBConstants.TSDB_DATA_TYPE_INT); - columnMetaDataList.add(colMetaData); - + ColumnMetaData col10 = new ColumnMetaData(); + col10.setColIndex(10); + col10.setColName("NUM_PREC_RADIX"); + col10.setColType(TSDBConstants.TSDB_DATA_TYPE_INT); + columnMetaDataList.add(col10); + // NULLABLE + ColumnMetaData col11 = new ColumnMetaData(); + col11.setColIndex(11); + col11.setColName("NULLABLE"); + col11.setColType(TSDBConstants.TSDB_DATA_TYPE_INT); + columnMetaDataList.add(col11); + // REMARKS + ColumnMetaData col12 = new ColumnMetaData(); + col12.setColIndex(12); + col12.setColName("REMARKS"); + col12.setColType(TSDBConstants.TSDB_DATA_TYPE_NCHAR); + columnMetaDataList.add(col12); resultSet.setColumnMetaDataList(columnMetaDataList); + // set up rowDataList - ResultSet resultSet0 = stmt.executeQuery("describe " + tableNamePattern); + ResultSet rs = stmt.executeQuery("describe " + dbname + "." + tableNamePattern); List rowDataList = new ArrayList<>(); int index = 0; - while (resultSet0.next()) { + while (rs.next()) { TSDBResultSetRowData rowData = new TSDBResultSetRowData(24); + // set TABLE_CAT + rowData.setString(0, dbname); // set TABLE_NAME rowData.setString(2, tableNamePattern); // set COLUMN_NAME - rowData.setString(3, resultSet0.getString(1)); + rowData.setString(3, rs.getString("Field")); // set DATA_TYPE - String typeName = resultSet0.getString(2); + String typeName = rs.getString("Type"); rowData.setInt(4, getDataType(typeName)); // set TYPE_NAME rowData.setString(5, typeName); // set COLUMN_SIZE - int length = resultSet0.getInt(3); + int length = rs.getInt("Length"); rowData.setInt(6, getColumnSize(typeName, length)); // set DECIMAL_DIGITS rowData.setInt(8, getDecimalDigits(typeName)); @@ -686,22 +821,18 @@ public class TSDBDatabaseMetaData implements java.sql.DatabaseMetaData { rowData.setInt(9, 10); // set NULLABLE rowData.setInt(10, getNullable(index, typeName)); + // set REMARKS + rowData.setString(11, rs.getString("Note")); rowDataList.add(rowData); index++; } resultSet.setRowDataList(rowDataList); - -// GetColumnsResultSet getColumnsResultSet = new GetColumnsResultSet(resultSet0, catalog, schemaPattern, tableNamePattern, columnNamePattern); -// return getColumnsResultSet; -// DatabaseMetaDataResultSet resultSet = new DatabaseMetaDataResultSet(); return resultSet; - } else { - throw new SQLException(TSDBConstants.FixErrMsg(TSDBConstants.JNI_CONNECTION_NULL)); - } - - /*************************/ -// return getEmptyResultSet(); + } catch (SQLException e) { + e.printStackTrace(); + } + return null; } private int getNullable(int index, String typeName) { @@ -778,7 +909,82 @@ public class TSDBDatabaseMetaData implements java.sql.DatabaseMetaData { } public ResultSet getPrimaryKeys(String catalog, String schema, String table) throws SQLException { - return getEmptyResultSet(); + if (conn == null || conn.isClosed()) + throw new SQLException(TSDBConstants.FixErrMsg(TSDBConstants.JNI_CONNECTION_NULL)); + + try (Statement stmt = conn.createStatement()) { + if (catalog == null || catalog.isEmpty()) + return null; + + ResultSet databases = stmt.executeQuery("show databases"); + String dbname = null; + while (databases.next()) { + dbname = databases.getString("name"); + if (dbname.equalsIgnoreCase(catalog)) + break; + } + databases.close(); + if (dbname == null) + return null; + + stmt.execute("use " + dbname); + DatabaseMetaDataResultSet resultSet = new DatabaseMetaDataResultSet(); + // set up ColumnMetaDataList + List columnMetaDataList = new ArrayList<>(); + // TABLE_CAT + ColumnMetaData col1 = new ColumnMetaData(); + col1.setColIndex(0); + col1.setColName("TABLE_CAT"); + col1.setColType(TSDBConstants.TSDB_DATA_TYPE_NCHAR); + columnMetaDataList.add(col1); + // TABLE_SCHEM + ColumnMetaData col2 = new ColumnMetaData(); + col2.setColIndex(1); + col2.setColName("TABLE_SCHEM"); + col2.setColType(TSDBConstants.TSDB_DATA_TYPE_NCHAR); + columnMetaDataList.add(col2); + // TABLE_NAME + ColumnMetaData col3 = new ColumnMetaData(); + col3.setColIndex(2); + col3.setColName("TABLE_NAME"); + col3.setColType(TSDBConstants.TSDB_DATA_TYPE_NCHAR); + columnMetaDataList.add(col3); + // COLUMN_NAME + ColumnMetaData col4 = new ColumnMetaData(); + col4.setColIndex(3); + col4.setColName("COLUMN_NAME"); + col4.setColType(TSDBConstants.TSDB_DATA_TYPE_NCHAR); + columnMetaDataList.add(col4); + // KEY_SEQ + ColumnMetaData col5 = new ColumnMetaData(); + col5.setColIndex(4); + col5.setColName("KEY_SEQ"); + col5.setColType(TSDBConstants.TSDB_DATA_TYPE_INT); + columnMetaDataList.add(col5); + // PK_NAME + ColumnMetaData col6 = new ColumnMetaData(); + col6.setColIndex(5); + col6.setColName("PK_NAME"); + col6.setColType(TSDBConstants.TSDB_DATA_TYPE_NCHAR); + columnMetaDataList.add(col6); + resultSet.setColumnMetaDataList(columnMetaDataList); + + // set rowData + List rowDataList = new ArrayList<>(); + ResultSet rs = stmt.executeQuery("describe " + dbname + "." + table); + rs.next(); + TSDBResultSetRowData rowData = new TSDBResultSetRowData(6); + rowData.setString(0, null); + rowData.setString(1, null); + rowData.setString(2, table); + String pkName = rs.getString(1); + rowData.setString(3, pkName); + rowData.setInt(4, 1); + rowData.setString(5, pkName); + rowDataList.add(rowData); + resultSet.setRowDataList(rowDataList); + return resultSet; + } } public ResultSet getImportedKeys(String catalog, String schema, String table) throws SQLException { @@ -876,12 +1082,72 @@ public class TSDBDatabaseMetaData implements java.sql.DatabaseMetaData { return false; } - public ResultSet getSuperTypes(String catalog, String schemaPattern, String typeNamePattern) throws SQLException { + public ResultSet getSuperTypes(String catalog, String schemaPattern, String typeNamePattern) throws + SQLException { return getEmptyResultSet(); } - public ResultSet getSuperTables(String catalog, String schemaPattern, String tableNamePattern) throws SQLException { - return getEmptyResultSet(); + public ResultSet getSuperTables(String catalog, String schemaPattern, String tableNamePattern) throws + SQLException { + if (conn == null || conn.isClosed()) + throw new SQLException(TSDBConstants.FixErrMsg(TSDBConstants.JNI_CONNECTION_NULL)); + + try (Statement stmt = conn.createStatement()) { + if (catalog == null || catalog.isEmpty()) + return null; + + ResultSet databases = stmt.executeQuery("show databases"); + String dbname = null; + while (databases.next()) { + dbname = databases.getString("name"); + if (dbname.equalsIgnoreCase(catalog)) + break; + } + databases.close(); + if (dbname == null) + return null; + + stmt.execute("use " + dbname); + DatabaseMetaDataResultSet resultSet = new DatabaseMetaDataResultSet(); + // set up ColumnMetaDataList + List columnMetaDataList = new ArrayList<>(); + // TABLE_CAT + ColumnMetaData col1 = new ColumnMetaData(); + col1.setColIndex(0); + col1.setColName("TABLE_CAT"); + col1.setColType(TSDBConstants.TSDB_DATA_TYPE_NCHAR); + columnMetaDataList.add(col1); + // TABLE_SCHEM + ColumnMetaData col2 = new ColumnMetaData(); + col2.setColIndex(1); + col2.setColName("TABLE_SCHEM"); + col2.setColType(TSDBConstants.TSDB_DATA_TYPE_NCHAR); + columnMetaDataList.add(col2); + // TABLE_NAME + ColumnMetaData col3 = new ColumnMetaData(); + col3.setColIndex(2); + col3.setColName("TABLE_NAME"); + col3.setColType(TSDBConstants.TSDB_DATA_TYPE_NCHAR); + columnMetaDataList.add(col3); + // SUPERTABLE_NAME + ColumnMetaData col4 = new ColumnMetaData(); + col4.setColIndex(3); + col4.setColName("SUPERTABLE_NAME"); + col4.setColType(TSDBConstants.TSDB_DATA_TYPE_NCHAR); + columnMetaDataList.add(col4); + resultSet.setColumnMetaDataList(columnMetaDataList); + + ResultSet rs = stmt.executeQuery("show tables like '" + tableNamePattern + "'"); + List rowDataList = new ArrayList<>(); + while (rs.next()) { + TSDBResultSetRowData rowData = new TSDBResultSetRowData(4); + rowData.setString(2, rs.getString(1)); + rowData.setString(3, rs.getString(4)); + rowDataList.add(rowData); + } + resultSet.setRowDataList(rowDataList); + return resultSet; + } } public ResultSet getAttributes(String catalog, String schemaPattern, String typeNamePattern, diff --git a/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBResultSetRowData.java b/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBResultSetRowData.java index c57f19550dd14719baecb835d76263df1e6a669b..6518bf10e444a05073206e1ef72b8f21a87e26b1 100644 --- a/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBResultSetRowData.java +++ b/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBResultSetRowData.java @@ -26,9 +26,9 @@ public class TSDBResultSetRowData { public TSDBResultSetRowData(int colSize) { this.setColSize(colSize); } - + public TSDBResultSetRowData() { - this.data = new ArrayList(); + this.data = new ArrayList<>(); this.setColSize(0); } @@ -39,7 +39,7 @@ public class TSDBResultSetRowData { if (this.colSize == 0) { return; } - this.data = new ArrayList(colSize); + this.data = new ArrayList<>(colSize); this.data.addAll(Collections.nCopies(this.colSize, null)); } @@ -53,7 +53,7 @@ public class TSDBResultSetRowData { public boolean getBoolean(int col, int srcType) throws SQLException { Object obj = data.get(col); - + switch(srcType) { case TSDBConstants.TSDB_DATA_TYPE_BOOL: return (Boolean) obj; case TSDBConstants.TSDB_DATA_TYPE_FLOAT: return ((Float) obj) == 1.0? Boolean.TRUE:Boolean.FALSE; @@ -64,10 +64,10 @@ public class TSDBResultSetRowData { case TSDBConstants.TSDB_DATA_TYPE_TIMESTAMP: case TSDBConstants.TSDB_DATA_TYPE_BIGINT: return ((Long) obj) == 1L? Boolean.TRUE:Boolean.FALSE; } - + return Boolean.TRUE; } - + public void setByte(int col, byte value) { data.set(col, value); } @@ -82,20 +82,20 @@ public class TSDBResultSetRowData { public int getInt(int col, int srcType) throws SQLException { Object obj = data.get(col); - + switch(srcType) { - case TSDBConstants.TSDB_DATA_TYPE_BOOL: return Boolean.TRUE.equals(obj)? 1:0; - case TSDBConstants.TSDB_DATA_TYPE_FLOAT: return ((Float) obj).intValue(); - case TSDBConstants.TSDB_DATA_TYPE_DOUBLE: return ((Double)obj).intValue(); - case TSDBConstants.TSDB_DATA_TYPE_TINYINT: return (Byte) obj; - case TSDBConstants.TSDB_DATA_TYPE_SMALLINT:return (Short) obj; - case TSDBConstants.TSDB_DATA_TYPE_INT: return (Integer) obj; - case TSDBConstants.TSDB_DATA_TYPE_TIMESTAMP: - case TSDBConstants.TSDB_DATA_TYPE_BIGINT: return ((Long) obj).intValue(); - case TSDBConstants.TSDB_DATA_TYPE_NCHAR: - case TSDBConstants.TSDB_DATA_TYPE_BINARY: return Integer.parseInt((String) obj); + case TSDBConstants.TSDB_DATA_TYPE_BOOL: return Boolean.TRUE.equals(obj)? 1:0; + case TSDBConstants.TSDB_DATA_TYPE_FLOAT: return ((Float) obj).intValue(); + case TSDBConstants.TSDB_DATA_TYPE_DOUBLE: return ((Double)obj).intValue(); + case TSDBConstants.TSDB_DATA_TYPE_TINYINT: return (Byte) obj; + case TSDBConstants.TSDB_DATA_TYPE_SMALLINT:return (Short) obj; + case TSDBConstants.TSDB_DATA_TYPE_INT: return (Integer) obj; + case TSDBConstants.TSDB_DATA_TYPE_TIMESTAMP: + case TSDBConstants.TSDB_DATA_TYPE_BIGINT: return ((Long) obj).intValue(); + case TSDBConstants.TSDB_DATA_TYPE_NCHAR: + case TSDBConstants.TSDB_DATA_TYPE_BINARY: return Integer.parseInt((String) obj); } - + return 0; } @@ -105,7 +105,7 @@ public class TSDBResultSetRowData { public long getLong(int col, int srcType) throws SQLException { Object obj = data.get(col); - + switch(srcType) { case TSDBConstants.TSDB_DATA_TYPE_BOOL: return Boolean.TRUE.equals(obj)? 1:0; case TSDBConstants.TSDB_DATA_TYPE_FLOAT: return ((Float) obj).longValue(); @@ -116,9 +116,9 @@ public class TSDBResultSetRowData { case TSDBConstants.TSDB_DATA_TYPE_TIMESTAMP: case TSDBConstants.TSDB_DATA_TYPE_BIGINT: return (Long) obj; case TSDBConstants.TSDB_DATA_TYPE_NCHAR: - case TSDBConstants.TSDB_DATA_TYPE_BINARY: return Long.parseLong((String) obj); + case TSDBConstants.TSDB_DATA_TYPE_BINARY: return Long.parseLong((String) obj); } - + return 0; } @@ -128,7 +128,7 @@ public class TSDBResultSetRowData { public float getFloat(int col, int srcType) throws SQLException { Object obj = data.get(col); - + switch(srcType) { case TSDBConstants.TSDB_DATA_TYPE_BOOL: return Boolean.TRUE.equals(obj)? 1:0; case TSDBConstants.TSDB_DATA_TYPE_FLOAT: return (Float) obj; @@ -139,7 +139,7 @@ public class TSDBResultSetRowData { case TSDBConstants.TSDB_DATA_TYPE_TIMESTAMP: case TSDBConstants.TSDB_DATA_TYPE_BIGINT: return (Long) obj; } - + return 0; } @@ -149,7 +149,7 @@ public class TSDBResultSetRowData { public double getDouble(int col, int srcType) throws SQLException { Object obj = data.get(col); - + switch(srcType) { case TSDBConstants.TSDB_DATA_TYPE_BOOL: return Boolean.TRUE.equals(obj)? 1:0; case TSDBConstants.TSDB_DATA_TYPE_FLOAT: return (Float) obj; @@ -160,7 +160,7 @@ public class TSDBResultSetRowData { case TSDBConstants.TSDB_DATA_TYPE_TIMESTAMP: case TSDBConstants.TSDB_DATA_TYPE_BIGINT: return (Long) obj; } - + return 0; } @@ -180,7 +180,7 @@ public class TSDBResultSetRowData { * The original type may not be a string type, but will be converted to by calling this method * @param col column index * @return - * @throws SQLException + * @throws SQLException */ public String getString(int col, int srcType) throws SQLException { if (srcType == TSDBConstants.TSDB_DATA_TYPE_BINARY || srcType == TSDBConstants.TSDB_DATA_TYPE_NCHAR) { diff --git a/src/connector/jdbc/src/test/java/TestTSDBDatabaseMetaData.java b/src/connector/jdbc/src/test/java/TestTSDBDatabaseMetaData.java deleted file mode 100644 index 39a08f0fe98a279e62ca07f20047813edeab56db..0000000000000000000000000000000000000000 --- a/src/connector/jdbc/src/test/java/TestTSDBDatabaseMetaData.java +++ /dev/null @@ -1,33 +0,0 @@ -import com.taosdata.jdbc.TSDBDriver; - -import java.sql.*; -import java.util.Properties; - -public class TestTSDBDatabaseMetaData { - - public static void main(String[] args) throws SQLException { - Connection connection = null; - DatabaseMetaData dbMetaData = null; - ResultSet resSet = null; - try { - Class.forName("com.taosdata.jdbc.TSDBDriver"); - Properties properties = new Properties(); - properties.setProperty(TSDBDriver.PROPERTY_KEY_HOST, "localhost"); - connection = DriverManager.getConnection("jdbc:TAOS://localhost:0/", properties); - dbMetaData = connection.getMetaData(); - resSet = dbMetaData.getCatalogs(); - while(resSet.next()) { - for (int i = 1; i <= resSet.getMetaData().getColumnCount(); i++) { - System.out.printf("dbMetaData.getCatalogs(%d) = %s\n", i, resSet.getString(i)); - } - } - resSet.close(); - - } catch (Exception e) { - e.printStackTrace(); - if (null != connection) { - connection.close(); - } - } - } -} diff --git a/src/connector/jdbc/src/test/java/com/taosdata/jdbc/StatementTest.java b/src/connector/jdbc/src/test/java/com/taosdata/jdbc/StatementTest.java index db7b8c8cb14cbc0d1ae5a5a3a3bf8df590c4bc2a..a79512984e6d78fda30b1281fefe91ddea7c2434 100644 --- a/src/connector/jdbc/src/test/java/com/taosdata/jdbc/StatementTest.java +++ b/src/connector/jdbc/src/test/java/com/taosdata/jdbc/StatementTest.java @@ -10,7 +10,7 @@ import java.util.Properties; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -public class StatementTest extends BaseTest { +public class StatementTest { static Connection connection = null; static Statement statement = null; static String dbName = "test"; @@ -26,14 +26,29 @@ public class StatementTest extends BaseTest { return; } Properties properties = new Properties(); - properties.setProperty(TSDBDriver.PROPERTY_KEY_HOST, host); properties.setProperty(TSDBDriver.PROPERTY_KEY_CHARSET, "UTF-8"); properties.setProperty(TSDBDriver.PROPERTY_KEY_LOCALE, "en_US.UTF-8"); properties.setProperty(TSDBDriver.PROPERTY_KEY_TIME_ZONE, "UTC-8"); - connection = DriverManager.getConnection("jdbc:TAOS://" + host + ":0/", properties); + connection = DriverManager.getConnection("jdbc:TAOS://" + host + ":0/?user=root&password=taosdata", properties); statement = connection.createStatement(); statement.executeUpdate("drop database if exists " + dbName); + } + + @Test + public void testCase() { + try { + ResultSet rs = statement.executeQuery("show databases"); + ResultSetMetaData metaData = rs.getMetaData(); + while (rs.next()) { + for (int i = 1; i <= metaData.getColumnCount(); i++) { + System.out.print(metaData.getColumnLabel(i) + ":" + rs.getString(i) + "\t"); + } + System.out.println(); + } + } catch (SQLException e) { + e.printStackTrace(); + } } @@ -54,9 +69,6 @@ public class StatementTest extends BaseTest { @Test public void testUnsupport() { -// if(null == resSet) { -// return; -// } TSDBStatement tsdbStatement = (TSDBStatement) statement; try { tsdbStatement.unwrap(null); @@ -163,11 +175,10 @@ public class StatementTest extends BaseTest { @AfterClass public static void close() throws Exception { if (!statement.isClosed()) { - statement.executeUpdate("drop database " + dbName); + statement.executeUpdate("drop database if exists " + dbName); statement.close(); connection.close(); Thread.sleep(10); - } } } diff --git a/src/connector/jdbc/src/test/java/com/taosdata/jdbc/TSDBDatabaseMetaDataTest.java b/src/connector/jdbc/src/test/java/com/taosdata/jdbc/TSDBDatabaseMetaDataTest.java index 448b513d0edadc0b8e3c3537acfdc83f25cb90b0..04e9ffab31b2a32e7e1cfa6b8a606fc26e6e6e2e 100644 --- a/src/connector/jdbc/src/test/java/com/taosdata/jdbc/TSDBDatabaseMetaDataTest.java +++ b/src/connector/jdbc/src/test/java/com/taosdata/jdbc/TSDBDatabaseMetaDataTest.java @@ -4,10 +4,7 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.ResultSet; -import java.sql.SQLException; +import java.sql.*; import java.util.Properties; public class TSDBDatabaseMetaDataTest { @@ -642,7 +639,15 @@ public class TSDBDatabaseMetaDataTest { @Test public void getTables() throws SQLException { - Assert.assertNull(metaData.getTables("", "", "*", null)); + ResultSet tables = metaData.getTables("log", "", null, null); + ResultSetMetaData metaData = tables.getMetaData(); + while (tables.next()) { + System.out.print(metaData.getColumnLabel(3) + ":" + tables.getString(3) + "\t"); + System.out.print(metaData.getColumnLabel(4) + ":" + tables.getString(4) + "\t"); + System.out.print(metaData.getColumnLabel(5) + ":" + tables.getString(5) + "\n"); + } + System.out.println(); + Assert.assertNotNull(tables); } @Test @@ -652,17 +657,41 @@ public class TSDBDatabaseMetaDataTest { @Test public void getCatalogs() throws SQLException { - Assert.assertNotNull(metaData.getCatalogs()); + ResultSet catalogs = metaData.getCatalogs(); + ResultSetMetaData meta = catalogs.getMetaData(); + while (catalogs.next()) { + for (int i = 1; i <= meta.getColumnCount(); i++) { + System.out.print(meta.getColumnLabel(i) + ": " + catalogs.getString(i)); + } + System.out.println(); + } } @Test public void getTableTypes() throws SQLException { + ResultSet tableTypes = metaData.getTableTypes(); + while (tableTypes.next()) { + System.out.println(tableTypes.getString("TABLE_TYPE")); + } Assert.assertNotNull(metaData.getTableTypes()); } @Test public void getColumns() throws SQLException { - Assert.assertNotNull(metaData.getColumns("", "", "", "")); + ResultSet columns = metaData.getColumns("log", "", "dn", ""); + ResultSetMetaData meta = columns.getMetaData(); + while (columns.next()) { + System.out.print(meta.getColumnLabel(1) + ": " + columns.getString(1) + "\t"); + System.out.print(meta.getColumnLabel(3) + ": " + columns.getString(3) + "\t"); + System.out.print(meta.getColumnLabel(4) + ": " + columns.getString(4) + "\t"); + System.out.print(meta.getColumnLabel(5) + ": " + columns.getString(5) + "\t"); + System.out.print(meta.getColumnLabel(6) + ": " + columns.getString(6) + "\t"); + System.out.print(meta.getColumnLabel(7) + ": " + columns.getString(7) + "\t"); + System.out.print(meta.getColumnLabel(9) + ": " + columns.getString(9) + "\t"); + System.out.print(meta.getColumnLabel(10) + ": " + columns.getString(10) + "\t"); + System.out.print(meta.getColumnLabel(11) + ": " + columns.getString(11) + "\n"); + System.out.print(meta.getColumnLabel(12) + ": " + columns.getString(12) + "\n"); + } } @Test @@ -687,7 +716,15 @@ public class TSDBDatabaseMetaDataTest { @Test public void getPrimaryKeys() throws SQLException { - Assert.assertNotNull(metaData.getPrimaryKeys("", "", "")); + ResultSet rs = metaData.getPrimaryKeys("log", "", "dn1"); + while (rs.next()) { + System.out.println("TABLE_NAME: " + rs.getString("TABLE_NAME")); + System.out.println("COLUMN_NAME: " + rs.getString("COLUMN_NAME")); + System.out.println("KEY_SEQ: " + rs.getString("KEY_SEQ")); + System.out.println("PK_NAME: " + rs.getString("PK_NAME")); + } + + Assert.assertNotNull(rs); } @Test @@ -812,7 +849,12 @@ public class TSDBDatabaseMetaDataTest { @Test public void getSuperTables() throws SQLException { - Assert.assertNotNull(metaData.getSuperTables("", "", "")); + ResultSet rs = metaData.getSuperTables("log", "", "dn1"); + while (rs.next()) { + System.out.println("TABLE_NAME: " + rs.getString("TABLE_NAME")); + System.out.println("SUPERTABLE_NAME: " + rs.getString("SUPERTABLE_NAME")); + } + Assert.assertNotNull(rs); } @Test diff --git a/src/connector/nodejs/nodetaos/cinterface.js b/src/connector/nodejs/nodetaos/cinterface.js index a246256f15f313b61c0b7e990e63848fee2431bf..43a08a800afe7aa3e445a943f8d7a7f95f1ed05f 100644 --- a/src/connector/nodejs/nodetaos/cinterface.js +++ b/src/connector/nodejs/nodetaos/cinterface.js @@ -3,15 +3,15 @@ * @module CTaosInterface */ -const ref = require('ref'); +const ref = require('ref-napi'); const os = require('os'); -const ffi = require('ffi'); -const ArrayType = require('ref-array'); -const Struct = require('ref-struct'); +const ffi = require('ffi-napi'); +const ArrayType = require('ref-array-napi'); +const Struct = require('ref-struct-napi'); const FieldTypes = require('./constants'); const errors = require ('./error'); const TaosObjects = require('./taosobjects'); -const { NULL_POINTER } = require('ref'); +const { NULL_POINTER } = require('ref-napi'); module.exports = CTaosInterface; diff --git a/src/connector/nodejs/nodetaos/cursor.js b/src/connector/nodejs/nodetaos/cursor.js index 0c9214fe32656fdfb7edb6cfc0d0c3587d4f7bb6..e18e6c2500019684dea85fe05bc7306e0a372478 100644 --- a/src/connector/nodejs/nodetaos/cursor.js +++ b/src/connector/nodejs/nodetaos/cursor.js @@ -1,4 +1,4 @@ -const ref = require('ref'); +const ref = require('ref-napi'); require('./globalfunc.js') const CTaosInterface = require('./cinterface') const errors = require ('./error') diff --git a/src/connector/nodejs/package-lock.json b/src/connector/nodejs/package-lock.json index d13fe6959c07955f5b15c7281f571ab932a996c3..9ca174ccd12f782b047789e44a6abce231b15ad0 100644 --- a/src/connector/nodejs/package-lock.json +++ b/src/connector/nodejs/package-lock.json @@ -1,44 +1,9 @@ { "name": "td2.0-connector", - "version": "2.0.1", + "version": "2.0.6", "lockfileVersion": 1, "requires": true, "dependencies": { - "abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" - }, - "ajv": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", - "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" - }, - "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" - }, - "are-we-there-yet": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, "array-index": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/array-index/-/array-index-1.0.0.tgz", @@ -46,104 +11,23 @@ "requires": { "debug": "^2.2.0", "es6-symbol": "^3.0.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } } }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" - }, - "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "requires": { - "tweetnacl": "^0.14.3" - } - }, - "bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "requires": { - "file-uri-to-path": "1.0.0" - } - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" - }, - "chownr": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.2.tgz", - "integrity": "sha512-GkfeAQh+QNy3wquu9oIZr6SS5x7wGdSgNQvD10X3r+AZr1Oys22HW8kAmDMvNg2+Dm0TeGaEuO8gFwdBXxwO8A==" - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" - }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" - }, "d": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", @@ -153,54 +37,22 @@ "type": "^1.0.1" } }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "requires": { - "assert-plus": "^1.0.0" - } - }, "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" - }, - "delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" - }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" + "ms": "2.1.2" } }, - "env-paths": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-1.0.0.tgz", - "integrity": "sha1-QWgTO0K7BcOKNbGuQ5fIKYqzaeA=" - }, "es5-ext": { - "version": "0.10.50", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.50.tgz", - "integrity": "sha512-KMzZTPBkeQV/JcSQhI5/z6d9VWJ3EnQ194USTUwIYZ2ZbpN8+SGXQKt1h68EX44+qt+Fzr8DO17vnxrw7c3agw==", + "version": "0.10.53", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", + "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", "requires": { "es6-iterator": "~2.0.3", - "es6-symbol": "~3.1.1", - "next-tick": "^1.0.0" + "es6-symbol": "~3.1.3", + "next-tick": "~1.0.0" } }, "es6-iterator": { @@ -214,631 +66,220 @@ } }, "es6-symbol": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", - "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", "requires": { - "d": "1", - "es5-ext": "~0.10.14" + "d": "^1.0.1", + "ext": "^1.1.2" } }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" - }, - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" - }, - "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" - }, - "ffi": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/ffi/-/ffi-2.3.0.tgz", - "integrity": "sha512-vkPA9Hf9CVuQ5HeMZykYvrZF2QNJ/iKGLkyDkisBnoOOFeFXZQhUPxBARPBIZMJVulvBI2R+jgofW03gyPpJcQ==", + "ext": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", + "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", "requires": { - "bindings": "~1.2.0", - "debug": "2", - "nan": "2", - "ref": "1", - "ref-struct": "1" + "type": "^2.0.0" }, "dependencies": { - "bindings": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.2.1.tgz", - "integrity": "sha1-FK1hE4EtLTfXLme0ystLtyZQXxE=" + "type": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.1.0.tgz", + "integrity": "sha512-G9absDWvhAWCV2gmF1zKud3OyC61nZDwWvBL2DApaVFogI07CprggiQAOOjvp2NRjYWFzPyu7vwtDrQFq8jeSA==" } } }, - "file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" - }, - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "fs-minipass": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.6.tgz", - "integrity": "sha512-crhvyXcMejjv3Z5d2Fa9sf5xLYVCF5O1c71QxbVnbLsmYMBEvDAftewesN/HhY03YRoA7zOMxjNGrF5svGaaeQ==", - "requires": { - "minipass": "^2.2.1" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, - "gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "requires": { - "assert-plus": "^1.0.0" - } - }, - "glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "graceful-fs": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.0.tgz", - "integrity": "sha512-jpSvDPV4Cq/bgtpndIWbI5hmYxhQGHPC4d4cqBPb4DLniCfhJokdXhwhaDuLBGLQdvvRum/UiX6ECVIPvDXqdg==" - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" - }, - "har-validator": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", - "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "ffi-napi": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/ffi-napi/-/ffi-napi-3.1.0.tgz", + "integrity": "sha512-EsHO+sP2p/nUC/3l/l8m9niee1BLm4asUFDzkkBGR4kYVgp2KqdAYUomZhkKtzim4Fq7mcYHjpUaIHsMqs+E1g==", "requires": { - "ajv": "^6.5.5", - "har-schema": "^2.0.0" + "debug": "^4.1.1", + "get-uv-event-loop-napi-h": "^1.0.5", + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.1", + "ref-napi": "^2.0.1", + "ref-struct-di": "^1.1.0" + }, + "dependencies": { + "ref-napi": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ref-napi/-/ref-napi-2.1.2.tgz", + "integrity": "sha512-aFl+vrIuLWUXMUTQGAwGAuSNLX3Ub5W3iVP8b7KyFFZUdn4+i4U1TXXTop0kCTUfGNu8glBGVz4lowkwMcPVVA==", + "requires": { + "debug": "^4.1.1", + "get-symbol-from-current-process-h": "^1.0.2", + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.1" + } + } } }, - "has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } + "get-symbol-from-current-process-h": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-symbol-from-current-process-h/-/get-symbol-from-current-process-h-1.0.2.tgz", + "integrity": "sha512-syloC6fsCt62ELLrr1VKBM1ggOpMdetX9hTrdW77UQdcApPHLmf7CI7OKcN1c9kYuNxKcDe4iJ4FY9sX3aw2xw==" }, - "inflight": { + "get-uv-event-loop-napi-h": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "resolved": "https://registry.npmjs.org/get-uv-event-loop-napi-h/-/get-uv-event-loop-napi-h-1.0.6.tgz", + "integrity": "sha512-t5c9VNR84nRoF+eLiz6wFrEp1SE2Acg0wS+Ysa2zF0eROes+LzOfuTaVHxGy8AbS8rq7FHEJzjnCZo1BupwdJg==", "requires": { - "number-is-nan": "^1.0.0" - } - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" - }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" - }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, - "mime-db": { - "version": "1.40.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", - "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" - }, - "mime-types": { - "version": "2.1.24", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", - "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", - "requires": { - "mime-db": "1.40.0" - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" - }, - "minipass": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz", - "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.2.1.tgz", - "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", - "requires": { - "minipass": "^2.2.1" - } - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "requires": { - "minimist": "0.0.8" + "get-symbol-from-current-process-h": "^1.0.1" } }, "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "nan": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", - "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "next-tick": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=" }, - "node-gyp": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-5.0.2.tgz", - "integrity": "sha512-sNcb5O7eJ9XiNAhWZ/UE2bWsBJn3Jb7rayMqMP4wjenlr1DwzZxUmbtmIrl04EU0p5fN2rU9WIDV+u0EbsI8oQ==", - "requires": { - "env-paths": "^1.0.0", - "glob": "^7.0.3", - "graceful-fs": "^4.1.2", - "mkdirp": "^0.5.0", - "nopt": "2 || 3", - "npmlog": "0 || 1 || 2 || 3 || 4", - "request": "^2.87.0", - "rimraf": "2", - "semver": "~5.3.0", - "tar": "^4.4.8", - "which": "1" - } - }, - "nopt": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", - "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", - "requires": { - "abbrev": "1" - } - }, - "npmlog": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" - }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" - }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" - }, - "psl": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.2.0.tgz", - "integrity": "sha512-GEn74ZffufCmkDDLNcl3uuyF/aSD6exEyh1v/ZSdAomB82t6G9hzJVRx0jBmLDW+VfZqks3aScmMw9DszwUalA==" - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + "node-addon-api": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", + "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==" }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + "node-gyp-build": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", + "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==" }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "ref": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ref/-/ref-1.3.5.tgz", - "integrity": "sha512-2cBCniTtxcGUjDpvFfVpw323a83/0RLSGJJY5l5lcomZWhYpU2cuLdsvYqMixvsdLJ9+sTdzEkju8J8ZHDM2nA==", - "requires": { - "bindings": "1", - "debug": "2", - "nan": "2" - } - }, - "ref-array": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/ref-array/-/ref-array-1.2.0.tgz", - "integrity": "sha1-u6hwFS1O4KvtFCGwYjkvCwGEKQw=", + "ref-array-napi": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ref-array-napi/-/ref-array-napi-1.2.1.tgz", + "integrity": "sha512-jQp2WWSucmxkqVfoNfm7yDlDeGu3liAbzqfwjNybL80ooLOCnCZpAK2woDInY+lxNOK/VlIVSqeDEYb4gVPuNQ==", "requires": { "array-index": "1", "debug": "2", - "ref": "1" - } - }, - "ref-struct": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/ref-struct/-/ref-struct-1.1.0.tgz", - "integrity": "sha1-XV7mWtQc78Olxf60BYcmHkee3BM=", - "requires": { - "debug": "2", - "ref": "1" - } - }, - "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.0", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - } - }, - "rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", - "requires": { - "glob": "^7.1.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "semver": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", - "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=" - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" - }, - "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" - }, - "sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" + "ref-napi": "^1.4.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "ref-napi": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/ref-napi/-/ref-napi-1.5.2.tgz", + "integrity": "sha512-hwyNmWpUkt1bDWDW4aiwCoC+SJfJO69UIdjqssNqdaS0sYJpgqzosGg/rLtk69UoQ8drZdI9yyQefM7eEMM3Gw==", + "requires": { + "debug": "^3.1.0", + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.1" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + } + } + } } }, - "strip-ansi": { + "ref-napi": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "tar": { - "version": "4.4.10", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.10.tgz", - "integrity": "sha512-g2SVs5QIxvo6OLp0GudTqEf05maawKUxXru104iaayWA09551tFCTI8f1Asb4lPfkBr91k07iL4c11XO3/b0tA==", + "resolved": "https://registry.npmjs.org/ref-napi/-/ref-napi-3.0.1.tgz", + "integrity": "sha512-W3rcb0E+tlO9u9ySFnX5vifInwwPGToOfFgTZUHJBNiOBsW0NNvgHz2zJN7ctABo/2yIlgdPQUvuqqfORIF4LA==", "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.3.5", - "minizlib": "^1.2.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.3" + "debug": "^4.1.1", + "get-symbol-from-current-process-h": "^1.0.2", + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.1" } }, - "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "ref-struct-di": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ref-struct-di/-/ref-struct-di-1.1.1.tgz", + "integrity": "sha512-2Xyn/0Qgz89VT+++WP0sTosdm9oeowLP23wRJYhG4BFdMUrLj3jhwHZNEytYNYgtPKLNTP3KJX4HEgBvM1/Y2g==", "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" + "debug": "^3.1.0" }, "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "requires": { + "ms": "^2.1.1" + } } } }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "ref-struct-napi": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ref-struct-napi/-/ref-struct-napi-1.1.1.tgz", + "integrity": "sha512-YgS5/d7+kT5zgtySYI5ieH0hREdv+DabgDvoczxsui0f9VLm0rrDcWEj4DHKehsH+tJnVMsLwuyctWgvdEcVRw==", "requires": { - "safe-buffer": "^5.0.1" + "debug": "2", + "ref-napi": "^1.4.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "ref-napi": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/ref-napi/-/ref-napi-1.5.2.tgz", + "integrity": "sha512-hwyNmWpUkt1bDWDW4aiwCoC+SJfJO69UIdjqssNqdaS0sYJpgqzosGg/rLtk69UoQ8drZdI9yyQefM7eEMM3Gw==", + "requires": { + "debug": "^3.1.0", + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.1" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + } + } + } } }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" - }, "type": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/type/-/type-1.0.1.tgz", - "integrity": "sha512-MAM5dBMJCJNKs9E7JXo4CXRAansRfG0nlJxW7Wf6GZzSOvH31zClSaHdIMWLehe/EGMBkqeC55rrkaOr5Oo7Nw==" - }, - "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "requires": { - "punycode": "^2.1.0" - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "requires": { - "isexe": "^2.0.0" - } - }, - "wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "requires": { - "string-width": "^1.0.2 || 2" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - }, - "yallist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" } } } diff --git a/src/connector/nodejs/package.json b/src/connector/nodejs/package.json index 5587a69e01e6743a7eb7ef234d111c86db246841..b39ce2c17d8e693d0e981885aed55ba1b82313b6 100644 --- a/src/connector/nodejs/package.json +++ b/src/connector/nodejs/package.json @@ -1,31 +1,34 @@ { "name": "td2.0-connector", - "version": "2.0.5", + "version": "2.0.6", "description": "A Node.js connector for TDengine.", "main": "tdengine.js", + "directories": { + "test": "test" + }, "scripts": { "test": "node test/test.js" }, + "repository": { + "type": "git", + "url": "git+https://github.com/taosdata/tdengine.git" + }, "keywords": [ "TDengine", "TAOS Data", "Time Series Database", "Connector" ], - "author": "StoneT2000", - "license": "AGPL-3.0", - "dependencies": { - "ffi": "^2.3.0", - "node-gyp": "^5.0.2", - "ref": "^1.3.5", - "ref-array": "^1.2.0" - }, - "homepage": "https://github.com/taosdata/tdengine", + "author": "TaosData Inc.", + "license": "AGPL-3.0-or-later", "bugs": { "url": "https://github.com/taosdata/tdengine/issues" }, - "repository": { - "type": "git", - "url": "https://github.com/taosdata/tdengine.git" + "homepage": "https://github.com/taosdata/tdengine#readme", + "dependencies": { + "ffi-napi": "^3.1.0", + "ref-array-napi": "^1.2.1", + "ref-napi": "^1.5.2", + "ref-struct-napi": "^1.1.1" } } diff --git a/src/inc/ttokendef.h b/src/inc/ttokendef.h index 09500fc8c575c8660076e0ef5093a1590e49f90f..c877ccfb72007af5bae8ef556f64c8305e7ba44e 100644 --- a/src/inc/ttokendef.h +++ b/src/inc/ttokendef.h @@ -82,151 +82,154 @@ #define TK_STABLES 64 #define TK_VGROUPS 65 #define TK_DROP 66 -#define TK_DNODE 67 -#define TK_USER 68 -#define TK_ACCOUNT 69 -#define TK_USE 70 -#define TK_DESCRIBE 71 -#define TK_ALTER 72 -#define TK_PASS 73 -#define TK_PRIVILEGE 74 -#define TK_LOCAL 75 -#define TK_IF 76 -#define TK_EXISTS 77 -#define TK_PPS 78 -#define TK_TSERIES 79 -#define TK_DBS 80 -#define TK_STORAGE 81 -#define TK_QTIME 82 -#define TK_CONNS 83 -#define TK_STATE 84 -#define TK_KEEP 85 -#define TK_CACHE 86 -#define TK_REPLICA 87 -#define TK_QUORUM 88 -#define TK_DAYS 89 -#define TK_MINROWS 90 -#define TK_MAXROWS 91 -#define TK_BLOCKS 92 -#define TK_CTIME 93 -#define TK_WAL 94 -#define TK_FSYNC 95 -#define TK_COMP 96 -#define TK_PRECISION 97 -#define TK_UPDATE 98 -#define TK_CACHELAST 99 -#define TK_LP 100 -#define TK_RP 101 -#define TK_UNSIGNED 102 -#define TK_TAGS 103 -#define TK_USING 104 -#define TK_AS 105 -#define TK_COMMA 106 -#define TK_NULL 107 -#define TK_SELECT 108 -#define TK_UNION 109 -#define TK_ALL 110 -#define TK_FROM 111 -#define TK_VARIABLE 112 -#define TK_INTERVAL 113 -#define TK_FILL 114 -#define TK_SLIDING 115 -#define TK_ORDER 116 -#define TK_BY 117 -#define TK_ASC 118 -#define TK_DESC 119 -#define TK_GROUP 120 -#define TK_HAVING 121 -#define TK_LIMIT 122 -#define TK_OFFSET 123 -#define TK_SLIMIT 124 -#define TK_SOFFSET 125 -#define TK_WHERE 126 -#define TK_NOW 127 -#define TK_RESET 128 -#define TK_QUERY 129 -#define TK_ADD 130 -#define TK_COLUMN 131 -#define TK_TAG 132 -#define TK_CHANGE 133 -#define TK_SET 134 -#define TK_KILL 135 -#define TK_CONNECTION 136 -#define TK_STREAM 137 -#define TK_COLON 138 -#define TK_ABORT 139 -#define TK_AFTER 140 -#define TK_ATTACH 141 -#define TK_BEFORE 142 -#define TK_BEGIN 143 -#define TK_CASCADE 144 -#define TK_CLUSTER 145 -#define TK_CONFLICT 146 -#define TK_COPY 147 -#define TK_DEFERRED 148 -#define TK_DELIMITERS 149 -#define TK_DETACH 150 -#define TK_EACH 151 -#define TK_END 152 -#define TK_EXPLAIN 153 -#define TK_FAIL 154 -#define TK_FOR 155 -#define TK_IGNORE 156 -#define TK_IMMEDIATE 157 -#define TK_INITIALLY 158 -#define TK_INSTEAD 159 -#define TK_MATCH 160 -#define TK_KEY 161 -#define TK_OF 162 -#define TK_RAISE 163 -#define TK_REPLACE 164 -#define TK_RESTRICT 165 -#define TK_ROW 166 -#define TK_STATEMENT 167 -#define TK_TRIGGER 168 -#define TK_VIEW 169 -#define TK_COUNT 170 -#define TK_SUM 171 -#define TK_AVG 172 -#define TK_MIN 173 -#define TK_MAX 174 -#define TK_FIRST 175 -#define TK_LAST 176 -#define TK_TOP 177 -#define TK_BOTTOM 178 -#define TK_STDDEV 179 -#define TK_PERCENTILE 180 -#define TK_APERCENTILE 181 -#define TK_LEASTSQUARES 182 -#define TK_HISTOGRAM 183 -#define TK_DIFF 184 -#define TK_SPREAD 185 -#define TK_TWA 186 -#define TK_INTERP 187 -#define TK_LAST_ROW 188 -#define TK_RATE 189 -#define TK_IRATE 190 -#define TK_SUM_RATE 191 -#define TK_SUM_IRATE 192 -#define TK_AVG_RATE 193 -#define TK_AVG_IRATE 194 -#define TK_TBID 195 -#define TK_SEMI 196 -#define TK_NONE 197 -#define TK_PREV 198 -#define TK_LINEAR 199 -#define TK_IMPORT 200 -#define TK_METRIC 201 -#define TK_TBNAME 202 -#define TK_JOIN 203 -#define TK_METRICS 204 -#define TK_STABLE 205 +#define TK_STABLE 67 +#define TK_DNODE 68 +#define TK_USER 69 +#define TK_ACCOUNT 70 +#define TK_USE 71 +#define TK_DESCRIBE 72 +#define TK_ALTER 73 +#define TK_PASS 74 +#define TK_PRIVILEGE 75 +#define TK_LOCAL 76 +#define TK_IF 77 +#define TK_EXISTS 78 +#define TK_PPS 79 +#define TK_TSERIES 80 +#define TK_DBS 81 +#define TK_STORAGE 82 +#define TK_QTIME 83 +#define TK_CONNS 84 +#define TK_STATE 85 +#define TK_KEEP 86 +#define TK_CACHE 87 +#define TK_REPLICA 88 +#define TK_QUORUM 89 +#define TK_DAYS 90 +#define TK_MINROWS 91 +#define TK_MAXROWS 92 +#define TK_BLOCKS 93 +#define TK_CTIME 94 +#define TK_WAL 95 +#define TK_FSYNC 96 +#define TK_COMP 97 +#define TK_PRECISION 98 +#define TK_UPDATE 99 +#define TK_CACHELAST 100 +#define TK_LP 101 +#define TK_RP 102 +#define TK_UNSIGNED 103 +#define TK_TAGS 104 +#define TK_USING 105 +#define TK_AS 106 +#define TK_COMMA 107 +#define TK_NULL 108 +#define TK_SELECT 109 +#define TK_UNION 110 +#define TK_ALL 111 +#define TK_FROM 112 +#define TK_VARIABLE 113 +#define TK_INTERVAL 114 +#define TK_FILL 115 +#define TK_SLIDING 116 +#define TK_ORDER 117 +#define TK_BY 118 +#define TK_ASC 119 +#define TK_DESC 120 +#define TK_GROUP 121 +#define TK_HAVING 122 +#define TK_LIMIT 123 +#define TK_OFFSET 124 +#define TK_SLIMIT 125 +#define TK_SOFFSET 126 +#define TK_WHERE 127 +#define TK_NOW 128 +#define TK_RESET 129 +#define TK_QUERY 130 +#define TK_ADD 131 +#define TK_COLUMN 132 +#define TK_TAG 133 +#define TK_CHANGE 134 +#define TK_SET 135 +#define TK_KILL 136 +#define TK_CONNECTION 137 +#define TK_STREAM 138 +#define TK_COLON 139 +#define TK_ABORT 140 +#define TK_AFTER 141 +#define TK_ATTACH 142 +#define TK_BEFORE 143 +#define TK_BEGIN 144 +#define TK_CASCADE 145 +#define TK_CLUSTER 146 +#define TK_CONFLICT 147 +#define TK_COPY 148 +#define TK_DEFERRED 149 +#define TK_DELIMITERS 150 +#define TK_DETACH 151 +#define TK_EACH 152 +#define TK_END 153 +#define TK_EXPLAIN 154 +#define TK_FAIL 155 +#define TK_FOR 156 +#define TK_IGNORE 157 +#define TK_IMMEDIATE 158 +#define TK_INITIALLY 159 +#define TK_INSTEAD 160 +#define TK_MATCH 161 +#define TK_KEY 162 +#define TK_OF 163 +#define TK_RAISE 164 +#define TK_REPLACE 165 +#define TK_RESTRICT 166 +#define TK_ROW 167 +#define TK_STATEMENT 168 +#define TK_TRIGGER 169 +#define TK_VIEW 170 +#define TK_COUNT 171 +#define TK_SUM 172 +#define TK_AVG 173 +#define TK_MIN 174 +#define TK_MAX 175 +#define TK_FIRST 176 +#define TK_LAST 177 +#define TK_TOP 178 +#define TK_BOTTOM 179 +#define TK_STDDEV 180 +#define TK_PERCENTILE 181 +#define TK_APERCENTILE 182 +#define TK_LEASTSQUARES 183 +#define TK_HISTOGRAM 184 +#define TK_DIFF 185 +#define TK_SPREAD 186 +#define TK_TWA 187 +#define TK_INTERP 188 +#define TK_LAST_ROW 189 +#define TK_RATE 190 +#define TK_IRATE 191 +#define TK_SUM_RATE 192 +#define TK_SUM_IRATE 193 +#define TK_AVG_RATE 194 +#define TK_AVG_IRATE 195 +#define TK_TBID 196 +#define TK_SEMI 197 +#define TK_NONE 198 +#define TK_PREV 199 +#define TK_LINEAR 200 +#define TK_IMPORT 201 +#define TK_METRIC 202 +#define TK_TBNAME 203 +#define TK_JOIN 204 +#define TK_METRICS 205 #define TK_INSERT 206 #define TK_INTO 207 #define TK_VALUES 208 + + + #define TK_SPACE 300 #define TK_COMMENT 301 #define TK_ILLEGAL 302 diff --git a/src/mnode/src/mnodeProfile.c b/src/mnode/src/mnodeProfile.c index 7c35829f88f4e7d1753a3ee00b13a9f87d03ae48..89dc32f03a8d63592bf34ba7e0e44566e9bcb92a 100644 --- a/src/mnode/src/mnodeProfile.c +++ b/src/mnode/src/mnodeProfile.c @@ -385,12 +385,22 @@ static int32_t mnodeRetrieveQueries(SShowObj *pShow, char *data, int32_t rows, v SConnObj *pConnObj = NULL; int32_t cols = 0; char * pWrite; + void * pIter; char str[TSDB_IPv4ADDR_LEN + 6] = {0}; while (numOfRows < rows) { - pShow->pIter = mnodeGetNextConn(pShow->pIter, &pConnObj); - if (pConnObj == NULL) break; + pIter = mnodeGetNextConn(pShow->pIter, &pConnObj); + if (pConnObj == NULL) { + pShow->pIter = pIter; + break; + } + + if (numOfRows + pConnObj->numOfQueries >= rows) { + mnodeCancelGetNextConn(pIter); + break; + } + pShow->pIter = pIter; for (int32_t i = 0; i < pConnObj->numOfQueries; ++i) { SQueryDesc *pDesc = pConnObj->pQueries + i; cols = 0; @@ -518,12 +528,22 @@ static int32_t mnodeRetrieveStreams(SShowObj *pShow, char *data, int32_t rows, v SConnObj *pConnObj = NULL; int32_t cols = 0; char * pWrite; + void * pIter; char ipStr[TSDB_IPv4ADDR_LEN + 6]; while (numOfRows < rows) { - pShow->pIter = mnodeGetNextConn(pShow->pIter, &pConnObj); - if (pConnObj == NULL) break; + pIter = mnodeGetNextConn(pShow->pIter, &pConnObj); + if (pConnObj == NULL) { + pShow->pIter = pIter; + break; + } + + if (numOfRows + pConnObj->numOfStreams >= rows) { + mnodeCancelGetNextConn(pIter); + break; + } + pShow->pIter = pIter; for (int32_t i = 0; i < pConnObj->numOfStreams; ++i) { SStreamDesc *pDesc = pConnObj->pStreams + i; cols = 0; diff --git a/src/os/src/detail/osTime.c b/src/os/src/detail/osTime.c index 1710c469fb48506f21d914ac586fa8356f044619..d6877790a8362e6422f1b658732d3fc5f5e9d616 100644 --- a/src/os/src/detail/osTime.c +++ b/src/os/src/detail/osTime.c @@ -504,13 +504,13 @@ int64_t taosTimeTruncate(int64_t t, const SInterval* pInterval, int32_t precisio int64_t end = 0; // not enough time range - if (INT64_MAX - start > pInterval->interval - 1) { + if (start < 0 || INT64_MAX - start > pInterval->interval - 1) { end = start + pInterval->interval - 1; while(end < t && ((start + pInterval->sliding) <= INT64_MAX)) { // move forward to the correct time window start += pInterval->sliding; - if (INT64_MAX - start > pInterval->interval - 1) { + if (start < 0 || INT64_MAX - start > pInterval->interval - 1) { end = start + pInterval->interval - 1; } else { end = INT64_MAX; diff --git a/src/query/inc/qSqlparser.h b/src/query/inc/qSqlparser.h index 56e676ef167b8c9f1a694ef0571d1b0318ef6992..be79bc55e61b32ed8e6892d320c19a900ceeb964 100644 --- a/src/query/inc/qSqlparser.h +++ b/src/query/inc/qSqlparser.h @@ -98,6 +98,7 @@ typedef struct SCreateTableSQL { typedef struct SAlterTableSQL { SStrToken name; + int16_t tableType; int16_t type; STagData tagData; SArray *pAddColumns; // SArray @@ -156,6 +157,7 @@ typedef struct tDCLSQL { int32_t nAlloc; /* Number of entries allocated below */ SStrToken *a; /* one entry for element */ bool existsCheck; + int16_t tableType; union { SCreateDBInfo dbOpt; @@ -250,7 +252,7 @@ SCreateTableSQL *tSetCreateSqlElems(SArray *pCols, SArray *pTags, SQuerySQL *pSe void tSqlExprNodeDestroy(tSQLExpr *pExpr); -SAlterTableSQL * tAlterTableSqlElems(SStrToken *pTableName, SArray *pCols, SArray *pVals, int32_t type); +SAlterTableSQL * tAlterTableSqlElems(SStrToken *pTableName, SArray *pCols, SArray *pVals, int32_t type, int16_t tableTable); SCreatedTableInfo createNewChildTableInfo(SStrToken *pTableName, SArray *pTagVals, SStrToken *pToken, SStrToken* igExists); void destroyAllSelectClause(SSubclauseInfo *pSql); @@ -267,7 +269,7 @@ void setCreatedTableName(SSqlInfo *pInfo, SStrToken *pTableNameToken, SStrToken void SqlInfoDestroy(SSqlInfo *pInfo); void setDCLSQLElems(SSqlInfo *pInfo, int32_t type, int32_t nParams, ...); -void setDropDbTableInfo(SSqlInfo *pInfo, int32_t type, SStrToken* pToken, SStrToken* existsCheck); +void setDropDbTableInfo(SSqlInfo *pInfo, int32_t type, SStrToken* pToken, SStrToken* existsCheck,int16_t tableType); void setShowOptions(SSqlInfo *pInfo, int32_t type, SStrToken* prefix, SStrToken* pPatterns); tDCLSQL *tTokenListAppend(tDCLSQL *pTokenList, SStrToken *pToken); diff --git a/src/query/inc/sql.y b/src/query/inc/sql.y index 1fa1369bb5da5bfe0fd4a08ce7c059396b8fa394..f224d2655178361aa220cc1d76a8f5befd10bd05 100644 --- a/src/query/inc/sql.y +++ b/src/query/inc/sql.y @@ -131,10 +131,16 @@ cmd ::= SHOW dbPrefix(X) VGROUPS ids(Y). { //drop configure for tables cmd ::= DROP TABLE ifexists(Y) ids(X) cpxName(Z). { X.n += Z.n; - setDropDbTableInfo(pInfo, TSDB_SQL_DROP_TABLE, &X, &Y); + setDropDbTableInfo(pInfo, TSDB_SQL_DROP_TABLE, &X, &Y, -1); } -cmd ::= DROP DATABASE ifexists(Y) ids(X). { setDropDbTableInfo(pInfo, TSDB_SQL_DROP_DB, &X, &Y); } +//drop stable +cmd ::= DROP STABLE ifexists(Y) ids(X) cpxName(Z). { + X.n += Z.n; + setDropDbTableInfo(pInfo, TSDB_SQL_DROP_TABLE, &X, &Y, TSDB_SUPER_TABLE); +} + +cmd ::= DROP DATABASE ifexists(Y) ids(X). { setDropDbTableInfo(pInfo, TSDB_SQL_DROP_DB, &X, &Y, -1); } cmd ::= DROP DNODE ids(X). { setDCLSQLElems(pInfo, TSDB_SQL_DROP_DNODE, 1, &X); } cmd ::= DROP USER ids(X). { setDCLSQLElems(pInfo, TSDB_SQL_DROP_USER, 1, &X); } cmd ::= DROP ACCOUNT ids(X). { setDCLSQLElems(pInfo, TSDB_SQL_DROP_ACCT, 1, &X); } @@ -305,6 +311,8 @@ signed(A) ::= MINUS INTEGER(X). { A = -strtol(X.z, NULL, 10);} ////////////////////////////////// The CREATE TABLE statement /////////////////////////////// cmd ::= CREATE TABLE create_table_args. {} +cmd ::= CREATE TABLE create_stable_args. {} +cmd ::= CREATE STABLE create_stable_args. {} cmd ::= CREATE TABLE create_table_list(Z). { pInfo->type = TSDB_SQL_CREATE_TABLE; pInfo->pCreateTableInfo = Z;} %type create_table_list{SCreateTableSQL*} @@ -333,7 +341,8 @@ create_table_args(A) ::= ifnotexists(U) ids(V) cpxName(Z) LP columnlist(X) RP. { } // create super table -create_table_args(A) ::= ifnotexists(U) ids(V) cpxName(Z) LP columnlist(X) RP TAGS LP columnlist(Y) RP. { +%type create_stable_args{SCreateTableSQL*} +create_stable_args(A) ::= ifnotexists(U) ids(V) cpxName(Z) LP columnlist(X) RP TAGS LP columnlist(Y) RP. { A = tSetCreateSqlElems(X, Y, NULL, TSQL_CREATE_STABLE); setSqlInfo(pInfo, A, NULL, TSDB_SQL_CREATE_TABLE); @@ -683,7 +692,7 @@ cmd ::= RESET QUERY CACHE. { setDCLSQLElems(pInfo, TSDB_SQL_RESET_CACHE, 0);} ///////////////////////////////////ALTER TABLE statement////////////////////////////////// cmd ::= ALTER TABLE ids(X) cpxName(F) ADD COLUMN columnlist(A). { X.n += F.n; - SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&X, A, NULL, TSDB_ALTER_TABLE_ADD_COLUMN); + SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&X, A, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } @@ -693,14 +702,14 @@ cmd ::= ALTER TABLE ids(X) cpxName(F) DROP COLUMN ids(A). { toTSDBType(A.type); SArray* K = tVariantListAppendToken(NULL, &A, -1); - SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&X, NULL, K, TSDB_ALTER_TABLE_DROP_COLUMN); + SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&X, NULL, K, TSDB_ALTER_TABLE_DROP_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } //////////////////////////////////ALTER TAGS statement///////////////////////////////////// cmd ::= ALTER TABLE ids(X) cpxName(Y) ADD TAG columnlist(A). { X.n += Y.n; - SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&X, A, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN); + SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&X, A, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } cmd ::= ALTER TABLE ids(X) cpxName(Z) DROP TAG ids(Y). { @@ -709,7 +718,7 @@ cmd ::= ALTER TABLE ids(X) cpxName(Z) DROP TAG ids(Y). { toTSDBType(Y.type); SArray* A = tVariantListAppendToken(NULL, &Y, -1); - SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&X, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN); + SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&X, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } @@ -722,7 +731,7 @@ cmd ::= ALTER TABLE ids(X) cpxName(F) CHANGE TAG ids(Y) ids(Z). { toTSDBType(Z.type); A = tVariantListAppendToken(A, &Z, -1); - SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&X, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN); + SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&X, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } @@ -733,7 +742,54 @@ cmd ::= ALTER TABLE ids(X) cpxName(F) SET TAG ids(Y) EQ tagitem(Z). { SArray* A = tVariantListAppendToken(NULL, &Y, -1); A = tVariantListAppend(A, &Z, -1); - SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&X, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL); + SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&X, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, -1); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); +} + + +///////////////////////////////////ALTER STABLE statement////////////////////////////////// +cmd ::= ALTER STABLE ids(X) cpxName(F) ADD COLUMN columnlist(A). { + X.n += F.n; + SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&X, A, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, TSDB_SUPER_TABLE); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); +} + +cmd ::= ALTER STABLE ids(X) cpxName(F) DROP COLUMN ids(A). { + X.n += F.n; + + toTSDBType(A.type); + SArray* K = tVariantListAppendToken(NULL, &A, -1); + + SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&X, NULL, K, TSDB_ALTER_TABLE_DROP_COLUMN, TSDB_SUPER_TABLE); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); +} + +//////////////////////////////////ALTER TAGS statement///////////////////////////////////// +cmd ::= ALTER STABLE ids(X) cpxName(Y) ADD TAG columnlist(A). { + X.n += Y.n; + SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&X, A, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, TSDB_SUPER_TABLE); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); +} +cmd ::= ALTER STABLE ids(X) cpxName(Z) DROP TAG ids(Y). { + X.n += Z.n; + + toTSDBType(Y.type); + SArray* A = tVariantListAppendToken(NULL, &Y, -1); + + SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&X, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN, TSDB_SUPER_TABLE); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); +} + +cmd ::= ALTER STABLE ids(X) cpxName(F) CHANGE TAG ids(Y) ids(Z). { + X.n += F.n; + + toTSDBType(Y.type); + SArray* A = tVariantListAppendToken(NULL, &Y, -1); + + toTSDBType(Z.type); + A = tVariantListAppendToken(A, &Z, -1); + + SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&X, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } diff --git a/src/query/src/qParserImpl.c b/src/query/src/qParserImpl.c index a5a3d7e323ebb1a933f90900904c0c0acb7160ce..62e221ff4eabf900f9fbff68460b8c4706ef46d4 100644 --- a/src/query/src/qParserImpl.c +++ b/src/query/src/qParserImpl.c @@ -585,11 +585,12 @@ SCreatedTableInfo createNewChildTableInfo(SStrToken *pTableName, SArray *pTagVal return info; } -SAlterTableSQL *tAlterTableSqlElems(SStrToken *pTableName, SArray *pCols, SArray *pVals, int32_t type) { +SAlterTableSQL *tAlterTableSqlElems(SStrToken *pTableName, SArray *pCols, SArray *pVals, int32_t type, int16_t tableType) { SAlterTableSQL *pAlterTable = calloc(1, sizeof(SAlterTableSQL)); pAlterTable->name = *pTableName; pAlterTable->type = type; + pAlterTable->tableType = tableType; if (type == TSDB_ALTER_TABLE_ADD_COLUMN || type == TSDB_ALTER_TABLE_ADD_TAG_COLUMN) { pAlterTable->pAddColumns = pCols; @@ -733,9 +734,10 @@ void setDCLSQLElems(SSqlInfo *pInfo, int32_t type, int32_t nParam, ...) { va_end(va); } -void setDropDbTableInfo(SSqlInfo *pInfo, int32_t type, SStrToken* pToken, SStrToken* existsCheck) { +void setDropDbTableInfo(SSqlInfo *pInfo, int32_t type, SStrToken* pToken, SStrToken* existsCheck, int16_t tableType) { pInfo->type = type; pInfo->pDCLInfo = tTokenListAppend(pInfo->pDCLInfo, pToken); + pInfo->pDCLInfo->tableType = tableType; pInfo->pDCLInfo->existsCheck = (existsCheck->n == 1); } diff --git a/src/query/src/sql.c b/src/query/src/sql.c index 6c59a5107404eac92632ebcd4f418ccc8468dafe..0f03499974bc5b69a82fde410e7e718cfb7c12ed 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,7 +100,7 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned short int -#define YYNOCODE 279 +#define YYNOCODE 278 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SStrToken typedef union { @@ -124,21 +127,29 @@ typedef union { #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 258 -#define YYNRULE 240 +#define YYNSTATE 282 +#define YYNRULE 248 +#define YYNRULE_WITH_ACTION 248 #define YYNTOKEN 209 -#define YY_MAX_SHIFT 257 -#define YY_MIN_SHIFTREDUCE 431 -#define YY_MAX_SHIFTREDUCE 670 -#define YY_ERROR_ACTION 671 -#define YY_ACCEPT_ACTION 672 -#define YY_NO_ACTION 673 -#define YY_MIN_REDUCE 674 -#define YY_MAX_REDUCE 913 +#define YY_MAX_SHIFT 281 +#define YY_MIN_SHIFTREDUCE 461 +#define YY_MAX_SHIFTREDUCE 708 +#define YY_ERROR_ACTION 709 +#define YY_ACCEPT_ACTION 710 +#define YY_NO_ACTION 711 +#define YY_MIN_REDUCE 712 +#define YY_MAX_REDUCE 959 /************* 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. @@ -203,132 +214,136 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (586) +#define YY_ACTTAB_COUNT (623) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 143, 474, 143, 23, 672, 257, 165, 547, 827, 475, - /* 10 */ 900, 168, 901, 37, 38, 12, 39, 40, 816, 23, - /* 20 */ 173, 31, 474, 474, 210, 43, 41, 45, 42, 805, - /* 30 */ 475, 475, 163, 36, 35, 232, 231, 34, 33, 32, - /* 40 */ 37, 38, 801, 39, 40, 816, 110, 173, 31, 162, - /* 50 */ 255, 210, 43, 41, 45, 42, 176, 66, 802, 195, - /* 60 */ 36, 35, 178, 824, 34, 33, 32, 432, 433, 434, - /* 70 */ 435, 436, 437, 438, 439, 440, 441, 442, 443, 256, - /* 80 */ 179, 225, 185, 37, 38, 805, 39, 40, 796, 242, - /* 90 */ 173, 31, 143, 180, 210, 43, 41, 45, 42, 110, - /* 100 */ 110, 167, 901, 36, 35, 57, 853, 34, 33, 32, - /* 110 */ 17, 223, 250, 249, 222, 221, 220, 248, 219, 247, - /* 120 */ 246, 245, 218, 244, 243, 803, 142, 774, 624, 762, - /* 130 */ 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, - /* 140 */ 773, 775, 776, 38, 181, 39, 40, 229, 228, 173, - /* 150 */ 31, 605, 606, 210, 43, 41, 45, 42, 207, 854, - /* 160 */ 61, 205, 36, 35, 23, 110, 34, 33, 32, 188, - /* 170 */ 39, 40, 23, 251, 173, 31, 192, 191, 210, 43, - /* 180 */ 41, 45, 42, 34, 33, 32, 105, 36, 35, 104, - /* 190 */ 147, 34, 33, 32, 172, 637, 805, 28, 628, 897, - /* 200 */ 631, 177, 634, 802, 172, 637, 896, 13, 628, 230, - /* 210 */ 631, 802, 634, 18, 172, 637, 794, 895, 628, 63, - /* 220 */ 631, 28, 634, 155, 574, 62, 169, 170, 23, 156, - /* 230 */ 209, 29, 197, 92, 91, 150, 169, 170, 77, 76, - /* 240 */ 582, 17, 198, 250, 249, 159, 169, 170, 248, 626, - /* 250 */ 247, 246, 245, 715, 244, 243, 133, 211, 780, 80, - /* 260 */ 160, 778, 779, 18, 242, 234, 781, 802, 783, 784, - /* 270 */ 782, 28, 785, 786, 43, 41, 45, 42, 724, 579, - /* 280 */ 64, 133, 36, 35, 19, 627, 34, 33, 32, 3, - /* 290 */ 124, 194, 225, 44, 910, 72, 68, 71, 158, 11, - /* 300 */ 10, 566, 592, 44, 563, 636, 564, 107, 565, 793, - /* 310 */ 22, 795, 630, 44, 633, 636, 716, 36, 35, 133, - /* 320 */ 635, 34, 33, 32, 171, 636, 596, 49, 78, 82, - /* 330 */ 635, 48, 182, 183, 87, 90, 81, 137, 135, 629, - /* 340 */ 635, 632, 84, 95, 94, 93, 50, 9, 145, 640, - /* 350 */ 52, 65, 120, 254, 253, 98, 597, 656, 638, 555, - /* 360 */ 146, 15, 14, 14, 24, 4, 55, 53, 546, 213, - /* 370 */ 556, 570, 148, 571, 24, 48, 568, 149, 569, 89, - /* 380 */ 88, 103, 101, 153, 154, 152, 141, 151, 144, 804, - /* 390 */ 864, 863, 818, 174, 860, 859, 175, 233, 826, 846, - /* 400 */ 831, 833, 106, 121, 845, 122, 567, 119, 123, 726, - /* 410 */ 217, 139, 26, 226, 102, 723, 28, 227, 909, 74, - /* 420 */ 908, 906, 125, 744, 27, 25, 196, 140, 713, 591, - /* 430 */ 83, 711, 85, 86, 199, 709, 708, 184, 54, 134, - /* 440 */ 706, 164, 705, 704, 703, 702, 136, 700, 698, 696, - /* 450 */ 694, 692, 138, 203, 58, 59, 51, 847, 815, 46, - /* 460 */ 208, 206, 204, 202, 200, 30, 79, 235, 236, 237, - /* 470 */ 238, 239, 240, 241, 161, 215, 216, 252, 670, 187, - /* 480 */ 186, 669, 69, 189, 157, 190, 668, 193, 661, 707, - /* 490 */ 197, 576, 60, 56, 593, 96, 128, 97, 127, 745, - /* 500 */ 126, 130, 129, 131, 132, 701, 693, 113, 111, 118, - /* 510 */ 116, 114, 112, 115, 800, 1, 117, 2, 166, 20, - /* 520 */ 108, 201, 6, 598, 109, 7, 639, 5, 8, 21, - /* 530 */ 16, 67, 212, 641, 214, 515, 65, 511, 509, 508, - /* 540 */ 507, 504, 478, 224, 70, 47, 73, 75, 24, 549, - /* 550 */ 548, 545, 499, 497, 489, 495, 491, 493, 487, 485, - /* 560 */ 517, 516, 514, 513, 512, 510, 506, 505, 48, 476, - /* 570 */ 447, 445, 674, 673, 673, 673, 673, 673, 673, 673, - /* 580 */ 673, 673, 673, 673, 99, 100, + /* 0 */ 158, 505, 158, 710, 281, 857, 659, 578, 182, 506, + /* 10 */ 941, 185, 942, 41, 42, 15, 43, 44, 26, 179, + /* 20 */ 190, 35, 505, 505, 231, 47, 45, 49, 46, 868, + /* 30 */ 506, 506, 846, 40, 39, 256, 255, 38, 37, 36, + /* 40 */ 41, 42, 660, 43, 44, 857, 951, 190, 35, 178, + /* 50 */ 279, 231, 47, 45, 49, 46, 180, 195, 843, 214, + /* 60 */ 40, 39, 157, 61, 38, 37, 36, 462, 463, 464, + /* 70 */ 465, 466, 467, 468, 469, 470, 471, 472, 473, 280, + /* 80 */ 198, 846, 204, 41, 42, 865, 43, 44, 246, 266, + /* 90 */ 190, 35, 158, 834, 231, 47, 45, 49, 46, 122, + /* 100 */ 122, 184, 942, 40, 39, 122, 62, 38, 37, 36, + /* 110 */ 20, 244, 274, 273, 243, 242, 241, 272, 240, 271, + /* 120 */ 270, 269, 239, 268, 267, 38, 37, 36, 813, 657, + /* 130 */ 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, + /* 140 */ 811, 812, 814, 815, 42, 200, 43, 44, 253, 252, + /* 150 */ 190, 35, 835, 275, 231, 47, 45, 49, 46, 228, + /* 160 */ 895, 66, 226, 40, 39, 115, 894, 38, 37, 36, + /* 170 */ 26, 43, 44, 32, 26, 190, 35, 846, 207, 231, + /* 180 */ 47, 45, 49, 46, 26, 211, 210, 162, 40, 39, + /* 190 */ 196, 845, 38, 37, 36, 189, 670, 117, 938, 661, + /* 200 */ 71, 664, 26, 667, 122, 189, 670, 188, 193, 661, + /* 210 */ 843, 664, 194, 667, 843, 189, 670, 16, 21, 661, + /* 220 */ 90, 664, 249, 667, 843, 266, 32, 186, 187, 246, + /* 230 */ 26, 230, 837, 166, 278, 277, 109, 186, 187, 167, + /* 240 */ 250, 615, 843, 199, 102, 101, 165, 186, 187, 4, + /* 250 */ 20, 26, 274, 273, 219, 197, 26, 272, 248, 271, + /* 260 */ 270, 269, 10, 268, 267, 67, 70, 132, 254, 819, + /* 270 */ 843, 217, 817, 818, 21, 844, 27, 820, 905, 822, + /* 280 */ 823, 821, 32, 824, 825, 47, 45, 49, 46, 258, + /* 290 */ 663, 843, 666, 40, 39, 48, 842, 38, 37, 36, + /* 300 */ 754, 232, 213, 146, 69, 48, 904, 669, 763, 173, + /* 310 */ 755, 146, 68, 146, 662, 48, 665, 669, 599, 638, + /* 320 */ 639, 596, 668, 597, 33, 598, 612, 669, 603, 607, + /* 330 */ 604, 22, 668, 832, 833, 25, 836, 216, 625, 88, + /* 340 */ 92, 937, 668, 119, 936, 82, 97, 100, 91, 201, + /* 350 */ 202, 191, 588, 629, 94, 3, 136, 27, 52, 152, + /* 360 */ 148, 29, 77, 73, 76, 150, 105, 104, 103, 40, + /* 370 */ 39, 630, 689, 38, 37, 36, 18, 17, 671, 53, + /* 380 */ 56, 174, 234, 17, 589, 81, 80, 27, 175, 52, + /* 390 */ 12, 11, 99, 98, 673, 87, 86, 57, 54, 160, + /* 400 */ 59, 161, 577, 14, 13, 163, 601, 164, 602, 114, + /* 410 */ 112, 170, 171, 901, 169, 900, 156, 168, 159, 192, + /* 420 */ 257, 116, 867, 859, 600, 872, 32, 874, 118, 133, + /* 430 */ 887, 886, 131, 134, 135, 765, 238, 154, 30, 215, + /* 440 */ 247, 762, 956, 78, 955, 953, 137, 251, 113, 950, + /* 450 */ 84, 949, 947, 138, 783, 31, 28, 155, 752, 93, + /* 460 */ 750, 95, 624, 220, 96, 181, 748, 747, 203, 147, + /* 470 */ 58, 745, 224, 744, 743, 856, 742, 741, 149, 151, + /* 480 */ 738, 55, 50, 123, 229, 227, 736, 734, 225, 732, + /* 490 */ 223, 730, 221, 153, 89, 34, 218, 63, 259, 260, + /* 500 */ 64, 888, 261, 262, 263, 264, 265, 276, 708, 176, + /* 510 */ 205, 206, 707, 208, 236, 237, 209, 177, 172, 706, + /* 520 */ 74, 694, 212, 216, 609, 746, 60, 106, 233, 6, + /* 530 */ 120, 141, 140, 784, 139, 142, 143, 740, 144, 145, + /* 540 */ 107, 739, 2, 108, 841, 731, 65, 626, 1, 129, + /* 550 */ 126, 124, 125, 183, 127, 128, 130, 222, 7, 631, + /* 560 */ 121, 23, 24, 672, 8, 5, 674, 9, 19, 235, + /* 570 */ 72, 546, 542, 70, 540, 539, 538, 535, 509, 245, + /* 580 */ 79, 27, 75, 580, 51, 83, 85, 579, 576, 530, + /* 590 */ 528, 520, 526, 522, 524, 518, 516, 548, 547, 545, + /* 600 */ 544, 543, 541, 537, 536, 52, 507, 477, 475, 712, + /* 610 */ 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, + /* 620 */ 711, 110, 111, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 267, 1, 267, 213, 210, 211, 230, 5, 213, 9, - /* 10 */ 277, 276, 277, 13, 14, 267, 16, 17, 251, 213, - /* 20 */ 20, 21, 1, 1, 24, 25, 26, 27, 28, 253, - /* 30 */ 9, 9, 265, 33, 34, 33, 34, 37, 38, 39, - /* 40 */ 13, 14, 252, 16, 17, 251, 213, 20, 21, 212, - /* 50 */ 213, 24, 25, 26, 27, 28, 250, 218, 252, 265, - /* 60 */ 33, 34, 230, 268, 37, 38, 39, 45, 46, 47, + /* 0 */ 267, 1, 267, 209, 210, 251, 1, 5, 229, 9, + /* 10 */ 277, 276, 277, 13, 14, 267, 16, 17, 212, 265, + /* 20 */ 20, 21, 1, 1, 24, 25, 26, 27, 28, 212, + /* 30 */ 9, 9, 253, 33, 34, 33, 34, 37, 38, 39, + /* 40 */ 13, 14, 37, 16, 17, 251, 253, 20, 21, 211, + /* 50 */ 212, 24, 25, 26, 27, 28, 250, 229, 252, 265, + /* 60 */ 33, 34, 267, 217, 37, 38, 39, 45, 46, 47, /* 70 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - /* 80 */ 66, 76, 60, 13, 14, 253, 16, 17, 249, 78, - /* 90 */ 20, 21, 267, 213, 24, 25, 26, 27, 28, 213, - /* 100 */ 213, 276, 277, 33, 34, 105, 273, 37, 38, 39, - /* 110 */ 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - /* 120 */ 95, 96, 97, 98, 99, 245, 267, 229, 101, 231, - /* 130 */ 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - /* 140 */ 242, 243, 244, 14, 130, 16, 17, 133, 134, 20, - /* 150 */ 21, 118, 119, 24, 25, 26, 27, 28, 271, 273, - /* 160 */ 273, 275, 33, 34, 213, 213, 37, 38, 39, 129, - /* 170 */ 16, 17, 213, 230, 20, 21, 136, 137, 24, 25, - /* 180 */ 26, 27, 28, 37, 38, 39, 213, 33, 34, 100, - /* 190 */ 267, 37, 38, 39, 1, 2, 253, 108, 5, 267, - /* 200 */ 7, 250, 9, 252, 1, 2, 267, 44, 5, 250, - /* 210 */ 7, 252, 9, 100, 1, 2, 0, 267, 5, 254, - /* 220 */ 7, 108, 9, 60, 101, 273, 33, 34, 213, 66, - /* 230 */ 37, 266, 109, 70, 71, 72, 33, 34, 131, 132, - /* 240 */ 37, 85, 269, 87, 88, 267, 33, 34, 92, 1, - /* 250 */ 94, 95, 96, 217, 98, 99, 220, 15, 229, 73, - /* 260 */ 267, 232, 233, 100, 78, 250, 237, 252, 239, 240, - /* 270 */ 241, 108, 243, 244, 25, 26, 27, 28, 217, 106, - /* 280 */ 218, 220, 33, 34, 111, 37, 37, 38, 39, 61, - /* 290 */ 62, 128, 76, 100, 253, 67, 68, 69, 135, 131, - /* 300 */ 132, 2, 101, 100, 5, 112, 7, 106, 9, 247, - /* 310 */ 248, 249, 5, 100, 7, 112, 217, 33, 34, 220, - /* 320 */ 127, 37, 38, 39, 59, 112, 101, 106, 61, 62, - /* 330 */ 127, 106, 33, 34, 67, 68, 69, 61, 62, 5, - /* 340 */ 127, 7, 75, 67, 68, 69, 125, 100, 267, 107, - /* 350 */ 106, 104, 105, 63, 64, 65, 101, 101, 101, 101, - /* 360 */ 267, 106, 106, 106, 106, 100, 100, 123, 102, 101, - /* 370 */ 101, 5, 267, 7, 106, 106, 5, 267, 7, 73, - /* 380 */ 74, 61, 62, 267, 267, 267, 267, 267, 267, 253, - /* 390 */ 246, 246, 251, 246, 246, 246, 246, 246, 213, 274, - /* 400 */ 213, 213, 213, 213, 274, 213, 107, 255, 213, 213, - /* 410 */ 213, 213, 213, 213, 59, 213, 108, 213, 213, 213, - /* 420 */ 213, 213, 213, 213, 213, 213, 251, 213, 213, 112, - /* 430 */ 213, 213, 213, 213, 270, 213, 213, 213, 122, 213, - /* 440 */ 213, 270, 213, 213, 213, 213, 213, 213, 213, 213, - /* 450 */ 213, 213, 213, 270, 214, 214, 124, 214, 264, 121, - /* 460 */ 116, 120, 115, 114, 113, 126, 84, 83, 49, 80, - /* 470 */ 82, 53, 81, 79, 214, 214, 214, 76, 5, 5, - /* 480 */ 138, 5, 218, 138, 214, 5, 5, 129, 86, 214, - /* 490 */ 109, 101, 106, 110, 101, 215, 222, 215, 226, 228, - /* 500 */ 227, 223, 225, 224, 221, 214, 214, 261, 263, 256, - /* 510 */ 258, 260, 262, 259, 251, 219, 257, 216, 1, 106, - /* 520 */ 100, 100, 117, 101, 100, 117, 101, 100, 100, 106, - /* 530 */ 100, 73, 103, 107, 103, 9, 104, 5, 5, 5, - /* 540 */ 5, 5, 77, 15, 73, 16, 132, 132, 106, 5, - /* 550 */ 5, 101, 5, 5, 5, 5, 5, 5, 5, 5, - /* 560 */ 5, 5, 5, 5, 5, 5, 5, 5, 106, 77, - /* 570 */ 59, 58, 0, 278, 278, 278, 278, 278, 278, 278, - /* 580 */ 278, 278, 278, 278, 21, 21, 278, 278, 278, 278, - /* 590 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, - /* 600 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + /* 80 */ 66, 253, 60, 13, 14, 268, 16, 17, 77, 79, + /* 90 */ 20, 21, 267, 247, 24, 25, 26, 27, 28, 212, + /* 100 */ 212, 276, 277, 33, 34, 212, 106, 37, 38, 39, + /* 110 */ 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + /* 120 */ 96, 97, 98, 99, 100, 37, 38, 39, 228, 102, + /* 130 */ 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + /* 140 */ 240, 241, 242, 243, 14, 131, 16, 17, 134, 135, + /* 150 */ 20, 21, 0, 229, 24, 25, 26, 27, 28, 271, + /* 160 */ 273, 273, 275, 33, 34, 101, 273, 37, 38, 39, + /* 170 */ 212, 16, 17, 109, 212, 20, 21, 253, 130, 24, + /* 180 */ 25, 26, 27, 28, 212, 137, 138, 267, 33, 34, + /* 190 */ 66, 253, 37, 38, 39, 1, 2, 212, 267, 5, + /* 200 */ 217, 7, 212, 9, 212, 1, 2, 59, 250, 5, + /* 210 */ 252, 7, 250, 9, 252, 1, 2, 44, 101, 5, + /* 220 */ 74, 7, 250, 9, 252, 79, 109, 33, 34, 77, + /* 230 */ 212, 37, 249, 60, 63, 64, 65, 33, 34, 66, + /* 240 */ 250, 37, 252, 212, 71, 72, 73, 33, 34, 101, + /* 250 */ 86, 212, 88, 89, 269, 131, 212, 93, 134, 95, + /* 260 */ 96, 97, 101, 99, 100, 273, 105, 106, 250, 228, + /* 270 */ 252, 102, 231, 232, 101, 244, 107, 236, 245, 238, + /* 280 */ 239, 240, 109, 242, 243, 25, 26, 27, 28, 250, + /* 290 */ 5, 252, 7, 33, 34, 101, 252, 37, 38, 39, + /* 300 */ 216, 15, 129, 219, 217, 101, 245, 113, 216, 136, + /* 310 */ 216, 219, 254, 219, 5, 101, 7, 113, 2, 119, + /* 320 */ 120, 5, 128, 7, 266, 9, 107, 113, 5, 102, + /* 330 */ 7, 112, 128, 246, 247, 248, 249, 110, 102, 61, + /* 340 */ 62, 267, 128, 107, 267, 67, 68, 69, 70, 33, + /* 350 */ 34, 245, 102, 102, 76, 61, 62, 107, 107, 61, + /* 360 */ 62, 67, 68, 69, 70, 67, 68, 69, 70, 33, + /* 370 */ 34, 102, 102, 37, 38, 39, 107, 107, 102, 107, + /* 380 */ 107, 267, 102, 107, 102, 132, 133, 107, 267, 107, + /* 390 */ 132, 133, 74, 75, 108, 132, 133, 124, 126, 267, + /* 400 */ 101, 267, 103, 132, 133, 267, 5, 267, 7, 61, + /* 410 */ 62, 267, 267, 245, 267, 245, 267, 267, 267, 245, + /* 420 */ 245, 212, 212, 251, 108, 212, 109, 212, 212, 212, + /* 430 */ 274, 274, 255, 212, 212, 212, 212, 212, 212, 251, + /* 440 */ 212, 212, 212, 212, 212, 212, 212, 212, 59, 212, + /* 450 */ 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, + /* 460 */ 212, 212, 113, 270, 212, 270, 212, 212, 212, 212, + /* 470 */ 123, 212, 270, 212, 212, 264, 212, 212, 212, 212, + /* 480 */ 212, 125, 122, 263, 117, 121, 212, 212, 116, 212, + /* 490 */ 115, 212, 114, 212, 85, 127, 213, 213, 84, 49, + /* 500 */ 213, 213, 81, 83, 53, 82, 80, 77, 5, 213, + /* 510 */ 139, 5, 5, 139, 213, 213, 5, 213, 213, 5, + /* 520 */ 217, 87, 130, 110, 102, 213, 111, 214, 104, 101, + /* 530 */ 101, 221, 225, 227, 226, 224, 222, 213, 223, 220, + /* 540 */ 214, 213, 215, 214, 251, 213, 107, 102, 218, 257, + /* 550 */ 260, 262, 261, 1, 259, 258, 256, 101, 118, 102, + /* 560 */ 101, 107, 107, 102, 118, 101, 108, 101, 101, 104, + /* 570 */ 74, 9, 5, 105, 5, 5, 5, 5, 78, 15, + /* 580 */ 133, 107, 74, 5, 16, 133, 133, 5, 102, 5, + /* 590 */ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + /* 600 */ 5, 5, 5, 5, 5, 107, 78, 59, 58, 0, /* 610 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, - /* 620 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + /* 620 */ 278, 21, 21, 278, 278, 278, 278, 278, 278, 278, /* 630 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, /* 640 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, /* 650 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, @@ -345,86 +360,97 @@ static const YYCODETYPE yy_lookahead[] = { /* 760 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, /* 770 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, /* 780 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, - /* 790 */ 278, 278, 278, 278, 278, + /* 790 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + /* 800 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + /* 810 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + /* 820 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + /* 830 */ 278, 278, }; -#define YY_SHIFT_COUNT (257) +#define YY_SHIFT_COUNT (281) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (572) +#define YY_SHIFT_MAX (609) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 163, 25, 156, 5, 193, 213, 21, 21, 21, 21, - /* 10 */ 21, 21, 0, 22, 213, 299, 299, 299, 113, 21, - /* 20 */ 21, 21, 216, 21, 21, 186, 11, 11, 586, 203, - /* 30 */ 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, - /* 40 */ 213, 213, 213, 213, 213, 213, 213, 299, 299, 2, - /* 50 */ 2, 2, 2, 2, 2, 2, 89, 21, 21, 21, - /* 60 */ 21, 33, 33, 173, 21, 21, 21, 21, 21, 21, + /* 0 */ 173, 24, 164, 11, 194, 214, 21, 21, 21, 21, + /* 10 */ 21, 21, 21, 21, 21, 0, 22, 214, 316, 316, + /* 20 */ 316, 117, 21, 21, 21, 152, 21, 21, 146, 11, + /* 30 */ 10, 10, 623, 204, 214, 214, 214, 214, 214, 214, + /* 40 */ 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, + /* 50 */ 214, 316, 316, 2, 2, 2, 2, 2, 2, 2, + /* 60 */ 64, 21, 21, 21, 21, 21, 200, 200, 219, 21, /* 70 */ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, /* 80 */ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, /* 90 */ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - /* 100 */ 21, 21, 21, 21, 308, 355, 355, 317, 317, 317, - /* 110 */ 355, 316, 332, 338, 344, 341, 347, 349, 351, 339, - /* 120 */ 308, 355, 355, 355, 5, 355, 382, 384, 419, 389, - /* 130 */ 388, 418, 391, 394, 355, 401, 355, 401, 355, 586, - /* 140 */ 586, 27, 70, 70, 70, 129, 154, 249, 249, 249, - /* 150 */ 267, 284, 284, 284, 284, 228, 276, 14, 40, 146, - /* 160 */ 146, 247, 290, 123, 201, 225, 255, 256, 257, 307, - /* 170 */ 334, 248, 265, 242, 221, 244, 258, 268, 269, 107, - /* 180 */ 266, 168, 366, 371, 306, 320, 473, 342, 474, 476, - /* 190 */ 345, 480, 481, 402, 358, 381, 390, 383, 386, 393, - /* 200 */ 420, 517, 421, 422, 424, 413, 405, 423, 408, 425, - /* 210 */ 427, 426, 428, 429, 430, 431, 432, 458, 526, 532, - /* 220 */ 533, 534, 535, 536, 465, 528, 471, 529, 414, 415, - /* 230 */ 442, 544, 545, 450, 442, 547, 548, 549, 550, 551, - /* 240 */ 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, - /* 250 */ 562, 462, 492, 563, 564, 511, 513, 572, + /* 100 */ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + /* 110 */ 21, 21, 21, 21, 21, 317, 389, 389, 389, 349, + /* 120 */ 349, 349, 389, 347, 356, 360, 367, 364, 372, 375, + /* 130 */ 378, 368, 317, 389, 389, 389, 11, 389, 389, 409, + /* 140 */ 414, 450, 421, 420, 451, 423, 426, 389, 430, 389, + /* 150 */ 430, 389, 430, 389, 623, 623, 27, 70, 70, 70, + /* 160 */ 130, 155, 260, 260, 260, 278, 294, 298, 336, 336, + /* 170 */ 336, 336, 14, 48, 88, 88, 161, 124, 171, 227, + /* 180 */ 169, 236, 251, 269, 270, 276, 285, 309, 5, 148, + /* 190 */ 286, 272, 273, 250, 280, 282, 253, 258, 263, 299, + /* 200 */ 271, 323, 401, 318, 348, 503, 371, 506, 507, 374, + /* 210 */ 511, 514, 434, 392, 413, 422, 415, 424, 428, 439, + /* 220 */ 445, 429, 552, 456, 457, 459, 454, 440, 455, 446, + /* 230 */ 461, 464, 458, 466, 424, 467, 465, 468, 496, 562, + /* 240 */ 567, 569, 570, 571, 572, 500, 564, 508, 447, 474, + /* 250 */ 474, 568, 452, 453, 474, 578, 582, 486, 474, 584, + /* 260 */ 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, + /* 270 */ 595, 596, 597, 598, 599, 498, 528, 600, 601, 548, + /* 280 */ 550, 609, }; -#define YY_REDUCE_COUNT (140) +#define YY_REDUCE_COUNT (155) #define YY_REDUCE_MIN (-267) -#define YY_REDUCE_MAX (301) +#define YY_REDUCE_MAX (332) static const short yy_reduce_ofst[] = { - /* 0 */ -206, -102, 29, 62, -265, -175, -114, -113, -194, -49, - /* 10 */ -41, 15, -205, -163, -267, -224, -168, -57, -233, -27, - /* 20 */ -167, -48, -161, -120, -210, 36, 61, 99, -35, -252, - /* 30 */ -141, -77, -68, -61, -50, -22, -7, 81, 93, 105, - /* 40 */ 110, 116, 117, 118, 119, 120, 121, 41, 136, 144, - /* 50 */ 145, 147, 148, 149, 150, 151, 141, 185, 187, 188, - /* 60 */ 189, 125, 130, 152, 190, 192, 195, 196, 197, 198, - /* 70 */ 199, 200, 202, 204, 205, 206, 207, 208, 209, 210, - /* 80 */ 211, 212, 214, 215, 217, 218, 219, 220, 222, 223, - /* 90 */ 224, 226, 227, 229, 230, 231, 232, 233, 234, 235, - /* 100 */ 236, 237, 238, 239, 175, 240, 241, 164, 171, 183, - /* 110 */ 243, 194, 245, 250, 246, 251, 254, 252, 259, 253, - /* 120 */ 263, 260, 261, 262, 264, 270, 271, 273, 272, 274, - /* 130 */ 277, 278, 279, 283, 275, 280, 291, 282, 292, 296, - /* 140 */ 301, + /* 0 */ -206, -100, 41, 87, -265, -175, -194, -113, -112, -42, + /* 10 */ -38, -28, -10, 18, 39, -183, -162, -267, -221, -172, + /* 20 */ -76, -246, -15, -107, -8, -17, 31, 44, 84, -154, + /* 30 */ 92, 94, 58, -252, -205, -80, -69, 74, 77, 114, + /* 40 */ 121, 132, 134, 138, 140, 144, 145, 147, 149, 150, + /* 50 */ 151, -207, -62, 33, 61, 106, 168, 170, 174, 175, + /* 60 */ 172, 209, 210, 213, 215, 216, 156, 157, 177, 217, + /* 70 */ 221, 222, 223, 224, 225, 226, 228, 229, 230, 231, + /* 80 */ 232, 233, 234, 235, 237, 238, 239, 240, 241, 242, + /* 90 */ 243, 244, 245, 246, 247, 248, 249, 252, 254, 255, + /* 100 */ 256, 257, 259, 261, 262, 264, 265, 266, 267, 268, + /* 110 */ 274, 275, 277, 279, 281, 188, 283, 284, 287, 193, + /* 120 */ 195, 202, 288, 211, 220, 289, 291, 290, 295, 297, + /* 130 */ 292, 300, 293, 296, 301, 302, 303, 304, 305, 306, + /* 140 */ 308, 307, 310, 311, 314, 315, 319, 312, 313, 324, + /* 150 */ 326, 328, 329, 332, 330, 327, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 671, 725, 714, 722, 903, 903, 671, 671, 671, 671, - /* 10 */ 671, 671, 828, 689, 903, 671, 671, 671, 671, 671, - /* 20 */ 671, 671, 722, 671, 671, 727, 727, 727, 823, 671, - /* 30 */ 671, 671, 671, 671, 671, 671, 671, 671, 671, 671, - /* 40 */ 671, 671, 671, 671, 671, 671, 671, 671, 671, 671, - /* 50 */ 671, 671, 671, 671, 671, 671, 671, 671, 830, 832, - /* 60 */ 671, 850, 850, 821, 671, 671, 671, 671, 671, 671, - /* 70 */ 671, 671, 671, 671, 671, 671, 671, 671, 671, 671, - /* 80 */ 671, 671, 671, 712, 671, 710, 671, 671, 671, 671, - /* 90 */ 671, 671, 671, 671, 671, 671, 671, 671, 699, 671, - /* 100 */ 671, 671, 671, 671, 671, 691, 691, 671, 671, 671, - /* 110 */ 691, 857, 861, 855, 843, 851, 842, 838, 837, 865, - /* 120 */ 671, 691, 691, 691, 722, 691, 743, 741, 739, 731, - /* 130 */ 737, 733, 735, 729, 691, 720, 691, 720, 691, 761, - /* 140 */ 777, 671, 866, 902, 856, 892, 891, 898, 890, 889, - /* 150 */ 671, 885, 886, 888, 887, 671, 671, 671, 671, 894, - /* 160 */ 893, 671, 671, 671, 671, 671, 671, 671, 671, 671, - /* 170 */ 671, 671, 868, 671, 862, 858, 671, 671, 671, 671, - /* 180 */ 787, 671, 671, 671, 671, 671, 671, 671, 671, 671, - /* 190 */ 671, 671, 671, 671, 671, 820, 671, 671, 829, 671, - /* 200 */ 671, 671, 671, 671, 671, 852, 671, 844, 671, 671, - /* 210 */ 671, 671, 671, 797, 671, 671, 671, 671, 671, 671, - /* 220 */ 671, 671, 671, 671, 671, 671, 671, 671, 671, 671, - /* 230 */ 907, 671, 671, 671, 905, 671, 671, 671, 671, 671, - /* 240 */ 671, 671, 671, 671, 671, 671, 671, 671, 671, 671, - /* 250 */ 671, 746, 671, 697, 695, 671, 687, 671, + /* 0 */ 709, 764, 753, 761, 944, 944, 709, 709, 709, 709, + /* 10 */ 709, 709, 709, 709, 709, 869, 727, 944, 709, 709, + /* 20 */ 709, 709, 709, 709, 709, 761, 709, 709, 766, 761, + /* 30 */ 766, 766, 864, 709, 709, 709, 709, 709, 709, 709, + /* 40 */ 709, 709, 709, 709, 709, 709, 709, 709, 709, 709, + /* 50 */ 709, 709, 709, 709, 709, 709, 709, 709, 709, 709, + /* 60 */ 709, 709, 709, 871, 873, 709, 891, 891, 862, 709, + /* 70 */ 709, 709, 709, 709, 709, 709, 709, 709, 709, 709, + /* 80 */ 709, 709, 709, 709, 709, 709, 709, 709, 709, 709, + /* 90 */ 709, 709, 709, 751, 709, 749, 709, 709, 709, 709, + /* 100 */ 709, 709, 709, 709, 709, 709, 709, 709, 709, 737, + /* 110 */ 709, 709, 709, 709, 709, 709, 729, 729, 729, 709, + /* 120 */ 709, 709, 729, 898, 902, 896, 884, 892, 883, 879, + /* 130 */ 878, 906, 709, 729, 729, 729, 761, 729, 729, 782, + /* 140 */ 780, 778, 770, 776, 772, 774, 768, 729, 759, 729, + /* 150 */ 759, 729, 759, 729, 800, 816, 709, 907, 943, 897, + /* 160 */ 933, 932, 939, 931, 930, 709, 709, 709, 926, 927, + /* 170 */ 929, 928, 709, 709, 935, 934, 709, 709, 709, 709, + /* 180 */ 709, 709, 709, 709, 709, 709, 709, 709, 709, 909, + /* 190 */ 709, 903, 899, 709, 709, 709, 709, 709, 709, 826, + /* 200 */ 709, 709, 709, 709, 709, 709, 709, 709, 709, 709, + /* 210 */ 709, 709, 709, 709, 861, 709, 709, 709, 709, 870, + /* 220 */ 709, 709, 709, 709, 709, 709, 893, 709, 885, 709, + /* 230 */ 709, 709, 709, 709, 838, 709, 709, 709, 709, 709, + /* 240 */ 709, 709, 709, 709, 709, 709, 709, 709, 709, 954, + /* 250 */ 952, 709, 709, 709, 948, 709, 709, 709, 946, 709, + /* 260 */ 709, 709, 709, 709, 709, 709, 709, 709, 709, 709, + /* 270 */ 709, 709, 709, 709, 709, 785, 709, 735, 733, 709, + /* 280 */ 725, 709, }; /********** End of lemon-generated parsing tables *****************************/ @@ -511,6 +537,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* STABLES => nothing */ 0, /* VGROUPS => nothing */ 0, /* DROP => nothing */ + 1, /* STABLE => ID */ 0, /* DNODE => nothing */ 0, /* USER => nothing */ 0, /* ACCOUNT => nothing */ @@ -649,7 +676,6 @@ static const YYCODETYPE yyFallback[] = { 1, /* TBNAME => ID */ 1, /* JOIN => ID */ 1, /* METRICS => ID */ - 1, /* STABLE => ID */ 1, /* INSERT => ID */ 1, /* INTO => ID */ 1, /* VALUES => ID */ @@ -692,6 +718,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 */ @@ -806,187 +833,187 @@ static const char *const yyTokenName[] = { /* 64 */ "STABLES", /* 65 */ "VGROUPS", /* 66 */ "DROP", - /* 67 */ "DNODE", - /* 68 */ "USER", - /* 69 */ "ACCOUNT", - /* 70 */ "USE", - /* 71 */ "DESCRIBE", - /* 72 */ "ALTER", - /* 73 */ "PASS", - /* 74 */ "PRIVILEGE", - /* 75 */ "LOCAL", - /* 76 */ "IF", - /* 77 */ "EXISTS", - /* 78 */ "PPS", - /* 79 */ "TSERIES", - /* 80 */ "DBS", - /* 81 */ "STORAGE", - /* 82 */ "QTIME", - /* 83 */ "CONNS", - /* 84 */ "STATE", - /* 85 */ "KEEP", - /* 86 */ "CACHE", - /* 87 */ "REPLICA", - /* 88 */ "QUORUM", - /* 89 */ "DAYS", - /* 90 */ "MINROWS", - /* 91 */ "MAXROWS", - /* 92 */ "BLOCKS", - /* 93 */ "CTIME", - /* 94 */ "WAL", - /* 95 */ "FSYNC", - /* 96 */ "COMP", - /* 97 */ "PRECISION", - /* 98 */ "UPDATE", - /* 99 */ "CACHELAST", - /* 100 */ "LP", - /* 101 */ "RP", - /* 102 */ "UNSIGNED", - /* 103 */ "TAGS", - /* 104 */ "USING", - /* 105 */ "AS", - /* 106 */ "COMMA", - /* 107 */ "NULL", - /* 108 */ "SELECT", - /* 109 */ "UNION", - /* 110 */ "ALL", - /* 111 */ "FROM", - /* 112 */ "VARIABLE", - /* 113 */ "INTERVAL", - /* 114 */ "FILL", - /* 115 */ "SLIDING", - /* 116 */ "ORDER", - /* 117 */ "BY", - /* 118 */ "ASC", - /* 119 */ "DESC", - /* 120 */ "GROUP", - /* 121 */ "HAVING", - /* 122 */ "LIMIT", - /* 123 */ "OFFSET", - /* 124 */ "SLIMIT", - /* 125 */ "SOFFSET", - /* 126 */ "WHERE", - /* 127 */ "NOW", - /* 128 */ "RESET", - /* 129 */ "QUERY", - /* 130 */ "ADD", - /* 131 */ "COLUMN", - /* 132 */ "TAG", - /* 133 */ "CHANGE", - /* 134 */ "SET", - /* 135 */ "KILL", - /* 136 */ "CONNECTION", - /* 137 */ "STREAM", - /* 138 */ "COLON", - /* 139 */ "ABORT", - /* 140 */ "AFTER", - /* 141 */ "ATTACH", - /* 142 */ "BEFORE", - /* 143 */ "BEGIN", - /* 144 */ "CASCADE", - /* 145 */ "CLUSTER", - /* 146 */ "CONFLICT", - /* 147 */ "COPY", - /* 148 */ "DEFERRED", - /* 149 */ "DELIMITERS", - /* 150 */ "DETACH", - /* 151 */ "EACH", - /* 152 */ "END", - /* 153 */ "EXPLAIN", - /* 154 */ "FAIL", - /* 155 */ "FOR", - /* 156 */ "IGNORE", - /* 157 */ "IMMEDIATE", - /* 158 */ "INITIALLY", - /* 159 */ "INSTEAD", - /* 160 */ "MATCH", - /* 161 */ "KEY", - /* 162 */ "OF", - /* 163 */ "RAISE", - /* 164 */ "REPLACE", - /* 165 */ "RESTRICT", - /* 166 */ "ROW", - /* 167 */ "STATEMENT", - /* 168 */ "TRIGGER", - /* 169 */ "VIEW", - /* 170 */ "COUNT", - /* 171 */ "SUM", - /* 172 */ "AVG", - /* 173 */ "MIN", - /* 174 */ "MAX", - /* 175 */ "FIRST", - /* 176 */ "LAST", - /* 177 */ "TOP", - /* 178 */ "BOTTOM", - /* 179 */ "STDDEV", - /* 180 */ "PERCENTILE", - /* 181 */ "APERCENTILE", - /* 182 */ "LEASTSQUARES", - /* 183 */ "HISTOGRAM", - /* 184 */ "DIFF", - /* 185 */ "SPREAD", - /* 186 */ "TWA", - /* 187 */ "INTERP", - /* 188 */ "LAST_ROW", - /* 189 */ "RATE", - /* 190 */ "IRATE", - /* 191 */ "SUM_RATE", - /* 192 */ "SUM_IRATE", - /* 193 */ "AVG_RATE", - /* 194 */ "AVG_IRATE", - /* 195 */ "TBID", - /* 196 */ "SEMI", - /* 197 */ "NONE", - /* 198 */ "PREV", - /* 199 */ "LINEAR", - /* 200 */ "IMPORT", - /* 201 */ "METRIC", - /* 202 */ "TBNAME", - /* 203 */ "JOIN", - /* 204 */ "METRICS", - /* 205 */ "STABLE", + /* 67 */ "STABLE", + /* 68 */ "DNODE", + /* 69 */ "USER", + /* 70 */ "ACCOUNT", + /* 71 */ "USE", + /* 72 */ "DESCRIBE", + /* 73 */ "ALTER", + /* 74 */ "PASS", + /* 75 */ "PRIVILEGE", + /* 76 */ "LOCAL", + /* 77 */ "IF", + /* 78 */ "EXISTS", + /* 79 */ "PPS", + /* 80 */ "TSERIES", + /* 81 */ "DBS", + /* 82 */ "STORAGE", + /* 83 */ "QTIME", + /* 84 */ "CONNS", + /* 85 */ "STATE", + /* 86 */ "KEEP", + /* 87 */ "CACHE", + /* 88 */ "REPLICA", + /* 89 */ "QUORUM", + /* 90 */ "DAYS", + /* 91 */ "MINROWS", + /* 92 */ "MAXROWS", + /* 93 */ "BLOCKS", + /* 94 */ "CTIME", + /* 95 */ "WAL", + /* 96 */ "FSYNC", + /* 97 */ "COMP", + /* 98 */ "PRECISION", + /* 99 */ "UPDATE", + /* 100 */ "CACHELAST", + /* 101 */ "LP", + /* 102 */ "RP", + /* 103 */ "UNSIGNED", + /* 104 */ "TAGS", + /* 105 */ "USING", + /* 106 */ "AS", + /* 107 */ "COMMA", + /* 108 */ "NULL", + /* 109 */ "SELECT", + /* 110 */ "UNION", + /* 111 */ "ALL", + /* 112 */ "FROM", + /* 113 */ "VARIABLE", + /* 114 */ "INTERVAL", + /* 115 */ "FILL", + /* 116 */ "SLIDING", + /* 117 */ "ORDER", + /* 118 */ "BY", + /* 119 */ "ASC", + /* 120 */ "DESC", + /* 121 */ "GROUP", + /* 122 */ "HAVING", + /* 123 */ "LIMIT", + /* 124 */ "OFFSET", + /* 125 */ "SLIMIT", + /* 126 */ "SOFFSET", + /* 127 */ "WHERE", + /* 128 */ "NOW", + /* 129 */ "RESET", + /* 130 */ "QUERY", + /* 131 */ "ADD", + /* 132 */ "COLUMN", + /* 133 */ "TAG", + /* 134 */ "CHANGE", + /* 135 */ "SET", + /* 136 */ "KILL", + /* 137 */ "CONNECTION", + /* 138 */ "STREAM", + /* 139 */ "COLON", + /* 140 */ "ABORT", + /* 141 */ "AFTER", + /* 142 */ "ATTACH", + /* 143 */ "BEFORE", + /* 144 */ "BEGIN", + /* 145 */ "CASCADE", + /* 146 */ "CLUSTER", + /* 147 */ "CONFLICT", + /* 148 */ "COPY", + /* 149 */ "DEFERRED", + /* 150 */ "DELIMITERS", + /* 151 */ "DETACH", + /* 152 */ "EACH", + /* 153 */ "END", + /* 154 */ "EXPLAIN", + /* 155 */ "FAIL", + /* 156 */ "FOR", + /* 157 */ "IGNORE", + /* 158 */ "IMMEDIATE", + /* 159 */ "INITIALLY", + /* 160 */ "INSTEAD", + /* 161 */ "MATCH", + /* 162 */ "KEY", + /* 163 */ "OF", + /* 164 */ "RAISE", + /* 165 */ "REPLACE", + /* 166 */ "RESTRICT", + /* 167 */ "ROW", + /* 168 */ "STATEMENT", + /* 169 */ "TRIGGER", + /* 170 */ "VIEW", + /* 171 */ "COUNT", + /* 172 */ "SUM", + /* 173 */ "AVG", + /* 174 */ "MIN", + /* 175 */ "MAX", + /* 176 */ "FIRST", + /* 177 */ "LAST", + /* 178 */ "TOP", + /* 179 */ "BOTTOM", + /* 180 */ "STDDEV", + /* 181 */ "PERCENTILE", + /* 182 */ "APERCENTILE", + /* 183 */ "LEASTSQUARES", + /* 184 */ "HISTOGRAM", + /* 185 */ "DIFF", + /* 186 */ "SPREAD", + /* 187 */ "TWA", + /* 188 */ "INTERP", + /* 189 */ "LAST_ROW", + /* 190 */ "RATE", + /* 191 */ "IRATE", + /* 192 */ "SUM_RATE", + /* 193 */ "SUM_IRATE", + /* 194 */ "AVG_RATE", + /* 195 */ "AVG_IRATE", + /* 196 */ "TBID", + /* 197 */ "SEMI", + /* 198 */ "NONE", + /* 199 */ "PREV", + /* 200 */ "LINEAR", + /* 201 */ "IMPORT", + /* 202 */ "METRIC", + /* 203 */ "TBNAME", + /* 204 */ "JOIN", + /* 205 */ "METRICS", /* 206 */ "INSERT", /* 207 */ "INTO", /* 208 */ "VALUES", - /* 209 */ "error", - /* 210 */ "program", - /* 211 */ "cmd", - /* 212 */ "dbPrefix", - /* 213 */ "ids", - /* 214 */ "cpxName", - /* 215 */ "ifexists", - /* 216 */ "alter_db_optr", - /* 217 */ "acct_optr", - /* 218 */ "ifnotexists", - /* 219 */ "db_optr", - /* 220 */ "pps", - /* 221 */ "tseries", - /* 222 */ "dbs", - /* 223 */ "streams", - /* 224 */ "storage", - /* 225 */ "qtime", - /* 226 */ "users", - /* 227 */ "conns", - /* 228 */ "state", - /* 229 */ "keep", - /* 230 */ "tagitemlist", - /* 231 */ "cache", - /* 232 */ "replica", - /* 233 */ "quorum", - /* 234 */ "days", - /* 235 */ "minrows", - /* 236 */ "maxrows", - /* 237 */ "blocks", - /* 238 */ "ctime", - /* 239 */ "wal", - /* 240 */ "fsync", - /* 241 */ "comp", - /* 242 */ "prec", - /* 243 */ "update", - /* 244 */ "cachelast", - /* 245 */ "typename", - /* 246 */ "signed", - /* 247 */ "create_table_args", + /* 209 */ "program", + /* 210 */ "cmd", + /* 211 */ "dbPrefix", + /* 212 */ "ids", + /* 213 */ "cpxName", + /* 214 */ "ifexists", + /* 215 */ "alter_db_optr", + /* 216 */ "acct_optr", + /* 217 */ "ifnotexists", + /* 218 */ "db_optr", + /* 219 */ "pps", + /* 220 */ "tseries", + /* 221 */ "dbs", + /* 222 */ "streams", + /* 223 */ "storage", + /* 224 */ "qtime", + /* 225 */ "users", + /* 226 */ "conns", + /* 227 */ "state", + /* 228 */ "keep", + /* 229 */ "tagitemlist", + /* 230 */ "cache", + /* 231 */ "replica", + /* 232 */ "quorum", + /* 233 */ "days", + /* 234 */ "minrows", + /* 235 */ "maxrows", + /* 236 */ "blocks", + /* 237 */ "ctime", + /* 238 */ "wal", + /* 239 */ "fsync", + /* 240 */ "comp", + /* 241 */ "prec", + /* 242 */ "update", + /* 243 */ "cachelast", + /* 244 */ "typename", + /* 245 */ "signed", + /* 246 */ "create_table_args", + /* 247 */ "create_stable_args", /* 248 */ "create_table_list", /* 249 */ "create_from_stable", /* 250 */ "columnlist", @@ -1052,218 +1079,226 @@ static const char *const yyRuleName[] = { /* 25 */ "cmd ::= SHOW dbPrefix VGROUPS", /* 26 */ "cmd ::= SHOW dbPrefix VGROUPS ids", /* 27 */ "cmd ::= DROP TABLE ifexists ids cpxName", - /* 28 */ "cmd ::= DROP DATABASE ifexists ids", - /* 29 */ "cmd ::= DROP DNODE ids", - /* 30 */ "cmd ::= DROP USER ids", - /* 31 */ "cmd ::= DROP ACCOUNT ids", - /* 32 */ "cmd ::= USE ids", - /* 33 */ "cmd ::= DESCRIBE ids cpxName", - /* 34 */ "cmd ::= ALTER USER ids PASS ids", - /* 35 */ "cmd ::= ALTER USER ids PRIVILEGE ids", - /* 36 */ "cmd ::= ALTER DNODE ids ids", - /* 37 */ "cmd ::= ALTER DNODE ids ids ids", - /* 38 */ "cmd ::= ALTER LOCAL ids", - /* 39 */ "cmd ::= ALTER LOCAL ids ids", - /* 40 */ "cmd ::= ALTER DATABASE ids alter_db_optr", - /* 41 */ "cmd ::= ALTER ACCOUNT ids acct_optr", - /* 42 */ "cmd ::= ALTER ACCOUNT ids PASS ids acct_optr", - /* 43 */ "ids ::= ID", - /* 44 */ "ids ::= STRING", - /* 45 */ "ifexists ::= IF EXISTS", - /* 46 */ "ifexists ::=", - /* 47 */ "ifnotexists ::= IF NOT EXISTS", - /* 48 */ "ifnotexists ::=", - /* 49 */ "cmd ::= CREATE DNODE ids", - /* 50 */ "cmd ::= CREATE ACCOUNT ids PASS ids acct_optr", - /* 51 */ "cmd ::= CREATE DATABASE ifnotexists ids db_optr", - /* 52 */ "cmd ::= CREATE USER ids PASS ids", - /* 53 */ "pps ::=", - /* 54 */ "pps ::= PPS INTEGER", - /* 55 */ "tseries ::=", - /* 56 */ "tseries ::= TSERIES INTEGER", - /* 57 */ "dbs ::=", - /* 58 */ "dbs ::= DBS INTEGER", - /* 59 */ "streams ::=", - /* 60 */ "streams ::= STREAMS INTEGER", - /* 61 */ "storage ::=", - /* 62 */ "storage ::= STORAGE INTEGER", - /* 63 */ "qtime ::=", - /* 64 */ "qtime ::= QTIME INTEGER", - /* 65 */ "users ::=", - /* 66 */ "users ::= USERS INTEGER", - /* 67 */ "conns ::=", - /* 68 */ "conns ::= CONNS INTEGER", - /* 69 */ "state ::=", - /* 70 */ "state ::= STATE ids", - /* 71 */ "acct_optr ::= pps tseries storage streams qtime dbs users conns state", - /* 72 */ "keep ::= KEEP tagitemlist", - /* 73 */ "cache ::= CACHE INTEGER", - /* 74 */ "replica ::= REPLICA INTEGER", - /* 75 */ "quorum ::= QUORUM INTEGER", - /* 76 */ "days ::= DAYS INTEGER", - /* 77 */ "minrows ::= MINROWS INTEGER", - /* 78 */ "maxrows ::= MAXROWS INTEGER", - /* 79 */ "blocks ::= BLOCKS INTEGER", - /* 80 */ "ctime ::= CTIME INTEGER", - /* 81 */ "wal ::= WAL INTEGER", - /* 82 */ "fsync ::= FSYNC INTEGER", - /* 83 */ "comp ::= COMP INTEGER", - /* 84 */ "prec ::= PRECISION STRING", - /* 85 */ "update ::= UPDATE INTEGER", - /* 86 */ "cachelast ::= CACHELAST INTEGER", - /* 87 */ "db_optr ::=", - /* 88 */ "db_optr ::= db_optr cache", - /* 89 */ "db_optr ::= db_optr replica", - /* 90 */ "db_optr ::= db_optr quorum", - /* 91 */ "db_optr ::= db_optr days", - /* 92 */ "db_optr ::= db_optr minrows", - /* 93 */ "db_optr ::= db_optr maxrows", - /* 94 */ "db_optr ::= db_optr blocks", - /* 95 */ "db_optr ::= db_optr ctime", - /* 96 */ "db_optr ::= db_optr wal", - /* 97 */ "db_optr ::= db_optr fsync", - /* 98 */ "db_optr ::= db_optr comp", - /* 99 */ "db_optr ::= db_optr prec", - /* 100 */ "db_optr ::= db_optr keep", - /* 101 */ "db_optr ::= db_optr update", - /* 102 */ "db_optr ::= db_optr cachelast", - /* 103 */ "alter_db_optr ::=", - /* 104 */ "alter_db_optr ::= alter_db_optr replica", - /* 105 */ "alter_db_optr ::= alter_db_optr quorum", - /* 106 */ "alter_db_optr ::= alter_db_optr keep", - /* 107 */ "alter_db_optr ::= alter_db_optr blocks", - /* 108 */ "alter_db_optr ::= alter_db_optr comp", - /* 109 */ "alter_db_optr ::= alter_db_optr wal", - /* 110 */ "alter_db_optr ::= alter_db_optr fsync", - /* 111 */ "alter_db_optr ::= alter_db_optr update", - /* 112 */ "alter_db_optr ::= alter_db_optr cachelast", - /* 113 */ "typename ::= ids", - /* 114 */ "typename ::= ids LP signed RP", - /* 115 */ "typename ::= ids UNSIGNED", - /* 116 */ "signed ::= INTEGER", - /* 117 */ "signed ::= PLUS INTEGER", - /* 118 */ "signed ::= MINUS INTEGER", - /* 119 */ "cmd ::= CREATE TABLE create_table_args", - /* 120 */ "cmd ::= CREATE TABLE create_table_list", - /* 121 */ "create_table_list ::= create_from_stable", - /* 122 */ "create_table_list ::= create_table_list create_from_stable", - /* 123 */ "create_table_args ::= ifnotexists ids cpxName LP columnlist RP", - /* 124 */ "create_table_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP", - /* 125 */ "create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP", - /* 126 */ "create_table_args ::= ifnotexists ids cpxName AS select", - /* 127 */ "columnlist ::= columnlist COMMA column", - /* 128 */ "columnlist ::= column", - /* 129 */ "column ::= ids typename", - /* 130 */ "tagitemlist ::= tagitemlist COMMA tagitem", - /* 131 */ "tagitemlist ::= tagitem", - /* 132 */ "tagitem ::= INTEGER", - /* 133 */ "tagitem ::= FLOAT", - /* 134 */ "tagitem ::= STRING", - /* 135 */ "tagitem ::= BOOL", - /* 136 */ "tagitem ::= NULL", - /* 137 */ "tagitem ::= MINUS INTEGER", - /* 138 */ "tagitem ::= MINUS FLOAT", - /* 139 */ "tagitem ::= PLUS INTEGER", - /* 140 */ "tagitem ::= PLUS FLOAT", - /* 141 */ "select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt", - /* 142 */ "union ::= select", - /* 143 */ "union ::= LP union RP", - /* 144 */ "union ::= union UNION ALL select", - /* 145 */ "union ::= union UNION ALL LP select RP", - /* 146 */ "cmd ::= union", - /* 147 */ "select ::= SELECT selcollist", - /* 148 */ "sclp ::= selcollist COMMA", - /* 149 */ "sclp ::=", - /* 150 */ "selcollist ::= sclp expr as", - /* 151 */ "selcollist ::= sclp STAR", - /* 152 */ "as ::= AS ids", - /* 153 */ "as ::= ids", - /* 154 */ "as ::=", - /* 155 */ "from ::= FROM tablelist", - /* 156 */ "tablelist ::= ids cpxName", - /* 157 */ "tablelist ::= ids cpxName ids", - /* 158 */ "tablelist ::= tablelist COMMA ids cpxName", - /* 159 */ "tablelist ::= tablelist COMMA ids cpxName ids", - /* 160 */ "tmvar ::= VARIABLE", - /* 161 */ "interval_opt ::= INTERVAL LP tmvar RP", - /* 162 */ "interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP", - /* 163 */ "interval_opt ::=", - /* 164 */ "fill_opt ::=", - /* 165 */ "fill_opt ::= FILL LP ID COMMA tagitemlist RP", - /* 166 */ "fill_opt ::= FILL LP ID RP", - /* 167 */ "sliding_opt ::= SLIDING LP tmvar RP", - /* 168 */ "sliding_opt ::=", - /* 169 */ "orderby_opt ::=", - /* 170 */ "orderby_opt ::= ORDER BY sortlist", - /* 171 */ "sortlist ::= sortlist COMMA item sortorder", - /* 172 */ "sortlist ::= item sortorder", - /* 173 */ "item ::= ids cpxName", - /* 174 */ "sortorder ::= ASC", - /* 175 */ "sortorder ::= DESC", - /* 176 */ "sortorder ::=", - /* 177 */ "groupby_opt ::=", - /* 178 */ "groupby_opt ::= GROUP BY grouplist", - /* 179 */ "grouplist ::= grouplist COMMA item", - /* 180 */ "grouplist ::= item", - /* 181 */ "having_opt ::=", - /* 182 */ "having_opt ::= HAVING expr", - /* 183 */ "limit_opt ::=", - /* 184 */ "limit_opt ::= LIMIT signed", - /* 185 */ "limit_opt ::= LIMIT signed OFFSET signed", - /* 186 */ "limit_opt ::= LIMIT signed COMMA signed", - /* 187 */ "slimit_opt ::=", - /* 188 */ "slimit_opt ::= SLIMIT signed", - /* 189 */ "slimit_opt ::= SLIMIT signed SOFFSET signed", - /* 190 */ "slimit_opt ::= SLIMIT signed COMMA signed", - /* 191 */ "where_opt ::=", - /* 192 */ "where_opt ::= WHERE expr", - /* 193 */ "expr ::= LP expr RP", - /* 194 */ "expr ::= ID", - /* 195 */ "expr ::= ID DOT ID", - /* 196 */ "expr ::= ID DOT STAR", - /* 197 */ "expr ::= INTEGER", - /* 198 */ "expr ::= MINUS INTEGER", - /* 199 */ "expr ::= PLUS INTEGER", - /* 200 */ "expr ::= FLOAT", - /* 201 */ "expr ::= MINUS FLOAT", - /* 202 */ "expr ::= PLUS FLOAT", - /* 203 */ "expr ::= STRING", - /* 204 */ "expr ::= NOW", - /* 205 */ "expr ::= VARIABLE", - /* 206 */ "expr ::= BOOL", - /* 207 */ "expr ::= ID LP exprlist RP", - /* 208 */ "expr ::= ID LP STAR RP", - /* 209 */ "expr ::= expr IS NULL", - /* 210 */ "expr ::= expr IS NOT NULL", - /* 211 */ "expr ::= expr LT expr", - /* 212 */ "expr ::= expr GT expr", - /* 213 */ "expr ::= expr LE expr", - /* 214 */ "expr ::= expr GE expr", - /* 215 */ "expr ::= expr NE expr", - /* 216 */ "expr ::= expr EQ expr", - /* 217 */ "expr ::= expr AND expr", - /* 218 */ "expr ::= expr OR expr", - /* 219 */ "expr ::= expr PLUS expr", - /* 220 */ "expr ::= expr MINUS expr", - /* 221 */ "expr ::= expr STAR expr", - /* 222 */ "expr ::= expr SLASH expr", - /* 223 */ "expr ::= expr REM expr", - /* 224 */ "expr ::= expr LIKE expr", - /* 225 */ "expr ::= expr IN LP exprlist RP", - /* 226 */ "exprlist ::= exprlist COMMA expritem", - /* 227 */ "exprlist ::= expritem", - /* 228 */ "expritem ::= expr", - /* 229 */ "expritem ::=", - /* 230 */ "cmd ::= RESET QUERY CACHE", - /* 231 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist", - /* 232 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids", - /* 233 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist", - /* 234 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids", - /* 235 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids", - /* 236 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem", - /* 237 */ "cmd ::= KILL CONNECTION INTEGER", - /* 238 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER", - /* 239 */ "cmd ::= KILL QUERY INTEGER COLON INTEGER", + /* 28 */ "cmd ::= DROP STABLE ifexists ids cpxName", + /* 29 */ "cmd ::= DROP DATABASE ifexists ids", + /* 30 */ "cmd ::= DROP DNODE ids", + /* 31 */ "cmd ::= DROP USER ids", + /* 32 */ "cmd ::= DROP ACCOUNT ids", + /* 33 */ "cmd ::= USE ids", + /* 34 */ "cmd ::= DESCRIBE ids cpxName", + /* 35 */ "cmd ::= ALTER USER ids PASS ids", + /* 36 */ "cmd ::= ALTER USER ids PRIVILEGE ids", + /* 37 */ "cmd ::= ALTER DNODE ids ids", + /* 38 */ "cmd ::= ALTER DNODE ids ids ids", + /* 39 */ "cmd ::= ALTER LOCAL ids", + /* 40 */ "cmd ::= ALTER LOCAL ids ids", + /* 41 */ "cmd ::= ALTER DATABASE ids alter_db_optr", + /* 42 */ "cmd ::= ALTER ACCOUNT ids acct_optr", + /* 43 */ "cmd ::= ALTER ACCOUNT ids PASS ids acct_optr", + /* 44 */ "ids ::= ID", + /* 45 */ "ids ::= STRING", + /* 46 */ "ifexists ::= IF EXISTS", + /* 47 */ "ifexists ::=", + /* 48 */ "ifnotexists ::= IF NOT EXISTS", + /* 49 */ "ifnotexists ::=", + /* 50 */ "cmd ::= CREATE DNODE ids", + /* 51 */ "cmd ::= CREATE ACCOUNT ids PASS ids acct_optr", + /* 52 */ "cmd ::= CREATE DATABASE ifnotexists ids db_optr", + /* 53 */ "cmd ::= CREATE USER ids PASS ids", + /* 54 */ "pps ::=", + /* 55 */ "pps ::= PPS INTEGER", + /* 56 */ "tseries ::=", + /* 57 */ "tseries ::= TSERIES INTEGER", + /* 58 */ "dbs ::=", + /* 59 */ "dbs ::= DBS INTEGER", + /* 60 */ "streams ::=", + /* 61 */ "streams ::= STREAMS INTEGER", + /* 62 */ "storage ::=", + /* 63 */ "storage ::= STORAGE INTEGER", + /* 64 */ "qtime ::=", + /* 65 */ "qtime ::= QTIME INTEGER", + /* 66 */ "users ::=", + /* 67 */ "users ::= USERS INTEGER", + /* 68 */ "conns ::=", + /* 69 */ "conns ::= CONNS INTEGER", + /* 70 */ "state ::=", + /* 71 */ "state ::= STATE ids", + /* 72 */ "acct_optr ::= pps tseries storage streams qtime dbs users conns state", + /* 73 */ "keep ::= KEEP tagitemlist", + /* 74 */ "cache ::= CACHE INTEGER", + /* 75 */ "replica ::= REPLICA INTEGER", + /* 76 */ "quorum ::= QUORUM INTEGER", + /* 77 */ "days ::= DAYS INTEGER", + /* 78 */ "minrows ::= MINROWS INTEGER", + /* 79 */ "maxrows ::= MAXROWS INTEGER", + /* 80 */ "blocks ::= BLOCKS INTEGER", + /* 81 */ "ctime ::= CTIME INTEGER", + /* 82 */ "wal ::= WAL INTEGER", + /* 83 */ "fsync ::= FSYNC INTEGER", + /* 84 */ "comp ::= COMP INTEGER", + /* 85 */ "prec ::= PRECISION STRING", + /* 86 */ "update ::= UPDATE INTEGER", + /* 87 */ "cachelast ::= CACHELAST INTEGER", + /* 88 */ "db_optr ::=", + /* 89 */ "db_optr ::= db_optr cache", + /* 90 */ "db_optr ::= db_optr replica", + /* 91 */ "db_optr ::= db_optr quorum", + /* 92 */ "db_optr ::= db_optr days", + /* 93 */ "db_optr ::= db_optr minrows", + /* 94 */ "db_optr ::= db_optr maxrows", + /* 95 */ "db_optr ::= db_optr blocks", + /* 96 */ "db_optr ::= db_optr ctime", + /* 97 */ "db_optr ::= db_optr wal", + /* 98 */ "db_optr ::= db_optr fsync", + /* 99 */ "db_optr ::= db_optr comp", + /* 100 */ "db_optr ::= db_optr prec", + /* 101 */ "db_optr ::= db_optr keep", + /* 102 */ "db_optr ::= db_optr update", + /* 103 */ "db_optr ::= db_optr cachelast", + /* 104 */ "alter_db_optr ::=", + /* 105 */ "alter_db_optr ::= alter_db_optr replica", + /* 106 */ "alter_db_optr ::= alter_db_optr quorum", + /* 107 */ "alter_db_optr ::= alter_db_optr keep", + /* 108 */ "alter_db_optr ::= alter_db_optr blocks", + /* 109 */ "alter_db_optr ::= alter_db_optr comp", + /* 110 */ "alter_db_optr ::= alter_db_optr wal", + /* 111 */ "alter_db_optr ::= alter_db_optr fsync", + /* 112 */ "alter_db_optr ::= alter_db_optr update", + /* 113 */ "alter_db_optr ::= alter_db_optr cachelast", + /* 114 */ "typename ::= ids", + /* 115 */ "typename ::= ids LP signed RP", + /* 116 */ "typename ::= ids UNSIGNED", + /* 117 */ "signed ::= INTEGER", + /* 118 */ "signed ::= PLUS INTEGER", + /* 119 */ "signed ::= MINUS INTEGER", + /* 120 */ "cmd ::= CREATE TABLE create_table_args", + /* 121 */ "cmd ::= CREATE TABLE create_stable_args", + /* 122 */ "cmd ::= CREATE STABLE create_stable_args", + /* 123 */ "cmd ::= CREATE TABLE create_table_list", + /* 124 */ "create_table_list ::= create_from_stable", + /* 125 */ "create_table_list ::= create_table_list create_from_stable", + /* 126 */ "create_table_args ::= ifnotexists ids cpxName LP columnlist RP", + /* 127 */ "create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP", + /* 128 */ "create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP", + /* 129 */ "create_table_args ::= ifnotexists ids cpxName AS select", + /* 130 */ "columnlist ::= columnlist COMMA column", + /* 131 */ "columnlist ::= column", + /* 132 */ "column ::= ids typename", + /* 133 */ "tagitemlist ::= tagitemlist COMMA tagitem", + /* 134 */ "tagitemlist ::= tagitem", + /* 135 */ "tagitem ::= INTEGER", + /* 136 */ "tagitem ::= FLOAT", + /* 137 */ "tagitem ::= STRING", + /* 138 */ "tagitem ::= BOOL", + /* 139 */ "tagitem ::= NULL", + /* 140 */ "tagitem ::= MINUS INTEGER", + /* 141 */ "tagitem ::= MINUS FLOAT", + /* 142 */ "tagitem ::= PLUS INTEGER", + /* 143 */ "tagitem ::= PLUS FLOAT", + /* 144 */ "select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt", + /* 145 */ "union ::= select", + /* 146 */ "union ::= LP union RP", + /* 147 */ "union ::= union UNION ALL select", + /* 148 */ "union ::= union UNION ALL LP select RP", + /* 149 */ "cmd ::= union", + /* 150 */ "select ::= SELECT selcollist", + /* 151 */ "sclp ::= selcollist COMMA", + /* 152 */ "sclp ::=", + /* 153 */ "selcollist ::= sclp expr as", + /* 154 */ "selcollist ::= sclp STAR", + /* 155 */ "as ::= AS ids", + /* 156 */ "as ::= ids", + /* 157 */ "as ::=", + /* 158 */ "from ::= FROM tablelist", + /* 159 */ "tablelist ::= ids cpxName", + /* 160 */ "tablelist ::= ids cpxName ids", + /* 161 */ "tablelist ::= tablelist COMMA ids cpxName", + /* 162 */ "tablelist ::= tablelist COMMA ids cpxName ids", + /* 163 */ "tmvar ::= VARIABLE", + /* 164 */ "interval_opt ::= INTERVAL LP tmvar RP", + /* 165 */ "interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP", + /* 166 */ "interval_opt ::=", + /* 167 */ "fill_opt ::=", + /* 168 */ "fill_opt ::= FILL LP ID COMMA tagitemlist RP", + /* 169 */ "fill_opt ::= FILL LP ID RP", + /* 170 */ "sliding_opt ::= SLIDING LP tmvar RP", + /* 171 */ "sliding_opt ::=", + /* 172 */ "orderby_opt ::=", + /* 173 */ "orderby_opt ::= ORDER BY sortlist", + /* 174 */ "sortlist ::= sortlist COMMA item sortorder", + /* 175 */ "sortlist ::= item sortorder", + /* 176 */ "item ::= ids cpxName", + /* 177 */ "sortorder ::= ASC", + /* 178 */ "sortorder ::= DESC", + /* 179 */ "sortorder ::=", + /* 180 */ "groupby_opt ::=", + /* 181 */ "groupby_opt ::= GROUP BY grouplist", + /* 182 */ "grouplist ::= grouplist COMMA item", + /* 183 */ "grouplist ::= item", + /* 184 */ "having_opt ::=", + /* 185 */ "having_opt ::= HAVING expr", + /* 186 */ "limit_opt ::=", + /* 187 */ "limit_opt ::= LIMIT signed", + /* 188 */ "limit_opt ::= LIMIT signed OFFSET signed", + /* 189 */ "limit_opt ::= LIMIT signed COMMA signed", + /* 190 */ "slimit_opt ::=", + /* 191 */ "slimit_opt ::= SLIMIT signed", + /* 192 */ "slimit_opt ::= SLIMIT signed SOFFSET signed", + /* 193 */ "slimit_opt ::= SLIMIT signed COMMA signed", + /* 194 */ "where_opt ::=", + /* 195 */ "where_opt ::= WHERE expr", + /* 196 */ "expr ::= LP expr RP", + /* 197 */ "expr ::= ID", + /* 198 */ "expr ::= ID DOT ID", + /* 199 */ "expr ::= ID DOT STAR", + /* 200 */ "expr ::= INTEGER", + /* 201 */ "expr ::= MINUS INTEGER", + /* 202 */ "expr ::= PLUS INTEGER", + /* 203 */ "expr ::= FLOAT", + /* 204 */ "expr ::= MINUS FLOAT", + /* 205 */ "expr ::= PLUS FLOAT", + /* 206 */ "expr ::= STRING", + /* 207 */ "expr ::= NOW", + /* 208 */ "expr ::= VARIABLE", + /* 209 */ "expr ::= BOOL", + /* 210 */ "expr ::= ID LP exprlist RP", + /* 211 */ "expr ::= ID LP STAR RP", + /* 212 */ "expr ::= expr IS NULL", + /* 213 */ "expr ::= expr IS NOT NULL", + /* 214 */ "expr ::= expr LT expr", + /* 215 */ "expr ::= expr GT expr", + /* 216 */ "expr ::= expr LE expr", + /* 217 */ "expr ::= expr GE expr", + /* 218 */ "expr ::= expr NE expr", + /* 219 */ "expr ::= expr EQ expr", + /* 220 */ "expr ::= expr AND expr", + /* 221 */ "expr ::= expr OR expr", + /* 222 */ "expr ::= expr PLUS expr", + /* 223 */ "expr ::= expr MINUS expr", + /* 224 */ "expr ::= expr STAR expr", + /* 225 */ "expr ::= expr SLASH expr", + /* 226 */ "expr ::= expr REM expr", + /* 227 */ "expr ::= expr LIKE expr", + /* 228 */ "expr ::= expr IN LP exprlist RP", + /* 229 */ "exprlist ::= exprlist COMMA expritem", + /* 230 */ "exprlist ::= expritem", + /* 231 */ "expritem ::= expr", + /* 232 */ "expritem ::=", + /* 233 */ "cmd ::= RESET QUERY CACHE", + /* 234 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist", + /* 235 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids", + /* 236 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist", + /* 237 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids", + /* 238 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids", + /* 239 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem", + /* 240 */ "cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist", + /* 241 */ "cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids", + /* 242 */ "cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist", + /* 243 */ "cmd ::= ALTER STABLE ids cpxName DROP TAG ids", + /* 244 */ "cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids", + /* 245 */ "cmd ::= KILL CONNECTION INTEGER", + /* 246 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER", + /* 247 */ "cmd ::= KILL QUERY INTEGER COLON INTEGER", }; #endif /* NDEBUG */ @@ -1312,28 +1347,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 } @@ -1350,11 +1386,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 */ @@ -1371,7 +1410,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 @@ -1384,8 +1424,8 @@ static void yy_destructor( ** inside the C code. */ /********* Begin destructor definitions ***************************************/ - case 229: /* keep */ - case 230: /* tagitemlist */ + case 228: /* keep */ + case 229: /* tagitemlist */ case 250: /* columnlist */ case 258: /* fill_opt */ case 260: /* groupby_opt */ @@ -1540,13 +1580,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) @@ -1554,15 +1593,19 @@ 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<=YY_ACTTAB_COUNT ); + assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD ); assert( iLookAhead!=YYNOCODE ); assert( iLookAhead < YYNTOKEN ); i += iLookAhead; + assert( i<(int)YY_NLOOKAHEAD ); if( yy_lookahead[i]!=iLookAhead ){ #ifdef YYFALLBACK YYCODETYPE iFallback; /* Fallback token */ - if( iLookAhead %s\n", @@ -1577,15 +1620,8 @@ static unsigned int yy_find_shift_action( #ifdef YYWILDCARD { int j = i - iLookAhead + YYWILDCARD; - if( -#if YY_SHIFT_MIN+YYWILDCARD<0 - j>=0 && -#endif -#if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT - j0 - ){ + assert( j<(int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])) ); + if( yy_lookahead[j]==YYWILDCARD && iLookAhead>0 ){ #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n", @@ -1599,6 +1635,7 @@ static unsigned int yy_find_shift_action( #endif /* YYWILDCARD */ return yy_default[stateno]; }else{ + assert( i>=0 && iyytos; - yytos->stateno = (YYACTIONTYPE)yyNewState; - yytos->major = (YYCODETYPE)yyMajor; + yytos->stateno = yyNewState; + yytos->major = yyMajor; yytos->minor.yy0 = yyMinor; yyTraceShift(yypParser, yyNewState, "Shift"); } -/* The following table contains information about every rule that -** is used during the reduce. -*/ -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[] = { - { 210, -1 }, /* (0) program ::= cmd */ - { 211, -2 }, /* (1) cmd ::= SHOW DATABASES */ - { 211, -2 }, /* (2) cmd ::= SHOW MNODES */ - { 211, -2 }, /* (3) cmd ::= SHOW DNODES */ - { 211, -2 }, /* (4) cmd ::= SHOW ACCOUNTS */ - { 211, -2 }, /* (5) cmd ::= SHOW USERS */ - { 211, -2 }, /* (6) cmd ::= SHOW MODULES */ - { 211, -2 }, /* (7) cmd ::= SHOW QUERIES */ - { 211, -2 }, /* (8) cmd ::= SHOW CONNECTIONS */ - { 211, -2 }, /* (9) cmd ::= SHOW STREAMS */ - { 211, -2 }, /* (10) cmd ::= SHOW VARIABLES */ - { 211, -2 }, /* (11) cmd ::= SHOW SCORES */ - { 211, -2 }, /* (12) cmd ::= SHOW GRANTS */ - { 211, -2 }, /* (13) cmd ::= SHOW VNODES */ - { 211, -3 }, /* (14) cmd ::= SHOW VNODES IPTOKEN */ - { 212, 0 }, /* (15) dbPrefix ::= */ - { 212, -2 }, /* (16) dbPrefix ::= ids DOT */ - { 214, 0 }, /* (17) cpxName ::= */ - { 214, -2 }, /* (18) cpxName ::= DOT ids */ - { 211, -5 }, /* (19) cmd ::= SHOW CREATE TABLE ids cpxName */ - { 211, -4 }, /* (20) cmd ::= SHOW CREATE DATABASE ids */ - { 211, -3 }, /* (21) cmd ::= SHOW dbPrefix TABLES */ - { 211, -5 }, /* (22) cmd ::= SHOW dbPrefix TABLES LIKE ids */ - { 211, -3 }, /* (23) cmd ::= SHOW dbPrefix STABLES */ - { 211, -5 }, /* (24) cmd ::= SHOW dbPrefix STABLES LIKE ids */ - { 211, -3 }, /* (25) cmd ::= SHOW dbPrefix VGROUPS */ - { 211, -4 }, /* (26) cmd ::= SHOW dbPrefix VGROUPS ids */ - { 211, -5 }, /* (27) cmd ::= DROP TABLE ifexists ids cpxName */ - { 211, -4 }, /* (28) cmd ::= DROP DATABASE ifexists ids */ - { 211, -3 }, /* (29) cmd ::= DROP DNODE ids */ - { 211, -3 }, /* (30) cmd ::= DROP USER ids */ - { 211, -3 }, /* (31) cmd ::= DROP ACCOUNT ids */ - { 211, -2 }, /* (32) cmd ::= USE ids */ - { 211, -3 }, /* (33) cmd ::= DESCRIBE ids cpxName */ - { 211, -5 }, /* (34) cmd ::= ALTER USER ids PASS ids */ - { 211, -5 }, /* (35) cmd ::= ALTER USER ids PRIVILEGE ids */ - { 211, -4 }, /* (36) cmd ::= ALTER DNODE ids ids */ - { 211, -5 }, /* (37) cmd ::= ALTER DNODE ids ids ids */ - { 211, -3 }, /* (38) cmd ::= ALTER LOCAL ids */ - { 211, -4 }, /* (39) cmd ::= ALTER LOCAL ids ids */ - { 211, -4 }, /* (40) cmd ::= ALTER DATABASE ids alter_db_optr */ - { 211, -4 }, /* (41) cmd ::= ALTER ACCOUNT ids acct_optr */ - { 211, -6 }, /* (42) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ - { 213, -1 }, /* (43) ids ::= ID */ - { 213, -1 }, /* (44) ids ::= STRING */ - { 215, -2 }, /* (45) ifexists ::= IF EXISTS */ - { 215, 0 }, /* (46) ifexists ::= */ - { 218, -3 }, /* (47) ifnotexists ::= IF NOT EXISTS */ - { 218, 0 }, /* (48) ifnotexists ::= */ - { 211, -3 }, /* (49) cmd ::= CREATE DNODE ids */ - { 211, -6 }, /* (50) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ - { 211, -5 }, /* (51) cmd ::= CREATE DATABASE ifnotexists ids db_optr */ - { 211, -5 }, /* (52) cmd ::= CREATE USER ids PASS ids */ - { 220, 0 }, /* (53) pps ::= */ - { 220, -2 }, /* (54) pps ::= PPS INTEGER */ - { 221, 0 }, /* (55) tseries ::= */ - { 221, -2 }, /* (56) tseries ::= TSERIES INTEGER */ - { 222, 0 }, /* (57) dbs ::= */ - { 222, -2 }, /* (58) dbs ::= DBS INTEGER */ - { 223, 0 }, /* (59) streams ::= */ - { 223, -2 }, /* (60) streams ::= STREAMS INTEGER */ - { 224, 0 }, /* (61) storage ::= */ - { 224, -2 }, /* (62) storage ::= STORAGE INTEGER */ - { 225, 0 }, /* (63) qtime ::= */ - { 225, -2 }, /* (64) qtime ::= QTIME INTEGER */ - { 226, 0 }, /* (65) users ::= */ - { 226, -2 }, /* (66) users ::= USERS INTEGER */ - { 227, 0 }, /* (67) conns ::= */ - { 227, -2 }, /* (68) conns ::= CONNS INTEGER */ - { 228, 0 }, /* (69) state ::= */ - { 228, -2 }, /* (70) state ::= STATE ids */ - { 217, -9 }, /* (71) acct_optr ::= pps tseries storage streams qtime dbs users conns state */ - { 229, -2 }, /* (72) keep ::= KEEP tagitemlist */ - { 231, -2 }, /* (73) cache ::= CACHE INTEGER */ - { 232, -2 }, /* (74) replica ::= REPLICA INTEGER */ - { 233, -2 }, /* (75) quorum ::= QUORUM INTEGER */ - { 234, -2 }, /* (76) days ::= DAYS INTEGER */ - { 235, -2 }, /* (77) minrows ::= MINROWS INTEGER */ - { 236, -2 }, /* (78) maxrows ::= MAXROWS INTEGER */ - { 237, -2 }, /* (79) blocks ::= BLOCKS INTEGER */ - { 238, -2 }, /* (80) ctime ::= CTIME INTEGER */ - { 239, -2 }, /* (81) wal ::= WAL INTEGER */ - { 240, -2 }, /* (82) fsync ::= FSYNC INTEGER */ - { 241, -2 }, /* (83) comp ::= COMP INTEGER */ - { 242, -2 }, /* (84) prec ::= PRECISION STRING */ - { 243, -2 }, /* (85) update ::= UPDATE INTEGER */ - { 244, -2 }, /* (86) cachelast ::= CACHELAST INTEGER */ - { 219, 0 }, /* (87) db_optr ::= */ - { 219, -2 }, /* (88) db_optr ::= db_optr cache */ - { 219, -2 }, /* (89) db_optr ::= db_optr replica */ - { 219, -2 }, /* (90) db_optr ::= db_optr quorum */ - { 219, -2 }, /* (91) db_optr ::= db_optr days */ - { 219, -2 }, /* (92) db_optr ::= db_optr minrows */ - { 219, -2 }, /* (93) db_optr ::= db_optr maxrows */ - { 219, -2 }, /* (94) db_optr ::= db_optr blocks */ - { 219, -2 }, /* (95) db_optr ::= db_optr ctime */ - { 219, -2 }, /* (96) db_optr ::= db_optr wal */ - { 219, -2 }, /* (97) db_optr ::= db_optr fsync */ - { 219, -2 }, /* (98) db_optr ::= db_optr comp */ - { 219, -2 }, /* (99) db_optr ::= db_optr prec */ - { 219, -2 }, /* (100) db_optr ::= db_optr keep */ - { 219, -2 }, /* (101) db_optr ::= db_optr update */ - { 219, -2 }, /* (102) db_optr ::= db_optr cachelast */ - { 216, 0 }, /* (103) alter_db_optr ::= */ - { 216, -2 }, /* (104) alter_db_optr ::= alter_db_optr replica */ - { 216, -2 }, /* (105) alter_db_optr ::= alter_db_optr quorum */ - { 216, -2 }, /* (106) alter_db_optr ::= alter_db_optr keep */ - { 216, -2 }, /* (107) alter_db_optr ::= alter_db_optr blocks */ - { 216, -2 }, /* (108) alter_db_optr ::= alter_db_optr comp */ - { 216, -2 }, /* (109) alter_db_optr ::= alter_db_optr wal */ - { 216, -2 }, /* (110) alter_db_optr ::= alter_db_optr fsync */ - { 216, -2 }, /* (111) alter_db_optr ::= alter_db_optr update */ - { 216, -2 }, /* (112) alter_db_optr ::= alter_db_optr cachelast */ - { 245, -1 }, /* (113) typename ::= ids */ - { 245, -4 }, /* (114) typename ::= ids LP signed RP */ - { 245, -2 }, /* (115) typename ::= ids UNSIGNED */ - { 246, -1 }, /* (116) signed ::= INTEGER */ - { 246, -2 }, /* (117) signed ::= PLUS INTEGER */ - { 246, -2 }, /* (118) signed ::= MINUS INTEGER */ - { 211, -3 }, /* (119) cmd ::= CREATE TABLE create_table_args */ - { 211, -3 }, /* (120) cmd ::= CREATE TABLE create_table_list */ - { 248, -1 }, /* (121) create_table_list ::= create_from_stable */ - { 248, -2 }, /* (122) create_table_list ::= create_table_list create_from_stable */ - { 247, -6 }, /* (123) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ - { 247, -10 }, /* (124) create_table_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ - { 249, -10 }, /* (125) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ - { 247, -5 }, /* (126) create_table_args ::= ifnotexists ids cpxName AS select */ - { 250, -3 }, /* (127) columnlist ::= columnlist COMMA column */ - { 250, -1 }, /* (128) columnlist ::= column */ - { 252, -2 }, /* (129) column ::= ids typename */ - { 230, -3 }, /* (130) tagitemlist ::= tagitemlist COMMA tagitem */ - { 230, -1 }, /* (131) tagitemlist ::= tagitem */ - { 253, -1 }, /* (132) tagitem ::= INTEGER */ - { 253, -1 }, /* (133) tagitem ::= FLOAT */ - { 253, -1 }, /* (134) tagitem ::= STRING */ - { 253, -1 }, /* (135) tagitem ::= BOOL */ - { 253, -1 }, /* (136) tagitem ::= NULL */ - { 253, -2 }, /* (137) tagitem ::= MINUS INTEGER */ - { 253, -2 }, /* (138) tagitem ::= MINUS FLOAT */ - { 253, -2 }, /* (139) tagitem ::= PLUS INTEGER */ - { 253, -2 }, /* (140) tagitem ::= PLUS FLOAT */ - { 251, -12 }, /* (141) select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */ - { 265, -1 }, /* (142) union ::= select */ - { 265, -3 }, /* (143) union ::= LP union RP */ - { 265, -4 }, /* (144) union ::= union UNION ALL select */ - { 265, -6 }, /* (145) union ::= union UNION ALL LP select RP */ - { 211, -1 }, /* (146) cmd ::= union */ - { 251, -2 }, /* (147) select ::= SELECT selcollist */ - { 266, -2 }, /* (148) sclp ::= selcollist COMMA */ - { 266, 0 }, /* (149) sclp ::= */ - { 254, -3 }, /* (150) selcollist ::= sclp expr as */ - { 254, -2 }, /* (151) selcollist ::= sclp STAR */ - { 268, -2 }, /* (152) as ::= AS ids */ - { 268, -1 }, /* (153) as ::= ids */ - { 268, 0 }, /* (154) as ::= */ - { 255, -2 }, /* (155) from ::= FROM tablelist */ - { 269, -2 }, /* (156) tablelist ::= ids cpxName */ - { 269, -3 }, /* (157) tablelist ::= ids cpxName ids */ - { 269, -4 }, /* (158) tablelist ::= tablelist COMMA ids cpxName */ - { 269, -5 }, /* (159) tablelist ::= tablelist COMMA ids cpxName ids */ - { 270, -1 }, /* (160) tmvar ::= VARIABLE */ - { 257, -4 }, /* (161) interval_opt ::= INTERVAL LP tmvar RP */ - { 257, -6 }, /* (162) interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */ - { 257, 0 }, /* (163) interval_opt ::= */ - { 258, 0 }, /* (164) fill_opt ::= */ - { 258, -6 }, /* (165) fill_opt ::= FILL LP ID COMMA tagitemlist RP */ - { 258, -4 }, /* (166) fill_opt ::= FILL LP ID RP */ - { 259, -4 }, /* (167) sliding_opt ::= SLIDING LP tmvar RP */ - { 259, 0 }, /* (168) sliding_opt ::= */ - { 261, 0 }, /* (169) orderby_opt ::= */ - { 261, -3 }, /* (170) orderby_opt ::= ORDER BY sortlist */ - { 271, -4 }, /* (171) sortlist ::= sortlist COMMA item sortorder */ - { 271, -2 }, /* (172) sortlist ::= item sortorder */ - { 273, -2 }, /* (173) item ::= ids cpxName */ - { 274, -1 }, /* (174) sortorder ::= ASC */ - { 274, -1 }, /* (175) sortorder ::= DESC */ - { 274, 0 }, /* (176) sortorder ::= */ - { 260, 0 }, /* (177) groupby_opt ::= */ - { 260, -3 }, /* (178) groupby_opt ::= GROUP BY grouplist */ - { 275, -3 }, /* (179) grouplist ::= grouplist COMMA item */ - { 275, -1 }, /* (180) grouplist ::= item */ - { 262, 0 }, /* (181) having_opt ::= */ - { 262, -2 }, /* (182) having_opt ::= HAVING expr */ - { 264, 0 }, /* (183) limit_opt ::= */ - { 264, -2 }, /* (184) limit_opt ::= LIMIT signed */ - { 264, -4 }, /* (185) limit_opt ::= LIMIT signed OFFSET signed */ - { 264, -4 }, /* (186) limit_opt ::= LIMIT signed COMMA signed */ - { 263, 0 }, /* (187) slimit_opt ::= */ - { 263, -2 }, /* (188) slimit_opt ::= SLIMIT signed */ - { 263, -4 }, /* (189) slimit_opt ::= SLIMIT signed SOFFSET signed */ - { 263, -4 }, /* (190) slimit_opt ::= SLIMIT signed COMMA signed */ - { 256, 0 }, /* (191) where_opt ::= */ - { 256, -2 }, /* (192) where_opt ::= WHERE expr */ - { 267, -3 }, /* (193) expr ::= LP expr RP */ - { 267, -1 }, /* (194) expr ::= ID */ - { 267, -3 }, /* (195) expr ::= ID DOT ID */ - { 267, -3 }, /* (196) expr ::= ID DOT STAR */ - { 267, -1 }, /* (197) expr ::= INTEGER */ - { 267, -2 }, /* (198) expr ::= MINUS INTEGER */ - { 267, -2 }, /* (199) expr ::= PLUS INTEGER */ - { 267, -1 }, /* (200) expr ::= FLOAT */ - { 267, -2 }, /* (201) expr ::= MINUS FLOAT */ - { 267, -2 }, /* (202) expr ::= PLUS FLOAT */ - { 267, -1 }, /* (203) expr ::= STRING */ - { 267, -1 }, /* (204) expr ::= NOW */ - { 267, -1 }, /* (205) expr ::= VARIABLE */ - { 267, -1 }, /* (206) expr ::= BOOL */ - { 267, -4 }, /* (207) expr ::= ID LP exprlist RP */ - { 267, -4 }, /* (208) expr ::= ID LP STAR RP */ - { 267, -3 }, /* (209) expr ::= expr IS NULL */ - { 267, -4 }, /* (210) expr ::= expr IS NOT NULL */ - { 267, -3 }, /* (211) expr ::= expr LT expr */ - { 267, -3 }, /* (212) expr ::= expr GT expr */ - { 267, -3 }, /* (213) expr ::= expr LE expr */ - { 267, -3 }, /* (214) expr ::= expr GE expr */ - { 267, -3 }, /* (215) expr ::= expr NE expr */ - { 267, -3 }, /* (216) expr ::= expr EQ expr */ - { 267, -3 }, /* (217) expr ::= expr AND expr */ - { 267, -3 }, /* (218) expr ::= expr OR expr */ - { 267, -3 }, /* (219) expr ::= expr PLUS expr */ - { 267, -3 }, /* (220) expr ::= expr MINUS expr */ - { 267, -3 }, /* (221) expr ::= expr STAR expr */ - { 267, -3 }, /* (222) expr ::= expr SLASH expr */ - { 267, -3 }, /* (223) expr ::= expr REM expr */ - { 267, -3 }, /* (224) expr ::= expr LIKE expr */ - { 267, -5 }, /* (225) expr ::= expr IN LP exprlist RP */ - { 276, -3 }, /* (226) exprlist ::= exprlist COMMA expritem */ - { 276, -1 }, /* (227) exprlist ::= expritem */ - { 277, -1 }, /* (228) expritem ::= expr */ - { 277, 0 }, /* (229) expritem ::= */ - { 211, -3 }, /* (230) cmd ::= RESET QUERY CACHE */ - { 211, -7 }, /* (231) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ - { 211, -7 }, /* (232) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ - { 211, -7 }, /* (233) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ - { 211, -7 }, /* (234) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ - { 211, -8 }, /* (235) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ - { 211, -9 }, /* (236) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ - { 211, -3 }, /* (237) cmd ::= KILL CONNECTION INTEGER */ - { 211, -5 }, /* (238) cmd ::= KILL STREAM INTEGER COLON INTEGER */ - { 211, -5 }, /* (239) cmd ::= KILL QUERY INTEGER COLON INTEGER */ +/* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side +** of that rule */ +static const YYCODETYPE yyRuleInfoLhs[] = { + 209, /* (0) program ::= cmd */ + 210, /* (1) cmd ::= SHOW DATABASES */ + 210, /* (2) cmd ::= SHOW MNODES */ + 210, /* (3) cmd ::= SHOW DNODES */ + 210, /* (4) cmd ::= SHOW ACCOUNTS */ + 210, /* (5) cmd ::= SHOW USERS */ + 210, /* (6) cmd ::= SHOW MODULES */ + 210, /* (7) cmd ::= SHOW QUERIES */ + 210, /* (8) cmd ::= SHOW CONNECTIONS */ + 210, /* (9) cmd ::= SHOW STREAMS */ + 210, /* (10) cmd ::= SHOW VARIABLES */ + 210, /* (11) cmd ::= SHOW SCORES */ + 210, /* (12) cmd ::= SHOW GRANTS */ + 210, /* (13) cmd ::= SHOW VNODES */ + 210, /* (14) cmd ::= SHOW VNODES IPTOKEN */ + 211, /* (15) dbPrefix ::= */ + 211, /* (16) dbPrefix ::= ids DOT */ + 213, /* (17) cpxName ::= */ + 213, /* (18) cpxName ::= DOT ids */ + 210, /* (19) cmd ::= SHOW CREATE TABLE ids cpxName */ + 210, /* (20) cmd ::= SHOW CREATE DATABASE ids */ + 210, /* (21) cmd ::= SHOW dbPrefix TABLES */ + 210, /* (22) cmd ::= SHOW dbPrefix TABLES LIKE ids */ + 210, /* (23) cmd ::= SHOW dbPrefix STABLES */ + 210, /* (24) cmd ::= SHOW dbPrefix STABLES LIKE ids */ + 210, /* (25) cmd ::= SHOW dbPrefix VGROUPS */ + 210, /* (26) cmd ::= SHOW dbPrefix VGROUPS ids */ + 210, /* (27) cmd ::= DROP TABLE ifexists ids cpxName */ + 210, /* (28) cmd ::= DROP STABLE ifexists ids cpxName */ + 210, /* (29) cmd ::= DROP DATABASE ifexists ids */ + 210, /* (30) cmd ::= DROP DNODE ids */ + 210, /* (31) cmd ::= DROP USER ids */ + 210, /* (32) cmd ::= DROP ACCOUNT ids */ + 210, /* (33) cmd ::= USE ids */ + 210, /* (34) cmd ::= DESCRIBE ids cpxName */ + 210, /* (35) cmd ::= ALTER USER ids PASS ids */ + 210, /* (36) cmd ::= ALTER USER ids PRIVILEGE ids */ + 210, /* (37) cmd ::= ALTER DNODE ids ids */ + 210, /* (38) cmd ::= ALTER DNODE ids ids ids */ + 210, /* (39) cmd ::= ALTER LOCAL ids */ + 210, /* (40) cmd ::= ALTER LOCAL ids ids */ + 210, /* (41) cmd ::= ALTER DATABASE ids alter_db_optr */ + 210, /* (42) cmd ::= ALTER ACCOUNT ids acct_optr */ + 210, /* (43) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ + 212, /* (44) ids ::= ID */ + 212, /* (45) ids ::= STRING */ + 214, /* (46) ifexists ::= IF EXISTS */ + 214, /* (47) ifexists ::= */ + 217, /* (48) ifnotexists ::= IF NOT EXISTS */ + 217, /* (49) ifnotexists ::= */ + 210, /* (50) cmd ::= CREATE DNODE ids */ + 210, /* (51) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ + 210, /* (52) cmd ::= CREATE DATABASE ifnotexists ids db_optr */ + 210, /* (53) cmd ::= CREATE USER ids PASS ids */ + 219, /* (54) pps ::= */ + 219, /* (55) pps ::= PPS INTEGER */ + 220, /* (56) tseries ::= */ + 220, /* (57) tseries ::= TSERIES INTEGER */ + 221, /* (58) dbs ::= */ + 221, /* (59) dbs ::= DBS INTEGER */ + 222, /* (60) streams ::= */ + 222, /* (61) streams ::= STREAMS INTEGER */ + 223, /* (62) storage ::= */ + 223, /* (63) storage ::= STORAGE INTEGER */ + 224, /* (64) qtime ::= */ + 224, /* (65) qtime ::= QTIME INTEGER */ + 225, /* (66) users ::= */ + 225, /* (67) users ::= USERS INTEGER */ + 226, /* (68) conns ::= */ + 226, /* (69) conns ::= CONNS INTEGER */ + 227, /* (70) state ::= */ + 227, /* (71) state ::= STATE ids */ + 216, /* (72) acct_optr ::= pps tseries storage streams qtime dbs users conns state */ + 228, /* (73) keep ::= KEEP tagitemlist */ + 230, /* (74) cache ::= CACHE INTEGER */ + 231, /* (75) replica ::= REPLICA INTEGER */ + 232, /* (76) quorum ::= QUORUM INTEGER */ + 233, /* (77) days ::= DAYS INTEGER */ + 234, /* (78) minrows ::= MINROWS INTEGER */ + 235, /* (79) maxrows ::= MAXROWS INTEGER */ + 236, /* (80) blocks ::= BLOCKS INTEGER */ + 237, /* (81) ctime ::= CTIME INTEGER */ + 238, /* (82) wal ::= WAL INTEGER */ + 239, /* (83) fsync ::= FSYNC INTEGER */ + 240, /* (84) comp ::= COMP INTEGER */ + 241, /* (85) prec ::= PRECISION STRING */ + 242, /* (86) update ::= UPDATE INTEGER */ + 243, /* (87) cachelast ::= CACHELAST INTEGER */ + 218, /* (88) db_optr ::= */ + 218, /* (89) db_optr ::= db_optr cache */ + 218, /* (90) db_optr ::= db_optr replica */ + 218, /* (91) db_optr ::= db_optr quorum */ + 218, /* (92) db_optr ::= db_optr days */ + 218, /* (93) db_optr ::= db_optr minrows */ + 218, /* (94) db_optr ::= db_optr maxrows */ + 218, /* (95) db_optr ::= db_optr blocks */ + 218, /* (96) db_optr ::= db_optr ctime */ + 218, /* (97) db_optr ::= db_optr wal */ + 218, /* (98) db_optr ::= db_optr fsync */ + 218, /* (99) db_optr ::= db_optr comp */ + 218, /* (100) db_optr ::= db_optr prec */ + 218, /* (101) db_optr ::= db_optr keep */ + 218, /* (102) db_optr ::= db_optr update */ + 218, /* (103) db_optr ::= db_optr cachelast */ + 215, /* (104) alter_db_optr ::= */ + 215, /* (105) alter_db_optr ::= alter_db_optr replica */ + 215, /* (106) alter_db_optr ::= alter_db_optr quorum */ + 215, /* (107) alter_db_optr ::= alter_db_optr keep */ + 215, /* (108) alter_db_optr ::= alter_db_optr blocks */ + 215, /* (109) alter_db_optr ::= alter_db_optr comp */ + 215, /* (110) alter_db_optr ::= alter_db_optr wal */ + 215, /* (111) alter_db_optr ::= alter_db_optr fsync */ + 215, /* (112) alter_db_optr ::= alter_db_optr update */ + 215, /* (113) alter_db_optr ::= alter_db_optr cachelast */ + 244, /* (114) typename ::= ids */ + 244, /* (115) typename ::= ids LP signed RP */ + 244, /* (116) typename ::= ids UNSIGNED */ + 245, /* (117) signed ::= INTEGER */ + 245, /* (118) signed ::= PLUS INTEGER */ + 245, /* (119) signed ::= MINUS INTEGER */ + 210, /* (120) cmd ::= CREATE TABLE create_table_args */ + 210, /* (121) cmd ::= CREATE TABLE create_stable_args */ + 210, /* (122) cmd ::= CREATE STABLE create_stable_args */ + 210, /* (123) cmd ::= CREATE TABLE create_table_list */ + 248, /* (124) create_table_list ::= create_from_stable */ + 248, /* (125) create_table_list ::= create_table_list create_from_stable */ + 246, /* (126) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ + 247, /* (127) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ + 249, /* (128) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ + 246, /* (129) create_table_args ::= ifnotexists ids cpxName AS select */ + 250, /* (130) columnlist ::= columnlist COMMA column */ + 250, /* (131) columnlist ::= column */ + 252, /* (132) column ::= ids typename */ + 229, /* (133) tagitemlist ::= tagitemlist COMMA tagitem */ + 229, /* (134) tagitemlist ::= tagitem */ + 253, /* (135) tagitem ::= INTEGER */ + 253, /* (136) tagitem ::= FLOAT */ + 253, /* (137) tagitem ::= STRING */ + 253, /* (138) tagitem ::= BOOL */ + 253, /* (139) tagitem ::= NULL */ + 253, /* (140) tagitem ::= MINUS INTEGER */ + 253, /* (141) tagitem ::= MINUS FLOAT */ + 253, /* (142) tagitem ::= PLUS INTEGER */ + 253, /* (143) tagitem ::= PLUS FLOAT */ + 251, /* (144) select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */ + 265, /* (145) union ::= select */ + 265, /* (146) union ::= LP union RP */ + 265, /* (147) union ::= union UNION ALL select */ + 265, /* (148) union ::= union UNION ALL LP select RP */ + 210, /* (149) cmd ::= union */ + 251, /* (150) select ::= SELECT selcollist */ + 266, /* (151) sclp ::= selcollist COMMA */ + 266, /* (152) sclp ::= */ + 254, /* (153) selcollist ::= sclp expr as */ + 254, /* (154) selcollist ::= sclp STAR */ + 268, /* (155) as ::= AS ids */ + 268, /* (156) as ::= ids */ + 268, /* (157) as ::= */ + 255, /* (158) from ::= FROM tablelist */ + 269, /* (159) tablelist ::= ids cpxName */ + 269, /* (160) tablelist ::= ids cpxName ids */ + 269, /* (161) tablelist ::= tablelist COMMA ids cpxName */ + 269, /* (162) tablelist ::= tablelist COMMA ids cpxName ids */ + 270, /* (163) tmvar ::= VARIABLE */ + 257, /* (164) interval_opt ::= INTERVAL LP tmvar RP */ + 257, /* (165) interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */ + 257, /* (166) interval_opt ::= */ + 258, /* (167) fill_opt ::= */ + 258, /* (168) fill_opt ::= FILL LP ID COMMA tagitemlist RP */ + 258, /* (169) fill_opt ::= FILL LP ID RP */ + 259, /* (170) sliding_opt ::= SLIDING LP tmvar RP */ + 259, /* (171) sliding_opt ::= */ + 261, /* (172) orderby_opt ::= */ + 261, /* (173) orderby_opt ::= ORDER BY sortlist */ + 271, /* (174) sortlist ::= sortlist COMMA item sortorder */ + 271, /* (175) sortlist ::= item sortorder */ + 273, /* (176) item ::= ids cpxName */ + 274, /* (177) sortorder ::= ASC */ + 274, /* (178) sortorder ::= DESC */ + 274, /* (179) sortorder ::= */ + 260, /* (180) groupby_opt ::= */ + 260, /* (181) groupby_opt ::= GROUP BY grouplist */ + 275, /* (182) grouplist ::= grouplist COMMA item */ + 275, /* (183) grouplist ::= item */ + 262, /* (184) having_opt ::= */ + 262, /* (185) having_opt ::= HAVING expr */ + 264, /* (186) limit_opt ::= */ + 264, /* (187) limit_opt ::= LIMIT signed */ + 264, /* (188) limit_opt ::= LIMIT signed OFFSET signed */ + 264, /* (189) limit_opt ::= LIMIT signed COMMA signed */ + 263, /* (190) slimit_opt ::= */ + 263, /* (191) slimit_opt ::= SLIMIT signed */ + 263, /* (192) slimit_opt ::= SLIMIT signed SOFFSET signed */ + 263, /* (193) slimit_opt ::= SLIMIT signed COMMA signed */ + 256, /* (194) where_opt ::= */ + 256, /* (195) where_opt ::= WHERE expr */ + 267, /* (196) expr ::= LP expr RP */ + 267, /* (197) expr ::= ID */ + 267, /* (198) expr ::= ID DOT ID */ + 267, /* (199) expr ::= ID DOT STAR */ + 267, /* (200) expr ::= INTEGER */ + 267, /* (201) expr ::= MINUS INTEGER */ + 267, /* (202) expr ::= PLUS INTEGER */ + 267, /* (203) expr ::= FLOAT */ + 267, /* (204) expr ::= MINUS FLOAT */ + 267, /* (205) expr ::= PLUS FLOAT */ + 267, /* (206) expr ::= STRING */ + 267, /* (207) expr ::= NOW */ + 267, /* (208) expr ::= VARIABLE */ + 267, /* (209) expr ::= BOOL */ + 267, /* (210) expr ::= ID LP exprlist RP */ + 267, /* (211) expr ::= ID LP STAR RP */ + 267, /* (212) expr ::= expr IS NULL */ + 267, /* (213) expr ::= expr IS NOT NULL */ + 267, /* (214) expr ::= expr LT expr */ + 267, /* (215) expr ::= expr GT expr */ + 267, /* (216) expr ::= expr LE expr */ + 267, /* (217) expr ::= expr GE expr */ + 267, /* (218) expr ::= expr NE expr */ + 267, /* (219) expr ::= expr EQ expr */ + 267, /* (220) expr ::= expr AND expr */ + 267, /* (221) expr ::= expr OR expr */ + 267, /* (222) expr ::= expr PLUS expr */ + 267, /* (223) expr ::= expr MINUS expr */ + 267, /* (224) expr ::= expr STAR expr */ + 267, /* (225) expr ::= expr SLASH expr */ + 267, /* (226) expr ::= expr REM expr */ + 267, /* (227) expr ::= expr LIKE expr */ + 267, /* (228) expr ::= expr IN LP exprlist RP */ + 276, /* (229) exprlist ::= exprlist COMMA expritem */ + 276, /* (230) exprlist ::= expritem */ + 277, /* (231) expritem ::= expr */ + 277, /* (232) expritem ::= */ + 210, /* (233) cmd ::= RESET QUERY CACHE */ + 210, /* (234) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ + 210, /* (235) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ + 210, /* (236) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ + 210, /* (237) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ + 210, /* (238) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ + 210, /* (239) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ + 210, /* (240) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ + 210, /* (241) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ + 210, /* (242) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ + 210, /* (243) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ + 210, /* (244) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ + 210, /* (245) cmd ::= KILL CONNECTION INTEGER */ + 210, /* (246) cmd ::= KILL STREAM INTEGER COLON INTEGER */ + 210, /* (247) cmd ::= KILL QUERY INTEGER COLON INTEGER */ +}; + +/* For rule J, yyRuleInfoNRhs[J] contains the negative of the number +** of symbols on the right-hand side of that rule. */ +static const signed char yyRuleInfoNRhs[] = { + -1, /* (0) program ::= cmd */ + -2, /* (1) cmd ::= SHOW DATABASES */ + -2, /* (2) cmd ::= SHOW MNODES */ + -2, /* (3) cmd ::= SHOW DNODES */ + -2, /* (4) cmd ::= SHOW ACCOUNTS */ + -2, /* (5) cmd ::= SHOW USERS */ + -2, /* (6) cmd ::= SHOW MODULES */ + -2, /* (7) cmd ::= SHOW QUERIES */ + -2, /* (8) cmd ::= SHOW CONNECTIONS */ + -2, /* (9) cmd ::= SHOW STREAMS */ + -2, /* (10) cmd ::= SHOW VARIABLES */ + -2, /* (11) cmd ::= SHOW SCORES */ + -2, /* (12) cmd ::= SHOW GRANTS */ + -2, /* (13) cmd ::= SHOW VNODES */ + -3, /* (14) cmd ::= SHOW VNODES IPTOKEN */ + 0, /* (15) dbPrefix ::= */ + -2, /* (16) dbPrefix ::= ids DOT */ + 0, /* (17) cpxName ::= */ + -2, /* (18) cpxName ::= DOT ids */ + -5, /* (19) cmd ::= SHOW CREATE TABLE ids cpxName */ + -4, /* (20) cmd ::= SHOW CREATE DATABASE ids */ + -3, /* (21) cmd ::= SHOW dbPrefix TABLES */ + -5, /* (22) cmd ::= SHOW dbPrefix TABLES LIKE ids */ + -3, /* (23) cmd ::= SHOW dbPrefix STABLES */ + -5, /* (24) cmd ::= SHOW dbPrefix STABLES LIKE ids */ + -3, /* (25) cmd ::= SHOW dbPrefix VGROUPS */ + -4, /* (26) cmd ::= SHOW dbPrefix VGROUPS ids */ + -5, /* (27) cmd ::= DROP TABLE ifexists ids cpxName */ + -5, /* (28) cmd ::= DROP STABLE ifexists ids cpxName */ + -4, /* (29) cmd ::= DROP DATABASE ifexists ids */ + -3, /* (30) cmd ::= DROP DNODE ids */ + -3, /* (31) cmd ::= DROP USER ids */ + -3, /* (32) cmd ::= DROP ACCOUNT ids */ + -2, /* (33) cmd ::= USE ids */ + -3, /* (34) cmd ::= DESCRIBE ids cpxName */ + -5, /* (35) cmd ::= ALTER USER ids PASS ids */ + -5, /* (36) cmd ::= ALTER USER ids PRIVILEGE ids */ + -4, /* (37) cmd ::= ALTER DNODE ids ids */ + -5, /* (38) cmd ::= ALTER DNODE ids ids ids */ + -3, /* (39) cmd ::= ALTER LOCAL ids */ + -4, /* (40) cmd ::= ALTER LOCAL ids ids */ + -4, /* (41) cmd ::= ALTER DATABASE ids alter_db_optr */ + -4, /* (42) cmd ::= ALTER ACCOUNT ids acct_optr */ + -6, /* (43) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ + -1, /* (44) ids ::= ID */ + -1, /* (45) ids ::= STRING */ + -2, /* (46) ifexists ::= IF EXISTS */ + 0, /* (47) ifexists ::= */ + -3, /* (48) ifnotexists ::= IF NOT EXISTS */ + 0, /* (49) ifnotexists ::= */ + -3, /* (50) cmd ::= CREATE DNODE ids */ + -6, /* (51) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ + -5, /* (52) cmd ::= CREATE DATABASE ifnotexists ids db_optr */ + -5, /* (53) cmd ::= CREATE USER ids PASS ids */ + 0, /* (54) pps ::= */ + -2, /* (55) pps ::= PPS INTEGER */ + 0, /* (56) tseries ::= */ + -2, /* (57) tseries ::= TSERIES INTEGER */ + 0, /* (58) dbs ::= */ + -2, /* (59) dbs ::= DBS INTEGER */ + 0, /* (60) streams ::= */ + -2, /* (61) streams ::= STREAMS INTEGER */ + 0, /* (62) storage ::= */ + -2, /* (63) storage ::= STORAGE INTEGER */ + 0, /* (64) qtime ::= */ + -2, /* (65) qtime ::= QTIME INTEGER */ + 0, /* (66) users ::= */ + -2, /* (67) users ::= USERS INTEGER */ + 0, /* (68) conns ::= */ + -2, /* (69) conns ::= CONNS INTEGER */ + 0, /* (70) state ::= */ + -2, /* (71) state ::= STATE ids */ + -9, /* (72) acct_optr ::= pps tseries storage streams qtime dbs users conns state */ + -2, /* (73) keep ::= KEEP tagitemlist */ + -2, /* (74) cache ::= CACHE INTEGER */ + -2, /* (75) replica ::= REPLICA INTEGER */ + -2, /* (76) quorum ::= QUORUM INTEGER */ + -2, /* (77) days ::= DAYS INTEGER */ + -2, /* (78) minrows ::= MINROWS INTEGER */ + -2, /* (79) maxrows ::= MAXROWS INTEGER */ + -2, /* (80) blocks ::= BLOCKS INTEGER */ + -2, /* (81) ctime ::= CTIME INTEGER */ + -2, /* (82) wal ::= WAL INTEGER */ + -2, /* (83) fsync ::= FSYNC INTEGER */ + -2, /* (84) comp ::= COMP INTEGER */ + -2, /* (85) prec ::= PRECISION STRING */ + -2, /* (86) update ::= UPDATE INTEGER */ + -2, /* (87) cachelast ::= CACHELAST INTEGER */ + 0, /* (88) db_optr ::= */ + -2, /* (89) db_optr ::= db_optr cache */ + -2, /* (90) db_optr ::= db_optr replica */ + -2, /* (91) db_optr ::= db_optr quorum */ + -2, /* (92) db_optr ::= db_optr days */ + -2, /* (93) db_optr ::= db_optr minrows */ + -2, /* (94) db_optr ::= db_optr maxrows */ + -2, /* (95) db_optr ::= db_optr blocks */ + -2, /* (96) db_optr ::= db_optr ctime */ + -2, /* (97) db_optr ::= db_optr wal */ + -2, /* (98) db_optr ::= db_optr fsync */ + -2, /* (99) db_optr ::= db_optr comp */ + -2, /* (100) db_optr ::= db_optr prec */ + -2, /* (101) db_optr ::= db_optr keep */ + -2, /* (102) db_optr ::= db_optr update */ + -2, /* (103) db_optr ::= db_optr cachelast */ + 0, /* (104) alter_db_optr ::= */ + -2, /* (105) alter_db_optr ::= alter_db_optr replica */ + -2, /* (106) alter_db_optr ::= alter_db_optr quorum */ + -2, /* (107) alter_db_optr ::= alter_db_optr keep */ + -2, /* (108) alter_db_optr ::= alter_db_optr blocks */ + -2, /* (109) alter_db_optr ::= alter_db_optr comp */ + -2, /* (110) alter_db_optr ::= alter_db_optr wal */ + -2, /* (111) alter_db_optr ::= alter_db_optr fsync */ + -2, /* (112) alter_db_optr ::= alter_db_optr update */ + -2, /* (113) alter_db_optr ::= alter_db_optr cachelast */ + -1, /* (114) typename ::= ids */ + -4, /* (115) typename ::= ids LP signed RP */ + -2, /* (116) typename ::= ids UNSIGNED */ + -1, /* (117) signed ::= INTEGER */ + -2, /* (118) signed ::= PLUS INTEGER */ + -2, /* (119) signed ::= MINUS INTEGER */ + -3, /* (120) cmd ::= CREATE TABLE create_table_args */ + -3, /* (121) cmd ::= CREATE TABLE create_stable_args */ + -3, /* (122) cmd ::= CREATE STABLE create_stable_args */ + -3, /* (123) cmd ::= CREATE TABLE create_table_list */ + -1, /* (124) create_table_list ::= create_from_stable */ + -2, /* (125) create_table_list ::= create_table_list create_from_stable */ + -6, /* (126) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ + -10, /* (127) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ + -10, /* (128) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ + -5, /* (129) create_table_args ::= ifnotexists ids cpxName AS select */ + -3, /* (130) columnlist ::= columnlist COMMA column */ + -1, /* (131) columnlist ::= column */ + -2, /* (132) column ::= ids typename */ + -3, /* (133) tagitemlist ::= tagitemlist COMMA tagitem */ + -1, /* (134) tagitemlist ::= tagitem */ + -1, /* (135) tagitem ::= INTEGER */ + -1, /* (136) tagitem ::= FLOAT */ + -1, /* (137) tagitem ::= STRING */ + -1, /* (138) tagitem ::= BOOL */ + -1, /* (139) tagitem ::= NULL */ + -2, /* (140) tagitem ::= MINUS INTEGER */ + -2, /* (141) tagitem ::= MINUS FLOAT */ + -2, /* (142) tagitem ::= PLUS INTEGER */ + -2, /* (143) tagitem ::= PLUS FLOAT */ + -12, /* (144) select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */ + -1, /* (145) union ::= select */ + -3, /* (146) union ::= LP union RP */ + -4, /* (147) union ::= union UNION ALL select */ + -6, /* (148) union ::= union UNION ALL LP select RP */ + -1, /* (149) cmd ::= union */ + -2, /* (150) select ::= SELECT selcollist */ + -2, /* (151) sclp ::= selcollist COMMA */ + 0, /* (152) sclp ::= */ + -3, /* (153) selcollist ::= sclp expr as */ + -2, /* (154) selcollist ::= sclp STAR */ + -2, /* (155) as ::= AS ids */ + -1, /* (156) as ::= ids */ + 0, /* (157) as ::= */ + -2, /* (158) from ::= FROM tablelist */ + -2, /* (159) tablelist ::= ids cpxName */ + -3, /* (160) tablelist ::= ids cpxName ids */ + -4, /* (161) tablelist ::= tablelist COMMA ids cpxName */ + -5, /* (162) tablelist ::= tablelist COMMA ids cpxName ids */ + -1, /* (163) tmvar ::= VARIABLE */ + -4, /* (164) interval_opt ::= INTERVAL LP tmvar RP */ + -6, /* (165) interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */ + 0, /* (166) interval_opt ::= */ + 0, /* (167) fill_opt ::= */ + -6, /* (168) fill_opt ::= FILL LP ID COMMA tagitemlist RP */ + -4, /* (169) fill_opt ::= FILL LP ID RP */ + -4, /* (170) sliding_opt ::= SLIDING LP tmvar RP */ + 0, /* (171) sliding_opt ::= */ + 0, /* (172) orderby_opt ::= */ + -3, /* (173) orderby_opt ::= ORDER BY sortlist */ + -4, /* (174) sortlist ::= sortlist COMMA item sortorder */ + -2, /* (175) sortlist ::= item sortorder */ + -2, /* (176) item ::= ids cpxName */ + -1, /* (177) sortorder ::= ASC */ + -1, /* (178) sortorder ::= DESC */ + 0, /* (179) sortorder ::= */ + 0, /* (180) groupby_opt ::= */ + -3, /* (181) groupby_opt ::= GROUP BY grouplist */ + -3, /* (182) grouplist ::= grouplist COMMA item */ + -1, /* (183) grouplist ::= item */ + 0, /* (184) having_opt ::= */ + -2, /* (185) having_opt ::= HAVING expr */ + 0, /* (186) limit_opt ::= */ + -2, /* (187) limit_opt ::= LIMIT signed */ + -4, /* (188) limit_opt ::= LIMIT signed OFFSET signed */ + -4, /* (189) limit_opt ::= LIMIT signed COMMA signed */ + 0, /* (190) slimit_opt ::= */ + -2, /* (191) slimit_opt ::= SLIMIT signed */ + -4, /* (192) slimit_opt ::= SLIMIT signed SOFFSET signed */ + -4, /* (193) slimit_opt ::= SLIMIT signed COMMA signed */ + 0, /* (194) where_opt ::= */ + -2, /* (195) where_opt ::= WHERE expr */ + -3, /* (196) expr ::= LP expr RP */ + -1, /* (197) expr ::= ID */ + -3, /* (198) expr ::= ID DOT ID */ + -3, /* (199) expr ::= ID DOT STAR */ + -1, /* (200) expr ::= INTEGER */ + -2, /* (201) expr ::= MINUS INTEGER */ + -2, /* (202) expr ::= PLUS INTEGER */ + -1, /* (203) expr ::= FLOAT */ + -2, /* (204) expr ::= MINUS FLOAT */ + -2, /* (205) expr ::= PLUS FLOAT */ + -1, /* (206) expr ::= STRING */ + -1, /* (207) expr ::= NOW */ + -1, /* (208) expr ::= VARIABLE */ + -1, /* (209) expr ::= BOOL */ + -4, /* (210) expr ::= ID LP exprlist RP */ + -4, /* (211) expr ::= ID LP STAR RP */ + -3, /* (212) expr ::= expr IS NULL */ + -4, /* (213) expr ::= expr IS NOT NULL */ + -3, /* (214) expr ::= expr LT expr */ + -3, /* (215) expr ::= expr GT expr */ + -3, /* (216) expr ::= expr LE expr */ + -3, /* (217) expr ::= expr GE expr */ + -3, /* (218) expr ::= expr NE expr */ + -3, /* (219) expr ::= expr EQ expr */ + -3, /* (220) expr ::= expr AND expr */ + -3, /* (221) expr ::= expr OR expr */ + -3, /* (222) expr ::= expr PLUS expr */ + -3, /* (223) expr ::= expr MINUS expr */ + -3, /* (224) expr ::= expr STAR expr */ + -3, /* (225) expr ::= expr SLASH expr */ + -3, /* (226) expr ::= expr REM expr */ + -3, /* (227) expr ::= expr LIKE expr */ + -5, /* (228) expr ::= expr IN LP exprlist RP */ + -3, /* (229) exprlist ::= exprlist COMMA expritem */ + -1, /* (230) exprlist ::= expritem */ + -1, /* (231) expritem ::= expr */ + 0, /* (232) expritem ::= */ + -3, /* (233) cmd ::= RESET QUERY CACHE */ + -7, /* (234) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ + -7, /* (235) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ + -7, /* (236) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ + -7, /* (237) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ + -8, /* (238) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ + -9, /* (239) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ + -7, /* (240) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ + -7, /* (241) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ + -7, /* (242) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ + -7, /* (243) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ + -8, /* (244) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ + -3, /* (245) cmd ::= KILL CONNECTION INTEGER */ + -5, /* (246) cmd ::= KILL STREAM INTEGER COLON INTEGER */ + -5, /* (247) cmd ::= KILL QUERY INTEGER COLON INTEGER */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -1976,30 +2272,34 @@ 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; #ifndef NDEBUG if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){ - yysize = yyRuleInfo[yyruleno].nrhs; + yysize = yyRuleInfoNRhs[yyruleno]; if( yysize ){ - fprintf(yyTraceFILE, "%sReduce %d [%s], go to state %d.\n", + fprintf(yyTraceFILE, "%sReduce %d [%s]%s, pop back to state %d.\n", yyTracePrompt, - yyruleno, yyRuleName[yyruleno], yymsp[yysize].stateno); + yyruleno, yyRuleName[yyruleno], + yyrulenoyytos - yypParser->yystack)>yypParser->yyhwm ){ yypParser->yyhwm++; @@ -2017,13 +2317,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; } @@ -2042,7 +2348,9 @@ static void yy_reduce( /********** Begin reduce actions **********************************************/ YYMINORTYPE yylhsminor; case 0: /* program ::= cmd */ - case 119: /* cmd ::= CREATE TABLE create_table_args */ yytestcase(yyruleno==119); + case 120: /* cmd ::= CREATE TABLE create_table_args */ yytestcase(yyruleno==120); + case 121: /* cmd ::= CREATE TABLE create_stable_args */ yytestcase(yyruleno==121); + case 122: /* cmd ::= CREATE STABLE create_stable_args */ yytestcase(yyruleno==122); {} break; case 1: /* cmd ::= SHOW DATABASES */ @@ -2150,107 +2458,113 @@ static void yy_reduce( case 27: /* cmd ::= DROP TABLE ifexists ids cpxName */ { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; - setDropDbTableInfo(pInfo, TSDB_SQL_DROP_TABLE, &yymsp[-1].minor.yy0, &yymsp[-2].minor.yy0); + setDropDbTableInfo(pInfo, TSDB_SQL_DROP_TABLE, &yymsp[-1].minor.yy0, &yymsp[-2].minor.yy0, -1); +} + break; + case 28: /* cmd ::= DROP STABLE ifexists ids cpxName */ +{ + yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; + setDropDbTableInfo(pInfo, TSDB_SQL_DROP_TABLE, &yymsp[-1].minor.yy0, &yymsp[-2].minor.yy0, TSDB_SUPER_TABLE); } break; - case 28: /* cmd ::= DROP DATABASE ifexists ids */ -{ setDropDbTableInfo(pInfo, TSDB_SQL_DROP_DB, &yymsp[0].minor.yy0, &yymsp[-1].minor.yy0); } + case 29: /* cmd ::= DROP DATABASE ifexists ids */ +{ setDropDbTableInfo(pInfo, TSDB_SQL_DROP_DB, &yymsp[0].minor.yy0, &yymsp[-1].minor.yy0, -1); } break; - case 29: /* cmd ::= DROP DNODE ids */ + case 30: /* cmd ::= DROP DNODE ids */ { setDCLSQLElems(pInfo, TSDB_SQL_DROP_DNODE, 1, &yymsp[0].minor.yy0); } break; - case 30: /* cmd ::= DROP USER ids */ + case 31: /* cmd ::= DROP USER ids */ { setDCLSQLElems(pInfo, TSDB_SQL_DROP_USER, 1, &yymsp[0].minor.yy0); } break; - case 31: /* cmd ::= DROP ACCOUNT ids */ + case 32: /* cmd ::= DROP ACCOUNT ids */ { setDCLSQLElems(pInfo, TSDB_SQL_DROP_ACCT, 1, &yymsp[0].minor.yy0); } break; - case 32: /* cmd ::= USE ids */ + case 33: /* cmd ::= USE ids */ { setDCLSQLElems(pInfo, TSDB_SQL_USE_DB, 1, &yymsp[0].minor.yy0);} break; - case 33: /* cmd ::= DESCRIBE ids cpxName */ + case 34: /* cmd ::= DESCRIBE ids cpxName */ { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; setDCLSQLElems(pInfo, TSDB_SQL_DESCRIBE_TABLE, 1, &yymsp[-1].minor.yy0); } break; - case 34: /* cmd ::= ALTER USER ids PASS ids */ + case 35: /* cmd ::= ALTER USER ids PASS ids */ { setAlterUserSql(pInfo, TSDB_ALTER_USER_PASSWD, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, NULL); } break; - case 35: /* cmd ::= ALTER USER ids PRIVILEGE ids */ + case 36: /* cmd ::= ALTER USER ids PRIVILEGE ids */ { setAlterUserSql(pInfo, TSDB_ALTER_USER_PRIVILEGES, &yymsp[-2].minor.yy0, NULL, &yymsp[0].minor.yy0);} break; - case 36: /* cmd ::= ALTER DNODE ids ids */ + case 37: /* cmd ::= ALTER DNODE ids ids */ { setDCLSQLElems(pInfo, TSDB_SQL_CFG_DNODE, 2, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 37: /* cmd ::= ALTER DNODE ids ids ids */ + case 38: /* cmd ::= ALTER DNODE ids ids ids */ { setDCLSQLElems(pInfo, TSDB_SQL_CFG_DNODE, 3, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 38: /* cmd ::= ALTER LOCAL ids */ + case 39: /* cmd ::= ALTER LOCAL ids */ { setDCLSQLElems(pInfo, TSDB_SQL_CFG_LOCAL, 1, &yymsp[0].minor.yy0); } break; - case 39: /* cmd ::= ALTER LOCAL ids ids */ + case 40: /* cmd ::= ALTER LOCAL ids ids */ { setDCLSQLElems(pInfo, TSDB_SQL_CFG_LOCAL, 2, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 40: /* cmd ::= ALTER DATABASE ids alter_db_optr */ + case 41: /* cmd ::= ALTER DATABASE ids alter_db_optr */ { SStrToken t = {0}; setCreateDBSQL(pInfo, TSDB_SQL_ALTER_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy234, &t);} break; - case 41: /* cmd ::= ALTER ACCOUNT ids acct_optr */ + case 42: /* cmd ::= ALTER ACCOUNT ids acct_optr */ { setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-1].minor.yy0, NULL, &yymsp[0].minor.yy71);} break; - case 42: /* cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ + case 43: /* 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.yy71);} break; - case 43: /* ids ::= ID */ - case 44: /* ids ::= STRING */ yytestcase(yyruleno==44); + case 44: /* ids ::= ID */ + case 45: /* ids ::= STRING */ yytestcase(yyruleno==45); {yylhsminor.yy0 = yymsp[0].minor.yy0; } yymsp[0].minor.yy0 = yylhsminor.yy0; break; - case 45: /* ifexists ::= IF EXISTS */ + case 46: /* ifexists ::= IF EXISTS */ { yymsp[-1].minor.yy0.n = 1;} break; - case 46: /* ifexists ::= */ - case 48: /* ifnotexists ::= */ yytestcase(yyruleno==48); + case 47: /* ifexists ::= */ + case 49: /* ifnotexists ::= */ yytestcase(yyruleno==49); { yymsp[1].minor.yy0.n = 0;} break; - case 47: /* ifnotexists ::= IF NOT EXISTS */ + case 48: /* ifnotexists ::= IF NOT EXISTS */ { yymsp[-2].minor.yy0.n = 1;} break; - case 49: /* cmd ::= CREATE DNODE ids */ + case 50: /* cmd ::= CREATE DNODE ids */ { setDCLSQLElems(pInfo, TSDB_SQL_CREATE_DNODE, 1, &yymsp[0].minor.yy0);} break; - case 50: /* cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ + case 51: /* 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.yy71);} break; - case 51: /* cmd ::= CREATE DATABASE ifnotexists ids db_optr */ + case 52: /* cmd ::= CREATE DATABASE ifnotexists ids db_optr */ { setCreateDBSQL(pInfo, TSDB_SQL_CREATE_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy234, &yymsp[-2].minor.yy0);} break; - case 52: /* cmd ::= CREATE USER ids PASS ids */ + case 53: /* cmd ::= CREATE USER ids PASS ids */ { setCreateUserSql(pInfo, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);} break; - case 53: /* pps ::= */ - case 55: /* tseries ::= */ yytestcase(yyruleno==55); - case 57: /* dbs ::= */ yytestcase(yyruleno==57); - case 59: /* streams ::= */ yytestcase(yyruleno==59); - case 61: /* storage ::= */ yytestcase(yyruleno==61); - case 63: /* qtime ::= */ yytestcase(yyruleno==63); - case 65: /* users ::= */ yytestcase(yyruleno==65); - case 67: /* conns ::= */ yytestcase(yyruleno==67); - case 69: /* state ::= */ yytestcase(yyruleno==69); + case 54: /* pps ::= */ + case 56: /* tseries ::= */ yytestcase(yyruleno==56); + case 58: /* dbs ::= */ yytestcase(yyruleno==58); + case 60: /* streams ::= */ yytestcase(yyruleno==60); + case 62: /* storage ::= */ yytestcase(yyruleno==62); + case 64: /* qtime ::= */ yytestcase(yyruleno==64); + case 66: /* users ::= */ yytestcase(yyruleno==66); + case 68: /* conns ::= */ yytestcase(yyruleno==68); + case 70: /* state ::= */ yytestcase(yyruleno==70); { yymsp[1].minor.yy0.n = 0; } break; - case 54: /* pps ::= PPS INTEGER */ - case 56: /* tseries ::= TSERIES INTEGER */ yytestcase(yyruleno==56); - case 58: /* dbs ::= DBS INTEGER */ yytestcase(yyruleno==58); - case 60: /* streams ::= STREAMS INTEGER */ yytestcase(yyruleno==60); - case 62: /* storage ::= STORAGE INTEGER */ yytestcase(yyruleno==62); - case 64: /* qtime ::= QTIME INTEGER */ yytestcase(yyruleno==64); - case 66: /* users ::= USERS INTEGER */ yytestcase(yyruleno==66); - case 68: /* conns ::= CONNS INTEGER */ yytestcase(yyruleno==68); - case 70: /* state ::= STATE ids */ yytestcase(yyruleno==70); + case 55: /* pps ::= PPS INTEGER */ + case 57: /* tseries ::= TSERIES INTEGER */ yytestcase(yyruleno==57); + case 59: /* dbs ::= DBS INTEGER */ yytestcase(yyruleno==59); + case 61: /* streams ::= STREAMS INTEGER */ yytestcase(yyruleno==61); + case 63: /* storage ::= STORAGE INTEGER */ yytestcase(yyruleno==63); + case 65: /* qtime ::= QTIME INTEGER */ yytestcase(yyruleno==65); + case 67: /* users ::= USERS INTEGER */ yytestcase(yyruleno==67); + case 69: /* conns ::= CONNS INTEGER */ yytestcase(yyruleno==69); + case 71: /* state ::= STATE ids */ yytestcase(yyruleno==71); { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } break; - case 71: /* acct_optr ::= pps tseries storage streams qtime dbs users conns state */ + case 72: /* acct_optr ::= pps tseries storage streams qtime dbs users conns state */ { yylhsminor.yy71.maxUsers = (yymsp[-2].minor.yy0.n>0)?atoi(yymsp[-2].minor.yy0.z):-1; yylhsminor.yy71.maxDbs = (yymsp[-3].minor.yy0.n>0)?atoi(yymsp[-3].minor.yy0.z):-1; @@ -2264,108 +2578,108 @@ static void yy_reduce( } yymsp[-8].minor.yy71 = yylhsminor.yy71; break; - case 72: /* keep ::= KEEP tagitemlist */ + case 73: /* keep ::= KEEP tagitemlist */ { yymsp[-1].minor.yy421 = yymsp[0].minor.yy421; } break; - case 73: /* cache ::= CACHE INTEGER */ - case 74: /* replica ::= REPLICA INTEGER */ yytestcase(yyruleno==74); - case 75: /* quorum ::= QUORUM INTEGER */ yytestcase(yyruleno==75); - case 76: /* days ::= DAYS INTEGER */ yytestcase(yyruleno==76); - case 77: /* minrows ::= MINROWS INTEGER */ yytestcase(yyruleno==77); - case 78: /* maxrows ::= MAXROWS INTEGER */ yytestcase(yyruleno==78); - case 79: /* blocks ::= BLOCKS INTEGER */ yytestcase(yyruleno==79); - case 80: /* ctime ::= CTIME INTEGER */ yytestcase(yyruleno==80); - case 81: /* wal ::= WAL INTEGER */ yytestcase(yyruleno==81); - case 82: /* fsync ::= FSYNC INTEGER */ yytestcase(yyruleno==82); - case 83: /* comp ::= COMP INTEGER */ yytestcase(yyruleno==83); - case 84: /* prec ::= PRECISION STRING */ yytestcase(yyruleno==84); - case 85: /* update ::= UPDATE INTEGER */ yytestcase(yyruleno==85); - case 86: /* cachelast ::= CACHELAST INTEGER */ yytestcase(yyruleno==86); + case 74: /* cache ::= CACHE INTEGER */ + case 75: /* replica ::= REPLICA INTEGER */ yytestcase(yyruleno==75); + case 76: /* quorum ::= QUORUM INTEGER */ yytestcase(yyruleno==76); + case 77: /* days ::= DAYS INTEGER */ yytestcase(yyruleno==77); + case 78: /* minrows ::= MINROWS INTEGER */ yytestcase(yyruleno==78); + case 79: /* maxrows ::= MAXROWS INTEGER */ yytestcase(yyruleno==79); + case 80: /* blocks ::= BLOCKS INTEGER */ yytestcase(yyruleno==80); + case 81: /* ctime ::= CTIME INTEGER */ yytestcase(yyruleno==81); + case 82: /* wal ::= WAL INTEGER */ yytestcase(yyruleno==82); + case 83: /* fsync ::= FSYNC INTEGER */ yytestcase(yyruleno==83); + case 84: /* comp ::= COMP INTEGER */ yytestcase(yyruleno==84); + case 85: /* prec ::= PRECISION STRING */ yytestcase(yyruleno==85); + case 86: /* update ::= UPDATE INTEGER */ yytestcase(yyruleno==86); + case 87: /* cachelast ::= CACHELAST INTEGER */ yytestcase(yyruleno==87); { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } break; - case 87: /* db_optr ::= */ + case 88: /* db_optr ::= */ {setDefaultCreateDbOption(&yymsp[1].minor.yy234);} break; - case 88: /* db_optr ::= db_optr cache */ + case 89: /* db_optr ::= db_optr cache */ { yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.cacheBlockSize = strtol(yymsp[0].minor.yy0.z, NULL, 10); } yymsp[-1].minor.yy234 = yylhsminor.yy234; break; - case 89: /* db_optr ::= db_optr replica */ - case 104: /* alter_db_optr ::= alter_db_optr replica */ yytestcase(yyruleno==104); + case 90: /* db_optr ::= db_optr replica */ + case 105: /* alter_db_optr ::= alter_db_optr replica */ yytestcase(yyruleno==105); { yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.replica = strtol(yymsp[0].minor.yy0.z, NULL, 10); } yymsp[-1].minor.yy234 = yylhsminor.yy234; break; - case 90: /* db_optr ::= db_optr quorum */ - case 105: /* alter_db_optr ::= alter_db_optr quorum */ yytestcase(yyruleno==105); + case 91: /* db_optr ::= db_optr quorum */ + case 106: /* alter_db_optr ::= alter_db_optr quorum */ yytestcase(yyruleno==106); { yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.quorum = strtol(yymsp[0].minor.yy0.z, NULL, 10); } yymsp[-1].minor.yy234 = yylhsminor.yy234; break; - case 91: /* db_optr ::= db_optr days */ + case 92: /* db_optr ::= db_optr days */ { yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.daysPerFile = strtol(yymsp[0].minor.yy0.z, NULL, 10); } yymsp[-1].minor.yy234 = yylhsminor.yy234; break; - case 92: /* db_optr ::= db_optr minrows */ + case 93: /* db_optr ::= db_optr minrows */ { yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.minRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } yymsp[-1].minor.yy234 = yylhsminor.yy234; break; - case 93: /* db_optr ::= db_optr maxrows */ + case 94: /* db_optr ::= db_optr maxrows */ { yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.maxRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } yymsp[-1].minor.yy234 = yylhsminor.yy234; break; - case 94: /* db_optr ::= db_optr blocks */ - case 107: /* alter_db_optr ::= alter_db_optr blocks */ yytestcase(yyruleno==107); + case 95: /* db_optr ::= db_optr blocks */ + case 108: /* alter_db_optr ::= alter_db_optr blocks */ yytestcase(yyruleno==108); { yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.numOfBlocks = strtol(yymsp[0].minor.yy0.z, NULL, 10); } yymsp[-1].minor.yy234 = yylhsminor.yy234; break; - case 95: /* db_optr ::= db_optr ctime */ + case 96: /* db_optr ::= db_optr ctime */ { yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.commitTime = strtol(yymsp[0].minor.yy0.z, NULL, 10); } yymsp[-1].minor.yy234 = yylhsminor.yy234; break; - case 96: /* db_optr ::= db_optr wal */ - case 109: /* alter_db_optr ::= alter_db_optr wal */ yytestcase(yyruleno==109); + case 97: /* db_optr ::= db_optr wal */ + case 110: /* alter_db_optr ::= alter_db_optr wal */ yytestcase(yyruleno==110); { yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.walLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } yymsp[-1].minor.yy234 = yylhsminor.yy234; break; - case 97: /* db_optr ::= db_optr fsync */ - case 110: /* alter_db_optr ::= alter_db_optr fsync */ yytestcase(yyruleno==110); + case 98: /* db_optr ::= db_optr fsync */ + case 111: /* alter_db_optr ::= alter_db_optr fsync */ yytestcase(yyruleno==111); { yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.fsyncPeriod = strtol(yymsp[0].minor.yy0.z, NULL, 10); } yymsp[-1].minor.yy234 = yylhsminor.yy234; break; - case 98: /* db_optr ::= db_optr comp */ - case 108: /* alter_db_optr ::= alter_db_optr comp */ yytestcase(yyruleno==108); + case 99: /* db_optr ::= db_optr comp */ + case 109: /* alter_db_optr ::= alter_db_optr comp */ yytestcase(yyruleno==109); { yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.compressionLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } yymsp[-1].minor.yy234 = yylhsminor.yy234; break; - case 99: /* db_optr ::= db_optr prec */ + case 100: /* db_optr ::= db_optr prec */ { yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.precision = yymsp[0].minor.yy0; } yymsp[-1].minor.yy234 = yylhsminor.yy234; break; - case 100: /* db_optr ::= db_optr keep */ - case 106: /* alter_db_optr ::= alter_db_optr keep */ yytestcase(yyruleno==106); + case 101: /* db_optr ::= db_optr keep */ + case 107: /* alter_db_optr ::= alter_db_optr keep */ yytestcase(yyruleno==107); { yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.keep = yymsp[0].minor.yy421; } yymsp[-1].minor.yy234 = yylhsminor.yy234; break; - case 101: /* db_optr ::= db_optr update */ - case 111: /* alter_db_optr ::= alter_db_optr update */ yytestcase(yyruleno==111); + case 102: /* db_optr ::= db_optr update */ + case 112: /* alter_db_optr ::= alter_db_optr update */ yytestcase(yyruleno==112); { yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.update = strtol(yymsp[0].minor.yy0.z, NULL, 10); } yymsp[-1].minor.yy234 = yylhsminor.yy234; break; - case 102: /* db_optr ::= db_optr cachelast */ - case 112: /* alter_db_optr ::= alter_db_optr cachelast */ yytestcase(yyruleno==112); + case 103: /* db_optr ::= db_optr cachelast */ + case 113: /* alter_db_optr ::= alter_db_optr cachelast */ yytestcase(yyruleno==113); { yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.cachelast = strtol(yymsp[0].minor.yy0.z, NULL, 10); } yymsp[-1].minor.yy234 = yylhsminor.yy234; break; - case 103: /* alter_db_optr ::= */ + case 104: /* alter_db_optr ::= */ { setDefaultCreateDbOption(&yymsp[1].minor.yy234);} break; - case 113: /* typename ::= ids */ + case 114: /* typename ::= ids */ { yymsp[0].minor.yy0.type = 0; tSqlSetColumnType (&yylhsminor.yy183, &yymsp[0].minor.yy0); } yymsp[0].minor.yy183 = yylhsminor.yy183; break; - case 114: /* typename ::= ids LP signed RP */ + case 115: /* typename ::= ids LP signed RP */ { if (yymsp[-1].minor.yy325 <= 0) { yymsp[-3].minor.yy0.type = 0; @@ -2377,7 +2691,7 @@ static void yy_reduce( } yymsp[-3].minor.yy183 = yylhsminor.yy183; break; - case 115: /* typename ::= ids UNSIGNED */ + case 116: /* 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); @@ -2385,20 +2699,20 @@ static void yy_reduce( } yymsp[-1].minor.yy183 = yylhsminor.yy183; break; - case 116: /* signed ::= INTEGER */ + case 117: /* signed ::= INTEGER */ { yylhsminor.yy325 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } yymsp[0].minor.yy325 = yylhsminor.yy325; break; - case 117: /* signed ::= PLUS INTEGER */ + case 118: /* signed ::= PLUS INTEGER */ { yymsp[-1].minor.yy325 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } break; - case 118: /* signed ::= MINUS INTEGER */ + case 119: /* signed ::= MINUS INTEGER */ { yymsp[-1].minor.yy325 = -strtol(yymsp[0].minor.yy0.z, NULL, 10);} break; - case 120: /* cmd ::= CREATE TABLE create_table_list */ + case 123: /* cmd ::= CREATE TABLE create_table_list */ { pInfo->type = TSDB_SQL_CREATE_TABLE; pInfo->pCreateTableInfo = yymsp[0].minor.yy38;} break; - case 121: /* create_table_list ::= create_from_stable */ + case 124: /* create_table_list ::= create_from_stable */ { SCreateTableSQL* pCreateTable = calloc(1, sizeof(SCreateTableSQL)); pCreateTable->childTableInfo = taosArrayInit(4, sizeof(SCreatedTableInfo)); @@ -2409,14 +2723,14 @@ static void yy_reduce( } yymsp[0].minor.yy38 = yylhsminor.yy38; break; - case 122: /* create_table_list ::= create_table_list create_from_stable */ + case 125: /* create_table_list ::= create_table_list create_from_stable */ { taosArrayPush(yymsp[-1].minor.yy38->childTableInfo, &yymsp[0].minor.yy152); yylhsminor.yy38 = yymsp[-1].minor.yy38; } yymsp[-1].minor.yy38 = yylhsminor.yy38; break; - case 123: /* create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ + case 126: /* create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ { yylhsminor.yy38 = tSetCreateSqlElems(yymsp[-1].minor.yy421, NULL, NULL, TSQL_CREATE_TABLE); setSqlInfo(pInfo, yylhsminor.yy38, NULL, TSDB_SQL_CREATE_TABLE); @@ -2426,7 +2740,7 @@ static void yy_reduce( } yymsp[-5].minor.yy38 = yylhsminor.yy38; break; - case 124: /* create_table_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ + case 127: /* create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ { yylhsminor.yy38 = tSetCreateSqlElems(yymsp[-5].minor.yy421, yymsp[-1].minor.yy421, NULL, TSQL_CREATE_STABLE); setSqlInfo(pInfo, yylhsminor.yy38, NULL, TSDB_SQL_CREATE_TABLE); @@ -2436,7 +2750,7 @@ static void yy_reduce( } yymsp[-9].minor.yy38 = yylhsminor.yy38; break; - case 125: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ + case 128: /* 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; @@ -2444,7 +2758,7 @@ static void yy_reduce( } yymsp[-9].minor.yy152 = yylhsminor.yy152; break; - case 126: /* create_table_args ::= ifnotexists ids cpxName AS select */ + case 129: /* create_table_args ::= ifnotexists ids cpxName AS select */ { yylhsminor.yy38 = tSetCreateSqlElems(NULL, NULL, yymsp[0].minor.yy148, TSQL_CREATE_STREAM); setSqlInfo(pInfo, yylhsminor.yy38, NULL, TSDB_SQL_CREATE_TABLE); @@ -2454,43 +2768,43 @@ static void yy_reduce( } yymsp[-4].minor.yy38 = yylhsminor.yy38; break; - case 127: /* columnlist ::= columnlist COMMA column */ + case 130: /* columnlist ::= columnlist COMMA column */ {taosArrayPush(yymsp[-2].minor.yy421, &yymsp[0].minor.yy183); yylhsminor.yy421 = yymsp[-2].minor.yy421; } yymsp[-2].minor.yy421 = yylhsminor.yy421; break; - case 128: /* columnlist ::= column */ + case 131: /* columnlist ::= column */ {yylhsminor.yy421 = taosArrayInit(4, sizeof(TAOS_FIELD)); taosArrayPush(yylhsminor.yy421, &yymsp[0].minor.yy183);} yymsp[0].minor.yy421 = yylhsminor.yy421; break; - case 129: /* column ::= ids typename */ + case 132: /* column ::= ids typename */ { tSqlSetColumnInfo(&yylhsminor.yy183, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy183); } yymsp[-1].minor.yy183 = yylhsminor.yy183; break; - case 130: /* tagitemlist ::= tagitemlist COMMA tagitem */ + case 133: /* tagitemlist ::= tagitemlist COMMA tagitem */ { yylhsminor.yy421 = tVariantListAppend(yymsp[-2].minor.yy421, &yymsp[0].minor.yy430, -1); } yymsp[-2].minor.yy421 = yylhsminor.yy421; break; - case 131: /* tagitemlist ::= tagitem */ + case 134: /* tagitemlist ::= tagitem */ { yylhsminor.yy421 = tVariantListAppend(NULL, &yymsp[0].minor.yy430, -1); } yymsp[0].minor.yy421 = yylhsminor.yy421; break; - case 132: /* tagitem ::= INTEGER */ - case 133: /* tagitem ::= FLOAT */ yytestcase(yyruleno==133); - case 134: /* tagitem ::= STRING */ yytestcase(yyruleno==134); - case 135: /* tagitem ::= BOOL */ yytestcase(yyruleno==135); + case 135: /* tagitem ::= INTEGER */ + case 136: /* tagitem ::= FLOAT */ yytestcase(yyruleno==136); + case 137: /* tagitem ::= STRING */ yytestcase(yyruleno==137); + case 138: /* tagitem ::= BOOL */ yytestcase(yyruleno==138); { toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yylhsminor.yy430, &yymsp[0].minor.yy0); } yymsp[0].minor.yy430 = yylhsminor.yy430; break; - case 136: /* tagitem ::= NULL */ + case 139: /* tagitem ::= NULL */ { yymsp[0].minor.yy0.type = 0; tVariantCreate(&yylhsminor.yy430, &yymsp[0].minor.yy0); } yymsp[0].minor.yy430 = yylhsminor.yy430; break; - case 137: /* tagitem ::= MINUS INTEGER */ - case 138: /* tagitem ::= MINUS FLOAT */ yytestcase(yyruleno==138); - case 139: /* tagitem ::= PLUS INTEGER */ yytestcase(yyruleno==139); - case 140: /* tagitem ::= PLUS FLOAT */ yytestcase(yyruleno==140); + case 140: /* tagitem ::= MINUS INTEGER */ + case 141: /* tagitem ::= MINUS FLOAT */ yytestcase(yyruleno==141); + case 142: /* tagitem ::= PLUS INTEGER */ yytestcase(yyruleno==142); + case 143: /* tagitem ::= PLUS FLOAT */ yytestcase(yyruleno==143); { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = yymsp[0].minor.yy0.type; @@ -2499,70 +2813,70 @@ static void yy_reduce( } yymsp[-1].minor.yy430 = yylhsminor.yy430; break; - case 141: /* select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */ + case 144: /* select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */ { yylhsminor.yy148 = tSetQuerySqlElems(&yymsp[-11].minor.yy0, yymsp[-10].minor.yy166, yymsp[-9].minor.yy421, yymsp[-8].minor.yy78, yymsp[-4].minor.yy421, yymsp[-3].minor.yy421, &yymsp[-7].minor.yy400, &yymsp[-5].minor.yy0, yymsp[-6].minor.yy421, &yymsp[0].minor.yy167, &yymsp[-1].minor.yy167); } yymsp[-11].minor.yy148 = yylhsminor.yy148; break; - case 142: /* union ::= select */ + case 145: /* union ::= select */ { yylhsminor.yy153 = setSubclause(NULL, yymsp[0].minor.yy148); } yymsp[0].minor.yy153 = yylhsminor.yy153; break; - case 143: /* union ::= LP union RP */ + case 146: /* union ::= LP union RP */ { yymsp[-2].minor.yy153 = yymsp[-1].minor.yy153; } break; - case 144: /* union ::= union UNION ALL select */ + case 147: /* union ::= union UNION ALL select */ { yylhsminor.yy153 = appendSelectClause(yymsp[-3].minor.yy153, yymsp[0].minor.yy148); } yymsp[-3].minor.yy153 = yylhsminor.yy153; break; - case 145: /* union ::= union UNION ALL LP select RP */ + case 148: /* union ::= union UNION ALL LP select RP */ { yylhsminor.yy153 = appendSelectClause(yymsp[-5].minor.yy153, yymsp[-1].minor.yy148); } yymsp[-5].minor.yy153 = yylhsminor.yy153; break; - case 146: /* cmd ::= union */ + case 149: /* cmd ::= union */ { setSqlInfo(pInfo, yymsp[0].minor.yy153, NULL, TSDB_SQL_SELECT); } break; - case 147: /* select ::= SELECT selcollist */ + case 150: /* select ::= SELECT selcollist */ { yylhsminor.yy148 = tSetQuerySqlElems(&yymsp[-1].minor.yy0, yymsp[0].minor.yy166, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); } yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 148: /* sclp ::= selcollist COMMA */ + case 151: /* sclp ::= selcollist COMMA */ {yylhsminor.yy166 = yymsp[-1].minor.yy166;} yymsp[-1].minor.yy166 = yylhsminor.yy166; break; - case 149: /* sclp ::= */ + case 152: /* sclp ::= */ {yymsp[1].minor.yy166 = 0;} break; - case 150: /* selcollist ::= sclp expr as */ + case 153: /* selcollist ::= sclp expr as */ { yylhsminor.yy166 = tSqlExprListAppend(yymsp[-2].minor.yy166, yymsp[-1].minor.yy78, yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0); } yymsp[-2].minor.yy166 = yylhsminor.yy166; break; - case 151: /* selcollist ::= sclp STAR */ + case 154: /* selcollist ::= sclp STAR */ { tSQLExpr *pNode = tSqlExprIdValueCreate(NULL, TK_ALL); yylhsminor.yy166 = tSqlExprListAppend(yymsp[-1].minor.yy166, pNode, 0); } yymsp[-1].minor.yy166 = yylhsminor.yy166; break; - case 152: /* as ::= AS ids */ + case 155: /* as ::= AS ids */ { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } break; - case 153: /* as ::= ids */ + case 156: /* as ::= ids */ { yylhsminor.yy0 = yymsp[0].minor.yy0; } yymsp[0].minor.yy0 = yylhsminor.yy0; break; - case 154: /* as ::= */ + case 157: /* as ::= */ { yymsp[1].minor.yy0.n = 0; } break; - case 155: /* from ::= FROM tablelist */ + case 158: /* from ::= FROM tablelist */ {yymsp[-1].minor.yy421 = yymsp[0].minor.yy421;} break; - case 156: /* tablelist ::= ids cpxName */ + case 159: /* tablelist ::= ids cpxName */ { toTSDBType(yymsp[-1].minor.yy0.type); yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; @@ -2571,7 +2885,7 @@ static void yy_reduce( } yymsp[-1].minor.yy421 = yylhsminor.yy421; break; - case 157: /* tablelist ::= ids cpxName ids */ + case 160: /* tablelist ::= ids cpxName ids */ { toTSDBType(yymsp[-2].minor.yy0.type); toTSDBType(yymsp[0].minor.yy0.type); @@ -2581,7 +2895,7 @@ static void yy_reduce( } yymsp[-2].minor.yy421 = yylhsminor.yy421; break; - case 158: /* tablelist ::= tablelist COMMA ids cpxName */ + case 161: /* tablelist ::= tablelist COMMA ids cpxName */ { toTSDBType(yymsp[-1].minor.yy0.type); yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; @@ -2590,7 +2904,7 @@ static void yy_reduce( } yymsp[-3].minor.yy421 = yylhsminor.yy421; break; - case 159: /* tablelist ::= tablelist COMMA ids cpxName ids */ + case 162: /* tablelist ::= tablelist COMMA ids cpxName ids */ { toTSDBType(yymsp[-2].minor.yy0.type); toTSDBType(yymsp[0].minor.yy0.type); @@ -2600,23 +2914,23 @@ static void yy_reduce( } yymsp[-4].minor.yy421 = yylhsminor.yy421; break; - case 160: /* tmvar ::= VARIABLE */ + case 163: /* tmvar ::= VARIABLE */ {yylhsminor.yy0 = yymsp[0].minor.yy0;} yymsp[0].minor.yy0 = yylhsminor.yy0; break; - case 161: /* interval_opt ::= INTERVAL LP tmvar RP */ + case 164: /* interval_opt ::= INTERVAL LP tmvar RP */ {yymsp[-3].minor.yy400.interval = yymsp[-1].minor.yy0; yymsp[-3].minor.yy400.offset.n = 0; yymsp[-3].minor.yy400.offset.z = NULL; yymsp[-3].minor.yy400.offset.type = 0;} break; - case 162: /* interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */ + case 165: /* interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */ {yymsp[-5].minor.yy400.interval = yymsp[-3].minor.yy0; yymsp[-5].minor.yy400.offset = yymsp[-1].minor.yy0;} break; - case 163: /* interval_opt ::= */ + case 166: /* interval_opt ::= */ {memset(&yymsp[1].minor.yy400, 0, sizeof(yymsp[1].minor.yy400));} break; - case 164: /* fill_opt ::= */ + case 167: /* fill_opt ::= */ {yymsp[1].minor.yy421 = 0; } break; - case 165: /* fill_opt ::= FILL LP ID COMMA tagitemlist RP */ + case 168: /* fill_opt ::= FILL LP ID COMMA tagitemlist RP */ { tVariant A = {0}; toTSDBType(yymsp[-3].minor.yy0.type); @@ -2626,37 +2940,37 @@ static void yy_reduce( yymsp[-5].minor.yy421 = yymsp[-1].minor.yy421; } break; - case 166: /* fill_opt ::= FILL LP ID RP */ + case 169: /* fill_opt ::= FILL LP ID RP */ { toTSDBType(yymsp[-1].minor.yy0.type); yymsp[-3].minor.yy421 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1); } break; - case 167: /* sliding_opt ::= SLIDING LP tmvar RP */ + case 170: /* sliding_opt ::= SLIDING LP tmvar RP */ {yymsp[-3].minor.yy0 = yymsp[-1].minor.yy0; } break; - case 168: /* sliding_opt ::= */ + case 171: /* sliding_opt ::= */ {yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.z = NULL; yymsp[1].minor.yy0.type = 0; } break; - case 169: /* orderby_opt ::= */ + case 172: /* orderby_opt ::= */ {yymsp[1].minor.yy421 = 0;} break; - case 170: /* orderby_opt ::= ORDER BY sortlist */ + case 173: /* orderby_opt ::= ORDER BY sortlist */ {yymsp[-2].minor.yy421 = yymsp[0].minor.yy421;} break; - case 171: /* sortlist ::= sortlist COMMA item sortorder */ + case 174: /* sortlist ::= sortlist COMMA item sortorder */ { yylhsminor.yy421 = tVariantListAppend(yymsp[-3].minor.yy421, &yymsp[-1].minor.yy430, yymsp[0].minor.yy96); } yymsp[-3].minor.yy421 = yylhsminor.yy421; break; - case 172: /* sortlist ::= item sortorder */ + case 175: /* sortlist ::= item sortorder */ { yylhsminor.yy421 = tVariantListAppend(NULL, &yymsp[-1].minor.yy430, yymsp[0].minor.yy96); } yymsp[-1].minor.yy421 = yylhsminor.yy421; break; - case 173: /* item ::= ids cpxName */ + case 176: /* item ::= ids cpxName */ { toTSDBType(yymsp[-1].minor.yy0.type); yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; @@ -2665,240 +2979,240 @@ static void yy_reduce( } yymsp[-1].minor.yy430 = yylhsminor.yy430; break; - case 174: /* sortorder ::= ASC */ + case 177: /* sortorder ::= ASC */ { yymsp[0].minor.yy96 = TSDB_ORDER_ASC; } break; - case 175: /* sortorder ::= DESC */ + case 178: /* sortorder ::= DESC */ { yymsp[0].minor.yy96 = TSDB_ORDER_DESC;} break; - case 176: /* sortorder ::= */ + case 179: /* sortorder ::= */ { yymsp[1].minor.yy96 = TSDB_ORDER_ASC; } break; - case 177: /* groupby_opt ::= */ + case 180: /* groupby_opt ::= */ { yymsp[1].minor.yy421 = 0;} break; - case 178: /* groupby_opt ::= GROUP BY grouplist */ + case 181: /* groupby_opt ::= GROUP BY grouplist */ { yymsp[-2].minor.yy421 = yymsp[0].minor.yy421;} break; - case 179: /* grouplist ::= grouplist COMMA item */ + case 182: /* grouplist ::= grouplist COMMA item */ { yylhsminor.yy421 = tVariantListAppend(yymsp[-2].minor.yy421, &yymsp[0].minor.yy430, -1); } yymsp[-2].minor.yy421 = yylhsminor.yy421; break; - case 180: /* grouplist ::= item */ + case 183: /* grouplist ::= item */ { yylhsminor.yy421 = tVariantListAppend(NULL, &yymsp[0].minor.yy430, -1); } yymsp[0].minor.yy421 = yylhsminor.yy421; break; - case 181: /* having_opt ::= */ - case 191: /* where_opt ::= */ yytestcase(yyruleno==191); - case 229: /* expritem ::= */ yytestcase(yyruleno==229); + case 184: /* having_opt ::= */ + case 194: /* where_opt ::= */ yytestcase(yyruleno==194); + case 232: /* expritem ::= */ yytestcase(yyruleno==232); {yymsp[1].minor.yy78 = 0;} break; - case 182: /* having_opt ::= HAVING expr */ - case 192: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==192); + case 185: /* having_opt ::= HAVING expr */ + case 195: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==195); {yymsp[-1].minor.yy78 = yymsp[0].minor.yy78;} break; - case 183: /* limit_opt ::= */ - case 187: /* slimit_opt ::= */ yytestcase(yyruleno==187); + case 186: /* limit_opt ::= */ + case 190: /* slimit_opt ::= */ yytestcase(yyruleno==190); {yymsp[1].minor.yy167.limit = -1; yymsp[1].minor.yy167.offset = 0;} break; - case 184: /* limit_opt ::= LIMIT signed */ - case 188: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==188); + case 187: /* limit_opt ::= LIMIT signed */ + case 191: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==191); {yymsp[-1].minor.yy167.limit = yymsp[0].minor.yy325; yymsp[-1].minor.yy167.offset = 0;} break; - case 185: /* limit_opt ::= LIMIT signed OFFSET signed */ + case 188: /* limit_opt ::= LIMIT signed OFFSET signed */ { yymsp[-3].minor.yy167.limit = yymsp[-2].minor.yy325; yymsp[-3].minor.yy167.offset = yymsp[0].minor.yy325;} break; - case 186: /* limit_opt ::= LIMIT signed COMMA signed */ + case 189: /* limit_opt ::= LIMIT signed COMMA signed */ { yymsp[-3].minor.yy167.limit = yymsp[0].minor.yy325; yymsp[-3].minor.yy167.offset = yymsp[-2].minor.yy325;} break; - case 189: /* slimit_opt ::= SLIMIT signed SOFFSET signed */ + case 192: /* slimit_opt ::= SLIMIT signed SOFFSET signed */ {yymsp[-3].minor.yy167.limit = yymsp[-2].minor.yy325; yymsp[-3].minor.yy167.offset = yymsp[0].minor.yy325;} break; - case 190: /* slimit_opt ::= SLIMIT signed COMMA signed */ + case 193: /* slimit_opt ::= SLIMIT signed COMMA signed */ {yymsp[-3].minor.yy167.limit = yymsp[0].minor.yy325; yymsp[-3].minor.yy167.offset = yymsp[-2].minor.yy325;} break; - case 193: /* expr ::= LP expr RP */ + case 196: /* expr ::= LP expr RP */ {yylhsminor.yy78 = yymsp[-1].minor.yy78; yylhsminor.yy78->token.z = yymsp[-2].minor.yy0.z; yylhsminor.yy78->token.n = (yymsp[0].minor.yy0.z - yymsp[-2].minor.yy0.z + 1);} yymsp[-2].minor.yy78 = yylhsminor.yy78; break; - case 194: /* expr ::= ID */ + case 197: /* expr ::= ID */ { yylhsminor.yy78 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_ID);} yymsp[0].minor.yy78 = yylhsminor.yy78; break; - case 195: /* expr ::= ID DOT ID */ + case 198: /* expr ::= ID DOT ID */ { yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy78 = tSqlExprIdValueCreate(&yymsp[-2].minor.yy0, TK_ID);} yymsp[-2].minor.yy78 = yylhsminor.yy78; break; - case 196: /* expr ::= ID DOT STAR */ + case 199: /* expr ::= ID DOT STAR */ { yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy78 = tSqlExprIdValueCreate(&yymsp[-2].minor.yy0, TK_ALL);} yymsp[-2].minor.yy78 = yylhsminor.yy78; break; - case 197: /* expr ::= INTEGER */ + case 200: /* expr ::= INTEGER */ { yylhsminor.yy78 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_INTEGER);} yymsp[0].minor.yy78 = yylhsminor.yy78; break; - case 198: /* expr ::= MINUS INTEGER */ - case 199: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==199); + case 201: /* expr ::= MINUS INTEGER */ + case 202: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==202); { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy78 = tSqlExprIdValueCreate(&yymsp[-1].minor.yy0, TK_INTEGER);} yymsp[-1].minor.yy78 = yylhsminor.yy78; break; - case 200: /* expr ::= FLOAT */ + case 203: /* expr ::= FLOAT */ { yylhsminor.yy78 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_FLOAT);} yymsp[0].minor.yy78 = yylhsminor.yy78; break; - case 201: /* expr ::= MINUS FLOAT */ - case 202: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==202); + case 204: /* expr ::= MINUS FLOAT */ + case 205: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==205); { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yylhsminor.yy78 = tSqlExprIdValueCreate(&yymsp[-1].minor.yy0, TK_FLOAT);} yymsp[-1].minor.yy78 = yylhsminor.yy78; break; - case 203: /* expr ::= STRING */ + case 206: /* expr ::= STRING */ { yylhsminor.yy78 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_STRING);} yymsp[0].minor.yy78 = yylhsminor.yy78; break; - case 204: /* expr ::= NOW */ + case 207: /* expr ::= NOW */ { yylhsminor.yy78 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_NOW); } yymsp[0].minor.yy78 = yylhsminor.yy78; break; - case 205: /* expr ::= VARIABLE */ + case 208: /* expr ::= VARIABLE */ { yylhsminor.yy78 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_VARIABLE);} yymsp[0].minor.yy78 = yylhsminor.yy78; break; - case 206: /* expr ::= BOOL */ + case 209: /* expr ::= BOOL */ { yylhsminor.yy78 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_BOOL);} yymsp[0].minor.yy78 = yylhsminor.yy78; break; - case 207: /* expr ::= ID LP exprlist RP */ + case 210: /* expr ::= ID LP exprlist RP */ { yylhsminor.yy78 = tSqlExprCreateFunction(yymsp[-1].minor.yy166, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } yymsp[-3].minor.yy78 = yylhsminor.yy78; break; - case 208: /* expr ::= ID LP STAR RP */ + case 211: /* expr ::= ID LP STAR RP */ { yylhsminor.yy78 = tSqlExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } yymsp[-3].minor.yy78 = yylhsminor.yy78; break; - case 209: /* expr ::= expr IS NULL */ + case 212: /* expr ::= expr IS NULL */ {yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, NULL, TK_ISNULL);} yymsp[-2].minor.yy78 = yylhsminor.yy78; break; - case 210: /* expr ::= expr IS NOT NULL */ + case 213: /* expr ::= expr IS NOT NULL */ {yylhsminor.yy78 = tSqlExprCreate(yymsp[-3].minor.yy78, NULL, TK_NOTNULL);} yymsp[-3].minor.yy78 = yylhsminor.yy78; break; - case 211: /* expr ::= expr LT expr */ + case 214: /* expr ::= expr LT expr */ {yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_LT);} yymsp[-2].minor.yy78 = yylhsminor.yy78; break; - case 212: /* expr ::= expr GT expr */ + case 215: /* expr ::= expr GT expr */ {yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_GT);} yymsp[-2].minor.yy78 = yylhsminor.yy78; break; - case 213: /* expr ::= expr LE expr */ + case 216: /* expr ::= expr LE expr */ {yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_LE);} yymsp[-2].minor.yy78 = yylhsminor.yy78; break; - case 214: /* expr ::= expr GE expr */ + case 217: /* expr ::= expr GE expr */ {yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_GE);} yymsp[-2].minor.yy78 = yylhsminor.yy78; break; - case 215: /* expr ::= expr NE expr */ + case 218: /* expr ::= expr NE expr */ {yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_NE);} yymsp[-2].minor.yy78 = yylhsminor.yy78; break; - case 216: /* expr ::= expr EQ expr */ + case 219: /* expr ::= expr EQ expr */ {yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_EQ);} yymsp[-2].minor.yy78 = yylhsminor.yy78; break; - case 217: /* expr ::= expr AND expr */ + case 220: /* expr ::= expr AND expr */ {yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_AND);} yymsp[-2].minor.yy78 = yylhsminor.yy78; break; - case 218: /* expr ::= expr OR expr */ + case 221: /* expr ::= expr OR expr */ {yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_OR); } yymsp[-2].minor.yy78 = yylhsminor.yy78; break; - case 219: /* expr ::= expr PLUS expr */ + case 222: /* expr ::= expr PLUS expr */ {yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_PLUS); } yymsp[-2].minor.yy78 = yylhsminor.yy78; break; - case 220: /* expr ::= expr MINUS expr */ + case 223: /* expr ::= expr MINUS expr */ {yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_MINUS); } yymsp[-2].minor.yy78 = yylhsminor.yy78; break; - case 221: /* expr ::= expr STAR expr */ + case 224: /* expr ::= expr STAR expr */ {yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_STAR); } yymsp[-2].minor.yy78 = yylhsminor.yy78; break; - case 222: /* expr ::= expr SLASH expr */ + case 225: /* expr ::= expr SLASH expr */ {yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_DIVIDE);} yymsp[-2].minor.yy78 = yylhsminor.yy78; break; - case 223: /* expr ::= expr REM expr */ + case 226: /* expr ::= expr REM expr */ {yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_REM); } yymsp[-2].minor.yy78 = yylhsminor.yy78; break; - case 224: /* expr ::= expr LIKE expr */ + case 227: /* expr ::= expr LIKE expr */ {yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_LIKE); } yymsp[-2].minor.yy78 = yylhsminor.yy78; break; - case 225: /* expr ::= expr IN LP exprlist RP */ + case 228: /* expr ::= expr IN LP exprlist RP */ {yylhsminor.yy78 = tSqlExprCreate(yymsp[-4].minor.yy78, (tSQLExpr*)yymsp[-1].minor.yy166, TK_IN); } yymsp[-4].minor.yy78 = yylhsminor.yy78; break; - case 226: /* exprlist ::= exprlist COMMA expritem */ + case 229: /* exprlist ::= exprlist COMMA expritem */ {yylhsminor.yy166 = tSqlExprListAppend(yymsp[-2].minor.yy166,yymsp[0].minor.yy78,0);} yymsp[-2].minor.yy166 = yylhsminor.yy166; break; - case 227: /* exprlist ::= expritem */ + case 230: /* exprlist ::= expritem */ {yylhsminor.yy166 = tSqlExprListAppend(0,yymsp[0].minor.yy78,0);} yymsp[0].minor.yy166 = yylhsminor.yy166; break; - case 228: /* expritem ::= expr */ + case 231: /* expritem ::= expr */ {yylhsminor.yy78 = yymsp[0].minor.yy78;} yymsp[0].minor.yy78 = yylhsminor.yy78; break; - case 230: /* cmd ::= RESET QUERY CACHE */ + case 233: /* cmd ::= RESET QUERY CACHE */ { setDCLSQLElems(pInfo, TSDB_SQL_RESET_CACHE, 0);} break; - case 231: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ + case 234: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy421, NULL, TSDB_ALTER_TABLE_ADD_COLUMN); + SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy421, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 232: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ + case 235: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; toTSDBType(yymsp[0].minor.yy0.type); SArray* K = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1); - SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, NULL, K, TSDB_ALTER_TABLE_DROP_COLUMN); + SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, NULL, K, TSDB_ALTER_TABLE_DROP_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 233: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ + case 236: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy421, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN); + SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy421, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 234: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ + case 237: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; toTSDBType(yymsp[0].minor.yy0.type); SArray* A = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1); - SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN); + SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 235: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ + case 238: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ { yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; @@ -2908,11 +3222,11 @@ static void yy_reduce( toTSDBType(yymsp[0].minor.yy0.type); A = tVariantListAppendToken(A, &yymsp[0].minor.yy0, -1); - SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&yymsp[-5].minor.yy0, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN); + SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&yymsp[-5].minor.yy0, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 236: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ + case 239: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ { yymsp[-6].minor.yy0.n += yymsp[-5].minor.yy0.n; @@ -2920,26 +3234,76 @@ static void yy_reduce( SArray* A = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1); A = tVariantListAppend(A, &yymsp[0].minor.yy430, -1); - SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&yymsp[-6].minor.yy0, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL); + SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&yymsp[-6].minor.yy0, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, -1); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); +} + break; + case 240: /* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ +{ + yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; + SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy421, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, TSDB_SUPER_TABLE); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); +} + break; + case 241: /* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ +{ + yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; + + toTSDBType(yymsp[0].minor.yy0.type); + SArray* K = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1); + + SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, NULL, K, TSDB_ALTER_TABLE_DROP_COLUMN, TSDB_SUPER_TABLE); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); +} + break; + case 242: /* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ +{ + yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; + SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy421, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, TSDB_SUPER_TABLE); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); +} + break; + case 243: /* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ +{ + yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; + + toTSDBType(yymsp[0].minor.yy0.type); + SArray* A = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1); + + SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN, TSDB_SUPER_TABLE); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); +} + break; + case 244: /* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ +{ + yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; + + toTSDBType(yymsp[-1].minor.yy0.type); + SArray* A = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1); + + toTSDBType(yymsp[0].minor.yy0.type); + A = tVariantListAppendToken(A, &yymsp[0].minor.yy0, -1); + + SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&yymsp[-5].minor.yy0, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 237: /* cmd ::= KILL CONNECTION INTEGER */ + case 245: /* cmd ::= KILL CONNECTION INTEGER */ {setKillSql(pInfo, TSDB_SQL_KILL_CONNECTION, &yymsp[0].minor.yy0);} break; - case 238: /* cmd ::= KILL STREAM INTEGER COLON INTEGER */ + case 246: /* cmd ::= KILL STREAM INTEGER COLON INTEGER */ {yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_STREAM, &yymsp[-2].minor.yy0);} break; - case 239: /* cmd ::= KILL QUERY INTEGER COLON INTEGER */ + case 247: /* cmd ::= KILL QUERY INTEGER COLON INTEGER */ {yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_QUERY, &yymsp[-2].minor.yy0);} break; default: break; /********** End reduce actions ************************************************/ }; - assert( yyrulenostateno = (YYACTIONTYPE)yyact; yymsp->major = (YYCODETYPE)yygoto; yyTraceShift(yypParser, yyact, "... then shift"); + return yyact; } /* @@ -2963,7 +3328,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); @@ -2974,7 +3340,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 */ @@ -2986,7 +3353,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 ****************************************/ @@ -3012,7 +3380,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 } /* @@ -3021,7 +3390,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); @@ -3036,7 +3406,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. @@ -3065,45 +3436,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); @@ -3154,10 +3527,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); } @@ -3174,6 +3546,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 @@ -3184,8 +3558,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: ** @@ -3207,10 +3580,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; @@ -3225,3 +3598,17 @@ 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 + assert( iToken<(int)(sizeof(yyFallback)/sizeof(yyFallback[0])) ); + return yyFallback[iToken]; +#else + (void)iToken; + return 0; +#endif +} diff --git a/tests/examples/JDBC/JDBCDemo/src/main/java/com/taosdata/example/JDBCDemo.java b/tests/examples/JDBC/JDBCDemo/src/main/java/com/taosdata/example/JDBCDemo.java index e569de10cf7894aa04fc3cb5bdb8354b581d5a93..0fa0059805e54893a3c25a4dbd7a0f4d67207b57 100644 --- a/tests/examples/JDBC/JDBCDemo/src/main/java/com/taosdata/example/JDBCDemo.java +++ b/tests/examples/JDBC/JDBCDemo/src/main/java/com/taosdata/example/JDBCDemo.java @@ -48,7 +48,6 @@ public class JDBCDemo { Class.forName("com.taosdata.jdbc.TSDBDriver"); } Properties properties = new Properties(); - properties.setProperty("host", host); properties.setProperty("charset", "UTF-8"); properties.setProperty("locale", "en_US.UTF-8"); properties.setProperty("timezone", "UTC-8"); diff --git a/tests/examples/JDBC/JDBCDemo/src/main/java/com/taosdata/example/JdbcRestfulDemo.java b/tests/examples/JDBC/JDBCDemo/src/main/java/com/taosdata/example/JdbcRestfulDemo.java new file mode 100644 index 0000000000000000000000000000000000000000..880bcbfc6fcda29c7225090707d694b3d0f7d4ea --- /dev/null +++ b/tests/examples/JDBC/JDBCDemo/src/main/java/com/taosdata/example/JdbcRestfulDemo.java @@ -0,0 +1,45 @@ +package com.taosdata.example; + +import java.sql.*; +import java.util.Properties; + +public class JdbcRestfulDemo { + private static final String host = "master"; + + public static void main(String[] args) { + try { + // load JDBC-restful driver + Class.forName("com.taosdata.jdbc.rs.RestfulDriver"); + // use port 6041 in url when use JDBC-restful + String url = "jdbc:TAOS-RS://" + host + ":6041/?user=root&password=taosdata"; + + Properties properties = new Properties(); + properties.setProperty("charset", "UTF-8"); + properties.setProperty("locale", "en_US.UTF-8"); + properties.setProperty("timezone", "UTC-8"); + + Connection conn = DriverManager.getConnection(url, properties); + Statement stmt = conn.createStatement(); + + stmt.execute("create database if not exists restful_test"); + stmt.execute("use restful_test"); + stmt.execute("create table restful_test.weather(ts timestamp, temperature float) tags(location nchar(64))"); + stmt.executeUpdate("insert into t1 using restful_test.weather tags('北京') values(now, 18.2)"); + ResultSet rs = stmt.executeQuery("select * from restful_test.weather"); + ResultSetMetaData meta = rs.getMetaData(); + while (rs.next()) { + for (int i = 1; i <= meta.getColumnCount(); i++) { + System.out.print(meta.getColumnLabel(i) + ": " + rs.getString(i) + "\t"); + } + System.out.println(); + } + + stmt.close(); + conn.close(); + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } catch (SQLException e) { + e.printStackTrace(); + } + } +} diff --git a/tests/examples/JDBC/taosdemo/pom.xml b/tests/examples/JDBC/taosdemo/pom.xml index 15b22917b6103740ac419e046d5fd8fa79363d25..72adbd0fa3664572e1b725f1769cad031bc58c10 100644 --- a/tests/examples/JDBC/taosdemo/pom.xml +++ b/tests/examples/JDBC/taosdemo/pom.xml @@ -67,9 +67,9 @@ com.taosdata.jdbc taos-jdbcdriver - 2.0.15 - system - ${project.basedir}/src/main/resources/lib/taos-jdbcdriver-2.0.15-dist.jar + 2.0.16 + + diff --git a/tests/examples/JDBC/taosdemo/src/main/resources/lib/taos-jdbcdriver-2.0.15-dist.jar b/tests/examples/JDBC/taosdemo/src/main/resources/lib/taos-jdbcdriver-2.0.15-dist.jar deleted file mode 100644 index 58508b92e5afec7e400691d213940536e8abe5f6..0000000000000000000000000000000000000000 Binary files a/tests/examples/JDBC/taosdemo/src/main/resources/lib/taos-jdbcdriver-2.0.15-dist.jar and /dev/null differ diff --git a/tests/examples/nodejs/nodejsChecker.js b/tests/examples/nodejs/nodejsChecker.js index f838d5cc8465dba70b5372a5d7720a8cff69544a..e634a54ea1c56310bae7d38188590a0d7862f953 100644 --- a/tests/examples/nodejs/nodejsChecker.js +++ b/tests/examples/nodejs/nodejsChecker.js @@ -1,4 +1,5 @@ const taos = require('td2.0-connector'); +//const taos = require('../../../src/connector/nodejs/'); var host = null; diff --git a/tests/pytest/account/account_create.py b/tests/pytest/account/account_create.py index 85adfff19994a3fbb12611e28d9872fb6cb1aeca..c008acccd8d8d33af0ca77bd161d4ab020c1543e 100644 --- a/tests/pytest/account/account_create.py +++ b/tests/pytest/account/account_create.py @@ -24,6 +24,17 @@ class TDTestCase: tdSql.init(conn.cursor(), logSql) def run(self): + tdSql.query("show users") + rows = tdSql.queryRows + + tdSql.execute("create user test PASS 'test' ") + tdSql.query("show users") + tdSql.checkRows(rows + 1) + + tdSql.error("create user tdenginetdenginetdengine PASS 'test' ") + + tdSql.error("create user tdenginet PASS '1234512345123456' ") + try: tdSql.execute("create account a&cc PASS 'pass123'") except Exception as e: @@ -31,6 +42,7 @@ class TDTestCase: return tdLog.exit("drop built-in user is error.") + def stop(self): tdSql.close() diff --git a/tests/pytest/alter/alter_table.py b/tests/pytest/alter/alter_table.py index 2982492f6567ad54a62a3fcca44d4f1ac9560697..48b0154361803c9f614e64b1f66e416613e83131 100644 --- a/tests/pytest/alter/alter_table.py +++ b/tests/pytest/alter/alter_table.py @@ -126,6 +126,8 @@ class TDTestCase: for i in range(2, size): tdSql.checkData(0, i, self.rowNum * (size - i)) + tdSql.error("alter local debugflag 143") + tdSql.execute("create table st(ts timestamp, c1 int) tags(t1 float)") tdSql.execute("create table t0 using st tags(null)") tdSql.execute("alter table t0 set tag t1=2.1") diff --git a/tests/pytest/fulltest.sh b/tests/pytest/fulltest.sh index d9bc185b6c326b79d933dafc50cd7db0e0d396f4..3be784ae95c84599c773d5c52b68ef5a630482ea 100755 --- a/tests/pytest/fulltest.sh +++ b/tests/pytest/fulltest.sh @@ -175,6 +175,7 @@ python3 ./test.py -f query/bug2119.py python3 ./test.py -f query/isNullTest.py python3 ./test.py -f query/queryWithTaosdKilled.py python3 ./test.py -f query/floatCompare.py +python3 ./test.py -f query/queryGroupbySort.py #stream python3 ./test.py -f stream/metric_1.py @@ -258,4 +259,7 @@ python3 ./test.py -f update/merge_commit_last.py python3 ./test.py -f update/bug_td2279.py # wal -python3 ./test.py -f wal/addOldWalTest.py \ No newline at end of file +python3 ./test.py -f wal/addOldWalTest.py + +# account +python3 ./test.py -f account/account_create.py \ No newline at end of file diff --git a/tests/pytest/query/queryGroupbySort.py b/tests/pytest/query/queryGroupbySort.py index 28ef897f42924d3e41c6598cac6b4c51e33d38ef..80f6d55aae1ae79cafbe651cc99db1d301dd90fc 100644 --- a/tests/pytest/query/queryGroupbySort.py +++ b/tests/pytest/query/queryGroupbySort.py @@ -28,19 +28,24 @@ class TDTestCase: def run(self): tdSql.prepare() - tdSql.execute( - "create table stb(ts timestamp,i int) tags (p_id nchar(20));") - tdSql.execute( - "insert into tb using stb tags('11231') values (%d, %d) (%d, %d) (%d, %d) (%d, %d)" - % (self.ts, 12, self.ts + 1, 15, self.ts + 2, 15, self.ts + 3, 12)) - - tdSql.query(''' select last(ts) p_time,i from stb where p_id='11231' and ts>=%d and ts <=%d - group by i order by time desc limit 100 ''' % (self.ts, self.ts + 4)) - tdSql.checkRows(2) - tdSql.checkData(0, 0, "2018-09-17 09:00:00.003000") - tdSql.checkData(1, 0, "2018-09-17 09:00:00.002000") - - + tdSql.execute("CREATE TABLE meters (ts timestamp, current float, voltage int, phase float) TAGS (location binary(64), groupId int)") + tdSql.execute("CREATE TABLE D1001 USING meters TAGS ('Beijing.Chaoyang', 2)") + tdSql.execute("CREATE TABLE D1002 USING meters TAGS ('Beijing.Chaoyang', 3)") + tdSql.execute("INSERT INTO D1001 VALUES (1538548685000, 10.3, 219, 0.31) (1538548695000, 12.6, 218, 0.33) (1538548696800, 12.3, 221, 0.31)") + tdSql.execute("INSERT INTO D1002 VALUES (1538548685001, 10.5, 220, 0.28) (1538548696800, 12.3, 221, 0.31)") + + tdSql.query("SELECT SUM(current), AVG(voltage) FROM meters WHERE groupId > 1 INTERVAL(1s) GROUP BY location order by ts DESC") + tdSql.checkRows(3) + tdSql.checkData(0, 0, "2018-10-03 14:38:16") + tdSql.checkData(1, 0, "2018-10-03 14:38:15") + tdSql.checkData(2, 0, "2018-10-03 14:38:05") + + tdSql.query("SELECT SUM(current), AVG(voltage) FROM meters WHERE groupId > 1 INTERVAL(1s) GROUP BY location order by ts ASC") + tdSql.checkRows(3) + tdSql.checkData(0, 0, "2018-10-03 14:38:05") + tdSql.checkData(1, 0, "2018-10-03 14:38:15") + tdSql.checkData(2, 0, "2018-10-03 14:38:16") + def stop(self): tdSql.close() tdLog.success("%s successfully executed" % __file__) diff --git a/tests/script/general/http/restful_full.sim b/tests/script/general/http/restful_full.sim index 7e12d30ac91eb49025fbebed05336e15cc6900ac..645ebd278872f8c9d19d8353d8aa857ab0ae73cb 100644 --- a/tests/script/general/http/restful_full.sim +++ b/tests/script/general/http/restful_full.sim @@ -15,6 +15,7 @@ print =============== step1 - login system_content curl 127.0.0.1:7111/rest/ print 1-> $system_content if $system_content != @{"status":"error","code":4357,"desc":"no auth info input"}@ then + print $system_content return -1 endi diff --git a/tests/script/general/parser/join.sim b/tests/script/general/parser/join.sim index d18a3d76760bb61f7ddd5d37f37b073ca40ffba6..56f115051cd4e558839d958a5177164b9fcf7a91 100644 --- a/tests/script/general/parser/join.sim +++ b/tests/script/general/parser/join.sim @@ -415,6 +415,7 @@ sql select count(join_mt0.c1), sum(join_mt1.c2), first(join_mt0.c5), last(join_m $val = 100 if $rows != $val then + print $rows return -1 endi @@ -514,4 +515,4 @@ sql drop table tm2; sql select count(*) from m1, m2 where m1.ts=m2.ts and m1.b=m2.a; sql drop database ux1; -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