ReactOS  0.4.14-dev-606-g14ebc0b
sql.tab.c
Go to the documentation of this file.
1 /* A Bison parser, made by GNU Bison 3.0. */
2 
3 /* Bison implementation for Yacc-like parsers in C
4 
5  Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
6 
7  This program is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>. */
19 
20 /* As a special exception, you may create a larger work that contains
21  part or all of the Bison parser skeleton and distribute that work
22  under terms of your choice, so long as that work isn't itself a
23  parser generator using the skeleton or a modified version thereof
24  as a parser skeleton. Alternatively, if you modify or redistribute
25  the parser skeleton itself, you may (at your option) remove this
26  special exception, which will cause the skeleton and the resulting
27  Bison output files to be licensed under the GNU General Public
28  License without this special exception.
29 
30  This special exception was added by the Free Software Foundation in
31  version 2.2 of Bison. */
32 
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34  simplifying the original so-called "semantic" parser. */
35 
36 /* All symbols defined below should begin with yy or YY, to avoid
37  infringing on user name space. This should be done even for local
38  variables, as they might otherwise be expanded by user macros.
39  There are some unavoidable exceptions within include files to
40  define necessary library symbols; they are noted "INFRINGES ON
41  USER NAME SPACE" below. */
42 
43 /* Identify Bison output. */
44 #define YYBISON 1
45 
46 /* Bison version. */
47 #define YYBISON_VERSION "3.0"
48 
49 /* Skeleton name. */
50 #define YYSKELETON_NAME "yacc.c"
51 
52 /* Pure parsers. */
53 #define YYPURE 1
54 
55 /* Push parsers. */
56 #define YYPUSH 0
57 
58 /* Pull parsers. */
59 #define YYPULL 1
60 
61 
62 /* Substitute the variable and function names. */
63 #define yyparse sql_parse
64 #define yylex sql_lex
65 #define yyerror sql_error
66 #define yydebug sql_debug
67 #define yynerrs sql_nerrs
68 
69 
70 /* Copy the first part of user declarations. */
71 #line 1 "sql.y" /* yacc.c:339 */
72 
73 
74 /*
75  * Implementation of the Microsoft Installer (msi.dll)
76  *
77  * Copyright 2002-2004 Mike McCormack for CodeWeavers
78  *
79  * This library is free software; you can redistribute it and/or
80  * modify it under the terms of the GNU Lesser General Public
81  * License as published by the Free Software Foundation; either
82  * version 2.1 of the License, or (at your option) any later version.
83  *
84  * This library is distributed in the hope that it will be useful,
85  * but WITHOUT ANY WARRANTY; without even the implied warranty of
86  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
87  * Lesser General Public License for more details.
88  *
89  * You should have received a copy of the GNU Lesser General Public
90  * License along with this library; if not, write to the Free Software
91  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
92  */
93 
94 
95 #include "config.h"
96 
97 #include <stdarg.h>
98 #include <stdio.h>
99 #include <stdlib.h>
100 
101 #include "windef.h"
102 #include "winbase.h"
103 #include "query.h"
104 #include "wine/list.h"
105 #include "wine/debug.h"
106 #include "wine/unicode.h"
107 
109 
110 static UINT SQL_getstring( void *info, const struct sql_str *strdata, LPWSTR *str );
111 static INT SQL_getint( void *info );
112 static int sql_lex( void *SQL_lval, SQL_input *info );
113 static int sql_error( SQL_input *info, const char *str);
114 
116 static void *parser_alloc( void *info, unsigned int sz );
118 
119 static BOOL SQL_MarkPrimaryKeys( column_info **cols, column_info *keys);
120 
121 static struct expr * EXPR_complex( void *info, struct expr *l, UINT op, struct expr *r );
122 static struct expr * EXPR_unary( void *info, struct expr *l, UINT op );
123 static struct expr * EXPR_column( void *info, const column_info *column );
124 static struct expr * EXPR_ival( void *info, int val );
125 static struct expr * EXPR_sval( void *info, const struct sql_str *str );
126 static struct expr * EXPR_wildcard( void *info );
127 
128 #define PARSER_BUBBLE_UP_VIEW( sql, result, current_view ) \
129  *sql->view = current_view; \
130  result = current_view
131 
132 
133 #line 134 "sql.tab.c" /* yacc.c:339 */
134 
135 # ifndef YY_NULL
136 # if defined __cplusplus && 201103L <= __cplusplus
137 # define YY_NULL nullptr
138 # else
139 # define YY_NULL 0
140 # endif
141 # endif
142 
143 /* Enabling verbose error messages. */
144 #ifdef YYERROR_VERBOSE
145 # undef YYERROR_VERBOSE
146 # define YYERROR_VERBOSE 1
147 #else
148 # define YYERROR_VERBOSE 0
149 #endif
150 
151 /* In a future release of Bison, this section will be replaced
152  by #include "sql.tab.h". */
153 #ifndef YY_SQL_E_REACTOSSYNC_GCC_DLL_WIN32_MSI_SQL_TAB_H_INCLUDED
154 # define YY_SQL_E_REACTOSSYNC_GCC_DLL_WIN32_MSI_SQL_TAB_H_INCLUDED
155 /* Debug traces. */
156 #ifndef YYDEBUG
157 # define YYDEBUG 0
158 #endif
159 #if YYDEBUG
160 extern int sql_debug;
161 #endif
162 
163 /* Token type. */
164 #ifndef YYTOKENTYPE
165 # define YYTOKENTYPE
167  {
168  TK_ALTER = 258,
169  TK_AND = 259,
170  TK_BY = 260,
171  TK_CHAR = 261,
172  TK_COMMA = 262,
173  TK_CREATE = 263,
174  TK_DELETE = 264,
175  TK_DROP = 265,
176  TK_DISTINCT = 266,
177  TK_DOT = 267,
178  TK_EQ = 268,
179  TK_FREE = 269,
180  TK_FROM = 270,
181  TK_GE = 271,
182  TK_GT = 272,
183  TK_HOLD = 273,
184  TK_ADD = 274,
185  TK_ID = 275,
186  TK_ILLEGAL = 276,
187  TK_INSERT = 277,
188  TK_INT = 278,
189  TK_INTEGER = 279,
190  TK_INTO = 280,
191  TK_IS = 281,
192  TK_KEY = 282,
193  TK_LE = 283,
194  TK_LONG = 284,
195  TK_LONGCHAR = 285,
196  TK_LP = 286,
197  TK_LT = 287,
199  TK_MINUS = 289,
200  TK_NE = 290,
201  TK_NOT = 291,
202  TK_NULL = 292,
203  TK_OBJECT = 293,
204  TK_OR = 294,
205  TK_ORDER = 295,
206  TK_PRIMARY = 296,
207  TK_RP = 297,
208  TK_SELECT = 298,
209  TK_SET = 299,
210  TK_SHORT = 300,
211  TK_SPACE = 301,
212  TK_STAR = 302,
213  TK_STRING = 303,
214  TK_TABLE = 304,
216  TK_UPDATE = 306,
217  TK_VALUES = 307,
218  TK_WHERE = 308,
219  TK_WILDCARD = 309,
220  END_OF_FILE = 310,
221  ILLEGAL = 311,
222  SPACE = 312,
224  COMMENT = 314,
225  FUNCTION = 315,
226  COLUMN = 316,
227  TK_LIKE = 318,
229  };
230 #endif
231 
232 /* Value type. */
233 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
234 typedef union YYSTYPE YYSTYPE;
235 union YYSTYPE
236 {
237 #line 68 "sql.y" /* yacc.c:355 */
238 
239  struct sql_str str;
243  struct expr *expr;
245  int integer;
246 
247 #line 248 "sql.tab.c" /* yacc.c:355 */
248 };
249 # define YYSTYPE_IS_TRIVIAL 1
250 # define YYSTYPE_IS_DECLARED 1
251 #endif
252 
253 
254 
255 int sql_parse (SQL_input *info);
256 
257 #endif /* !YY_SQL_E_REACTOSSYNC_GCC_DLL_WIN32_MSI_SQL_TAB_H_INCLUDED */
258 
259 /* Copy the second part of user declarations. */
260 
261 #line 262 "sql.tab.c" /* yacc.c:358 */
262 
263 #ifdef short
264 # undef short
265 #endif
266 
267 #ifdef YYTYPE_UINT8
268 typedef YYTYPE_UINT8 yytype_uint8;
269 #else
270 typedef unsigned char yytype_uint8;
271 #endif
272 
273 #ifdef YYTYPE_INT8
274 typedef YYTYPE_INT8 yytype_int8;
275 #else
276 typedef signed char yytype_int8;
277 #endif
278 
279 #ifdef YYTYPE_UINT16
280 typedef YYTYPE_UINT16 yytype_uint16;
281 #else
282 typedef unsigned short int yytype_uint16;
283 #endif
284 
285 #ifdef YYTYPE_INT16
286 typedef YYTYPE_INT16 yytype_int16;
287 #else
288 typedef short int yytype_int16;
289 #endif
290 
291 #ifndef YYSIZE_T
292 # ifdef __SIZE_TYPE__
293 # define YYSIZE_T __SIZE_TYPE__
294 # elif defined size_t
295 # define YYSIZE_T size_t
296 # elif ! defined YYSIZE_T
297 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
298 # define YYSIZE_T size_t
299 # else
300 # define YYSIZE_T unsigned int
301 # endif
302 #endif
303 
304 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
305 
306 #ifndef YY_
307 # if defined YYENABLE_NLS && YYENABLE_NLS
308 # if ENABLE_NLS
309 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
310 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
311 # endif
312 # endif
313 # ifndef YY_
314 # define YY_(Msgid) Msgid
315 # endif
316 #endif
317 
318 #ifndef __attribute__
319 /* This feature is available in gcc versions 2.5 and later. */
320 # if (! defined __GNUC__ || __GNUC__ < 2 \
321  || (__GNUC__ == 2 && __GNUC_MINOR__ < 5))
322 # define __attribute__(Spec) /* empty */
323 # endif
324 #endif
325 
326 /* Suppress unused-variable warnings by "using" E. */
327 #if ! defined lint || defined __GNUC__
328 # define YYUSE(E) ((void) (E))
329 #else
330 # define YYUSE(E) /* empty */
331 #endif
332 
333 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
334 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
335 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
336  _Pragma ("GCC diagnostic push") \
337  _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
338  _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
339 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
340  _Pragma ("GCC diagnostic pop")
341 #else
342 # define YY_INITIAL_VALUE(Value) Value
343 #endif
344 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
345 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
346 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
347 #endif
348 #ifndef YY_INITIAL_VALUE
349 # define YY_INITIAL_VALUE(Value) /* Nothing. */
350 #endif
351 
352 
353 #if ! defined yyoverflow || YYERROR_VERBOSE
354 
355 /* The parser invokes alloca or malloc; define the necessary symbols. */
356 
357 # ifdef YYSTACK_USE_ALLOCA
358 # if YYSTACK_USE_ALLOCA
359 # ifdef __GNUC__
360 # define YYSTACK_ALLOC __builtin_alloca
361 # elif defined __BUILTIN_VA_ARG_INCR
362 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
363 # elif defined _AIX
364 # define YYSTACK_ALLOC __alloca
365 # elif defined _MSC_VER
366 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
367 # define alloca _alloca
368 # else
369 # define YYSTACK_ALLOC alloca
370 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
371 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
372  /* Use EXIT_SUCCESS as a witness for stdlib.h. */
373 # ifndef EXIT_SUCCESS
374 # define EXIT_SUCCESS 0
375 # endif
376 # endif
377 # endif
378 # endif
379 # endif
380 
381 # ifdef YYSTACK_ALLOC
382  /* Pacify GCC's 'empty if-body' warning. */
383 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
384 # ifndef YYSTACK_ALLOC_MAXIMUM
385  /* The OS might guarantee only one guard page at the bottom of the stack,
386  and a page size can be as small as 4096 bytes. So we cannot safely
387  invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
388  to allow for a few compiler-allocated temporary stack slots. */
389 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
390 # endif
391 # else
392 # define YYSTACK_ALLOC YYMALLOC
393 # define YYSTACK_FREE YYFREE
394 # ifndef YYSTACK_ALLOC_MAXIMUM
395 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
396 # endif
397 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
398  && ! ((defined YYMALLOC || defined malloc) \
399  && (defined YYFREE || defined free)))
400 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
401 # ifndef EXIT_SUCCESS
402 # define EXIT_SUCCESS 0
403 # endif
404 # endif
405 # ifndef YYMALLOC
406 # define YYMALLOC malloc
407 # if ! defined malloc && ! defined EXIT_SUCCESS
408 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
409 # endif
410 # endif
411 # ifndef YYFREE
412 # define YYFREE free
413 # if ! defined free && ! defined EXIT_SUCCESS
414 void free (void *); /* INFRINGES ON USER NAME SPACE */
415 # endif
416 # endif
417 # endif
418 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
419 
420 
421 #if (! defined yyoverflow \
422  && (! defined __cplusplus \
423  || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
424 
425 /* A type that is properly aligned for any stack member. */
426 union yyalloc
427 {
430 };
431 
432 /* The size of the maximum gap between one aligned stack and the next. */
433 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
434 
435 /* The size of an array large to enough to hold all stacks, each with
436  N elements. */
437 # define YYSTACK_BYTES(N) \
438  ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
439  + YYSTACK_GAP_MAXIMUM)
440 
441 # define YYCOPY_NEEDED 1
442 
443 /* Relocate STACK from its old location to the new one. The
444  local variables YYSIZE and YYSTACKSIZE give the old and new number of
445  elements in the stack, and YYPTR gives the new location of the
446  stack. Advance YYPTR to a properly aligned location for the next
447  stack. */
448 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
449  do \
450  { \
451  YYSIZE_T yynewbytes; \
452  YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
453  Stack = &yyptr->Stack_alloc; \
454  yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
455  yyptr += yynewbytes / sizeof (*yyptr); \
456  } \
457  while (0)
458 
459 #endif
460 
461 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
462 /* Copy COUNT objects from SRC to DST. The source and destination do
463  not overlap. */
464 # ifndef YYCOPY
465 # if defined __GNUC__ && 1 < __GNUC__
466 # define YYCOPY(Dst, Src, Count) \
467  __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
468 # else
469 # define YYCOPY(Dst, Src, Count) \
470  do \
471  { \
472  YYSIZE_T yyi; \
473  for (yyi = 0; yyi < (Count); yyi++) \
474  (Dst)[yyi] = (Src)[yyi]; \
475  } \
476  while (0)
477 # endif
478 # endif
479 #endif /* !YYCOPY_NEEDED */
480 
481 /* YYFINAL -- State number of the termination state. */
482 #define YYFINAL 36
483 /* YYLAST -- Last index in YYTABLE. */
484 #define YYLAST 156
485 
486 /* YYNTOKENS -- Number of terminals. */
487 #define YYNTOKENS 65
488 /* YYNNTS -- Number of nonterminals. */
489 #define YYNNTS 37
490 /* YYNRULES -- Number of rules. */
491 #define YYNRULES 87
492 /* YYNSTATES -- Number of states. */
493 #define YYNSTATES 154
494 
495 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
496  by yylex, with out-of-bounds checking. */
497 #define YYUNDEFTOK 2
498 #define YYMAXUTOK 319
499 
500 #define YYTRANSLATE(YYX) \
501  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
502 
503 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
504  as returned by yylex, without out-of-bounds checking. */
505 static const yytype_uint8 yytranslate[] =
506 {
507  0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
508  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
509  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
510  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
511  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
512  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
513  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
514  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
515  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
516  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
517  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
518  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
519  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
520  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
521  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
522  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
523  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
524  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
525  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
526  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
527  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
528  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
529  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
530  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
531  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
532  2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
533  5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
534  15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
535  25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
536  35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
537  45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
538  55, 56, 57, 58, 59, 60, 61, 62, 63, 64
539 };
540 
541 #if YYDEBUG
542  /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
543 static const yytype_uint16 yyrline[] =
544 {
545  0, 117, 117, 125, 126, 127, 128, 129, 130, 131,
546  135, 146, 160, 177, 193, 204, 218, 232, 243, 254,
547  268, 272, 279, 294, 304, 314, 321, 330, 334, 338,
548  345, 349, 356, 360, 364, 368, 372, 376, 380, 387,
549  396, 400, 415, 435, 436, 440, 447, 448, 452, 459,
550  471, 484, 488, 500, 515, 519, 528, 534, 540, 546,
551  552, 558, 564, 570, 576, 582, 588, 597, 598, 602,
552  609, 620, 621, 629, 637, 643, 649, 655, 664, 673,
553  679, 688, 694, 700, 709, 716, 724, 732
554 };
555 #endif
556 
557 #if YYDEBUG || YYERROR_VERBOSE || 0
558 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
559  First, the terminals, then, starting at YYNTOKENS, nonterminals. */
560 static const char *const yytname[] =
561 {
562  "$end", "error", "$undefined", "TK_ALTER", "TK_AND", "TK_BY", "TK_CHAR",
563  "TK_COMMA", "TK_CREATE", "TK_DELETE", "TK_DROP", "TK_DISTINCT", "TK_DOT",
564  "TK_EQ", "TK_FREE", "TK_FROM", "TK_GE", "TK_GT", "TK_HOLD", "TK_ADD",
565  "TK_ID", "TK_ILLEGAL", "TK_INSERT", "TK_INT", "TK_INTEGER", "TK_INTO",
566  "TK_IS", "TK_KEY", "TK_LE", "TK_LONG", "TK_LONGCHAR", "TK_LP", "TK_LT",
567  "TK_LOCALIZABLE", "TK_MINUS", "TK_NE", "TK_NOT", "TK_NULL", "TK_OBJECT",
568  "TK_OR", "TK_ORDER", "TK_PRIMARY", "TK_RP", "TK_SELECT", "TK_SET",
569  "TK_SHORT", "TK_SPACE", "TK_STAR", "TK_STRING", "TK_TABLE",
570  "TK_TEMPORARY", "TK_UPDATE", "TK_VALUES", "TK_WHERE", "TK_WILDCARD",
571  "END_OF_FILE", "ILLEGAL", "SPACE", "UNCLOSED_STRING", "COMMENT",
572  "FUNCTION", "COLUMN", "AGG_FUNCTION.", "TK_LIKE", "TK_NEGATION",
573  "$accept", "query", "onequery", "oneinsert", "onecreate", "oneupdate",
574  "onedelete", "onealter", "alterop", "onedrop", "table_def", "column_def",
575  "column_and_type", "column_type", "data_type_l", "data_type",
576  "data_count", "oneselect", "selectfrom", "selcollist", "collist", "from",
577  "unorderdfrom", "tablelist", "expr", "val", "constlist",
578  "update_assign_list", "column_assignment", "const_val", "column_val",
579  "column", "selcolumn", "table", "id", "string", "number", YY_NULL
580 };
581 #endif
582 
583 # ifdef YYPRINT
584 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
585  (internal) symbol number NUM (which must be that of a token). */
586 static const yytype_uint16 yytoknum[] =
587 {
588  0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
589  265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
590  275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
591  285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
592  295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
593  305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
594  315, 316, 317, 318, 319
595 };
596 # endif
597 
598 #define YYPACT_NINF -80
599 
600 #define yypact_value_is_default(Yystate) \
601  (!!((Yystate) == (-80)))
602 
603 #define YYTABLE_NINF -85
604 
605 #define yytable_value_is_error(Yytable_value) \
606  0
607 
608  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
609  STATE-NUM. */
610 static const yytype_int16 yypact[] =
611 {
612  36, -44, -39, -1, -26, 9, 50, 37, 56, -80,
613  -80, -80, -80, -80, -80, -80, -80, 37, 37, 37,
614  -80, 25, 37, 37, -18, -80, -80, -80, -80, -1,
615  78, 47, 76, -80, 57, -80, -80, 105, 72, 51,
616  55, 100, -80, 81, -80, -80, -18, 37, 37, -80,
617  -80, 37, -80, 37, 62, 37, -12, -12, -80, -80,
618  63, 102, 108, 101, 76, 97, 45, 83, 2, -80,
619  62, 3, 94, -80, -80, 126, -80, -80, 127, 93,
620  62, 37, 52, 37, -80, 106, -80, -80, -80, -80,
621  -80, -80, 31, 103, 118, 37, 111, 11, 62, 62,
622  60, 60, 60, -11, 60, 60, 60, -12, 88, 3,
623  -80, -80, 117, -80, -80, -80, -80, -80, 117, -80,
624  -80, 107, -80, -80, -12, -80, -80, 138, -80, -80,
625  -80, -80, -80, 109, -80, -80, -80, -80, -80, 112,
626  -80, 110, -80, -80, -80, -80, 52, -80, 113, 140,
627  95, 52, -80, -80
628 };
629 
630  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
631  Performed when YYTABLE does not specify something else to do. Zero
632  means the default is an error. */
633 static const yytype_uint8 yydefact[] =
634 {
635  0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
636  5, 4, 6, 7, 8, 9, 3, 0, 0, 0,
637  16, 51, 0, 0, 0, 85, 45, 86, 40, 0,
638  43, 0, 82, 83, 0, 84, 1, 0, 0, 52,
639  54, 0, 22, 0, 41, 42, 0, 0, 0, 21,
640  20, 0, 17, 0, 0, 0, 0, 0, 44, 81,
641  15, 71, 0, 0, 80, 18, 0, 0, 0, 25,
642  0, 53, 0, 78, 55, 54, 48, 50, 46, 0,
643  0, 0, 0, 0, 19, 32, 36, 37, 34, 38,
644  35, 26, 27, 30, 12, 0, 0, 0, 0, 0,
645  0, 0, 0, 0, 0, 0, 0, 0, 0, 14,
646  72, 87, 0, 76, 77, 73, 74, 79, 0, 28,
647  29, 0, 13, 24, 0, 56, 57, 58, 59, 68,
648  67, 63, 60, 0, 65, 62, 61, 64, 47, 0,
649  75, 0, 39, 31, 23, 66, 0, 33, 0, 69,
650  10, 0, 11, 70
651 };
652 
653  /* YYPGOTO[NTERM-NUM]. */
654 static const yytype_int8 yypgoto[] =
655 {
656  -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
657  -80, -80, -47, -80, -80, -80, -80, -80, 124, 104,
658  -53, 120, -80, 96, 19, 26, 5, 73, -80, -79,
659  -7, -29, -80, 14, -6, -80, -16
660 };
661 
662  /* YYDEFGOTO[NTERM-NUM]. */
663 static const yytype_int16 yydefgoto[] =
664 {
665  -1, 8, 9, 10, 11, 12, 13, 14, 52, 15,
666  67, 68, 65, 91, 92, 93, 141, 16, 28, 29,
667  77, 20, 21, 39, 71, 128, 148, 60, 61, 129,
668  130, 73, 30, 63, 64, 33, 116
669 };
670 
671  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
672  positive, shift that token. If negative, reduce the rule whose
673  number is the opposite. If YYTABLE_NINF, syntax error. */
674 static const yytype_int16 yytable[] =
675 {
676  32, 35, 25, 115, 79, 17, 69, 98, 25, 95,
677  18, 35, 35, 35, 19, 98, 35, 35, 32, 62,
678  31, 34, 66, 22, 66, 133, 134, 78, 78, 26,
679  27, 37, 38, 40, 23, 76, 42, 43, 31, 1,
680  32, 59, 99, 96, 2, 3, 4, 72, 123, 35,
681  99, 85, 62, 125, 138, -49, 36, 25, 5, 47,
682  31, 24, 55, 72, 119, 41, 66, 149, 86, 75,
683  25, 144, 149, 72, 87, 88, 111, 117, 78, 6,
684  25, 120, 25, 89, 111, 46, 112, 7, -84, 97,
685  90, 72, 72, 70, 112, 78, 140, 26, 27, 109,
686  113, 48, 142, 53, 54, 56, 114, 100, 113, 81,
687  101, 102, 57, 83, 114, 84, 80, 126, 127, 49,
688  103, 82, 104, 50, 51, 94, 105, 131, 132, 106,
689  135, 136, 137, 55, 107, 108, 122, 118, 124, 121,
690  139, 111, 98, 146, 143, 152, 145, 151, 44, 45,
691  58, 74, 147, 0, 110, 150, 153
692 };
693 
694 static const yytype_int16 yycheck[] =
695 {
696  6, 7, 20, 82, 57, 49, 53, 4, 20, 7,
697  49, 17, 18, 19, 15, 4, 22, 23, 24, 48,
698  6, 7, 51, 49, 53, 36, 37, 56, 57, 47,
699  48, 17, 18, 19, 25, 47, 22, 23, 24, 3,
700  46, 47, 39, 41, 8, 9, 10, 54, 95, 55,
701  39, 6, 81, 42, 107, 0, 0, 20, 22, 12,
702  46, 11, 7, 70, 33, 40, 95, 146, 23, 55,
703  20, 124, 151, 80, 29, 30, 24, 83, 107, 43,
704  20, 50, 20, 38, 24, 7, 34, 51, 12, 70,
705  45, 98, 99, 31, 34, 124, 112, 47, 48, 80,
706  48, 44, 118, 31, 53, 5, 54, 13, 48, 7,
707  16, 17, 31, 12, 54, 18, 53, 98, 99, 14,
708  26, 13, 28, 18, 19, 42, 32, 101, 102, 35,
709  104, 105, 106, 7, 7, 42, 18, 31, 27, 36,
710  52, 24, 4, 31, 37, 50, 37, 7, 24, 29,
711  46, 55, 42, -1, 81, 42, 151
712 };
713 
714  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
715  symbol of state STATE-NUM. */
716 static const yytype_uint8 yystos[] =
717 {
718  0, 3, 8, 9, 10, 22, 43, 51, 66, 67,
719  68, 69, 70, 71, 72, 74, 82, 49, 49, 15,
720  86, 87, 49, 25, 11, 20, 47, 48, 83, 84,
721  97, 98, 99, 100, 98, 99, 0, 98, 98, 88,
722  98, 40, 98, 98, 83, 86, 7, 12, 44, 14,
723  18, 19, 73, 31, 53, 7, 5, 31, 84, 99,
724  92, 93, 96, 98, 99, 77, 96, 75, 76, 77,
725  31, 89, 95, 96, 88, 98, 47, 85, 96, 85,
726  53, 7, 13, 12, 18, 6, 23, 29, 30, 38,
727  45, 78, 79, 80, 42, 7, 41, 89, 4, 39,
728  13, 16, 17, 26, 28, 32, 35, 7, 42, 89,
729  92, 24, 34, 48, 54, 94, 101, 99, 31, 33,
730  50, 36, 18, 77, 27, 42, 89, 89, 90, 94,
731  95, 90, 90, 36, 37, 90, 90, 90, 85, 52,
732  101, 81, 101, 37, 85, 37, 31, 42, 91, 94,
733  42, 7, 50, 91
734 };
735 
736  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
737 static const yytype_uint8 yyr1[] =
738 {
739  0, 65, 66, 67, 67, 67, 67, 67, 67, 67,
740  68, 68, 69, 69, 70, 70, 71, 72, 72, 72,
741  73, 73, 74, 75, 76, 76, 77, 78, 78, 78,
742  79, 79, 80, 80, 80, 80, 80, 80, 80, 81,
743  82, 82, 83, 84, 84, 84, 85, 85, 85, 86,
744  86, 86, 87, 87, 88, 88, 89, 89, 89, 89,
745  89, 89, 89, 89, 89, 89, 89, 90, 90, 91,
746  91, 92, 92, 93, 94, 94, 94, 94, 95, 96,
747  96, 97, 97, 97, 98, 99, 100, 101
748 };
749 
750  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
751 static const yytype_uint8 yyr2[] =
752 {
753  0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
754  10, 11, 6, 7, 6, 4, 2, 4, 5, 6,
755  1, 1, 3, 4, 3, 1, 2, 1, 2, 2,
756  1, 3, 1, 4, 1, 1, 1, 1, 1, 1,
757  2, 3, 2, 1, 3, 1, 1, 3, 1, 2,
758  4, 1, 2, 4, 1, 3, 3, 3, 3, 3,
759  3, 3, 3, 3, 3, 3, 4, 1, 1, 1,
760  3, 1, 3, 3, 1, 2, 1, 1, 1, 3,
761  1, 3, 1, 1, 1, 1, 1, 1
762 };
763 
764 
765 #define yyerrok (yyerrstatus = 0)
766 #define yyclearin (yychar = YYEMPTY)
767 #define YYEMPTY (-2)
768 #define YYEOF 0
769 
770 #define YYACCEPT goto yyacceptlab
771 #define YYABORT goto yyabortlab
772 #define YYERROR goto yyerrorlab
773 
774 
775 #define YYRECOVERING() (!!yyerrstatus)
776 
777 #define YYBACKUP(Token, Value) \
778 do \
779  if (yychar == YYEMPTY) \
780  { \
781  yychar = (Token); \
782  yylval = (Value); \
783  YYPOPSTACK (yylen); \
784  yystate = *yyssp; \
785  goto yybackup; \
786  } \
787  else \
788  { \
789  yyerror (info, YY_("syntax error: cannot back up")); \
790  YYERROR; \
791  } \
792 while (0)
793 
794 /* Error token number */
795 #define YYTERROR 1
796 #define YYERRCODE 256
797 
798 
799 
800 /* Enable debugging if requested. */
801 #if YYDEBUG
802 
803 # ifndef YYFPRINTF
804 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
805 # define YYFPRINTF fprintf
806 # endif
807 
808 # define YYDPRINTF(Args) \
809 do { \
810  if (yydebug) \
811  YYFPRINTF Args; \
812 } while (0)
813 
814 /* This macro is provided for backward compatibility. */
815 #ifndef YY_LOCATION_PRINT
816 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
817 #endif
818 
819 
820 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
821 do { \
822  if (yydebug) \
823  { \
824  YYFPRINTF (stderr, "%s ", Title); \
825  yy_symbol_print (stderr, \
826  Type, Value, info); \
827  YYFPRINTF (stderr, "\n"); \
828  } \
829 } while (0)
830 
831 
832 /*----------------------------------------.
833 | Print this symbol's value on YYOUTPUT. |
834 `----------------------------------------*/
835 
836 static void
837 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, SQL_input *info)
838 {
839  FILE *yyo = yyoutput;
840  YYUSE (yyo);
841  YYUSE (info);
842  if (!yyvaluep)
843  return;
844 # ifdef YYPRINT
845  if (yytype < YYNTOKENS)
846  YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
847 # endif
848  YYUSE (yytype);
849 }
850 
851 
852 /*--------------------------------.
853 | Print this symbol on YYOUTPUT. |
854 `--------------------------------*/
855 
856 static void
857 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, SQL_input *info)
858 {
859  YYFPRINTF (yyoutput, "%s %s (",
860  yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
861 
862  yy_symbol_value_print (yyoutput, yytype, yyvaluep, info);
863  YYFPRINTF (yyoutput, ")");
864 }
865 
866 /*------------------------------------------------------------------.
867 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
868 | TOP (included). |
869 `------------------------------------------------------------------*/
870 
871 static void
872 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
873 {
874  YYFPRINTF (stderr, "Stack now");
875  for (; yybottom <= yytop; yybottom++)
876  {
877  int yybot = *yybottom;
878  YYFPRINTF (stderr, " %d", yybot);
879  }
880  YYFPRINTF (stderr, "\n");
881 }
882 
883 # define YY_STACK_PRINT(Bottom, Top) \
884 do { \
885  if (yydebug) \
886  yy_stack_print ((Bottom), (Top)); \
887 } while (0)
888 
889 
890 /*------------------------------------------------.
891 | Report that the YYRULE is going to be reduced. |
892 `------------------------------------------------*/
893 
894 static void
895 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, SQL_input *info)
896 {
897  unsigned long int yylno = yyrline[yyrule];
898  int yynrhs = yyr2[yyrule];
899  int yyi;
900  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
901  yyrule - 1, yylno);
902  /* The symbols being reduced. */
903  for (yyi = 0; yyi < yynrhs; yyi++)
904  {
905  YYFPRINTF (stderr, " $%d = ", yyi + 1);
906  yy_symbol_print (stderr,
907  yystos[yyssp[yyi + 1 - yynrhs]],
908  &(yyvsp[(yyi + 1) - (yynrhs)])
909  , info);
910  YYFPRINTF (stderr, "\n");
911  }
912 }
913 
914 # define YY_REDUCE_PRINT(Rule) \
915 do { \
916  if (yydebug) \
917  yy_reduce_print (yyssp, yyvsp, Rule, info); \
918 } while (0)
919 
920 /* Nonzero means print parse trace. It is left uninitialized so that
921  multiple parsers can coexist. */
922 int yydebug;
923 #else /* !YYDEBUG */
924 # define YYDPRINTF(Args)
925 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
926 # define YY_STACK_PRINT(Bottom, Top)
927 # define YY_REDUCE_PRINT(Rule)
928 #endif /* !YYDEBUG */
929 
930 
931 /* YYINITDEPTH -- initial size of the parser's stacks. */
932 #ifndef YYINITDEPTH
933 # define YYINITDEPTH 200
934 #endif
935 
936 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
937  if the built-in stack extension method is used).
938 
939  Do not make this value too large; the results are undefined if
940  YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
941  evaluated with infinite-precision integer arithmetic. */
942 
943 #ifndef YYMAXDEPTH
944 # define YYMAXDEPTH 10000
945 #endif
946 
947 
948 #if YYERROR_VERBOSE
949 
950 # ifndef yystrlen
951 # if defined __GLIBC__ && defined _STRING_H
952 # define yystrlen strlen
953 # else
954 /* Return the length of YYSTR. */
955 static YYSIZE_T
956 yystrlen (const char *yystr)
957 {
958  YYSIZE_T yylen;
959  for (yylen = 0; yystr[yylen]; yylen++)
960  continue;
961  return yylen;
962 }
963 # endif
964 # endif
965 
966 # ifndef yystpcpy
967 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
968 # define yystpcpy stpcpy
969 # else
970 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
971  YYDEST. */
972 static char *
973 yystpcpy (char *yydest, const char *yysrc)
974 {
975  char *yyd = yydest;
976  const char *yys = yysrc;
977 
978  while ((*yyd++ = *yys++) != '\0')
979  continue;
980 
981  return yyd - 1;
982 }
983 # endif
984 # endif
985 
986 # ifndef yytnamerr
987 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
988  quotes and backslashes, so that it's suitable for yyerror. The
989  heuristic is that double-quoting is unnecessary unless the string
990  contains an apostrophe, a comma, or backslash (other than
991  backslash-backslash). YYSTR is taken from yytname. If YYRES is
992  null, do not copy; instead, return the length of what the result
993  would have been. */
994 static YYSIZE_T
995 yytnamerr (char *yyres, const char *yystr)
996 {
997  if (*yystr == '"')
998  {
999  YYSIZE_T yyn = 0;
1000  char const *yyp = yystr;
1001 
1002  for (;;)
1003  switch (*++yyp)
1004  {
1005  case '\'':
1006  case ',':
1007  goto do_not_strip_quotes;
1008 
1009  case '\\':
1010  if (*++yyp != '\\')
1011  goto do_not_strip_quotes;
1012  /* Fall through. */
1013  default:
1014  if (yyres)
1015  yyres[yyn] = *yyp;
1016  yyn++;
1017  break;
1018 
1019  case '"':
1020  if (yyres)
1021  yyres[yyn] = '\0';
1022  return yyn;
1023  }
1024  do_not_strip_quotes: ;
1025  }
1026 
1027  if (! yyres)
1028  return yystrlen (yystr);
1029 
1030  return yystpcpy (yyres, yystr) - yyres;
1031 }
1032 # endif
1033 
1034 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1035  about the unexpected token YYTOKEN for the state stack whose top is
1036  YYSSP.
1037 
1038  Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1039  not large enough to hold the message. In that case, also set
1040  *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1041  required number of bytes is too large to store. */
1042 static int
1043 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1044  yytype_int16 *yyssp, int yytoken)
1045 {
1046  YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
1047  YYSIZE_T yysize = yysize0;
1048  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1049  /* Internationalized format string. */
1050  const char *yyformat = YY_NULL;
1051  /* Arguments of yyformat. */
1052  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1053  /* Number of reported tokens (one for the "unexpected", one per
1054  "expected"). */
1055  int yycount = 0;
1056 
1057  /* There are many possibilities here to consider:
1058  - If this state is a consistent state with a default action, then
1059  the only way this function was invoked is if the default action
1060  is an error action. In that case, don't check for expected
1061  tokens because there are none.
1062  - The only way there can be no lookahead present (in yychar) is if
1063  this state is a consistent state with a default action. Thus,
1064  detecting the absence of a lookahead is sufficient to determine
1065  that there is no unexpected or expected token to report. In that
1066  case, just report a simple "syntax error".
1067  - Don't assume there isn't a lookahead just because this state is a
1068  consistent state with a default action. There might have been a
1069  previous inconsistent state, consistent state with a non-default
1070  action, or user semantic action that manipulated yychar.
1071  - Of course, the expected token list depends on states to have
1072  correct lookahead information, and it depends on the parser not
1073  to perform extra reductions after fetching a lookahead from the
1074  scanner and before detecting a syntax error. Thus, state merging
1075  (from LALR or IELR) and default reductions corrupt the expected
1076  token list. However, the list is correct for canonical LR with
1077  one exception: it will still contain any token that will not be
1078  accepted due to an error action in a later state.
1079  */
1080  if (yytoken != YYEMPTY)
1081  {
1082  int yyn = yypact[*yyssp];
1083  yyarg[yycount++] = yytname[yytoken];
1084  if (!yypact_value_is_default (yyn))
1085  {
1086  /* Start YYX at -YYN if negative to avoid negative indexes in
1087  YYCHECK. In other words, skip the first -YYN actions for
1088  this state because they are default actions. */
1089  int yyxbegin = yyn < 0 ? -yyn : 0;
1090  /* Stay within bounds of both yycheck and yytname. */
1091  int yychecklim = YYLAST - yyn + 1;
1092  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1093  int yyx;
1094 
1095  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1096  if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1097  && !yytable_value_is_error (yytable[yyx + yyn]))
1098  {
1099  if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1100  {
1101  yycount = 1;
1102  yysize = yysize0;
1103  break;
1104  }
1105  yyarg[yycount++] = yytname[yyx];
1106  {
1107  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
1108  if (! (yysize <= yysize1
1109  && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1110  return 2;
1111  yysize = yysize1;
1112  }
1113  }
1114  }
1115  }
1116 
1117  switch (yycount)
1118  {
1119 # define YYCASE_(N, S) \
1120  case N: \
1121  yyformat = S; \
1122  break
1123  YYCASE_(0, YY_("syntax error"));
1124  YYCASE_(1, YY_("syntax error, unexpected %s"));
1125  YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1126  YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1127  YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1128  YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1129 # undef YYCASE_
1130  }
1131 
1132  {
1133  YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1134  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1135  return 2;
1136  yysize = yysize1;
1137  }
1138 
1139  if (*yymsg_alloc < yysize)
1140  {
1141  *yymsg_alloc = 2 * yysize;
1142  if (! (yysize <= *yymsg_alloc
1143  && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1144  *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1145  return 1;
1146  }
1147 
1148  /* Avoid sprintf, as that infringes on the user's name space.
1149  Don't have undefined behavior even if the translation
1150  produced a string with the wrong number of "%s"s. */
1151  {
1152  char *yyp = *yymsg;
1153  int yyi = 0;
1154  while ((*yyp = *yyformat) != '\0')
1155  if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1156  {
1157  yyp += yytnamerr (yyp, yyarg[yyi++]);
1158  yyformat += 2;
1159  }
1160  else
1161  {
1162  yyp++;
1163  yyformat++;
1164  }
1165  }
1166  return 0;
1167 }
1168 #endif /* YYERROR_VERBOSE */
1169 
1170 /*-----------------------------------------------.
1171 | Release the memory associated to this symbol. |
1172 `-----------------------------------------------*/
1173 
1174 static void
1175 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, SQL_input *info)
1176 {
1177  YYUSE (yyvaluep);
1178  YYUSE (info);
1179  if (!yymsg)
1180  yymsg = "Deleting";
1181  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1182 
1184  YYUSE (yytype);
1186 }
1187 
1188 
1189 
1190 
1191 /*----------.
1192 | yyparse. |
1193 `----------*/
1194 
1195 int
1197 {
1198 /* The lookahead symbol. */
1199 int yychar;
1200 
1201 
1202 /* The semantic value of the lookahead symbol. */
1203 /* Default value used for initialization, for pacifying older GCCs
1204  or non-GCC compilers. */
1205 YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
1206 YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1207 
1208  /* Number of syntax errors so far. */
1209  int yynerrs;
1210 
1211  int yystate;
1212  /* Number of tokens to shift before error messages enabled. */
1213  int yyerrstatus;
1214 
1215  /* The stacks and their tools:
1216  'yyss': related to states.
1217  'yyvs': related to semantic values.
1218 
1219  Refer to the stacks through separate pointers, to allow yyoverflow
1220  to reallocate them elsewhere. */
1221 
1222  /* The state stack. */
1223  yytype_int16 yyssa[YYINITDEPTH];
1224  yytype_int16 *yyss;
1225  yytype_int16 *yyssp;
1226 
1227  /* The semantic value stack. */
1228  YYSTYPE yyvsa[YYINITDEPTH];
1229  YYSTYPE *yyvs;
1230  YYSTYPE *yyvsp;
1231 
1232  YYSIZE_T yystacksize;
1233 
1234  int yyn;
1235  int yyresult;
1236  /* Lookahead token as an internal (translated) token number. */
1237  int yytoken = 0;
1238  /* The variables used to return semantic value and location from the
1239  action routines. */
1240  YYSTYPE yyval;
1241 
1242 #if YYERROR_VERBOSE
1243  /* Buffer for error messages, and its allocated size. */
1244  char yymsgbuf[128];
1245  char *yymsg = yymsgbuf;
1246  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1247 #endif
1248 
1249 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1250 
1251  /* The number of symbols on the RHS of the reduced rule.
1252  Keep to zero when no symbol should be popped. */
1253  int yylen = 0;
1254 
1255  yyssp = yyss = yyssa;
1256  yyvsp = yyvs = yyvsa;
1257  yystacksize = YYINITDEPTH;
1258 
1259  YYDPRINTF ((stderr, "Starting parse\n"));
1260 
1261  yystate = 0;
1262  yyerrstatus = 0;
1263  yynerrs = 0;
1264  yychar = YYEMPTY; /* Cause a token to be read. */
1265  goto yysetstate;
1266 
1267 /*------------------------------------------------------------.
1268 | yynewstate -- Push a new state, which is found in yystate. |
1269 `------------------------------------------------------------*/
1270  yynewstate:
1271  /* In all cases, when you get here, the value and location stacks
1272  have just been pushed. So pushing a state here evens the stacks. */
1273  yyssp++;
1274 
1275  yysetstate:
1276  *yyssp = yystate;
1277 
1278  if (yyss + yystacksize - 1 <= yyssp)
1279  {
1280  /* Get the current used size of the three stacks, in elements. */
1281  YYSIZE_T yysize = yyssp - yyss + 1;
1282 
1283 #ifdef yyoverflow
1284  {
1285  /* Give user a chance to reallocate the stack. Use copies of
1286  these so that the &'s don't force the real ones into
1287  memory. */
1288  YYSTYPE *yyvs1 = yyvs;
1289  yytype_int16 *yyss1 = yyss;
1290 
1291  /* Each stack pointer address is followed by the size of the
1292  data in use in that stack, in bytes. This used to be a
1293  conditional around just the two extra args, but that might
1294  be undefined if yyoverflow is a macro. */
1295  yyoverflow (YY_("memory exhausted"),
1296  &yyss1, yysize * sizeof (*yyssp),
1297  &yyvs1, yysize * sizeof (*yyvsp),
1298  &yystacksize);
1299 
1300  yyss = yyss1;
1301  yyvs = yyvs1;
1302  }
1303 #else /* no yyoverflow */
1304 # ifndef YYSTACK_RELOCATE
1305  goto yyexhaustedlab;
1306 # else
1307  /* Extend the stack our own way. */
1308  if (YYMAXDEPTH <= yystacksize)
1309  goto yyexhaustedlab;
1310  yystacksize *= 2;
1311  if (YYMAXDEPTH < yystacksize)
1312  yystacksize = YYMAXDEPTH;
1313 
1314  {
1315  yytype_int16 *yyss1 = yyss;
1316  union yyalloc *yyptr =
1317  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1318  if (! yyptr)
1319  goto yyexhaustedlab;
1320  YYSTACK_RELOCATE (yyss_alloc, yyss);
1321  YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1322 # undef YYSTACK_RELOCATE
1323  if (yyss1 != yyssa)
1324  YYSTACK_FREE (yyss1);
1325  }
1326 # endif
1327 #endif /* no yyoverflow */
1328 
1329  yyssp = yyss + yysize - 1;
1330  yyvsp = yyvs + yysize - 1;
1331 
1332  YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1333  (unsigned long int) yystacksize));
1334 
1335  if (yyss + yystacksize - 1 <= yyssp)
1336  YYABORT;
1337  }
1338 
1339  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1340 
1341  if (yystate == YYFINAL)
1342  YYACCEPT;
1343 
1344  goto yybackup;
1345 
1346 /*-----------.
1347 | yybackup. |
1348 `-----------*/
1349 yybackup:
1350 
1351  /* Do appropriate processing given the current state. Read a
1352  lookahead token if we need one and don't already have one. */
1353 
1354  /* First try to decide what to do without reference to lookahead token. */
1355  yyn = yypact[yystate];
1356  if (yypact_value_is_default (yyn))
1357  goto yydefault;
1358 
1359  /* Not known => get a lookahead token if don't already have one. */
1360 
1361  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1362  if (yychar == YYEMPTY)
1363  {
1364  YYDPRINTF ((stderr, "Reading a token: "));
1365  yychar = yylex (&yylval, info);
1366  }
1367 
1368  if (yychar <= YYEOF)
1369  {
1370  yychar = yytoken = YYEOF;
1371  YYDPRINTF ((stderr, "Now at end of input.\n"));
1372  }
1373  else
1374  {
1375  yytoken = YYTRANSLATE (yychar);
1376  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1377  }
1378 
1379  /* If the proper action on seeing token YYTOKEN is to reduce or to
1380  detect an error, take that action. */
1381  yyn += yytoken;
1382  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1383  goto yydefault;
1384  yyn = yytable[yyn];
1385  if (yyn <= 0)
1386  {
1387  if (yytable_value_is_error (yyn))
1388  goto yyerrlab;
1389  yyn = -yyn;
1390  goto yyreduce;
1391  }
1392 
1393  /* Count tokens shifted since error; after three, turn off error
1394  status. */
1395  if (yyerrstatus)
1396  yyerrstatus--;
1397 
1398  /* Shift the lookahead token. */
1399  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1400 
1401  /* Discard the shifted token. */
1402  yychar = YYEMPTY;
1403 
1404  yystate = yyn;
1406  *++yyvsp = yylval;
1408 
1409  goto yynewstate;
1410 
1411 
1412 /*-----------------------------------------------------------.
1413 | yydefault -- do the default action for the current state. |
1414 `-----------------------------------------------------------*/
1415 yydefault:
1416  yyn = yydefact[yystate];
1417  if (yyn == 0)
1418  goto yyerrlab;
1419  goto yyreduce;
1420 
1421 
1422 /*-----------------------------.
1423 | yyreduce -- Do a reduction. |
1424 `-----------------------------*/
1425 yyreduce:
1426  /* yyn is the number of a rule to reduce with. */
1427  yylen = yyr2[yyn];
1428 
1429  /* If YYLEN is nonzero, implement the default value of the action:
1430  '$$ = $1'.
1431 
1432  Otherwise, the following line sets YYVAL to garbage.
1433  This behavior is undocumented and Bison
1434  users should not rely upon it. Assigning to YYVAL
1435  unconditionally makes the parser a bit smaller, and it avoids a
1436  GCC warning that YYVAL may be used uninitialized. */
1437  yyval = yyvsp[1-yylen];
1438 
1439 
1440  YY_REDUCE_PRINT (yyn);
1441  switch (yyn)
1442  {
1443  case 2:
1444 #line 118 "sql.y" /* yacc.c:1646 */
1445  {
1446  SQL_input* sql = (SQL_input*) info;
1447  *sql->view = (yyvsp[0].query);
1448  }
1449 #line 1450 "sql.tab.c" /* yacc.c:1646 */
1450  break;
1451 
1452  case 10:
1453 #line 136 "sql.y" /* yacc.c:1646 */
1454  {
1455  SQL_input *sql = (SQL_input*) info;
1456  MSIVIEW *insert = NULL;
1457 
1458  INSERT_CreateView( sql->db, &insert, (yyvsp[-7].string), (yyvsp[-5].column_list), (yyvsp[-1].column_list), FALSE );
1459  if( !insert )
1460  YYABORT;
1461 
1462  PARSER_BUBBLE_UP_VIEW( sql, (yyval.query), insert );
1463  }
1464 #line 1465 "sql.tab.c" /* yacc.c:1646 */
1465  break;
1466 
1467  case 11:
1468 #line 147 "sql.y" /* yacc.c:1646 */
1469  {
1470  SQL_input *sql = (SQL_input*) info;
1471  MSIVIEW *insert = NULL;
1472 
1473  INSERT_CreateView( sql->db, &insert, (yyvsp[-8].string), (yyvsp[-6].column_list), (yyvsp[-2].column_list), TRUE );
1474  if( !insert )
1475  YYABORT;
1476 
1477  PARSER_BUBBLE_UP_VIEW( sql, (yyval.query), insert );
1478  }
1479 #line 1480 "sql.tab.c" /* yacc.c:1646 */
1480  break;
1481 
1482  case 12:
1483 #line 161 "sql.y" /* yacc.c:1646 */
1484  {
1485  SQL_input* sql = (SQL_input*) info;
1486  MSIVIEW *create = NULL;
1487  UINT r;
1488 
1489  if( !(yyvsp[-1].column_list) )
1490  YYABORT;
1491  r = CREATE_CreateView( sql->db, &create, (yyvsp[-3].string), (yyvsp[-1].column_list), FALSE );
1492  if( !create )
1493  {
1494  sql->r = r;
1495  YYABORT;
1496  }
1497 
1498  PARSER_BUBBLE_UP_VIEW( sql, (yyval.query), create );
1499  }
1500 #line 1501 "sql.tab.c" /* yacc.c:1646 */
1501  break;
1502 
1503  case 13:
1504 #line 178 "sql.y" /* yacc.c:1646 */
1505  {
1506  SQL_input* sql = (SQL_input*) info;
1507  MSIVIEW *create = NULL;
1508 
1509  if( !(yyvsp[-2].column_list) )
1510  YYABORT;
1511  CREATE_CreateView( sql->db, &create, (yyvsp[-4].string), (yyvsp[-2].column_list), TRUE );
1512  if( !create )
1513  YYABORT;
1514 
1515  PARSER_BUBBLE_UP_VIEW( sql, (yyval.query), create );
1516  }
1517 #line 1518 "sql.tab.c" /* yacc.c:1646 */
1518  break;
1519 
1520  case 14:
1521 #line 194 "sql.y" /* yacc.c:1646 */
1522  {
1523  SQL_input* sql = (SQL_input*) info;
1524  MSIVIEW *update = NULL;
1525 
1526  UPDATE_CreateView( sql->db, &update, (yyvsp[-4].string), (yyvsp[-2].column_list), (yyvsp[0].expr) );
1527  if( !update )
1528  YYABORT;
1529 
1530  PARSER_BUBBLE_UP_VIEW( sql, (yyval.query), update );
1531  }
1532 #line 1533 "sql.tab.c" /* yacc.c:1646 */
1533  break;
1534 
1535  case 15:
1536 #line 205 "sql.y" /* yacc.c:1646 */
1537  {
1538  SQL_input* sql = (SQL_input*) info;
1539  MSIVIEW *update = NULL;
1540 
1541  UPDATE_CreateView( sql->db, &update, (yyvsp[-2].string), (yyvsp[0].column_list), NULL );
1542  if( !update )
1543  YYABORT;
1544 
1545  PARSER_BUBBLE_UP_VIEW( sql, (yyval.query), update );
1546  }
1547 #line 1548 "sql.tab.c" /* yacc.c:1646 */
1548  break;
1549 
1550  case 16:
1551 #line 219 "sql.y" /* yacc.c:1646 */
1552  {
1553  SQL_input* sql = (SQL_input*) info;
1554  MSIVIEW *delete = NULL;
1555 
1556  DELETE_CreateView( sql->db, &delete, (yyvsp[0].query) );
1557  if( !delete )
1558  YYABORT;
1559 
1560  PARSER_BUBBLE_UP_VIEW( sql, (yyval.query), delete );
1561  }
1562 #line 1563 "sql.tab.c" /* yacc.c:1646 */
1563  break;
1564 
1565  case 17:
1566 #line 233 "sql.y" /* yacc.c:1646 */
1567  {
1568  SQL_input* sql = (SQL_input*) info;
1569  MSIVIEW *alter = NULL;
1570 
1571  ALTER_CreateView( sql->db, &alter, (yyvsp[-1].string), NULL, (yyvsp[0].integer) );
1572  if( !alter )
1573  YYABORT;
1574 
1575  PARSER_BUBBLE_UP_VIEW( sql, (yyval.query), alter );
1576  }
1577 #line 1578 "sql.tab.c" /* yacc.c:1646 */
1578  break;
1579 
1580  case 18:
1581 #line 244 "sql.y" /* yacc.c:1646 */
1582  {
1583  SQL_input *sql = (SQL_input *)info;
1584  MSIVIEW *alter = NULL;
1585 
1586  ALTER_CreateView( sql->db, &alter, (yyvsp[-2].string), (yyvsp[0].column_list), 0 );
1587  if (!alter)
1588  YYABORT;
1589 
1590  PARSER_BUBBLE_UP_VIEW( sql, (yyval.query), alter );
1591  }
1592 #line 1593 "sql.tab.c" /* yacc.c:1646 */
1593  break;
1594 
1595  case 19:
1596 #line 255 "sql.y" /* yacc.c:1646 */
1597  {
1598  SQL_input *sql = (SQL_input *)info;
1599  MSIVIEW *alter = NULL;
1600 
1601  ALTER_CreateView( sql->db, &alter, (yyvsp[-3].string), (yyvsp[-1].column_list), 1 );
1602  if (!alter)
1603  YYABORT;
1604 
1605  PARSER_BUBBLE_UP_VIEW( sql, (yyval.query), alter );
1606  }
1607 #line 1608 "sql.tab.c" /* yacc.c:1646 */
1608  break;
1609 
1610  case 20:
1611 #line 269 "sql.y" /* yacc.c:1646 */
1612  {
1613  (yyval.integer) = 1;
1614  }
1615 #line 1616 "sql.tab.c" /* yacc.c:1646 */
1616  break;
1617 
1618  case 21:
1619 #line 273 "sql.y" /* yacc.c:1646 */
1620  {
1621  (yyval.integer) = -1;
1622  }
1623 #line 1624 "sql.tab.c" /* yacc.c:1646 */
1624  break;
1625 
1626  case 22:
1627 #line 280 "sql.y" /* yacc.c:1646 */
1628  {
1629  SQL_input* sql = (SQL_input*) info;
1630  MSIVIEW* drop = NULL;
1631  UINT r;
1632 
1633  r = DROP_CreateView( sql->db, &drop, (yyvsp[0].string) );
1634  if( r != ERROR_SUCCESS || !(yyval.query) )
1635  YYABORT;
1636 
1637  PARSER_BUBBLE_UP_VIEW( sql, (yyval.query), drop );
1638  }
1639 #line 1640 "sql.tab.c" /* yacc.c:1646 */
1640  break;
1641 
1642  case 23:
1643 #line 295 "sql.y" /* yacc.c:1646 */
1644  {
1645  if( SQL_MarkPrimaryKeys( &(yyvsp[-3].column_list), (yyvsp[0].column_list) ) )
1646  (yyval.column_list) = (yyvsp[-3].column_list);
1647  else
1648  (yyval.column_list) = NULL;
1649  }
1650 #line 1651 "sql.tab.c" /* yacc.c:1646 */
1651  break;
1652 
1653  case 24:
1654 #line 305 "sql.y" /* yacc.c:1646 */
1655  {
1656  column_info *ci;
1657 
1658  for( ci = (yyvsp[-2].column_list); ci->next; ci = ci->next )
1659  ;
1660 
1661  ci->next = (yyvsp[0].column_list);
1662  (yyval.column_list) = (yyvsp[-2].column_list);
1663  }
1664 #line 1665 "sql.tab.c" /* yacc.c:1646 */
1665  break;
1666 
1667  case 25:
1668 #line 315 "sql.y" /* yacc.c:1646 */
1669  {
1670  (yyval.column_list) = (yyvsp[0].column_list);
1671  }
1672 #line 1673 "sql.tab.c" /* yacc.c:1646 */
1673  break;
1674 
1675  case 26:
1676 #line 322 "sql.y" /* yacc.c:1646 */
1677  {
1678  (yyval.column_list) = (yyvsp[-1].column_list);
1679  (yyval.column_list)->type = ((yyvsp[0].column_type) | MSITYPE_VALID);
1680  (yyval.column_list)->temporary = (yyvsp[0].column_type) & MSITYPE_TEMPORARY ? TRUE : FALSE;
1681  }
1682 #line 1683 "sql.tab.c" /* yacc.c:1646 */
1683  break;
1684 
1685  case 27:
1686 #line 331 "sql.y" /* yacc.c:1646 */
1687  {
1688  (yyval.column_type) = (yyvsp[0].column_type);
1689  }
1690 #line 1691 "sql.tab.c" /* yacc.c:1646 */
1691  break;
1692 
1693  case 28:
1694 #line 335 "sql.y" /* yacc.c:1646 */
1695  {
1696  (yyval.column_type) = (yyvsp[-1].column_type) | MSITYPE_LOCALIZABLE;
1697  }
1698 #line 1699 "sql.tab.c" /* yacc.c:1646 */
1699  break;
1700 
1701  case 29:
1702 #line 339 "sql.y" /* yacc.c:1646 */
1703  {
1704  (yyval.column_type) = (yyvsp[-1].column_type) | MSITYPE_TEMPORARY;
1705  }
1706 #line 1707 "sql.tab.c" /* yacc.c:1646 */
1707  break;
1708 
1709  case 30:
1710 #line 346 "sql.y" /* yacc.c:1646 */
1711  {
1712  (yyval.column_type) |= MSITYPE_NULLABLE;
1713  }
1714 #line 1715 "sql.tab.c" /* yacc.c:1646 */
1715  break;
1716 
1717  case 31:
1718 #line 350 "sql.y" /* yacc.c:1646 */
1719  {
1720  (yyval.column_type) = (yyvsp[-2].column_type);
1721  }
1722 #line 1723 "sql.tab.c" /* yacc.c:1646 */
1723  break;
1724 
1725  case 32:
1726 #line 357 "sql.y" /* yacc.c:1646 */
1727  {
1728  (yyval.column_type) = MSITYPE_STRING | 0x400;
1729  }
1730 #line 1731 "sql.tab.c" /* yacc.c:1646 */
1731  break;
1732 
1733  case 33:
1734 #line 361 "sql.y" /* yacc.c:1646 */
1735  {
1736  (yyval.column_type) = MSITYPE_STRING | 0x400 | (yyvsp[-1].column_type);
1737  }
1738 #line 1739 "sql.tab.c" /* yacc.c:1646 */
1739  break;
1740 
1741  case 34:
1742 #line 365 "sql.y" /* yacc.c:1646 */
1743  {
1744  (yyval.column_type) = MSITYPE_STRING | 0x400;
1745  }
1746 #line 1747 "sql.tab.c" /* yacc.c:1646 */
1747  break;
1748 
1749  case 35:
1750 #line 369 "sql.y" /* yacc.c:1646 */
1751  {
1752  (yyval.column_type) = 2 | 0x400;
1753  }
1754 #line 1755 "sql.tab.c" /* yacc.c:1646 */
1755  break;
1756 
1757  case 36:
1758 #line 373 "sql.y" /* yacc.c:1646 */
1759  {
1760  (yyval.column_type) = 2 | 0x400;
1761  }
1762 #line 1763 "sql.tab.c" /* yacc.c:1646 */
1763  break;
1764 
1765  case 37:
1766 #line 377 "sql.y" /* yacc.c:1646 */
1767  {
1768  (yyval.column_type) = 4;
1769  }
1770 #line 1771 "sql.tab.c" /* yacc.c:1646 */
1771  break;
1772 
1773  case 38:
1774 #line 381 "sql.y" /* yacc.c:1646 */
1775  {
1777  }
1778 #line 1779 "sql.tab.c" /* yacc.c:1646 */
1779  break;
1780 
1781  case 39:
1782 #line 388 "sql.y" /* yacc.c:1646 */
1783  {
1784  if( ( (yyvsp[0].integer) > 255 ) || ( (yyvsp[0].integer) < 0 ) )
1785  YYABORT;
1786  (yyval.column_type) = (yyvsp[0].integer);
1787  }
1788 #line 1789 "sql.tab.c" /* yacc.c:1646 */
1789  break;
1790 
1791  case 40:
1792 #line 397 "sql.y" /* yacc.c:1646 */
1793  {
1794  (yyval.query) = (yyvsp[0].query);
1795  }
1796 #line 1797 "sql.tab.c" /* yacc.c:1646 */
1797  break;
1798 
1799  case 41:
1800 #line 401 "sql.y" /* yacc.c:1646 */
1801  {
1802  SQL_input* sql = (SQL_input*) info;
1803  MSIVIEW* distinct = NULL;
1804  UINT r;
1805 
1806  r = DISTINCT_CreateView( sql->db, &distinct, (yyvsp[0].query) );
1807  if (r != ERROR_SUCCESS)
1808  YYABORT;
1809 
1810  PARSER_BUBBLE_UP_VIEW( sql, (yyval.query), distinct );
1811  }
1812 #line 1813 "sql.tab.c" /* yacc.c:1646 */
1813  break;
1814 
1815  case 42:
1816 #line 416 "sql.y" /* yacc.c:1646 */
1817  {
1818  SQL_input* sql = (SQL_input*) info;
1819  MSIVIEW* select = NULL;
1820  UINT r;
1821 
1822  if( (yyvsp[-1].column_list) )
1823  {
1824  r = SELECT_CreateView( sql->db, &select, (yyvsp[0].query), (yyvsp[-1].column_list) );
1825  if (r != ERROR_SUCCESS)
1826  YYABORT;
1827 
1828  PARSER_BUBBLE_UP_VIEW( sql, (yyval.query), select );
1829  }
1830  else
1831  (yyval.query) = (yyvsp[0].query);
1832  }
1833 #line 1834 "sql.tab.c" /* yacc.c:1646 */
1834  break;
1835 
1836  case 44:
1837 #line 437 "sql.y" /* yacc.c:1646 */
1838  {
1839  (yyvsp[-2].column_list)->next = (yyvsp[0].column_list);
1840  }
1841 #line 1842 "sql.tab.c" /* yacc.c:1646 */
1842  break;
1843 
1844  case 45:
1845 #line 441 "sql.y" /* yacc.c:1646 */
1846  {
1847  (yyval.column_list) = NULL;
1848  }
1849 #line 1850 "sql.tab.c" /* yacc.c:1646 */
1850  break;
1851 
1852  case 47:
1853 #line 449 "sql.y" /* yacc.c:1646 */
1854  {
1855  (yyvsp[-2].column_list)->next = (yyvsp[0].column_list);
1856  }
1857 #line 1858 "sql.tab.c" /* yacc.c:1646 */
1858  break;
1859 
1860  case 48:
1861 #line 453 "sql.y" /* yacc.c:1646 */
1862  {
1863  (yyval.column_list) = NULL;
1864  }
1865 #line 1866 "sql.tab.c" /* yacc.c:1646 */
1866  break;
1867 
1868  case 49:
1869 #line 460 "sql.y" /* yacc.c:1646 */
1870  {
1871  SQL_input* sql = (SQL_input*) info;
1872  MSIVIEW* table = NULL;
1873  UINT r;
1874 
1875  r = TABLE_CreateView( sql->db, (yyvsp[0].string), &table );
1876  if( r != ERROR_SUCCESS || !(yyval.query) )
1877  YYABORT;
1878 
1879  PARSER_BUBBLE_UP_VIEW( sql, (yyval.query), table );
1880  }
1881 #line 1882 "sql.tab.c" /* yacc.c:1646 */
1882  break;
1883 
1884  case 50:
1885 #line 472 "sql.y" /* yacc.c:1646 */
1886  {
1887  UINT r;
1888 
1889  if( (yyvsp[0].column_list) )
1890  {
1891  r = (yyvsp[-3].query)->ops->sort( (yyvsp[-3].query), (yyvsp[0].column_list) );
1892  if ( r != ERROR_SUCCESS)
1893  YYABORT;
1894  }
1895 
1896  (yyval.query) = (yyvsp[-3].query);
1897  }
1898 #line 1899 "sql.tab.c" /* yacc.c:1646 */
1899  break;
1900 
1901  case 52:
1902 #line 489 "sql.y" /* yacc.c:1646 */
1903  {
1904  SQL_input* sql = (SQL_input*) info;
1905  MSIVIEW* where = NULL;
1906  UINT r;
1907 
1908  r = WHERE_CreateView( sql->db, &where, (yyvsp[0].string), NULL );
1909  if( r != ERROR_SUCCESS )
1910  YYABORT;
1911 
1912  PARSER_BUBBLE_UP_VIEW( sql, (yyval.query), where );
1913  }
1914 #line 1915 "sql.tab.c" /* yacc.c:1646 */
1915  break;
1916 
1917  case 53:
1918 #line 501 "sql.y" /* yacc.c:1646 */
1919  {
1920  SQL_input* sql = (SQL_input*) info;
1921  MSIVIEW* where = NULL;
1922  UINT r;
1923 
1924  r = WHERE_CreateView( sql->db, &where, (yyvsp[-2].string), (yyvsp[0].expr) );
1925  if( r != ERROR_SUCCESS )
1926  YYABORT;
1927 
1928  PARSER_BUBBLE_UP_VIEW( sql, (yyval.query), where );
1929  }
1930 #line 1931 "sql.tab.c" /* yacc.c:1646 */
1931  break;
1932 
1933  case 54:
1934 #line 516 "sql.y" /* yacc.c:1646 */
1935  {
1936  (yyval.string) = (yyvsp[0].string);
1937  }
1938 #line 1939 "sql.tab.c" /* yacc.c:1646 */
1939  break;
1940 
1941  case 55:
1942 #line 520 "sql.y" /* yacc.c:1646 */
1943  {
1944  (yyval.string) = parser_add_table( info, (yyvsp[0].string), (yyvsp[-2].string) );
1945  if (!(yyval.string))
1946  YYABORT;
1947  }
1948 #line 1949 "sql.tab.c" /* yacc.c:1646 */
1949  break;
1950 
1951  case 56:
1952 #line 529 "sql.y" /* yacc.c:1646 */
1953  {
1954  (yyval.expr) = (yyvsp[-1].expr);
1955  if( !(yyval.expr) )
1956  YYABORT;
1957  }
1958 #line 1959 "sql.tab.c" /* yacc.c:1646 */
1959  break;
1960 
1961  case 57:
1962 #line 535 "sql.y" /* yacc.c:1646 */
1963  {
1964  (yyval.expr) = EXPR_complex( info, (yyvsp[-2].expr), OP_AND, (yyvsp[0].expr) );
1965  if( !(yyval.expr) )
1966  YYABORT;
1967  }
1968 #line 1969 "sql.tab.c" /* yacc.c:1646 */
1969  break;
1970 
1971  case 58:
1972 #line 541 "sql.y" /* yacc.c:1646 */
1973  {
1974  (yyval.expr) = EXPR_complex( info, (yyvsp[-2].expr), OP_OR, (yyvsp[0].expr) );
1975  if( !(yyval.expr) )
1976  YYABORT;
1977  }
1978 #line 1979 "sql.tab.c" /* yacc.c:1646 */
1979  break;
1980 
1981  case 59:
1982 #line 547 "sql.y" /* yacc.c:1646 */
1983  {
1984  (yyval.expr) = EXPR_complex( info, (yyvsp[-2].expr), OP_EQ, (yyvsp[0].expr) );
1985  if( !(yyval.expr) )
1986  YYABORT;
1987  }
1988 #line 1989 "sql.tab.c" /* yacc.c:1646 */
1989  break;
1990 
1991  case 60:
1992 #line 553 "sql.y" /* yacc.c:1646 */
1993  {
1994  (yyval.expr) = EXPR_complex( info, (yyvsp[-2].expr), OP_GT, (yyvsp[0].expr) );
1995  if( !(yyval.expr) )
1996  YYABORT;
1997  }
1998 #line 1999 "sql.tab.c" /* yacc.c:1646 */
1999  break;
2000 
2001  case 61:
2002 #line 559 "sql.y" /* yacc.c:1646 */
2003  {
2004  (yyval.expr) = EXPR_complex( info, (yyvsp[-2].expr), OP_LT, (yyvsp[0].expr) );
2005  if( !(yyval.expr) )
2006  YYABORT;
2007  }
2008 #line 2009 "sql.tab.c" /* yacc.c:1646 */
2009  break;
2010 
2011  case 62:
2012 #line 565 "sql.y" /* yacc.c:1646 */
2013  {
2014  (yyval.expr) = EXPR_complex( info, (yyvsp[-2].expr), OP_LE, (yyvsp[0].expr) );
2015  if( !(yyval.expr) )
2016  YYABORT;
2017  }
2018 #line 2019 "sql.tab.c" /* yacc.c:1646 */
2019  break;
2020 
2021  case 63:
2022 #line 571 "sql.y" /* yacc.c:1646 */
2023  {
2024  (yyval.expr) = EXPR_complex( info, (yyvsp[-2].expr), OP_GE, (yyvsp[0].expr) );
2025  if( !(yyval.expr) )
2026  YYABORT;
2027  }
2028 #line 2029 "sql.tab.c" /* yacc.c:1646 */
2029  break;
2030 
2031  case 64:
2032 #line 577 "sql.y" /* yacc.c:1646 */
2033  {
2034  (yyval.expr) = EXPR_complex( info, (yyvsp[-2].expr), OP_NE, (yyvsp[0].expr) );
2035  if( !(yyval.expr) )
2036  YYABORT;
2037  }
2038 #line 2039 "sql.tab.c" /* yacc.c:1646 */
2039  break;
2040 
2041  case 65:
2042 #line 583 "sql.y" /* yacc.c:1646 */
2043  {
2044  (yyval.expr) = EXPR_unary( info, (yyvsp[-2].expr), OP_ISNULL );
2045  if( !(yyval.expr) )
2046  YYABORT;
2047  }
2048 #line 2049 "sql.tab.c" /* yacc.c:1646 */
2049  break;
2050 
2051  case 66:
2052 #line 589 "sql.y" /* yacc.c:1646 */
2053  {
2054  (yyval.expr) = EXPR_unary( info, (yyvsp[-3].expr), OP_NOTNULL );
2055  if( !(yyval.expr) )
2056  YYABORT;
2057  }
2058 #line 2059 "sql.tab.c" /* yacc.c:1646 */
2059  break;
2060 
2061  case 69:
2062 #line 603 "sql.y" /* yacc.c:1646 */
2063  {
2064  (yyval.column_list) = parser_alloc_column( info, NULL, NULL );
2065  if( !(yyval.column_list) )
2066  YYABORT;
2067  (yyval.column_list)->val = (yyvsp[0].expr);
2068  }
2069 #line 2070 "sql.tab.c" /* yacc.c:1646 */
2070  break;
2071 
2072  case 70:
2073 #line 610 "sql.y" /* yacc.c:1646 */
2074  {
2075  (yyval.column_list) = parser_alloc_column( info, NULL, NULL );
2076  if( !(yyval.column_list) )
2077  YYABORT;
2078  (yyval.column_list)->val = (yyvsp[-2].expr);
2079  (yyval.column_list)->next = (yyvsp[0].column_list);
2080  }
2081 #line 2082 "sql.tab.c" /* yacc.c:1646 */
2082  break;
2083 
2084  case 72:
2085 #line 622 "sql.y" /* yacc.c:1646 */
2086  {
2087  (yyval.column_list) = (yyvsp[-2].column_list);
2088  (yyval.column_list)->next = (yyvsp[0].column_list);
2089  }
2090 #line 2091 "sql.tab.c" /* yacc.c:1646 */
2091  break;
2092 
2093  case 73:
2094 #line 630 "sql.y" /* yacc.c:1646 */
2095  {
2096  (yyval.column_list) = (yyvsp[-2].column_list);
2097  (yyval.column_list)->val = (yyvsp[0].expr);
2098  }
2099 #line 2100 "sql.tab.c" /* yacc.c:1646 */
2100  break;
2101 
2102  case 74:
2103 #line 638 "sql.y" /* yacc.c:1646 */
2104  {
2105  (yyval.expr) = EXPR_ival( info, (yyvsp[0].integer) );
2106  if( !(yyval.expr) )
2107  YYABORT;
2108  }
2109 #line 2110 "sql.tab.c" /* yacc.c:1646 */
2110  break;
2111 
2112  case 75:
2113 #line 644 "sql.y" /* yacc.c:1646 */
2114  {
2115  (yyval.expr) = EXPR_ival( info, -(yyvsp[0].integer) );
2116  if( !(yyval.expr) )
2117  YYABORT;
2118  }
2119 #line 2120 "sql.tab.c" /* yacc.c:1646 */
2120  break;
2121 
2122  case 76:
2123 #line 650 "sql.y" /* yacc.c:1646 */
2124  {
2125  (yyval.expr) = EXPR_sval( info, &(yyvsp[0].str) );
2126  if( !(yyval.expr) )
2127  YYABORT;
2128  }
2129 #line 2130 "sql.tab.c" /* yacc.c:1646 */
2130  break;
2131 
2132  case 77:
2133 #line 656 "sql.y" /* yacc.c:1646 */
2134  {
2135  (yyval.expr) = EXPR_wildcard( info );
2136  if( !(yyval.expr) )
2137  YYABORT;
2138  }
2139 #line 2140 "sql.tab.c" /* yacc.c:1646 */
2140  break;
2141 
2142  case 78:
2143 #line 665 "sql.y" /* yacc.c:1646 */
2144  {
2145  (yyval.expr) = EXPR_column( info, (yyvsp[0].column_list) );
2146  if( !(yyval.expr) )
2147  YYABORT;
2148  }
2149 #line 2150 "sql.tab.c" /* yacc.c:1646 */
2150  break;
2151 
2152  case 79:
2153 #line 674 "sql.y" /* yacc.c:1646 */
2154  {
2155  (yyval.column_list) = parser_alloc_column( info, (yyvsp[-2].string), (yyvsp[0].string) );
2156  if( !(yyval.column_list) )
2157  YYABORT;
2158  }
2159 #line 2160 "sql.tab.c" /* yacc.c:1646 */
2160  break;
2161 
2162  case 80:
2163 #line 680 "sql.y" /* yacc.c:1646 */
2164  {
2165  (yyval.column_list) = parser_alloc_column( info, NULL, (yyvsp[0].string) );
2166  if( !(yyval.column_list) )
2167  YYABORT;
2168  }
2169 #line 2170 "sql.tab.c" /* yacc.c:1646 */
2170  break;
2171 
2172  case 81:
2173 #line 689 "sql.y" /* yacc.c:1646 */
2174  {
2175  (yyval.column_list) = parser_alloc_column( info, (yyvsp[-2].string), (yyvsp[0].string) );
2176  if( !(yyval.column_list) )
2177  YYABORT;
2178  }
2179 #line 2180 "sql.tab.c" /* yacc.c:1646 */
2180  break;
2181 
2182  case 82:
2183 #line 695 "sql.y" /* yacc.c:1646 */
2184  {
2185  (yyval.column_list) = parser_alloc_column( info, NULL, (yyvsp[0].string) );
2186  if( !(yyval.column_list) )
2187  YYABORT;
2188  }
2189 #line 2190 "sql.tab.c" /* yacc.c:1646 */
2190  break;
2191 
2192  case 83:
2193 #line 701 "sql.y" /* yacc.c:1646 */
2194  {
2195  (yyval.column_list) = parser_alloc_column( info, NULL, (yyvsp[0].string) );
2196  if( !(yyval.column_list) )
2197  YYABORT;
2198  }
2199 #line 2200 "sql.tab.c" /* yacc.c:1646 */
2200  break;
2201 
2202  case 84:
2203 #line 710 "sql.y" /* yacc.c:1646 */
2204  {
2205  (yyval.string) = (yyvsp[0].string);
2206  }
2207 #line 2208 "sql.tab.c" /* yacc.c:1646 */
2208  break;
2209 
2210  case 85:
2211 #line 717 "sql.y" /* yacc.c:1646 */
2212  {
2213  if ( SQL_getstring( info, &(yyvsp[0].str), &(yyval.string) ) != ERROR_SUCCESS || !(yyval.string) )
2214  YYABORT;
2215  }
2216 #line 2217 "sql.tab.c" /* yacc.c:1646 */
2217  break;
2218 
2219  case 86:
2220 #line 725 "sql.y" /* yacc.c:1646 */
2221  {
2222  if ( SQL_getstring( info, &(yyvsp[0].str), &(yyval.string) ) != ERROR_SUCCESS || !(yyval.string) )
2223  YYABORT;
2224  }
2225 #line 2226 "sql.tab.c" /* yacc.c:1646 */
2226  break;
2227 
2228  case 87:
2229 #line 733 "sql.y" /* yacc.c:1646 */
2230  {
2231  (yyval.integer) = SQL_getint( info );
2232  }
2233 #line 2234 "sql.tab.c" /* yacc.c:1646 */
2234  break;
2235 
2236 
2237 #line 2238 "sql.tab.c" /* yacc.c:1646 */
2238  default: break;
2239  }
2240  /* User semantic actions sometimes alter yychar, and that requires
2241  that yytoken be updated with the new translation. We take the
2242  approach of translating immediately before every use of yytoken.
2243  One alternative is translating here after every semantic action,
2244  but that translation would be missed if the semantic action invokes
2245  YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2246  if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2247  incorrect destructor might then be invoked immediately. In the
2248  case of YYERROR or YYBACKUP, subsequent parser actions might lead
2249  to an incorrect destructor call or verbose syntax error message
2250  before the lookahead is translated. */
2251  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2252 
2253  YYPOPSTACK (yylen);
2254  yylen = 0;
2255  YY_STACK_PRINT (yyss, yyssp);
2256 
2257  *++yyvsp = yyval;
2258 
2259  /* Now 'shift' the result of the reduction. Determine what state
2260  that goes to, based on the state we popped back to and the rule
2261  number reduced by. */
2262 
2263  yyn = yyr1[yyn];
2264 
2265  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2266  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2267  yystate = yytable[yystate];
2268  else
2269  yystate = yydefgoto[yyn - YYNTOKENS];
2270 
2271  goto yynewstate;
2272 
2273 
2274 /*--------------------------------------.
2275 | yyerrlab -- here on detecting error. |
2276 `--------------------------------------*/
2277 yyerrlab:
2278  /* Make sure we have latest lookahead translation. See comments at
2279  user semantic actions for why this is necessary. */
2280  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2281 
2282  /* If not already recovering from an error, report this error. */
2283  if (!yyerrstatus)
2284  {
2285  ++yynerrs;
2286 #if ! YYERROR_VERBOSE
2287  yyerror (info, YY_("syntax error"));
2288 #else
2289 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2290  yyssp, yytoken)
2291  {
2292  char const *yymsgp = YY_("syntax error");
2293  int yysyntax_error_status;
2294  yysyntax_error_status = YYSYNTAX_ERROR;
2295  if (yysyntax_error_status == 0)
2296  yymsgp = yymsg;
2297  else if (yysyntax_error_status == 1)
2298  {
2299  if (yymsg != yymsgbuf)
2300  YYSTACK_FREE (yymsg);
2301  yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2302  if (!yymsg)
2303  {
2304  yymsg = yymsgbuf;
2305  yymsg_alloc = sizeof yymsgbuf;
2306  yysyntax_error_status = 2;
2307  }
2308  else
2309  {
2310  yysyntax_error_status = YYSYNTAX_ERROR;
2311  yymsgp = yymsg;
2312  }
2313  }
2314  yyerror (info, yymsgp);
2315  if (yysyntax_error_status == 2)
2316  goto yyexhaustedlab;
2317  }
2318 # undef YYSYNTAX_ERROR
2319 #endif
2320  }
2321 
2322 
2323 
2324  if (yyerrstatus == 3)
2325  {
2326  /* If just tried and failed to reuse lookahead token after an
2327  error, discard it. */
2328 
2329  if (yychar <= YYEOF)
2330  {
2331  /* Return failure if at end of input. */
2332  if (yychar == YYEOF)
2333  YYABORT;
2334  }
2335  else
2336  {
2337  yydestruct ("Error: discarding",
2338  yytoken, &yylval, info);
2339  yychar = YYEMPTY;
2340  }
2341  }
2342 
2343  /* Else will try to reuse lookahead token after shifting the error
2344  token. */
2345  goto yyerrlab1;
2346 
2347 
2348 /*---------------------------------------------------.
2349 | yyerrorlab -- error raised explicitly by YYERROR. |
2350 `---------------------------------------------------*/
2351 yyerrorlab:
2352 
2353  /* Pacify compilers like GCC when the user code never invokes
2354  YYERROR and the label yyerrorlab therefore never appears in user
2355  code. */
2356  if (/*CONSTCOND*/ 0)
2357  goto yyerrorlab;
2358 
2359  /* Do not reclaim the symbols of the rule whose action triggered
2360  this YYERROR. */
2361  YYPOPSTACK (yylen);
2362  yylen = 0;
2363  YY_STACK_PRINT (yyss, yyssp);
2364  yystate = *yyssp;
2365  goto yyerrlab1;
2366 
2367 
2368 /*-------------------------------------------------------------.
2369 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2370 `-------------------------------------------------------------*/
2371 yyerrlab1:
2372  yyerrstatus = 3; /* Each real token shifted decrements this. */
2373 
2374  for (;;)
2375  {
2376  yyn = yypact[yystate];
2377  if (!yypact_value_is_default (yyn))
2378  {
2379  yyn += YYTERROR;
2380  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2381  {
2382  yyn = yytable[yyn];
2383  if (0 < yyn)
2384  break;
2385  }
2386  }
2387 
2388  /* Pop the current state because it cannot handle the error token. */
2389  if (yyssp == yyss)
2390  YYABORT;
2391 
2392 
2393  yydestruct ("Error: popping",
2394  yystos[yystate], yyvsp, info);
2395  YYPOPSTACK (1);
2396  yystate = *yyssp;
2397  YY_STACK_PRINT (yyss, yyssp);
2398  }
2399 
2401  *++yyvsp = yylval;
2403 
2404 
2405  /* Shift the error token. */
2406  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2407 
2408  yystate = yyn;
2409  goto yynewstate;
2410 
2411 
2412 /*-------------------------------------.
2413 | yyacceptlab -- YYACCEPT comes here. |
2414 `-------------------------------------*/
2415 yyacceptlab:
2416  yyresult = 0;
2417  goto yyreturn;
2418 
2419 /*-----------------------------------.
2420 | yyabortlab -- YYABORT comes here. |
2421 `-----------------------------------*/
2422 yyabortlab:
2423  yyresult = 1;
2424  goto yyreturn;
2425 
2426 #if !defined yyoverflow || YYERROR_VERBOSE
2427 /*-------------------------------------------------.
2428 | yyexhaustedlab -- memory exhaustion comes here. |
2429 `-------------------------------------------------*/
2430 yyexhaustedlab:
2431  yyerror (info, YY_("memory exhausted"));
2432  yyresult = 2;
2433  /* Fall through. */
2434 #endif
2435 
2436 yyreturn:
2437  if (yychar != YYEMPTY)
2438  {
2439  /* Make sure we have latest lookahead translation. See comments at
2440  user semantic actions for why this is necessary. */
2441  yytoken = YYTRANSLATE (yychar);
2442  yydestruct ("Cleanup: discarding lookahead",
2443  yytoken, &yylval, info);
2444  }
2445  /* Do not reclaim the symbols of the rule whose action triggered
2446  this YYABORT or YYACCEPT. */
2447  YYPOPSTACK (yylen);
2448  YY_STACK_PRINT (yyss, yyssp);
2449  while (yyssp != yyss)
2450  {
2451  yydestruct ("Cleanup: popping",
2452  yystos[*yyssp], yyvsp, info);
2453  YYPOPSTACK (1);
2454  }
2455 #ifndef yyoverflow
2456  if (yyss != yyssa)
2457  YYSTACK_FREE (yyss);
2458 #endif
2459 #if YYERROR_VERBOSE
2460  if (yymsg != yymsgbuf)
2461  YYSTACK_FREE (yymsg);
2462 #endif
2463  return yyresult;
2464 }
2465 #line 738 "sql.y" /* yacc.c:1906 */
2466 
2467 
2469 {
2470  static const WCHAR space[] = {' ',0};
2471  DWORD len = strlenW( list ) + strlenW( table ) + 2;
2472  LPWSTR ret;
2473 
2474  ret = parser_alloc( info, len * sizeof(WCHAR) );
2475  if( ret )
2476  {
2477  strcpyW( ret, list );
2478  strcatW( ret, space );
2479  strcatW( ret, table );
2480  }
2481  return ret;
2482 }
2483 
2484 static void *parser_alloc( void *info, unsigned int sz )
2485 {
2486  SQL_input* sql = (SQL_input*) info;
2487  struct list *mem;
2488 
2489  mem = msi_alloc( sizeof (struct list) + sz );
2490  list_add_tail( sql->mem, mem );
2491  return &mem[1];
2492 }
2493 
2495 {
2496  column_info *col;
2497 
2498  col = parser_alloc( info, sizeof (*col) );
2499  if( col )
2500  {
2501  col->table = table;
2502  col->column = column;
2503  col->val = NULL;
2504  col->type = 0;
2505  col->next = NULL;
2506  }
2507 
2508  return col;
2509 }
2510 
2511 static int sql_lex( void *SQL_lval, SQL_input *sql )
2512 {
2513  int token, skip;
2514  struct sql_str * str = SQL_lval;
2515 
2516  do
2517  {
2518  sql->n += sql->len;
2519  if( ! sql->command[sql->n] )
2520  return 0; /* end of input */
2521 
2522  /* TRACE("string : %s\n", debugstr_w(&sql->command[sql->n])); */
2523  sql->len = sqliteGetToken( &sql->command[sql->n], &token, &skip );
2524  if( sql->len==0 )
2525  break;
2526  str->data = &sql->command[sql->n];
2527  str->len = sql->len;
2528  sql->n += skip;
2529  }
2530  while( token == TK_SPACE );
2531 
2532  /* TRACE("token : %d (%s)\n", token, debugstr_wn(&sql->command[sql->n], sql->len)); */
2533 
2534  return token;
2535 }
2536 
2537 UINT SQL_getstring( void *info, const struct sql_str *strdata, LPWSTR *str )
2538 {
2539  LPCWSTR p = strdata->data;
2540  UINT len = strdata->len;
2541 
2542  /* match quotes */
2543  if( ( (p[0]=='`') && (p[len-1]!='`') ) ||
2544  ( (p[0]=='\'') && (p[len-1]!='\'') ) )
2545  return ERROR_FUNCTION_FAILED;
2546 
2547  /* if there are quotes, remove them */
2548  if( ( (p[0]=='`') && (p[len-1]=='`') ) ||
2549  ( (p[0]=='\'') && (p[len-1]=='\'') ) )
2550  {
2551  p++;
2552  len -= 2;
2553  }
2554  *str = parser_alloc( info, (len + 1)*sizeof(WCHAR) );
2555  if( !*str )
2556  return ERROR_OUTOFMEMORY;
2557  memcpy( *str, p, len*sizeof(WCHAR) );
2558  (*str)[len]=0;
2559 
2560  return ERROR_SUCCESS;
2561 }
2562 
2564 {
2565  SQL_input* sql = (SQL_input*) info;
2566  LPCWSTR p = &sql->command[sql->n];
2567  INT i, r = 0;
2568 
2569  for( i=0; i<sql->len; i++ )
2570  {
2571  if( '0' > p[i] || '9' < p[i] )
2572  {
2573  ERR("should only be numbers here!\n");
2574  break;
2575  }
2576  r = (p[i]-'0') + r*10;
2577  }
2578 
2579  return r;
2580 }
2581 
2582 static int sql_error( SQL_input *info, const char *str )
2583 {
2584  return 0;
2585 }
2586 
2587 static struct expr * EXPR_wildcard( void *info )
2588 {
2589  struct expr *e = parser_alloc( info, sizeof *e );
2590  if( e )
2591  {
2592  e->type = EXPR_WILDCARD;
2593  }
2594  return e;
2595 }
2596 
2597 static struct expr * EXPR_complex( void *info, struct expr *l, UINT op, struct expr *r )
2598 {
2599  struct expr *e = parser_alloc( info, sizeof *e );
2600  if( e )
2601  {
2602  e->type = EXPR_COMPLEX;
2603  e->u.expr.left = l;
2604  e->u.expr.op = op;
2605  e->u.expr.right = r;
2606  }
2607  return e;
2608 }
2609 
2610 static struct expr * EXPR_unary( void *info, struct expr *l, UINT op )
2611 {
2612  struct expr *e = parser_alloc( info, sizeof *e );
2613  if( e )
2614  {
2615  e->type = EXPR_UNARY;
2616  e->u.expr.left = l;
2617  e->u.expr.op = op;
2618  e->u.expr.right = NULL;
2619  }
2620  return e;
2621 }
2622 
2623 static struct expr * EXPR_column( void *info, const column_info *column )
2624 {
2625  struct expr *e = parser_alloc( info, sizeof *e );
2626  if( e )
2627  {
2628  e->type = EXPR_COLUMN;
2629  e->u.column.unparsed.column = column->column;
2630  e->u.column.unparsed.table = column->table;
2631  }
2632  return e;
2633 }
2634 
2635 static struct expr * EXPR_ival( void *info, int val )
2636 {
2637  struct expr *e = parser_alloc( info, sizeof *e );
2638  if( e )
2639  {
2640  e->type = EXPR_IVAL;
2641  e->u.ival = val;
2642  }
2643  return e;
2644 }
2645 
2646 static struct expr * EXPR_sval( void *info, const struct sql_str *str )
2647 {
2648  struct expr *e = parser_alloc( info, sizeof *e );
2649  if( e )
2650  {
2651  e->type = EXPR_SVAL;
2652  if( SQL_getstring( info, str, (LPWSTR *)&e->u.sval ) != ERROR_SUCCESS )
2653  return NULL; /* e will be freed by query destructor */
2654  }
2655  return e;
2656 }
2657 
2658 static void swap_columns( column_info **cols, column_info *A, int idx )
2659 {
2660  column_info *preA = NULL, *preB = NULL, *B, *ptr;
2661  int i = 0;
2662 
2663  B = NULL;
2664  ptr = *cols;
2665  while( ptr )
2666  {
2667  if( i++ == idx )
2668  B = ptr;
2669  else if( !B )
2670  preB = ptr;
2671 
2672  if( ptr->next == A )
2673  preA = ptr;
2674 
2675  ptr = ptr->next;
2676  }
2677 
2678  if( preB ) preB->next = A;
2679  if( preA ) preA->next = B;
2680  ptr = A->next;
2681  A->next = B->next;
2682  B->next = ptr;
2683  if( idx == 0 )
2684  *cols = A;
2685 }
2686 
2688  column_info *keys )
2689 {
2690  column_info *k;
2691  BOOL found = TRUE;
2692  int count;
2693 
2694  for( k = keys, count = 0; k && found; k = k->next, count++ )
2695  {
2696  column_info *c;
2697  int idx;
2698 
2699  found = FALSE;
2700  for( c = *cols, idx = 0; c && !found; c = c->next, idx++ )
2701  {
2702  if( strcmpW( k->column, c->column ) )
2703  continue;
2704  c->type |= MSITYPE_KEY;
2705  found = TRUE;
2706  if (idx != count)
2707  swap_columns( cols, c, count );
2708  }
2709  }
2710 
2711  return found;
2712 }
2713 
2715  struct list *mem )
2716 {
2717  SQL_input sql;
2718  int r;
2719 
2720  *phview = NULL;
2721 
2722  sql.db = db;
2723  sql.command = command;
2724  sql.n = 0;
2725  sql.len = 0;
2726  sql.r = ERROR_BAD_QUERY_SYNTAX;
2727  sql.view = phview;
2728  sql.mem = mem;
2729 
2730  r = sql_parse(&sql);
2731 
2732  TRACE("Parse returned %d\n", r);
2733  if( r )
2734  {
2735  if (*sql.view)
2736  {
2737  (*sql.view)->ops->delete(*sql.view);
2738  *sql.view = NULL;
2739  }
2740  return sql.r;
2741  }
2742 
2743  return ERROR_SUCCESS;
2744 }
#define EXPR_COLUMN
Definition: query.h:48
unsigned short int yytype_uint16
Definition: sql.tab.c:282
static int yysyntax_error(YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken)
Definition: hlsl.tab.c:2255
void * malloc(YYSIZE_T)
static const yytype_int16 yycheck[]
Definition: sql.tab.c:694
static void swap_columns(column_info **cols, column_info *A, int idx)
Definition: sql.tab.c:2658
static BOOL SQL_MarkPrimaryKeys(column_info **cols, column_info *keys)
Definition: sql.tab.c:2687
#define TRUE
Definition: types.h:120
#define YYINITDEPTH
Definition: sql.tab.c:933
#define YYSTACK_ALLOC
Definition: sql.tab.c:392
Definition: sql.tab.c:181
#define OP_EQ
Definition: query.h:36
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
#define yyerror
Definition: sql.tab.c:65
#define OP_GE
Definition: query.h:42
#define ERROR_SUCCESS
Definition: deptool.c:10
UINT INSERT_CreateView(MSIDATABASE *db, MSIVIEW **view, LPCWSTR table, column_info *columns, column_info *values, BOOL temp)
Definition: insert.c:361
MSIVIEW * query
Definition: sql.tab.c:242
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
UINT TABLE_CreateView(MSIDATABASE *db, LPCWSTR name, MSIVIEW **view) DECLSPEC_HIDDEN
Definition: table.c:2162
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
Definition: sql.tab.c:346
static const yytype_uint8 yyr1[]
Definition: sql.tab.c:737
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
Definition: sql.tab.c:925
static const yytype_int16 yytable[]
Definition: sql.tab.c:674
static YYSIZE_T yystrlen(const char *yystr)
Definition: hlsl.tab.c:2165
#define YYPOPSTACK(N)
YYLTYPE yylloc
Definition: hlsl.tab.c:2413
#define YY_REDUCE_PRINT(Rule)
Definition: sql.tab.c:927
DWORD len
Definition: query.h:103
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define yychar
Definition: asmshader.tab.c:74
#define YYEOF
Definition: sql.tab.c:768
static column_info * parser_alloc_column(void *info, LPCWSTR table, LPCWSTR column)
Definition: sql.tab.c:2494
GLuint GLuint GLsizei count
Definition: gl.h:1545
LPWSTR string
Definition: sql.tab.c:240
#define YYCASE_(N, S)
UINT r
Definition: query.h:104
int sql_parse(SQL_input *info)
static const char *const yytname[]
Definition: hlsl.tab.c:1465
#define yynerrs
Definition: sql.tab.c:67
WINE_DEFAULT_DEBUG_CHANNEL(msi)
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
#define yylex
Definition: sql.tab.c:64
static UINT SQL_getstring(void *info, const struct sql_str *strdata, LPWSTR *str)
Definition: sql.tab.c:2537
Definition: sql.tab.c:197
struct _column_info * next
Definition: msipriv.h:216
Definition: query.h:59
#define YY_(Msgid)
Definition: sql.tab.c:314
static int insert
Definition: xmllint.c:144
static struct expr * EXPR_complex(void *info, struct expr *l, UINT op, struct expr *r)
Definition: sql.tab.c:2597
DWORD n
Definition: query.h:103
#define YYSTACK_BYTES(N)
Definition: sql.tab.c:437
static void yydestruct(const char *yymsg, int yytype, YYSTYPE *yyvaluep, SQL_input *info)
Definition: sql.tab.c:1175
short yytype_int16
#define MSITYPE_STRING
Definition: msipriv.h:47
UINT MSI_ParseSQL(MSIDATABASE *db, LPCWSTR command, MSIVIEW **phview, struct list *mem)
Definition: sql.tab.c:2714
int32_t INT
Definition: typedefs.h:56
static int sql_lex(void *SQL_lval, SQL_input *info)
Definition: sql.tab.c:2511
static void * parser_alloc(void *info, unsigned int sz)
Definition: sql.tab.c:2484
Definition: query.h:86
int integer
Definition: sql.tab.c:245
#define OP_AND
Definition: query.h:37
Definition: sql.tab.c:193
#define yylval
Definition: asmshader.tab.c:73
#define YYDPRINTF(Args)
Definition: sql.tab.c:924
#define yyparse
Definition: sql.tab.c:63
static struct expr * EXPR_unary(void *info, struct expr *l, UINT op)
Definition: sql.tab.c:2610
static YYSIZE_T yytnamerr(char *yyres, const char *yystr)
Definition: hlsl.tab.c:2204
#define YYSTACK_ALLOC_MAXIMUM
Definition: sql.tab.c:395
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
LPCWSTR command
Definition: query.h:102
#define A(row, col)
MSIVIEW ** view
Definition: query.h:105
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define YYACCEPT
Definition: sql.tab.c:770
static struct expr * EXPR_sval(void *info, const struct sql_str *str)
Definition: sql.tab.c:2646
#define YY_INITIAL_VALUE(Value)
Definition: sql.tab.c:342
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
jsstr_t * str
Definition: parser.tab.c:295
static const yytype_int8 yypgoto[]
Definition: sql.tab.c:654
unsigned int BOOL
Definition: ntddk_ex.h:94
INT WSAAPI select(IN INT s, IN OUT LPFD_SET readfds, IN OUT LPFD_SET writefds, IN OUT LPFD_SET exceptfds, IN CONST struct timeval *timeout)
Definition: select.c:41
#define e
Definition: ke_i.h:82
static struct expr * EXPR_wildcard(void *info)
Definition: sql.tab.c:2587
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat token
Definition: glfuncs.h:210
#define YYEMPTY
Definition: sql.tab.c:767
static PVOID ptr
Definition: dispmode.c:27
unsigned int idx
Definition: utils.c:41
UINT SELECT_CreateView(MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table, const column_info *columns) DECLSPEC_HIDDEN
Definition: select.c:424
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Definition: sql.tab.c:345
static const yytype_uint8 yystos[]
Definition: sql.tab.c:716
const WCHAR * str
#define yytable_value_is_error(Yytable_value)
Definition: sql.tab.c:605
smooth NULL
Definition: ftsmooth.c:416
LPCWSTR column
Definition: msipriv.h:212
Definition: sql.tab.c:170
#define MSITYPE_NULLABLE
Definition: msipriv.h:48
Definition: sql.tab.c:207
Definition: sql.tab.c:182
#define OP_NE
Definition: query.h:43
Definition: sql.tab.c:185
signed char yytype_int8
Definition: sql.tab.c:276
INT len
Definition: query.h:61
GLuint GLfloat * val
Definition: glext.h:7180
r l[0]
Definition: byte_order.h:167
static const yytype_uint8 yydefact[]
Definition: sql.tab.c:633
yytype_int16 yyss_alloc
static const yytype_uint8 yyr2[]
Definition: sql.tab.c:751
#define PARSER_BUBBLE_UP_VIEW(sql, result, current_view)
Definition: sql.tab.c:128
yytokentype
#define TRACE(s)
Definition: solgame.cpp:4
#define MSITYPE_LOCALIZABLE
Definition: msipriv.h:46
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned short yytype_uint16
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
Definition: sql.tab.c:448
#define YYMAXDEPTH
Definition: sql.tab.c:944
YYSTYPE yyvs_alloc
Definition: sql.tab.c:204
#define YYSYNTAX_ERROR
column_info * column_list
Definition: sql.tab.c:241
const GLubyte * c
Definition: glext.h:8905
#define YYUSE(E)
Definition: sql.tab.c:328
unsigned long DWORD
Definition: ntddk_ex.h:95
Definition: sql.tab.c:196
#define MSITYPE_KEY
Definition: msipriv.h:49
#define OP_LE
Definition: query.h:41
#define EXPR_WILDCARD
Definition: query.h:54
int ret
static int sql_error(SQL_input *info, const char *str)
Definition: sql.tab.c:2582
Definition: ttei1.cpp:12
short int yytype_int16
Definition: sql.tab.c:288
UINT ALTER_CreateView(MSIDATABASE *db, MSIVIEW **view, LPCWSTR name, column_info *colinfo, int hold)
Definition: alter.c:255
static const yytype_int16 yypact[]
Definition: sql.tab.c:610
void free(void *)
Definition: cabinet.c:147
UINT CREATE_CreateView(MSIDATABASE *db, MSIVIEW **view, LPCWSTR table, column_info *col_info, BOOL hold)
Definition: create.c:161
Definition: sql.tab.c:200
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
#define yydebug
Definition: sql.tab.c:66
Definition: _list.h:228
UINT DISTINCT_CreateView(MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table)
Definition: distinct.c:294
struct expr * expr
Definition: sql.tab.c:243
static char * yystpcpy(char *yydest, const char *yysrc)
Definition: hlsl.tab.c:2182
#define ERR(fmt,...)
Definition: debug.h:109
#define YYSIZE_T
Definition: sql.tab.c:298
#define YYSTACK_FREE
Definition: sql.tab.c:393
Definition: sql.tab.c:222
struct list * mem
Definition: query.h:109
unsigned char yytype_uint8
Definition: sql.tab.c:270
UINT UPDATE_CreateView(MSIDATABASE *db, MSIVIEW **view, LPWSTR table, column_info *list, struct expr *expr) DECLSPEC_HIDDEN
Definition: update.c:228
static struct expr * EXPR_ival(void *info, int val)
Definition: sql.tab.c:2635
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
static unsigned __int64 next
Definition: rand_nt.c:6
MSIDATABASE * db
Definition: query.h:101
struct expr * val
Definition: msipriv.h:215
#define MSITYPE_TEMPORARY
Definition: msipriv.h:50
unsigned short USHORT
Definition: pedump.c:61
UINT WHERE_CreateView(MSIDATABASE *db, MSIVIEW **view, LPWSTR tables, struct expr *cond) DECLSPEC_HIDDEN
Definition: where.c:1209
int sqliteGetToken(const WCHAR *z, int *tokenType, int *skip) DECLSPEC_HIDDEN
Definition: tokenize.c:209
struct define * next
Definition: compiler.c:65
signed char yytype_int8
#define YYTRANSLATE(YYX)
Definition: sql.tab.c:500
UINT DELETE_CreateView(MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table)
Definition: delete.c:199
static LPWSTR parser_add_table(void *info, LPCWSTR list, LPCWSTR table)
Definition: sql.tab.c:2468
WINE_UNICODE_INLINE WCHAR * strcatW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:242
#define B(row, col)
unsigned int UINT
Definition: ndis.h:50
#define MSITYPE_VALID
Definition: msipriv.h:45
Definition: sql.tab.c:178
expression_t * expr
Definition: parser.tab.c:302
#define OP_OR
Definition: query.h:38
#define YYTERROR
Definition: sql.tab.c:795
#define skip(...)
Definition: atltest.h:64
int command(const char *fmt,...)
Definition: ftp.c:266
Definition: mem.c:156
#define yypact_value_is_default(Yystate)
Definition: sql.tab.c:600
LPCWSTR table
Definition: msipriv.h:211
#define YYABORT
Definition: sql.tab.c:771
WINE_UNICODE_INLINE int strcmpW(const WCHAR *str1, const WCHAR *str2)
Definition: unicode.h:229
USHORT column_type
Definition: sql.tab.c:244
#define c
Definition: ke_i.h:80
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204
FILE * stderr
UINT DROP_CreateView(MSIDATABASE *db, MSIVIEW **view, LPCWSTR name)
Definition: drop.c:118
UINT op
Definition: effect.c:223
#define YYLAST
Definition: sql.tab.c:484
GLenum GLenum GLvoid GLvoid * column
Definition: glext.h:5664
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static const yytype_int16 yydefgoto[]
Definition: sql.tab.c:663
static const struct access_res create[16]
Definition: package.c:7720
#define YY_NULL
Definition: sql.tab.c:139
int k
Definition: mpi.c:3369
#define YYFINAL
Definition: sql.tab.c:482
#define ERROR_BAD_QUERY_SYNTAX
Definition: winerror.h:973
#define YYNTOKENS
Definition: sql.tab.c:487
Definition: sql.tab.c:191
unsigned char yytype_uint8
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
#define YY_STACK_PRINT(Bottom, Top)
Definition: sql.tab.c:926
LPCWSTR data
Definition: query.h:60
static const yytype_uint8 yytranslate[]
Definition: sql.tab.c:505
static struct expr * EXPR_column(void *info, const column_info *column)
Definition: sql.tab.c:2623
static INT SQL_getint(void *info)
Definition: sql.tab.c:2563