~ubuntu-branches/ubuntu/raring/mysql-5.5/raring-proposed

« back to all changes in this revision

Viewing changes to sql/sql_priv.h

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2013-01-16 08:29:25 UTC
  • mfrom: (1.1.11)
  • Revision ID: package-import@ubuntu.com-20130116082925-znscu5xswxo6pmw2
Tags: 5.5.29-0ubuntu1
* SECURITY UPDATE: Update to 5.5.29 to fix security issues (LP: #1100264)
  - http://www.oracle.com/technetwork/topics/security/cpujan2013-1515902.html
* debian/patches/CVE-2012-5611.patch: removed, included upstream.
* debian/patches/38_scripts__mysqld_safe.sh__signals.patch: refreshed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
151
151
*/
152
152
#define OPTION_ALLOW_BATCH              (ULL(1) << 36) // THD, intern (slave)
153
153
 
 
154
/*
 
155
  Check how many bytes are available on buffer.
 
156
 
 
157
  @param buf_start    Pointer to buffer start.
 
158
  @param buf_current  Pointer to the current position on buffer.
 
159
  @param buf_len      Buffer length.
 
160
 
 
161
  @return             Number of bytes available on event buffer.
 
162
*/
 
163
template <class T> T available_buffer(const char* buf_start,
 
164
                                      const char* buf_current,
 
165
                                      T buf_len)
 
166
{
 
167
  return buf_len - (buf_current - buf_start);
 
168
}
 
169
 
 
170
/*
 
171
  Check if jump value is within buffer limits.
 
172
 
 
173
  @param jump         Number of positions we want to advance.
 
174
  @param buf_start    Pointer to buffer start
 
175
  @param buf_current  Pointer to the current position on buffer.
 
176
  @param buf_len      Buffer length.
 
177
 
 
178
  @return      True   If jump value is within buffer limits.
 
179
               False  Otherwise.
 
180
*/
 
181
template <class T> bool valid_buffer_range(T jump,
 
182
                                           const char* buf_start,
 
183
                                           const char* buf_current,
 
184
                                           T buf_len)
 
185
{
 
186
  return (jump <= available_buffer(buf_start, buf_current, buf_len));
 
187
}
 
188
 
154
189
/* The rest of the file is included in the server only */
155
190
#ifndef MYSQL_CLIENT
156
191