mirror of
https://github.com/valitydev/riak_test.git
synced 2024-11-06 08:35:22 +00:00
Add parens to EXPLAIN test output
This commit is contained in:
parent
1de4565130
commit
2d905b2e1d
@ -24,18 +24,18 @@
|
||||
|GeoCheckin|
|
||||
+----------+
|
||||
"}}.
|
||||
{{command, "EXPLAIN SELECT * FROM GeoCheckin WHERE myfamily = 'family1' AND myseries = 'series1' AND time >= 2 AND time <= 7000000 AND weather='fair';\n"}, {result, "+-----+-------------------------------------+------------+-------------------------------------+-----------+----------+
|
||||
|Subqu| Range Scan Start Key |Is Start Inc| Range Scan End Key |Is End Incl| Filter |
|
||||
+-----+-------------------------------------+------------+-------------------------------------+-----------+----------+
|
||||
| 1 |myfamily = 'family1', myseries = 'ser| false |myfamily = 'family1', myseries = 'ser| false |weather = |
|
||||
| 2 |myfamily = 'family1', myseries = 'ser| false |myfamily = 'family1', myseries = 'ser| false |weather = |
|
||||
| 3 |myfamily = 'family1', myseries = 'ser| false |myfamily = 'family1', myseries = 'ser| false |weather = |
|
||||
| 4 |myfamily = 'family1', myseries = 'ser| false |myfamily = 'family1', myseries = 'ser| false |weather = |
|
||||
| 5 |myfamily = 'family1', myseries = 'ser| false |myfamily = 'family1', myseries = 'ser| false |weather = |
|
||||
| 6 |myfamily = 'family1', myseries = 'ser| false |myfamily = 'family1', myseries = 'ser| false |weather = |
|
||||
| 7 |myfamily = 'family1', myseries = 'ser| false |myfamily = 'family1', myseries = 'ser| false |weather = |
|
||||
| 8 |myfamily = 'family1', myseries = 'ser| false |myfamily = 'family1', myseries = 'ser| false |weather = |
|
||||
+-----+-------------------------------------+------------+-------------------------------------+-----------+----------+
|
||||
{{command, "EXPLAIN SELECT * FROM GeoCheckin WHERE myfamily = 'family1' AND myseries = 'series1' AND time >= 2 AND time <= 7000000 AND weather='fair';"}, {result, "+-----+------------------------------------+------------+-------------------------------------+-----------+-----------+
|
||||
|Subqu| Range Scan Start Key |Is Start Inc| Range Scan End Key |Is End Incl| Filter |
|
||||
+-----+------------------------------------+------------+-------------------------------------+-----------+-----------+
|
||||
| 1 |myfamily = 'family1', myseries = 'se| false |myfamily = 'family1', myseries = 'ser| false |(weather = |
|
||||
| 2 |myfamily = 'family1', myseries = 'se| false |myfamily = 'family1', myseries = 'ser| false |(weather = |
|
||||
| 3 |myfamily = 'family1', myseries = 'se| false |myfamily = 'family1', myseries = 'ser| false |(weather = |
|
||||
| 4 |myfamily = 'family1', myseries = 'se| false |myfamily = 'family1', myseries = 'ser| false |(weather = |
|
||||
| 5 |myfamily = 'family1', myseries = 'se| false |myfamily = 'family1', myseries = 'ser| false |(weather = |
|
||||
| 6 |myfamily = 'family1', myseries = 'se| false |myfamily = 'family1', myseries = 'ser| false |(weather = |
|
||||
| 7 |myfamily = 'family1', myseries = 'se| false |myfamily = 'family1', myseries = 'ser| false |(weather = |
|
||||
| 8 |myfamily = 'family1', myseries = 'se| false |myfamily = 'family1', myseries = 'ser| false |(weather = |
|
||||
+-----+------------------------------------+------------+-------------------------------------+-----------+-----------+
|
||||
"}}.
|
||||
{{command, "EXPLAIN SELECT * FROM GeoCheckin;\n"}, {result, "Error (1001): The query must have a where clause."}}.
|
||||
{{command, "insert into GeoCheckin (myfamily, myseries, time, weather, temperature) values ('family1','series1',1,'snow',25.2);\n"}, {result, ""}}.
|
||||
|
@ -34,7 +34,7 @@ confirm() ->
|
||||
ts_util:create_and_activate_bucket_type(ClusterConn, DDL, "MyTable"),
|
||||
Qry = "EXPLAIN SELECT myint, myfloat, myoptional FROM MyTable WHERE "
|
||||
"myfamily='wingo' AND myseries='dingo' AND time > 0 AND time < 2000000 "
|
||||
"AND (mybool=true OR myvarchar='banana')",
|
||||
"AND ((mybool=true AND myvarchar='banana') OR (myoptional=7))",
|
||||
|
||||
Got = ts_util:single_query(Conn, Qry),
|
||||
Expected =
|
||||
@ -47,18 +47,18 @@ confirm() ->
|
||||
false,
|
||||
"myfamily = 'wingo', myseries = 'dingo', time = 900000",
|
||||
false,
|
||||
"mybool = true OR myvarchar = 'banana'"},
|
||||
{2,
|
||||
"((myoptional = 7) OR ((mybool = true) AND (myvarchar = 'banana')))"},
|
||||
{2,
|
||||
"myfamily = 'wingo', myseries = 'dingo', time = 900000",
|
||||
false,
|
||||
"myfamily = 'wingo', myseries = 'dingo', time = 1800000",
|
||||
false,
|
||||
"mybool = true OR myvarchar = 'banana'"},
|
||||
{3,
|
||||
"((myoptional = 7) OR ((mybool = true) AND (myvarchar = 'banana')))"},
|
||||
{3,
|
||||
"myfamily = 'wingo', myseries = 'dingo', time = 1800000",
|
||||
false,
|
||||
"myfamily = 'wingo', myseries = 'dingo', time = 2000000",
|
||||
false,
|
||||
"mybool = true OR myvarchar = 'banana'"}]}},
|
||||
"((myoptional = 7) OR ((mybool = true) AND (myvarchar = 'banana')))"}]}},
|
||||
?assertEqual(Expected, Got),
|
||||
pass.
|
||||
|
Loading…
Reference in New Issue
Block a user