00001 /* Copyright (C) 2008 PrimeBase Technologies GmbH, Germany 00002 * 00003 * PrimeBase MS 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation; either version 2 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00018 * 00019 * Created by Leslie on 8/27/08. 00020 * 00021 */ 00022 00023 #pragma once 00024 #ifndef __DISCOVER_MS_H__ 00025 #define __DISCOVER_MS_H__ 00026 #include "cslib/CSConfig.h" 00027 00028 #define UTF8_CHARSET my_charset_utf8_general_ci 00029 00030 /* 00031 * --------------------------------------------------------------- 00032 * TABLE DISCOVERY HANDLER 00033 */ 00034 #define NOVAL 0 00035 00036 typedef struct dt_field_info 00037 { 00041 const char* field_name; 00046 uint field_length; 00047 00052 char* field_decimal_length; 00058 #ifdef DRIZZLED 00059 enum drizzled::enum_field_types field_type; 00060 #else 00061 enum enum_field_types field_type; 00062 #endif 00063 00067 #ifdef DRIZZLED 00068 const drizzled::CHARSET_INFO *field_charset; 00069 #else 00070 CHARSET_INFO *field_charset; 00071 #endif 00072 uint field_flags; // Field atributes(maybe_null, signed, unsigned etc.) 00073 const char* comment; 00074 } DT_FIELD_INFO; 00075 00076 typedef struct dt_key_info 00077 { 00078 const char* key_name; 00079 uint key_type; /* PRI_KEY_FLAG, UNIQUE_KEY_FLAG, MULTIPLE_KEY_FLAG */ 00080 const char* key_columns[8]; // The size of this can be set to what ever you need. 00081 } DT_KEY_INFO; 00082 00083 typedef struct internal_table_info { 00084 bool is_pbms; 00085 const char *name; 00086 DT_FIELD_INFO *info; 00087 DT_KEY_INFO *keys; 00088 } INTERRNAL_TABLE_INFO; 00089 00090 00091 #ifndef DRIZZLED 00092 int ms_create_table_frm(handlerton *hton, THD* thd, const char *db, const char *name, DT_FIELD_INFO *info, DT_KEY_INFO *keys, uchar **frmblob, size_t *frmlen); 00093 #endif 00094 00095 #endif 00096