~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-10-02 14:17:48 UTC
  • mfrom: (1.1.1 upstream)
  • mto: (2.1.17 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20101002141748-m6vbfbfjhrw1153e
Tags: 2010.09.1802-1
* New upstream release.
* Removed pid-file argument hack.
* Updated GPL-2 address to be new address.
* Directly copy in drizzledump.1 since debian doesn't have sphinx 1.0 yet.
* Link to jquery from libjs-jquery. Add it as a depend.
* Add drizzled.8 symlink to the install files.

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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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
 
 
34
typedef struct dt_field_info
 
35
        {
 
36
        /** 
 
37
        This is used as column name. 
 
38
        */
 
39
        const char* field_name;
 
40
        /**
 
41
        For string-type columns, this is the maximum number of
 
42
        characters. For numeric data this can be NULL.
 
43
        */
 
44
        uint field_length;
 
45
 
 
46
        /**
 
47
        For decimal  columns, this is the maximum number of
 
48
        digits after the decimal. For other data this can be NULL.
 
49
        */
 
50
        char* field_decimal_length;
 
51
        /**
 
52
        This denotes data type for the column. For the most part, there seems to
 
53
        be one entry in the enum for each SQL data type, although there seem to
 
54
        be a number of additional entries in the enum.
 
55
        */
 
56
#ifdef DRIZZLED
 
57
        enum drizzled::enum_field_types field_type;
 
58
#else
 
59
        enum enum_field_types field_type;
 
60
#endif
 
61
 
 
62
        /**
 
63
        This is the charater set for non numeric data types including blob data.
 
64
        */
 
65
#ifdef DRIZZLED
 
66
        const drizzled::CHARSET_INFO *field_charset;
 
67
#else
 
68
        CHARSET_INFO *field_charset;
 
69
#endif
 
70
        uint field_flags;        // Field atributes(maybe_null, signed, unsigned etc.)
 
71
        const char* comment;
 
72
} DT_FIELD_INFO;
 
73
 
 
74
typedef struct dt_key_info
 
75
{
 
76
        const char*     key_name;
 
77
        uint            key_type; /* PRI_KEY_FLAG, UNIQUE_KEY_FLAG, MULTIPLE_KEY_FLAG */
 
78
        const char*     key_columns[8]; // The size of this can be set to what ever you need.
 
79
} DT_KEY_INFO;
 
80
 
 
81
typedef struct internal_table_info {
 
82
        bool                    is_pbms;
 
83
        const char              *name;
 
84
        DT_FIELD_INFO   *info;
 
85
        DT_KEY_INFO             *keys;
 
86
} INTERRNAL_TABLE_INFO;
 
87
 
 
88
 
 
89
#ifndef DRIZZLED
 
90
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);
 
91
#endif
 
92
 
 
93
#endif
 
94