mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
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.
This commit is contained in:
@ -174,5 +174,5 @@ EXPLAIN
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
drop table t1;
|
drop table t1,t2;
|
||||||
drop table t0;
|
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;
|
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;
|
drop table t0;
|
||||||
|
@ -721,7 +721,15 @@ int Explain_table_access::print_explain(select_result_sink *output, uint8 explai
|
|||||||
/* `ref` */
|
/* `ref` */
|
||||||
StringBuffer<64> ref_list_buf;
|
StringBuffer<64> ref_list_buf;
|
||||||
if (ref_list.is_empty())
|
if (ref_list.is_empty())
|
||||||
|
{
|
||||||
|
if (type == JT_FT)
|
||||||
|
{
|
||||||
|
/* Traditionally, EXPLAIN lines with type=fulltext have ref='' */
|
||||||
|
push_str(&item_list, "");
|
||||||
|
}
|
||||||
|
else
|
||||||
item_list.push_back(item_null);
|
item_list.push_back(item_null);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
push_string_list(&item_list, ref_list, &ref_list_buf);
|
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);
|
size_t len= strlen(str);
|
||||||
char *cp;
|
char *cp;
|
||||||
if (!(cp = (char*)alloc_root(mem_root, len)))
|
if (!(cp = (char*)alloc_root(mem_root, len+1)))
|
||||||
return 1;
|
return 1;
|
||||||
memcpy(cp, str, len+1);
|
memcpy(cp, str, len+1);
|
||||||
push_back(cp);
|
push_back(cp);
|
||||||
@ -880,6 +888,9 @@ void Explain_table_access::tag_to_json(Json_writer *writer, enum explain_extra_t
|
|||||||
case ET_USING:
|
case ET_USING:
|
||||||
// index merge: case ET_USING
|
// index merge: case ET_USING
|
||||||
break;
|
break;
|
||||||
|
case ET_USING_JOIN_BUFFER:
|
||||||
|
// TODO TODO
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
DBUG_ASSERT(0);
|
DBUG_ASSERT(0);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user