~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/session.h

  • Committer: Olaf van der Spek
  • Date: 2011-03-15 20:23:53 UTC
  • mto: (2239.2.1 build)
  • mto: This revision was merged to the branch mainline in revision 2240.
  • Revision ID: olafvdspek@gmail.com-20110315202353-01kpds2os4gkps3o
Refactor includes

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
#include <sys/resource.h>
33
33
#include <sys/time.h>
34
34
 
35
 
// #include <drizzled/catalog/instance.h>
36
 
// #include <drizzled/cursor.h>
37
35
#include <drizzled/diagnostics_area.h>
38
36
#include <drizzled/error.h>
39
37
#include <drizzled/identifier.h>
203
201
  }
204
202
 
205
203
public:
 
204
  Diagnostics_area& main_da();
206
205
  const LEX& lex() const;
207
206
  LEX& lex();
208
207
  enum_sql_command getSqlCommand() const;
608
607
  List<DRIZZLE_ERROR> warn_list;
609
608
  uint32_t warn_count[(uint32_t) DRIZZLE_ERROR::WARN_LEVEL_END];
610
609
  uint32_t total_warn_count;
611
 
  Diagnostics_area main_da;
 
610
  Diagnostics_area main_da0;
612
611
 
613
612
  ulong col_access;
614
613
 
1094
1093
 
1095
1094
  int send_explain_fields(select_result *result);
1096
1095
 
1097
 
  /**
1098
 
    Clear the current error, if any.
1099
 
    We do not clear is_fatal_error or is_fatal_sub_stmt_error since we
1100
 
    assume this is never called if the fatal error is set.
1101
 
    @todo: To silence an error, one should use Internal_error_handler
1102
 
    mechanism. In future this function will be removed.
1103
 
  */
1104
 
  inline void clear_error(bool full= false)
1105
 
  {
1106
 
    if (main_da.is_error())
1107
 
      main_da.reset_diagnostics_area();
1108
 
 
1109
 
    if (full)
1110
 
    {
1111
 
      drizzle_reset_errors(this, true);
1112
 
    }
1113
 
  }
1114
 
 
1115
 
  void clearDiagnostics()
1116
 
  {
1117
 
    main_da.reset_diagnostics_area();
1118
 
  }
1119
 
 
1120
 
  /**
1121
 
    Mark the current error as fatal. Warning: this does not
1122
 
    set any error, it sets a property of the error, so must be
1123
 
    followed or prefixed with my_error().
1124
 
  */
1125
 
  inline void fatal_error()
1126
 
  {
1127
 
    assert(main_da.is_error());
1128
 
    is_fatal_error= true;
1129
 
  }
1130
 
  /**
1131
 
    true if there is an error in the error stack.
1132
 
 
1133
 
    Please use this method instead of direct access to
1134
 
    net.report_error.
1135
 
 
1136
 
    If true, the current (sub)-statement should be aborted.
1137
 
    The main difference between this member and is_fatal_error
1138
 
    is that a fatal error can not be handled by a stored
1139
 
    procedure continue handler, whereas a normal error can.
1140
 
 
1141
 
    To raise this flag, use my_error().
1142
 
  */
1143
 
  inline bool is_error() const { return main_da.is_error(); }
 
1096
  void clear_error(bool full= false);
 
1097
  void clearDiagnostics();
 
1098
  void fatal_error();
 
1099
  bool is_error() const;
 
1100
 
1144
1101
  inline const CHARSET_INFO *charset() { return default_charset_info; }
1145
1102
 
1146
1103
  /**
1404
1361
  void mark_used_tables_as_free_for_reuse(Table *table);
1405
1362
 
1406
1363
public:
1407
 
 
1408
 
  /** A short cut for session->main_da.set_ok_status(). */
1409
 
  inline void my_ok(ha_rows affected_rows= 0, ha_rows found_rows_arg= 0,
1410
 
                    uint64_t passed_id= 0, const char *message= NULL)
1411
 
  {
1412
 
    main_da.set_ok_status(this, affected_rows, found_rows_arg, passed_id, message);
1413
 
  }
1414
 
 
1415
 
 
1416
 
  /** A short cut for session->main_da.set_eof_status(). */
1417
 
 
1418
 
  inline void my_eof()
1419
 
  {
1420
 
    main_da.set_eof_status(this);
1421
 
  }
1422
 
 
 
1364
  void my_ok(ha_rows affected_rows= 0, ha_rows found_rows_arg= 0, uint64_t passed_id= 0, const char *message= NULL);
 
1365
  void my_eof();
1423
1366
  bool add_item_to_list(Item *item);
1424
1367
  bool add_value_to_list(Item *value);
1425
1368
  bool add_order_to_list(Item *item, bool asc);