~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/pbms/src/discover_ms.h

Merge Revision revid:marko.makela@oracle.com-20100505101406-u4low2x26q6itck0 from MySQL InnoDB

Original revid:marko.makela@oracle.com-20100505101406-u4low2x26q6itck0

Original Authors: Marko Mäkelä <marko.makela@oracle.com>
Original commit message:
Merge from mysql-5.1-innodb:

  ------------------------------------------------------------
  revno: 3446
  revision-id: marko.makela@oracle.com-20100505100507-6kcd2hf32hruxbv7
  parent: marko.makela@oracle.com-20100505095328-vetnl0flhmhao7p5
  committer: Marko Mäkelä <marko.makela@oracle.com>
  branch nick: 5.1-innodb
  timestamp: Wed 2010-05-05 13:05:07 +0300
  message:
    Add Valgrind diagnostics to track down Bug #38999.
  ------------------------------------------------------------

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (c) 2008 PrimeBase Technologies GmbH, Germany
 
2
 *
 
3
 * PrimeBase MS
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or modify
 
6
 * it under the terms of the GNU General Public License as published by
 
7
 * the Free Software Foundation; either version 2 of the License, or
 
8
 * (at your option) any later version.
 
9
 *
 
10
 * This program is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program; if not, write to the Free Software
 
17
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
18
 *
 
19
 *  Created by Leslie on 8/27/08.
 
20
 *
 
21
 */
 
22
 
 
23
#ifndef __DISCOVER_MS_H__
 
24
#define __DISCOVER_MS_H__
 
25
#include "cslib/CSConfig.h"
 
26
 
 
27
#define UTF8_CHARSET    my_charset_utf8_general_ci
 
28
 
 
29
/*
 
30
 * ---------------------------------------------------------------
 
31
 * TABLE DISCOVERY HANDLER
 
32
 */
 
33
#define NOVAL 0
 
34
 
 
35
typedef struct dt_field_info
 
36
        {
 
37
        /** 
 
38
        This is used as column name. 
 
39
        */
 
40
        const char* field_name;
 
41
        /**
 
42
        For string-type columns, this is the maximum number of
 
43
        characters. For numeric data this can be NULL.
 
44
        */
 
45
        uint field_length;
 
46
 
 
47
        /**
 
48
        For decimal  columns, this is the maximum number of
 
49
        digits after the decimal. For other data this can be NULL.
 
50
        */
 
51
        char* field_decimal_length;
 
52
        /**
 
53
        This denotes data type for the column. For the most part, there seems to
 
54
        be one entry in the enum for each SQL data type, although there seem to
 
55
        be a number of additional entries in the enum.
 
56
        */
 
57
#ifdef DRIZZLED
 
58
        enum drizzled::enum_field_types field_type;
 
59
#else
 
60
        enum enum_field_types field_type;
 
61
#endif
 
62
 
 
63
        /**
 
64
        This is the charater set for non numeric data types including blob data.
 
65
        */
 
66
#ifdef DRIZZLED
 
67
        const drizzled::CHARSET_INFO *field_charset;
 
68
#else
 
69
        CHARSET_INFO *field_charset;
 
70
#endif
 
71
        uint field_flags;        // Field atributes(maybe_null, signed, unsigned etc.)
 
72
        const char* comment;
 
73
} DT_FIELD_INFO;
 
74
 
 
75
typedef struct dt_key_info
 
76
{
 
77
        const char*     key_name;
 
78
        uint            key_type; /* PRI_KEY_FLAG, UNIQUE_KEY_FLAG, MULTIPLE_KEY_FLAG */
 
79
        const char*     key_columns[8]; // The size of this can be set to what ever you need.
 
80
} DT_KEY_INFO;
 
81
 
 
82
typedef struct internal_table_info {
 
83
        bool                    is_pbms;
 
84
        const char              *name;
 
85
        DT_FIELD_INFO   *info;
 
86
        DT_KEY_INFO             *keys;
 
87
} INTERRNAL_TABLE_INFO;
 
88
 
 
89
 
 
90
#ifndef DRIZZLED
 
91
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);
 
92
#endif
 
93
 
 
94
#endif
 
95