Skip to content

Commit

Permalink
add tests for emoji, chinese, utf8 and unicode
Browse files Browse the repository at this point in the history
  • Loading branch information
chengshiwen committed Aug 8, 2024
1 parent 5f6c640 commit 22b4d8a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
12 changes: 12 additions & 0 deletions script/query.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
# curl -X POST 'http://127.0.0.1:7076/api/v2/query' -H 'Content-type: application/vnd.flux' -d 'from(bucket:"db2") |> range(start:0) |> filter(fn: (r) => r._measurement == "cpu4")'
# curl -X POST 'http://127.0.0.1:7076/api/v2/query' -H 'Content-type: application/vnd.flux' -d "from(bucket:\"db1\") |> range(start:0) |> filter(fn: (r) => r._measurement == \"measurement with spaces, commas and 'quotes'\")"
# curl -X POST 'http://127.0.0.1:7076/api/v2/query' -H 'Content-type: application/vnd.flux' -d "from(bucket:\"db1\") |> range(start:0) |> filter(fn: (r) => r._measurement == \"'measurement with spaces, commas and 'quotes''\")"
# curl -X POST 'http://127.0.0.1:7076/api/v2/query' -H 'Content-type: application/vnd.flux' -d "from(bucket:\"db1\") |> range(start:0) |> filter(fn: (r) => r._measurement == \"measurement with emoji we⛅️ther\")"
# curl -X POST 'http://127.0.0.1:7076/api/v2/query' -H 'Content-type: application/vnd.flux' -d "from(bucket:\"db1\") |> range(start:0) |> filter(fn: (r) => r._measurement == \"measurement with 汉字 表\")"
# curl -X POST 'http://127.0.0.1:7076/api/v2/query' -H 'Content-type: application/vnd.flux' -d 'from(bucket:"db2") |> range(start:0) |> filter(fn: (r) => r._measurement == "measurement with spaces, commas and \"quotes\"")'
# curl -X POST 'http://127.0.0.1:7076/api/v2/query' -H 'Content-type: application/vnd.flux' -d 'from(bucket:"db2") |> range(start:0) |> filter(fn: (r) => r._measurement == "\"measurement with spaces, commas and \"quotes\"\"")'
# curl -X POST 'http://127.0.0.1:7076/api/v2/query' -H 'Content-type: application/vnd.flux' -d 'from(bucket:"db2") |> range(start:0) |> filter(fn: (r) => r._measurement == "\"measurement with quo⚡️es and emoji🔥\"")'


# echo ""
Expand Down Expand Up @@ -67,8 +70,11 @@ curl -G 'http://127.0.0.1:7076/query?db=db2' --data-urlencode 'q=select * from r
curl -G 'http://127.0.0.1:7076/query?db=db2' --data-urlencode 'q=select * from rp2.cpu4'
curl -G 'http://127.0.0.1:7076/query?db=db1' --data-urlencode "q=select * from \"measurement with spaces, commas and 'quotes'\""
curl -G 'http://127.0.0.1:7076/query?db=db1' --data-urlencode "q=select * from \"'measurement with spaces, commas and 'quotes''\""
curl -G 'http://127.0.0.1:7076/query?db=db1' --data-urlencode "q=select * from \"measurement with emoji we⛅️ther\""
curl -G 'http://127.0.0.1:7076/query?db=db1' --data-urlencode "q=select * from \"measurement with 汉字 表\""
curl -G 'http://127.0.0.1:7076/query?db=db2' --data-urlencode 'q=select * from "measurement with spaces, commas and \"quotes\""'
curl -G 'http://127.0.0.1:7076/query?db=db2' --data-urlencode 'q=select * from "\"measurement with spaces, commas and \"quotes\"\""'
curl -G 'http://127.0.0.1:7076/query?db=db2' --data-urlencode 'q=select * from "\"measurement with quo⚡️es and emoji🔥\""'

curl -G 'http://127.0.0.1:7076/query?db=db1' --data-urlencode 'q=show tag keys from cpu1'
curl -G 'http://127.0.0.1:7076/query' --data-urlencode 'q=show FIELD keys on db1 from cpu2'
Expand Down Expand Up @@ -178,16 +184,22 @@ curl -X POST 'http://127.0.0.1:7076/query?db=db2' --data-urlencode 'q=drop measu
curl -X POST 'http://127.0.0.1:7076/query?db=db2' --data-urlencode 'q=drop series from cpu4'
curl -X POST 'http://127.0.0.1:7076/query?db=db1' --data-urlencode "q=delete from \"measurement with spaces, commas and 'quotes'\""
curl -X POST 'http://127.0.0.1:7076/query?db=db1' --data-urlencode "q=drop measurement \"'measurement with spaces, commas and 'quotes''\""
curl -X POST 'http://127.0.0.1:7076/query?db=db1' --data-urlencode "q=delete from \"measurement with emoji we⛅️ther\""
curl -X POST 'http://127.0.0.1:7076/query?db=db1' --data-urlencode "q=drop measurement \"measurement with 汉字 表\""
curl -X POST 'http://127.0.0.1:7076/query?db=db2' --data-urlencode 'q=delete from "measurement with spaces, commas and \"quotes\""'
curl -X POST 'http://127.0.0.1:7076/query?db=db2' --data-urlencode 'q=drop measurement "\"measurement with spaces, commas and \"quotes\"\""'
curl -X POST 'http://127.0.0.1:7076/query?db=db2' --data-urlencode 'q=drop measurement "\"measurement with quo⚡️es and emoji🔥\""'
curl -G 'http://127.0.0.1:7076/query?db=db1' --data-urlencode 'q=select * from cpu1;'
curl -G 'http://127.0.0.1:7076/query?db=db1' --data-urlencode 'q=select * from cpu2'
curl -G 'http://127.0.0.1:7076/query?db=db2' --data-urlencode 'q=select * from rp2.cpu3;'
curl -G 'http://127.0.0.1:7076/query?db=db2' --data-urlencode 'q=select * from rp2.cpu4'
curl -G 'http://127.0.0.1:7076/query?db=db1' --data-urlencode "q=select * from \"measurement with spaces, commas and 'quotes'\""
curl -G 'http://127.0.0.1:7076/query?db=db1' --data-urlencode "q=select * from \"'measurement with spaces, commas and 'quotes''\""
curl -G 'http://127.0.0.1:7076/query?db=db1' --data-urlencode "q=select * from \"measurement with emoji we⛅️ther\""
curl -G 'http://127.0.0.1:7076/query?db=db1' --data-urlencode "q=select * from \"measurement with 汉字 表\""
curl -G 'http://127.0.0.1:7076/query?db=db2' --data-urlencode 'q=select * from "measurement with spaces, commas and \"quotes\""'
curl -G 'http://127.0.0.1:7076/query?db=db2' --data-urlencode 'q=select * from "\"measurement with spaces, commas and \"quotes\"\""'
curl -G 'http://127.0.0.1:7076/query?db=db2' --data-urlencode 'q=select * from "\"measurement with quo⚡️es and emoji🔥\""'
curl -X POST 'http://127.0.0.1:7076/query' --data-urlencode 'q=DROP RETENTION POLICY "24h.events" on "db1"'
curl -G 'http://127.0.0.1:7076/query?db=db1' --data-urlencode 'q=SHOW retention policies'
curl -X POST 'http://127.0.0.1:7076/query' --data-urlencode 'q=drop database db1'
Expand Down
7 changes: 5 additions & 2 deletions script/write.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ cpu4 idle=47,system=93i,user="Stephen Chow",admin=true,brief\ desc="the best

curl -i -X POST 'http://127.0.0.1:7076/write?db=db1' --data-binary \
"measurement\ with\ spaces\,\ commas\ and\ 'quotes','quote\ tag\ key\"=\"quote\ value' \"quote\ field\ key'=16,system=16i
'measurement\ with\ spaces\,\ commas\ and\ 'quotes'','quote\ tag\ key\"='quote\ value\" \"quote\ field\ key'=74,system=23i"
'measurement\ with\ spaces\,\ commas\ and\ 'quotes'','quote\ tag\ key\"='quote\ value\" \"quote\ field\ key'=74,system=23i
measurement\ with\ emoji\ we⛅️ther,location=us-midwest temper🔥ture=82 1465839830100400200
measurement\ with\ 汉字\ 表,标签=中文 文字=\"测试\",utf8=\"\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e\""

curl -i -X POST 'http://127.0.0.1:7076/write?db=db2' --data-binary \
'measurement\ with\ spaces\,\ commas\ and\ "quotes",tag\ key\ with\ equals\ \==tag\ value\ with"spaces" field_k\ey\ with\ \=="string field value, multiple backslashes \,\\,\\\,\\\\"
"measurement\ with\ spaces\,\ commas\ and\ "quotes"",tag\ key\ with\ equals\ \==tag\,value\,with"commas" field_k\ey\ with\ \=="string field value, only \" need be escaped"'
"measurement\ with\ spaces\,\ commas\ and\ "quotes"",tag\ key\ with\ equals\ \==tag\,value\,with"commas" field_k\ey\ with\ \=="string field value, only \" need be escaped"
"measurement\ with\ quo⚡️es\ and\ emoji🔥",tag\ key\ with\ sp🚀ces=tag\,value\,with"commas" field_k\ey="string field value, only \" need be esc🍭ped"'

0 comments on commit 22b4d8a

Please sign in to comment.