1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Fix EXPLAIN bug with binary protocol

Added new client tests (EXPLAIN + DECIMAL conv)
This commit is contained in:
venu@myvenu.com
2003-03-04 14:22:30 -08:00
parent 6a9273fa95
commit 1f88025066
2 changed files with 249 additions and 30 deletions

View File

@ -572,34 +572,42 @@ static bool mysql_test_select_fields(PREP_STMT *stmt, TABLE_LIST *tables,
if (open_and_lock_tables(thd, tables))
DBUG_RETURN(1);
fix_tables_pointers(thd->lex.all_selects_list);
if (!result && !(result= new select_send()))
if (lex->describe)
{
delete select_lex->having;
delete select_lex->where;
send_error(thd, ER_OUT_OF_RESOURCES);
DBUG_RETURN(1);
if (!(result= new select_send()))
{
send_error(thd, ER_OUT_OF_RESOURCES);
DBUG_RETURN(1);
}
if (send_prep_stmt(stmt, 0) || send_item_params(stmt))
DBUG_RETURN(1);
}
else
{
fix_tables_pointers(thd->lex.all_selects_list);
if (!result && !(result= new select_send()))
{
delete select_lex->having;
delete select_lex->where;
send_error(thd, ER_OUT_OF_RESOURCES);
DBUG_RETURN(1);
}
JOIN *join= new JOIN(thd, fields, select_options, result);
thd->used_tables= 0; // Updated by setup_fields
if (join->prepare(&select_lex->ref_pointer_array, tables,
wild_num, conds, og_num, order, group, having, proc,
select_lex, unit, 0, 0))
DBUG_RETURN(1);
if (send_prep_stmt(stmt, fields.elements) ||
thd->protocol_simple.send_fields(&fields, 0) ||
send_item_params(stmt))
DBUG_RETURN(1);
join->cleanup(thd);
}
JOIN *join= new JOIN(thd, fields, select_options, result);
thd->used_tables= 0; // Updated by setup_fields
if (join->prepare(&select_lex->ref_pointer_array, tables,
wild_num, conds, og_num, order, group, having, proc,
select_lex, unit, 0, 0))
DBUG_RETURN(1);
/*
Currently return only column list info only, and we are not
sending any info on where clause.
*/
if (send_prep_stmt(stmt, fields.elements) ||
thd->protocol_simple.send_fields(&fields, 0) ||
send_item_params(stmt))
DBUG_RETURN(1);
join->cleanup(thd);
DBUG_RETURN(0);
}