summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2015-02-17 18:43:22 +0300
committerSergei Petrunia <psergey@askmonty.org>2015-02-17 18:43:22 +0300
commit4da7aa55f6e7844d66899909d76e061426991fac (patch)
treea564865ef6baa395a2f575463cb61bf24d6b7550
parent3e2849d2a01b06a61407b00989c3f981e62dd183 (diff)
downloadmariadb-git-4da7aa55f6e7844d66899909d76e061426991fac.tar.gz
Add a testcase for EXPLAIN FORMAT=JSON for ROR-union index_merge.
-rw-r--r--mysql-test/r/explain_json.result29
-rw-r--r--mysql-test/t/explain_json.test3
2 files changed, 32 insertions, 0 deletions
diff --git a/mysql-test/r/explain_json.result b/mysql-test/r/explain_json.result
index 9e1a3e08cdc..61d61323cb6 100644
--- a/mysql-test/r/explain_json.result
+++ b/mysql-test/r/explain_json.result
@@ -148,6 +148,35 @@ EXPLAIN
}
}
}
+explain format=json select * from t2 where (a1=1 and a2=1) or
+(b1=2 and b2=1);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t2",
+ "access_type": "index_merge",
+ "possible_keys": ["a1", "b1"],
+ "key_length": "10,10",
+ "index_merge": {
+ "union": {
+ "range": {
+ "key": "a1",
+ "used_key_parts": ["a1", "a2"]
+ },
+ "range": {
+ "key": "b1",
+ "used_key_parts": ["b1", "b2"]
+ }
+ }
+ },
+ "rows": 2,
+ "filtered": 100,
+ "attached_condition": "(((t2.a1 = 1) and (t2.a2 = 1)) or ((t2.b1 = 2) and (t2.b2 = 1)))"
+ }
+ }
+}
# Try ref access on two key components
explain format=json select * from t0,t2 where t2.b1=t0.a and t2.b2=4;
EXPLAIN
diff --git a/mysql-test/t/explain_json.test b/mysql-test/t/explain_json.test
index a94833f86fc..7fc1f568cec 100644
--- a/mysql-test/t/explain_json.test
+++ b/mysql-test/t/explain_json.test
@@ -34,6 +34,9 @@ explain format=json select * from t2 where a1<5;
explain format=json select * from t2 where a1=1 or b1=2;
explain format=json select * from t2 where a1=1 or (b1=2 and b2=3);
+explain format=json select * from t2 where (a1=1 and a2=1) or
+ (b1=2 and b2=1);
+
--echo # Try ref access on two key components
explain format=json select * from t0,t2 where t2.b1=t0.a and t2.b2=4;