The world's most popular open source database
00001 /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB 00002 00003 This program is free software; you can redistribute it and/or modify 00004 it under the terms of the GNU General Public License as published by 00005 the Free Software Foundation; either version 2 of the License, or 00006 (at your option) any later version. 00007 00008 This program is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 GNU General Public License for more details. 00012 00013 You should have received a copy of the GNU General Public License 00014 along with this program; if not, write to the Free Software 00015 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ 00016 00017 00018 /* Extra functions used by unireg library */ 00019 00020 #ifndef _unireg_h 00021 00022 #ifndef NO_ALARM_LOOP 00023 #define NO_ALARM_LOOP /* lib5 and popen can't use alarm */ 00024 #endif 00025 00026 /* These paths are converted to other systems (WIN95) before use */ 00027 00028 #define LANGUAGE "english/" 00029 #define ERRMSG_FILE "errmsg.sys" 00030 #define TEMP_PREFIX "MY" 00031 #define LOG_PREFIX "ML" 00032 #define PROGDIR "bin/" 00033 #ifndef DATADIR 00034 #define DATADIR "data/" 00035 #endif 00036 #ifndef SHAREDIR 00037 #define SHAREDIR "share/" 00038 #endif 00039 #ifndef LIBDIR 00040 #define LIBDIR "lib/" 00041 #endif 00042 00043 #define ER(X) errmesg[(X) - ER_ERROR_FIRST] 00044 #define ER_SAFE(X) (((X) >= ER_ERROR_FIRST && (X) <= ER_ERROR_LAST) ? ER(X) : "Invalid error code") 00045 00046 00047 #define ERRMAPP 1 /* Errormap f|r my_error */ 00048 #define LIBLEN FN_REFLEN-FN_LEN /* Max l{ngd p} dev */ 00049 /* extra 4+4 bytes for slave tmp tables */ 00050 #define MAX_DBKEY_LENGTH (NAME_LEN*2+1+1+4+4) 00051 #define MAX_ALIAS_NAME 256 00052 #define MAX_FIELD_NAME 34 /* Max colum name length +2 */ 00053 #define MAX_SYS_VAR_LENGTH 32 00054 #define MAX_KEY MAX_INDEXES /* Max used keys */ 00055 #define MAX_REF_PARTS 16 /* Max parts used as ref */ 00056 #define MAX_KEY_LENGTH 3072 /* max possible key */ 00057 #if SIZEOF_OFF_T > 4 00058 #define MAX_REFLENGTH 8 /* Max length for record ref */ 00059 #else 00060 #define MAX_REFLENGTH 4 /* Max length for record ref */ 00061 #endif 00062 #define MAX_HOSTNAME 61 /* len+1 in mysql.user */ 00063 00064 #define MAX_MBWIDTH 3 /* Max multibyte sequence */ 00065 #define MAX_FIELD_CHARLENGTH 255 00066 #define MAX_FIELD_VARCHARLENGTH 65535 00067 #define CONVERT_IF_BIGGER_TO_BLOB 512 /* Used for CREATE ... SELECT */ 00068 00069 /* Max column width +1 */ 00070 #define MAX_FIELD_WIDTH (MAX_FIELD_CHARLENGTH*MAX_MBWIDTH+1) 00071 00072 #define MAX_BIT_FIELD_LENGTH 64 /* Max length in bits for bit fields */ 00073 00074 #define MAX_DATE_WIDTH 10 /* YYYY-MM-DD */ 00075 #define MAX_TIME_WIDTH 23 /* -DDDDDD HH:MM:SS.###### */ 00076 #define MAX_DATETIME_FULL_WIDTH 29 /* YYYY-MM-DD HH:MM:SS.###### AM */ 00077 #define MAX_DATETIME_WIDTH 19 /* YYYY-MM-DD HH:MM:SS */ 00078 00079 #define MAX_TABLES (sizeof(table_map)*8-3) /* Max tables in join */ 00080 #define PARAM_TABLE_BIT (((table_map) 1) << (sizeof(table_map)*8-3)) 00081 #define OUTER_REF_TABLE_BIT (((table_map) 1) << (sizeof(table_map)*8-2)) 00082 #define RAND_TABLE_BIT (((table_map) 1) << (sizeof(table_map)*8-1)) 00083 #define PSEUDO_TABLE_BITS (PARAM_TABLE_BIT | OUTER_REF_TABLE_BIT | \ 00084 RAND_TABLE_BIT) 00085 #define MAX_FIELDS 4096 /* Limit in the .frm file */ 00086 #define MAX_PARTITIONS 1024 00087 00088 #define MAX_SORT_MEMORY (2048*1024-MALLOC_OVERHEAD) 00089 #define MIN_SORT_MEMORY (32*1024-MALLOC_OVERHEAD) 00090 00091 /* Memory allocated when parsing a statement / saving a statement */ 00092 #define MEM_ROOT_BLOCK_SIZE 8192 00093 #define MEM_ROOT_PREALLOC 8192 00094 #define TRANS_MEM_ROOT_BLOCK_SIZE 4096 00095 #define TRANS_MEM_ROOT_PREALLOC 4096 00096 00097 #define DEFAULT_ERROR_COUNT 64 00098 #define EXTRA_RECORDS 10 /* Extra records in sort */ 00099 #define SCROLL_EXTRA 5 /* Extra scroll-rows. */ 00100 #define FIELD_NAME_USED ((uint) 32768) /* Bit set if fieldname used */ 00101 #define FORM_NAME_USED ((uint) 16384) /* Bit set if formname used */ 00102 #define FIELD_NR_MASK 16383 /* To get fieldnumber */ 00103 #define FERR -1 /* Error from my_functions */ 00104 #define CREATE_MODE 0 /* Default mode on new files */ 00105 #define NAMES_SEP_CHAR '\377' /* Char to sep. names */ 00106 00107 #define READ_RECORD_BUFFER (uint) (IO_SIZE*8) /* Pointer_buffer_size */ 00108 #define DISK_BUFFER_SIZE (uint) (IO_SIZE*16) /* Size of diskbuffer */ 00109 #define POSTFIX_ERROR DBL_MAX 00110 00111 #define ME_INFO (ME_HOLDTANG+ME_OLDWIN+ME_NOREFRESH) 00112 #define ME_ERROR (ME_BELL+ME_OLDWIN+ME_NOREFRESH) 00113 #define MYF_RW MYF(MY_WME+MY_NABP) /* Vid my_read & my_write */ 00114 00115 #define SPECIAL_USE_LOCKS 1 /* Lock used databases */ 00116 #define SPECIAL_NO_NEW_FUNC 2 /* Skip new functions */ 00117 #define SPECIAL_SKIP_SHOW_DB 4 /* Don't allow 'show db' */ 00118 #define SPECIAL_WAIT_IF_LOCKED 8 /* Wait if locked database */ 00119 #define SPECIAL_SAME_DB_NAME 16 /* form name = file name */ 00120 #define SPECIAL_ENGLISH 32 /* English error messages */ 00121 #define SPECIAL_NO_RESOLVE 64 /* Don't use gethostname */ 00122 #define SPECIAL_NO_PRIOR 128 /* Don't prioritize threads */ 00123 #define SPECIAL_BIG_SELECTS 256 /* Don't use heap tables */ 00124 #define SPECIAL_NO_HOST_CACHE 512 /* Don't cache hosts */ 00125 #define SPECIAL_SHORT_LOG_FORMAT 1024 00126 #define SPECIAL_SAFE_MODE 2048 00127 #define SPECIAL_LOG_QUERIES_NOT_USING_INDEXES 4096 /* Log q not using indexes */ 00128 00129 /* Extern defines */ 00130 #define store_record(A,B) bmove_align((A)->B,(A)->record[0],(size_t) (A)->s->reclength) 00131 #define restore_record(A,B) bmove_align((A)->record[0],(A)->B,(size_t) (A)->s->reclength) 00132 #define cmp_record(A,B) memcmp((A)->record[0],(A)->B,(size_t) (A)->s->reclength) 00133 #define empty_record(A) { \ 00134 restore_record((A),s->default_values); \ 00135 bfill((A)->null_flags,(A)->s->null_bytes,255);\ 00136 } 00137 00138 /* Defines for use with openfrm, openprt and openfrd */ 00139 00140 #define READ_ALL 1 /* openfrm: Read all parameters */ 00141 #define CHANGE_FRM 2 /* openfrm: open .frm as O_RDWR */ 00142 #define READ_KEYINFO 4 /* L{s nyckeldata fr}n filen */ 00143 #define EXTRA_RECORD 8 /* Reservera plats f|r extra record */ 00144 #define DONT_OPEN_TABLES 8 /* Don't open database-files (frd) */ 00145 #define DONT_OPEN_MASTER_REG 16 /* Don't open first reg-file (prt) */ 00146 #define EXTRA_LONG_RECORD 16 /* Plats f|r dubbel s|k-record */ 00147 #define COMPUTE_TYPES 32 /* Kontrollera type f|r f{ltena */ 00148 #define SEARCH_PRG 64 /* S|k efter registret i 'prg_dev' */ 00149 #define READ_USED_NAMES 128 /* L{s anv{nda formul{rnamn */ 00150 #define DONT_GIVE_ERROR 256 /* Don't do frm_error on openfrm */ 00151 #define READ_SCREENS 1024 /* Read screens, info and helpfile */ 00152 #define DELAYED_OPEN 4096 /* Open table later */ 00153 #define OPEN_VIEW 8192 /* Allow open on view */ 00154 #define OPEN_VIEW_NO_PARSE 16384 /* Open frm only if it's a view, 00155 but do not parse view itself */ 00156 #define SC_INFO_LENGTH 4 /* Form format constant */ 00157 #define TE_INFO_LENGTH 3 00158 #define MTYP_NOEMPTY_BIT 128 00159 00160 #define FRM_VER_TRUE_VARCHAR (FRM_VER+4) /* 10 */ 00161 /* 00162 Minimum length pattern before Turbo Boyer-Moore is used 00163 for SELECT "text" LIKE "%pattern%", excluding the two 00164 wildcards in class Item_func_like. 00165 */ 00166 #define MIN_TURBOBM_PATTERN_LEN 3 00167 00168 /* 00169 Defines for binary logging. 00170 Do not decrease the value of BIN_LOG_HEADER_SIZE. 00171 Do not even increase it before checking code. 00172 */ 00173 00174 #define BIN_LOG_HEADER_SIZE 4 00175 #define FLOATING_POINT_BUFFER 331 00176 00177 #define DEFAULT_KEY_CACHE_NAME "default" 00178 00179 /* Include prototypes for unireg */ 00180 00181 #include "mysqld_error.h" 00182 #include "structs.h" /* All structs we need */ 00183 00184 #endif
1.4.7

