~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/session.cc

  • Committer: Brian Aker
  • Date: 2009-07-09 19:49:32 UTC
  • mfrom: (1085.1.10 mordred)
  • Revision ID: brian@gaz-20090709194932-o90qfzgk9xem5di1
Merge from Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
 
42
42
using namespace std;
43
43
 
 
44
extern "C"
 
45
{
 
46
  unsigned char *get_var_key(user_var_entry *entry, size_t *length, bool );
 
47
  void free_user_var(user_var_entry *entry);
 
48
}
44
49
 
45
50
/*
46
51
  The following is used to initialise Table_ident with a internal
68
73
/****************************************************************************
69
74
** User variables
70
75
****************************************************************************/
71
 
extern "C" unsigned char *get_var_key(user_var_entry *entry, size_t *length,
72
 
                              bool )
 
76
unsigned char *get_var_key(user_var_entry *entry, size_t *length, bool )
73
77
{
74
78
  *length= entry->name.length;
75
79
  return (unsigned char*) entry->name.str;
76
80
}
77
81
 
78
 
extern "C" void free_user_var(user_var_entry *entry)
 
82
void free_user_var(user_var_entry *entry)
79
83
{
80
84
  char *pos= (char*) entry+ALIGN_SIZE(sizeof(*entry));
81
85
  if (entry->value && entry->value != pos)
1611
1615
  }
1612
1616
}
1613
1617
 
1614
 
 
1615
 
void session_increment_bytes_sent(ulong length)
1616
 
{
1617
 
  Session *session=current_session;
1618
 
  if (likely(session != 0))
1619
 
  { /* current_session==0 when disconnect() calls net_send_error() */
1620
 
    session->status_var.bytes_sent+= length;
1621
 
  }
1622
 
}
1623
 
 
1624
 
 
1625
 
void session_increment_bytes_received(ulong length)
1626
 
{
1627
 
  current_session->status_var.bytes_received+= length;
1628
 
}
1629
 
 
1630
 
 
1631
 
void session_increment_net_big_packet_count(ulong length)
1632
 
{
1633
 
  current_session->status_var.net_big_packet_count+= length;
1634
 
}
1635
 
 
1636
1618
void Session::send_kill_message() const
1637
1619
{
1638
1620
  int err= killed_errno();
1737
1719
                              (bool) allocate_lex_string);
1738
1720
}
1739
1721
 
1740
 
extern "C" const struct charset_info_st *session_charset(Session *session)
 
1722
const struct charset_info_st *session_charset(Session *session)
1741
1723
{
1742
1724
  return(session->charset());
1743
1725
}
1744
1726
 
1745
 
extern "C" char **session_query(Session *session)
 
1727
char **session_query(Session *session)
1746
1728
{
1747
1729
  return(&session->query);
1748
1730
}
1749
1731
 
1750
 
extern "C" int session_non_transactional_update(const Session *session)
 
1732
int session_non_transactional_update(const Session *session)
1751
1733
{
1752
1734
  return(session->transaction.all.modified_non_trans_table);
1753
1735
}
1754
1736
 
1755
 
extern "C" void session_mark_transaction_to_rollback(Session *session, bool all)
 
1737
void session_mark_transaction_to_rollback(Session *session, bool all)
1756
1738
{
1757
1739
  mark_transaction_to_rollback(session, all);
1758
1740
}