~stewart/drizzle/embedded-innodb-autoincrement

« back to all changes in this revision

Viewing changes to drizzled/session.cc

merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
namespace drizzled
60
60
{
61
61
 
62
 
extern "C"
63
 
{
64
 
  unsigned char *get_var_key(user_var_entry *entry, size_t *length, bool );
65
 
  void free_user_var(user_var_entry *entry);
66
 
}
67
 
 
68
62
/*
69
63
  The following is used to initialise Table_ident with a internal
70
64
  table name
80
74
/****************************************************************************
81
75
** User variables
82
76
****************************************************************************/
83
 
unsigned char *get_var_key(user_var_entry *entry, size_t *length, bool )
 
77
static unsigned char *get_var_key(user_var_entry *entry, size_t *length, bool)
84
78
{
85
79
  *length= entry->name.length;
86
80
  return (unsigned char*) entry->name.str;
87
81
}
88
82
 
89
 
void free_user_var(user_var_entry *entry)
 
83
static void free_user_var(user_var_entry *entry)
90
84
{
91
85
  delete entry;
92
86
}
107
101
/*
108
102
  The following functions form part of the C plugin API
109
103
*/
110
 
extern "C" int mysql_tmpfile(const char *prefix)
 
104
int mysql_tmpfile(const char *prefix)
111
105
{
112
106
  char filename[FN_REFLEN];
113
107
  int fd = internal::create_temp_file(filename, drizzle_tmpdir, prefix, MYF(MY_WME));
118
112
  return fd;
119
113
}
120
114
 
121
 
extern "C"
122
115
int session_tablespace_op(const Session *session)
123
116
{
124
117
  return test(session->tablespace_op);
132
125
 
133
126
   @see Session::set_proc_info
134
127
 */
135
 
extern "C" void
136
 
set_session_proc_info(Session *session, const char *info)
 
128
void set_session_proc_info(Session *session, const char *info)
137
129
{
138
130
  session->set_proc_info(info);
139
131
}
140
132
 
141
 
extern "C"
142
133
const char *get_session_proc_info(Session *session)
143
134
{
144
135
  return session->get_proc_info();
155
146
  return &ha_data[monitored->getId()].resource_context[index];
156
147
}
157
148
 
158
 
extern "C"
159
149
int64_t session_test_options(const Session *session, int64_t test_options)
160
150
{
161
151
  return session->options & test_options;
162
152
}
163
153
 
164
 
extern "C"
165
154
int session_sql_command(const Session *session)
166
155
{
167
156
  return (int) session->lex->sql_command;
168
157
}
169
158
 
170
 
extern "C"
171
159
int session_tx_isolation(const Session *session)
172
160
{
173
161
  return (int) session->variables.tx_isolation;
320
308
  *xid = *(DRIZZLE_XID *) &transaction.xid_state.xid;
321
309
}
322
310
 
323
 
 
324
311
/* Do operations that may take a long time */
325
312
 
326
313
void Session::cleanup(void)
1604
1591
  @retval 0 the user thread is active
1605
1592
  @retval 1 the user thread has been killed
1606
1593
*/
1607
 
extern "C" int session_killed(const Session *session)
 
1594
int session_killed(const Session *session)
1608
1595
{
1609
1596
  return(session->killed);
1610
1597
}
1611
1598
 
1612
 
/**
1613
 
  Return the session id of a user session
1614
 
  @param pointer to Session object
1615
 
  @return session's id
1616
 
*/
1617
 
extern "C" unsigned long session_get_thread_id(const Session *session)
1618
 
{
1619
 
  return (unsigned long) session->getSessionId();
1620
 
}
1621
 
 
1622
1599
 
1623
1600
const struct charset_info_st *session_charset(Session *session)
1624
1601
{
1625
1602
  return(session->charset());
1626
1603
}
1627
1604
 
1628
 
int session_non_transactional_update(const Session *session)
1629
 
{
1630
 
  return(session->transaction.all.hasModifiedNonTransData());
1631
 
}
1632
 
 
1633
 
void session_mark_transaction_to_rollback(Session *session, bool all)
1634
 
{
1635
 
  mark_transaction_to_rollback(session, all);
1636
 
}
1637
 
 
1638
1605
/**
1639
1606
  Mark transaction to rollback and mark error as fatal to a sub-statement.
1640
1607