~ubuntu-branches/ubuntu/vivid/drizzle/vivid

« back to all changes in this revision

Viewing changes to drizzled/session/state.cc

  • Committer: Package Import Robot
  • Author(s): Dmitrijs Ledkovs
  • Date: 2013-10-29 15:43:40 UTC
  • mfrom: (20.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20131029154340-j36v7gxq9tm1gi5f
Tags: 1:7.2.3-2ubuntu1
* Merge from debian, remaining changes:
  - Link against boost_system because of boost_thread.
  - Add required libs to message/include.am
  - Add upstart job and adjust init script to be upstart compatible.
  - Disable -floop-parallelize-all due to gcc-4.8/4.9 compiler ICE
    http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57732

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
namespace drizzled {
28
28
namespace session {
29
29
 
30
 
State::State(const char *in_packet, size_t in_packet_length)
 
30
State::State(str_ref v)
31
31
{
32
 
  if (in_packet_length)
 
32
  if (not v.empty())
33
33
  {
34
 
    size_t minimum= std::min(in_packet_length, static_cast<size_t>(PROCESS_LIST_WIDTH));
 
34
    size_t minimum= std::min<size_t>(v.size(), PROCESS_LIST_WIDTH);
35
35
    _query.resize(minimum + 1);
36
 
    memcpy(&_query[0], in_packet, minimum);
37
 
  }
38
 
  else
39
 
  {
40
 
    _query.resize(0);
 
36
    memcpy(&_query[0], v.data(), minimum);
41
37
  }
42
38
}
43
39
 
53
49
{
54
50
  if (_query.size())
55
51
  {
56
 
    size= _query.size() -1;
 
52
    size= _query.size() - 1;
57
53
    return &_query[0];
58
54
  }
59
55