Commit 23de67ef authored by bell@sanja.is.com.ua's avatar bell@sanja.is.com.ua

after merging fix

parent 7af2a5b1
......@@ -6,8 +6,8 @@ path=`dirname $0`
extra_flags="$pentium_cflags $debug_cflags"
c_warnings="$c_warnings $debug_extra_warnings"
cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium_configs $debug_configs $static_link"
extra_configs="$pentium_configs $debug_configs "
extra_configs="$extra_configs $static_link"
extra_configs="$extra_configs"
. "$path/FINISH.sh"
......@@ -121,7 +121,7 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DEPENDENT SUBSELECT t1 system NULL NULL NULL NULL 1 where used
3 DEPENDENT UNION t5 ALL NULL NULL NULL NULL 2 where used
select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2;
Subselect return more than 1 record
Subselect returns more than 1 record
create table attend (patient_uq int, clinic_uq int, index i1 (clinic_uq));
create table clinic( uq int primary key, name char(25));
insert into clinic values(1,"Oblastnaia bolnitsa"),(2,"Bolnitsa Krasnogo Kresta");
......
......@@ -45,7 +45,7 @@ select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)
insert into t5 values (2);
select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
explain select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
-- error 1230
-- error 1240
select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2;
create table attend (patient_uq int, clinic_uq int, index i1 (clinic_uq));
create table clinic( uq int primary key, name char(25));
......
......@@ -66,6 +66,8 @@ void send_error(THD *thd, uint sql_errno, const char *err)
else
{
length=(uint) strlen(err);
set_if_smaller(length,MYSQL_ERRMSG_SIZE-1);
}
VOID(net_write_command(net,(uchar) 255, "", 0, (char*) err,length));
thd->fatal_error=0; // Error message is given
thd->net.report_error= 0;
......
......@@ -1339,7 +1339,7 @@ mysql_execute_command(THD *thd)
{
if (!(explain_result= new select_send()))
{
send_error(&thd->net, ER_OUT_OF_RESOURCES);
send_error(thd, ER_OUT_OF_RESOURCES);
DBUG_VOID_RETURN;
}
//check rights
......@@ -1478,7 +1478,7 @@ mysql_execute_command(THD *thd)
if (!explain_result)
if (!(explain_result= new select_send()))
{
send_error(&thd->net, ER_OUT_OF_RESOURCES);
send_error(thd, ER_OUT_OF_RESOURCES);
DBUG_VOID_RETURN;
}
else
......
......@@ -154,7 +154,7 @@ int handle_select(THD *thd, LEX *lex, select_result *result)
{
int res;
register SELECT_LEX *select_lex = &lex->select_lex;
fix_tables_pointers(select_lex);
if (select_lex->next_select())
res=mysql_union(thd,lex,result);
else
......@@ -171,7 +171,7 @@ int handle_select(THD *thd, LEX *lex, select_result *result)
result->abort();
if (res || thd->net.report_error)
{
send_error(&thd->net, 0, MYF(0));
send_error(thd, 0, MYF(0));
res= 1;
}
delete result;
......@@ -7215,6 +7215,8 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
String tmp2(buff2,sizeof(buff2),default_charset_info);
tmp1.length(0);
tmp2.length(0);
item_list.empty();
item_list.push_back(new Item_int((int)thd->lex.select->select_number));
item_list.push_back(new Item_string(thd->lex.select->type,
strlen(thd->lex.select->type),
......@@ -7224,7 +7226,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
if (table->tmp_table == TMP_TABLE && table->derived_select_number != 0)
{
// Derived table name generation
buff[512];
char buff[512];
int len= my_snprintf(buff, 512, "<derived%u>",
table->derived_select_number);
item_list.push_back(new Item_string(buff, len, default_charset_info));
......
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