InnoDB Plugin  1.0
ha_prototypes.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3 Copyright (c) 2006, 2014, Oracle and/or its affiliates. All Rights Reserved.
4 
5 This program is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free Software
7 Foundation; version 2 of the License.
8 
9 This program is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12 
13 You should have received a copy of the GNU General Public License along with
14 this program; if not, write to the Free Software Foundation, Inc.,
15 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
16 
17 *****************************************************************************/
18 
19 /*******************************************************************/
27 #ifndef HA_INNODB_PROTOTYPES_H
28 #define HA_INNODB_PROTOTYPES_H
29 
30 #include "my_dbug.h"
31 #include "mysqld_error.h"
32 #include "my_compare.h"
33 #include "my_sys.h"
34 #include "m_string.h"
35 #include "debug_sync.h"
36 
37 #include "trx0types.h"
38 #include "m_ctype.h" /* CHARSET_INFO */
39 
40 // Forward declarations
41 class Field;
42 struct fts_string_t;
43 
44 /*********************************************************************/
47 UNIV_INTERN
48 ulint
50 /*====================*/
51  void* to,
52  ulint to_length,
54  CHARSET_INFO* to_cs,
55  const void* from,
56  ulint from_length,
57  CHARSET_INFO* from_cs,
59  uint* errors);
62 /*******************************************************************/
71 UNIV_INTERN
72 ulint
74 /*================*/
75  const char* data,
76  ulint data_len,
78  ulint charset_coll,
79  char* buf,
80  ulint buf_size);
83 /*****************************************************************/
85 UNIV_INTERN
86 void
88 /*============================*/
89  trx_t* trx,
91  const char* full_name,
96  ulint full_name_len);
99 /*****************************************************************/
103 UNIV_INTERN
104 char*
106 /*==================*/
107  char* buf,
108  ulint buflen,
109  const char* id,
110  ulint idlen,
111  THD* thd,
112  ibool table_id);
115 /******************************************************************/
122 UNIV_INTERN
123 ibool
125 /*============================*/
126  THD* thd);
128 /******************************************************************/
133 UNIV_INTERN
134 enum durability_properties
136 /*=====================*/
137  const THD* thd)
138  __attribute__((nonnull, warn_unused_result));
139 
140 /******************************************************************/
146 UNIV_INTERN
147 ibool
149 /*===========================*/
150  THD* thd);
152 /*************************************************************/
154 UNIV_INTERN
155 void
157 /*=====================*/
158  FILE* f,
159  THD* thd,
160  uint max_query_len);
163 /*************************************************************/
167 UNIV_INTERN
168 int
170 /*===============*/
171  int mysql_type,
172  uint charset_number,
173  const unsigned char* a,
174  unsigned int a_length,
176  const unsigned char* b,
177  unsigned int b_length)
179  __attribute__((nonnull, warn_unused_result));
180 /**************************************************************/
185 UNIV_INTERN
186 ulint
188 /*==============================*/
189  ulint* unsigned_flag,
194  const void* field)
195  __attribute__((nonnull));
196 
197 /******************************************************************/
199 UNIV_INTERN
200 void
202 /*====================*/
203  ulint cset,
204  ulint* mbminlen,
205  ulint* mbmaxlen);
207 /******************************************************************/
210 UNIV_INTERN
211 int
213 /*================*/
214  const char* a,
215  const char* b);
217 /******************************************************************/
221 UNIV_INTERN
222 int
224 /*=================*/
225  const char* a,
226  const char* b);
228 /******************************************************************/
231 UNIV_INTERN
232 const char*
234 /*==============*/
235  const char* path_name);
237 /******************************************************************/
240 UNIV_INTERN
241 ibool
243 /*==========*/
244  const THD* thd);
246 /******************************************************************/
248 UNIV_INTERN
249 void
251 /*===========================*/
252  struct charset_info_st* cs,
253  char* to,
254  const char* from,
255  ulint len);
257 /******************************************************************/
259 UNIV_INTERN
260 void
262 /*=====================*/
263  struct charset_info_st* cs,
264  char* to,
265  const char* from,
266  ulint len);
268 /******************************************************************/
270 UNIV_INTERN
271 void
273 /*================*/
274  char* a);
276 /**********************************************************************/
279 UNIV_INTERN
280 struct charset_info_st*
282 /*=================*/
283  THD* thd);
284 /**********************************************************************/
287 UNIV_INTERN
288 const char*
290 /*==============*/
291  THD* thd,
292  size_t* length)
293  __attribute__((nonnull));
294 /******************************************************************/
300 UNIV_INTERN
301 ulint
303 /*===========================*/
304  ulint charset_id,
305  ulint prefix_len,
308  ulint data_len,
309  const char* str);
311 /*************************************************************/
314 UNIV_INTERN
315 enum icp_result
317 /*================*/
318  void* file)
319  __attribute__((nonnull, warn_unused_result));
320 /******************************************************************/
324 UNIV_INTERN
325 ibool
327 /*============*/
328  THD* thd);
331 /******************************************************************/
334 UNIV_INTERN
335 ulong
337 /*==================*/
338  THD* thd);
340 /******************************************************************/
342 UNIV_INTERN
343 void
345 /*===================*/
346  THD* thd,
347  ulint value);
349 /**********************************************************************/
354 UNIV_INTERN
355 ulint
357 /*===============================*/
358 
359 /**********************************************************************/
365 UNIV_INTERN
366 ulint
368 /*=====================================*/
369 
370 /*****************************************************************/
373 UNIV_INTERN
374 int
376 /*===============*/
377  THD* thd);
379 /*************************************************************/
381 UNIV_INTERN
382 ulint
384 /*=========================*/
385  CHARSET_INFO* charset,
386  const byte* start,
387  const byte* end,
389  fts_string_t* token,
390  ulint* offset);
394 /******************************************************************/
396 UNIV_INTERN
397 int
399 /*=======================*/
400  const void* cs,
401  const void* p1,
402  const void* p2);
404 /****************************************************************/
407 UNIV_INTERN
408 CHARSET_INFO*
410 /*=====================*/
411  int mysql_type,
412  uint charset_number);
413 /******************************************************************/
416 UNIV_INTERN
417 ibool
419 /*=================*/
420  THD* thd);
422 /******************************************************************/
426 UNIV_INTERN
427 ibool
429 /*===================*/
430  THD* thd);
432 /*****************************************************************/
436 UNIV_INTERN
437 void
439 /*==================*/
440  char* buf,
442  ulint buflen,
443  const char* name,
445  ibool is_index_name)
446  __attribute__((nonnull));
447 
450  IB_LOG_LEVEL_INFO,
451  IB_LOG_LEVEL_WARN,
452  IB_LOG_LEVEL_ERROR,
453  IB_LOG_LEVEL_FATAL
454 };
455 
456 /******************************************************************/
467 UNIV_INTERN
468 void
469 ib_errf(
470 /*====*/
471  THD* thd,
472  ib_log_level_t level,
473  ib_uint32_t code,
474  const char* format,
475  ...)
476  __attribute__((format(printf, 4, 5)));
477 
478 /******************************************************************/
488 UNIV_INTERN
489 void
491 /*========*/
492  THD* thd,
493  ib_log_level_t level,
494  ib_uint32_t code,
495  ...);
497 /******************************************************************/
500 UNIV_INTERN
501 void
502 ib_logf(
503 /*====*/
504  ib_log_level_t level,
505  const char* format,
506  ...)
507  __attribute__((format(printf, 2, 3)));
508 
509 /******************************************************************/
512 UNIV_INTERN
513 const char*
515 /*=================*/
516 
517 /******************************************************************/
520 UNIV_INTERN
521 const char*
523 /*=================*/
524  int error_code);
526 /*********************************************************************/
544 UNIV_INTERN
545 ulonglong
547 /*==================*/
548  ulonglong current,
549  ulonglong need,
550  ulonglong step,
551  ulonglong offset,
552  ulonglong max_value)
553  __attribute__((pure, warn_unused_result));
554 
555 /********************************************************************/
558 UNIV_INTERN
559 ulonglong
561 /*===========================*/
562  const Field* field)
563  __attribute__((nonnull, pure, warn_unused_result));
564 
565 /**********************************************************************
566 Check if the length of the identifier exceeds the maximum allowed.
567 The input to this function is an identifier in charset my_charset_filename.
568 return true when length of identifier is too long. */
569 UNIV_INTERN
570 my_bool
571 innobase_check_identifier_length(
572 /*=============================*/
573  const char* id); /* in: identifier to check. it must belong
574  to charset my_charset_filename */
575 
576 /**********************************************************************
577 Converts an identifier from my_charset_filename to UTF-8 charset. */
578 uint
579 innobase_convert_to_system_charset(
580 /*===============================*/
581  char* to, /* out: converted identifier */
582  const char* from, /* in: identifier to convert */
583  ulint len, /* in: length of 'to', in bytes */
584  uint* errors); /* out: error return */
585 
586 /**********************************************************************
587 Converts an identifier from my_charset_filename to UTF-8 charset. */
588 uint
589 innobase_convert_to_filename_charset(
590 /*=================================*/
591  char* to, /* out: converted identifier */
592  const char* from, /* in: identifier to convert */
593  ulint len); /* in: length of 'to', in bytes */
594 
595 
596 #endif /* HA_INNODB_PROTOTYPES_H */