~ubuntu-branches/ubuntu/wily/mysql-5.6/wily

« back to all changes in this revision

Viewing changes to storage/perfschema/table_helper.cc

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2015-04-16 20:07:10 UTC
  • mto: (1.3.9 vivid-proposed)
  • mto: This revision was merged to the branch mainline in revision 11.
  • Revision ID: package-import@ubuntu.com-20150416200710-pcrsa022082zj46k
Tags: upstream-5.6.24
ImportĀ upstreamĀ versionĀ 5.6.24

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
 
1
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
2
2
 
3
3
  This program is free software; you can redistribute it and/or modify
4
4
  it under the terms of the GNU General Public License as published by
25
25
#include "pfs_host.h"
26
26
#include "pfs_user.h"
27
27
#include "pfs_account.h"
 
28
#include "pfs_instr.h"
28
29
 
29
30
int PFS_host_row::make_row(PFS_host *pfs)
30
31
{
109
110
  if (m_schema_name_length > 0)
110
111
    memcpy(m_schema_name, pfs->m_digest_key.m_schema_name, m_schema_name_length);
111
112
 
112
 
  int safe_byte_count= pfs->m_digest_storage.m_byte_count;
113
 
  if (safe_byte_count > PSI_MAX_DIGEST_STORAGE_SIZE)
 
113
  uint safe_byte_count= pfs->m_digest_storage.m_byte_count;
 
114
  if (safe_byte_count > pfs_max_digest_length)
114
115
    safe_byte_count= 0;
115
116
 
116
117
  /*
124
125
      Calculate digest from MD5 HASH collected to be shown as
125
126
      DIGEST in this row.
126
127
    */
127
 
    MD5_HASH_TO_STRING(pfs->m_digest_key.m_md5, m_digest);
 
128
    MD5_HASH_TO_STRING(pfs->m_digest_storage.m_md5, m_digest);
128
129
    m_digest_length= MD5_HASH_TO_STRING_LENGTH;
129
130
 
130
131
    /*
131
132
      Calculate digest_text information from the token array collected
132
133
      to be shown as DIGEST_TEXT column.
133
134
    */
134
 
    get_digest_text(m_digest_text, &pfs->m_digest_storage);
135
 
    m_digest_text_length= strlen(m_digest_text);
 
135
    compute_digest_text(&pfs->m_digest_storage, &m_digest_text);
136
136
 
137
 
    if (m_digest_text_length == 0)
 
137
    if (m_digest_text.length() == 0)
138
138
      m_digest_length= 0;
139
139
  }
140
140
  else
141
141
  {
142
142
    m_digest_length= 0;
143
 
    m_digest_text_length= 0;
 
143
    m_digest_text.length(0);
144
144
  }
145
145
 
146
146
  return 0;
165
165
        f->set_null();
166
166
      break;
167
167
    case 2: /* DIGEST_TEXT */
168
 
      if (m_digest_text_length > 0)
169
 
        PFS_engine_table::set_field_longtext_utf8(f, m_digest_text,
170
 
                                                  m_digest_text_length);
 
168
      if (m_digest_text.length() > 0)
 
169
        PFS_engine_table::set_field_longtext_utf8(f, m_digest_text.ptr(),
 
170
                                                  m_digest_text.length());
171
171
      else
172
172
        f->set_null();
173
173
      break;