diff options
Diffstat (limited to 'storage/innobase/include/data0type.h')
-rw-r--r-- | storage/innobase/include/data0type.h | 42 |
1 files changed, 37 insertions, 5 deletions
diff --git a/storage/innobase/include/data0type.h b/storage/innobase/include/data0type.h index d7fa0b9cd44..c7fcf316f24 100644 --- a/storage/innobase/include/data0type.h +++ b/storage/innobase/include/data0type.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved. +Copyright (c) 1996, 2009, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with -this program; if not, write to the Free Software Foundation, Inc., 59 Temple -Place, Suite 330, Boston, MA 02111-1307 USA +this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA *****************************************************************************/ @@ -35,6 +35,16 @@ extern ulint data_mysql_default_charset_coll; /* SQL data type struct */ typedef struct dtype_struct dtype_t; +/* SQL Like operator comparison types */ +enum ib_like_enum { + IB_LIKE_EXACT, /* e.g. STRING */ + IB_LIKE_PREFIX, /* e.g., STRING% */ + IB_LIKE_SUFFIX, /* e.g., %STRING */ + IB_LIKE_SUBSTR, /* e.g., %STRING% */ + IB_LIKE_REGEXP /* Future */ +}; +typedef enum ib_like_enum ib_like_t; + /*-------------------------------------------*/ /* The 'MAIN TYPE' of a column */ #define DATA_VARCHAR 1 /* character varying of the @@ -139,6 +149,8 @@ be less than 256 */ #define DATA_N_SYS_COLS 3 /* number of system columns defined above */ +#define DATA_FTS_DOC_ID 3 /* Used as FTS DOC ID column */ + #define DATA_SYS_PRTYPE_MASK 0xF /* mask to extract the above from prtype */ /* Flags ORed to the precise data type */ @@ -182,6 +194,12 @@ because in GCC it returns a long. */ /* Get mbmaxlen from mbminmaxlen. */ #define DATA_MBMAXLEN(mbminmaxlen) ((ulint) ((mbminmaxlen) / DATA_MBMAX)) +/* We now support 15 bits (up to 32767) collation number */ +#define MAX_CHAR_COLL_NUM 32767 + +/* Mask to get the Charset Collation number (0x7fff) */ +#define CHAR_COLL_MASK MAX_CHAR_COLL_NUM + #ifndef UNIV_HOTBACKUP /*********************************************************************//** Gets the MySQL type code from a dtype. @@ -450,6 +468,20 @@ dtype_new_read_for_order_and_null_size( /*===================================*/ dtype_t* type, /*!< in: type struct */ const byte* buf); /*!< in: buffer for stored type order info */ + +/*********************************************************************//** +Returns the type's SQL name (e.g. BIGINT UNSIGNED) from mtype,prtype,len +@return the SQL type name */ +UNIV_INLINE +char* +dtype_sql_name( +/*===========*/ + unsigned mtype, /*!< in: mtype */ + unsigned prtype, /*!< in: prtype */ + unsigned len, /*!< in: len */ + char* name, /*!< out: SQL name */ + unsigned name_sz);/*!< in: size of the name buffer */ + #endif /* !UNIV_HOTBACKUP */ /*********************************************************************//** @@ -477,14 +509,14 @@ dtype_new_read_for_order_and_null_size() sym_tab_add_null_lit() */ struct dtype_struct{ - unsigned mtype:8; /*!< main data type */ - unsigned prtype:24; /*!< precise type; MySQL data + unsigned prtype:32; /*!< precise type; MySQL data type, charset code, flags to indicate nullability, signedness, whether this is a binary string, whether this is a true VARCHAR where MySQL uses 2 bytes to store the length */ + unsigned mtype:8; /*!< main data type */ /* the remaining fields do not affect alphabetical ordering: */ |