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

« back to all changes in this revision

Viewing changes to drizzled/function_hash.h

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-06-19 10:46:49 UTC
  • mfrom: (1.1.6)
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20120619104649-e2l0ggd4oz3um0f4
Tags: upstream-7.1.36-stable
ImportĀ upstreamĀ versionĀ 7.1.36-stable

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* C++ code produced by gperf version 3.0.3 */
 
1
/* C++ code produced by gperf version 3.0.4 */
2
2
/* Command-line: /usr/bin/gperf -D --initializer-suffix=,0 --struct-type --enum --omit-struct-type --readonly-tables --language=C++ --class-name=function_hash drizzled/function_hash.gperf  */
3
3
/* Computed positions: -k'1,3,6' */
4
4
 
54
54
/* This file includes all functions */
55
55
 
56
56
#include <drizzled/foreign_key.h>
57
 
#include <drizzled/sql_yacc.h>
 
57
#include <drizzled/sql_yacc.hh>
58
58
#include <drizzled/lex_symbol.h>
59
59
 
60
60
using namespace drizzled;
68
68
  are compiled into the server. Don't add ifdef'ed symbols to the
69
69
  lists
70
70
*/
71
 
/* maximum key range = 53, duplicates = 0 */
 
71
/* maximum key range = 50, duplicates = 0 */
72
72
 
73
73
class function_hash
74
74
{
75
75
private:
76
76
  static inline unsigned int hash (const char *str, unsigned int len);
77
77
public:
78
 
  static const struct st_symbol *in_word_set (const char *str, unsigned int len);
 
78
  static const struct SYMBOL *in_word_set (const char *str, unsigned int len);
79
79
};
80
80
 
81
81
inline unsigned int
83
83
{
84
84
  static const unsigned char asso_values[] =
85
85
    {
86
 
      57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
87
 
      57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
88
 
      57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
89
 
      57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
90
 
      57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
91
 
      57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
92
 
      57, 57, 57, 57, 57,  5,  5,  0, 15,  3,
93
 
      57,  5, 57,  0, 57, 57, 57,  5, 23, 10,
94
 
       3, 57, 25,  0,  5,  0,  0, 15,  5, 57,
95
 
      57, 57, 57, 57, 57,  0, 57, 57, 57, 57,
96
 
      57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
97
 
      57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
98
 
      57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
99
 
      57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
100
 
      57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
101
 
      57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
102
 
      57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
103
 
      57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
104
 
      57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
105
 
      57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
106
 
      57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
107
 
      57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
108
 
      57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
109
 
      57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
110
 
      57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
111
 
      57, 57, 57, 57, 57, 57
 
86
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
 
87
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
 
88
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
 
89
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
 
90
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
 
91
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
 
92
      54, 54, 54, 54, 54, 10, 15,  0, 15, 20,
 
93
      54, 10, 54,  0, 54, 54, 54,  5, 30,  3,
 
94
       3, 54, 10,  0, 10,  0,  0, 20,  5, 54,
 
95
      54, 54, 54, 54, 54,  5, 54, 54, 54, 54,
 
96
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
 
97
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
 
98
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
 
99
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
 
100
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
 
101
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
 
102
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
 
103
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
 
104
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
 
105
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
 
106
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
 
107
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
 
108
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
 
109
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
 
110
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
 
111
      54, 54, 54, 54, 54, 54
112
112
    };
113
113
  register int hval = len;
114
114
 
130
130
  return hval;
131
131
}
132
132
 
133
 
const struct st_symbol *
 
133
const struct SYMBOL *
134
134
function_hash::in_word_set (register const char *str, register unsigned int len)
135
135
{
136
136
  enum
137
137
    {
138
 
      TOTAL_KEYWORDS = 28,
 
138
      TOTAL_KEYWORDS = 29,
139
139
      MIN_WORD_LENGTH = 3,
140
140
      MAX_WORD_LENGTH = 12,
141
141
      MIN_HASH_VALUE = 4,
142
 
      MAX_HASH_VALUE = 56
 
142
      MAX_HASH_VALUE = 53
143
143
    };
144
144
 
145
 
  static const struct st_symbol wordlist[] =
 
145
  static const struct SYMBOL wordlist[] =
146
146
    {
147
147
#line 46 "drizzled/function_hash.gperf"
148
148
      {"CAST",CAST_SYM},
149
149
#line 47 "drizzled/function_hash.gperf"
150
150
      {"COUNT",COUNT_SYM},
151
 
#line 67 "drizzled/function_hash.gperf"
 
151
#line 68 "drizzled/function_hash.gperf"
152
152
      {"SUM",SUM_SYM},
153
 
#line 70 "drizzled/function_hash.gperf"
154
 
      {"TRIM",TRIM},
155
 
#line 58 "drizzled/function_hash.gperf"
 
153
#line 59 "drizzled/function_hash.gperf"
156
154
      {"POSITION",POSITION_SYM},
157
 
#line 68 "drizzled/function_hash.gperf"
158
 
      {"SYSDATE",SYSDATE},
159
 
#line 53 "drizzled/function_hash.gperf"
 
155
#line 54 "drizzled/function_hash.gperf"
160
156
      {"MAX",MAX_SYM},
161
 
#line 51 "drizzled/function_hash.gperf"
162
 
      {"EXTRACT",EXTRACT_SYM},
 
157
#line 71 "drizzled/function_hash.gperf"
 
158
      {"TRIM",TRIM},
 
159
#line 60 "drizzled/function_hash.gperf"
 
160
      {"SESSION_USER",USER},
 
161
#line 70 "drizzled/function_hash.gperf"
 
162
      {"SYSTEM_USER",USER},
163
163
#line 69 "drizzled/function_hash.gperf"
164
 
      {"SYSTEM_USER",USER},
165
 
#line 64 "drizzled/function_hash.gperf"
166
 
      {"SUBDATE",SUBDATE_SYM},
167
 
#line 60 "drizzled/function_hash.gperf"
 
164
      {"SYSDATE",SYSDATE},
 
165
#line 61 "drizzled/function_hash.gperf"
168
166
      {"STD",STD_SYM},
169
 
#line 61 "drizzled/function_hash.gperf"
 
167
#line 73 "drizzled/function_hash.gperf"
 
168
      {"VAR_POP",VARIANCE_SYM},
 
169
#line 62 "drizzled/function_hash.gperf"
170
170
      {"STDDEV",STD_SYM},
171
 
#line 59 "drizzled/function_hash.gperf"
172
 
      {"SESSION_USER",USER},
173
 
#line 55 "drizzled/function_hash.gperf"
 
171
#line 49 "drizzled/function_hash.gperf"
 
172
      {"CURTIME",CURTIME},
 
173
#line 56 "drizzled/function_hash.gperf"
174
174
      {"MID",SUBSTRING},
175
 
#line 62 "drizzled/function_hash.gperf"
 
175
#line 63 "drizzled/function_hash.gperf"
176
176
      {"STDDEV_POP",STD_SYM},
177
 
#line 63 "drizzled/function_hash.gperf"
 
177
#line 64 "drizzled/function_hash.gperf"
178
178
      {"STDDEV_SAMP",STDDEV_SAMP_SYM},
179
 
#line 52 "drizzled/function_hash.gperf"
 
179
#line 48 "drizzled/function_hash.gperf"
 
180
      {"CURDATE",CURDATE},
 
181
#line 74 "drizzled/function_hash.gperf"
 
182
      {"VAR_SAMP",VAR_SAMP_SYM},
 
183
#line 53 "drizzled/function_hash.gperf"
180
184
      {"GROUP_CONCAT",GROUP_CONCAT_SYM},
181
 
#line 50 "drizzled/function_hash.gperf"
 
185
#line 66 "drizzled/function_hash.gperf"
 
186
      {"SUBSTR",SUBSTRING},
 
187
#line 65 "drizzled/function_hash.gperf"
 
188
      {"SUBDATE",SUBDATE_SYM},
 
189
#line 51 "drizzled/function_hash.gperf"
182
190
      {"DATE_SUB",DATE_SUB_INTERVAL},
183
 
#line 56 "drizzled/function_hash.gperf"
 
191
#line 67 "drizzled/function_hash.gperf"
 
192
      {"SUBSTRING",SUBSTRING},
 
193
#line 52 "drizzled/function_hash.gperf"
 
194
      {"EXTRACT",EXTRACT_SYM},
 
195
#line 57 "drizzled/function_hash.gperf"
184
196
      {"MIN",MIN_SYM},
185
197
#line 45 "drizzled/function_hash.gperf"
186
198
      {"ADDDATE",ADDDATE_SYM},
187
 
#line 49 "drizzled/function_hash.gperf"
 
199
#line 50 "drizzled/function_hash.gperf"
188
200
      {"DATE_ADD",DATE_ADD_INTERVAL},
189
 
#line 65 "drizzled/function_hash.gperf"
190
 
      {"SUBSTR",SUBSTRING},
191
 
#line 48 "drizzled/function_hash.gperf"
192
 
      {"CURDATE",CURDATE},
193
 
#line 73 "drizzled/function_hash.gperf"
194
 
      {"VAR_SAMP",VAR_SAMP_SYM},
195
 
#line 66 "drizzled/function_hash.gperf"
196
 
      {"SUBSTRING",SUBSTRING},
197
 
#line 57 "drizzled/function_hash.gperf"
198
 
      {"NOW",NOW_SYM},
199
201
#line 72 "drizzled/function_hash.gperf"
200
 
      {"VAR_POP",VARIANCE_SYM},
201
 
#line 71 "drizzled/function_hash.gperf"
202
 
      {"VARIANCE",VARIANCE_SYM}
 
202
      {"VARIANCE",VARIANCE_SYM},
 
203
#line 58 "drizzled/function_hash.gperf"
 
204
      {"NOW",NOW_SYM}
203
205
    };
204
206
 
205
207
  static const signed char lookup[] =
206
208
    {
207
 
      -1, -1, -1, -1,  0,  1, -1, -1,  2,  3, -1,  4,  5,  6,
208
 
      -1,  7,  8,  9, 10, -1, -1, 11, 12, 13, -1, 14, 15, 16,
209
 
      17, -1, -1, 18, 19, 20, -1, -1, 21, 22, 23, 24, -1, 25,
210
 
      26, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
211
 
      27
 
209
      -1, -1, -1, -1,  0,  1, -1, -1,  2, -1, -1,  3, -1,  4,
 
210
       5,  6,  7,  8,  9, -1, 10, 11, 12, 13, -1, 14, 15, 16,
 
211
      17, -1, 18, 19, 20, 21, 22, -1, -1, 23, 24, -1, -1, -1,
 
212
      25, 26, -1, -1, -1, -1, 27, -1, -1, -1, -1, 28
212
213
    };
213
214
 
214
215
  if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
230
231
    }
231
232
  return 0;
232
233
}
233
 
#line 74 "drizzled/function_hash.gperf"
 
234
#line 75 "drizzled/function_hash.gperf"
234
235