InnoDB Plugin  1.0
Macros | Functions | Variables
fts0types.ic File Reference
#include <ctype.h>
#include "rem0cmp.h"
#include "ha_prototypes.h"
Include dependency graph for fts0types.ic:
This graph shows which files directly or indirectly include this file:

Macros

#define INNOBASE_FTS0TYPES_IC
#define fts_utf8_is_valid(b)   (((b) & 0xC0) == 0x80)

Functions

UNIV_INLINE void fts_utf8_string_dup (fts_string_t *dst, const fts_string_t *src, mem_heap_t *heap)
UNIV_INLINE int fts_trx_row_doc_id_cmp (const void *p1, const void *p2)
UNIV_INLINE int fts_ranking_doc_id_cmp (const void *p1, const void *p2)
UNIV_INLINE int fts_update_doc_id_cmp (const void *p1, const void *p2)
UNIV_INLINE void fts_utf8_tolower (fts_string_t *str)
UNIV_INLINE int fts_utf8_string_cmp (const void *p1, const void *p2)
UNIV_INLINE int fts_utf8_string_cmp_prefix (const void *p1, const void *p2)
UNIV_INLINE ulint fts_utf8_decode (const byte **ptr)
ulint innobase_strnxfrm (const CHARSET_INFO *cs, const uchar *p2, const ulint len2)
UNIV_INLINE ulint fts_select_index (const CHARSET_INFO *cs, const byte *str, ulint len)
UNIV_INLINE ulint fts_select_next_index (const CHARSET_INFO *cs, const byte *str, ulint len)
UNIV_INLINE const char * fts_get_suffix (ulint selected)
UNIV_INLINE ulint fts_get_n_selectors (void)

Variables

const ulint UTF8_ERROR

Detailed Description

Full text search types.

Created 2007-03-27 Sunny Bains

Function Documentation

UNIV_INLINE ulint fts_get_n_selectors ( void  )

Get the number of index selectors.

Returns
The number of selectors
UNIV_INLINE const char* fts_get_suffix ( ulint  selected)

Return the selected FTS aux index suffix.

Parameters
selectedin: selected index
UNIV_INLINE int fts_ranking_doc_id_cmp ( const void *  p1,
const void *  p2 
)

Compare two fts_ranking_t doc_ids.

Returns
< 0 if n1 < n2, 0 if n1 == n2, > 0 if n1 > n2
Parameters
p1in: id1
p2in: id2
UNIV_INLINE ulint fts_select_index ( const CHARSET_INFO *  cs,
const byte *  str,
ulint  len 
)

Select the FTS auxiliary index for the given character.

Returns
the index to use for the string
Parameters
csin: Charset
strin: string
lenin: string length
UNIV_INLINE ulint fts_select_next_index ( const CHARSET_INFO *  cs,
const byte *  str,
ulint  len 
)

Select the next FTS auxiliary index for the given character.

Returns
the next index to use for character
Parameters
csin: Charset
strin: string
lenin: string length
UNIV_INLINE int fts_trx_row_doc_id_cmp ( const void *  p1,
const void *  p2 
)

Compare two fts_trx_row_t doc_ids.

Returns
< 0 if n1 < n2, 0 if n1 == n2, > 0 if n1 > n2
Parameters
p1in: id1
p2in: id2
UNIV_INLINE int fts_update_doc_id_cmp ( const void *  p1,
const void *  p2 
)

Compare two fts_update_t doc_ids.

Returns
< 0 if n1 < n2, 0 if n1 == n2, > 0 if n1 > n2
Parameters
p1in: id1
p2in: id2
UNIV_INLINE ulint fts_utf8_decode ( const byte **  ptr)

Decode a UTF-8 character.

http://www.unicode.org/versions/Unicode4.0.0/ch03.pdf:

Scalar Value 1st Byte 2nd Byte 3rd Byte 4th Byte 00000000 0xxxxxxx 0xxxxxxx 00000yyy yyxxxxxx 110yyyyy 10xxxxxx zzzzyyyy yyxxxxxx 1110zzzz 10yyyyyy 10xxxxxx 000uuuzz zzzzyyyy yyxxxxxx 11110uuu 10zzzzzz 10yyyyyy 10xxxxxx

This function decodes UTF-8 sequences up to 6 bytes (31 bits).

On error *ptr will point to the first byte that was not correctly decoded. This will hopefully help in resyncing the input.

Returns
UTF8_ERROR if *ptr did not point to a valid UTF-8 sequence, or the Unicode code point.
Parameters
ptrin/out: pointer to UTF-8 string. The pointer is advanced to the start of the next character.
UNIV_INLINE int fts_utf8_string_cmp ( const void *  p1,
const void *  p2 
)

Compare two UTF-8 strings.

Returns
< 0 if n1 < n2, 0 if n1 == n2, > 0 if n1 > n2
Parameters
p1in: key
p2in: node
UNIV_INLINE int fts_utf8_string_cmp_prefix ( const void *  p1,
const void *  p2 
)

Compare two UTF-8 strings, and return match (0) if passed in "key" value equals or is the prefix of the "node" value.

Returns
< 0 if n1 < n2, 0 if n1 == n2, > 0 if n1 > n2
Parameters
p1in: key
p2in: node
UNIV_INLINE void fts_utf8_string_dup ( fts_string_t dst,
const fts_string_t src,
mem_heap_t heap 
)

Duplicate an UTF-8 string.

Returns
< 0 if n1 < n2, 0 if n1 == n2, > 0 if n1 > n2
Parameters
dstin: dup to here
srcin: src string
heapin: heap to use
UNIV_INLINE void fts_utf8_tolower ( fts_string_t str)

Lowercase an UTF-8 string.

Parameters
strin: string
ulint innobase_strnxfrm ( const CHARSET_INFO *  cs,
const uchar *  p2,
const ulint  len2 
)

Get the first character's code position for FTS index partition in: string length

Parameters
csin: Character set
p2in: string