17 #ifndef _SP_PCONTEXT_H_
18 #define _SP_PCONTEXT_H_
20 #include "sql_string.h"
21 #include "mysql_com.h"
23 #include "sql_array.h"
43 enum enum_field_types
type;
160 memcpy(
sql_state, _sql_state, SQLSTATE_LENGTH);
168 DBUG_ASSERT(
type != ERROR_CODE &&
type != SQLSTATE);
293 int get_level()
const
328 {
return m_max_var_index; }
333 {
return m_var_offset + m_vars.elements(); }
337 {
return m_vars.elements(); }
341 {
return m_var_offset +
i; }
353 enum enum_field_types
type,
354 sp_variable::enum_mode
mode);
397 int get_num_case_exprs()
const
398 {
return m_num_case_exprs; }
400 int push_case_expr_id()
402 if (m_case_expr_ids.
append(m_num_case_exprs))
405 return m_num_case_exprs++;
408 void pop_case_expr_id()
409 { m_case_expr_ids.
pop(); }
411 int get_current_case_expr_id()
const
412 {
return *m_case_expr_ids.
back(); }
426 if (!label && m_parent)
427 label= m_parent->last_label();
433 {
return m_labels.pop(); }
443 bool current_scope_only)
const;
478 Sql_condition::enum_warning_level
level)
const;
492 uint max_cursor_index()
const
493 {
return m_max_cursor_index + m_cursors.elements(); }
495 uint current_cursor_count()
const
496 {
return m_cursor_offset + m_cursors.elements(); }
504 void init(uint var_offset, uint cursor_offset,
int num_case_expressions);
521 uint m_max_var_index;
524 uint m_max_cursor_index;
538 uint m_cursor_offset;
546 int m_num_case_exprs;