Commit 3c5ce8a0 authored by Sergei Petrunia's avatar Sergei Petrunia

Make testsuite to pass

- Drop all tables in explain_json.test
- Tabular form should print ref='' when type='fulltext' (another peculiarity
  of the traditional EXPLAIN format)
- String_list::append_str should allocate memory for \0, too
- Some temporary code for EXPLAIN JSON and join buffering.
parent 305dd8e5
......@@ -174,5 +174,5 @@ EXPLAIN
}
}
}
drop table t1;
drop table t1,t2;
drop table t0;
......@@ -38,5 +38,5 @@ explain format=json select * from t2 where a1=1 or (b1=2 and b2=3);
explain format=json select * from t0,t2 where t2.b1=t0.a and t2.b2=4;
drop table t1;
drop table t1,t2;
drop table t0;
......@@ -721,7 +721,15 @@ int Explain_table_access::print_explain(select_result_sink *output, uint8 explai
/* `ref` */
StringBuffer<64> ref_list_buf;
if (ref_list.is_empty())
item_list.push_back(item_null);
{
if (type == JT_FT)
{
/* Traditionally, EXPLAIN lines with type=fulltext have ref='' */
push_str(&item_list, "");
}
else
item_list.push_back(item_null);
}
else
push_string_list(&item_list, ref_list, &ref_list_buf);
......@@ -819,7 +827,7 @@ bool String_list::append_str(MEM_ROOT *mem_root, const char *str)
{
size_t len= strlen(str);
char *cp;
if (!(cp = (char*)alloc_root(mem_root, len)))
if (!(cp = (char*)alloc_root(mem_root, len+1)))
return 1;
memcpy(cp, str, len+1);
push_back(cp);
......@@ -880,6 +888,9 @@ void Explain_table_access::tag_to_json(Json_writer *writer, enum explain_extra_t
case ET_USING:
// index merge: case ET_USING
break;
case ET_USING_JOIN_BUFFER:
// TODO TODO
break;
default:
DBUG_ASSERT(0);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment