18 #include "sql_class.h"                 
   19 #include "sql_get_diagnostics.h"       
   48   DBUG_ENTER(
"Sql_cmd_get_diagnostics::execute");
 
   51   save_stmt_da->set_warning_info_read_only(
false);
 
   54   thd->set_stmt_da(&new_stmt_da);
 
   56   thd->set_stmt_da(save_stmt_da);
 
   61     thd->get_stmt_da()->set_ok_status(0, 0, NULL);
 
   66   uint sql_errno= new_stmt_da.sql_errno();
 
   67   const char *
message= new_stmt_da.message();
 
   68   const char *sqlstate= new_stmt_da.get_sqlstate();
 
   71   if (thd->is_fatal_error)
 
   78   save_stmt_da->push_warning(thd, sql_errno, sqlstate,
 
   79                              Sql_condition::WARN_LEVEL_ERROR,
 
   83   if (! (rv= thd->is_error()))
 
   84     thd->get_stmt_da()->set_ok_status(0, 0, NULL);
 
  105   DBUG_ENTER(
"Diagnostics_information_item::set_value");
 
  108   srp= m_target->get_settable_routine_parameter();
 
  113   rv= srp->set_value(thd, thd->sp_runtime_ctx, value);
 
  135   DBUG_ENTER(
"Statement_information::aggregate");
 
  141   while ((stmt_info_item= it++))
 
  143     if ((rv= 
evaluate(thd, stmt_info_item, da)))
 
  166   DBUG_ENTER(
"Statement_information_item::get_value");
 
  176     ulong count= da->cond_count();
 
  177     value= 
new (thd->mem_root) 
Item_uint(count);
 
  186     value= 
new (thd->mem_root) 
Item_int(thd->get_row_count_func());
 
  208   longlong cond_number;
 
  213   DBUG_ENTER(
"Condition_information::aggregate");
 
  216   if (!m_cond_number_expr->fixed &&
 
  217       m_cond_number_expr->fix_fields(thd, &m_cond_number_expr))
 
  220   cond_number= m_cond_number_expr->val_int();
 
  228   if (cond_number < 1 || (ulonglong) cond_number > da->cond_count())
 
  230     my_error(ER_DA_INVALID_CONDITION_NUMBER, MYF(0));
 
  235   while (cond_number--)
 
  241   while ((cond_info_item= it_items++))
 
  243     if ((rv= 
evaluate(thd, cond_info_item, cond)))
 
  264 Condition_information_item::make_utf8_string_item(THD *thd, 
const String *str)
 
  269   const CHARSET_INFO *from_cs= str->charset() ? str->charset() : to_cs;
 
  292   DBUG_ENTER(
"Condition_information_item::get_value");
 
  297     value= make_utf8_string_item(thd, &(cond->m_class_origin));
 
  299   case SUBCLASS_ORIGIN:
 
  300     value= make_utf8_string_item(thd, &(cond->m_subclass_origin));
 
  302   case CONSTRAINT_CATALOG:
 
  303     value= make_utf8_string_item(thd, &(cond->m_constraint_catalog));
 
  305   case CONSTRAINT_SCHEMA:
 
  306     value= make_utf8_string_item(thd, &(cond->m_constraint_schema));
 
  308   case CONSTRAINT_NAME:
 
  309     value= make_utf8_string_item(thd, &(cond->m_constraint_name));
 
  312     value= make_utf8_string_item(thd, &(cond->m_catalog_name));
 
  315     value= make_utf8_string_item(thd, &(cond->m_schema_name));
 
  318     value= make_utf8_string_item(thd, &(cond->m_table_name));
 
  321     value= make_utf8_string_item(thd, &(cond->m_column_name));
 
  324     value= make_utf8_string_item(thd, &(cond->m_cursor_name));
 
  327     value= make_utf8_string_item(thd, &(cond->m_message_text));
 
  330     value= 
new (thd->mem_root) 
Item_uint(cond->m_sql_errno);
 
  332   case RETURNED_SQLSTATE:
 
  334     value= make_utf8_string_item(thd, &str);