Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
63bcf688
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
63bcf688
编写于
12月 08, 2021
作者:
H
huolibo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change ? to contains in json tag
上级
62e497e8
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
13 deletion
+13
-13
src/connector/jdbc/src/test/java/com/taosdata/jdbc/JsonTagTest.java
...tor/jdbc/src/test/java/com/taosdata/jdbc/JsonTagTest.java
+13
-13
未找到文件。
src/connector/jdbc/src/test/java/com/taosdata/jdbc/JsonTagTest.java
浏览文件 @
63bcf688
...
...
@@ -60,13 +60,13 @@ public class JsonTagTest {
"select * from jsons1 where jtag->''=9"
,
"select -> from jsons1"
,
"select ? from jsons1"
,
"select * from jsons1 where
?
"
,
"select * from jsons1 where
contains
"
,
"select * from jsons1 where jtag->"
,
"select jtag->location from jsons1"
,
"select jtag
?
location from jsons1"
,
"select * from jsons1 where jtag
?
location"
,
"select * from jsons1 where jtag
?
''"
,
"select * from jsons1 where jtag
?
'location'='beijing'"
,
"select jtag
contains
location from jsons1"
,
"select * from jsons1 where jtag
contains
location"
,
"select * from jsons1 where jtag
contains
''"
,
"select * from jsons1 where jtag
contains
'location'='beijing'"
,
// test where with json tag
"select * from jsons1_1 where jtag is not null"
,
"select * from jsons1 where jtag='{\"tag1\":11,\"tag2\":\"\"}'"
,
...
...
@@ -748,7 +748,7 @@ public class JsonTagTest {
// test ?
@Test
public
void
case09_select10
()
throws
SQLException
{
ResultSet
resultSet
=
statement
.
executeQuery
(
"select * from jsons1 where jtag
?
'tag1'"
);
ResultSet
resultSet
=
statement
.
executeQuery
(
"select * from jsons1 where jtag
contains
'tag1'"
);
int
count
=
0
;
while
(
resultSet
.
next
())
{
count
++;
...
...
@@ -759,7 +759,7 @@ public class JsonTagTest {
@Test
public
void
case09_select11
()
throws
SQLException
{
ResultSet
resultSet
=
statement
.
executeQuery
(
"select * from jsons1 where jtag
?
'tag3'"
);
ResultSet
resultSet
=
statement
.
executeQuery
(
"select * from jsons1 where jtag
contains
'tag3'"
);
int
count
=
0
;
while
(
resultSet
.
next
())
{
count
++;
...
...
@@ -770,7 +770,7 @@ public class JsonTagTest {
@Test
public
void
case09_select12
()
throws
SQLException
{
ResultSet
resultSet
=
statement
.
executeQuery
(
"select * from jsons1 where jtag
?
'tag_no_exist'"
);
ResultSet
resultSet
=
statement
.
executeQuery
(
"select * from jsons1 where jtag
contains
'tag_no_exist'"
);
int
count
=
0
;
while
(
resultSet
.
next
())
{
count
++;
...
...
@@ -826,7 +826,7 @@ public class JsonTagTest {
@Test
public
void
case10_selectAndOr05
()
throws
SQLException
{
ResultSet
resultSet
=
statement
.
executeQuery
(
"select * from jsons1 where jtag->'tag1' is not null and jtag
?
'tag3'"
);
ResultSet
resultSet
=
statement
.
executeQuery
(
"select * from jsons1 where jtag->'tag1' is not null and jtag
contains
'tag3'"
);
int
count
=
0
;
while
(
resultSet
.
next
())
{
count
++;
...
...
@@ -837,7 +837,7 @@ public class JsonTagTest {
@Test
public
void
case10_selectAndOr06
()
throws
SQLException
{
ResultSet
resultSet
=
statement
.
executeQuery
(
"select * from jsons1 where jtag->'tag1'='femail' and jtag
?
'tag3'"
);
ResultSet
resultSet
=
statement
.
executeQuery
(
"select * from jsons1 where jtag->'tag1'='femail' and jtag
contains
'tag3'"
);
int
count
=
0
;
while
(
resultSet
.
next
())
{
count
++;
...
...
@@ -860,7 +860,7 @@ public class JsonTagTest {
@Test
public
void
case11_selectTbName02
()
throws
SQLException
{
ResultSet
resultSet
=
statement
.
executeQuery
(
"select * from jsons1 where tbname = 'jsons1_1' and jtag
?
'tag3'"
);
ResultSet
resultSet
=
statement
.
executeQuery
(
"select * from jsons1 where tbname = 'jsons1_1' and jtag
contains
'tag3'"
);
int
count
=
0
;
while
(
resultSet
.
next
())
{
count
++;
...
...
@@ -871,7 +871,7 @@ public class JsonTagTest {
@Test
public
void
case11_selectTbName03
()
throws
SQLException
{
ResultSet
resultSet
=
statement
.
executeQuery
(
"select * from jsons1 where tbname = 'jsons1_1' and jtag
?
'tag3' and dataint=3"
);
ResultSet
resultSet
=
statement
.
executeQuery
(
"select * from jsons1 where tbname = 'jsons1_1' and jtag
contains
'tag3' and dataint=3"
);
int
count
=
0
;
while
(
resultSet
.
next
())
{
count
++;
...
...
@@ -882,7 +882,7 @@ public class JsonTagTest {
@Test
public
void
case11_selectTbName04
()
throws
SQLException
{
ResultSet
resultSet
=
statement
.
executeQuery
(
"select * from jsons1 where tbname = 'jsons1_1' and jtag
?
'tag3' and dataint=23"
);
ResultSet
resultSet
=
statement
.
executeQuery
(
"select * from jsons1 where tbname = 'jsons1_1' and jtag
contains
'tag3' and dataint=23"
);
int
count
=
0
;
while
(
resultSet
.
next
())
{
count
++;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录