diff --git a/BUILD/compile-pentium-debug b/BUILD/compile-pentium-debug index 27a637d965f..4a9d0e74599 100755 --- a/BUILD/compile-pentium-debug +++ b/BUILD/compile-pentium-debug @@ -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" diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index aa058a97109..911065890e2 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -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"); diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 3ae695c8967..bf98090eb43 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -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)); diff --git a/sql/net_pkg.cc b/sql/net_pkg.cc index fc8bc77e713..9f91db95052 100644 --- a/sql/net_pkg.cc +++ b/sql/net_pkg.cc @@ -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; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 62744edd763..7902e66043d 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -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 diff --git a/sql/sql_select.cc b/sql/sql_select.cc index c4b100e453e..35703e57d82 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -154,8 +154,8 @@ int handle_select(THD *thd, LEX *lex, select_result *result) { int res; register SELECT_LEX *select_lex = &lex->select_lex; - - if (select_lex->next_select()) + fix_tables_pointers(select_lex); + if (select_lex->next_select()) res=mysql_union(thd,lex,result); else res=mysql_select(thd,(TABLE_LIST*) select_lex->table_list.first, @@ -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, "", table->derived_select_number); item_list.push_back(new Item_string(buff, len, default_charset_info));