pgpool-II-3.4.3/0002775000076400007640000000000012554350620010337 500000000000000pgpool-II-3.4.3/INSTALL0000664000076400007640000003660012554350605011316 00000000000000Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. Some packages provide this `INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the `make install' phase executed with root privileges. 5. Optionally, type `make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior `make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type `make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide `make distcheck', which can by used by developers to test that all other targets like `make install' and `make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. This is known as a "VPATH" build. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple `-arch' options to the compiler but only a single `-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the `lipo' tool if you have problems. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of `${prefix}', so that specifying just `--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to `configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the `make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, `make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of `${prefix}'. Any directories that were specified during `configure', but not in terms of `${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the `DESTDIR' variable. For example, `make install DESTDIR=/alternate/directory' will prepend `/alternate/directory' before all installation names. The approach of `DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of `${prefix}' at `configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of `make' will be. For these packages, running `./configure --enable-silent-rules' sets the default to minimal output, which can be overridden with `make V=1'; while running `./configure --disable-silent-rules' sets the default to verbose, which can be overridden with `make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX `make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as `configure' are involved. Use GNU `make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put `/usr/ucb' early in your `PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in `/usr/bin'. So, if you need `/usr/ucb' in your `PATH', put it _after_ `/usr/bin'. On Haiku, software installed for all users goes in `/boot/common', not `/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf bug. Until the bug is fixed you can use this workaround: CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. pgpool-II-3.4.3/configure0000775000076400007640000170456012554350605012204 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for pgpool-II 3.4.3. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: pgpool-hackers@pgpoo.net about your system, including $0: any error possibly output before this message. Then $0: install a modern shell, or manually run the script $0: under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='pgpool-II' PACKAGE_TARNAME='pgpool-II' PACKAGE_VERSION='3.4.3' PACKAGE_STRING='pgpool-II 3.4.3' PACKAGE_BUGREPORT='pgpool-hackers@pgpoo.net' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS enable_rpath_FALSE enable_rpath_TRUE MEMCACHED_DIR PGSQL_LIB_DIR PGSQL_INCLUDE_DIR MEMCACHED_RPATH_OPT MEMCACHED_LINK_OPT MEMCACHED_INCLUDE_OPT PGCONFIG LIBOBJS YFLAGS YACC LEXLIB LEX_OUTPUT_ROOT LEX CPP OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_dependency_tracking enable_silent_rules enable_maintainer_mode enable_shared enable_static with_pic enable_fast_install with_gnu_ld with_sysroot enable_libtool_lock enable_float4_byval enable_float8_byval with_pgsql with_pgsql_includedir with_pgsql_libdir with_openssl with_pam with_memcached enable_rpath enable_sequence_lock enable_table_lock enable_cassert ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP YACC YFLAGS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures pgpool-II 3.4.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/pgpool-II] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of pgpool-II 3.4.3:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-float4-byval disable float4 passed by value --disable-float8-byval disable float8 passed by value --disable-rpath do not embed shared library search path in executables --enable-sequence-lock insert_lock compatible with pgpool-II 3.0 series (until 3.0.4) --enable-table-lock insert_lock compatible with pgpool-II 2.2 and 2.3 series --enable-cassert build with assertion checks Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-pgsql=DIR site header files for PostgreSQL in DIR --with-pgsql-includedir=DIR site header files for PostgreSQL in DIR --with-pgsql-libdir=DIR site library files for PostgreSQL in DIR --with-openssl build with OpenSSL support --with-pam build with PAM support --with-memcached=DIR site header files for libmemcached in DIR Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor YACC The `Yet Another Compiler Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a default value of `-d' given by some make applications. Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF pgpool-II configure 3.4.3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## --------------------------------------- ## ## Report this to pgpool-hackers@pgpoo.net ## ## --------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes # INCLUDES, setting VAR accordingly. Returns whether the value could be # computed ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid; break else as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=$ac_mid; break else as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid else as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval () { return $2; } static unsigned long int ulongval () { return $2; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : echo >>conftest.val; read $3 &5 $as_echo_n "checking for $2.$3... " >&6; } if eval \${$4+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (sizeof ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else eval "$4=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$4 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by pgpool-II $as_me 3.4.3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version='1.14' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='pgpool-II' VERSION='3.4.3' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE # AC_PROG_RANLIB case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.2' macro_revision='1.3337' ltmain="$ac_aux_dir/ltmain.sh" # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 $as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ac_config_commands="$ac_config_commands libtool" # Only expand once: for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LEX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LEX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 $as_echo "$LEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test "x$LEX" != "x:"; then cat >conftest.l <<_ACEOF %% a { ECHO; } b { REJECT; } c { yymore (); } d { yyless (1); } e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */ yyless ((input () != 0)); } f { unput (yytext[0]); } . { BEGIN INITIAL; } %% #ifdef YYTEXT_POINTER extern char *yytext; #endif int main (void) { return ! yylex () + ! yywrap (); } _ACEOF { { ac_try="$LEX conftest.l" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$LEX conftest.l") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5 $as_echo_n "checking lex output file root... " >&6; } if ${ac_cv_prog_lex_root+:} false; then : $as_echo_n "(cached) " >&6 else if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else as_fn_error $? "cannot find output from $LEX; giving up" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 $as_echo "$ac_cv_prog_lex_root" >&6; } LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root if test -z "${LEXLIB+set}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5 $as_echo_n "checking lex library... " >&6; } if ${ac_cv_lib_lex+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_LIBS=$LIBS ac_cv_lib_lex='none needed' for ac_lib in '' -lfl -ll; do LIBS="$ac_lib $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lex=$ac_lib fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext test "$ac_cv_lib_lex" != 'none needed' && break done LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 $as_echo "$ac_cv_lib_lex" >&6; } test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 $as_echo_n "checking whether yytext is a pointer... " >&6; } if ${ac_cv_prog_lex_yytext_pointer+:} false; then : $as_echo_n "(cached) " >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no ac_save_LIBS=$LIBS LIBS="$LEXLIB $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define YYTEXT_POINTER 1 `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_prog_lex_yytext_pointer=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 $as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then $as_echo "#define YYTEXT_POINTER 1" >>confdefs.h fi rm -f conftest.l $LEX_OUTPUT_ROOT.c fi if test "$LEX" = :; then LEX=${am_missing_run}flex fi for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_YACC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 $as_echo "$YACC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" OLD_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -Wall" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wall option" >&5 $as_echo_n "checking for -Wall option... " >&6; } if ${ac_cv_wall+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { char a; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_wall=yes else ac_cv_wall=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi echo $ac_cv_wall if test $ac_cv_wall = no; then CFLAGS=$OLD_CFLAGS fi OLD_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -Wmissing-prototypes" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wmissing-prototypes option" >&5 $as_echo_n "checking for -Wmissing-prototypes option... " >&6; } if ${ac_cv_wmissing_prototypes+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { char a; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_wmissing_prototypes=yes else ac_cv_wmissing_prototypes=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi echo $ac_cv_wmissing_prototypes if test $ac_cv_wmissing_prototypes = no; then CFLAGS=$OLD_CFLAGS fi OLD_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -Wmissing-declarations" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wmissing-declarations option" >&5 $as_echo_n "checking for -Wmissing-declarations option... " >&6; } if ${ac_cv_wmissing_declarations+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { char a; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_wmissing_declarations=yes else ac_cv_wmissing_declarations=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi echo $ac_cv_wmissing_declarations if test $ac_cv_wmissing_declarations = no; then CFLAGS=$OLD_CFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lm" >&5 $as_echo_n "checking for main in -lm... " >&6; } if ${ac_cv_lib_m_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_main=yes else ac_cv_lib_m_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_main" >&5 $as_echo "$ac_cv_lib_m_main" >&6; } if test "x$ac_cv_lib_m_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lnsl" >&5 $as_echo_n "checking for main in -lnsl... " >&6; } if ${ac_cv_lib_nsl_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_main=yes else ac_cv_lib_nsl_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_main" >&5 $as_echo "$ac_cv_lib_nsl_main" >&6; } if test "x$ac_cv_lib_nsl_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL 1 _ACEOF LIBS="-lnsl $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lsocket" >&5 $as_echo_n "checking for main in -lsocket... " >&6; } if ${ac_cv_lib_socket_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_main=yes else ac_cv_lib_socket_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_main" >&5 $as_echo "$ac_cv_lib_socket_main" >&6; } if test "x$ac_cv_lib_socket_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF LIBS="-lsocket $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lipc" >&5 $as_echo_n "checking for main in -lipc... " >&6; } if ${ac_cv_lib_ipc_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ipc_main=yes else ac_cv_lib_ipc_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_main" >&5 $as_echo "$ac_cv_lib_ipc_main" >&6; } if test "x$ac_cv_lib_ipc_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBIPC 1 _ACEOF LIBS="-lipc $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lIPC" >&5 $as_echo_n "checking for main in -lIPC... " >&6; } if ${ac_cv_lib_IPC_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lIPC $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_IPC_main=yes else ac_cv_lib_IPC_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_IPC_main" >&5 $as_echo "$ac_cv_lib_IPC_main" >&6; } if test "x$ac_cv_lib_IPC_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBIPC 1 _ACEOF LIBS="-lIPC $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -llc" >&5 $as_echo_n "checking for main in -llc... " >&6; } if ${ac_cv_lib_lc_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lc_main=yes else ac_cv_lib_lc_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lc_main" >&5 $as_echo "$ac_cv_lib_lc_main" >&6; } if test "x$ac_cv_lib_lc_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBLC 1 _ACEOF LIBS="-llc $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lBSD" >&5 $as_echo_n "checking for main in -lBSD... " >&6; } if ${ac_cv_lib_BSD_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lBSD $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_BSD_main=yes else ac_cv_lib_BSD_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_BSD_main" >&5 $as_echo "$ac_cv_lib_BSD_main" >&6; } if test "x$ac_cv_lib_BSD_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBBSD 1 _ACEOF LIBS="-lBSD $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lgen" >&5 $as_echo_n "checking for main in -lgen... " >&6; } if ${ac_cv_lib_gen_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgen $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_gen_main=yes else ac_cv_lib_gen_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gen_main" >&5 $as_echo "$ac_cv_lib_gen_main" >&6; } if test "x$ac_cv_lib_gen_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBGEN 1 _ACEOF LIBS="-lgen $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lPW" >&5 $as_echo_n "checking for main in -lPW... " >&6; } if ${ac_cv_lib_PW_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lPW $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_PW_main=yes else ac_cv_lib_PW_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_PW_main" >&5 $as_echo "$ac_cv_lib_PW_main" >&6; } if test "x$ac_cv_lib_PW_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPW 1 _ACEOF LIBS="-lPW $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lresolv" >&5 $as_echo_n "checking for main in -lresolv... " >&6; } if ${ac_cv_lib_resolv_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lresolv $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_resolv_main=yes else ac_cv_lib_resolv_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_main" >&5 $as_echo "$ac_cv_lib_resolv_main" >&6; } if test "x$ac_cv_lib_resolv_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBRESOLV 1 _ACEOF LIBS="-lresolv $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lcrypt" >&5 $as_echo_n "checking for main in -lcrypt... " >&6; } if ${ac_cv_lib_crypt_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypt_main=yes else ac_cv_lib_crypt_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypt_main" >&5 $as_echo "$ac_cv_lib_crypt_main" >&6; } if test "x$ac_cv_lib_crypt_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCRYPT 1 _ACEOF LIBS="-lcrypt $LIBS" fi for ac_func in strlcat, strlcpy do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 $as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } if ${ac_cv_header_sys_wait_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main () { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_sys_wait_h=yes else ac_cv_header_sys_wait_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 $as_echo "$ac_cv_header_sys_wait_h" >&6; } if test $ac_cv_header_sys_wait_h = yes; then $as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h fi for ac_header in fcntl.h unistd.h getopt.h netinet/tcp.h netinet/in.h netdb.h sys/param.h sys/types.h sys/socket.h sys/un.h sys/time.h sys/sem.h sys/shm.h sys/select.h crypt.h sys/pstat.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" if test "x$ac_cv_type_pid_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi # Macros to detect C compiler features # $PostgreSQL: pgsql/config/c-compiler.m4,v 1.19 2008/06/27 00:36:16 tgl Exp $ # PGAC_C_SIGNED # ------------- # Check if the C compiler understands signed types. # PGAC_C_SIGNED # PGAC_TYPE_64BIT_INT(TYPE) # ------------------------- # Check if TYPE is a working 64 bit integer type. Set HAVE_TYPE_64 to # yes or no respectively, and define HAVE_TYPE_64 if yes. # PGAC_TYPE_64BIT_INT # PGAC_C_FUNCNAME_SUPPORT # ----------------------- # Check if the C compiler understands __func__ (C99) or __FUNCTION__ (gcc). # Define HAVE_FUNCNAME__FUNC or HAVE_FUNCNAME__FUNCTION accordingly. # PGAC_C_FUNCNAME_SUPPORT # PGAC_PROG_CC_CFLAGS_OPT # ----------------------- # Given a string, check if the compiler supports the string as a # command-line option. If it does, add the string to CFLAGS. # PGAC_PROG_CC_CFLAGS_OPT # PGAC_PROG_CC_LDFLAGS_OPT # ------------------------ # Given a string, check if the compiler supports the string as a # command-line option. If it does, add the string to LDFLAGS. # For reasons you'd really rather not know about, this checks whether # you can link to a particular function, not just whether you can link. # In fact, we must actually check that the resulting program runs :-( # PGAC_PROG_CC_LDFLAGS_OPT # Macros that test various C library quirks # $PostgreSQL: pgsql/config/c-library.m4,v 1.33 2008/08/21 13:53:28 petere Exp $ # PGAC_VAR_INT_TIMEZONE # --------------------- # Check if the global variable `timezone' exists. If so, define # HAVE_INT_TIMEZONE. # PGAC_VAR_INT_TIMEZONE # PGAC_STRUCT_TIMEZONE # ------------------ # Figure out how to get the current timezone. If `struct tm' has a # `tm_zone' member, define `HAVE_TM_ZONE'. Also, if the # external array `tzname' is found, define `HAVE_TZNAME'. # This is the same as the standard macro AC_STRUCT_TIMEZONE, except that # tzname[] is checked for regardless of whether we find tm_zone. # PGAC_STRUCT_TIMEZONE # PGAC_FUNC_GETTIMEOFDAY_1ARG # --------------------------- # Check if gettimeofday() has only one arguments. (Normal is two.) # If so, define GETTIMEOFDAY_1ARG. # PGAC_FUNC_GETTIMEOFDAY_1ARG # PGAC_FUNC_GETPWUID_R_5ARG # --------------------------- # Check if getpwuid_r() takes a fifth argument (later POSIX standard, not draft version) # If so, define GETPWUID_R_5ARG # PGAC_FUNC_GETPWUID_R_5ARG # PGAC_FUNC_STRERROR_R_INT # --------------------------- # Check if strerror_r() returns an int (SUSv3) rather than a char * (GNU libc) # If so, define STRERROR_R_INT # PGAC_FUNC_STRERROR_R_INT # PGAC_UNION_SEMUN # ---------------- # Check if `union semun' exists. Define HAVE_UNION_SEMUN if so. # If it doesn't then one could define it as # union semun { int val; struct semid_ds *buf; unsigned short *array; } # PGAC_UNION_SEMUN # PGAC_STRUCT_SOCKADDR_UN # ----------------------- # If `struct sockaddr_un' exists, define HAVE_UNIX_SOCKETS. # (Requires test for !) # PGAC_STRUCT_SOCKADDR_UN # PGAC_STRUCT_SOCKADDR_STORAGE # ---------------------------- # If `struct sockaddr_storage' exists, define HAVE_STRUCT_SOCKADDR_STORAGE. # If it is missing then one could define it. # PGAC_STRUCT_SOCKADDR_STORAGE # PGAC_STRUCT_SOCKADDR_STORAGE_MEMBERS # -------------------------------------- # Check the members of `struct sockaddr_storage'. We need to know about # ss_family and ss_len. (Some platforms follow RFC 2553 and call them # __ss_family and __ss_len.) We also check struct sockaddr's sa_len; # if we have to define our own `struct sockaddr_storage', this tells us # whether we need to provide an ss_len field. # PGAC_STRUCT_SOCKADDR_STORAGE_MEMBERS # PGAC_STRUCT_ADDRINFO # ----------------------- # If `struct addrinfo' exists, define HAVE_STRUCT_ADDRINFO. # PGAC_STRUCT_ADDRINFO # PGAC_FUNC_POSIX_SIGNALS # ----------------------- # Check to see if the machine has the POSIX signal interface. Define # HAVE_POSIX_SIGNALS if so. Also set the output variable HAVE_POSIX_SIGNALS # to yes or no. # # Note that this test only compiles a test program, it doesn't check # whether the routines actually work. If that becomes a problem, make # a fancier check. # PGAC_FUNC_POSIX_SIGNALS # PGAC_FUNC_SNPRINTF_LONG_LONG_INT_FORMAT # --------------------------------------- # Determine which format snprintf uses for long long int. We handle # %lld, %qd, %I64d. The result is in shell variable # LONG_LONG_INT_FORMAT. # # MinGW uses '%I64d', though gcc throws an warning with -Wall, # while '%lld' doesn't generate a warning, but doesn't work. # # PGAC_FUNC_SNPRINTF_LONG_LONG_INT_FORMAT # PGAC_FUNC_PRINTF_ARG_CONTROL # --------------------------------------- # Determine if printf supports %1$ argument selection, e.g. %5$ selects # the fifth argument after the printf print string. # This is not in the C99 standard, but in the Single Unix Specification (SUS). # It is used in our language translation strings. # # PGAC_FUNC_PRINTF_ARG_CONTROL # backport from Autoconf 2.61a # http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=f0c325537a22105536ac8c4e88656e50f9946486 # AC_FUNC_FSEEKO # -------------- # AC_FUNC_FSEEKO # $PostgreSQL: pgsql/config/general.m4,v 1.10 2008/10/29 09:27:24 petere Exp $ # This file defines new macros to process configure command line # arguments, to replace the brain-dead AC_ARG_WITH and AC_ARG_ENABLE. # The flaw in these is particularly that they only differentiate # between "given" and "not given" and do not provide enough help to # process arguments that only accept "yes/no", that require an # argument (other than "yes/no"), etc. # # The point of this implementation is to reduce code size and # redundancy in configure.in and to improve robustness and consistency # in the option evaluation code. # Convert type and name to shell variable name (e.g., "enable_long_strings") # PGAC_ARG(TYPE, NAME, HELP-STRING-LHS-EXTRA, HELP-STRING-RHS, # [ACTION-IF-YES], [ACTION-IF-NO], [ACTION-IF-ARG], # [ACTION-IF-OMITTED]) # ------------------------------------------------------------ # This is the base layer. TYPE is either "with" or "enable", depending # on what you like. NAME is the rest of the option name. # HELP-STRING-LHS-EXTRA is a string to append to the option name on # the left-hand side of the help output, e.g., an argument name. If # set to "-", append nothing, but let the option appear in the # negative form (disable/without). HELP-STRING-RHS is the option # description, for the right-hand side of the help output. # ACTION-IF-YES is executed if the option is given without an argument # (or "yes", which is the same); similar for ACTION-IF-NO. # PGAC_ARG # PGAC_ARG_CHECK() # ---------------- # Checks if the user passed any --with/without/enable/disable # arguments that were not defined. Just prints out a warning message, # so this should be called near the end, so the user will see it. # PGAC_ARG_CHECK # PGAC_ARG_BOOL(TYPE, NAME, DEFAULT, HELP-STRING-RHS, # [ACTION-IF-YES], [ACTION-IF-NO]) # --------------------------------------------------- # Accept a boolean option, that is, one that only takes yes or no. # ("no" is equivalent to "disable" or "without"). DEFAULT is what # should be done if the option is omitted; it should be "yes" or "no". # (Consequently, one of ACTION-IF-YES and ACTION-IF-NO will always # execute.) # PGAC_ARG_BOOL # PGAC_ARG_REQ(TYPE, NAME, HELP-ARGNAME, HELP-STRING-RHS, # [ACTION-IF-GIVEN], [ACTION-IF-NOT-GIVEN]) # ------------------------------------------------------- # This option will require an argument; "yes" or "no" will not be # accepted. HELP-ARGNAME is a name for the argument for the help output. # PGAC_ARG_REQ # PGAC_ARG_OPTARG(TYPE, NAME, HELP-ARGNAME, HELP-STRING-RHS, # [DEFAULT-ACTION], [ARG-ACTION], # [ACTION-ENABLED], [ACTION-DISABLED]) # ---------------------------------------------------------- # This will create an option that behaves as follows: If omitted, or # called with "no", then set the enable_variable to "no" and do # nothing else. If called with "yes", then execute DEFAULT-ACTION. If # called with argument, set enable_variable to "yes" and execute # ARG-ACTION. Additionally, execute ACTION-ENABLED if we ended up with # "yes" either way, else ACTION-DISABLED. # # The intent is to allow enabling a feature, and optionally pass an # additional piece of information. # PGAC_ARG_OPTARG pgac_need_repl_snprintf=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether long int is 64 bits" >&5 $as_echo_n "checking whether long int is 64 bits... " >&6; } if ${pgac_cv_type_long_int_64+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : # If cross-compiling, check the size reported by the compiler and # trust that the arithmetic works. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { static int test_array [1 - 2 * !(sizeof(long int) == 8)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : pgac_cv_type_long_int_64=yes else pgac_cv_type_long_int_64=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ typedef long int ac_int64; /* * These are globals to discourage the compiler from folding all the * arithmetic tests down to compile-time constants. */ ac_int64 a = 20000001; ac_int64 b = 40000005; int does_int64_work() { ac_int64 c,d; if (sizeof(ac_int64) != 8) return 0; /* definitely not the right size */ /* Do perfunctory checks to see if 64-bit arithmetic seems to work */ c = a * b; d = (c + b) / b; if (d != a+1) return 0; return 1; } main() { exit(! does_int64_work()); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : pgac_cv_type_long_int_64=yes else pgac_cv_type_long_int_64=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_type_long_int_64" >&5 $as_echo "$pgac_cv_type_long_int_64" >&6; } HAVE_LONG_INT_64=$pgac_cv_type_long_int_64 if test x"$pgac_cv_type_long_int_64" = xyes ; then $as_echo "#define HAVE_LONG_INT_64 1" >>confdefs.h fi if test x"$HAVE_LONG_INT_64" = x"no" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether long long int is 64 bits" >&5 $as_echo_n "checking whether long long int is 64 bits... " >&6; } if ${pgac_cv_type_long_long_int_64+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : # If cross-compiling, check the size reported by the compiler and # trust that the arithmetic works. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { static int test_array [1 - 2 * !(sizeof(long long int) == 8)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : pgac_cv_type_long_long_int_64=yes else pgac_cv_type_long_long_int_64=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ typedef long long int ac_int64; /* * These are globals to discourage the compiler from folding all the * arithmetic tests down to compile-time constants. */ ac_int64 a = 20000001; ac_int64 b = 40000005; int does_int64_work() { ac_int64 c,d; if (sizeof(ac_int64) != 8) return 0; /* definitely not the right size */ /* Do perfunctory checks to see if 64-bit arithmetic seems to work */ c = a * b; d = (c + b) / b; if (d != a+1) return 0; return 1; } main() { exit(! does_int64_work()); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : pgac_cv_type_long_long_int_64=yes else pgac_cv_type_long_long_int_64=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_type_long_long_int_64" >&5 $as_echo "$pgac_cv_type_long_long_int_64" >&6; } HAVE_LONG_LONG_INT_64=$pgac_cv_type_long_long_int_64 if test x"$pgac_cv_type_long_long_int_64" = xyes ; then $as_echo "#define HAVE_LONG_LONG_INT_64 1" >>confdefs.h fi fi if test x"$HAVE_LONG_LONG_INT_64" = xyes ; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define INT64CONST(x) x##LL long long int foo = INT64CONST(0x1234567890123456); int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : $as_echo "#define HAVE_LL_CONSTANTS 1" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # If we found "long int" is 64 bits, assume snprintf handles it. If # we found we need to use "long long int", better check. We cope with # snprintfs that use %lld, %qd, or %I64d as the format. If none of these # work, fall back to our own snprintf emulation (which we know uses %lld). if test "$HAVE_LONG_LONG_INT_64" = yes ; then if test $pgac_need_repl_snprintf = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking snprintf format for long long int" >&5 $as_echo_n "checking snprintf format for long long int... " >&6; } if ${pgac_cv_snprintf_long_long_int_format+:} false; then : $as_echo_n "(cached) " >&6 else for pgac_format in '%lld' '%qd' '%I64d'; do if test "$cross_compiling" = yes; then : pgac_cv_snprintf_long_long_int_format=cross; break else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include typedef long long int ac_int64; #define INT64_FORMAT "$pgac_format" ac_int64 a = 20000001; ac_int64 b = 40000005; int does_int64_snprintf_work() { ac_int64 c; char buf[100]; if (sizeof(ac_int64) != 8) return 0; /* doesn't look like the right size */ c = a * b; snprintf(buf, 100, INT64_FORMAT, c); if (strcmp(buf, "800000140000005") != 0) return 0; /* either multiply or snprintf is busted */ return 1; } main() { exit(! does_int64_snprintf_work()); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : pgac_cv_snprintf_long_long_int_format=$pgac_format; break fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi done fi LONG_LONG_INT_FORMAT='' case $pgac_cv_snprintf_long_long_int_format in cross) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot test (not on host machine)" >&5 $as_echo "cannot test (not on host machine)" >&6; };; ?*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_snprintf_long_long_int_format" >&5 $as_echo "$pgac_cv_snprintf_long_long_int_format" >&6; } LONG_LONG_INT_FORMAT=$pgac_cv_snprintf_long_long_int_format;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; };; esac if test "$LONG_LONG_INT_FORMAT" = ""; then # Force usage of our own snprintf, since system snprintf is broken pgac_need_repl_snprintf=yes LONG_LONG_INT_FORMAT='%lld' fi else # Here if we previously decided we needed to use our own snprintf LONG_LONG_INT_FORMAT='%lld' fi LONG_LONG_UINT_FORMAT=`echo "$LONG_LONG_INT_FORMAT" | sed 's/d$/u/'` INT64_FORMAT="\"$LONG_LONG_INT_FORMAT\"" UINT64_FORMAT="\"$LONG_LONG_UINT_FORMAT\"" else # Here if we are not using 'long long int' at all INT64_FORMAT='"%ld"' UINT64_FORMAT='"%lu"' fi cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define INT64_FORMAT $INT64_FORMAT _ACEOF cat >>confdefs.h <<_ACEOF #define UINT64_FORMAT $UINT64_FORMAT _ACEOF # Now we have checked all the reasons to replace snprintf if test $pgac_need_repl_snprintf = yes; then $as_echo "#define USE_REPL_SNPRINTF 1" >>confdefs.h case " $LIBOBJS " in *" snprintf.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS snprintf.$ac_objext" ;; esac fi # Need a #define for the size of Datum (unsigned long) # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned long" >&5 $as_echo_n "checking size of unsigned long... " >&6; } if ${ac_cv_sizeof_unsigned_long+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned long))" "ac_cv_sizeof_unsigned_long" "$ac_includes_default"; then : else if test "$ac_cv_type_unsigned_long" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (unsigned long) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_unsigned_long=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_long" >&5 $as_echo "$ac_cv_sizeof_unsigned_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_UNSIGNED_LONG $ac_cv_sizeof_unsigned_long _ACEOF # And check size of void *, size_t (enables tweaks for > 32bit address space) # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 $as_echo_n "checking size of void *... " >&6; } if ${ac_cv_sizeof_void_p+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then : else if test "$ac_cv_type_void_p" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (void *) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_void_p=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 $as_echo "$ac_cv_sizeof_void_p" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_VOID_P $ac_cv_sizeof_void_p _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5 $as_echo_n "checking size of size_t... " >&6; } if ${ac_cv_sizeof_size_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default"; then : else if test "$ac_cv_type_size_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (size_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_size_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5 $as_echo "$ac_cv_sizeof_size_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_SIZE_T $ac_cv_sizeof_size_t _ACEOF # Decide whether float4 is passed by value: user-selectable, enabled by default { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with float4 passed by value" >&5 $as_echo_n "checking whether to build with float4 passed by value... " >&6; } pgac_args="$pgac_args enable_float4_byval" # Check whether --enable-float4-byval was given. if test "${enable_float4_byval+set}" = set; then : enableval=$enable_float4_byval; case $enableval in yes) $as_echo "#define USE_FLOAT4_BYVAL 1" >>confdefs.h float4passbyval=true ;; no) float4passbyval=false ;; *) as_fn_error $? "no argument expected for --enable-float4-byval option" "$LINENO" 5 ;; esac else enable_float4_byval=yes $as_echo "#define USE_FLOAT4_BYVAL 1" >>confdefs.h float4passbyval=true fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_float4_byval" >&5 $as_echo "$enable_float4_byval" >&6; } cat >>confdefs.h <<_ACEOF #define FLOAT4PASSBYVAL $float4passbyval _ACEOF # Decide whether float8 is passed by value. # Note: this setting also controls int8 and related types such as timestamp. # If sizeof(Datum) >= 8, this is user-selectable, enabled by default. # If not, trying to select it is an error. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with float8 passed by value" >&5 $as_echo_n "checking whether to build with float8 passed by value... " >&6; } if test $ac_cv_sizeof_unsigned_long -ge 8 ; then pgac_args="$pgac_args enable_float8_byval" # Check whether --enable-float8-byval was given. if test "${enable_float8_byval+set}" = set; then : enableval=$enable_float8_byval; case $enableval in yes) : ;; no) : ;; *) as_fn_error $? "no argument expected for --enable-float8-byval option" "$LINENO" 5 ;; esac else enable_float8_byval=yes fi else pgac_args="$pgac_args enable_float8_byval" # Check whether --enable-float8-byval was given. if test "${enable_float8_byval+set}" = set; then : enableval=$enable_float8_byval; case $enableval in yes) : ;; no) : ;; *) as_fn_error $? "no argument expected for --enable-float8-byval option" "$LINENO" 5 ;; esac else enable_float8_byval=no fi if test "$enable_float8_byval" = yes ; then as_fn_error $? "--enable-float8-byval is not supported on 32-bit platforms." "$LINENO" 5 fi fi if test "$enable_float8_byval" = yes ; then $as_echo "#define USE_FLOAT8_BYVAL 1" >>confdefs.h float8passbyval=true else float8passbyval=false fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_float8_byval" >&5 $as_echo "$enable_float8_byval" >&6; } cat >>confdefs.h <<_ACEOF #define FLOAT8PASSBYVAL $float8passbyval _ACEOF # $PostgreSQL: pgsql/config/ac_func_accept_argtypes.m4,v 1.6 2003/11/29 19:51:17 pgsql Exp $ # This comes from the official Autoconf macro archive at # # (I removed the $ before the Id CVS keyword below.) # PostgreSQL local changes: In the original version ACCEPT_TYPE_ARG3 # is a pointer type. That's kind of useless because then you can't # use the macro to define a corresponding variable. We also make the # reasonable(?) assumption that you can use arg3 for getsocktype etc. # as well (i.e., anywhere POSIX.2 has socklen_t). # # arg2 can also be `const' (e.g., RH 4.2). Change the order of tests # for arg3 so that `int' is first, in case there is no prototype at all. # # Solaris 7 and 8 have arg3 as 'void *' (disguised as 'Psocklen_t' # which is *not* 'socklen_t *'). If we detect that, then we assume # 'int' as the result, because that ought to work best. # # On Win32, accept() returns 'unsigned int PASCAL' ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" "#include #ifdef HAVE_SYS_SOCKET_H #include #endif " if test "x$ac_cv_type_struct_sockaddr_storage" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_SOCKADDR_STORAGE 1 _ACEOF fi ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" "#include #ifdef HAVE_SYS_SOCKET_H #include #endif " if test "x$ac_cv_member_struct_sockaddr_storage_ss_family" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1 _ACEOF fi ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "__ss_family" "ac_cv_member_struct_sockaddr_storage___ss_family" "#include #ifdef HAVE_SYS_SOCKET_H #include #endif " if test "x$ac_cv_member_struct_sockaddr_storage___ss_family" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY 1 _ACEOF fi ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_len" "ac_cv_member_struct_sockaddr_storage_ss_len" "#include #ifdef HAVE_SYS_SOCKET_H #include #endif " if test "x$ac_cv_member_struct_sockaddr_storage_ss_len" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN 1 _ACEOF fi ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "__ss_len" "ac_cv_member_struct_sockaddr_storage___ss_len" "#include #ifdef HAVE_SYS_SOCKET_H #include #endif " if test "x$ac_cv_member_struct_sockaddr_storage___ss_len" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_SOCKADDR_STORAGE___SS_LEN 1 _ACEOF fi ac_fn_c_check_member "$LINENO" "struct sockaddr" "sa_len" "ac_cv_member_struct_sockaddr_sa_len" "#include #ifdef HAVE_SYS_SOCKET_H #include #endif " if test "x$ac_cv_member_struct_sockaddr_sa_len" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_SOCKADDR_SA_LEN 1 _ACEOF fi ac_fn_c_check_type "$LINENO" "union semun" "ac_cv_type_union_semun" "#include #include #include " if test "x$ac_cv_type_union_semun" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_UNION_SEMUN 1 _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 $as_echo_n "checking return type of signal handlers... " >&6; } if ${ac_cv_type_signal+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { return *(signal (0, 0)) (0) == 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_signal=int else ac_cv_type_signal=void fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 $as_echo "$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF for ac_func in vprintf do : ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" if test "x$ac_cv_func_vprintf" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VPRINTF 1 _ACEOF ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" if test "x$ac_cv_func__doprnt" = xyes; then : $as_echo "#define HAVE_DOPRNT 1" >>confdefs.h fi fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wait3 that fills in rusage" >&5 $as_echo_n "checking for wait3 that fills in rusage... " >&6; } if ${ac_cv_func_wait3_rusage+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_wait3_rusage=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #include #include #include /* HP-UX has wait3 but does not fill in rusage at all. */ int main () { struct rusage r; int i; /* Use a field that we can force nonzero -- voluntary context switches. For systems like NeXT and OSF/1 that don't set it, also use the system CPU time. And page faults (I/O) for Linux. */ r.ru_nvcsw = 0; r.ru_stime.tv_sec = 0; r.ru_stime.tv_usec = 0; r.ru_majflt = r.ru_minflt = 0; switch (fork ()) { case 0: /* Child. */ sleep(1); /* Give up the CPU. */ _exit(0); break; case -1: /* What can we do? */ _exit(0); break; default: /* Parent. */ wait3(&i, 0, &r); /* Avoid "text file busy" from rm on fast HP-UX machines. */ sleep(2); return (r.ru_nvcsw == 0 && r.ru_majflt == 0 && r.ru_minflt == 0 && r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0); } } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_wait3_rusage=yes else ac_cv_func_wait3_rusage=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_wait3_rusage" >&5 $as_echo "$ac_cv_func_wait3_rusage" >&6; } if test $ac_cv_func_wait3_rusage = yes; then $as_echo "#define HAVE_WAIT3 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for accept()" >&5 $as_echo_n "checking types of arguments for accept()... " >&6; } if ${ac_cv_func_accept_return+:} false; then : $as_echo_n "(cached) " >&6 else if ${ac_cv_func_accept_arg1+:} false; then : $as_echo_n "(cached) " >&6 else if ${ac_cv_func_accept_arg2+:} false; then : $as_echo_n "(cached) " >&6 else if ${ac_cv_func_accept_arg3+:} false; then : $as_echo_n "(cached) " >&6 else for ac_cv_func_accept_return in 'int' 'unsigned int PASCAL'; do for ac_cv_func_accept_arg1 in 'int' 'unsigned int'; do for ac_cv_func_accept_arg2 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do for ac_cv_func_accept_arg3 in 'int' 'size_t' 'socklen_t' 'unsigned int' 'void'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif extern $ac_cv_func_accept_return accept ($ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *); int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_not_found=no; break 4 else ac_not_found=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done done done done if test "$ac_not_found" = yes; then as_fn_error $? "could not determine argument types" "$LINENO" 5 fi if test "$ac_cv_func_accept_arg3" = "void"; then ac_cv_func_accept_arg3=int fi fi fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_accept_return, $ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *" >&5 $as_echo "$ac_cv_func_accept_return, $ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *" >&6; } cat >>confdefs.h <<_ACEOF #define ACCEPT_TYPE_RETURN $ac_cv_func_accept_return _ACEOF cat >>confdefs.h <<_ACEOF #define ACCEPT_TYPE_ARG1 $ac_cv_func_accept_arg1 _ACEOF cat >>confdefs.h <<_ACEOF #define ACCEPT_TYPE_ARG2 $ac_cv_func_accept_arg2 _ACEOF cat >>confdefs.h <<_ACEOF #define ACCEPT_TYPE_ARG3 $ac_cv_func_accept_arg3 _ACEOF for ac_func in setsid select socket sigprocmask strdup strerror strftime strtok asprintf vasprintf gai_strerror hstrerror pstat setproctitle vsyslog do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_prog in pg_config do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_PGCONFIG+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PGCONFIG"; then ac_cv_prog_PGCONFIG="$PGCONFIG" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PGCONFIG="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi PGCONFIG=$ac_cv_prog_PGCONFIG if test -n "$PGCONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PGCONFIG" >&5 $as_echo "$PGCONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PGCONFIG" && break done if test -z $PGCONFIG then PGSQL_INCLUDE_DIR=/usr/local/pgsql/include PGSQL_LIB_DIR=/usr/local/pgsql/lib else PGSQL_INCLUDE_DIR=`pg_config --includedir` PGSQL_LIB_DIR=`pg_config --libdir` fi # Check whether --with-pgsql was given. if test "${with_pgsql+set}" = set; then : withval=$with_pgsql; case "$withval" in "" | y | ye | yes | n | no) as_fn_error $? "*** You must supply an argument to the --with-pgsql option." "$LINENO" 5 ;; esac PGSQL_INCLUDE_DIR="$withval"/include PGSQL_LIB_DIR="$withval"/lib fi # Check whether --with-pgsql-includedir was given. if test "${with_pgsql_includedir+set}" = set; then : withval=$with_pgsql_includedir; case "$withval" in "" | y | ye | yes | n | no) as_fn_error $? "*** You must supply an argument to the --with-pgsql-includedir option." "$LINENO" 5 ;; esac PGSQL_INCLUDE_DIR="$withval" fi # Check whether --with-pgsql-libdir was given. if test "${with_pgsql_libdir+set}" = set; then : withval=$with_pgsql_libdir; case "$withval" in "" | y | ye | yes | n | no) as_fn_error $? "*** You must supply an argument to the --with-pgsql-libdir option." "$LINENO" 5 ;; esac PGSQL_LIB_DIR="$withval" fi # Check whether --with-openssl was given. if test "${with_openssl+set}" = set; then : withval=$with_openssl; else openssl=no fi if test "$with_openssl" = yes || test "$with_openssl" = auto; then for ac_header in openssl/ssl.h do : ac_fn_c_check_header_mongrel "$LINENO" "openssl/ssl.h" "ac_cv_header_openssl_ssl_h" "$ac_includes_default" if test "x$ac_cv_header_openssl_ssl_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_OPENSSL_SSL_H 1 _ACEOF $as_echo "#define USE_SSL 1" >>confdefs.h else if test "$with_openssl" = yes; then as_fn_error $? "header file is required for SSL" "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: header file is required for SSL" >&5 $as_echo "$as_me: WARNING: header file is required for SSL" >&2;} fi fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CRYPTO_new_ex_data in -lcrypto" >&5 $as_echo_n "checking for CRYPTO_new_ex_data in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_CRYPTO_new_ex_data+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char CRYPTO_new_ex_data (); int main () { return CRYPTO_new_ex_data (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_CRYPTO_new_ex_data=yes else ac_cv_lib_crypto_CRYPTO_new_ex_data=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_CRYPTO_new_ex_data" >&5 $as_echo "$ac_cv_lib_crypto_CRYPTO_new_ex_data" >&6; } if test "x$ac_cv_lib_crypto_CRYPTO_new_ex_data" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCRYPTO 1 _ACEOF LIBS="-lcrypto $LIBS" else as_fn_error $? "library 'crypto' is required for OpenSSL" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_library_init in -lssl" >&5 $as_echo_n "checking for SSL_library_init in -lssl... " >&6; } if ${ac_cv_lib_ssl_SSL_library_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lssl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char SSL_library_init (); int main () { return SSL_library_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ssl_SSL_library_init=yes else ac_cv_lib_ssl_SSL_library_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_library_init" >&5 $as_echo "$ac_cv_lib_ssl_SSL_library_init" >&6; } if test "x$ac_cv_lib_ssl_SSL_library_init" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSSL 1 _ACEOF LIBS="-lssl $LIBS" else as_fn_error $? "library 'ssl' is required for OpenSSL" "$LINENO" 5 fi fi # Check whether --with-pam was given. if test "${with_pam+set}" = set; then : withval=$with_pam; $as_echo "#define USE_PAM 1" >>confdefs.h fi if test "$with_pam" = yes ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pam_start in -lpam" >&5 $as_echo_n "checking for pam_start in -lpam... " >&6; } if ${ac_cv_lib_pam_pam_start+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpam $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pam_start (); int main () { return pam_start (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pam_pam_start=yes else ac_cv_lib_pam_pam_start=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pam_pam_start" >&5 $as_echo "$ac_cv_lib_pam_pam_start" >&6; } if test "x$ac_cv_lib_pam_pam_start" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPAM 1 _ACEOF LIBS="-lpam $LIBS" else as_fn_error $? "library 'pam' is required for PAM" "$LINENO" 5 fi for ac_header in security/pam_appl.h do : ac_fn_c_check_header_mongrel "$LINENO" "security/pam_appl.h" "ac_cv_header_security_pam_appl_h" "$ac_includes_default" if test "x$ac_cv_header_security_pam_appl_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SECURITY_PAM_APPL_H 1 _ACEOF else for ac_header in pam/pam_appl.h do : ac_fn_c_check_header_mongrel "$LINENO" "pam/pam_appl.h" "ac_cv_header_pam_pam_appl_h" "$ac_includes_default" if test "x$ac_cv_header_pam_pam_appl_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PAM_PAM_APPL_H 1 _ACEOF else as_fn_error $? "header file or is required for PAM." "$LINENO" 5 fi done fi done fi # Check whether --with-memcached was given. if test "${with_memcached+set}" = set; then : withval=$with_memcached; case "$withval" in "" | y | ye | yes | n | no) as_fn_error $? "*** You must supply an argument to the --with-memcached option." "$LINENO" 5 ;; *) MEMCACHED_INCLUDE_DIR="$withval"/include MEMCACHED_LIB_DIR="$withval"/lib OLD_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -I$MEMCACHED_INCLUDE_DIR" for ac_header in libmemcached/memcached.h do : ac_fn_c_check_header_mongrel "$LINENO" "libmemcached/memcached.h" "ac_cv_header_libmemcached_memcached_h" "$ac_includes_default" if test "x$ac_cv_header_libmemcached_memcached_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBMEMCACHED_MEMCACHED_H 1 _ACEOF $as_echo "#define USE_MEMCACHED 1" >>confdefs.h else as_fn_error $? "header file is required for memcached support" "$LINENO" 5 fi done CFLAGS=$OLD_CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking for memcached_create in -lmemcached" >&5 $as_echo_n "checking for memcached_create in -lmemcached... " >&6; } if ${ac_cv_lib_memcached_memcached_create+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmemcached $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char memcached_create (); int main () { return memcached_create (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_memcached_memcached_create=yes else ac_cv_lib_memcached_memcached_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_memcached_memcached_create" >&5 $as_echo "$ac_cv_lib_memcached_memcached_create" >&6; } if test "x$ac_cv_lib_memcached_memcached_create" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBMEMCACHED 1 _ACEOF LIBS="-lmemcached $LIBS" else as_fn_error $? "libmemcached is not installed" "$LINENO" 5 fi MEMCACHED_INCLUDE_OPT="-I $MEMCACHED_INCLUDE_DIR" MEMCACHED_LINK_OPT="-L$MEMCACHED_LIB_DIR" MEMCACHED_RPATH_OPT="-rpath $MEMCACHED_LIB_DIR" ;; esac fi OLD_LDFLAGS="$LDFLAGS" LDFLAGS="-L$PGSQL_LIB_DIR" OLD_LIBS="$LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PQexecPrepared in -lpq" >&5 $as_echo_n "checking for PQexecPrepared in -lpq... " >&6; } if ${ac_cv_lib_pq_PQexecPrepared+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpq $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char PQexecPrepared (); int main () { return PQexecPrepared (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pq_PQexecPrepared=yes else ac_cv_lib_pq_PQexecPrepared=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pq_PQexecPrepared" >&5 $as_echo "$ac_cv_lib_pq_PQexecPrepared" >&6; } if test "x$ac_cv_lib_pq_PQexecPrepared" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPQ 1 _ACEOF LIBS="-lpq $LIBS" else as_fn_error $? "libpq is not installed or libpq is old" "$LINENO" 5 fi for ac_func in PQprepare do : ac_fn_c_check_func "$LINENO" "PQprepare" "ac_cv_func_PQprepare" if test "x$ac_cv_func_PQprepare" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PQPREPARE 1 _ACEOF fi done LDFLAGS="$OLD_LDFLAGS" LIBS="$OLD_LIBS" # --enable(disable)-rpath option # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then : enableval=$enable_rpath; case "${enableval}" in yes) rpath=yes ;; no) rpath=no ;; esac else rpath=yes fi if test x$rpath = xyes; then enable_rpath_TRUE= enable_rpath_FALSE='#' else enable_rpath_TRUE='#' enable_rpath_FALSE= fi # Decide whether to use row lock against the sequence table for insert_lock. # This lock method is compatible with pgpool-II 3.0 series(until 3.0.4). { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use row lock against the sequence table for insert_lock" >&5 $as_echo_n "checking whether to use row lock against the sequence table for insert_lock... " >&6; } pgac_args="$pgac_args enable_sequence_lock" # Check whether --enable-sequence-lock was given. if test "${enable_sequence_lock+set}" = set; then : enableval=$enable_sequence_lock; case $enableval in yes) : ;; no) : ;; *) as_fn_error $? "no argument expected for --enable-sequence-lock option" "$LINENO" 5 ;; esac else enable_sequence_lock=no fi if test "$enable_sequence_lock" = yes && test "$enable_table_lock" = yes ; then as_fn_error $? "--enable-table-lock cannot be enabled at the same time." "$LINENO" 5 fi if test "$enable_sequence_lock" = yes ; then $as_echo "#define USE_SEQUENCE_LOCK 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_sequence_lock" >&5 $as_echo "$enable_sequence_lock" >&6; } # Decide whether to use table lock against the target table for insert_lock. # This lock method is compatible with pgpool-II 2.2 and 2.3 series. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use table lock against the target table for insert_lock" >&5 $as_echo_n "checking whether to use table lock against the target table for insert_lock... " >&6; } pgac_args="$pgac_args enable_table_lock" # Check whether --enable-table-lock was given. if test "${enable_table_lock+set}" = set; then : enableval=$enable_table_lock; case $enableval in yes) : ;; no) : ;; *) as_fn_error $? "no argument expected for --enable-table-lock option" "$LINENO" 5 ;; esac else enable_table_lock=no fi if test "$enable_table_lock" = yes && test "$enable_sequence_lock" = yes ; then as_fn_error $? "--enable-sequence-lock cannot be enabled at the same time." "$LINENO" 5 fi if test "$enable_table_lock" = yes ; then $as_echo "#define USE_TABLE_LOCK 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_table_lock" >&5 $as_echo "$enable_table_lock" >&6; } pgac_args="$pgac_args enable_cassert" # Check whether --enable-cassert was given. if test "${enable_cassert+set}" = set; then : enableval=$enable_cassert; case $enableval in yes) : ;; no) : ;; *) as_fn_error $? "no argument expected for --enable-cassert option" "$LINENO" 5 ;; esac else enable_cassert=no fi if test "$enable_cassert" = yes ; then $as_echo "#define USE_ASSERT_CHECKING 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: enable cassert = $enable_cassert" >&5 $as_echo "enable cassert = $enable_cassert" >&6; } ac_config_headers="$ac_config_headers src/include/config.h" ac_config_files="$ac_config_files Makefile doc/Makefile src/Makefile src/include/Makefile src/parser/Makefile src/libs/Makefile src/libs/pcp/Makefile src/tools/Makefile src/tools/pgmd5/Makefile src/tools/pcp/Makefile src/watchdog/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${enable_rpath_TRUE}" && test -z "${enable_rpath_FALSE}"; then as_fn_error $? "conditional \"enable_rpath\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by pgpool-II $as_me 3.4.3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ pgpool-II config.status 3.4.3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "src/include/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/include/config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/include/Makefile") CONFIG_FILES="$CONFIG_FILES src/include/Makefile" ;; "src/parser/Makefile") CONFIG_FILES="$CONFIG_FILES src/parser/Makefile" ;; "src/libs/Makefile") CONFIG_FILES="$CONFIG_FILES src/libs/Makefile" ;; "src/libs/pcp/Makefile") CONFIG_FILES="$CONFIG_FILES src/libs/pcp/Makefile" ;; "src/tools/Makefile") CONFIG_FILES="$CONFIG_FILES src/tools/Makefile" ;; "src/tools/pgmd5/Makefile") CONFIG_FILES="$CONFIG_FILES src/tools/pgmd5/Makefile" ;; "src/tools/pcp/Makefile") CONFIG_FILES="$CONFIG_FILES src/tools/pcp/Makefile" ;; "src/watchdog/Makefile") CONFIG_FILES="$CONFIG_FILES src/watchdog/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="" # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi pgpool-II-3.4.3/install-sh0000775000076400007640000003325612554350605012275 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-01-19.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for `test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: pgpool-II-3.4.3/c-library.m40000664000076400007640000002502412353255235012411 00000000000000# Macros that test various C library quirks # $PostgreSQL: pgsql/config/c-library.m4,v 1.33 2008/08/21 13:53:28 petere Exp $ # PGAC_VAR_INT_TIMEZONE # --------------------- # Check if the global variable `timezone' exists. If so, define # HAVE_INT_TIMEZONE. AC_DEFUN([PGAC_VAR_INT_TIMEZONE], [AC_CACHE_CHECK(for int timezone, pgac_cv_var_int_timezone, [AC_TRY_LINK([#include int res;], [#ifndef __CYGWIN__ res = timezone / 60; #else res = _timezone / 60; #endif], [pgac_cv_var_int_timezone=yes], [pgac_cv_var_int_timezone=no])]) if test x"$pgac_cv_var_int_timezone" = xyes ; then AC_DEFINE(HAVE_INT_TIMEZONE,, [Define to 1 if you have the global variable 'int timezone'.]) fi])# PGAC_VAR_INT_TIMEZONE # PGAC_STRUCT_TIMEZONE # ------------------ # Figure out how to get the current timezone. If `struct tm' has a # `tm_zone' member, define `HAVE_TM_ZONE'. Also, if the # external array `tzname' is found, define `HAVE_TZNAME'. # This is the same as the standard macro AC_STRUCT_TIMEZONE, except that # tzname[] is checked for regardless of whether we find tm_zone. AC_DEFUN([PGAC_STRUCT_TIMEZONE], [AC_REQUIRE([AC_STRUCT_TM])dnl AC_CHECK_MEMBERS([struct tm.tm_zone],,,[#include #include <$ac_cv_struct_tm> ]) if test "$ac_cv_member_struct_tm_tm_zone" = yes; then AC_DEFINE(HAVE_TM_ZONE, 1, [Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use `HAVE_STRUCT_TM_TM_ZONE' instead.]) fi AC_CACHE_CHECK(for tzname, ac_cv_var_tzname, [AC_TRY_LINK( [#include #ifndef tzname /* For SGI. */ extern char *tzname[]; /* RS6000 and others reject char **tzname. */ #endif ], [atoi(*tzname);], ac_cv_var_tzname=yes, ac_cv_var_tzname=no)]) if test $ac_cv_var_tzname = yes; then AC_DEFINE(HAVE_TZNAME, 1, [Define to 1 if you have the external array `tzname'.]) fi ])# PGAC_STRUCT_TIMEZONE # PGAC_FUNC_GETTIMEOFDAY_1ARG # --------------------------- # Check if gettimeofday() has only one arguments. (Normal is two.) # If so, define GETTIMEOFDAY_1ARG. AC_DEFUN([PGAC_FUNC_GETTIMEOFDAY_1ARG], [AC_CACHE_CHECK(whether gettimeofday takes only one argument, pgac_cv_func_gettimeofday_1arg, [AC_TRY_COMPILE([#include ], [struct timeval *tp; struct timezone *tzp; gettimeofday(tp,tzp);], [pgac_cv_func_gettimeofday_1arg=no], [pgac_cv_func_gettimeofday_1arg=yes])]) if test x"$pgac_cv_func_gettimeofday_1arg" = xyes ; then AC_DEFINE(GETTIMEOFDAY_1ARG,, [Define to 1 if gettimeofday() takes only 1 argument.]) fi AH_VERBATIM(GETTIMEOFDAY_1ARG_, [@%:@ifdef GETTIMEOFDAY_1ARG @%:@ define gettimeofday(a,b) gettimeofday(a) @%:@endif])dnl ])# PGAC_FUNC_GETTIMEOFDAY_1ARG # PGAC_FUNC_GETPWUID_R_5ARG # --------------------------- # Check if getpwuid_r() takes a fifth argument (later POSIX standard, not draft version) # If so, define GETPWUID_R_5ARG AC_DEFUN([PGAC_FUNC_GETPWUID_R_5ARG], [AC_CACHE_CHECK(whether getpwuid_r takes a fifth argument, pgac_cv_func_getpwuid_r_5arg, [AC_TRY_COMPILE([#include #include ], [uid_t uid; struct passwd *space; char *buf; size_t bufsize; struct passwd **result; getpwuid_r(uid, space, buf, bufsize, result);], [pgac_cv_func_getpwuid_r_5arg=yes], [pgac_cv_func_getpwuid_r_5arg=no])]) if test x"$pgac_cv_func_getpwuid_r_5arg" = xyes ; then AC_DEFINE(GETPWUID_R_5ARG,, [Define to 1 if getpwuid_r() takes a 5th argument.]) fi ])# PGAC_FUNC_GETPWUID_R_5ARG # PGAC_FUNC_STRERROR_R_INT # --------------------------- # Check if strerror_r() returns an int (SUSv3) rather than a char * (GNU libc) # If so, define STRERROR_R_INT AC_DEFUN([PGAC_FUNC_STRERROR_R_INT], [AC_CACHE_CHECK(whether strerror_r returns int, pgac_cv_func_strerror_r_int, [AC_TRY_COMPILE([#include ], [#ifndef _AIX int strerror_r(int, char *, size_t); #else /* Older AIX has 'int' for the third argument so we don't test the args. */ int strerror_r(); #endif], [pgac_cv_func_strerror_r_int=yes], [pgac_cv_func_strerror_r_int=no])]) if test x"$pgac_cv_func_strerror_r_int" = xyes ; then AC_DEFINE(STRERROR_R_INT,, [Define to 1 if strerror_r() returns a int.]) fi ])# PGAC_FUNC_STRERROR_R_INT # PGAC_UNION_SEMUN # ---------------- # Check if `union semun' exists. Define HAVE_UNION_SEMUN if so. # If it doesn't then one could define it as # union semun { int val; struct semid_ds *buf; unsigned short *array; } AC_DEFUN([PGAC_UNION_SEMUN], [AC_CHECK_TYPES([union semun], [], [], [#include #include #include ])])# PGAC_UNION_SEMUN # PGAC_STRUCT_SOCKADDR_UN # ----------------------- # If `struct sockaddr_un' exists, define HAVE_UNIX_SOCKETS. # (Requires test for !) AC_DEFUN([PGAC_STRUCT_SOCKADDR_UN], [AC_CHECK_TYPES([struct sockaddr_un], [AC_DEFINE(HAVE_UNIX_SOCKETS, 1, [Define to 1 if you have unix sockets.])], [], [#include #ifdef HAVE_SYS_UN_H #include #endif ])])# PGAC_STRUCT_SOCKADDR_UN # PGAC_STRUCT_SOCKADDR_STORAGE # ---------------------------- # If `struct sockaddr_storage' exists, define HAVE_STRUCT_SOCKADDR_STORAGE. # If it is missing then one could define it. AC_DEFUN([PGAC_STRUCT_SOCKADDR_STORAGE], [AC_CHECK_TYPES([struct sockaddr_storage], [], [], [#include #ifdef HAVE_SYS_SOCKET_H #include #endif ])])# PGAC_STRUCT_SOCKADDR_STORAGE # PGAC_STRUCT_SOCKADDR_STORAGE_MEMBERS # -------------------------------------- # Check the members of `struct sockaddr_storage'. We need to know about # ss_family and ss_len. (Some platforms follow RFC 2553 and call them # __ss_family and __ss_len.) We also check struct sockaddr's sa_len; # if we have to define our own `struct sockaddr_storage', this tells us # whether we need to provide an ss_len field. AC_DEFUN([PGAC_STRUCT_SOCKADDR_STORAGE_MEMBERS], [AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family, struct sockaddr_storage.__ss_family, struct sockaddr_storage.ss_len, struct sockaddr_storage.__ss_len, struct sockaddr.sa_len], [], [], [#include #ifdef HAVE_SYS_SOCKET_H #include #endif ])])# PGAC_STRUCT_SOCKADDR_STORAGE_MEMBERS # PGAC_STRUCT_ADDRINFO # ----------------------- # If `struct addrinfo' exists, define HAVE_STRUCT_ADDRINFO. AC_DEFUN([PGAC_STRUCT_ADDRINFO], [AC_CHECK_TYPES([struct addrinfo], [], [], [#include #include #include ])])# PGAC_STRUCT_ADDRINFO # PGAC_FUNC_POSIX_SIGNALS # ----------------------- # Check to see if the machine has the POSIX signal interface. Define # HAVE_POSIX_SIGNALS if so. Also set the output variable HAVE_POSIX_SIGNALS # to yes or no. # # Note that this test only compiles a test program, it doesn't check # whether the routines actually work. If that becomes a problem, make # a fancier check. AC_DEFUN([PGAC_FUNC_POSIX_SIGNALS], [AC_CACHE_CHECK(for POSIX signal interface, pgac_cv_func_posix_signals, [AC_TRY_LINK([#include ], [struct sigaction act, oact; sigemptyset(&act.sa_mask); act.sa_flags = SA_RESTART; sigaction(0, &act, &oact);], [pgac_cv_func_posix_signals=yes], [pgac_cv_func_posix_signals=no])]) if test x"$pgac_cv_func_posix_signals" = xyes ; then AC_DEFINE(HAVE_POSIX_SIGNALS,, [Define to 1 if you have the POSIX signal interface.]) fi HAVE_POSIX_SIGNALS=$pgac_cv_func_posix_signals AC_SUBST(HAVE_POSIX_SIGNALS)])# PGAC_FUNC_POSIX_SIGNALS # PGAC_FUNC_SNPRINTF_LONG_LONG_INT_FORMAT # --------------------------------------- # Determine which format snprintf uses for long long int. We handle # %lld, %qd, %I64d. The result is in shell variable # LONG_LONG_INT_FORMAT. # # MinGW uses '%I64d', though gcc throws an warning with -Wall, # while '%lld' doesn't generate a warning, but doesn't work. # AC_DEFUN([PGAC_FUNC_SNPRINTF_LONG_LONG_INT_FORMAT], [AC_MSG_CHECKING([snprintf format for long long int]) AC_CACHE_VAL(pgac_cv_snprintf_long_long_int_format, [for pgac_format in '%lld' '%qd' '%I64d'; do AC_TRY_RUN([#include typedef long long int ac_int64; #define INT64_FORMAT "$pgac_format" ac_int64 a = 20000001; ac_int64 b = 40000005; int does_int64_snprintf_work() { ac_int64 c; char buf[100]; if (sizeof(ac_int64) != 8) return 0; /* doesn't look like the right size */ c = a * b; snprintf(buf, 100, INT64_FORMAT, c); if (strcmp(buf, "800000140000005") != 0) return 0; /* either multiply or snprintf is busted */ return 1; } main() { exit(! does_int64_snprintf_work()); }], [pgac_cv_snprintf_long_long_int_format=$pgac_format; break], [], [pgac_cv_snprintf_long_long_int_format=cross; break]) done])dnl AC_CACHE_VAL LONG_LONG_INT_FORMAT='' case $pgac_cv_snprintf_long_long_int_format in cross) AC_MSG_RESULT([cannot test (not on host machine)]);; ?*) AC_MSG_RESULT([$pgac_cv_snprintf_long_long_int_format]) LONG_LONG_INT_FORMAT=$pgac_cv_snprintf_long_long_int_format;; *) AC_MSG_RESULT(none);; esac])# PGAC_FUNC_SNPRINTF_LONG_LONG_INT_FORMAT # PGAC_FUNC_PRINTF_ARG_CONTROL # --------------------------------------- # Determine if printf supports %1$ argument selection, e.g. %5$ selects # the fifth argument after the printf print string. # This is not in the C99 standard, but in the Single Unix Specification (SUS). # It is used in our language translation strings. # AC_DEFUN([PGAC_FUNC_PRINTF_ARG_CONTROL], [AC_MSG_CHECKING([whether printf supports argument control]) AC_CACHE_VAL(pgac_cv_printf_arg_control, [AC_TRY_RUN([#include #include int main() { char buf[100]; /* can it swap arguments? */ snprintf(buf, 100, "%2\$d %1\$d", 3, 4); if (strcmp(buf, "4 3") != 0) return 1; return 0; }], [pgac_cv_printf_arg_control=yes], [pgac_cv_printf_arg_control=no], [pgac_cv_printf_arg_control=cross]) ])dnl AC_CACHE_VAL AC_MSG_RESULT([$pgac_cv_printf_arg_control]) ])# PGAC_FUNC_PRINTF_ARG_CONTROL # backport from Autoconf 2.61a # http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=f0c325537a22105536ac8c4e88656e50f9946486 # AC_FUNC_FSEEKO # -------------- AN_FUNCTION([ftello], [AC_FUNC_FSEEKO]) AN_FUNCTION([fseeko], [AC_FUNC_FSEEKO]) AC_DEFUN([AC_FUNC_FSEEKO], [_AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, 1, [ac_cv_sys_largefile_source], [Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2).], [[#include /* for off_t */ #include ]], [[int (*fp) (FILE *, off_t, int) = fseeko; return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);]]) # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug # in glibc 2.1.3, but that breaks too many other things. # If you want fseeko and ftello with glibc, upgrade to a fixed glibc. if test $ac_cv_sys_largefile_source != unknown; then AC_DEFINE(HAVE_FSEEKO, 1, [Define to 1 if fseeko (and presumably ftello) exists and is declared.]) fi ])# AC_FUNC_FSEEKO pgpool-II-3.4.3/config.guess0000775000076400007640000012743212554350605012611 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-02-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner. Please send patches (context # diff format) to and include a ChangeLog # entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-gnueabi else echo ${UNAME_MACHINE}-unknown-linux-gnueabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then UNAME_PROCESSOR="x86_64" fi fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: pgpool-II-3.4.3/src/0002775000076400007640000000000012554350620011126 500000000000000pgpool-II-3.4.3/src/tools/0002775000076400007640000000000012554350620012266 500000000000000pgpool-II-3.4.3/src/tools/fe_port.c0000664000076400007640000000670112554350605014015 00000000000000/* * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2014 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation, and that the name of the * author not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. The author makes no representations about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * * fe_port.c * */ #ifndef POOL_PRIVATE #error "This file is not expected to be compiled for pgpool utilities only" #endif #include #include #include #include #include #include #include #include "utils/fe_ports.h" int _fe_error_level = 0; const char* _filename; const char* _funcname; int _lineno; int _print_timestamp = 0; static const char * error_severity(int elevel); static char *nowsec(void); #define MAXSTRFTIME 128 /* * ignore errdetail() in frontend */ int errdetail(const char *fmt,...) { return 0; } /* * ignore errhint() in frontend */ int errhint(const char *fmt,...) { return 0; } void errfinish(int dummy,...) { } void errmsg(const char *fmt,...) { va_list ap; #ifdef HAVE_ASPRINTF char *fmt2; int len; #endif #ifdef HAVE_ASPRINTF if (_print_timestamp) len = asprintf(&fmt2, "%s %s: pid %d: %s\n", nowsec(), error_severity(_fe_error_level), (int)getpid(), fmt); else len = asprintf(&fmt2, "%s: pid %d: %s\n", error_severity(_fe_error_level),(int)getpid(), fmt); if (len >= 0 && fmt2) { va_start(ap, fmt); vfprintf(stderr, fmt2, ap); va_end(ap); fflush(stderr); free(fmt2); } #else if (_print_timestamp) fprintf(stderr, "%s %s: pid %d: ", nowsec(),error_severity(_fe_error_level), (int)getpid()); else fprintf(stderr, "%s: pid %d: ",error_severity(_fe_error_level), (int)getpid()); va_start(ap, fmt); vfprintf(stderr, fmt, ap); va_end(ap); fprintf(stderr, "\n"); #endif } /* * error_severity --- get localized string representing elevel */ static const char * error_severity(int elevel) { const char *prefix; switch (elevel) { case DEBUG1: case DEBUG2: case DEBUG3: case DEBUG4: case DEBUG5: prefix = "DEBUG"; break; case LOG: case COMMERROR: prefix = "LOG"; break; case INFO: prefix = "INFO"; break; case NOTICE: prefix = "NOTICE"; break; case WARNING: prefix = "WARNING"; break; case ERROR: prefix = "ERROR"; break; case FATAL: prefix = "FATAL"; break; case PANIC: prefix = "PANIC"; break; default: prefix = "???"; break; } return prefix; } static char *nowsec(void) { static char strbuf[MAXSTRFTIME]; time_t now = time(NULL); strftime(strbuf, MAXSTRFTIME, "%Y-%m-%d %H:%M:%S", localtime(&now)); return strbuf; } int errstart(int elevel, const char *filename, int lineno, const char *funcname) { _fe_error_level = elevel; /* * This is a basic version and for now we just supress all messages below WARNING for frontend */ if(_fe_error_level < WARNING) return 0; _filename = filename; _lineno = lineno; _funcname = funcname; return 1; } pgpool-II-3.4.3/src/tools/fe_memutils.c0000664000076400007640000000403112554350605014662 00000000000000/*------------------------------------------------------------------------- * * fe_memutils.c * memory management support for frontend code * * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION * src/common/fe_memutils.c * *------------------------------------------------------------------------- */ #ifndef POOL_PRIVATE #error "This file is not expected to be compiled for pgpool utilities only" #endif #include #include #include #include "utils/fe_ports.h" void * pg_malloc(size_t size) { void *tmp; /* Avoid unportable behavior of malloc(0) */ if (size == 0) size = 1; tmp = malloc(size); if (!tmp) { fprintf(stderr, "out of memory\n"); exit(EXIT_FAILURE); } return tmp; } void * pg_malloc0(size_t size) { void *tmp; tmp = pg_malloc(size); memset(tmp, 0, size); return tmp; } void * pg_realloc(void *ptr, size_t size) { void *tmp; /* Avoid unportable behavior of realloc(NULL, 0) */ if (ptr == NULL && size == 0) size = 1; tmp = realloc(ptr, size); if (!tmp) { fprintf(stderr, "out of memory\n"); exit(EXIT_FAILURE); } return tmp; } /* * "Safe" wrapper around strdup(). */ char * pg_strdup(const char *in) { char *tmp; if (!in) { fprintf(stderr, "cannot duplicate null pointer (internal error)\n"); exit(EXIT_FAILURE); } tmp = strdup(in); if (!tmp) { fprintf(stderr, "out of memory\n"); exit(EXIT_FAILURE); } return tmp; } void pg_free(void *ptr) { if (ptr != NULL) free(ptr); } /* * Frontend emulation of backend memory management functions. Useful for * programs that compile backend files. */ void * palloc(unsigned int size) { return pg_malloc(size); } void * palloc0(unsigned int size) { return pg_malloc0(size); } void pfree(void *pointer) { pg_free(pointer); } char * pstrdup(const char *in) { return pg_strdup(in); } void * repalloc(void *pointer, unsigned int size) { return pg_realloc(pointer, size); } pgpool-II-3.4.3/src/tools/Makefile.am0000664000076400007640000000002512554350605014240 00000000000000SUBDIRS = pcp pgmd5 pgpool-II-3.4.3/src/tools/pgmd5/0002775000076400007640000000000012554350620013302 500000000000000pgpool-II-3.4.3/src/tools/pgmd5/pool_config.c0000664000076400007640000043267412554350605015705 00000000000000 #line 3 "pool_config.c" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ #include #include #include #include /* end standard C headers. */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have . Non-C99 systems may or may not. */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #endif /* ! C99 */ #endif /* ! FLEXINT_H */ #ifdef __cplusplus /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ /* C99 requires __STDC__ to be defined as 1. */ #if defined (__STDC__) #define YY_USE_CONST #endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart(yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k. * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. * Ditto for the __ia64__ case accordingly. */ #define YY_BUF_SIZE 32768 #else #define YY_BUF_SIZE 16384 #endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif extern int yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ int yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void yyrestart (FILE *input_file ); void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); void yy_delete_buffer (YY_BUFFER_STATE b ); void yy_flush_buffer (YY_BUFFER_STATE b ); void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); void yypop_buffer_state (void ); static void yyensure_buffer_stack (void ); static void yy_load_buffer_state (void ); static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); void *yyalloc (yy_size_t ); void *yyrealloc (void *,yy_size_t ); void yyfree (void * ); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer(yyin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer(yyin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ #define yywrap(n) 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; typedef int yy_state_type; extern int yylineno; int yylineno = 1; extern char *yytext; #define yytext_ptr yytext static yy_state_type yy_get_previous_state (void ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); static int yy_get_next_buffer (void ); static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ yyleng = (size_t) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; #define YY_NUM_RULES 11 #define YY_END_OF_BUFFER 12 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; }; static yyconst flex_int16_t yy_accept[38] = { 0, 0, 0, 12, 10, 2, 1, 10, 10, 10, 8, 7, 7, 9, 4, 2, 0, 3, 0, 5, 0, 8, 7, 7, 8, 0, 0, 6, 4, 4, 0, 5, 0, 0, 8, 7, 6, 0 } ; static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 4, 1, 1, 1, 5, 1, 1, 1, 6, 1, 7, 8, 9, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 9, 1, 1, 12, 1, 1, 1, 13, 13, 13, 13, 14, 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 1, 16, 1, 1, 17, 1, 13, 13, 13, 13, 14, 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 18, 15, 15, 1, 1, 1, 1, 1, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15 } ; static yyconst flex_int32_t yy_meta[19] = { 0, 1, 1, 2, 1, 1, 1, 3, 3, 3, 4, 4, 1, 5, 4, 3, 1, 3, 3 } ; static yyconst flex_int16_t yy_base[45] = { 0, 0, 0, 61, 86, 58, 86, 55, 14, 23, 43, 10, 46, 86, 28, 47, 40, 86, 16, 86, 22, 28, 0, 0, 0, 40, 0, 24, 45, 0, 24, 39, 43, 12, 14, 0, 22, 86, 62, 67, 22, 70, 75, 77, 80 } ; static yyconst flex_int16_t yy_def[45] = { 0, 37, 1, 37, 37, 37, 37, 38, 39, 37, 40, 9, 9, 37, 41, 37, 38, 37, 39, 37, 42, 40, 11, 12, 21, 37, 43, 44, 41, 28, 39, 39, 42, 37, 37, 43, 44, 0, 37, 37, 37, 37, 37, 37, 37 } ; static yyconst flex_int16_t yy_nxt[105] = { 0, 4, 5, 6, 7, 8, 9, 9, 10, 4, 11, 12, 13, 14, 14, 14, 4, 14, 14, 19, 23, 19, 34, 34, 34, 34, 24, 31, 26, 19, 20, 21, 20, 22, 23, 27, 27, 27, 32, 36, 20, 36, 25, 17, 19, 29, 33, 33, 31, 15, 34, 34, 27, 27, 27, 20, 23, 25, 17, 32, 15, 37, 29, 16, 16, 16, 16, 16, 18, 37, 18, 18, 18, 28, 28, 28, 30, 37, 30, 30, 30, 35, 35, 27, 27, 27, 3, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37 } ; static yyconst flex_int16_t yy_chk[105] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8, 11, 18, 33, 33, 34, 34, 40, 20, 11, 30, 8, 9, 18, 9, 9, 14, 14, 14, 20, 36, 30, 27, 21, 16, 31, 14, 25, 25, 32, 15, 25, 25, 28, 28, 28, 31, 12, 10, 7, 32, 5, 3, 28, 38, 38, 38, 38, 38, 39, 0, 39, 39, 39, 41, 41, 41, 42, 0, 42, 42, 42, 43, 43, 44, 44, 44, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37 } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; extern int yy_flex_debug; int yy_flex_debug = 0; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "pool_config.l" /* -*-pgsql-c-*- */ /* * * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2014 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation, and that the name of the * author not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. The author makes no representations about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * * pool_config.l: read configuration file * */ #line 27 "pool_config.l" #include #include #include #include "pool.h" #include "pool_config.h" #include "utils/regex_array.h" #ifndef POOL_PRIVATE #include "utils/elog.h" #else #include "utils/fe_ports.h" #endif #define CHECK_CONTEXT(mask, context) ((mask) & (context)) /* to shut off compiler warnings */ int yylex(void); POOL_CONFIG *pool_config; /* configuration values */ POOL_SYSTEMDB_CONNECTION_POOL *system_db_info; static unsigned Lineno; static char *default_reset_query_list[] = {"ABORT", "DISCARD ALL"}; static char *default_black_function_list[] = {"nextval", "setval"}; typedef enum { POOL_KEY = 1, POOL_INTEGER, POOL_REAL, POOL_STRING, POOL_UNQUOTED_STRING, POOL_EQUALS, POOL_EOL, POOL_PARSE_ERROR } POOL_TOKEN; static char *extract_string(char *value, POOL_TOKEN token); static char **extract_string_tokens(char *str, char *delim, int *n); static void clear_host_entry(int slot); #line 558 "pool_config.c" #define INITIAL 0 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ #include #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif static int yy_init_globals (void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ int yylex_destroy (void ); int yyget_debug (void ); void yyset_debug (int debug_flag ); YY_EXTRA_TYPE yyget_extra (void ); void yyset_extra (YY_EXTRA_TYPE user_defined ); FILE *yyget_in (void ); void yyset_in (FILE * in_str ); FILE *yyget_out (void ); void yyset_out (FILE * out_str ); int yyget_leng (void ); char *yyget_text (void ); int yyget_lineno (void ); void yyset_lineno (int line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap (void ); #else extern int yywrap (void ); #endif #endif #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * ); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void ); #else static int input (void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k */ #define YY_READ_BUF_SIZE 16384 #else #define YY_READ_BUF_SIZE 8192 #endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \ } \ errno=0; \ clearerr(yyin); \ } \ }\ \ #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* end tables serialization structures and prototypes */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 extern int yylex (void); #define YY_DECL int yylex (void) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif #define YY_RULE_SETUP \ YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; #line 89 "pool_config.l" #line 746 "pool_config.c" if ( !(yy_init) ) { (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin,YY_BUF_SIZE ); } yy_load_buffer_state( ); } while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); /* Support of yytext. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = (yy_start); yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 38 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } while ( yy_current_state != 37 ); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); yy_find_action: yy_act = yy_accept[yy_current_state]; YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = (yy_hold_char); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); goto yy_find_action; case 1: /* rule 1 can match eol */ YY_RULE_SETUP #line 91 "pool_config.l" Lineno++; return POOL_EOL; YY_BREAK case 2: YY_RULE_SETUP #line 92 "pool_config.l" /* eat whitespace */ YY_BREAK case 3: *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 93 "pool_config.l" /* eat comment */ YY_BREAK case 4: YY_RULE_SETUP #line 95 "pool_config.l" return POOL_KEY; YY_BREAK case 5: YY_RULE_SETUP #line 96 "pool_config.l" return POOL_STRING; YY_BREAK case 6: YY_RULE_SETUP #line 97 "pool_config.l" return POOL_UNQUOTED_STRING; YY_BREAK case 7: YY_RULE_SETUP #line 98 "pool_config.l" return POOL_INTEGER; YY_BREAK case 8: YY_RULE_SETUP #line 99 "pool_config.l" return POOL_REAL; YY_BREAK case 9: YY_RULE_SETUP #line 100 "pool_config.l" return POOL_EQUALS; YY_BREAK case 10: YY_RULE_SETUP #line 102 "pool_config.l" return POOL_PARSE_ERROR; YY_BREAK case 11: YY_RULE_SETUP #line 104 "pool_config.l" ECHO; YY_BREAK #line 884 "pool_config.c" case YY_STATE_EOF(INITIAL): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = (yy_hold_char); YY_RESTORE_YY_MORE_OFFSET if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ yy_state_type yy_next_state; (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = (yytext_ptr) + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); goto yy_find_action; } } else switch ( yy_get_next_buffer( ) ) { case EOB_ACT_END_OF_FILE: { (yy_did_buffer_switch_on_eof) = 0; if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer (void) { register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; register char *source = (yytext_ptr); register int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = YY_CURRENT_BUFFER; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), (size_t) num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } if ( (yy_n_chars) == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart(yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); } (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state (void) { register yy_state_type yy_current_state; register char *yy_cp; yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 38 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { register int yy_is_jam; register char *yy_cp = (yy_c_buf_p); register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 38 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 37); return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) #else static int input (void) #endif { int c; *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; else { /* need more input */ int offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ yyrestart(yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( yywrap( ) ) return EOF; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + offset; break; } } } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ *(yy_c_buf_p) = '\0'; /* preserve yytext */ (yy_hold_char) = *++(yy_c_buf_p); return c; } #endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ void yyrestart (FILE * input_file ) { if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin,YY_BUF_SIZE ); } yy_init_buffer(YY_CURRENT_BUFFER,input_file ); yy_load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); * yypush_buffer_state(new_buffer); */ yyensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } YY_CURRENT_BUFFER_LVALUE = new_buffer; yy_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ (yy_did_buffer_switch_on_eof) = 1; } static void yy_load_buffer_state (void) { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * * @return the allocated buffer state. */ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; yy_init_buffer(b,file ); return b; } /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() * */ void yy_delete_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yyfree((void *) b->yy_ch_buf ); yyfree((void *) b ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; yy_flush_buffer(b ); b->yy_input_file = file; b->yy_fill_buffer = 1; /* If b is the current buffer, then yy_init_buffer was _probably_ * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } b->yy_is_interactive = 0; errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ void yy_flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * */ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; yyensure_buffer_stack(); /* This block is copied from yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * */ void yypop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ static void yyensure_buffer_stack (void) { int num_to_alloc; if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; } if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ int grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; } } /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; yy_switch_to_buffer(b ); return b; } /** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) { return yy_scan_bytes(yystr,strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) yyalloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; b = yy_scan_buffer(buf,n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif static void yy_fatal_error (yyconst char* msg ) { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = (yy_hold_char); \ (yy_c_buf_p) = yytext + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ yyleng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. * */ int yyget_lineno (void) { return yylineno; } /** Get the input stream. * */ FILE *yyget_in (void) { return yyin; } /** Get the output stream. * */ FILE *yyget_out (void) { return yyout; } /** Get the length of the current token. * */ int yyget_leng (void) { return yyleng; } /** Get the current token. * */ char *yyget_text (void) { return yytext; } /** Set the current line number. * @param line_number * */ void yyset_lineno (int line_number ) { yylineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. * * @see yy_switch_to_buffer */ void yyset_in (FILE * in_str ) { yyin = in_str ; } void yyset_out (FILE * out_str ) { yyout = out_str ; } int yyget_debug (void) { return yy_flex_debug; } void yyset_debug (int bdebug ) { yy_flex_debug = bdebug ; } static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. * This function is called from yylex_destroy(), so don't allocate here. */ (yy_buffer_stack) = 0; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; (yy_c_buf_p) = (char *) 0; (yy_init) = 0; (yy_start) = 0; /* Defined in main.c */ #ifdef YY_STDINIT yyin = stdin; yyout = stdout; #else yyin = (FILE *) 0; yyout = (FILE *) 0; #endif /* For future reference: Set errno on error, since we are called by * yylex_init() */ return 0; } /* yylex_destroy is for both reentrant and non-reentrant scanners. */ int yylex_destroy (void) { /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; yypop_buffer_state(); } /* Destroy the stack itself. */ yyfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * yylex() is called, initialization will occur. */ yy_init_globals( ); return 0; } /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif void *yyalloc (yy_size_t size ) { return (void *) malloc( size ); } void *yyrealloc (void * ptr, yy_size_t size ) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } void yyfree (void * ptr ) { free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" #line 104 "pool_config.l" int pool_init_config(void) { int res; static char localhostname[256]; int i; pool_config = palloc(sizeof(POOL_CONFIG)); memset(pool_config, 0, sizeof(POOL_CONFIG)); #ifndef POOL_PRIVATE pool_config->backend_desc = pool_shared_memory_create(sizeof(BackendDesc)); #else pool_config->backend_desc = palloc(sizeof(BackendDesc)); #endif /* * add for watchdog */ pool_config->other_wd = palloc0(sizeof(WdDesc)); /* set hardcoded default values */ pool_config->listen_addresses = "localhost"; pool_config->pcp_listen_addresses = "*"; pool_config->port = 9999; pool_config->pcp_port = 9898; pool_config->socket_dir = DEFAULT_SOCKET_DIR; pool_config->pcp_socket_dir = DEFAULT_SOCKET_DIR; pool_config->backend_socket_dir = NULL; pool_config->pcp_timeout = 10; pool_config->num_init_children = 32; pool_config->listen_backlog_multiplier = 2; pool_config->max_pool = 4; pool_config->child_life_time = 300; pool_config->client_idle_limit = 0; pool_config->connection_life_time = 0; pool_config->child_max_connections = 0; pool_config->authentication_timeout = 60; pool_config->logdir = DEFAULT_LOGDIR; pool_config->logsyslog = 0; pool_config->log_destination = "stderr"; pool_config->syslog_facility = LOG_LOCAL0; pool_config->syslog_ident = "pgpool"; pool_config->pid_file_name = DEFAULT_PID_FILE_NAME; pool_config->log_statement = 0; pool_config->log_per_node_statement = 0; pool_config->log_connections = 0; pool_config->log_hostname = 0; pool_config->enable_pool_hba = 0; pool_config->pool_passwd = "pool_passwd"; pool_config->replication_mode = 0; pool_config->load_balance_mode = 0; pool_config->replication_stop_on_mismatch = 0; pool_config->failover_if_affected_tuples_mismatch = 0; pool_config->replicate_select = 0; pool_config->reset_query_list = default_reset_query_list; pool_config->num_reset_queries = sizeof(default_reset_query_list)/sizeof(char *); pool_config->white_function_list = NULL; pool_config->num_white_function_list = 0; pool_config->black_function_list = default_black_function_list; pool_config->num_black_function_list = sizeof(default_black_function_list)/sizeof(char *); pool_config->log_line_prefix = ""; pool_config->log_error_verbosity = 1; /* PGERROR_DEFAULT */ pool_config->client_min_messages = 18; /* NOTICE */ pool_config->log_min_messages = 19; /* WARNING */ pool_config->master_slave_mode = 0; pool_config->master_slave_sub_mode = "slony"; pool_config->delay_threshold = 0; pool_config->log_standby_delay = "none"; pool_config->connection_cache = 1; pool_config->health_check_timeout = 20; pool_config->health_check_period = 0; pool_config->health_check_user = "nobody"; pool_config->health_check_password = ""; pool_config->health_check_max_retries = 0; pool_config->health_check_retry_delay = 1; pool_config->connect_timeout = 10000; pool_config->sr_check_period = 0; pool_config->sr_check_user = "nobody"; pool_config->sr_check_password = ""; pool_config->failover_command = ""; pool_config->follow_master_command = ""; pool_config->failback_command = ""; pool_config->fail_over_on_backend_error = 1; pool_config->insert_lock = 1; pool_config->ignore_leading_white_space = 1; pool_config->parallel_mode = 0; pool_config->system_db_hostname = "localhost"; pool_config->system_db_port = 5432; pool_config->system_db_dbname = "pgpool"; pool_config->system_db_schema = "pgpool_catalog"; pool_config->system_db_user = "pgpool"; pool_config->system_db_password = ""; pool_config->backend_desc->num_backends = 0; pool_config->recovery_user = ""; pool_config->recovery_password = ""; pool_config->recovery_1st_stage_command = ""; pool_config->recovery_2nd_stage_command = ""; pool_config->recovery_timeout = 90; pool_config->search_primary_node_timeout = 10; pool_config->client_idle_limit_in_recovery = 0; pool_config->lobj_lock_table = ""; pool_config->ssl = 0; pool_config->ssl_cert = ""; pool_config->ssl_key = ""; pool_config->ssl_ca_cert = ""; pool_config->ssl_ca_cert_dir = ""; pool_config->debug_level = 0; pool_config->relcache_expire = 0; pool_config->relcache_size = 256; pool_config->check_temp_table = 1; pool_config->check_unlogged_table = 1; pool_config->lists_patterns = NULL; pool_config->pattc = 0; pool_config->current_pattern_size = 0; /* * database_redirect_preference_list */ pool_config->database_redirect_preference_list = NULL; pool_config->redirect_dbnames = NULL; pool_config->db_redirect_tokens = NULL; /* * app_name_redirect_preference_list */ pool_config->app_name_redirect_preference_list = NULL; pool_config->redirect_app_names = NULL; pool_config->app_name_redirect_tokens = NULL; pool_config->allow_sql_comments = 0; /* * add for watchdog */ pool_config->use_watchdog = 0; pool_config->wd_lifecheck_method = MODE_HEARTBEAT; pool_config->clear_memqcache_on_escalation = 1; pool_config->wd_escalation_command = ""; pool_config->trusted_servers = ""; pool_config->delegate_IP = ""; res = gethostname(localhostname,sizeof(localhostname)); if(res !=0 ) { ereport(DEBUG1, (errmsg("initializing pool configuration"), errdetail("failed to get the local hostname"))); } pool_config->wd_hostname = localhostname; pool_config->wd_port = 9000; pool_config->other_wd->num_wd = 0; pool_config->wd_interval = 10; pool_config->wd_authkey = ""; pool_config->ping_path = "/bin"; pool_config->ifconfig_path = "/sbin"; pool_config->if_up_cmd = "ifconfig eth0:0 inet $_IP_$ netmask 255.255.255.0"; pool_config->if_down_cmd = "ifconfig eth0:0 down"; pool_config->arping_path = "/usr/sbin"; pool_config->arping_cmd = "arping -U $_IP_$ -w 1"; pool_config->wd_life_point = 3; pool_config->wd_lifecheck_query = "SELECT 1"; pool_config->wd_lifecheck_dbname = "template1"; pool_config->wd_lifecheck_user = "nobody"; pool_config->wd_lifecheck_password = ""; pool_config->wd_heartbeat_port = 9694; pool_config->wd_heartbeat_keepalive = 2; pool_config->wd_heartbeat_deadtime = 30; pool_config->num_hb_if = 0; pool_config->memory_cache_enabled = 0; pool_config->memqcache_method = "shmem"; pool_config->memqcache_memcached_host = "localhost"; pool_config->memqcache_memcached_port = 11211; pool_config->memqcache_total_size = 67108864; pool_config->memqcache_max_num_cache = 1000000; pool_config->memqcache_expire = 0; pool_config->memqcache_auto_cache_invalidation = 1; pool_config->memqcache_maxcache = 409600; pool_config->memqcache_cache_block_size = 1048576; pool_config->memqcache_oiddir = "/var/log/pgpool/oiddir"; pool_config->white_memqcache_table_list = NULL; pool_config->num_white_memqcache_table_list = 0; pool_config->black_memqcache_table_list = NULL; pool_config->num_black_memqcache_table_list = 0; pool_config->lists_memqcache_table_patterns = NULL; pool_config->memqcache_table_pattc = 0; pool_config->current_memqcache_table_pattern_size = 0; res = gethostname(localhostname,sizeof(localhostname)); if(res !=0 ) { ereport(DEBUG1, (errmsg("initializing pool configuration"), errdetail("failed to get the local hostname"))); } pool_config->pgpool2_hostname = localhostname; for (i=0;ipattc == pool_config->current_pattern_size) { pool_config->current_pattern_size += PATTERN_ARR_SIZE; _tmp = repalloc(pool_config->lists_patterns, (pool_config->current_pattern_size * sizeof(RegPattern))); if (!_tmp) { return(-1); } pool_config->lists_patterns = (RegPattern*)_tmp; } pool_config->lists_patterns[pool_config->pattc] = item; pool_config->pattc++; return(pool_config->pattc); } int growMemqcacheTablePatternArray(RegPattern item) { void *_tmp = NULL; if (pool_config->memqcache_table_pattc == pool_config->current_memqcache_table_pattern_size) { pool_config->current_memqcache_table_pattern_size += PATTERN_ARR_SIZE; _tmp = repalloc(pool_config->lists_memqcache_table_patterns, (pool_config->current_memqcache_table_pattern_size * sizeof(RegPattern))); if (!_tmp) { return(-1); } pool_config->lists_memqcache_table_patterns = (RegPattern*)_tmp; } pool_config->lists_memqcache_table_patterns[pool_config->memqcache_table_pattc] = item; pool_config->memqcache_table_pattc++; return(pool_config->memqcache_table_pattc); } int pool_get_config(char *confpath, POOL_CONFIG_CONTEXT context) { FILE *fd; int token; char key[1024]; double total_weight; int i; int error_level; bool log_destination_changed = false; #ifdef USE_MEMCACHED bool use_memcached = true; #else bool use_memcached = false; #endif if(CHECK_CONTEXT(INIT_CONFIG, context)) error_level = ERROR; else error_level = WARNING; #define PARSE_ERROR() ereport(CHECK_CONTEXT(INIT_CONFIG, context)?ERROR:WARNING, \ (errmsg("syntex error in configuration file \"%s\"",POOL_CONF_FILE_NAME), \ errdetail("parse error at line %d '%s'", Lineno, yytext))) /* open config file */ fd = fopen(confpath, "r"); if (!fd) { ereport(WARNING, (errmsg("could not open configuration file: \"%s\"\n",POOL_CONF_FILE_NAME), errdetail("using default configuration parameter values"))); return 0; } yyin = fd; Lineno = 1; for(;;) { token = yylex(); if (token == 0) { break; } if (token == POOL_PARSE_ERROR) { PARSE_ERROR(); fclose(fd); return(-1); } if (token == POOL_EOL) continue; if (token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } strlcpy(key, yytext, sizeof(key)); ereport(DEBUG5, (errmsg("key: %s", key))); token = yylex(); if (token == POOL_EQUALS) token = yylex(); ereport(DEBUG5, (errmsg("value: %s kind: %d", yytext, token))); if (!strcmp(key, "allow_inet_domain_socket") && CHECK_CONTEXT(INIT_CONFIG, context)) { /* for backward compatibility */ int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"",yytext,key))); return(-1); } if (v) pool_config->listen_addresses = pstrdup("*"); else pool_config->listen_addresses = pstrdup(""); } else if (!strcmp(key, "listen_addresses") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->listen_addresses = str; } else if (!strcmp(key, "port") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 1024) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\". %s must be >= 1024",yytext,key, key))); return(-1); } pool_config->port = v; } else if (!strcmp(key, "pcp_listen_addresses") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->pcp_listen_addresses = str; } else if (!strcmp(key, "pcp_port") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 1024) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\". %s must be >= 1024",yytext,key, key))); return(-1); } pool_config->pcp_port = v; } else if (!strcmp(key, "socket_dir") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->socket_dir = str; } else if (!strcmp(key, "pcp_socket_dir") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->pcp_socket_dir = str; } else if (!strcmp(key, "pcp_timeout") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\". %s must be >= 0",yytext,key, key))); return(-1); } pool_config->pcp_timeout = v; } else if (!strcmp(key, "num_init_children") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 1) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\". %s must be >= 1",yytext,key, key))); return(-1); } pool_config->num_init_children = v; } else if (!strcmp(key, "listen_backlog_multiplier") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 1) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\". %s must be >= 1",yytext,key, key))); return(-1); } pool_config->listen_backlog_multiplier = v; } else if (!strcmp(key, "child_life_time") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\". %s must be >= 0",yytext,key, key))); return(-1); } pool_config->child_life_time = v; } else if (!strcmp(key, "client_idle_limit") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\". %s must be >= 0",yytext,key, key))); return(-1); } pool_config->client_idle_limit = v; } else if (!strcmp(key, "connection_life_time") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\". %s must be >= 0",yytext,key, key))); return(-1); } pool_config->connection_life_time = v; } else if (!strcmp(key, "child_max_connections") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\". %s must be >= 0",yytext,key, key))); return(-1); } pool_config->child_max_connections = v; } else if (!strcmp(key, "authentication_timeout") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\". %s must be >= 0",yytext,key, key))); return(-1); } pool_config->authentication_timeout = v; } else if (!strcmp(key, "max_pool") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\". %s must be >= 0",yytext,key, key))); return(-1); } pool_config->max_pool = v; } else if (!strcmp(key, "logdir") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->logdir = str; } else if (!strcmp(key, "log_destination") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } log_destination_changed = pool_config->log_destination != str; pool_config->log_destination = str; } else if (!strcmp(key, "syslog_facility") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->syslog_facility = set_syslog_facility(str); } else if (!strcmp(key, "syslog_ident") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } log_destination_changed = log_destination_changed || pool_config->syslog_ident != str; pool_config->syslog_ident = str; } else if (!strcmp(key, "pid_file_name") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->pid_file_name = str; } else if (!strcmp(key, "log_connections") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"",yytext,key))); return(-1); } pool_config->log_connections = v; } else if (!strcmp(key, "log_hostname") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"",yytext,key))); return(-1); } pool_config->log_hostname = v; } else if (!strcmp(key, "enable_pool_hba") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"",yytext,key))); return(-1); } pool_config->enable_pool_hba = v; } else if (!strcmp(key, "pool_passwd") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->pool_passwd = str; } else if (!strcmp(key, "backend_socket_dir") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; ereport(LOG, (errmsg("initializing pool configuration: backend_socket_dir is deprecated"), errdetail("please use backend_hostname instead"))); if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->backend_socket_dir = str; } else if (!strcmp(key, "replication_mode") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"",yytext,key))); return(-1); } pool_config->replication_mode = v; if (pool_config->master_slave_mode && pool_config->replication_mode) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("replication_mode and master_slave_mode cannot be enabled at the same time"))); return(-1); } } else if (!strcmp(key, "load_balance_mode") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"",yytext,key))); return(-1); } pool_config->load_balance_mode = v; } else if (!strcmp(key, "replication_stop_on_mismatch") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"",yytext,key))); return(-1); } ereport(DEBUG1, (errmsg("initializing pool configuration"), errdetail("replication_stop_on_mismatch: %d", v))); pool_config->replication_stop_on_mismatch = v; } else if (!strcmp(key, "failover_if_affected_tuples_mismatch") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"",yytext,key))); return(-1); } ereport(DEBUG1, (errmsg("initializing pool configuration"), errdetail("failover_if_affected_tuples_mismatch: %d", v))); pool_config->failover_if_affected_tuples_mismatch = v; } else if (!strcmp(key, "replicate_select") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"",yytext,key))); return(-1); } ereport(DEBUG1, (errmsg("initializing pool configuration"), errdetail("replicate_select: %d", v))); pool_config->replicate_select = v; } else if (!strcmp(key, "reset_query_list") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->reset_query_list = extract_string_tokens(str, ";", &pool_config->num_reset_queries); if (pool_config->reset_query_list == NULL) { fclose(fd); return(-1); } } else if (!strcmp(key, "white_function_list") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->white_function_list = extract_string_tokens(str, ",", &pool_config->num_white_function_list); if (pool_config->white_function_list == NULL) { fclose(fd); return(-1); } for (i=0;inum_white_function_list;i++) { add_regex_pattern("white_function_list", pool_config->white_function_list[i]); } } else if (!strcmp(key, "black_function_list") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->black_function_list = extract_string_tokens(str, ",", &pool_config->num_black_function_list); if (pool_config->black_function_list == NULL) { fclose(fd); return(-1); } for (i=0;inum_black_function_list;i++) { add_regex_pattern("black_function_list", pool_config->black_function_list[i]); } } else if (!strcmp(key, "log_error_verbosity") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str, *valid_val; int i; const char *ordered_valid_values[] = {"terse","default","verbose",NULL}; bool found = false; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } for(i=0; ; i++) { valid_val = (char*)ordered_valid_values[i]; if(!valid_val) break; if (!strcasecmp(str, valid_val)) { found = true; pool_config->log_error_verbosity = i; break; } } if (!found) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"",yytext,key))); return(-1); } } else if (!strcmp(key, "client_min_messages") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str, *valid_val; int i; const char *ordered_valid_values[] = {"debug5","debug4","debug3","debug2","debug1","log","commerror","info","notice","warning","error",NULL}; bool found = false; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } for(i=0; ; i++) { valid_val = (char*)ordered_valid_values[i]; if(!valid_val) break; if (!strcasecmp(str, valid_val)) { found = true; pool_config->client_min_messages = i + 10; break; } } if (!found) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"",yytext,key))); return(-1); } } else if (!strcmp(key, "log_min_messages") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str, *valid_val; int i; const char *ordered_valid_values[] = {"debug5","debug4","debug3","debug2","debug1","log","commerror","info","notice","warning","error","fatal","panic",NULL}; bool found = false; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } for(i=0; ; i++) { valid_val = (char*)ordered_valid_values[i]; if(!valid_val) break; if (!strcasecmp(str, valid_val)) { found = true; pool_config->log_min_messages = i + 10; /* error codes start with 10 */ break; } } if (!found) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"",yytext,key))); return(-1); } } else if (!strcmp(key, "log_line_prefix") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->log_line_prefix = str; } else if (!strcmp(key, "print_timestamp") && CHECK_CONTEXT(INIT_CONFIG, context)) { ereport(NOTICE, (errmsg("configuration key \"%s\" is not supported anymore",key), errdetail("please use \"log_line_prefix\" instead"))); } else if (!strcmp(key, "print_user") && CHECK_CONTEXT(INIT_CONFIG, context)) { ereport(NOTICE, (errmsg("configuration key \"%s\" is not supported anymore",key), errdetail("please use \"log_line_prefix\" instead"))); } else if (!strcmp(key, "master_slave_mode") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"",yytext,key))); return(-1); } pool_config->master_slave_mode = v; if (pool_config->master_slave_mode && pool_config->replication_mode) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("replication_mode and master_slave_mode cannot be enabled at the same time"))); return(-1); } } else if (!strcmp(key, "master_slave_sub_mode") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if (strcmp(str, MODE_SLONY) && strcmp(str, MODE_STREAMREP)) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("allowed values for configuration parameter %s can be either \"slony\" or \"stream\"", key))); return(-1); } pool_config->master_slave_sub_mode = str; } else if (!strcmp(key, "delay_threshold") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { long long int v = atol(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\". %s must be >= 0",yytext,key, key))); return(-1); } pool_config->delay_threshold = v; } else if (!strcmp(key, "log_standby_delay") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if (strcmp(str, "always") && strcmp(str, "if_over_threshold") && strcmp(str, "none")) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("allowed values are: \"always\", \"if_over_threshold\" and \"none\""))); return(-1); } pool_config->log_standby_delay = str; } else if (!strcmp(key, "connection_cache") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key))); return(-1); } pool_config->connection_cache = v; } else if (!strcmp(key, "health_check_timeout") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->health_check_timeout = v; } else if (!strcmp(key, "health_check_period") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->health_check_period = v; } else if (!strcmp(key, "health_check_user") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->health_check_user = str; } else if (!strcmp(key, "health_check_password") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->health_check_password = str; } else if (!strcmp(key, "health_check_max_retries") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->health_check_max_retries = v; } else if (!strcmp(key, "health_check_retry_delay") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->health_check_retry_delay = v; } else if (!strcmp(key, "connect_timeout") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->connect_timeout = v; } else if (!strcmp(key, "sr_check_period") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->sr_check_period = v; } else if (!strcmp(key, "sr_check_user") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->sr_check_user = str; } else if (!strcmp(key, "sr_check_password") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->sr_check_password = str; } else if (!strcmp(key, "failover_command") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->failover_command = str; } else if (!strcmp(key, "follow_master_command") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->follow_master_command = str; } else if (!strcmp(key, "failback_command") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->failback_command = str; } else if (!strcmp(key, "fail_over_on_backend_error") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key))); return(-1); } pool_config->fail_over_on_backend_error = v; } else if (!strcmp(key, "recovery_user") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->recovery_user = str; } else if (!strcmp(key, "recovery_password") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->recovery_password = str; } else if (!strcmp(key, "recovery_1st_stage_command") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->recovery_1st_stage_command = str; } else if (!strcmp(key, "recovery_2nd_stage_command") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->recovery_2nd_stage_command = str; } else if (!strcmp(key, "recovery_timeout") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->recovery_timeout = v; } else if (!strcmp(key, "search_primary_node_timeout") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->search_primary_node_timeout = v; } else if (!strcmp(key, "client_idle_limit_in_recovery") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < -1) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->client_idle_limit_in_recovery = v; } else if (!strcmp(key, "insert_lock") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->insert_lock = v; } else if (!strcmp(key, "ignore_leading_white_space") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->ignore_leading_white_space = v; } else if (!strcmp(key, "parallel_mode") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->parallel_mode = v; } else if (!strcmp(key, "pgpool2_hostname") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if(strlen(str)) pool_config->pgpool2_hostname = str; } else if (!strcmp(key, "system_db_hostname") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->system_db_hostname = str; } else if (!strcmp(key, "system_db_port") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->system_db_port = v; } else if (!strcmp(key, "system_db_dbname") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->system_db_dbname = str; } else if (!strcmp(key, "system_db_schema") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->system_db_schema = str; } else if (!strcmp(key, "system_db_user") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->system_db_user = str; } else if (!strcmp(key, "system_db_password") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->system_db_password = str; } else if (!strncmp(key, "backend_hostname", 16) && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context) && mypid == getpid()) /* this parameter must be modified by parent pid */ { int slot; char *str; slot = atoi(key + 16); if (slot < 0 || slot >= MAX_CONNECTION_SLOTS) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid slot no :\"%d\" for key:\"%s\"", slot,key), errhint("backend number must be between 0 and %d inclusive",MAX_CONNECTION_SLOTS))); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if (context == INIT_CONFIG || (context == RELOAD_CONFIG && BACKEND_INFO(slot).backend_status == CON_UNUSED)) strlcpy(BACKEND_INFO(slot).backend_hostname, str, MAX_DB_HOST_NAMELEN); } else if (!strncmp(key, "backend_port", 12) && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context) && mypid == getpid()) /* this parameter must be modified by parent pid */ { int slot; slot = atoi(key + 12); if (slot < 0 || slot >= MAX_CONNECTION_SLOTS) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid slot no :\"%d\" for key:\"%s\"", slot,key), errhint("backend port slot must be between 0 and %d inclusive",MAX_CONNECTION_SLOTS))); return(-1); } ereport(DEBUG1, (errmsg("initializing pool configuration"), errdetail("backend port slot number %d port: %d ", slot,atoi(yytext)))); if (context == INIT_CONFIG) { BACKEND_INFO(slot).backend_port = atoi(yytext); BACKEND_INFO(slot).backend_status = CON_CONNECT_WAIT; } else if (context == RELOAD_CONFIG && BACKEND_INFO(slot).backend_status == CON_UNUSED) { BACKEND_INFO(slot).backend_port = atoi(yytext); BACKEND_INFO(slot).backend_status = CON_DOWN; } } else if (!strncmp(key, "backend_weight", 14) && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context) && mypid == getpid()) /* this parameter must be modified by parent pid */ { int slot; double v; slot = atoi(key + 14); if (slot < 0 || slot >= MAX_CONNECTION_SLOTS) { fclose(fd); fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid slot no :\"%d\" for key:\"%s\"", slot,key), errhint("backend weight slot must be between 0 and %d inclusive",MAX_CONNECTION_SLOTS))); return(-1); } v = atof(yytext); if (v < 0.0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0.0"))); return(-1); } ereport(DEBUG1, (errmsg("initializing pool configuration"), errdetail("weight slot number %d weight: %f", slot, v))); if (context == INIT_CONFIG || context == RELOAD_CONFIG) { double old_v = BACKEND_INFO(slot).unnormalized_weight; BACKEND_INFO(slot).unnormalized_weight = v; /* * Log weight change event only when context is * reloading of pgpool.conf and weight is actually * changed */ if (context == RELOAD_CONFIG && old_v != v) { ereport(LOG, (errmsg("initializing pool configuration: backend weight for backend:%d changed from %f to %f", slot, old_v, v), errdetail("This change will be effective from next client session"))); } } } else if (!strncmp(key, "backend_data_directory", 22) && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context) && mypid == getpid()) /* this parameter must be modified by parent pid */ { int slot; char *str; BACKEND_STATUS status; slot = atoi(key + 22); if (slot < 0 || slot >= MAX_CONNECTION_SLOTS) { fclose(fd); fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid slot no :\"%d\" for key:\"%s\"", slot,key), errhint("backend data directory slot must be between 0 and %d inclusive",MAX_CONNECTION_SLOTS))); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } status = BACKEND_INFO(slot).backend_status; if (context == INIT_CONFIG || (context == RELOAD_CONFIG && (status == CON_UNUSED || status == CON_DOWN))) strlcpy(BACKEND_INFO(slot).backend_data_directory, str, MAX_PATH_LENGTH); } else if (!strncmp(key, "backend_flag", 12) && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context) && mypid == getpid()) /* this parameter must be modified by parent pid */ { char *str; char **flags; int n; int i; int slot; unsigned short flag = 0; bool allow_to_failover_is_specified = 0; bool disallow_to_failover_is_specified = 0; str = extract_string(yytext, token); if (str == NULL) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("extract_string failed: %s", yytext))); return(-1); } flags = extract_string_tokens(str, "|", &n); if (!flags || n < 0) { ereport(DEBUG1, (errmsg("initializing pool configuration"), errdetail("unable to get backend flags"))); fclose(fd); return(-1); } for (i=0;i= MAX_CONNECTION_SLOTS) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid slot no :\"%d\" for key:\"%s\"", slot,key), errhint("slot must be between 0 and %d inclusive",MAX_CONNECTION_SLOTS))); return(-1); } BACKEND_INFO(slot).flag = flag; ereport(DEBUG1, (errmsg("initializing pool configuration"), errdetail("backend slot number %d flag: %04x", slot, flag))); } else if (!strcmp(key, "log_statement") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->log_statement = v; } else if (!strcmp(key, "log_per_node_statement") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->log_per_node_statement = v; } else if (!strcmp(key, "lobj_lock_table") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->lobj_lock_table = str; } /* * add for watchdog */ else if (!strncmp(key, "other_pgpool_hostname", 21) && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context) && mypid == getpid()) /* this parameter must be modified by parent pid */ { int slot; char *str; slot = atoi(key + 21) ; if (slot < 0 || slot >= MAX_CONNECTION_SLOTS) { fclose(fd); fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid slot no :\"%d\" for key:\"%s\"", slot,key), errhint("slot must be between 0 and %d inclusive",MAX_CONNECTION_SLOTS))); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if (context == INIT_CONFIG || (context == RELOAD_CONFIG )) strlcpy(WD_INFO(slot).hostname, str, WD_MAX_HOST_NAMELEN); } else if (!strncmp(key, "other_pgpool_port", 17) && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context) && mypid == getpid()) /* this parameter must be modified by parent pid */ { int slot; slot = atoi(key + 17); if (slot < 0 || slot >= MAX_CONNECTION_SLOTS) { fclose(fd); fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid slot no :\"%d\" for key:\"%s\"", slot,key), errhint("slot must be between 0 and %d inclusive",MAX_CONNECTION_SLOTS))); return(-1); } if (context == INIT_CONFIG || (context == RELOAD_CONFIG )) WD_INFO(slot).pgpool_port = atoi(yytext); } else if (!strncmp(key, "other_wd_port", 13) && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context) && mypid == getpid()) /* this parameter must be modified by parent pid */ { int slot; slot = atoi(key + 13); if (slot < 0 || slot >= MAX_CONNECTION_SLOTS) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid slot no :\"%d\" for key:\"%s\"", slot,key), errhint("slot must be between 0 and %d inclusive",MAX_CONNECTION_SLOTS))); return(-1); } if (context == INIT_CONFIG || (context == RELOAD_CONFIG )) { WD_INFO(slot).wd_port = atoi(yytext); WD_INFO(slot).status = WD_INIT; pool_config->other_wd->num_wd = slot + 1; } } else if (!strcmp(key, "use_watchdog") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->use_watchdog = v; } else if (!strcmp(key, "clear_memqcache_on_escalation") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->clear_memqcache_on_escalation = v; } else if (!strcmp(key, "wd_escalation_command") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->wd_escalation_command = str; } else if (!strcmp(key, "trusted_servers") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if(strlen(str)) pool_config->trusted_servers = str; } else if (!strcmp(key, "delegate_IP") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if(strlen(str)) pool_config->delegate_IP = str; } else if (!strcmp(key, "wd_hostname") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if(strlen(str)) pool_config->wd_hostname = str; } else if (!strcmp(key, "wd_port") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v <= 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than 0"))); return(-1); } pool_config->wd_port = v; } else if (!strcmp(key, "wd_interval") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v <= 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than 0"))); return(-1); } pool_config->wd_interval = v; } else if (!strcmp(key, "ping_path") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if(strlen(str)) pool_config->ping_path = str; } else if (!strcmp(key, "ifconfig_path") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if(strlen(str)) pool_config->ifconfig_path = str; } else if (!strcmp(key, "if_up_cmd") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if(strlen(str)) pool_config->if_up_cmd = str; } else if (!strcmp(key, "if_down_cmd") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if(strlen(str)) pool_config->if_down_cmd = str; } else if (!strcmp(key, "arping_path") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if(strlen(str)) pool_config->arping_path = str; } else if (!strcmp(key, "arping_cmd") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if(strlen(str)) pool_config->arping_cmd = str; } else if (!strcmp(key, "wd_life_point") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v <= 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than 0"))); return(-1); } pool_config->wd_life_point = v; } else if (!strcmp(key, "wd_lifecheck_query") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if(strlen(str)) pool_config->wd_lifecheck_query = str; } else if (!strcmp(key, "wd_lifecheck_dbname") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->wd_lifecheck_dbname = str; } else if (!strcmp(key, "wd_lifecheck_user") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->wd_lifecheck_user = str; } else if (!strcmp(key, "wd_lifecheck_password") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->wd_lifecheck_password = str; } else if (!strcmp(key, "wd_lifecheck_method") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if (strcmp(str, MODE_HEARTBEAT) && strcmp(str, MODE_QUERY)) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("allowed values for configuration parameter %s can be either \"heartbeat\" or \"query\"", key))); return(-1); } pool_config->wd_lifecheck_method = str; } else if (!strcmp(key, "wd_heartbeat_port") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v <= 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than 0"))); return(-1); } pool_config->wd_heartbeat_port = v; } else if (!strcmp(key, "wd_heartbeat_keepalive") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v <= 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than 0"))); return(-1); } pool_config->wd_heartbeat_keepalive = v; } else if (!strcmp(key, "wd_heartbeat_deadtime") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v <= 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than 0"))); return(-1); } pool_config->wd_heartbeat_deadtime = v; } else if (!strcmp(key, "wd_authkey") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->wd_authkey = str; } else if (!strncmp(key, "heartbeat_device", 16) && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context) && mypid == getpid()) /* this parameter must be modified by parent pid */ { int slot; char *str; slot = atoi(key + 16) ; if (slot < 0 || slot >= WD_MAX_IF_NUM) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid slot no :\"%d\" for key:\"%s\"", slot,key), errhint("slot must be between 0 and %d inclusive",MAX_CONNECTION_SLOTS))); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if (context == INIT_CONFIG || (context == RELOAD_CONFIG )) strlcpy(WD_HB_IF(slot).if_name, str, WD_MAX_IF_NAME_LEN); } /* this must be prior to hertbeat_destination */ else if (!strncmp(key, "heartbeat_destination_port", 26) && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context) && mypid == getpid()) /* this parameter must be modified by parent pid */ { int slot; slot = atoi(key + 26) ; if (slot < 0 || slot >= WD_MAX_IF_NUM) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid slot no :\"%d\" for key:\"%s\"", slot,key), errhint("slot must be between 0 and %d inclusive",MAX_CONNECTION_SLOTS))); return(-1); } if (context == INIT_CONFIG || (context == RELOAD_CONFIG )) { WD_HB_IF(slot).dest_port = atoi(yytext); pool_config->num_hb_if = slot + 1; } } else if (!strncmp(key, "heartbeat_destination", 21) && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context) && mypid == getpid()) /* this parameter must be modified by parent pid */ { int slot; char *str; slot = atoi(key + 21) ; if (slot < 0 || slot >= WD_MAX_IF_NUM) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid slot no :\"%d\" for key:\"%s\"", slot,key), errhint("slot must be between 0 and %d inclusive",MAX_CONNECTION_SLOTS))); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if (context == INIT_CONFIG || (context == RELOAD_CONFIG )) strlcpy(WD_HB_IF(slot).addr, str, WD_MAX_HOST_NAMELEN); } else if (!strcmp(key, "ssl") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key))); return(-1); } pool_config->ssl = v; } else if (!strcmp(key, "ssl_cert") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->ssl_cert = str; } else if (!strcmp(key, "ssl_key") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->ssl_key = str; } else if (!strcmp(key, "ssl_ca_cert") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->ssl_ca_cert = str; } else if (!strcmp(key, "ssl_ca_cert_dir") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->ssl_ca_cert_dir = str; } else if (!strcmp(key, "debug_level") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } /* Consider -d option value stored in pool_config already */ pool_config->debug_level |= v; } else if (!strcmp(key, "relcache_expire") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->relcache_expire = v; } else if (!strcmp(key, "relcache_size") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 1) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 1"))); return(-1); } pool_config->relcache_size = v; } else if (!strcmp(key, "check_temp_table") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key))); return(-1); } pool_config->check_temp_table = v; } else if (!strcmp(key, "check_unlogged_table") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key))); return(-1); } pool_config->check_unlogged_table = v; } else if (!strcmp(key, "memory_cache_enabled") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key))); return(-1); } pool_config->memory_cache_enabled = v; } else if (!strcmp(key, "memqcache_method") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if (!strcmp(str, "memcached") && !use_memcached) { fclose(fd); ereport(error_level, (errmsg("invalid configuration, Feature Not available"), errdetail("invalid value:\"%s\" for key:\"%s\", memcached not available because pgpool-II is not built with MEMCACHED support", yytext,key))); return -1; } if (strcmp(str, "memcached") && strcmp(str, "shmem")) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("allowed values for configuration parameter %s can be either \"shmem\" or \"memcached\"", str))); return -1; } pool_config->memqcache_method = str; } else if (!strcmp(key, "memqcache_memcached_host") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->memqcache_memcached_host = str; } else if (!strcmp(key, "memqcache_memcached_port") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->memqcache_memcached_port = v; } else if (!strcmp(key, "memqcache_total_size") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->memqcache_total_size = v; } else if (!strcmp(key, "memqcache_max_num_cache") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal 0"))); return(-1); } pool_config->memqcache_max_num_cache = v; } else if (!strcmp(key, "memqcache_expire") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal 0"))); return(-1); } pool_config->memqcache_expire = v; } else if (!strcmp(key, "memqcache_auto_cache_invalidation") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key))); return(-1); } pool_config->memqcache_auto_cache_invalidation = v; } else if (!strcmp(key, "memqcache_maxcache") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal 0"))); return(-1); } pool_config->memqcache_maxcache = v; } else if (!strcmp(key, "memqcache_cache_block_size") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 512) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 512"))); return(-1); } pool_config->memqcache_cache_block_size = v; } else if (!strcmp(key, "memqcache_oiddir") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->memqcache_oiddir = str; } else if (!strcmp(key, "white_memqcache_table_list") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->white_memqcache_table_list = extract_string_tokens(str, ",", &pool_config->num_white_memqcache_table_list); if (pool_config->white_memqcache_table_list == NULL) { fclose(fd); return(-1); } for (i=0;inum_white_memqcache_table_list;i++) { add_regex_pattern("white_memqcache_table_list", pool_config->white_memqcache_table_list[i]); } } else if (!strcmp(key, "black_memqcache_table_list") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->black_memqcache_table_list = extract_string_tokens(str, ",", &pool_config->num_black_memqcache_table_list); if (pool_config->black_memqcache_table_list == NULL) { fclose(fd); return(-1); } for (i=0;inum_black_memqcache_table_list;i++) { add_regex_pattern("black_memqcache_table_list", pool_config->black_memqcache_table_list[i]); } } else if (!strcmp(key, "database_redirect_preference_list") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; int i; Left_right_tokens *lrtokens; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->database_redirect_preference_list = str; lrtokens = create_lrtoken_array(); extract_string_tokens2(str, ",", ':', lrtokens); pool_config->redirect_dbnames = create_regex_array(); pool_config->db_redirect_tokens = lrtokens; for (i=0;ipos;i++) { if (add_regex_array(pool_config->redirect_dbnames, lrtokens->token[i].left_token)) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("wrong redirect dbname regular expression: \"%s\"", lrtokens->token[i].left_token))); return(-1); } } } else if (!strcmp(key, "app_name_redirect_preference_list") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; int i; Left_right_tokens *lrtokens; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->app_name_redirect_preference_list = str; lrtokens = create_lrtoken_array(); extract_string_tokens2(str, ",", ':', lrtokens); pool_config->redirect_app_names = create_regex_array(); pool_config->app_name_redirect_tokens = lrtokens; for (i=0;ipos;i++) { if (add_regex_array(pool_config->redirect_app_names, lrtokens->token[i].left_token)) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("wrong redirect dbname regular expression: \"%s\"", lrtokens->token[i].left_token))); return(-1); } } } else if (!strcmp(key, "allow_sql_comments") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->allow_sql_comments = v; } } fclose(fd); if (log_destination_changed) { /* log_destination has changed, we need to open syslog or close it */ if (!strcmp(pool_config->log_destination, "stderr")) { closelog(); pool_config->logsyslog = 0; } else { openlog(pool_config->syslog_ident, LOG_PID|LOG_NDELAY|LOG_NOWAIT, pool_config->syslog_facility); pool_config->logsyslog = 1; } } pool_config->backend_desc->num_backends = 0; total_weight = 0.0; for (i=0;ibackend_desc->num_backends = i+1; /* initialize backend_hostname with a default socket path if empty */ if (*(BACKEND_INFO(i).backend_hostname) == '\0') { if (pool_config->backend_socket_dir == NULL) { ereport(DEBUG1, (errmsg("initializing pool configuration"), errdetail("empty backend_hostname%d, use PostgreSQL's default unix socket path (%s)", i, DEFAULT_SOCKET_DIR))); strlcpy(BACKEND_INFO(i).backend_hostname, DEFAULT_SOCKET_DIR, MAX_DB_HOST_NAMELEN); } else /* DEPRECATED. backward compatibility with older version. Use backend_socket_dir*/ { ereport(DEBUG1, (errmsg("initializing pool configuration"), errdetail("empty backend_hostname%d, use backend_socket_dir as unix socket path (%s)", i, pool_config->backend_socket_dir))); strlcpy(BACKEND_INFO(i).backend_hostname, pool_config->backend_socket_dir, MAX_DB_HOST_NAMELEN); } } } } ereport(DEBUG1, (errmsg("initializing pool configuration"), errdetail("num_backends: %d total_weight: %f", pool_config->backend_desc->num_backends, total_weight))); /* * Normalize load balancing weights. What we are doing here is, * assign 0 to RAND_MAX to each backend's weight according to the * value weightN. For example, if two backends are assigned 1.0, * then each backend will get RAND_MAX/2 normalized weight. */ for (i=0;isystem_db_hostname == '\0') { ereport(DEBUG1, (errmsg("initializing pool configuration"), errdetail("empty system_db_hostname, use PostgreSQL's default unix socket path (%s)", DEFAULT_SOCKET_DIR))); strlcpy(pool_config->system_db_hostname, DEFAULT_SOCKET_DIR, MAX_DB_HOST_NAMELEN); } if (pool_config->parallel_mode) { #ifndef POOL_PRIVATE int dist_num; #endif SystemDBInfo *info; system_db_info = palloc(sizeof(POOL_SYSTEMDB_CONNECTION_POOL)); memset(system_db_info, 0, sizeof(*system_db_info)); #ifndef POOL_PRIVATE system_db_info->system_db_status = pool_shared_memory_create(sizeof(BACKEND_STATUS)); #else system_db_info->system_db_status = palloc(sizeof(BACKEND_STATUS)); #endif *system_db_info->system_db_status = CON_CONNECT_WAIT; /* which is the same as SYSDB_STATUS = CON_CONNECT_WAIT */ info = palloc(sizeof(SystemDBInfo)); system_db_info->info = info; info->hostname = pool_config->system_db_hostname; info->port = pool_config->system_db_port; info->user = pool_config->system_db_user; info->password = pool_config->system_db_password; info->database_name = pool_config->system_db_dbname; info->schema_name = pool_config->system_db_schema; info->dist_def_num = 0; info->dist_def_slot = NULL; #ifndef POOL_PRIVATE if (pool_config->parallel_mode) { dist_num = pool_memset_system_db_info(info); if(dist_num < 0) { ereport(ERROR, (errmsg("invalid configuration, failed to get systemdb info"))); return(-1); } if (!pool_config->replication_mode && !pool_config->load_balance_mode) { ereport(ERROR, (errmsg("invalid configuration, parallel_mode requires replication_mode or load_balance_mode turned on"))); return(-1); } } SYSDB_STATUS = CON_UP; #endif } if (strcmp(pool_config->recovery_1st_stage_command, "") || strcmp(pool_config->recovery_2nd_stage_command, "")) { for (i=0;ibackend_desc->backend_info[i].backend_port != 0 && !strcmp(pool_config->backend_desc->backend_info[i].backend_data_directory, "")) { ereport(ERROR, (errmsg("invalid configuration, recovery_1st_stage_command and recovery_2nd_stage_command requires backend_data_directory to be set"))); return -1; } } } return 0; } static char *extract_string(char *value, POOL_TOKEN token) { char *ret; ret = pstrdup(value); if (token == POOL_STRING) { ret[strlen(ret)-1] = '\0'; return (ret+1); } return ret; } /* * Try to interpret value as boolean value. Valid values are: true, * false, yes, no, on, off, 1, 0; as well as unique prefixes thereof. * If the string parses okay, return true, else false. * If okay and result is not NULL, return the value in *result. * This function copied from PostgreSQL source code. */ static bool parse_bool_with_len(const char *value, size_t len, bool *result) { switch (*value) { case 't': case 'T': if (strncasecmp(value, "true", len) == 0) { if (result) *result = true; return true; } break; case 'f': case 'F': if (strncasecmp(value, "false", len) == 0) { if (result) *result = false; return true; } break; case 'y': case 'Y': if (strncasecmp(value, "yes", len) == 0) { if (result) *result = true; return true; } break; case 'n': case 'N': if (strncasecmp(value, "no", len) == 0) { if (result) *result = false; return true; } break; case 'o': case 'O': /* 'o' is not unique enough */ if (strncasecmp(value, "on", (len > 2 ? len : 2)) == 0) { if (result) *result = true; return true; } else if (strncasecmp(value, "off", (len > 2 ? len : 2)) == 0) { if (result) *result = false; return true; } break; case '1': if (len == 1) { if (result) *result = true; return true; } break; case '0': if (len == 1) { if (result) *result = false; return true; } break; default: break; } if (result) *result = false; /* suppress compiler warning */ return false; } int eval_logical(char *str) { bool result; if (!parse_bool_with_len(str, strlen(str), &result)) return -1; return (result ? 1 : 0); } /* * Extract tokens separated by delimi from str. Return value is an * array of pointers in pallocd strings. number of tokens is set to * n; note that str will be destroyed by strtok(). */ #define MAXTOKENS 1024 static char **extract_string_tokens(char *str, char *delimi, int *n) { char *token; static char **tokens; *n = 0; tokens = palloc(MAXTOKENS*sizeof(char *)); for (token = strtok(str, delimi); token != NULL && *n < MAXTOKENS; token = strtok(NULL, delimi)) { tokens[*n] = pstrdup(token); ereport(DEBUG3, (errmsg("initializing pool configuration"), errdetail("extracting string tokens [token: %s]", tokens[*n]))); (*n)++; } return tokens; } static void clear_host_entry(int slot) { *pool_config->backend_desc->backend_info[slot].backend_hostname = '\0'; pool_config->backend_desc->backend_info[slot].backend_port = 0; pool_config->backend_desc->backend_info[slot].backend_status = CON_UNUSED; pool_config->backend_desc->backend_info[slot].backend_weight = 0.0; } #ifdef DEBUG static void print_host_entry(int slot) { ereport(DEBUG1, (errmsg("initializing pool configuration"), errdetail("slot: %d host: %s port: %d status: %d weight: %f", slot, pool_config->server_hostnames[slot], pool_config->server_ports[slot], pool_config->server_status[slot], pool_config->server_weights[slot]))); } #endif /* Use to set the syslog facility level if logsyslog is activated */ int set_syslog_facility(char *value) { int facility = LOG_LOCAL0; if (value == NULL) return facility; if (strncmp(value, "LOCAL", 5) == 0 && strlen(value) == 6) { switch (value[5]) { case '0': facility = LOG_LOCAL0; break; case '1': facility = LOG_LOCAL1; break; case '2': facility = LOG_LOCAL2; break; case '3': facility = LOG_LOCAL3; break; case '4': facility = LOG_LOCAL4; break; case '5': facility = LOG_LOCAL5; break; case '6': facility = LOG_LOCAL6; break; case '7': facility = LOG_LOCAL7; break; } } return facility; } /* * Translate binary form of backend flag to string. * The returned data is in static buffer, and it will be destroyed * at the next call to this function. */ char *pool_flag_to_str(unsigned short flag) { static char buf[1024]; /* should be large enough */ if (POOL_ALLOW_TO_FAILOVER(flag)) snprintf(buf, sizeof(buf), "ALLOW_TO_FAILOVER"); else if (POOL_DISALLOW_TO_FAILOVER(flag)) snprintf(buf, sizeof(buf), "DISALLOW_TO_FAILOVER"); return buf; } pgpool-II-3.4.3/src/tools/pgmd5/pool_passwd.c0000664000076400007640000001145012554350605015722 00000000000000/* -*-pgsql-c-*- */ /* * * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2013 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation, and that the name of the * author not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. The author makes no representations about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * * Module to handle pool_passwd */ #include #include #include "pool.h" #include "auth/pool_passwd.h" #include "auth/md5.h" #ifndef POOL_PRIVATE #include "utils/elog.h" #else #include "utils/fe_ports.h" #endif static FILE *passwd_fd = NULL; /* File descriptor for pool_passwd */ static char saved_passwd_filename[POOLMAXPATHLEN+1]; /* * Initialize this module. * If pool_passwd does not exist yet, create it. * Open pool_passwd. */ void pool_init_pool_passwd(char *pool_passwd_filename) { if (passwd_fd) return; if (saved_passwd_filename[0] == '\0') { int len = strlen(pool_passwd_filename); memcpy(saved_passwd_filename, pool_passwd_filename, len); saved_passwd_filename[len] = '\0'; } passwd_fd = fopen(pool_passwd_filename, "r+"); if (!passwd_fd) { if (errno == ENOENT) { /* The file does not exist yet. Create it. */ passwd_fd = fopen(pool_passwd_filename, "w+"); if (passwd_fd) return; } ereport(ERROR, (errmsg("initializing pool password, failed to open file:\"%s\"",pool_passwd_filename), errdetail("file open failed with error:\"%s\"",strerror(errno)))); } } /* * Update passwd. If the user does not exist, create a new entry. * Returns 0 on success non 0 otherwise. */ int pool_create_passwdent(char *username, char *passwd) { int len; int c; char name[MAX_USER_NAME_LEN]; char *p; int readlen; if (!passwd_fd) ereport(ERROR, (errmsg("error updating password, password file descriptor is NULL"))); len = strlen(passwd); if (len != POOL_PASSWD_LEN) ereport(ERROR, (errmsg("error updating password, invalid password length:%d",len))); rewind(passwd_fd); name[0] = '\0'; while (!feof(passwd_fd)) { p = name; readlen = 0; while (readlen < sizeof(name)) { c = fgetc(passwd_fd); if (c == EOF) break; else if (c == ':') break; readlen++; *p++ = c; } *p = '\0'; if (!strcmp(username, name)) { /* User name found. Update password. */ while ((c = *passwd++)) { fputc(c, passwd_fd); } fputc('\n', passwd_fd); return 0; } else { /* Skip password */ while((c = fgetc(passwd_fd)) != EOF && c != '\n') ; } } fseek(passwd_fd, 0, SEEK_END); /* * Not found the user name. * Create a new entry. */ while ((c = *username++)) { fputc(c, passwd_fd); } fputc(':', passwd_fd); while ((c = *passwd++)) { fputc(c, passwd_fd); } fputc('\n', passwd_fd); return 0; } /* * Get password in pool_passwd by username. Returns NULL if specified * entry does not exist or error occurred. * Returned password is on the static memory. */ char *pool_get_passwd(char *username) { int c; char name[MAX_USER_NAME_LEN+1]; static char passwd[POOL_PASSWD_LEN+1]; char *p; int readlen; if (!username) ereport(ERROR, (errmsg("unable to get password, username is NULL"))); if (!passwd_fd) ereport(ERROR, (errmsg("unable to get password, password file descriptor is NULL"))); rewind(passwd_fd); name[0] = '\0'; while (!feof(passwd_fd)) { p = name; readlen = 0; while (readlen < (sizeof(name)-1)) { c = fgetc(passwd_fd); if (c == EOF) break; else if (c == ':') break; readlen++; *p++ = c; } *p = '\0'; if (!strcmp(username, name)) { /* User name found. Return password. */ p = passwd; readlen = 0; while((c = fgetc(passwd_fd)) != EOF && c != '\n' && readlen < (sizeof(passwd)-1)) { *p++ = c; readlen++; } *p = '\0'; return passwd; } else { /* Skip password */ while((c = fgetc(passwd_fd)) != EOF && c != '\n') ; } } return NULL; } /* * Delete the entry by username. If specified entry does not exist, * does nothing. */ void pool_delete_passwdent(char *username) { } /* * Finish this moil. Close pool_passwd. */ void pool_finish_pool_passwd(void) { if (passwd_fd) { fclose(passwd_fd); passwd_fd = NULL; } } void pool_reopen_passwd_file(void) { pool_finish_pool_passwd(); pool_init_pool_passwd(saved_passwd_filename); } pgpool-II-3.4.3/src/tools/pgmd5/fe_memutils.c0000664000076400007640000000403112554350605015676 00000000000000/*------------------------------------------------------------------------- * * fe_memutils.c * memory management support for frontend code * * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION * src/common/fe_memutils.c * *------------------------------------------------------------------------- */ #ifndef POOL_PRIVATE #error "This file is not expected to be compiled for pgpool utilities only" #endif #include #include #include #include "utils/fe_ports.h" void * pg_malloc(size_t size) { void *tmp; /* Avoid unportable behavior of malloc(0) */ if (size == 0) size = 1; tmp = malloc(size); if (!tmp) { fprintf(stderr, "out of memory\n"); exit(EXIT_FAILURE); } return tmp; } void * pg_malloc0(size_t size) { void *tmp; tmp = pg_malloc(size); memset(tmp, 0, size); return tmp; } void * pg_realloc(void *ptr, size_t size) { void *tmp; /* Avoid unportable behavior of realloc(NULL, 0) */ if (ptr == NULL && size == 0) size = 1; tmp = realloc(ptr, size); if (!tmp) { fprintf(stderr, "out of memory\n"); exit(EXIT_FAILURE); } return tmp; } /* * "Safe" wrapper around strdup(). */ char * pg_strdup(const char *in) { char *tmp; if (!in) { fprintf(stderr, "cannot duplicate null pointer (internal error)\n"); exit(EXIT_FAILURE); } tmp = strdup(in); if (!tmp) { fprintf(stderr, "out of memory\n"); exit(EXIT_FAILURE); } return tmp; } void pg_free(void *ptr) { if (ptr != NULL) free(ptr); } /* * Frontend emulation of backend memory management functions. Useful for * programs that compile backend files. */ void * palloc(unsigned int size) { return pg_malloc(size); } void * palloc0(unsigned int size) { return pg_malloc0(size); } void pfree(void *pointer) { pg_free(pointer); } char * pstrdup(const char *in) { return pg_strdup(in); } void * repalloc(void *pointer, unsigned int size) { return pg_realloc(pointer, size); } pgpool-II-3.4.3/src/tools/pgmd5/md5.c0000664000076400007640000002506612554350605014065 00000000000000/* * md5.c * * Implements the MD5 Message-Digest Algorithm as specified in * RFC 1321. This implementation is a simple one, in that it * needs every input byte to be buffered before doing any * calculations. I do not expect this file to be used for * general purpose MD5'ing of large amounts of data, only for * generating hashed passwords from limited input. * * Sverre H. Huseby * * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * This file is imported from PostgreSQL 8.1.3., and modified by * Taiki Yamaguchi * * IDENTIFICATION * $Header$ */ #include #include #include #include #include "pool.h" #include "auth/md5.h" #include "utils/palloc.h" #ifdef NOT_USED typedef unsigned char uint8; /* == 8 bits */ typedef unsigned int uint32; /* == 32 bits */ #endif #define S11 7 #define S12 12 #define S13 17 #define S14 22 #define S21 5 #define S22 9 #define S23 14 #define S24 20 #define S31 4 #define S32 11 #define S33 16 #define S34 23 #define S41 6 #define S42 10 #define S43 15 #define S44 21 #define F(x, y, z) (((x) & (y)) | ((~x) & (z))) #define G(x, y, z) (((x) & (z)) | ((y) & (~z))) #define H(x, y, z) ((x) ^ (y) ^ (z)) #define I(x, y, z) ((y) ^ ((x) | (~z))) #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32 - (n)))) #define FF(a, b, c, d, x, s, ac) { \ (a) += F((b), (c), (d)) + (x) + (uint32)(ac); \ (a) = ROTATE_LEFT((a), (s)); \ (a) += (b); \ } #define GG(a, b, c, d, x, s, ac) { \ (a) += G((b), (c), (d)) + (x) + (uint32)(ac); \ (a) = ROTATE_LEFT((a), (s)); \ (a) += (b); \ } #define HH(a, b, c, d, x, s, ac) { \ (a) += H((b), (c), (d)) + (x) + (uint32)(ac); \ (a) = ROTATE_LEFT((a), (s)); \ (a) += (b); \ } #define II(a, b, c, d, x, s, ac) { \ (a) += I((b), (c), (d)) + (x) + (uint32)(ac); \ (a) = ROTATE_LEFT((a), (s)); \ (a) += (b); \ } const uint32 T[64] = { 0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee, 0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501, 0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be, 0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821, 0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa, 0xd62f105d, 0x02441453, 0xd8a1e681, 0xe7d3fbc8, 0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed, 0xa9e3e905, 0xfcefa3f8, 0x676f02d9, 0x8d2a4c8a, 0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c, 0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70, 0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x04881d05, 0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665, 0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039, 0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1, 0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1, 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391 }; /* * PRIVATE FUNCTIONS */ /* * The returned array is allocated using malloc. the caller should free it * when it is no longer needed. */ static uint8 * createPaddedCopyWithLength(uint8 *b, uint32 *l) { /* * uint8 *b - message to be digested * uint32 *l - length of b */ uint8 *ret; uint32 q; uint32 len, newLen448; uint32 len_high, len_low; /* 64-bit value split into 32-bit sections */ len = ((b == NULL) ? 0 : *l); newLen448 = len + 64 - (len % 64) - 8; if (newLen448 <= len) newLen448 += 64; *l = newLen448 + 8; if ((ret = (uint8 *) malloc(sizeof(uint8) * *l)) == NULL) return NULL; if (b != NULL) memcpy(ret, b, sizeof(uint8) * len); /* pad */ ret[len] = 0x80; for (q = len + 1; q < newLen448; q++) ret[q] = 0x00; /* append length as a 64 bit bitcount */ len_low = len; /* split into two 32-bit values */ /* we only look at the bottom 32-bits */ len_high = len >> 29; len_low <<= 3; q = newLen448; ret[q++] = (len_low & 0xff); len_low >>= 8; ret[q++] = (len_low & 0xff); len_low >>= 8; ret[q++] = (len_low & 0xff); len_low >>= 8; ret[q++] = (len_low & 0xff); ret[q++] = (len_high & 0xff); len_high >>= 8; ret[q++] = (len_high & 0xff); len_high >>= 8; ret[q++] = (len_high & 0xff); len_high >>= 8; ret[q] = (len_high & 0xff); return ret; } static void doTheRounds(uint32 X[16], uint32 state[4]) { uint32 a, b, c, d; a = state[0]; b = state[1]; c = state[2]; d = state[3]; /* round 1 */ FF(a, b, c, d, X[ 0], S11, T[ 0]); FF(d, a, b, c, X[ 1], S12, T[ 1]); FF(c, d, a, b, X[ 2], S13, T[ 2]); FF(b, c, d, a, X[ 3], S14, T[ 3]); FF(a, b, c, d, X[ 4], S11, T[ 4]); FF(d, a, b, c, X[ 5], S12, T[ 5]); FF(c, d, a, b, X[ 6], S13, T[ 6]); FF(b, c, d, a, X[ 7], S14, T[ 7]); FF(a, b, c, d, X[ 8], S11, T[ 8]); FF(d, a, b, c, X[ 9], S12, T[ 9]); FF(c, d, a, b, X[10], S13, T[10]); FF(b, c, d, a, X[11], S14, T[11]); FF(a, b, c, d, X[12], S11, T[12]); FF(d, a, b, c, X[13], S12, T[13]); FF(c, d, a, b, X[14], S13, T[14]); FF(b, c, d, a, X[15], S14, T[15]); GG(a, b, c, d, X[ 1], S21, T[16]); GG(d, a, b, c, X[ 6], S22, T[17]); GG(c, d, a, b, X[11], S23, T[18]); GG(b, c, d, a, X[ 0], S24, T[19]); GG(a, b, c, d, X[ 5], S21, T[20]); GG(d, a, b, c, X[10], S22, T[21]); GG(c, d, a, b, X[15], S23, T[22]); GG(b, c, d, a, X[ 4], S24, T[23]); GG(a, b, c, d, X[ 9], S21, T[24]); GG(d, a, b, c, X[14], S22, T[25]); GG(c, d, a, b, X[ 3], S23, T[26]); GG(b, c, d, a, X[ 8], S24, T[27]); GG(a, b, c, d, X[13], S21, T[28]); GG(d, a, b, c, X[ 2], S22, T[29]); GG(c, d, a, b, X[ 7], S23, T[30]); GG(b, c, d, a, X[12], S24, T[31]); HH(a, b, c, d, X[ 5], S31, T[32]); HH(d, a, b, c, X[ 8], S32, T[33]); HH(c, d, a, b, X[11], S33, T[34]); HH(b, c, d, a, X[14], S34, T[35]); HH(a, b, c, d, X[ 1], S31, T[36]); HH(d, a, b, c, X[ 4], S32, T[37]); HH(c, d, a, b, X[ 7], S33, T[38]); HH(b, c, d, a, X[10], S34, T[39]); HH(a, b, c, d, X[13], S31, T[40]); HH(d, a, b, c, X[ 0], S32, T[41]); HH(c, d, a, b, X[ 3], S33, T[42]); HH(b, c, d, a, X[ 6], S34, T[43]); HH(a, b, c, d, X[ 9], S31, T[44]); HH(d, a, b, c, X[12], S32, T[45]); HH(c, d, a, b, X[15], S33, T[46]); HH(b, c, d, a, X[ 2], S34, T[47]); II(a, b, c, d, X[ 0], S41, T[48]); II(d, a, b, c, X[ 7], S42, T[49]); II(c, d, a, b, X[14], S43, T[50]); II(b, c, d, a, X[ 5], S44, T[51]); II(a, b, c, d, X[12], S41, T[52]); II(d, a, b, c, X[ 3], S42, T[53]); II(c, d, a, b, X[10], S43, T[54]); II(b, c, d, a, X[ 1], S44, T[55]); II(a, b, c, d, X[ 8], S41, T[56]); II(d, a, b, c, X[15], S42, T[57]); II(c, d, a, b, X[ 6], S43, T[58]); II(b, c, d, a, X[13], S44, T[59]); II(a, b, c, d, X[ 4], S41, T[60]); II(d, a, b, c, X[11], S42, T[61]); II(c, d, a, b, X[ 2], S43, T[62]); II(b, c, d, a, X[ 9], S44, T[63]); state[0] += a; state[1] += b; state[2] += c; state[3] += d; } static int calculateDigestFromBuffer(uint8 *b, uint32 len, uint8 sum[16]) { /* * uint8 *b - message to be digested * uint32 len - length of b * uint8 sum[16] - md5 digest calculated from b */ register uint32 i, j, k, newI; uint32 l; uint8 *input; register uint32 *wbp; uint32 workBuff[16], state[4]; l = len; state[0] = 0x67452301; state[1] = 0xEFCDAB89; state[2] = 0x98BADCFE; state[3] = 0x10325476; if ((input = createPaddedCopyWithLength(b, &l)) == NULL) return 0; for (i = 0;;) { if ((newI = i + 16 * 4) > l) break; k = i + 3; for (j = 0; j < 16; j++) { wbp = (workBuff + j); *wbp = input[k--]; *wbp <<= 8; *wbp |= input[k--]; *wbp <<= 8; *wbp |= input[k--]; *wbp <<= 8; *wbp |= input[k]; k += 7; } doTheRounds(workBuff, state); i = newI; } free(input); j = 0; for (i = 0; i < 4; i++) { k = state[i]; sum[j++] = (k & 0xff); k >>= 8; sum[j++] = (k & 0xff); k >>= 8; sum[j++] = (k & 0xff); k >>= 8; sum[j++] = (k & 0xff); } return 1; } static void bytesToHex(uint8 b[16], char *s) { static const char *hex = "0123456789abcdef"; int q, w; for (q = 0, w = 0; q < 16; q++) { s[w++] = hex[(b[q] >> 4) & 0x0F]; s[w++] = hex[b[q] & 0x0F]; } s[w] = '\0'; } /* * PUBLIC FUNCTIONS */ /* * pool_md5_hash * * Calculates the MD5 sum of the bytes in a buffer. * * SYNOPSIS int pool_md5_hash(const void *buff, size_t len, char *hexsum) * * INPUT buff the buffer containing the bytes that you want * the MD5 sum of. * len number of bytes in the buffer. * * OUTPUT hexsum the MD5 sum as a '\0'-terminated string of * hexadecimal digits. an MD5 sum is 16 bytes long. * each byte is represented by two heaxadecimal * characters. you thus need to provide an array * of 33 characters, including the trailing '\0'. * * RETURNS false on failure (out of memory for internal buffers) or * true on success. * * STANDARDS MD5 is described in RFC 1321. * * AUTHOR Sverre H. Huseby * MODIFIED by Taiki Yamaguchi * */ int pool_md5_hash(const void *buff, size_t len, char *hexsum) { uint8 sum[16]; if (!calculateDigestFromBuffer((uint8 *) buff, len, sum)) return 0; /* failed */ bytesToHex(sum, hexsum); return 1; /* success */ } /* * Computes MD5 checksum of "passwd" (a null-terminated string) followed * by "salt" (which need not be null-terminated). * * Output format is a 32-hex-digit MD5 checksum. * Hence, the output buffer "buf" must be at least 33 bytes long. * * Returns 1 if okay, 0 on error (out of memory). */ int pool_md5_encrypt(const char *passwd, const char *salt, size_t salt_len, char *buf) { size_t passwd_len = strlen(passwd); char *crypt_buf = malloc(passwd_len + salt_len); int ret; if (!crypt_buf) return 0; /* failed */ /* * Place salt at the end because it may be known by users trying to crack * the MD5 output. */ strcpy(crypt_buf, passwd); memcpy(crypt_buf + passwd_len, salt, salt_len); ret = pool_md5_hash(crypt_buf, passwd_len + salt_len, buf); free(crypt_buf); return ret; } /* * Computes MD5 checksum of "passwd" (a null-terminated string) followed * by "salt" (which need not be null-terminated). * * Output format is "md5" followed by a 32-hex-digit MD5 checksum. * Hence, the output buffer "buf" must be at least 36 bytes long. * * Returns TRUE if okay, FALSE on error (out of memory). */ bool pg_md5_encrypt(const char *passwd, const char *salt, size_t salt_len, char *buf) { size_t passwd_len = strlen(passwd); /* +1 here is just to avoid risk of unportable malloc(0) */ char *crypt_buf = palloc(passwd_len + salt_len + 1); bool ret; /* * Place salt at the end because it may be known by users trying to crack * the MD5 output. */ memcpy(crypt_buf, passwd, passwd_len); memcpy(crypt_buf + passwd_len, salt, salt_len); strcpy(buf, "md5"); ret = pool_md5_hash(crypt_buf, passwd_len + salt_len, buf + 3); pfree(crypt_buf); return ret; } pgpool-II-3.4.3/src/tools/pgmd5/pg_md5.c0000664000076400007640000001562412554350605014552 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2013 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation, and that the name of the * author not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. The author makes no representations about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * * pg_md5 command main * */ #include "pool.h" #include "pool_config.h" #include "auth/pool_passwd.h" #include "auth/md5.h" #include #include #include #include #include #include #ifdef HAVE_GETOPT_H #include #else #include "utils/getopt_long.h" #endif #include #include /* Maximum number of characters allowed for input. */ #define MAX_INPUT_SIZE MAX_USER_NAME_LEN static void print_usage(const char prog[], int exit_code); static void set_tio_attr(int enable); static void update_pool_passwd(char *conf_file, char *username, char *password); int main(int argc, char *argv[]) { #define PRINT_USAGE(exit_code) print_usage(argv[0], exit_code) char conf_file[POOLMAXPATHLEN+1]; char username[MAX_INPUT_SIZE+1]; int opt; int optindex; bool md5auth = false; bool prompt = false; static struct option long_options[] = { {"help", no_argument, NULL, 'h'}, {"prompt", no_argument, NULL, 'p'}, {"md5auth", no_argument, NULL, 'm'}, {"username", required_argument, NULL, 'u'}, {"config-file", required_argument, NULL, 'f'}, {NULL, 0, NULL, 0} }; snprintf(conf_file, sizeof(conf_file), "%s/%s", DEFAULT_CONFIGDIR, POOL_CONF_FILE_NAME); /* initialize username buffer with zeros so that we can use strlen on it later to check if a username was given on the command line */ memset(username, 0, MAX_INPUT_SIZE+1); while ((opt = getopt_long(argc, argv, "hpmf:u:", long_options, &optindex)) != -1) { switch (opt) { case 'p': /* prompt for password */ prompt = true; break; case 'm': /* produce md5 authentication password */ md5auth = true; break; case 'f': /* specify configuration file */ if (!optarg) { PRINT_USAGE(EXIT_SUCCESS); } strlcpy(conf_file, optarg, sizeof(conf_file)); break; case 'u': if (!optarg) { PRINT_USAGE(EXIT_SUCCESS); } /* check the input limit early */ if (strlen(optarg) > MAX_INPUT_SIZE) { fprintf(stderr, "Error: input exceeds maximum username length!\n\n"); exit(EXIT_FAILURE); } strlcpy(username, optarg, sizeof(username)); break; default: PRINT_USAGE(EXIT_SUCCESS); break; } } /* Prompt for password. */ if (prompt) { char md5[MD5_PASSWD_LEN+1]; char buf[MAX_INPUT_SIZE+1]; int len; set_tio_attr(1); printf("password: "); if (!fgets(buf, (MAX_INPUT_SIZE+1), stdin)) { int eno = errno; fprintf(stderr, "Couldn't read input from stdin. (fgets(): %s)", strerror(eno)); exit(EXIT_FAILURE); } printf("\n"); set_tio_attr(0); /* Remove LF at the end of line, if there is any. */ len = strlen(buf); if (len > 0 && buf[len-1] == '\n') { buf[len-1] = '\0'; len--; } if (md5auth) { update_pool_passwd(conf_file, username, buf); } else { pool_md5_hash(buf, len, md5); printf("%s\n", md5); } } /* Read password from argv. */ else { char md5[POOL_PASSWD_LEN+1]; int len; if (optind >= argc) { PRINT_USAGE(EXIT_FAILURE); } len = strlen(argv[optind]); if (len > MAX_INPUT_SIZE) { fprintf(stderr, "Error: Input exceeds maximum password length!\n\n"); PRINT_USAGE(EXIT_FAILURE); } if (md5auth) { update_pool_passwd(conf_file, username, argv[optind]); } else { pool_md5_hash(argv[optind], len, md5); printf("%s\n", md5); } } return EXIT_SUCCESS; } static void update_pool_passwd(char *conf_file, char *username, char *password) { struct passwd *pw; char md5[POOL_PASSWD_LEN+1]; char pool_passwd[POOLMAXPATHLEN+1]; char dirnamebuf[POOLMAXPATHLEN+1]; char *dirp; if (pool_init_config()) { fprintf(stderr, "pool_init_config() failed\n\n"); exit(EXIT_FAILURE); } if (pool_get_config(conf_file, INIT_CONFIG)) { fprintf(stderr, "Unable to get configuration. Exiting..."); exit(EXIT_FAILURE); } strlcpy(dirnamebuf, conf_file, sizeof(dirnamebuf)); dirp = dirname(dirnamebuf); snprintf(pool_passwd, sizeof(pool_passwd), "%s/%s", dirp, pool_config->pool_passwd); pool_init_pool_passwd(pool_passwd); if (strlen(username)) { /* generate the hash for the given username */ pg_md5_encrypt(password, username, strlen(username), md5); pool_create_passwdent(username, md5); } else { /* get the user information from the current uid */ pw = getpwuid(getuid()); if (!pw) { fprintf(stderr, "getpwuid() failed\n\n"); exit(EXIT_FAILURE); } pg_md5_encrypt(password, pw->pw_name, strlen(pw->pw_name), md5); pool_create_passwdent(pw->pw_name, md5); } pool_finish_pool_passwd(); } static void print_usage(const char prog[], int exit_code) { fprintf(((exit_code == EXIT_SUCCESS) ? stdout : stderr), "Usage:\n\ \n\ %s [OPTIONS]\n\ %s \n\ \n\ --prompt, -p Prompt password using standard input.\n\ --md5auth, -m Produce md5 authentication password.\n\ --username, -u USER When producing a md5 authentication password,\n\ create the pool_passwd entry for USER.\n\ --config-file, -f CONFIG-FILE Specify pgpool.conf.\n\ --help, -h This help menu.\n\ \n\ Warning: At most %d characters are allowed for input.\n\ Warning: Plain password argument is deprecated for security concerns\n\ and kept for compatibility. Please prefer using password\n\ prompt.\n", prog, prog, MAX_INPUT_SIZE); exit(exit_code); } static void set_tio_attr(int set) { struct termios tio; static struct termios tio_save; if (!isatty(0)) { fprintf(stderr, "stdin is not tty\n"); exit(EXIT_FAILURE); } if (set) { if (tcgetattr(0, &tio) < 0) { fprintf(stderr, "set_tio_attr(set): tcgetattr failed\n"); exit(EXIT_FAILURE); } tio_save = tio; tio.c_iflag &= ~(BRKINT|ISTRIP|IXON); tio.c_lflag &= ~(ICANON|IEXTEN|ECHO|ECHOE|ECHOK|ECHONL); tio.c_cc[VMIN] = 1; tio.c_cc[VTIME] = 0; if (tcsetattr(0, TCSANOW, &tio) < 0) { fprintf(stderr, "(set_tio_attr(set): tcsetattr failed\n"); exit(EXIT_FAILURE); } } else { if (tcsetattr(0, TCSANOW, &tio_save) < 0) { fprintf(stderr, "set_tio_attr(reset): tcsetattr failed\n"); exit(EXIT_FAILURE); } } } pgpool-II-3.4.3/src/tools/pgmd5/pool_config.l0000664000076400007640000030560012554350605015702 00000000000000/* -*-pgsql-c-*- */ /* * * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2015 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation, and that the name of the * author not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. The author makes no representations about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * * pool_config.l: read configuration file * */ %{ #include #include #include #include #include "pool.h" #include "pool_config.h" #include "utils/regex_array.h" #ifndef POOL_PRIVATE #include "utils/elog.h" #else #include "utils/fe_ports.h" #endif #define CHECK_CONTEXT(mask, context) ((mask) & (context)) /* to shut off compiler warnings */ int yylex(void); POOL_CONFIG *pool_config; /* configuration values */ POOL_SYSTEMDB_CONNECTION_POOL *system_db_info; static unsigned Lineno; static char *default_reset_query_list[] = {"ABORT", "DISCARD ALL"}; static char *default_black_function_list[] = {"nextval", "setval"}; typedef enum { POOL_KEY = 1, POOL_INTEGER, POOL_REAL, POOL_STRING, POOL_UNQUOTED_STRING, POOL_EQUALS, POOL_EOL, POOL_PARSE_ERROR } POOL_TOKEN; static char *extract_string(char *value, POOL_TOKEN token); static char **extract_string_tokens(char *str, char *delim, int *n); static void clear_host_entry(int slot); static bool check_redirect_node_spec(char *node_spec); %} %option 8bit %option never-interactive %option nounput %option noyywrap SIGN ("-"|"+") DIGIT [0-9] HEXDIGIT [0-9a-fA-F] INTEGER {SIGN}?({DIGIT}+|0x{HEXDIGIT}+) EXPONENT [Ee]{SIGN}?{DIGIT}+ REAL {SIGN}?{DIGIT}*"."{DIGIT}*{EXPONENT}? LETTER [A-Za-z_\200-\377] LETTER_OR_DIGIT [A-Za-z_0-9\200-\377] KEY {LETTER}{LETTER_OR_DIGIT}* UNQUOTED_STRING {LETTER}({LETTER_OR_DIGIT}|[-._:/])* STRING \'([^'\n]|\\.)*\' %% \n Lineno++; return POOL_EOL; [ \t\r]+ /* eat whitespace */ #.*$ /* eat comment */ {KEY} return POOL_KEY; {STRING} return POOL_STRING; {UNQUOTED_STRING} return POOL_UNQUOTED_STRING; {INTEGER} return POOL_INTEGER; {REAL} return POOL_REAL; = return POOL_EQUALS; . return POOL_PARSE_ERROR; %% int pool_init_config(void) { int res; static char localhostname[256]; int i; pool_config = palloc(sizeof(POOL_CONFIG)); memset(pool_config, 0, sizeof(POOL_CONFIG)); #ifndef POOL_PRIVATE pool_config->backend_desc = pool_shared_memory_create(sizeof(BackendDesc)); #else pool_config->backend_desc = palloc(sizeof(BackendDesc)); #endif /* * add for watchdog */ pool_config->other_wd = palloc0(sizeof(WdDesc)); /* set hardcoded default values */ pool_config->listen_addresses = "localhost"; pool_config->pcp_listen_addresses = "*"; pool_config->port = 9999; pool_config->pcp_port = 9898; pool_config->socket_dir = DEFAULT_SOCKET_DIR; pool_config->pcp_socket_dir = DEFAULT_SOCKET_DIR; pool_config->backend_socket_dir = NULL; pool_config->pcp_timeout = 10; pool_config->num_init_children = 32; pool_config->listen_backlog_multiplier = 2; pool_config->max_pool = 4; pool_config->child_life_time = 300; pool_config->client_idle_limit = 0; pool_config->connection_life_time = 0; pool_config->child_max_connections = 0; pool_config->authentication_timeout = 60; pool_config->logdir = DEFAULT_LOGDIR; pool_config->logsyslog = 0; pool_config->log_destination = "stderr"; pool_config->syslog_facility = LOG_LOCAL0; pool_config->syslog_ident = "pgpool"; pool_config->pid_file_name = DEFAULT_PID_FILE_NAME; pool_config->log_statement = 0; pool_config->log_per_node_statement = 0; pool_config->log_connections = 0; pool_config->log_hostname = 0; pool_config->enable_pool_hba = 0; pool_config->pool_passwd = "pool_passwd"; pool_config->replication_mode = 0; pool_config->load_balance_mode = 0; pool_config->replication_stop_on_mismatch = 0; pool_config->failover_if_affected_tuples_mismatch = 0; pool_config->replicate_select = 0; pool_config->reset_query_list = default_reset_query_list; pool_config->num_reset_queries = sizeof(default_reset_query_list)/sizeof(char *); pool_config->white_function_list = NULL; pool_config->num_white_function_list = 0; pool_config->black_function_list = default_black_function_list; pool_config->num_black_function_list = sizeof(default_black_function_list)/sizeof(char *); pool_config->log_line_prefix = "%t: pid %p: "; pool_config->log_error_verbosity = 1; /* PGERROR_DEFAULT */ pool_config->client_min_messages = 18; /* NOTICE */ pool_config->log_min_messages = 19; /* WARNING */ pool_config->master_slave_mode = 0; pool_config->master_slave_sub_mode = "slony"; pool_config->delay_threshold = 0; pool_config->log_standby_delay = "none"; pool_config->connection_cache = 1; pool_config->health_check_timeout = 20; pool_config->health_check_period = 0; pool_config->health_check_user = "nobody"; pool_config->health_check_password = ""; pool_config->health_check_max_retries = 0; pool_config->health_check_retry_delay = 1; pool_config->connect_timeout = 10000; pool_config->sr_check_period = 0; pool_config->sr_check_user = "nobody"; pool_config->sr_check_password = ""; pool_config->failover_command = ""; pool_config->follow_master_command = ""; pool_config->failback_command = ""; pool_config->fail_over_on_backend_error = 1; pool_config->insert_lock = 1; pool_config->ignore_leading_white_space = 1; pool_config->parallel_mode = 0; pool_config->system_db_hostname = "localhost"; pool_config->system_db_port = 5432; pool_config->system_db_dbname = "pgpool"; pool_config->system_db_schema = "pgpool_catalog"; pool_config->system_db_user = "pgpool"; pool_config->system_db_password = ""; pool_config->backend_desc->num_backends = 0; pool_config->recovery_user = ""; pool_config->recovery_password = ""; pool_config->recovery_1st_stage_command = ""; pool_config->recovery_2nd_stage_command = ""; pool_config->recovery_timeout = 90; pool_config->search_primary_node_timeout = 10; pool_config->client_idle_limit_in_recovery = 0; pool_config->lobj_lock_table = ""; pool_config->ssl = 0; pool_config->ssl_cert = ""; pool_config->ssl_key = ""; pool_config->ssl_ca_cert = ""; pool_config->ssl_ca_cert_dir = ""; pool_config->debug_level = 0; pool_config->relcache_expire = 0; pool_config->relcache_size = 256; pool_config->check_temp_table = 1; pool_config->check_unlogged_table = 1; pool_config->lists_patterns = NULL; pool_config->pattc = 0; pool_config->current_pattern_size = 0; /* * database_redirect_preference_list */ pool_config->database_redirect_preference_list = NULL; pool_config->redirect_dbnames = NULL; pool_config->db_redirect_tokens = NULL; /* * app_name_redirect_preference_list */ pool_config->app_name_redirect_preference_list = NULL; pool_config->redirect_app_names = NULL; pool_config->app_name_redirect_tokens = NULL; pool_config->allow_sql_comments = 0; /* * add for watchdog */ pool_config->use_watchdog = 0; pool_config->wd_lifecheck_method = MODE_HEARTBEAT; pool_config->clear_memqcache_on_escalation = 1; pool_config->wd_escalation_command = ""; pool_config->trusted_servers = ""; pool_config->delegate_IP = ""; res = gethostname(localhostname,sizeof(localhostname)); if(res !=0 ) { ereport(DEBUG1, (errmsg("initializing pool configuration"), errdetail("failed to get the local hostname"))); } pool_config->wd_hostname = localhostname; pool_config->wd_port = 9000; pool_config->other_wd->num_wd = 0; pool_config->wd_interval = 10; pool_config->wd_authkey = ""; pool_config->ping_path = "/bin"; pool_config->ifconfig_path = "/sbin"; pool_config->if_up_cmd = "ifconfig eth0:0 inet $_IP_$ netmask 255.255.255.0"; pool_config->if_down_cmd = "ifconfig eth0:0 down"; pool_config->arping_path = "/usr/sbin"; pool_config->arping_cmd = "arping -U $_IP_$ -w 1"; pool_config->wd_life_point = 3; pool_config->wd_lifecheck_query = "SELECT 1"; pool_config->wd_lifecheck_dbname = "template1"; pool_config->wd_lifecheck_user = "nobody"; pool_config->wd_lifecheck_password = ""; pool_config->wd_heartbeat_port = 9694; pool_config->wd_heartbeat_keepalive = 2; pool_config->wd_heartbeat_deadtime = 30; pool_config->num_hb_if = 0; pool_config->memory_cache_enabled = 0; pool_config->memqcache_method = "shmem"; pool_config->memqcache_memcached_host = "localhost"; pool_config->memqcache_memcached_port = 11211; pool_config->memqcache_total_size = (int64)67108864; pool_config->memqcache_max_num_cache = 1000000; pool_config->memqcache_expire = 0; pool_config->memqcache_auto_cache_invalidation = 1; pool_config->memqcache_maxcache = 409600; pool_config->memqcache_cache_block_size = 1048576; pool_config->memqcache_oiddir = "/var/log/pgpool/oiddir"; pool_config->white_memqcache_table_list = NULL; pool_config->num_white_memqcache_table_list = 0; pool_config->black_memqcache_table_list = NULL; pool_config->num_black_memqcache_table_list = 0; pool_config->lists_memqcache_table_patterns = NULL; pool_config->memqcache_table_pattc = 0; pool_config->current_memqcache_table_pattern_size = 0; res = gethostname(localhostname,sizeof(localhostname)); if(res !=0 ) { ereport(DEBUG1, (errmsg("initializing pool configuration"), errdetail("failed to get the local hostname"))); } pool_config->pgpool2_hostname = localhostname; for (i=0;ipattc == pool_config->current_pattern_size) { pool_config->current_pattern_size += PATTERN_ARR_SIZE; _tmp = repalloc(pool_config->lists_patterns, (pool_config->current_pattern_size * sizeof(RegPattern))); if (!_tmp) { return(-1); } pool_config->lists_patterns = (RegPattern*)_tmp; } pool_config->lists_patterns[pool_config->pattc] = item; pool_config->pattc++; return(pool_config->pattc); } int growMemqcacheTablePatternArray(RegPattern item) { void *_tmp = NULL; if (pool_config->memqcache_table_pattc == pool_config->current_memqcache_table_pattern_size) { pool_config->current_memqcache_table_pattern_size += PATTERN_ARR_SIZE; _tmp = repalloc(pool_config->lists_memqcache_table_patterns, (pool_config->current_memqcache_table_pattern_size * sizeof(RegPattern))); if (!_tmp) { return(-1); } pool_config->lists_memqcache_table_patterns = (RegPattern*)_tmp; } pool_config->lists_memqcache_table_patterns[pool_config->memqcache_table_pattc] = item; pool_config->memqcache_table_pattc++; return(pool_config->memqcache_table_pattc); } int pool_get_config(char *confpath, POOL_CONFIG_CONTEXT context) { FILE *fd; int token; char key[1024]; double total_weight; int i; int error_level; bool log_destination_changed = false; #ifdef USE_MEMCACHED bool use_memcached = true; #else bool use_memcached = false; #endif if(CHECK_CONTEXT(INIT_CONFIG, context)) error_level = ERROR; else error_level = WARNING; #define PARSE_ERROR() ereport(CHECK_CONTEXT(INIT_CONFIG, context)?ERROR:WARNING, \ (errmsg("syntex error in configuration file \"%s\"",POOL_CONF_FILE_NAME), \ errdetail("parse error at line %d '%s'", Lineno, yytext))) /* open config file */ fd = fopen(confpath, "r"); if (!fd) { ereport(WARNING, (errmsg("could not open configuration file: \"%s\"\n",POOL_CONF_FILE_NAME), errdetail("using default configuration parameter values"))); return 0; } yyin = fd; Lineno = 1; for(;;) { token = yylex(); if (token == 0) { break; } if (token == POOL_PARSE_ERROR) { PARSE_ERROR(); fclose(fd); return(-1); } if (token == POOL_EOL) continue; if (token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } strlcpy(key, yytext, sizeof(key)); ereport(DEBUG5, (errmsg("key: %s", key))); token = yylex(); if (token == POOL_EQUALS) token = yylex(); ereport(DEBUG5, (errmsg("value: %s kind: %d", yytext, token))); if (!strcmp(key, "allow_inet_domain_socket") && CHECK_CONTEXT(INIT_CONFIG, context)) { /* for backward compatibility */ int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"",yytext,key))); return(-1); } if (v) pool_config->listen_addresses = pstrdup("*"); else pool_config->listen_addresses = pstrdup(""); } else if (!strcmp(key, "listen_addresses") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->listen_addresses = str; } else if (!strcmp(key, "port") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 1024) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\". %s must be >= 1024",yytext,key, key))); return(-1); } pool_config->port = v; } else if (!strcmp(key, "pcp_listen_addresses") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->pcp_listen_addresses = str; } else if (!strcmp(key, "pcp_port") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 1024) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\". %s must be >= 1024",yytext,key, key))); return(-1); } pool_config->pcp_port = v; } else if (!strcmp(key, "socket_dir") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->socket_dir = str; } else if (!strcmp(key, "pcp_socket_dir") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->pcp_socket_dir = str; } else if (!strcmp(key, "pcp_timeout") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\". %s must be >= 0",yytext,key, key))); return(-1); } pool_config->pcp_timeout = v; } else if (!strcmp(key, "num_init_children") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 1) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\". %s must be >= 1",yytext,key, key))); return(-1); } pool_config->num_init_children = v; } else if (!strcmp(key, "listen_backlog_multiplier") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 1) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\". %s must be >= 1",yytext,key, key))); return(-1); } pool_config->listen_backlog_multiplier = v; } else if (!strcmp(key, "child_life_time") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\". %s must be >= 0",yytext,key, key))); return(-1); } pool_config->child_life_time = v; } else if (!strcmp(key, "client_idle_limit") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\". %s must be >= 0",yytext,key, key))); return(-1); } pool_config->client_idle_limit = v; } else if (!strcmp(key, "connection_life_time") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\". %s must be >= 0",yytext,key, key))); return(-1); } pool_config->connection_life_time = v; } else if (!strcmp(key, "child_max_connections") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\". %s must be >= 0",yytext,key, key))); return(-1); } pool_config->child_max_connections = v; } else if (!strcmp(key, "authentication_timeout") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\". %s must be >= 0",yytext,key, key))); return(-1); } pool_config->authentication_timeout = v; } else if (!strcmp(key, "max_pool") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\". %s must be >= 0",yytext,key, key))); return(-1); } pool_config->max_pool = v; } else if (!strcmp(key, "logdir") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->logdir = str; } else if (!strcmp(key, "log_destination") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } log_destination_changed = pool_config->log_destination != str; pool_config->log_destination = str; } else if (!strcmp(key, "syslog_facility") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->syslog_facility = set_syslog_facility(str); } else if (!strcmp(key, "syslog_ident") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } log_destination_changed = log_destination_changed || pool_config->syslog_ident != str; pool_config->syslog_ident = str; } else if (!strcmp(key, "pid_file_name") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->pid_file_name = str; } else if (!strcmp(key, "log_connections") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"",yytext,key))); return(-1); } pool_config->log_connections = v; } else if (!strcmp(key, "log_hostname") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"",yytext,key))); return(-1); } pool_config->log_hostname = v; } else if (!strcmp(key, "enable_pool_hba") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"",yytext,key))); return(-1); } pool_config->enable_pool_hba = v; } else if (!strcmp(key, "pool_passwd") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->pool_passwd = str; } else if (!strcmp(key, "backend_socket_dir") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; ereport(LOG, (errmsg("initializing pool configuration: backend_socket_dir is deprecated"), errdetail("please use backend_hostname instead"))); if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->backend_socket_dir = str; } else if (!strcmp(key, "replication_mode") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"",yytext,key))); return(-1); } pool_config->replication_mode = v; if (pool_config->master_slave_mode && pool_config->replication_mode) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("replication_mode and master_slave_mode cannot be enabled at the same time"))); return(-1); } } else if (!strcmp(key, "load_balance_mode") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"",yytext,key))); return(-1); } pool_config->load_balance_mode = v; } else if (!strcmp(key, "replication_stop_on_mismatch") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"",yytext,key))); return(-1); } ereport(DEBUG1, (errmsg("initializing pool configuration"), errdetail("replication_stop_on_mismatch: %d", v))); pool_config->replication_stop_on_mismatch = v; } else if (!strcmp(key, "failover_if_affected_tuples_mismatch") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"",yytext,key))); return(-1); } ereport(DEBUG1, (errmsg("initializing pool configuration"), errdetail("failover_if_affected_tuples_mismatch: %d", v))); pool_config->failover_if_affected_tuples_mismatch = v; } else if (!strcmp(key, "replicate_select") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"",yytext,key))); return(-1); } ereport(DEBUG1, (errmsg("initializing pool configuration"), errdetail("replicate_select: %d", v))); pool_config->replicate_select = v; } else if (!strcmp(key, "reset_query_list") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->reset_query_list = extract_string_tokens(str, ";", &pool_config->num_reset_queries); if (pool_config->reset_query_list == NULL) { fclose(fd); return(-1); } } else if (!strcmp(key, "white_function_list") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->white_function_list = extract_string_tokens(str, ",", &pool_config->num_white_function_list); if (pool_config->white_function_list == NULL) { fclose(fd); return(-1); } for (i=0;inum_white_function_list;i++) { add_regex_pattern("white_function_list", pool_config->white_function_list[i]); } } else if (!strcmp(key, "black_function_list") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->black_function_list = extract_string_tokens(str, ",", &pool_config->num_black_function_list); if (pool_config->black_function_list == NULL) { fclose(fd); return(-1); } for (i=0;inum_black_function_list;i++) { add_regex_pattern("black_function_list", pool_config->black_function_list[i]); } } else if (!strcmp(key, "log_error_verbosity") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str, *valid_val; int i; const char *ordered_valid_values[] = {"terse","default","verbose",NULL}; bool found = false; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } for(i=0; ; i++) { valid_val = (char*)ordered_valid_values[i]; if(!valid_val) break; if (!strcasecmp(str, valid_val)) { found = true; pool_config->log_error_verbosity = i; break; } } if (!found) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"",yytext,key))); return(-1); } } else if (!strcmp(key, "client_min_messages") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str, *valid_val; int i; const char *ordered_valid_values[] = {"debug5","debug4","debug3","debug2","debug1","log","commerror","info","notice","warning","error",NULL}; bool found = false; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } for(i=0; ; i++) { valid_val = (char*)ordered_valid_values[i]; if(!valid_val) break; if (!strcasecmp(str, valid_val)) { found = true; pool_config->client_min_messages = i + 10; break; } } if (!found) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"",yytext,key))); return(-1); } } else if (!strcmp(key, "log_min_messages") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str, *valid_val; int i; const char *ordered_valid_values[] = {"debug5","debug4","debug3","debug2","debug1","log","commerror","info","notice","warning","error","fatal","panic",NULL}; bool found = false; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } for(i=0; ; i++) { valid_val = (char*)ordered_valid_values[i]; if(!valid_val) break; if (!strcasecmp(str, valid_val)) { found = true; pool_config->log_min_messages = i + 10; /* error codes start with 10 */ break; } } if (!found) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"",yytext,key))); return(-1); } } else if (!strcmp(key, "log_line_prefix") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->log_line_prefix = str; } else if (!strcmp(key, "print_timestamp") && CHECK_CONTEXT(INIT_CONFIG, context)) { ereport(NOTICE, (errmsg("configuration key \"%s\" is not supported anymore",key), errdetail("please use \"log_line_prefix\" instead"))); } else if (!strcmp(key, "print_user") && CHECK_CONTEXT(INIT_CONFIG, context)) { ereport(NOTICE, (errmsg("configuration key \"%s\" is not supported anymore",key), errdetail("please use \"log_line_prefix\" instead"))); } else if (!strcmp(key, "master_slave_mode") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"",yytext,key))); return(-1); } pool_config->master_slave_mode = v; if (pool_config->master_slave_mode && pool_config->replication_mode) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("replication_mode and master_slave_mode cannot be enabled at the same time"))); return(-1); } } else if (!strcmp(key, "master_slave_sub_mode") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if (strcmp(str, MODE_SLONY) && strcmp(str, MODE_STREAMREP)) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("allowed values for configuration parameter %s can be either \"slony\" or \"stream\"", key))); return(-1); } pool_config->master_slave_sub_mode = str; } else if (!strcmp(key, "delay_threshold") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { long long int v = atol(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\". %s must be >= 0",yytext,key, key))); return(-1); } pool_config->delay_threshold = v; } else if (!strcmp(key, "log_standby_delay") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if (strcmp(str, "always") && strcmp(str, "if_over_threshold") && strcmp(str, "none")) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("allowed values are: \"always\", \"if_over_threshold\" and \"none\""))); return(-1); } pool_config->log_standby_delay = str; } else if (!strcmp(key, "connection_cache") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key))); return(-1); } pool_config->connection_cache = v; } else if (!strcmp(key, "health_check_timeout") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->health_check_timeout = v; } else if (!strcmp(key, "health_check_period") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->health_check_period = v; } else if (!strcmp(key, "health_check_user") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->health_check_user = str; } else if (!strcmp(key, "health_check_password") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->health_check_password = str; } else if (!strcmp(key, "health_check_max_retries") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->health_check_max_retries = v; } else if (!strcmp(key, "health_check_retry_delay") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->health_check_retry_delay = v; } else if (!strcmp(key, "connect_timeout") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->connect_timeout = v; } else if (!strcmp(key, "sr_check_period") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->sr_check_period = v; } else if (!strcmp(key, "sr_check_user") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->sr_check_user = str; } else if (!strcmp(key, "sr_check_password") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->sr_check_password = str; } else if (!strcmp(key, "failover_command") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->failover_command = str; } else if (!strcmp(key, "follow_master_command") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->follow_master_command = str; } else if (!strcmp(key, "failback_command") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->failback_command = str; } else if (!strcmp(key, "fail_over_on_backend_error") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key))); return(-1); } pool_config->fail_over_on_backend_error = v; } else if (!strcmp(key, "recovery_user") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->recovery_user = str; } else if (!strcmp(key, "recovery_password") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->recovery_password = str; } else if (!strcmp(key, "recovery_1st_stage_command") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->recovery_1st_stage_command = str; } else if (!strcmp(key, "recovery_2nd_stage_command") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->recovery_2nd_stage_command = str; } else if (!strcmp(key, "recovery_timeout") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->recovery_timeout = v; } else if (!strcmp(key, "search_primary_node_timeout") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->search_primary_node_timeout = v; } else if (!strcmp(key, "client_idle_limit_in_recovery") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < -1) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->client_idle_limit_in_recovery = v; } else if (!strcmp(key, "insert_lock") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->insert_lock = v; } else if (!strcmp(key, "ignore_leading_white_space") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->ignore_leading_white_space = v; } else if (!strcmp(key, "parallel_mode") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->parallel_mode = v; } else if (!strcmp(key, "pgpool2_hostname") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if(strlen(str)) pool_config->pgpool2_hostname = str; } else if (!strcmp(key, "system_db_hostname") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->system_db_hostname = str; } else if (!strcmp(key, "system_db_port") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->system_db_port = v; } else if (!strcmp(key, "system_db_dbname") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->system_db_dbname = str; } else if (!strcmp(key, "system_db_schema") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->system_db_schema = str; } else if (!strcmp(key, "system_db_user") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->system_db_user = str; } else if (!strcmp(key, "system_db_password") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->system_db_password = str; } else if (!strncmp(key, "backend_hostname", 16) && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context) && mypid == getpid()) /* this parameter must be modified by parent pid */ { int slot; char *str; slot = atoi(key + 16); if (slot < 0 || slot >= MAX_CONNECTION_SLOTS) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid slot no :\"%d\" for key:\"%s\"", slot,key), errhint("backend number must be between 0 and %d inclusive",MAX_CONNECTION_SLOTS))); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if (context == INIT_CONFIG || (context == RELOAD_CONFIG && BACKEND_INFO(slot).backend_status == CON_UNUSED)) strlcpy(BACKEND_INFO(slot).backend_hostname, str, MAX_DB_HOST_NAMELEN); } else if (!strncmp(key, "backend_port", 12) && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context) && mypid == getpid()) /* this parameter must be modified by parent pid */ { int slot; slot = atoi(key + 12); if (slot < 0 || slot >= MAX_CONNECTION_SLOTS) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid slot no :\"%d\" for key:\"%s\"", slot,key), errhint("backend port slot must be between 0 and %d inclusive",MAX_CONNECTION_SLOTS))); return(-1); } ereport(DEBUG1, (errmsg("initializing pool configuration"), errdetail("backend port slot number %d port: %d ", slot,atoi(yytext)))); if (context == INIT_CONFIG) { BACKEND_INFO(slot).backend_port = atoi(yytext); BACKEND_INFO(slot).backend_status = CON_CONNECT_WAIT; } else if (context == RELOAD_CONFIG && BACKEND_INFO(slot).backend_status == CON_UNUSED) { BACKEND_INFO(slot).backend_port = atoi(yytext); BACKEND_INFO(slot).backend_status = CON_DOWN; } } else if (!strncmp(key, "backend_weight", 14) && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context) && mypid == getpid()) /* this parameter must be modified by parent pid */ { int slot; double v; slot = atoi(key + 14); if (slot < 0 || slot >= MAX_CONNECTION_SLOTS) { fclose(fd); fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid slot no :\"%d\" for key:\"%s\"", slot,key), errhint("backend weight slot must be between 0 and %d inclusive",MAX_CONNECTION_SLOTS))); return(-1); } v = atof(yytext); if (v < 0.0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0.0"))); return(-1); } ereport(DEBUG1, (errmsg("initializing pool configuration"), errdetail("weight slot number %d weight: %f", slot, v))); if (context == INIT_CONFIG || context == RELOAD_CONFIG) { double old_v = BACKEND_INFO(slot).unnormalized_weight; BACKEND_INFO(slot).unnormalized_weight = v; /* * Log weight change event only when context is * reloading of pgpool.conf and weight is actually * changed */ if (context == RELOAD_CONFIG && old_v != v) { ereport(LOG, (errmsg("initializing pool configuration: backend weight for backend:%d changed from %f to %f", slot, old_v, v), errdetail("This change will be effective from next client session"))); } } } else if (!strncmp(key, "backend_data_directory", 22) && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context) && mypid == getpid()) /* this parameter must be modified by parent pid */ { int slot; char *str; BACKEND_STATUS status; slot = atoi(key + 22); if (slot < 0 || slot >= MAX_CONNECTION_SLOTS) { fclose(fd); fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid slot no :\"%d\" for key:\"%s\"", slot,key), errhint("backend data directory slot must be between 0 and %d inclusive",MAX_CONNECTION_SLOTS))); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } status = BACKEND_INFO(slot).backend_status; if (context == INIT_CONFIG || (context == RELOAD_CONFIG && (status == CON_UNUSED || status == CON_DOWN))) strlcpy(BACKEND_INFO(slot).backend_data_directory, str, MAX_PATH_LENGTH); } else if (!strncmp(key, "backend_flag", 12) && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context) && mypid == getpid()) /* this parameter must be modified by parent pid */ { char *str; char **flags; int n; int i; int slot; unsigned short flag = 0; bool allow_to_failover_is_specified = 0; bool disallow_to_failover_is_specified = 0; str = extract_string(yytext, token); if (str == NULL) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("extract_string failed: %s", yytext))); return(-1); } flags = extract_string_tokens(str, "|", &n); if (!flags || n < 0) { ereport(DEBUG1, (errmsg("initializing pool configuration"), errdetail("unable to get backend flags"))); fclose(fd); return(-1); } for (i=0;i= MAX_CONNECTION_SLOTS) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid slot no :\"%d\" for key:\"%s\"", slot,key), errhint("slot must be between 0 and %d inclusive",MAX_CONNECTION_SLOTS))); return(-1); } BACKEND_INFO(slot).flag = flag; ereport(DEBUG1, (errmsg("initializing pool configuration"), errdetail("backend slot number %d flag: %04x", slot, flag))); } else if (!strcmp(key, "log_statement") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->log_statement = v; } else if (!strcmp(key, "log_per_node_statement") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->log_per_node_statement = v; } else if (!strcmp(key, "lobj_lock_table") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->lobj_lock_table = str; } /* * add for watchdog */ else if (!strncmp(key, "other_pgpool_hostname", 21) && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context) && mypid == getpid()) /* this parameter must be modified by parent pid */ { int slot; char *str; slot = atoi(key + 21) ; if (slot < 0 || slot >= MAX_CONNECTION_SLOTS) { fclose(fd); fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid slot no :\"%d\" for key:\"%s\"", slot,key), errhint("slot must be between 0 and %d inclusive",MAX_CONNECTION_SLOTS))); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if (context == INIT_CONFIG || (context == RELOAD_CONFIG )) strlcpy(WD_INFO(slot).hostname, str, WD_MAX_HOST_NAMELEN); } else if (!strncmp(key, "other_pgpool_port", 17) && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context) && mypid == getpid()) /* this parameter must be modified by parent pid */ { int slot; slot = atoi(key + 17); if (slot < 0 || slot >= MAX_CONNECTION_SLOTS) { fclose(fd); fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid slot no :\"%d\" for key:\"%s\"", slot,key), errhint("slot must be between 0 and %d inclusive",MAX_CONNECTION_SLOTS))); return(-1); } if (context == INIT_CONFIG || (context == RELOAD_CONFIG )) WD_INFO(slot).pgpool_port = atoi(yytext); } else if (!strncmp(key, "other_wd_port", 13) && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context) && mypid == getpid()) /* this parameter must be modified by parent pid */ { int slot; slot = atoi(key + 13); if (slot < 0 || slot >= MAX_CONNECTION_SLOTS) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid slot no :\"%d\" for key:\"%s\"", slot,key), errhint("slot must be between 0 and %d inclusive",MAX_CONNECTION_SLOTS))); return(-1); } if (context == INIT_CONFIG || (context == RELOAD_CONFIG )) { WD_INFO(slot).wd_port = atoi(yytext); WD_INFO(slot).status = WD_INIT; pool_config->other_wd->num_wd = slot + 1; } } else if (!strcmp(key, "use_watchdog") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->use_watchdog = v; } else if (!strcmp(key, "clear_memqcache_on_escalation") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->clear_memqcache_on_escalation = v; } else if (!strcmp(key, "wd_escalation_command") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->wd_escalation_command = str; } else if (!strcmp(key, "trusted_servers") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if(strlen(str)) pool_config->trusted_servers = str; } else if (!strcmp(key, "delegate_IP") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if(strlen(str)) pool_config->delegate_IP = str; } else if (!strcmp(key, "wd_hostname") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if(strlen(str)) pool_config->wd_hostname = str; } else if (!strcmp(key, "wd_port") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v <= 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than 0"))); return(-1); } pool_config->wd_port = v; } else if (!strcmp(key, "wd_interval") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v <= 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than 0"))); return(-1); } pool_config->wd_interval = v; } else if (!strcmp(key, "ping_path") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if(strlen(str)) pool_config->ping_path = str; } else if (!strcmp(key, "ifconfig_path") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if(strlen(str)) pool_config->ifconfig_path = str; } else if (!strcmp(key, "if_up_cmd") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if(strlen(str)) pool_config->if_up_cmd = str; } else if (!strcmp(key, "if_down_cmd") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if(strlen(str)) pool_config->if_down_cmd = str; } else if (!strcmp(key, "arping_path") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if(strlen(str)) pool_config->arping_path = str; } else if (!strcmp(key, "arping_cmd") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if(strlen(str)) pool_config->arping_cmd = str; } else if (!strcmp(key, "wd_life_point") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v <= 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than 0"))); return(-1); } pool_config->wd_life_point = v; } else if (!strcmp(key, "wd_lifecheck_query") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if(strlen(str)) pool_config->wd_lifecheck_query = str; } else if (!strcmp(key, "wd_lifecheck_dbname") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->wd_lifecheck_dbname = str; } else if (!strcmp(key, "wd_lifecheck_user") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->wd_lifecheck_user = str; } else if (!strcmp(key, "wd_lifecheck_password") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->wd_lifecheck_password = str; } else if (!strcmp(key, "wd_lifecheck_method") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if (strcmp(str, MODE_HEARTBEAT) && strcmp(str, MODE_QUERY)) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("allowed values for configuration parameter %s can be either \"heartbeat\" or \"query\"", key))); return(-1); } pool_config->wd_lifecheck_method = str; } else if (!strcmp(key, "wd_heartbeat_port") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v <= 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than 0"))); return(-1); } pool_config->wd_heartbeat_port = v; } else if (!strcmp(key, "wd_heartbeat_keepalive") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v <= 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than 0"))); return(-1); } pool_config->wd_heartbeat_keepalive = v; } else if (!strcmp(key, "wd_heartbeat_deadtime") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v <= 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than 0"))); return(-1); } pool_config->wd_heartbeat_deadtime = v; } else if (!strcmp(key, "wd_authkey") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->wd_authkey = str; } else if (!strncmp(key, "heartbeat_device", 16) && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context) && mypid == getpid()) /* this parameter must be modified by parent pid */ { int slot; char *str; slot = atoi(key + 16) ; if (slot < 0 || slot >= WD_MAX_IF_NUM) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid slot no :\"%d\" for key:\"%s\"", slot,key), errhint("slot must be between 0 and %d inclusive",MAX_CONNECTION_SLOTS))); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if (context == INIT_CONFIG || (context == RELOAD_CONFIG )) strlcpy(WD_HB_IF(slot).if_name, str, WD_MAX_IF_NAME_LEN); } /* this must be prior to hertbeat_destination */ else if (!strncmp(key, "heartbeat_destination_port", 26) && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context) && mypid == getpid()) /* this parameter must be modified by parent pid */ { int slot; slot = atoi(key + 26) ; if (slot < 0 || slot >= WD_MAX_IF_NUM) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid slot no :\"%d\" for key:\"%s\"", slot,key), errhint("slot must be between 0 and %d inclusive",MAX_CONNECTION_SLOTS))); return(-1); } if (context == INIT_CONFIG || (context == RELOAD_CONFIG )) { WD_HB_IF(slot).dest_port = atoi(yytext); pool_config->num_hb_if = slot + 1; } } else if (!strncmp(key, "heartbeat_destination", 21) && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context) && mypid == getpid()) /* this parameter must be modified by parent pid */ { int slot; char *str; slot = atoi(key + 21) ; if (slot < 0 || slot >= WD_MAX_IF_NUM) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid slot no :\"%d\" for key:\"%s\"", slot,key), errhint("slot must be between 0 and %d inclusive",MAX_CONNECTION_SLOTS))); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if (context == INIT_CONFIG || (context == RELOAD_CONFIG )) strlcpy(WD_HB_IF(slot).addr, str, WD_MAX_HOST_NAMELEN); } else if (!strcmp(key, "ssl") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key))); return(-1); } pool_config->ssl = v; } else if (!strcmp(key, "ssl_cert") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->ssl_cert = str; } else if (!strcmp(key, "ssl_key") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->ssl_key = str; } else if (!strcmp(key, "ssl_ca_cert") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->ssl_ca_cert = str; } else if (!strcmp(key, "ssl_ca_cert_dir") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->ssl_ca_cert_dir = str; } else if (!strcmp(key, "debug_level") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } /* Consider -d option value stored in pool_config already */ pool_config->debug_level |= v; } else if (!strcmp(key, "relcache_expire") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->relcache_expire = v; } else if (!strcmp(key, "relcache_size") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 1) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 1"))); return(-1); } pool_config->relcache_size = v; } else if (!strcmp(key, "check_temp_table") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key))); return(-1); } pool_config->check_temp_table = v; } else if (!strcmp(key, "check_unlogged_table") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key))); return(-1); } pool_config->check_unlogged_table = v; } else if (!strcmp(key, "memory_cache_enabled") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key))); return(-1); } pool_config->memory_cache_enabled = v; } else if (!strcmp(key, "memqcache_method") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } if (!strcmp(str, "memcached") && !use_memcached) { fclose(fd); ereport(error_level, (errmsg("invalid configuration, Feature Not available"), errdetail("invalid value:\"%s\" for key:\"%s\", memcached not available because pgpool-II is not built with MEMCACHED support", yytext,key))); return -1; } if (strcmp(str, "memcached") && strcmp(str, "shmem")) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("allowed values for configuration parameter %s can be either \"shmem\" or \"memcached\"", str))); return -1; } pool_config->memqcache_method = str; } else if (!strcmp(key, "memqcache_memcached_host") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->memqcache_memcached_host = str; } else if (!strcmp(key, "memqcache_memcached_port") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->memqcache_memcached_port = v; } else if (!strcmp(key, "memqcache_total_size") && CHECK_CONTEXT(INIT_CONFIG, context)) { int64 v = atoll(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->memqcache_total_size = v; } else if (!strcmp(key, "memqcache_max_num_cache") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal 0"))); return(-1); } pool_config->memqcache_max_num_cache = v; } else if (!strcmp(key, "memqcache_expire") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal 0"))); return(-1); } pool_config->memqcache_expire = v; } else if (!strcmp(key, "memqcache_auto_cache_invalidation") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key))); return(-1); } pool_config->memqcache_auto_cache_invalidation = v; } else if (!strcmp(key, "memqcache_maxcache") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal 0"))); return(-1); } pool_config->memqcache_maxcache = v; } else if (!strcmp(key, "memqcache_cache_block_size") && CHECK_CONTEXT(INIT_CONFIG, context)) { int v = atoi(yytext); if (token != POOL_INTEGER || v < 512) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 512"))); return(-1); } pool_config->memqcache_cache_block_size = v; } else if (!strcmp(key, "memqcache_oiddir") && CHECK_CONTEXT(INIT_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->memqcache_oiddir = str; } else if (!strcmp(key, "white_memqcache_table_list") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->white_memqcache_table_list = extract_string_tokens(str, ",", &pool_config->num_white_memqcache_table_list); if (pool_config->white_memqcache_table_list == NULL) { fclose(fd); return(-1); } for (i=0;inum_white_memqcache_table_list;i++) { add_regex_pattern("white_memqcache_table_list", pool_config->white_memqcache_table_list[i]); } } else if (!strcmp(key, "black_memqcache_table_list") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->black_memqcache_table_list = extract_string_tokens(str, ",", &pool_config->num_black_memqcache_table_list); if (pool_config->black_memqcache_table_list == NULL) { fclose(fd); return(-1); } for (i=0;inum_black_memqcache_table_list;i++) { add_regex_pattern("black_memqcache_table_list", pool_config->black_memqcache_table_list[i]); } } else if (!strcmp(key, "database_redirect_preference_list") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; int i; Left_right_tokens *lrtokens; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->database_redirect_preference_list = str; lrtokens = create_lrtoken_array(); extract_string_tokens2(str, ",", ':', lrtokens); pool_config->redirect_dbnames = create_regex_array(); pool_config->db_redirect_tokens = lrtokens; for (i=0;ipos;i++) { if (!check_redirect_node_spec(lrtokens->token[i].right_token)) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("wrong redirect db node spec: \"%s\"", lrtokens->token[i].right_token))); return(-1); } if (*(lrtokens->token[i].left_token) == '\0' || add_regex_array(pool_config->redirect_dbnames, lrtokens->token[i].left_token)) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("wrong redirect dbname regular expression: \"%s\"", lrtokens->token[i].left_token))); return(-1); } } } else if (!strcmp(key, "app_name_redirect_preference_list") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { char *str; int i; Left_right_tokens *lrtokens; if (token != POOL_STRING && token != POOL_UNQUOTED_STRING && token != POOL_KEY) { PARSE_ERROR(); fclose(fd); return(-1); } str = extract_string(yytext, token); if (str == NULL) { fclose(fd); return(-1); } pool_config->app_name_redirect_preference_list = str; lrtokens = create_lrtoken_array(); extract_string_tokens2(str, ",", ':', lrtokens); pool_config->redirect_app_names = create_regex_array(); pool_config->app_name_redirect_tokens = lrtokens; for (i=0;ipos;i++) { if (!check_redirect_node_spec(lrtokens->token[i].right_token)) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("wrong redirect db node spec: \"%s\"", lrtokens->token[i].right_token))); return(-1); } if (*(lrtokens->token[i].left_token) == '\0' || add_regex_array(pool_config->redirect_app_names, lrtokens->token[i].left_token)) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("wrong redirect app name regular expression: \"%s\"", lrtokens->token[i].left_token))); return(-1); } } } else if (!strcmp(key, "allow_sql_comments") && CHECK_CONTEXT(INIT_CONFIG|RELOAD_CONFIG, context)) { int v = eval_logical(yytext); if (v < 0) { fclose(fd); ereport(error_level, (errmsg("invalid configuration for key \"%s\"",key), errdetail("invalid value:\"%s\" for key:\"%s\"", yytext,key), errhint("value must be greater than or equal to 0"))); return(-1); } pool_config->allow_sql_comments = v; } } fclose(fd); if (log_destination_changed) { /* log_destination has changed, we need to open syslog or close it */ if (!strcmp(pool_config->log_destination, "stderr")) { closelog(); pool_config->logsyslog = 0; } else { openlog(pool_config->syslog_ident, LOG_PID|LOG_NDELAY|LOG_NOWAIT, pool_config->syslog_facility); pool_config->logsyslog = 1; } } pool_config->backend_desc->num_backends = 0; total_weight = 0.0; for (i=0;ibackend_desc->num_backends = i+1; /* initialize backend_hostname with a default socket path if empty */ if (*(BACKEND_INFO(i).backend_hostname) == '\0') { if (pool_config->backend_socket_dir == NULL) { ereport(DEBUG1, (errmsg("initializing pool configuration"), errdetail("empty backend_hostname%d, use PostgreSQL's default unix socket path (%s)", i, DEFAULT_SOCKET_DIR))); strlcpy(BACKEND_INFO(i).backend_hostname, DEFAULT_SOCKET_DIR, MAX_DB_HOST_NAMELEN); } else /* DEPRECATED. backward compatibility with older version. Use backend_socket_dir*/ { ereport(DEBUG1, (errmsg("initializing pool configuration"), errdetail("empty backend_hostname%d, use backend_socket_dir as unix socket path (%s)", i, pool_config->backend_socket_dir))); strlcpy(BACKEND_INFO(i).backend_hostname, pool_config->backend_socket_dir, MAX_DB_HOST_NAMELEN); } } } } ereport(DEBUG1, (errmsg("initializing pool configuration"), errdetail("num_backends: %d total_weight: %f", pool_config->backend_desc->num_backends, total_weight))); /* * Normalize load balancing weights. What we are doing here is, * assign 0 to RAND_MAX to each backend's weight according to the * value weightN. For example, if two backends are assigned 1.0, * then each backend will get RAND_MAX/2 normalized weight. */ for (i=0;isystem_db_hostname == '\0') { ereport(DEBUG1, (errmsg("initializing pool configuration"), errdetail("empty system_db_hostname, use PostgreSQL's default unix socket path (%s)", DEFAULT_SOCKET_DIR))); strlcpy(pool_config->system_db_hostname, DEFAULT_SOCKET_DIR, MAX_DB_HOST_NAMELEN); } if (pool_config->parallel_mode) { #ifndef POOL_PRIVATE int dist_num; #endif SystemDBInfo *info; system_db_info = palloc(sizeof(POOL_SYSTEMDB_CONNECTION_POOL)); memset(system_db_info, 0, sizeof(*system_db_info)); #ifndef POOL_PRIVATE system_db_info->system_db_status = pool_shared_memory_create(sizeof(BACKEND_STATUS)); #else system_db_info->system_db_status = palloc(sizeof(BACKEND_STATUS)); #endif *system_db_info->system_db_status = CON_CONNECT_WAIT; /* which is the same as SYSDB_STATUS = CON_CONNECT_WAIT */ info = palloc(sizeof(SystemDBInfo)); system_db_info->info = info; info->hostname = pool_config->system_db_hostname; info->port = pool_config->system_db_port; info->user = pool_config->system_db_user; info->password = pool_config->system_db_password; info->database_name = pool_config->system_db_dbname; info->schema_name = pool_config->system_db_schema; info->dist_def_num = 0; info->dist_def_slot = NULL; #ifndef POOL_PRIVATE if (pool_config->parallel_mode) { dist_num = pool_memset_system_db_info(info); if(dist_num < 0) { ereport(ERROR, (errmsg("invalid configuration, failed to get systemdb info"))); return(-1); } if (!pool_config->replication_mode && !pool_config->load_balance_mode) { ereport(ERROR, (errmsg("invalid configuration, parallel_mode requires replication_mode or load_balance_mode turned on"))); return(-1); } } SYSDB_STATUS = CON_UP; #endif } if (strcmp(pool_config->recovery_1st_stage_command, "") || strcmp(pool_config->recovery_2nd_stage_command, "")) { for (i=0;ibackend_desc->backend_info[i].backend_port != 0 && !strcmp(pool_config->backend_desc->backend_info[i].backend_data_directory, "")) { ereport(ERROR, (errmsg("invalid configuration, recovery_1st_stage_command and recovery_2nd_stage_command requires backend_data_directory to be set"))); return -1; } } } return 0; } static char *extract_string(char *value, POOL_TOKEN token) { char *ret; ret = pstrdup(value); if (token == POOL_STRING) { ret[strlen(ret)-1] = '\0'; return (ret+1); } return ret; } /* * Try to interpret value as boolean value. Valid values are: true, * false, yes, no, on, off, 1, 0; as well as unique prefixes thereof. * If the string parses okay, return true, else false. * If okay and result is not NULL, return the value in *result. * This function copied from PostgreSQL source code. */ static bool parse_bool_with_len(const char *value, size_t len, bool *result) { switch (*value) { case 't': case 'T': if (strncasecmp(value, "true", len) == 0) { if (result) *result = true; return true; } break; case 'f': case 'F': if (strncasecmp(value, "false", len) == 0) { if (result) *result = false; return true; } break; case 'y': case 'Y': if (strncasecmp(value, "yes", len) == 0) { if (result) *result = true; return true; } break; case 'n': case 'N': if (strncasecmp(value, "no", len) == 0) { if (result) *result = false; return true; } break; case 'o': case 'O': /* 'o' is not unique enough */ if (strncasecmp(value, "on", (len > 2 ? len : 2)) == 0) { if (result) *result = true; return true; } else if (strncasecmp(value, "off", (len > 2 ? len : 2)) == 0) { if (result) *result = false; return true; } break; case '1': if (len == 1) { if (result) *result = true; return true; } break; case '0': if (len == 1) { if (result) *result = false; return true; } break; default: break; } if (result) *result = false; /* suppress compiler warning */ return false; } int eval_logical(char *str) { bool result; if (!parse_bool_with_len(str, strlen(str), &result)) return -1; return (result ? 1 : 0); } /* * Extract tokens separated by delimi from str. Return value is an * array of pointers in pallocd strings. number of tokens is set to * n; note that str will be destroyed by strtok(). */ #define MAXTOKENS 1024 static char **extract_string_tokens(char *str, char *delimi, int *n) { char *token; static char **tokens; *n = 0; tokens = palloc(MAXTOKENS*sizeof(char *)); for (token = strtok(str, delimi); token != NULL && *n < MAXTOKENS; token = strtok(NULL, delimi)) { tokens[*n] = pstrdup(token); ereport(DEBUG3, (errmsg("initializing pool configuration"), errdetail("extracting string tokens [token: %s]", tokens[*n]))); (*n)++; } return tokens; } static void clear_host_entry(int slot) { *pool_config->backend_desc->backend_info[slot].backend_hostname = '\0'; pool_config->backend_desc->backend_info[slot].backend_port = 0; pool_config->backend_desc->backend_info[slot].backend_status = CON_UNUSED; pool_config->backend_desc->backend_info[slot].backend_weight = 0.0; } #ifdef DEBUG static void print_host_entry(int slot) { ereport(DEBUG1, (errmsg("initializing pool configuration"), errdetail("slot: %d host: %s port: %d status: %d weight: %f", slot, pool_config->server_hostnames[slot], pool_config->server_ports[slot], pool_config->server_status[slot], pool_config->server_weights[slot]))); } #endif /* Use to set the syslog facility level if logsyslog is activated */ int set_syslog_facility(char *value) { int facility = LOG_LOCAL0; if (value == NULL) return facility; if (strncmp(value, "LOCAL", 5) == 0 && strlen(value) == 6) { switch (value[5]) { case '0': facility = LOG_LOCAL0; break; case '1': facility = LOG_LOCAL1; break; case '2': facility = LOG_LOCAL2; break; case '3': facility = LOG_LOCAL3; break; case '4': facility = LOG_LOCAL4; break; case '5': facility = LOG_LOCAL5; break; case '6': facility = LOG_LOCAL6; break; case '7': facility = LOG_LOCAL7; break; } } return facility; } /* * Translate binary form of backend flag to string. * The returned data is in static buffer, and it will be destroyed * at the next call to this function. */ char *pool_flag_to_str(unsigned short flag) { static char buf[1024]; /* should be large enough */ if (POOL_ALLOW_TO_FAILOVER(flag)) snprintf(buf, sizeof(buf), "ALLOW_TO_FAILOVER"); else if (POOL_DISALLOW_TO_FAILOVER(flag)) snprintf(buf, sizeof(buf), "DISALLOW_TO_FAILOVER"); return buf; } /* * Check DB node spec. node spec should be either "primary", "standby" or * numeric DB node id. */ bool check_redirect_node_spec(char *node_spec) { int len = strlen(node_spec); int i; long val; if (len <= 0) return false; if (strcasecmp("primary", node_spec) == 0) { return true; } if (strcasecmp("standby", node_spec) == 0) { return true; } for (i=0;i=0 && val < MAX_NUM_BACKENDS) return true; return false; } pgpool-II-3.4.3/src/tools/pgmd5/pool_globals.c0000664000076400007640000000211712554350605016044 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2010 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation, and that the name of the * author not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. The author makes no representations about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * * Global variables. Should be eventually removed. */ #include "pool.h" int debug = 0; /* non 0 if debug option is given (-d). pcp only */ pid_t mypid; /* pgpool parent process id */ bool run_as_pcp_child; ProcessType processType; ProcessState processState; pgpool-II-3.4.3/src/tools/pgmd5/Makefile.am0000664000076400007640000000167112554350605015264 00000000000000AM_CPPFLAGS = -D_GNU_SOURCE -DPOOL_PRIVATE -I @PGSQL_INCLUDE_DIR@ bin_PROGRAMS = pg_md5 pg_md5_SOURCES = pg_md5.c \ md5.c \ pool_passwd.c \ pool_signal.c \ strlcpy.c \ regex_array.c \ pool_config.l \ ../fe_port.c \ fe_memutils.c \ pool_globals.c DEFS = @DEFS@ \ -DDEFAULT_CONFIGDIR=\"$(sysconfdir)\" -DPOOL_TOOLS md5.c: ../../../src/auth/md5.c rm -f $@ && ln -s $< . md5.h: ../../../src/include/auth/md5.h rm -f $@ && ln -s $< . pool_passwd.c: ../../../src/auth/pool_passwd.c rm -f $@ && ln -s $< . pool_signal.c: ../../../src/utils/pool_signal.c rm -f $@ && ln -s $< . strlcpy.c: ../../../src/utils/strlcpy.c rm -f $@ && ln -s $< . regex_array.c: ../../../src/utils/regex_array.c rm -f $@ && ln -s $< . pool_config.l: ../../../src/config/pool_config.l rm -f $@ && ln -s $< . fe_memutils.c: ../../../src/tools/fe_memutils.c rm -f $@ && ln -s $< . pool_globals.c: ../../../src/main/pool_globals.c rm -f $@ && ln -s $< . pgpool-II-3.4.3/src/tools/pgmd5/Makefile.in0000664000076400007640000005365312554350605015304 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = pg_md5$(EXEEXT) subdir = src/tools/pgmd5 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs pool_config.c \ $(top_srcdir)/depcomp $(top_srcdir)/ylwrap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/c-compiler.m4 $(top_srcdir)/c-library.m4 \ $(top_srcdir)/general.m4 \ $(top_srcdir)/ac_func_accept_argtypes.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am__dirstamp = $(am__leading_dot)dirstamp am_pg_md5_OBJECTS = pg_md5.$(OBJEXT) md5.$(OBJEXT) \ pool_passwd.$(OBJEXT) pool_signal.$(OBJEXT) strlcpy.$(OBJEXT) \ regex_array.$(OBJEXT) pool_config.$(OBJEXT) \ ../fe_port.$(OBJEXT) fe_memutils.$(OBJEXT) \ pool_globals.$(OBJEXT) pg_md5_OBJECTS = $(am_pg_md5_OBJECTS) pg_md5_LDADD = $(LDADD) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = @MAINTAINER_MODE_FALSE@am__skiplex = test -f $@ || LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS) LTLEXCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(LEX) $(AM_LFLAGS) $(LFLAGS) AM_V_LEX = $(am__v_LEX_@AM_V@) am__v_LEX_ = $(am__v_LEX_@AM_DEFAULT_V@) am__v_LEX_0 = @echo " LEX " $@; am__v_LEX_1 = YLWRAP = $(top_srcdir)/ylwrap SOURCES = $(pg_md5_SOURCES) DIST_SOURCES = $(pg_md5_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ \ -DDEFAULT_CONFIGDIR=\"$(sysconfdir)\" -DPOOL_TOOLS DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MEMCACHED_DIR = @MEMCACHED_DIR@ MEMCACHED_INCLUDE_OPT = @MEMCACHED_INCLUDE_OPT@ MEMCACHED_LINK_OPT = @MEMCACHED_LINK_OPT@ MEMCACHED_RPATH_OPT = @MEMCACHED_RPATH_OPT@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PGCONFIG = @PGCONFIG@ PGSQL_INCLUDE_DIR = @PGSQL_INCLUDE_DIR@ PGSQL_LIB_DIR = @PGSQL_LIB_DIR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -D_GNU_SOURCE -DPOOL_PRIVATE -I @PGSQL_INCLUDE_DIR@ pg_md5_SOURCES = pg_md5.c \ md5.c \ pool_passwd.c \ pool_signal.c \ strlcpy.c \ regex_array.c \ pool_config.l \ ../fe_port.c \ fe_memutils.c \ pool_globals.c all: all-am .SUFFIXES: .SUFFIXES: .c .l .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/tools/pgmd5/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/tools/pgmd5/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ../$(am__dirstamp): @$(MKDIR_P) .. @: > ../$(am__dirstamp) ../$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../$(DEPDIR) @: > ../$(DEPDIR)/$(am__dirstamp) ../fe_port.$(OBJEXT): ../$(am__dirstamp) ../$(DEPDIR)/$(am__dirstamp) pg_md5$(EXEEXT): $(pg_md5_OBJECTS) $(pg_md5_DEPENDENCIES) $(EXTRA_pg_md5_DEPENDENCIES) @rm -f pg_md5$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pg_md5_OBJECTS) $(pg_md5_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f ../*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@../$(DEPDIR)/fe_port.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fe_memutils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pg_md5.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pool_config.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pool_globals.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pool_passwd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pool_signal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regex_array.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strlcpy.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< .l.c: $(AM_V_LEX)$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../$(DEPDIR)/$(am__dirstamp) -rm -f ../$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -rm -f pool_config.c clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ../$(DEPDIR) ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ../$(DEPDIR) ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS md5.c: ../../../src/auth/md5.c rm -f $@ && ln -s $< . md5.h: ../../../src/include/auth/md5.h rm -f $@ && ln -s $< . pool_passwd.c: ../../../src/auth/pool_passwd.c rm -f $@ && ln -s $< . pool_signal.c: ../../../src/utils/pool_signal.c rm -f $@ && ln -s $< . strlcpy.c: ../../../src/utils/strlcpy.c rm -f $@ && ln -s $< . regex_array.c: ../../../src/utils/regex_array.c rm -f $@ && ln -s $< . pool_config.l: ../../../src/config/pool_config.l rm -f $@ && ln -s $< . fe_memutils.c: ../../../src/tools/fe_memutils.c rm -f $@ && ln -s $< . pool_globals.c: ../../../src/main/pool_globals.c rm -f $@ && ln -s $< . # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: pgpool-II-3.4.3/src/tools/pgmd5/pool_signal.c0000664000076400007640000001105612554350605015700 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Portions Copyright (c) 2003-2008, PgPool Global Development Group * Portions Copyright (c) 2003-2004, PostgreSQL Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation, and that the name of the * author not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. The author makes no representations about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. */ /* * Signal stuff. Stolen from PostgreSQL source code. */ #include "config.h" #include "pool.h" #include "utils/pool_signal.h" #include "utils/elog.h" #include #include #ifdef HAVE_SIGPROCMASK sigset_t UnBlockSig, BlockSig, AuthBlockSig; #else int UnBlockSig, BlockSig, AuthBlockSig; #endif /* * Initialize BlockSig, UnBlockSig, and AuthBlockSig. * * BlockSig is the set of signals to block when we are trying to block * signals. This includes all signals we normally expect to get, but NOT * signals that should never be turned off. * * AuthBlockSig is the set of signals to block during authentication; * it's essentially BlockSig minus SIGTERM, SIGQUIT, SIGALRM. * * UnBlockSig is the set of signals to block when we don't want to block * signals (is this ever nonzero??) */ void poolinitmask(void) { #ifdef HAVE_SIGPROCMASK sigemptyset(&UnBlockSig); sigfillset(&BlockSig); sigfillset(&AuthBlockSig); /* * Unmark those signals that should never be blocked. Some of these * signal names don't exist on all platforms. Most do, but might as * well ifdef them all for consistency... */ #ifdef SIGTRAP sigdelset(&BlockSig, SIGTRAP); sigdelset(&AuthBlockSig, SIGTRAP); #endif #ifdef SIGABRT sigdelset(&BlockSig, SIGABRT); sigdelset(&AuthBlockSig, SIGABRT); #endif #ifdef SIGILL sigdelset(&BlockSig, SIGILL); sigdelset(&AuthBlockSig, SIGILL); #endif #ifdef SIGFPE sigdelset(&BlockSig, SIGFPE); sigdelset(&AuthBlockSig, SIGFPE); #endif #ifdef SIGSEGV sigdelset(&BlockSig, SIGSEGV); sigdelset(&AuthBlockSig, SIGSEGV); #endif #ifdef SIGBUS sigdelset(&BlockSig, SIGBUS); sigdelset(&AuthBlockSig, SIGBUS); #endif #ifdef SIGSYS sigdelset(&BlockSig, SIGSYS); sigdelset(&AuthBlockSig, SIGSYS); #endif #ifdef SIGCONT sigdelset(&BlockSig, SIGCONT); sigdelset(&AuthBlockSig, SIGCONT); #endif #ifdef SIGTERM sigdelset(&AuthBlockSig, SIGTERM); #endif #ifdef SIGQUIT sigdelset(&AuthBlockSig, SIGQUIT); #endif #ifdef SIGALRM sigdelset(&AuthBlockSig, SIGALRM); #endif #else UnBlockSig = 0; BlockSig = sigmask(SIGHUP) | sigmask(SIGQUIT) | sigmask(SIGTERM) | sigmask(SIGALRM) | sigmask(SIGINT) | sigmask(SIGUSR1) | sigmask(SIGUSR2) | sigmask(SIGCHLD) | sigmask(SIGWINCH) | sigmask(SIGFPE); AuthBlockSig = sigmask(SIGHUP) | sigmask(SIGINT) | sigmask(SIGUSR1) | sigmask(SIGUSR2) | sigmask(SIGCHLD) | sigmask(SIGWINCH) | sigmask(SIGFPE); #endif } /* Win32 signal handling is in backend/port/win32/signal.c */ #ifndef WIN32 /* * We need to check actually the system has the posix signals or not, but... */ #define HAVE_POSIX_SIGNALS /* * Set up a signal handler */ pool_sighandler_t pool_signal(int signo, pool_sighandler_t func) { #if !defined(HAVE_POSIX_SIGNALS) return signal(signo, func); #else struct sigaction act, oact; act.sa_handler = func; sigemptyset(&act.sa_mask); act.sa_flags = 0; if (signo != SIGALRM) act.sa_flags |= SA_RESTART; #ifdef SA_NOCLDSTOP if (signo == SIGCHLD) act.sa_flags |= SA_NOCLDSTOP; #endif if (sigaction(signo, &act, &oact) < 0) return SIG_ERR; return oact.sa_handler; #endif /* !HAVE_POSIX_SIGNALS */ } int pool_signal_parent(int sig) { /* * Check if saved parent pid is same as current parent. * This is a guard against sending the signal to init process * pgpool-II parent process crashed and left the child processes * orphan. */ if(mypid != getppid()) { /* * pgpool parent is no more alive, commiting sucide. */ ereport(PANIC, (errmsg("pgpool-II main process died unexpectedly. exiting current process"))); } ereport(DEBUG1, (errmsg("sending %d to the parent process with PID:%d", sig ,mypid))); return kill(mypid, sig); } #endif /* WIN32 */ pgpool-II-3.4.3/src/tools/pgmd5/regex_array.c0000664000076400007640000001123412554350605015700 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2015 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation, and that the name of the * author not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. The author makes no representations about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * */ /* * This module handles regular expressio arrary. */ #include #include "pool.h" #include "pool_config.h" #include "utils/regex_array.h" #ifndef POOL_PRIVATE #include "utils/elog.h" #include "utils/palloc.h" #else #include "utils/fe_ports.h" #endif /* * Create RegArray object */ RegArray *create_regex_array(void) { RegArray *ar; ar = palloc(sizeof(RegArray)); ar->pos = 0; ar->size = AR_ALLOC_UNIT; ar->regex = (regex_t **)palloc(sizeof(regex_t *) * ar->size); return ar; } /* * Add an regular expression pattern */ int add_regex_array(RegArray *ar, char *pattern) { int regex_flags; regex_t *regex; char *pat; int len; if (ar == NULL) { ereport(WARNING, (errmsg("failed to add regex pattern, regex array is NULL"))); return -1; } if (pattern == NULL) { ereport(WARNING, (errmsg("failed to add regex pattern, regex pattern is NULL"))); return -1; } len = strlen(pattern); /* Force case insensitive pattern matching */ regex_flags = REG_NOSUB; regex_flags |= REG_ICASE; /* Add extended regex search */ regex_flags |= REG_EXTENDED; pat = palloc(sizeof(char)*(len+3)); if (strncmp(pattern, "^", 1) != 0) { strncpy(pat, "^", 2); strncat(pat, pattern, len + 1); } else { strncpy(pat, pattern, len + 1); } if (len == 0 || (len > 0 && pattern[len - 1] != '$')) { strncat(pat, "$", 2); } /* Compile our regex */ regex = palloc(sizeof(regex_t)); if (regcomp(regex, pat, regex_flags) != 0) { ereport(WARNING, (errmsg("failed to add regex pattern, invalid regex pattern: \"%s\" (%s)", pattern, pat))); pfree(regex); pfree(pat); return -1; } pfree(pat); if (ar->pos == ar->size) { ar->size += AR_ALLOC_UNIT; ar->regex = repalloc(ar->regex, sizeof(regex_t *) * ar->size); } ar->regex[ar->pos] = regex; ar->pos++; return 0; } /* * Execute regex matching. Returns matched array index. */ int regex_array_match(RegArray *ar, char *pattern) { int i; if (ar == NULL) { ereport(WARNING, (errmsg("failed to execute regex matching, regex array is NULL"))); return -1; } if (pattern == NULL) { ereport(WARNING, (errmsg("failed to execute regex matching, pattern is NULL"))); return -1; } for (i=0;ipos;i++) { if (regexec(ar->regex[i], pattern, 0, 0, 0) == 0) return i; } return -1; } /* * Destroy RegArray object */ void destroy_regex_arrary(RegArray *ar) { pfree(ar->regex); pfree(ar); } /* * Create L-R token array */ Left_right_tokens *create_lrtoken_array(void) { Left_right_tokens *ar; ar = palloc(sizeof(Left_right_tokens)); ar->pos = 0; ar->size = AR_ALLOC_UNIT; ar->token = (Left_right_token *)palloc(sizeof(Left_right_token) * ar->size); return ar; } /* * Extract tokens separated by delimi from str. Each token is separeted by delim2, * and token lists are returned to left_tokens and right_tokens respectively. * Nnumber of tokens is set to *n. */ void extract_string_tokens2(char *str, char *delimi, char delimi2, Left_right_tokens *lrtokens) { char *token; char *mystr; mystr = pstrdup(str); for (token = strtok(mystr, delimi); token != NULL; token = strtok(NULL, delimi)) { int len; char *left_token; char *right_token; int i,j; len = strlen(token)+1; left_token = palloc(len); right_token = palloc(len); for (i=0;token[i] && token[i] != delimi2;i++) left_token[i] = token[i]; left_token[i] = '\0'; if (i == len -1) { pfree(mystr); return; } /* Skip delimiter 2 */ i++; j = 0; for (;token[i];i++) right_token[j++] = token[i]; right_token[j] = '\0'; if (lrtokens->pos == lrtokens->size) { lrtokens->size += AR_ALLOC_UNIT; lrtokens->token = repalloc(lrtokens->token, sizeof(Left_right_token) * lrtokens->size); } lrtokens->token[lrtokens->pos].left_token = left_token; lrtokens->token[lrtokens->pos].right_token = right_token; lrtokens->pos++; } pfree(mystr); } pgpool-II-3.4.3/src/tools/pgmd5/strlcpy.c0000664000076400007640000000466312554350605015100 00000000000000/* -*-pgsql-c-*- */ /* * * $Header$ * * This file was imported from PostgreSQL source code. * See below for the copyright and description. * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Portions Copyright (c) 2003-2008 PgPool Global Development Group * */ /*------------------------------------------------------------------------- * * strlcpy.c * strncpy done right * * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group * * * IDENTIFICATION * $PostgreSQL: pgsql/src/port/strlcpy.c,v 1.3 2006/10/04 00:30:14 momjian Exp $ * * This file was taken from OpenBSD and is used on platforms that don't * provide strlcpy(). The OpenBSD copyright terms follow. *------------------------------------------------------------------------- */ /* $OpenBSD: strlcpy.c,v 1.11 2006/05/05 15:27:38 millert Exp $ */ /* * Copyright (c) 1998 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include #include "pool.h" /* * Copy src to string dst of size siz. At most siz-1 characters * will be copied. Always NUL terminates (unless siz == 0). * Returns strlen(src); if retval >= siz, truncation occurred. * Function creation history: http://www.gratisoft.us/todd/papers/strlcpy.html */ size_t strlcpy(char *dst, const char *src, size_t siz) { char *d = dst; const char *s = src; size_t n = siz; /* Copy as many bytes as will fit */ if (n != 0) { while (--n != 0) { if ((*d++ = *s++) == '\0') break; } } /* Not enough room in dst, add NUL and traverse rest of src */ if (n == 0) { if (siz != 0) *d = '\0'; /* NUL-terminate dst */ while (*s++) ; } return (s - src - 1); /* count does not include NUL */ } pgpool-II-3.4.3/src/tools/pcp/0002775000076400007640000000000012554350620013050 500000000000000pgpool-II-3.4.3/src/tools/pcp/pcp_systemdb_info.c0000664000076400007640000001061512554350605016647 00000000000000/* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2008 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation, and that the name of the * author not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. The author makes no representations about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * * Client program to send "systemDB info" command. */ #include #include #include #include #ifdef HAVE_GETOPT_H #include #else #include "utils/getopt_long.h" #endif #include "pcp/pcp.h" static void usage(void); static void myexit(ErrorCode e); int main(int argc, char **argv) { long timeout; char host[MAX_DB_HOST_NAMELEN]; int port; char user[MAX_USER_PASSWD_LEN]; char pass[MAX_USER_PASSWD_LEN]; SystemDBInfo *systemdb_info; int i, j; int ch; int optindex; static struct option long_options[] = { {"debug", no_argument, NULL, 'd'}, {"help", no_argument, NULL, 'h'}, {NULL, 0, NULL, 0} }; while ((ch = getopt_long(argc, argv, "hd", long_options, &optindex)) != -1) { switch (ch) { case 'd': pcp_enable_debug(); break; case 'h': case '?': default: usage(); exit(0); } } argc -= optind; argv += optind; if (argc != 5) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } timeout = atol(argv[0]); if (timeout < 0) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(host, argv[1]); port = atoi(argv[2]); if (port <= 1024 || port > 65535) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(user, argv[3]); if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(pass, argv[4]); if (pcp_connect(host, port, user, pass)) { pcp_errorstr(errorcode); myexit(errorcode); } if ((systemdb_info = pcp_systemdb_info()) == NULL) { pcp_errorstr(errorcode); pcp_disconnect(); myexit(errorcode); } else { printf("%s %d %s %s %s %s %d %d\n", systemdb_info->hostname, systemdb_info->port, systemdb_info->user, systemdb_info->password[0] == '\0' ? "''" : systemdb_info->password, systemdb_info->schema_name, systemdb_info->database_name, systemdb_info->dist_def_num, systemdb_info->system_db_status); for (i = 0; i < systemdb_info->dist_def_num; i++) { DistDefInfo *ddi = &systemdb_info->dist_def_slot[i]; printf("%s %s %s %s %d ", ddi->dbname, ddi->schema_name, ddi->table_name, ddi->dist_key_col_name, ddi->col_num); for (j = 0; j < ddi->col_num; j++) printf("%s ", ddi->col_list[j]); for (j = 0; j < ddi->col_num; j++) printf("%s ", ddi->type_list[j]); printf("%s\n", ddi->dist_def_func); } free_systemdb_info(systemdb_info); } pcp_disconnect(); return 0; } static void usage(void) { fprintf(stderr, "pcp_systemdb_info - display the pgpool-II systemDB information\n\n"); fprintf(stderr, "Usage: pcp_systemdb_info [-d] timeout hostname port# username password\n"); fprintf(stderr, "Usage: pcp_systemdb_info -h\n\n"); fprintf(stderr, " -d, --debug : enable debug message (optional)\n"); fprintf(stderr, " timeout : connection timeout value in seconds. command exits on timeout\n"); fprintf(stderr, " hostname : pgpool-II hostname\n"); fprintf(stderr, " port# : PCP port number\n"); fprintf(stderr, " username : username for PCP authentication\n"); fprintf(stderr, " password : password for PCP authentication\n"); fprintf(stderr, " -h, --help : print this help\n"); } static void myexit(ErrorCode e) { if (e == INVALERR) { usage(); exit(e); } exit(e); } pgpool-II-3.4.3/src/tools/pcp/pcp_proc_info.c0000664000076400007640000001413112554350605015755 00000000000000/* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2008 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation, and that the name of the * author not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. The author makes no representations about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * * Client program to send "process info" command. */ #include #include #include #include #ifdef HAVE_GETOPT_H #include #else #include "utils/getopt_long.h" #endif #include #include "pcp/pcp.h" static void usage(void); static void myexit(ErrorCode e); int main(int argc, char **argv) { long timeout; char host[MAX_DB_HOST_NAMELEN]; int port; char user[MAX_USER_PASSWD_LEN]; char pass[MAX_USER_PASSWD_LEN]; int processID; ProcessInfo *process_info; int array_size; int ch; int optindex; char * frmt; bool verbose = false; bool all = false; static struct option long_options[] = { {"debug", no_argument, NULL, 'd'}, {"help", no_argument, NULL, 'h'}, {"verbose", no_argument, NULL, 'v'}, {NULL, 0, NULL, 0} }; while ((ch = getopt_long(argc, argv, "hdva", long_options, &optindex)) != -1) { switch (ch) { case 'd': pcp_enable_debug(); break; case 'v': verbose = true; break; case 'a': all = true; break; case 'h': case '?': default: usage(); exit(0); } } argc -= optind; argv += optind; if (verbose) { if (all) frmt = "Database : %s\n" "Username : %s\n" "Start time : %s\n" "Creation time: %s\n" "Major : %d\n" "Minor : %d\n" "Counter : %d\n" "Backend PID : %d\n" "Connected : %d\n" "PID : %d\n" "Backend ID : %d\n"; else frmt = "Database : %s\n" "Username : %s\n" "Start time : %s\n" "Creation time: %s\n" "Major : %d\n" "Minor : %d\n" "Counter : %d\n" "Backend PID : %d\n" "Connected : %d\n"; } else { if (all) frmt = "%s %s %s %s %d %d %d %d %d %d %d\n"; else frmt = "%s %s %s %s %d %d %d %d %d\n"; } if (!(argc == 5 || argc == 6)) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } timeout = atol(argv[0]); if (timeout < 0) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(host, argv[1]); port = atoi(argv[2]); if (port <= 1024 || port > 65535) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(user, argv[3]); if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(pass, argv[4]); if (argc == 6) { processID = atoi(argv[5]); if (processID < 0) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } } else { processID = 0; } pcp_set_timeout(timeout); if (pcp_connect(host, port, user, pass)) { pcp_errorstr(errorcode); myexit(errorcode); } if ((process_info = pcp_process_info(processID, &array_size)) == NULL) { pcp_errorstr(errorcode); pcp_disconnect(); myexit(errorcode); } else { int i; char strcreatetime[128]; char strstarttime[128]; for (i = 0; i < array_size; i++) { if ((!all) && (process_info[i].connection_info->database[0] == '\0')) continue; *strcreatetime = *strstarttime = '\0'; if (process_info[i].start_time) strftime(strstarttime, 128, "%Y-%m-%d %H:%M:%S", localtime(&process_info[i].start_time)); if (process_info[i].connection_info->create_time) strftime(strcreatetime, 128, "%Y-%m-%d %H:%M:%S", localtime(&process_info[i].connection_info->create_time)); printf(frmt, process_info[i].connection_info->database, process_info[i].connection_info->user, strstarttime, strcreatetime, process_info[i].connection_info->major, process_info[i].connection_info->minor, process_info[i].connection_info->counter, process_info[i].connection_info->pid, process_info[i].connection_info->connected, process_info[i].pid, process_info[i].connection_info->backend_id); } free(process_info->connection_info); free(process_info); } pcp_disconnect(); return 0; } static void usage(void) { fprintf(stderr, "pcp_proc_info - display a pgpool-II child process' information\n\n"); fprintf(stderr, "Usage: pcp_proc_info [-d] timeout hostname port# username password [PID]\n"); fprintf(stderr, " -d, --debug : enable debug message (optional)\n"); fprintf(stderr, " timeout : connection timeout value in seconds. command exits on timeout\n"); fprintf(stderr, " hostname : pgpool-II hostname\n"); fprintf(stderr, " port# : PCP port number\n"); fprintf(stderr, " username : username for PCP authentication\n"); fprintf(stderr, " password : password for PCP authentication\n"); fprintf(stderr, " PID : if given, PID of the only child process to get information for\n\n"); fprintf(stderr, "Usage: pcp_proc_info [options]\n"); fprintf(stderr, " Options available are:\n"); fprintf(stderr, " -h, --help : print this help\n"); fprintf(stderr, " -v, --verbose : display one line per information with a header\n"); fprintf(stderr, " -a, --all : display all child processes and their available connection slots.\n"); } static void myexit(ErrorCode e) { if (e == INVALERR) { usage(); exit(e); } exit(e); } pgpool-II-3.4.3/src/tools/pcp/pcp_proc_count.c0000664000076400007640000000721412554350605016156 00000000000000/* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2008 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation, and that the name of the * author not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. The author makes no representations about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * * Client program to send "process count" command. */ #include #include #include #include #ifdef HAVE_GETOPT_H #include #else #include "utils/getopt_long.h" #endif #include "pcp/pcp.h" static void usage(void); static void myexit(ErrorCode e); int main(int argc, char **argv) { long timeout; char host[MAX_DB_HOST_NAMELEN]; int port; char user[MAX_USER_PASSWD_LEN]; char pass[MAX_USER_PASSWD_LEN]; int process_count; int *process_list = NULL; int ch; int optindex; static struct option long_options[] = { {"debug", no_argument, NULL, 'd'}, {"help", no_argument, NULL, 'h'}, {NULL, 0, NULL, 0} }; while ((ch = getopt_long(argc, argv, "hd", long_options, &optindex)) != -1) { switch (ch) { case 'd': pcp_enable_debug(); break; case 'h': case '?': default: usage(); exit(0); } } argc -= optind; argv += optind; if (argc != 5) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } timeout = atol(argv[0]); if (timeout < 0) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(host, argv[1]); port = atoi(argv[2]); if (port <= 1024 || port > 65535) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(user, argv[3]); if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(pass, argv[4]); pcp_set_timeout(timeout); if (pcp_connect(host, port, user, pass)) { pcp_errorstr(errorcode); myexit(errorcode); } if ((process_list = pcp_process_count(&process_count)) == NULL) { pcp_errorstr(errorcode); pcp_disconnect(); myexit(errorcode); } else { int i; for (i = 0; i < process_count; i++) printf("%d ", process_list[i]); printf("\n"); free(process_list); } pcp_disconnect(); return 0; } static void usage(void) { fprintf(stderr, "pcp_proc_count - display the list of pgpool-II child process PIDs\n\n"); fprintf(stderr, "Usage: pcp_proc_count timeout hostname port# username password\n"); fprintf(stderr, "Usage: pcp_node_info -h\n\n"); fprintf(stderr, " timeout : connection timeout value in seconds. command exits on timeout\n"); fprintf(stderr, " hostname : pgpool-II hostname\n"); fprintf(stderr, " port# : PCP port number\n"); fprintf(stderr, " username : username for PCP authentication\n"); fprintf(stderr, " password : password for PCP authentication\n"); fprintf(stderr, " -h, --help : print this help\n"); } static void myexit(ErrorCode e) { if (e == INVALERR) { usage(); exit(e); } exit(e); } pgpool-II-3.4.3/src/tools/pcp/pcp_watchdog_info.c0000664000076400007640000001134212554350605016613 00000000000000/* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2013 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation, and that the name of the * author not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. The author makes no representations about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * * Client program to send "watchdog info" command. */ #include #include #include #include #ifdef HAVE_GETOPT_H #include #else #include "utils/getopt_long.h" #endif #include "pcp/pcp.h" static void usage(void); static void myexit(ErrorCode e); int main(int argc, char **argv) { long timeout; char host[MAX_DB_HOST_NAMELEN]; int port; char user[MAX_USER_PASSWD_LEN]; char pass[MAX_USER_PASSWD_LEN]; int wd_index; WdInfo *watchdog_info; int ch; int optindex; bool verbose = false; static struct option long_options[] = { {"debug", no_argument, NULL, 'd'}, {"help", no_argument, NULL, 'h'}, {"verbose", no_argument, NULL, 'v'}, {NULL, 0, NULL, 0} }; while ((ch = getopt_long(argc, argv, "hdv", long_options, &optindex)) != -1) { switch (ch) { case 'd': pcp_enable_debug(); break; case 'v': verbose = true; break; case 'h': case '?': default: usage(); exit(0); } } argc -= optind; argv += optind; if (!(argc == 5 || argc == 6)) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } timeout = atol(argv[0]); if (timeout < 0) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(host, argv[1]); port = atoi(argv[2]); if (port <= 1024 || port > 65535) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(user, argv[3]); if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(pass, argv[4]); if (argc == 6) { wd_index = atoi(argv[5]); if (wd_index < 0 || wd_index > MAX_WATCHDOG_NUM) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } wd_index++; } else { wd_index = 0; } pcp_set_timeout(timeout); if (pcp_connect(host, port, user, pass)) { pcp_errorstr(errorcode); myexit(errorcode); } if ((watchdog_info = pcp_watchdog_info(wd_index)) == NULL) { pcp_errorstr(errorcode); pcp_disconnect(); myexit(errorcode); } else { if (verbose) { printf("Hostname : %s\nPgpool port : %d\nWatchdog port: %d\nStatus : %d\n", watchdog_info->hostname, watchdog_info->pgpool_port, watchdog_info->wd_port, watchdog_info->status); } else { printf("%s %d %d %d\n", watchdog_info->hostname, watchdog_info->pgpool_port, watchdog_info->wd_port, watchdog_info->status); } free(watchdog_info); } pcp_disconnect(); return 0; } static void usage(void) { fprintf(stderr, "pcp_watchdog_info - display a pgpool-II watchdog's information\n\n"); fprintf(stderr, "Usage: pcp_watchdog_info [-d] timeout hostname port# username password [watchdogID]\n"); fprintf(stderr, " -d, --debug : enable debug message (optional)\n"); fprintf(stderr, " timeout : connection timeout value in seconds. command exits on timeout\n"); fprintf(stderr, " hostname : pgpool-II hostname\n"); fprintf(stderr, " port# : PCP port number\n"); fprintf(stderr, " username : username for PCP authentication\n"); fprintf(stderr, " password : password for PCP authentication\n"); fprintf(stderr, " watchdogID : ID of a other pgpool to get information for\n"); fprintf(stderr, " If omitted then get one's self information\n\n"); fprintf(stderr, "Usage: pcp_watchdog_info [options]\n"); fprintf(stderr, " Options available are:\n"); fprintf(stderr, " -h, --help : print this help\n"); fprintf(stderr, " -v, --verbose : display one line per information with a header\n"); } static void myexit(ErrorCode e) { if (e == INVALERR) { usage(); exit(e); } exit(e); } pgpool-II-3.4.3/src/tools/pcp/pcp_recovery_node.c0000664000076400007640000000733512554350605016652 00000000000000/* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2008 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation, and that the name of the * author not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. The author makes no representations about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * * Client program to send "attach node" command. */ #include #include #include #include #ifdef HAVE_GETOPT_H #include #else #include "utils/getopt_long.h" #endif #include "pcp/pcp.h" static void usage(void); static void myexit(ErrorCode e); int main(int argc, char **argv) { long timeout; char host[MAX_DB_HOST_NAMELEN]; int port; char user[MAX_USER_PASSWD_LEN]; char pass[MAX_USER_PASSWD_LEN]; int nodeID; int ch; int optindex; static struct option long_options[] = { {"debug", no_argument, NULL, 'd'}, {"help", no_argument, NULL, 'h'}, {NULL, 0, NULL, 0} }; while ((ch = getopt_long(argc, argv, "hd", long_options, &optindex)) != -1) { switch (ch) { case 'd': pcp_enable_debug(); break; case 'h': case '?': default: usage(); exit(0); } } argc -= optind; argv += optind; if (argc != 6) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } timeout = atol(argv[0]); if (timeout < 0) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(host, argv[1]); port = atoi(argv[2]); if (port <= 1024 || port > 65535) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(user, argv[3]); if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(pass, argv[4]); nodeID = atoi(argv[5]); if (nodeID < 0 || nodeID > MAX_NUM_BACKENDS) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } pcp_set_timeout(timeout); if (pcp_connect(host, port, user, pass)) { pcp_errorstr(errorcode); myexit(errorcode); } if (pcp_recovery_node(nodeID)) { pcp_errorstr(errorcode); pcp_disconnect(); myexit(errorcode); } pcp_disconnect(); return 0; } static void usage(void) { fprintf(stderr, "pcp_recovery_node - recovery a node\n\n"); fprintf(stderr, "Usage: pcp_recovery_node [-d] timeout hostname port# username password nodeID\n"); fprintf(stderr, "Usage: pcp_recovery_node -h\n\n"); fprintf(stderr, " -d, --debug : enable debug message (optional)\n"); fprintf(stderr, " timeout : connection timeout value in seconds. command exits on timeout\n"); fprintf(stderr, " hostname : pgpool-II hostname\n"); fprintf(stderr, " port# : PCP port number\n"); fprintf(stderr, " username : username for PCP authentication\n"); fprintf(stderr, " password : password for PCP authentication\n"); fprintf(stderr, " nodeID : ID of a node to recover\n"); fprintf(stderr, " -h, --help : print this help\n"); } static void myexit(ErrorCode e) { if (e == INVALERR) { usage(); exit(e); } exit(e); } pgpool-II-3.4.3/src/tools/pcp/pcp_stop_pgpool.c0000664000076400007640000000763512554350605016357 00000000000000/* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2013 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation, and that the name of the * author not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. The author makes no representations about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * * Client program to send "stop pgpool" command. */ #include #include #include #include #ifdef HAVE_GETOPT_H #include #else #include "utils/getopt_long.h" #endif #include "pcp/pcp.h" static void usage(void); static void myexit(ErrorCode e); int main(int argc, char **argv) { long timeout; char host[MAX_DB_HOST_NAMELEN]; int port; char user[MAX_USER_PASSWD_LEN]; char pass[MAX_USER_PASSWD_LEN]; char mode; int ch; int optindex; static struct option long_options[] = { {"debug", no_argument, NULL, 'd'}, {"help", no_argument, NULL, 'h'}, {NULL, 0, NULL, 0} }; while ((ch = getopt_long(argc, argv, "hd", long_options, &optindex)) != -1) { switch (ch) { case 'd': pcp_enable_debug(); break; case 'h': case '?': default: usage(); exit(0); } } argc -= optind; argv += optind; if (argc != 6) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } timeout = atol(argv[0]); if (timeout < 0) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(host, argv[1]); port = atoi(argv[2]); if (port <= 1024 || port > 65535) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(user, argv[3]); if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(pass, argv[4]); if (strlen(argv[5]) != 1) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } mode = argv[5][0]; if (mode != 's' && mode != 'f' && mode != 'i') { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } pcp_set_timeout(timeout); if (pcp_connect(host, port, user, pass)) { pcp_errorstr(errorcode); myexit(errorcode); } if (pcp_terminate_pgpool(mode)) { pcp_errorstr(errorcode); pcp_disconnect(); myexit(errorcode); } pcp_disconnect(); return 0; } static void usage(void) { fprintf(stderr, "pcp_stop_pgpool - terminate pgpool-II\n\n"); fprintf(stderr, "Usage: pcp_stop_pgpool [-d] timeout hostname port# username password mode\n"); fprintf(stderr, "Usage: pcp_stop_pgpool -h\n\n"); fprintf(stderr, " -d, --debug : enable debug message (optional)\n"); fprintf(stderr, " timeout : connection timeout value in seconds. command exits on timeout\n"); fprintf(stderr, " hostname : pgpool-II hostname\n"); fprintf(stderr, " port# : PCP port number\n"); fprintf(stderr, " username : username for PCP authentication\n"); fprintf(stderr, " password : password for PCP authentication\n"); fprintf(stderr, " mode : shutdown mode\n"); fprintf(stderr, " s - smart shutdown f - fast shutdown i - immediate shutdown\n"); fprintf(stderr, " -h, --help : print this help\n"); } static void myexit(ErrorCode e) { if (e == INVALERR) { usage(); exit(e); } exit(e); } pgpool-II-3.4.3/src/tools/pcp/pcp_attach_node.c0000664000076400007640000000735012554350605016255 00000000000000/* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2008 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation, and that the name of the * author not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. The author makes no representations about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * * Client program to send "attach node" command. */ #include #include #include #include #ifdef HAVE_GETOPT_H #include #else #include "utils/getopt_long.h" #endif #include "pcp/pcp.h" static void usage(void); static void myexit(ErrorCode e); int main(int argc, char **argv) { long timeout; char host[MAX_DB_HOST_NAMELEN]; int port; char user[MAX_USER_PASSWD_LEN]; char pass[MAX_USER_PASSWD_LEN]; int nodeID; int ch; int optindex; static struct option long_options[] = { {"debug", no_argument, NULL, 'd'}, {"help", no_argument, NULL, 'h'}, {NULL, 0, NULL, 0} }; while ((ch = getopt_long(argc, argv, "hd", long_options, &optindex)) != -1) { switch (ch) { case 'd': pcp_enable_debug(); break; case 'h': case '?': default: usage(); exit(0); } } argc -= optind; argv += optind; if (argc != 6) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } timeout = atol(argv[0]); if (timeout < 0) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(host, argv[1]); port = atoi(argv[2]); if (port <= 1024 || port > 65535) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(user, argv[3]); if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(pass, argv[4]); nodeID = atoi(argv[5]); if (nodeID < 0 || nodeID > MAX_NUM_BACKENDS) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } pcp_set_timeout(timeout); if (pcp_connect(host, port, user, pass)) { pcp_errorstr(errorcode); myexit(errorcode); } if (pcp_attach_node(nodeID)) { pcp_errorstr(errorcode); pcp_disconnect(); myexit(errorcode); } pcp_disconnect(); return 0; } static void usage(void) { fprintf(stderr, "pcp_attach_node - attach a node from pgpool-II\n\n"); fprintf(stderr, "Usage: pcp_attach_node [-d] timeout hostname port# username password nodeID\n"); fprintf(stderr, "Usage: pcp_attach_node -h\n\n"); fprintf(stderr, " -d, --debug : enable debug message (optional)\n"); fprintf(stderr, " timeout : connection timeout value in seconds. command exits on timeout\n"); fprintf(stderr, " hostname : pgpool-II hostname\n"); fprintf(stderr, " port# : PCP port number\n"); fprintf(stderr, " username : username for PCP authentication\n"); fprintf(stderr, " password : password for PCP authentication\n"); fprintf(stderr, " nodeID : ID of a node to be attached\n"); fprintf(stderr, " -h, --help : print this help\n"); } static void myexit(ErrorCode e) { if (e == INVALERR) { usage(); exit(e); } exit(e); } pgpool-II-3.4.3/src/tools/pcp/pcp_node_info.c0000664000076400007640000001112212554350605015734 00000000000000/* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2008 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation, and that the name of the * author not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. The author makes no representations about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * * Client program to send "node info" command. */ #include #include #include #include #ifdef HAVE_GETOPT_H #include #else #include "utils/getopt_long.h" #endif #include "pcp/pcp.h" static void usage(void); static void myexit(ErrorCode e); int main(int argc, char **argv) { long timeout; char host[MAX_DB_HOST_NAMELEN]; int port; char user[MAX_USER_PASSWD_LEN]; char pass[MAX_USER_PASSWD_LEN]; int nodeID; BackendInfo *backend_info; int ch; int optindex; bool verbose = false; static struct option long_options[] = { {"debug", no_argument, NULL, 'd'}, {"help", no_argument, NULL, 'h'}, {"verbose", no_argument, NULL, 'v'}, {NULL, 0, NULL, 0} }; while ((ch = getopt_long(argc, argv, "hdv", long_options, &optindex)) != -1) { switch (ch) { case 'd': pcp_enable_debug(); break; case 'v': verbose = true; break; case 'h': case '?': default: usage(); exit(0); } } argc -= optind; argv += optind; if (argc != 6) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } timeout = atol(argv[0]); if (timeout < 0) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(host, argv[1]); port = atoi(argv[2]); if (port <= 1024 || port > 65535) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(user, argv[3]); if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(pass, argv[4]); nodeID = atoi(argv[5]); if (nodeID < 0 || nodeID > MAX_NUM_BACKENDS) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } pcp_set_timeout(timeout); if (pcp_connect(host, port, user, pass)) { pcp_errorstr(errorcode); myexit(errorcode); } if ((backend_info = pcp_node_info(nodeID)) == NULL) { pcp_errorstr(errorcode); pcp_disconnect(); myexit(errorcode); } else { if (verbose) { printf("Hostname: %s\nPort : %d\nStatus : %d\nWeight : %f\n", backend_info->backend_hostname, backend_info->backend_port, backend_info->backend_status, backend_info->backend_weight/RAND_MAX); } else { printf("%s %d %d %f\n", backend_info->backend_hostname, backend_info->backend_port, backend_info->backend_status, backend_info->backend_weight/RAND_MAX); } free(backend_info); } pcp_disconnect(); return 0; } static void usage(void) { fprintf(stderr, "pcp_node_info - display a pgpool-II node's information\n\n"); fprintf(stderr, "Usage: pcp_node_info [-d] timeout hostname port# username password nodeID\n"); fprintf(stderr, " -d, --debug : enable debug message (optional)\n"); fprintf(stderr, " timeout : connection timeout value in seconds. command exits on timeout\n"); fprintf(stderr, " hostname : pgpool-II hostname\n"); fprintf(stderr, " port# : PCP port number\n"); fprintf(stderr, " username : username for PCP authentication\n"); fprintf(stderr, " password : password for PCP authentication\n"); fprintf(stderr, " nodeID : ID of a node to get information for\n\n"); fprintf(stderr, "Usage: pcp_node_info [options]\n"); fprintf(stderr, " Options available are:\n"); fprintf(stderr, " -h, --help : print this help\n"); fprintf(stderr, " -v, --verbose : display one line per information with a header\n"); } static void myexit(ErrorCode e) { if (e == INVALERR) { usage(); exit(e); } exit(e); } pgpool-II-3.4.3/src/tools/pcp/pcp_promote_node.c0000664000076400007640000001010412554350605016465 00000000000000/* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2011 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation, and that the name of the * author not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. The author makes no representations about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * * Client program to send "promote node" command. */ #include #include #include #include #ifdef HAVE_GETOPT_H #include #else #include "utils/getopt_long.h" #endif #include "pcp/pcp.h" static void usage(void); static void myexit(ErrorCode e); int main(int argc, char **argv) { long timeout; char host[MAX_DB_HOST_NAMELEN]; int port; char user[MAX_USER_PASSWD_LEN]; char pass[MAX_USER_PASSWD_LEN]; int nodeID; int ch; int optindex; bool gracefully = false; int sts; static struct option long_options[] = { {"debug", no_argument, NULL, 'd'}, {"gracefully", no_argument, NULL, 'g'}, {"help", no_argument, NULL, 'h'}, {NULL, 0, NULL, 0} }; while ((ch = getopt_long(argc, argv, "hdg", long_options, &optindex)) != -1) { switch (ch) { case 'd': pcp_enable_debug(); break; case 'g': gracefully = true; break; case 'h': case '?': default: usage(); exit(0); } } argc -= optind; argv += optind; if (argc != 6) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } timeout = atol(argv[0]); if (timeout < 0) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(host, argv[1]); port = atoi(argv[2]); if (port <= 1024 || port > 65535) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(user, argv[3]); if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(pass, argv[4]); nodeID = atoi(argv[5]); if (nodeID < 0 || nodeID > MAX_NUM_BACKENDS) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } pcp_set_timeout(timeout); if (pcp_connect(host, port, user, pass)) { pcp_errorstr(errorcode); myexit(errorcode); } if (gracefully) sts = pcp_promote_node_gracefully(nodeID); else sts = pcp_promote_node(nodeID); if (sts) { pcp_errorstr(errorcode); pcp_disconnect(); myexit(errorcode); } pcp_disconnect(); return 0; } static void usage(void) { fprintf(stderr, "pcp_promote_node - promote a node as new master from pgpool-II\n\n"); fprintf(stderr, "Usage: pcp_promote_node [-d][-g] timeout hostname port# username password nodeID\n"); fprintf(stderr, "Usage: pcp_promote_node -h\n\n"); fprintf(stderr, " -d, --debug : enable debug message (optional)\n"); fprintf(stderr, " -g, --gracefully : promote gracefully(optional)\n"); fprintf(stderr, " timeout : connection timeout value in seconds. command exits on timeout\n"); fprintf(stderr, " hostname : pgpool-II hostname\n"); fprintf(stderr, " port# : PCP port number\n"); fprintf(stderr, " username : username for PCP authentication\n"); fprintf(stderr, " password : password for PCP authentication\n"); fprintf(stderr, " nodeID : ID of a node to be promoted\n"); fprintf(stderr, " -h, --help : print this help\n"); } static void myexit(ErrorCode e) { if (e == INVALERR) { usage(); exit(e); } exit(e); } pgpool-II-3.4.3/src/tools/pcp/Makefile.am0000664000076400007640000000326112554350605015027 00000000000000libs_dir = $(top_srcdir)/src/libs AM_CPPFLAGS = -D_GNU_SOURCE -DPOOL_PRIVATE -I @PGSQL_INCLUDE_DIR@ bin_PROGRAMS = pcp_stop_pgpool \ pcp_node_count \ pcp_node_info \ pcp_proc_count \ pcp_proc_info \ pcp_systemdb_info \ pcp_detach_node \ pcp_attach_node \ pcp_recovery_node \ pcp_promote_node \ pcp_pool_status \ pcp_watchdog_info pcp_stop_pgpool_SOURCES = pcp_stop_pgpool.c ../fe_memutils.c pcp_stop_pgpool_LDADD = $(libs_dir)/pcp/libpcp.la pcp_node_count_SOURCES = pcp_node_count.c ../fe_memutils.c pcp_node_count_LDADD = $(libs_dir)/pcp/libpcp.la pcp_node_info_SOURCES = pcp_node_info.c ../fe_memutils.c pcp_node_info_LDADD = $(libs_dir)/pcp/libpcp.la pcp_proc_count_SOURCES = pcp_proc_count.c ../fe_memutils.c pcp_proc_count_LDADD = $(libs_dir)/pcp/libpcp.la pcp_proc_info_SOURCES = pcp_proc_info.c ../fe_memutils.c pcp_proc_info_LDADD = $(libs_dir)/pcp/libpcp.la pcp_systemdb_info_SOURCES = pcp_systemdb_info.c ../fe_memutils.c pcp_systemdb_info_LDADD = $(libs_dir)/pcp/libpcp.la pcp_detach_node_SOURCES = pcp_detach_node.c ../fe_memutils.c pcp_detach_node_LDADD = $(libs_dir)/pcp/libpcp.la pcp_attach_node_SOURCES = pcp_attach_node.c ../fe_memutils.c pcp_attach_node_LDADD = $(libs_dir)/pcp/libpcp.la pcp_recovery_node_SOURCES = pcp_recovery_node.c ../fe_memutils.c pcp_recovery_node_LDADD = $(libs_dir)/pcp/libpcp.la pcp_pool_status_SOURCES = pcp_pool_status.c ../fe_memutils.c pcp_pool_status_LDADD = $(libs_dir)/pcp/libpcp.la pcp_promote_node_SOURCES = pcp_promote_node.c ../fe_memutils.c pcp_promote_node_LDADD = $(libs_dir)/pcp/libpcp.la pcp_watchdog_info_SOURCES = pcp_watchdog_info.c ../fe_memutils.c pcp_watchdog_info_LDADD = $(libs_dir)/pcp/libpcp.la pgpool-II-3.4.3/src/tools/pcp/pcp_node_count.c0000664000076400007640000000712412554350605016140 00000000000000/* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2008 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation, and that the name of the * author not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. The author makes no representations about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * * Client program to send "node count" command. */ #include #include #include #include #ifdef HAVE_GETOPT_H #include #else #include "utils/getopt_long.h" #endif #include "pcp/pcp.h" static void usage(void); static void myexit(ErrorCode e); int main(int argc, char **argv) { long timeout; char host[MAX_DB_HOST_NAMELEN]; int port; char user[MAX_USER_PASSWD_LEN]; char pass[MAX_USER_PASSWD_LEN]; int node_count; int ch; int optindex; static struct option long_options[] = { {"debug", no_argument, NULL, 'd'}, {"help", no_argument, NULL, 'h'}, {NULL, 0, NULL, 0} }; while ((ch = getopt_long(argc, argv, "hd", long_options, &optindex)) != -1) { switch (ch) { case 'd': pcp_enable_debug(); break; case 'h': case '?': default: usage(); exit(0); } } argc -= optind; argv += optind; if (argc != 5) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } timeout = atol(argv[0]); if (timeout < 0) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(host, argv[1]); port = atoi(argv[2]); if (port <= 1024 || port > 65535) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(user, argv[3]); if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(pass, argv[4]); pcp_set_timeout(timeout); if (pcp_connect(host, port, user, pass)) { pcp_errorstr(errorcode); myexit(errorcode); } if ((node_count = pcp_node_count()) < 0) { pcp_errorstr(errorcode); pcp_disconnect(); myexit(errorcode); } else { printf("%d\n", node_count); } pcp_disconnect(); return 0; } static void usage(void) { fprintf(stderr, "pcp_node_count - display the total number of nodes under pgpool-II's control\n\n"); fprintf(stderr, "Usage: pcp_node_count [-d] timeout hostname port# username password\n"); fprintf(stderr, "Usage: pcp_node_count -h\n\n"); fprintf(stderr, " -d, --debug : enable debug message (optional)\n"); fprintf(stderr, " timeout : connection timeout value in seconds. command exits on timeout\n"); fprintf(stderr, " hostname : pgpool-II hostname\n"); fprintf(stderr, " port# : PCP port number\n"); fprintf(stderr, " username : username for PCP authentication\n"); fprintf(stderr, " password : password for PCP authentication\n"); fprintf(stderr, " -h, --help : print this help\n"); } static void myexit(ErrorCode e) { if (e == INVALERR) { usage(); exit(e); } exit(e); } pgpool-II-3.4.3/src/tools/pcp/pcp_pool_status.c0000664000076400007640000000736212554350605016363 00000000000000/* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2011 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation, and that the name of the * author not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. The author makes no representations about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * * Client program to send "pool status" command. */ #include #include #include #include #ifdef HAVE_GETOPT_H #include #else #include "utils/getopt_long.h" #endif #include "pcp/pcp.h" static void usage(void); static void myexit(ErrorCode e); int main(int argc, char **argv) { long timeout; char host[MAX_DB_HOST_NAMELEN]; int port; char user[MAX_USER_PASSWD_LEN]; char pass[MAX_USER_PASSWD_LEN]; POOL_REPORT_CONFIG *status; int ch; int i; int optindex; int array_size = 0; static struct option long_options[] = { {"debug", no_argument, NULL, 'd'}, {"help", no_argument, NULL, 'h'}, {NULL, 0, NULL, 0} }; while ((ch = getopt_long(argc, argv, "hd", long_options, &optindex)) != -1) { switch (ch) { case 'd': pcp_enable_debug(); break; case 'h': case '?': default: usage(); exit(0); } } argc -= optind; argv += optind; if (argc != 5) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } timeout = atol(argv[0]); if (timeout < 0) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(host, argv[1]); port = atoi(argv[2]); if (port <= 1024 || port > 65535) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(user, argv[3]); if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(pass, argv[4]); pcp_set_timeout(timeout); if (pcp_connect(host, port, user, pass)) { pcp_errorstr(errorcode); myexit(errorcode); } if ((status = pcp_pool_status(&array_size)) == NULL) { pcp_errorstr(errorcode); pcp_disconnect(); myexit(errorcode); } else { for (i=0; i&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = pcp_stop_pgpool$(EXEEXT) pcp_node_count$(EXEEXT) \ pcp_node_info$(EXEEXT) pcp_proc_count$(EXEEXT) \ pcp_proc_info$(EXEEXT) pcp_systemdb_info$(EXEEXT) \ pcp_detach_node$(EXEEXT) pcp_attach_node$(EXEEXT) \ pcp_recovery_node$(EXEEXT) pcp_promote_node$(EXEEXT) \ pcp_pool_status$(EXEEXT) pcp_watchdog_info$(EXEEXT) subdir = src/tools/pcp DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/c-compiler.m4 $(top_srcdir)/c-library.m4 \ $(top_srcdir)/general.m4 \ $(top_srcdir)/ac_func_accept_argtypes.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am__dirstamp = $(am__leading_dot)dirstamp am_pcp_attach_node_OBJECTS = pcp_attach_node.$(OBJEXT) \ ../fe_memutils.$(OBJEXT) pcp_attach_node_OBJECTS = $(am_pcp_attach_node_OBJECTS) pcp_attach_node_DEPENDENCIES = $(libs_dir)/pcp/libpcp.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am_pcp_detach_node_OBJECTS = pcp_detach_node.$(OBJEXT) \ ../fe_memutils.$(OBJEXT) pcp_detach_node_OBJECTS = $(am_pcp_detach_node_OBJECTS) pcp_detach_node_DEPENDENCIES = $(libs_dir)/pcp/libpcp.la am_pcp_node_count_OBJECTS = pcp_node_count.$(OBJEXT) \ ../fe_memutils.$(OBJEXT) pcp_node_count_OBJECTS = $(am_pcp_node_count_OBJECTS) pcp_node_count_DEPENDENCIES = $(libs_dir)/pcp/libpcp.la am_pcp_node_info_OBJECTS = pcp_node_info.$(OBJEXT) \ ../fe_memutils.$(OBJEXT) pcp_node_info_OBJECTS = $(am_pcp_node_info_OBJECTS) pcp_node_info_DEPENDENCIES = $(libs_dir)/pcp/libpcp.la am_pcp_pool_status_OBJECTS = pcp_pool_status.$(OBJEXT) \ ../fe_memutils.$(OBJEXT) pcp_pool_status_OBJECTS = $(am_pcp_pool_status_OBJECTS) pcp_pool_status_DEPENDENCIES = $(libs_dir)/pcp/libpcp.la am_pcp_proc_count_OBJECTS = pcp_proc_count.$(OBJEXT) \ ../fe_memutils.$(OBJEXT) pcp_proc_count_OBJECTS = $(am_pcp_proc_count_OBJECTS) pcp_proc_count_DEPENDENCIES = $(libs_dir)/pcp/libpcp.la am_pcp_proc_info_OBJECTS = pcp_proc_info.$(OBJEXT) \ ../fe_memutils.$(OBJEXT) pcp_proc_info_OBJECTS = $(am_pcp_proc_info_OBJECTS) pcp_proc_info_DEPENDENCIES = $(libs_dir)/pcp/libpcp.la am_pcp_promote_node_OBJECTS = pcp_promote_node.$(OBJEXT) \ ../fe_memutils.$(OBJEXT) pcp_promote_node_OBJECTS = $(am_pcp_promote_node_OBJECTS) pcp_promote_node_DEPENDENCIES = $(libs_dir)/pcp/libpcp.la am_pcp_recovery_node_OBJECTS = pcp_recovery_node.$(OBJEXT) \ ../fe_memutils.$(OBJEXT) pcp_recovery_node_OBJECTS = $(am_pcp_recovery_node_OBJECTS) pcp_recovery_node_DEPENDENCIES = $(libs_dir)/pcp/libpcp.la am_pcp_stop_pgpool_OBJECTS = pcp_stop_pgpool.$(OBJEXT) \ ../fe_memutils.$(OBJEXT) pcp_stop_pgpool_OBJECTS = $(am_pcp_stop_pgpool_OBJECTS) pcp_stop_pgpool_DEPENDENCIES = $(libs_dir)/pcp/libpcp.la am_pcp_systemdb_info_OBJECTS = pcp_systemdb_info.$(OBJEXT) \ ../fe_memutils.$(OBJEXT) pcp_systemdb_info_OBJECTS = $(am_pcp_systemdb_info_OBJECTS) pcp_systemdb_info_DEPENDENCIES = $(libs_dir)/pcp/libpcp.la am_pcp_watchdog_info_OBJECTS = pcp_watchdog_info.$(OBJEXT) \ ../fe_memutils.$(OBJEXT) pcp_watchdog_info_OBJECTS = $(am_pcp_watchdog_info_OBJECTS) pcp_watchdog_info_DEPENDENCIES = $(libs_dir)/pcp/libpcp.la AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(pcp_attach_node_SOURCES) $(pcp_detach_node_SOURCES) \ $(pcp_node_count_SOURCES) $(pcp_node_info_SOURCES) \ $(pcp_pool_status_SOURCES) $(pcp_proc_count_SOURCES) \ $(pcp_proc_info_SOURCES) $(pcp_promote_node_SOURCES) \ $(pcp_recovery_node_SOURCES) $(pcp_stop_pgpool_SOURCES) \ $(pcp_systemdb_info_SOURCES) $(pcp_watchdog_info_SOURCES) DIST_SOURCES = $(pcp_attach_node_SOURCES) $(pcp_detach_node_SOURCES) \ $(pcp_node_count_SOURCES) $(pcp_node_info_SOURCES) \ $(pcp_pool_status_SOURCES) $(pcp_proc_count_SOURCES) \ $(pcp_proc_info_SOURCES) $(pcp_promote_node_SOURCES) \ $(pcp_recovery_node_SOURCES) $(pcp_stop_pgpool_SOURCES) \ $(pcp_systemdb_info_SOURCES) $(pcp_watchdog_info_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MEMCACHED_DIR = @MEMCACHED_DIR@ MEMCACHED_INCLUDE_OPT = @MEMCACHED_INCLUDE_OPT@ MEMCACHED_LINK_OPT = @MEMCACHED_LINK_OPT@ MEMCACHED_RPATH_OPT = @MEMCACHED_RPATH_OPT@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PGCONFIG = @PGCONFIG@ PGSQL_INCLUDE_DIR = @PGSQL_INCLUDE_DIR@ PGSQL_LIB_DIR = @PGSQL_LIB_DIR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ libs_dir = $(top_srcdir)/src/libs AM_CPPFLAGS = -D_GNU_SOURCE -DPOOL_PRIVATE -I @PGSQL_INCLUDE_DIR@ pcp_stop_pgpool_SOURCES = pcp_stop_pgpool.c ../fe_memutils.c pcp_stop_pgpool_LDADD = $(libs_dir)/pcp/libpcp.la pcp_node_count_SOURCES = pcp_node_count.c ../fe_memutils.c pcp_node_count_LDADD = $(libs_dir)/pcp/libpcp.la pcp_node_info_SOURCES = pcp_node_info.c ../fe_memutils.c pcp_node_info_LDADD = $(libs_dir)/pcp/libpcp.la pcp_proc_count_SOURCES = pcp_proc_count.c ../fe_memutils.c pcp_proc_count_LDADD = $(libs_dir)/pcp/libpcp.la pcp_proc_info_SOURCES = pcp_proc_info.c ../fe_memutils.c pcp_proc_info_LDADD = $(libs_dir)/pcp/libpcp.la pcp_systemdb_info_SOURCES = pcp_systemdb_info.c ../fe_memutils.c pcp_systemdb_info_LDADD = $(libs_dir)/pcp/libpcp.la pcp_detach_node_SOURCES = pcp_detach_node.c ../fe_memutils.c pcp_detach_node_LDADD = $(libs_dir)/pcp/libpcp.la pcp_attach_node_SOURCES = pcp_attach_node.c ../fe_memutils.c pcp_attach_node_LDADD = $(libs_dir)/pcp/libpcp.la pcp_recovery_node_SOURCES = pcp_recovery_node.c ../fe_memutils.c pcp_recovery_node_LDADD = $(libs_dir)/pcp/libpcp.la pcp_pool_status_SOURCES = pcp_pool_status.c ../fe_memutils.c pcp_pool_status_LDADD = $(libs_dir)/pcp/libpcp.la pcp_promote_node_SOURCES = pcp_promote_node.c ../fe_memutils.c pcp_promote_node_LDADD = $(libs_dir)/pcp/libpcp.la pcp_watchdog_info_SOURCES = pcp_watchdog_info.c ../fe_memutils.c pcp_watchdog_info_LDADD = $(libs_dir)/pcp/libpcp.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/tools/pcp/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/tools/pcp/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ../$(am__dirstamp): @$(MKDIR_P) .. @: > ../$(am__dirstamp) ../$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../$(DEPDIR) @: > ../$(DEPDIR)/$(am__dirstamp) ../fe_memutils.$(OBJEXT): ../$(am__dirstamp) \ ../$(DEPDIR)/$(am__dirstamp) pcp_attach_node$(EXEEXT): $(pcp_attach_node_OBJECTS) $(pcp_attach_node_DEPENDENCIES) $(EXTRA_pcp_attach_node_DEPENDENCIES) @rm -f pcp_attach_node$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pcp_attach_node_OBJECTS) $(pcp_attach_node_LDADD) $(LIBS) pcp_detach_node$(EXEEXT): $(pcp_detach_node_OBJECTS) $(pcp_detach_node_DEPENDENCIES) $(EXTRA_pcp_detach_node_DEPENDENCIES) @rm -f pcp_detach_node$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pcp_detach_node_OBJECTS) $(pcp_detach_node_LDADD) $(LIBS) pcp_node_count$(EXEEXT): $(pcp_node_count_OBJECTS) $(pcp_node_count_DEPENDENCIES) $(EXTRA_pcp_node_count_DEPENDENCIES) @rm -f pcp_node_count$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pcp_node_count_OBJECTS) $(pcp_node_count_LDADD) $(LIBS) pcp_node_info$(EXEEXT): $(pcp_node_info_OBJECTS) $(pcp_node_info_DEPENDENCIES) $(EXTRA_pcp_node_info_DEPENDENCIES) @rm -f pcp_node_info$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pcp_node_info_OBJECTS) $(pcp_node_info_LDADD) $(LIBS) pcp_pool_status$(EXEEXT): $(pcp_pool_status_OBJECTS) $(pcp_pool_status_DEPENDENCIES) $(EXTRA_pcp_pool_status_DEPENDENCIES) @rm -f pcp_pool_status$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pcp_pool_status_OBJECTS) $(pcp_pool_status_LDADD) $(LIBS) pcp_proc_count$(EXEEXT): $(pcp_proc_count_OBJECTS) $(pcp_proc_count_DEPENDENCIES) $(EXTRA_pcp_proc_count_DEPENDENCIES) @rm -f pcp_proc_count$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pcp_proc_count_OBJECTS) $(pcp_proc_count_LDADD) $(LIBS) pcp_proc_info$(EXEEXT): $(pcp_proc_info_OBJECTS) $(pcp_proc_info_DEPENDENCIES) $(EXTRA_pcp_proc_info_DEPENDENCIES) @rm -f pcp_proc_info$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pcp_proc_info_OBJECTS) $(pcp_proc_info_LDADD) $(LIBS) pcp_promote_node$(EXEEXT): $(pcp_promote_node_OBJECTS) $(pcp_promote_node_DEPENDENCIES) $(EXTRA_pcp_promote_node_DEPENDENCIES) @rm -f pcp_promote_node$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pcp_promote_node_OBJECTS) $(pcp_promote_node_LDADD) $(LIBS) pcp_recovery_node$(EXEEXT): $(pcp_recovery_node_OBJECTS) $(pcp_recovery_node_DEPENDENCIES) $(EXTRA_pcp_recovery_node_DEPENDENCIES) @rm -f pcp_recovery_node$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pcp_recovery_node_OBJECTS) $(pcp_recovery_node_LDADD) $(LIBS) pcp_stop_pgpool$(EXEEXT): $(pcp_stop_pgpool_OBJECTS) $(pcp_stop_pgpool_DEPENDENCIES) $(EXTRA_pcp_stop_pgpool_DEPENDENCIES) @rm -f pcp_stop_pgpool$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pcp_stop_pgpool_OBJECTS) $(pcp_stop_pgpool_LDADD) $(LIBS) pcp_systemdb_info$(EXEEXT): $(pcp_systemdb_info_OBJECTS) $(pcp_systemdb_info_DEPENDENCIES) $(EXTRA_pcp_systemdb_info_DEPENDENCIES) @rm -f pcp_systemdb_info$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pcp_systemdb_info_OBJECTS) $(pcp_systemdb_info_LDADD) $(LIBS) pcp_watchdog_info$(EXEEXT): $(pcp_watchdog_info_OBJECTS) $(pcp_watchdog_info_DEPENDENCIES) $(EXTRA_pcp_watchdog_info_DEPENDENCIES) @rm -f pcp_watchdog_info$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pcp_watchdog_info_OBJECTS) $(pcp_watchdog_info_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f ../*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@../$(DEPDIR)/fe_memutils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcp_attach_node.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcp_detach_node.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcp_node_count.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcp_node_info.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcp_pool_status.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcp_proc_count.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcp_proc_info.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcp_promote_node.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcp_recovery_node.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcp_stop_pgpool.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcp_systemdb_info.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcp_watchdog_info.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../$(DEPDIR)/$(am__dirstamp) -rm -f ../$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ../$(DEPDIR) ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ../$(DEPDIR) ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: pgpool-II-3.4.3/src/tools/pcp/pcp_detach_node.c0000664000076400007640000001005612554350605016236 00000000000000/* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2010 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation, and that the name of the * author not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. The author makes no representations about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * * Client program to send "detach node" command. */ #include #include #include #include #ifdef HAVE_GETOPT_H #include #else #include "utils/getopt_long.h" #endif #include "pcp/pcp.h" static void usage(void); static void myexit(ErrorCode e); int main(int argc, char **argv) { long timeout; char host[MAX_DB_HOST_NAMELEN]; int port; char user[MAX_USER_PASSWD_LEN]; char pass[MAX_USER_PASSWD_LEN]; int nodeID; int ch; int optindex; bool gracefully = false; int sts; static struct option long_options[] = { {"debug", no_argument, NULL, 'd'}, {"gracefully", no_argument, NULL, 'g'}, {"help", no_argument, NULL, 'h'}, {NULL, 0, NULL, 0} }; while ((ch = getopt_long(argc, argv, "hdg", long_options, &optindex)) != -1) { switch (ch) { case 'd': pcp_enable_debug(); break; case 'g': gracefully = true; break; case 'h': case '?': default: usage(); exit(0); } } argc -= optind; argv += optind; if (argc != 6) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } timeout = atol(argv[0]); if (timeout < 0) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(host, argv[1]); port = atoi(argv[2]); if (port <= 1024 || port > 65535) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(user, argv[3]); if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } strcpy(pass, argv[4]); nodeID = atoi(argv[5]); if (nodeID < 0 || nodeID > MAX_NUM_BACKENDS) { errorcode = INVALERR; pcp_errorstr(errorcode); myexit(errorcode); } pcp_set_timeout(timeout); if (pcp_connect(host, port, user, pass)) { pcp_errorstr(errorcode); myexit(errorcode); } if (gracefully) sts = pcp_detach_node_gracefully(nodeID); else sts = pcp_detach_node(nodeID); if (sts) { pcp_errorstr(errorcode); pcp_disconnect(); myexit(errorcode); } pcp_disconnect(); return 0; } static void usage(void) { fprintf(stderr, "pcp_detach_node - detach a node from pgpool-II\n\n"); fprintf(stderr, "Usage: pcp_detach_node [-d][-g] timeout hostname port# username password nodeID\n"); fprintf(stderr, "Usage: pcp_detach_node -h\n\n"); fprintf(stderr, " -d, --debug : enable debug message (optional)\n"); fprintf(stderr, " -g, --gracefully : detach gracefully(optional)\n"); fprintf(stderr, " timeout : connection timeout value in seconds. command exits on timeout\n"); fprintf(stderr, " hostname : pgpool-II hostname\n"); fprintf(stderr, " port# : PCP port number\n"); fprintf(stderr, " username : username for PCP authentication\n"); fprintf(stderr, " password : password for PCP authentication\n"); fprintf(stderr, " nodeID : ID of a node to be detached\n"); fprintf(stderr, " -h, --help : print this help\n"); } static void myexit(ErrorCode e) { if (e == INVALERR) { usage(); exit(e); } exit(e); } pgpool-II-3.4.3/src/tools/Makefile.in0000664000076400007640000004440012554350605014256 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/tools DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/c-compiler.m4 $(top_srcdir)/c-library.m4 \ $(top_srcdir)/general.m4 \ $(top_srcdir)/ac_func_accept_argtypes.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MEMCACHED_DIR = @MEMCACHED_DIR@ MEMCACHED_INCLUDE_OPT = @MEMCACHED_INCLUDE_OPT@ MEMCACHED_LINK_OPT = @MEMCACHED_LINK_OPT@ MEMCACHED_RPATH_OPT = @MEMCACHED_RPATH_OPT@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PGCONFIG = @PGCONFIG@ PGSQL_INCLUDE_DIR = @PGSQL_INCLUDE_DIR@ PGSQL_LIB_DIR = @PGSQL_LIB_DIR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = pcp pgmd5 all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/tools/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/tools/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: pgpool-II-3.4.3/src/query_cache/0002775000076400007640000000000012554350617013424 500000000000000pgpool-II-3.4.3/src/query_cache/pool_memqcache.c0000664000076400007640000027050412554350605016467 00000000000000/* -*-pgsql-c-*- */ /* * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2014 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation, and that the name of the * author not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. The author makes no representations about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * * pool_memqcache.c: query cache on shmem or memcached * */ #define DATABASE_TO_OID_QUERY "SELECT oid FROM pg_database WHERE datname = '%s'" #include "pool.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef USE_MEMCACHED #include #endif #include "auth/md5.h" #include "pool_config.h" #include "protocol/pool_proto_modules.h" #include "parser/parsenodes.h" #include "context/pool_session_context.h" #include "query_cache/pool_memqcache.h" #include "utils/pool_relcache.h" #include "utils/pool_select_walker.h" #include "utils/pool_stream.h" #include "utils/pool_stream.h" #include "utils/elog.h" #include "utils/palloc.h" #include "utils/memutils.h" #ifdef USE_MEMCACHED memcached_st *memc; #endif static char* encode_key(const char *s, char *buf, POOL_CONNECTION_POOL *backend); #ifdef DEBUG static void dump_cache_data(const char *data, size_t len); #endif static int pool_commit_cache(POOL_CONNECTION_POOL *backend, char *query, char *data, size_t datalen, int num_oids, int *oids); static int pool_fetch_cache(POOL_CONNECTION_POOL *backend, const char *query, char **buf, size_t *len); static int send_cached_messages(POOL_CONNECTION *frontend, const char *qcache, int qcachelen); static void send_message(POOL_CONNECTION *conn, char kind, int len, const char *data); #ifdef USE_MEMCACHED static int delete_cache_on_memcached(const char *key); #endif static int pool_get_dml_table_oid(int **oid); static int pool_get_dropdb_table_oids(int **oids, int dboid); static void pool_discard_dml_table_oid(void); static void pool_invalidate_query_cache(int num_table_oids, int *table_oid, bool unlink, int dboid); static int pool_get_database_oid(void); static void pool_add_table_oid_map(POOL_CACHEKEY *cachkey, int num_table_oids, int *table_oids); static void pool_reset_memqcache_buffer(void); static POOL_CACHEID *pool_add_item_shmem_cache(POOL_QUERY_HASH *query_hash, char *data, int size); static POOL_CACHEID *pool_find_item_on_shmem_cache(POOL_QUERY_HASH *query_hash); static char *pool_get_item_shmem_cache(POOL_QUERY_HASH *query_hash, int *size, int *sts); static POOL_QUERY_CACHE_ARRAY * pool_add_query_cache_array(POOL_QUERY_CACHE_ARRAY *cache_array, POOL_TEMP_QUERY_CACHE *cache); static void pool_add_temp_query_cache(POOL_TEMP_QUERY_CACHE *temp_cache, char kind, char *data, int data_len); static void pool_add_oids_temp_query_cache(POOL_TEMP_QUERY_CACHE *temp_cache, int num_oids, int *oids); static POOL_INTERNAL_BUFFER *pool_create_buffer(void); static void pool_discard_buffer(POOL_INTERNAL_BUFFER *buffer); static void pool_add_buffer(POOL_INTERNAL_BUFFER *buffer, void *data, size_t len); static void *pool_get_buffer(POOL_INTERNAL_BUFFER *buffer, size_t *len); static char *pool_get_buffer_pointer(POOL_INTERNAL_BUFFER *buffer); static char *pool_get_current_cache_buffer(size_t *len); static size_t pool_get_buffer_length(POOL_INTERNAL_BUFFER *buffer); static void pool_check_and_discard_cache_buffer(int num_oids, int *oids); static void pool_set_memqcache_blocks(int num_blocks); static int pool_get_memqcache_blocks(void); static void *pool_memory_cache_address(void); static void pool_reset_fsmm(size_t size); static void *pool_fsmm_address(void); static void pool_update_fsmm(POOL_CACHE_BLOCKID blockid, size_t free_space); static POOL_CACHE_BLOCKID pool_get_block(size_t free_space); static POOL_CACHE_ITEM_HEADER *pool_cache_item_header(POOL_CACHEID *cacheid); static int pool_init_cache_block(POOL_CACHE_BLOCKID blockid); #if NOT_USED static void pool_wipe_out_cache_block(POOL_CACHE_BLOCKID blockid); #endif static int pool_delete_item_shmem_cache(POOL_CACHEID *cacheid); static char *block_address(int blockid); static POOL_CACHE_ITEM_POINTER *item_pointer(char *block, int i); static POOL_CACHE_ITEM_HEADER *item_header(char *block, int i); static POOL_CACHE_BLOCKID pool_reuse_block(void); #ifdef SHMEMCACHE_DEBUG static void dump_shmem_cache(POOL_CACHE_BLOCKID blockid); #endif static int pool_hash_reset(int nelements); static int pool_hash_insert(POOL_QUERY_HASH *key, POOL_CACHEID *cacheid, bool update); static uint32 create_hash_key(POOL_QUERY_HASH *key); static volatile POOL_HASH_ELEMENT *get_new_hash_element(void); static void put_back_hash_element(volatile POOL_HASH_ELEMENT *element); static bool is_free_hash_element(void); static char *get_relation_without_alias(RangeVar *relation); /* * Connect to Memcached */ int memcached_connect(void) { char *memqcache_memcached_host; int memqcache_memcached_port; #ifdef USE_MEMCACHED memcached_server_st *servers; memcached_return rc; /* Already connected? */ if (memc) { return 0; } #endif memqcache_memcached_host = pool_config->memqcache_memcached_host; memqcache_memcached_port = pool_config->memqcache_memcached_port; ereport(DEBUG1, (errmsg("connecting to memcached on Host:\"%s:%d\"", memqcache_memcached_host,memqcache_memcached_port))); #ifdef USE_MEMCACHED memc = memcached_create(NULL); servers = memcached_server_list_append(NULL, memqcache_memcached_host, memqcache_memcached_port, &rc); rc = memcached_server_push(memc, servers); if (rc != MEMCACHED_SUCCESS) { ereport(WARNING, (errmsg("failed to connect to memcached, server push error:\"%s\"\n", memcached_strerror(memc, rc)))); memc = (memcached_st *)-1; return -1; } memcached_server_list_free(servers); #else ereport(WARNING, (errmsg("failed to connect to memcached, memcached support is not enabled"))); return -1; #endif return 0; } /* * Disconnect to Memcached */ void memcached_disconnect (void) { #ifdef USE_MEMCACHED if (!memc) { return; } memcached_free(memc); #else ereport(WARNING, (errmsg("failed to disconnect from memcached, memcached support is not enabled"))); #endif } /* * Register buffer data for query cache in memory cache */ void memqcache_register(char kind, POOL_CONNECTION *frontend, char *data, int data_len) { POOL_TEMP_QUERY_CACHE *cache; cache = pool_get_current_cache(); pool_add_temp_query_cache(cache, kind, data, data_len); } /* * Commit SELECT results to cache storage. */ static int pool_commit_cache(POOL_CONNECTION_POOL *backend, char *query, char *data, size_t datalen, int num_oids, int *oids) { #ifdef USE_MEMCACHED memcached_return rc; #endif POOL_CACHEKEY cachekey; char tmpkey[MAX_KEY]; time_t memqcache_expire; /* * get_buflen() will return -1 if query result exceeds memqcache_maxcache */ if (datalen == -1) { return -1; } /* query disabled */ if (strlen(query) <= 0) { return -1; } ereport(DEBUG1, (errmsg("commiting SELECT results to cache storage"), errdetail("Query=\"%s\"", query))); #ifdef DEBUG dump_cache_data(data, datalen); #endif /* encode md5key for memcached */ encode_key(query, tmpkey, backend); ereport(DEBUG2, (errmsg("commiting SELECT results to cache storage"), errdetail("search key : \"%s\"", tmpkey))); memcpy(cachekey.hashkey, tmpkey, 32); memqcache_expire = pool_config->memqcache_expire; ereport(DEBUG1, (errmsg("commiting SELECT results to cache storage"), errdetail("memqcache_expire = %ld", memqcache_expire))); if (pool_is_shmem_cache()) { POOL_CACHEID *cacheid; POOL_QUERY_HASH query_hash; memcpy(query_hash.query_hash, tmpkey, sizeof(query_hash.query_hash)); cacheid = pool_hash_search(&query_hash); if (cacheid != NULL) { ereport(DEBUG1, (errmsg("commiting SELECT results to cache storage"), errdetail("item already exists"))); return 0; } else { cacheid = pool_add_item_shmem_cache(&query_hash, data, datalen); if (cacheid == NULL) { ereport(LOG, (errmsg("failed to add item to shmem cache"))); return -1; } else { ereport(DEBUG2, (errmsg("commiting SELECT results to cache storage"), errdetail("blockid: %d itemid: %d", cacheid->blockid, cacheid->itemid))); } cachekey.cacheid.blockid = cacheid->blockid; cachekey.cacheid.itemid = cacheid->itemid; } } #ifdef USE_MEMCACHED else { rc = memcached_set(memc, tmpkey, 32, data, datalen, (time_t)memqcache_expire, 0); if (rc != MEMCACHED_SUCCESS) { ereport(WARNING, (errmsg("cache commit failed with error:\"%s\"",memcached_strerror(memc, rc)))); return -1; } ereport(DEBUG1, (errmsg("commiting SELECT results to cache storage"), errdetail("set cache succeeded"))); } #endif /* * Register cache id to oid map */ pool_add_table_oid_map(&cachekey, num_oids, oids); return 0; } /* * Fetch from memory cache. * Return: * 0: fetch success, * 1: not found */ static int pool_fetch_cache(POOL_CONNECTION_POOL *backend, const char *query, char **buf, size_t *len) { char *ptr; char tmpkey[MAX_KEY]; int sts; char *p; if (strlen(query) <= 0) ereport(ERROR, (errmsg("fetching from cache storage, no query"))); /* encode md5key for memcached */ encode_key(query, tmpkey, backend); ereport(DEBUG1, (errmsg("fetching from cache storage"), errdetail("search key \"%s\"", tmpkey))); if (pool_is_shmem_cache()) { POOL_QUERY_HASH query_hash; int mylen; memcpy(query_hash.query_hash, tmpkey, sizeof(query_hash.query_hash)); ptr = pool_get_item_shmem_cache(&query_hash, &mylen, &sts); if (ptr == NULL) { ereport(DEBUG1, (errmsg("fetching from cache storage"), errdetail("cache not found on shared memory"))); return 1; } *len = mylen; } #ifdef USE_MEMCACHED else { memcached_return rc; unsigned int flags; ptr = memcached_get(memc, tmpkey, strlen(tmpkey), len, &flags, &rc); if (rc != MEMCACHED_SUCCESS) { if (rc != MEMCACHED_NOTFOUND) { ereport(LOG, (errmsg("fetching from cache storage, memcached_get failed with error: \"%s\"", memcached_strerror(memc, rc)))); /* * Turn off memory cache support to prevent future errors. */ pool_config->memory_cache_enabled = 0; /* Behave as if cache not found */ return 1; } else { /* Not found */ ereport(DEBUG1, (errmsg("fetching from cache storage"), errdetail("cache item not found for key: \"%s\" and query:\"%s\"",tmpkey,query))); return 1; } } } #else else { ereport(ERROR, (errmsg("memcached support is not enabled"))); } #endif p = palloc(*len); memcpy(p, ptr, *len); if (!pool_is_shmem_cache()) { free(ptr); } ereport(DEBUG1, (errmsg("fetching from cache storage"), errdetail("query=\"%s\" len:%zd", query, *len))); #ifdef DEBUG dump_cache_data(p, *len); #endif *buf = p; return 0; } /* * encode key. * create cache key as md5(username + query string + database name) */ static char* encode_key(const char *s, char *buf, POOL_CONNECTION_POOL *backend) { char* strkey; int u_length; int d_length; int q_length; int length; u_length = strlen(backend->info->user); ereport(DEBUG1, (errmsg("memcache encode key"), errdetail("username: \"%s\" database_name: \"%s\"", backend->info->user,backend->info->database))); d_length = strlen(backend->info->database); q_length = strlen(s); ereport(DEBUG1, (errmsg("memcache encode key"), errdetail("query: \"%s\"", s))); length = u_length + d_length + q_length + 1; strkey = (char*)palloc(sizeof(char) * length); snprintf(strkey, length, "%s%s%s", backend->info->user, s, backend->info->database); pool_md5_hash(strkey, strlen(strkey), buf); ereport(DEBUG1, (errmsg("memcache encode key"), errdetail("`%s' -> `%s'", strkey, buf))); pfree(strkey); return buf; } #ifdef DEBUG /* * dump cache data */ static void dump_cache_data(const char *data, size_t len) { int i; int plen; fprintf(stderr,"shmem: len = %zd\n", len); while (len > 0) { fprintf(stderr,"shmem: kind:%c\n", *data++); len--; memmove(&plen, data, 4); len -= 4; data += 4; plen = ntohl(plen); fprintf(stderr,"shmem: len:%d\n", plen); plen -= 4; fprintf(stderr, "shmem: "); for (i=0;itstate; send_message(frontend, 'Z', 5, (char *)&state); } else { pool_write(frontend, "Z", 1); } if (pool_flush(frontend)) { return POOL_END; } *foundp = true; if (pool_config->log_per_node_statement) ereport(LOG, (errmsg("fetch from memory cache"), errdetail("query result fetched from cache. statement: %s", contents))); ereport(DEBUG1, (errmsg("fetch from memory cache"), errdetail("query result found in the query cache, %s", contents))); return POOL_CONTINUE; } /* Cache not found */ return POOL_CONTINUE; } /* * Simple and rough(thus unreliable) check if the query is likely * SELECT. Just check if the query starts with SELECT or WITH. This * can be used before parse tree is available. */ bool pool_is_likely_select(char *query) { bool do_continue = false; if (query == NULL) return false; if (pool_config->ignore_leading_white_space) { /* Ignore leading white spaces */ while (*query && isspace(*query)) query++; } if (! *query) { return false; } /* * Get rid of head comment. * It is sure that the query is in correct format, because the parser * has rejected bad queries such as the one with not-ended comment. */ while (*query) { /* Ignore spaces and return marks */ do_continue = false; while (*query && isspace(*query)) { query++; do_continue = true; } if (do_continue) { continue; } while (*query && !strncmp(query, "\n", 2)) { query++; do_continue = true; } if (do_continue) { query += 2; continue; } /* Ignore comments like C */ if (!strncmp(query, "/*", 2)) { while (*query && strncmp(query, "*/", 2)) query++; query += 2; continue; } /* Ignore SQL comments */ if (!strncmp(query, "--", 2)) { while (*query && strncmp(query, "\n", 2)) query++; query += 2; continue; } if (!strncasecmp(query, "SELECT", 6) || !strncasecmp(query, "WITH", 4)) { return true; } query++; } return false; } /* * Return true if SELECT can be cached. "node" is the parse tree for * the query and "query" is the query string. * The query must be SELECT or WITH. */ bool pool_is_allow_to_cache(Node *node, char *query) { int i = 0; int num_oids = -1; SelectContext ctx; /* * If NO QUERY CACHE comment exists, do not cache. */ if (!strncasecmp(query, NO_QUERY_CACHE, NO_QUERY_CACHE_COMMENT_SZ)) return false; /* * Check black table list first. */ if (pool_config->num_black_memqcache_table_list > 0) { /* Extract oids in from clause of SELECT, and check if SELECT to them could be cached. */ num_oids = pool_extract_table_oids_from_select_stmt(node, &ctx); if (num_oids > 0) { for (i = 0; i < num_oids; i++) { ereport(DEBUG1, (errmsg("memcache: checking if node is allowed to cache: check table_names[%d] = \"%s\"", i, ctx.table_names[i]))); if (pool_is_table_in_black_list(ctx.table_names[i]) == true) { ereport(DEBUG1, (errmsg("memcache: node is not allowed to cache"))); return false; } } } } /* SELECT INTO or SELECT FOR SHARE or UPDATE cannot be cached */ if (pool_has_insertinto_or_locking_clause(node)) return false; /* * If SELECT uses non immutable functions, it's not allowed to * cache. */ if (pool_has_non_immutable_function_call(node)) return false; /* * If SELECT uses temporary tables it's not allowed to cache. */ if (pool_config->check_temp_table && pool_has_temp_table(node)) return false; /* * If SELECT uses system catalogs, it's not allowed to cache. */ if (pool_has_system_catalog(node)) return false; /* * If the table is in the while list, allow to cache even if it is * VIEW or unlogged table. */ if (pool_config->num_white_memqcache_table_list > 0) { if (num_oids < 0) num_oids = pool_extract_table_oids_from_select_stmt(node, &ctx); if (num_oids > 0) { for (i = 0; i < num_oids; i++) { char *table = ctx.table_names[i]; ereport(DEBUG1, (errmsg("memcache: checking if node is allowed to cache: check table_names[%d] = \"%s\"", i, table))); if (is_view(table) || is_unlogged_table(table)) { if (pool_is_table_in_white_list(table) == false) { ereport(DEBUG1, (errmsg("memcache: node is not allowed to cache"))); return false; } } } } } else { /* * If SELECT uses views, it's not allowed to cache. */ if (pool_has_view(node)) return false; /* * If SELECT uses unlogged tables, it's not allowed to cache. */ if (pool_has_unlogged_table(node)) return false; } return true; } /* * Return true If the SELECTed table is in back list. */ bool pool_is_table_in_black_list(const char *table_name) { if (pool_config->num_black_memqcache_table_list > 0 && pattern_compare((char *)table_name, BLACKLIST, "black_memqcache_table_list") == 1) { return true; } return false; } /* * Return true If the SELECTed table is in white list. */ bool pool_is_table_in_white_list(const char *table_name) { if (pool_config->num_white_memqcache_table_list > 0 && pattern_compare((char *)table_name, WHITELIST, "white_memqcache_table_list") == 1) { return true; } return false; } /* * Extract table oid from INSERT/UPDATE/DELETE/TRUNCATE/ * DROP TABLE/ALTER TABLE/COPY FROM statement. * Returns number of oids. * In case of error, returns 0(InvalidOid). * oids buffer(oidsp) will be discarded by subsequent call. */ int pool_extract_table_oids(Node *node, int **oidsp) { #define POOL_MAX_DML_OIDS 128 char *table; static int oids[POOL_MAX_DML_OIDS]; int num_oids; int oid; if (node == NULL) { ereport(LOG, (errmsg("memcache: error while extracting table oids. statement is NULL"))); return 0; } num_oids = 0; *oidsp = oids; if (IsA(node, InsertStmt)) { InsertStmt *stmt = (InsertStmt *)node; table = nodeToString(stmt->relation); } else if (IsA(node, UpdateStmt)) { UpdateStmt *stmt = (UpdateStmt *)node; table = get_relation_without_alias(stmt->relation); } else if (IsA(node, DeleteStmt)) { DeleteStmt *stmt = (DeleteStmt *)node; table = get_relation_without_alias(stmt->relation); } #ifdef NOT_USED /* * We do not handle CREATE TABLE here. It is possible that * pool_extract_table_oids() is called before CREATE TABLE gets * executed. */ else if (IsA(node, CreateStmt)) { CreateStmt *stmt = (CreateStmt *)node; table = nodeToString(stmt->relation); } #endif else if (IsA(node, AlterTableStmt)) { AlterTableStmt *stmt = (AlterTableStmt *)node; table = nodeToString(stmt->relation); } else if (IsA(node, CopyStmt)) { CopyStmt *stmt = (CopyStmt *)node; if (stmt->is_from) /* COPY FROM? */ { table = nodeToString(stmt->relation); } else { return 0; } } else if (IsA(node, DropStmt)) { ListCell *cell; DropStmt *stmt = (DropStmt *)node; if (stmt->removeType != OBJECT_TABLE) { return 0; } /* Here, stmt->objects is list of target relation info. The * first cell of target relation info is a list (possibly) * consists of database, schema and relation. We need to call * makeRangeVarFromNameList() before passing to nodeToString. * Otherwise we get weird excessively decorated relation name * (''table_name''). */ foreach(cell, stmt->objects) { if (num_oids > POOL_MAX_DML_OIDS) { ereport(LOG, (errmsg("memcache: error while extracting table oids. too many oids:%d", num_oids))); return 0; } table = nodeToString(makeRangeVarFromNameList(lfirst(cell))); oid = pool_table_name_to_oid(table); if (oid > 0) { oids[num_oids++] = pool_table_name_to_oid(table); ereport(DEBUG1, (errmsg("memcache: extracting table oids: table: \"%s\" oid:%d", table, oids[num_oids-1]))); } } return num_oids; } else if (IsA(node, TruncateStmt)) { ListCell *cell; TruncateStmt *stmt = (TruncateStmt *)node; foreach(cell, stmt->relations) { if (num_oids > POOL_MAX_DML_OIDS) { ereport(LOG, (errmsg("memcache: error while extracting table oids. too many oids:%d", num_oids))); return 0; } table = nodeToString(lfirst(cell)); oid = pool_table_name_to_oid(table); if (oid > 0) { oids[num_oids++] = pool_table_name_to_oid(table); ereport(DEBUG1, (errmsg("memcache: extracting table oids: table: \"%s\" oid:%d", table, oids[num_oids-1]))); } } return num_oids; } else { ereport(DEBUG1, (errmsg("memcache: extracting table oids: statment is different from INSERT/UPDATE/DELETE/TRUNCATE/DROP TABLE/ALTER TABLE"))); return 0; } oid = pool_table_name_to_oid(table); if (oid > 0) { oids[num_oids++] = pool_table_name_to_oid(table); ereport(DEBUG1, (errmsg("memcache: extracting table oids: table: \"%s\" oid:%d", table, oid))); } return num_oids; } /* * Get relation name without alias. NodeToString() calls * _outRangeVar(). Unfortunately _outRangeVar() returns table with * alias ("t1 AS foo") as a table name if table alias is used. This * function just trim down "AS..." part from the table name when table * alias is used. */ static char *get_relation_without_alias(RangeVar *relation) { char *table; char *p; if (!IsA(relation, RangeVar)) { ereport(WARNING, (errmsg("memcache: extracting table name without alias: invalid node, not a RangeVar"), errdetail("passed in node is of type:%d",relation->type))); return ""; } table = nodeToString(relation); if (relation->alias) { p = strchr(table, ' '); if (!p) { ereport(LOG, (errmsg("memcache: extracting table name without alias: parsing error"), errdetail("cannot locate space in name:\"%s\"", table))); return ""; } *p = '\0'; } return table; } #define POOL_OIDBUF_SIZE 1024 static int* oidbuf; static int oidbufp; static int oidbuf_size; /* * Add table oid to internal buffer */ void pool_add_dml_table_oid(int oid) { int i; int* tmp; if (oid == 0) return; if (oidbufp >= oidbuf_size) { MemoryContext oldcxt; oidbuf_size += POOL_OIDBUF_SIZE; /* * This need to live throughout the life of child so home it in * TopMemoryContext */ oldcxt = MemoryContextSwitchTo(TopMemoryContext); tmp = repalloc(oidbuf, sizeof(int) * oidbuf_size); oldcxt = MemoryContextSwitchTo(oldcxt); if (tmp == NULL) return; oidbuf = tmp; } for (i=0;imemqcache_oiddir, dboid); if ((dir = opendir(path)) == NULL) { ereport(DEBUG1, (errmsg("memcache: getting drop table oids"), errdetail("Failed to open dir: %s", path))); return 0; } while ((dp = readdir(dir)) != NULL) { if (strcmp(dp->d_name, ".") == 0 || strcmp(dp->d_name, "..") == 0) continue; if (num_oids >= oids_size) { oids_size += POOL_OIDBUF_SIZE; tmp = repalloc(rtn, sizeof(int) * oids_size); if (tmp == NULL) { closedir(dir); return 0; } rtn = tmp; } rtn[num_oids] = atol(dp->d_name); num_oids++; } closedir(dir); *oids = rtn; return num_oids; } /* Discard oid internal buffer */ static void pool_discard_dml_table_oid(void) { oidbufp = 0; } /* * Management modules for oid map. When caching SELECT results, we * record table oids to file, which has following structure. * * memqcache_oiddir -+- database_oid -+-table_oid_file1 * | * +-table_oid_file2 * | * +-table_oid_file3... * * table_oid_file's name is table oid, which was used by the SELECT * statement. The file has 1 or more cacheid(s). When SELECT result is * cached, the file is created and cache id is appended. Later SELECT * using same table oid will add to the same file. If the SELECT uses * multiple tables, multiple table_oid_file will be created. When * INSERT/UPDATE/DELETE is executed, corresponding caches must be * deleted(cache invalidation) (when DROP TABLE, ALTER TABLE is * executed, the caches must be deleted as well). When database is * dropped, all caches belonging to the database must be deleted. */ /* * Get oid of current database */ static int pool_get_database_oid(void) { /* * Query to convert table name to oid */ int oid = 0; static POOL_RELCACHE *relcache; POOL_CONNECTION_POOL *backend; backend = pool_get_session_context(false)->backend; /* * If relcache does not exist, create it. */ if (!relcache) { relcache = pool_create_relcache(pool_config->relcache_size, DATABASE_TO_OID_QUERY, int_register_func, int_unregister_func, false); if (relcache == NULL) { ereport(LOG, (errmsg("memcache: error creating relcache while getting database OID"))); return oid; } } /* * Search relcache. */ oid = (int)(intptr_t)pool_search_relcache(relcache, backend, MASTER_CONNECTION(backend)->sp->database); return oid; } /* * Get oid of current database for discarding cache files * after executing DROP DATABASE */ int pool_get_database_oid_from_dbname(char *dbname) { int dboid = 0; POOL_SELECT_RESULT *res; char query[1024]; POOL_CONNECTION_POOL *backend; backend = pool_get_session_context(false)->backend; snprintf(query, sizeof(query), DATABASE_TO_OID_QUERY, dbname); do_query(MASTER(backend), query, &res, MAJOR(backend)); if (res->numrows != 1) { ereport(DEBUG1, (errmsg("memcache: getting oid of current database"), errdetail("received %d rows", res->numrows))); free_select_result(res); return 0; } dboid = atol(res->data[0]); free_select_result(res); return dboid; } /* * Add cache id(shmem case) or hash key(memcached case) to table oid * map file. Caller must hold shmem lock before calling this function * to avoid file extension conflict among different pgpool child * process. * As of pgpool-II 3.2, pool_handle_query_cache is responsible for that. * (pool_handle_query_cache -> pool_commit_cache -> pool_add_table_oid_map) */ static void pool_add_table_oid_map(POOL_CACHEKEY *cachekey, int num_table_oids, int *table_oids) { char *dir; int dboid; char path[1024]; int i; int len; /* * Create memqcache_oiddir */ dir = pool_config->memqcache_oiddir; if (mkdir(dir, S_IREAD|S_IWRITE|S_IEXEC) == -1) { if (errno != EEXIST) { ereport(WARNING, (errmsg("memcache: adding table oid maps, failed to create directory:\"%s\". error:\"%s\"", dir, strerror(errno)))); return; } } /* * Create memqcache_oiddir/database_oid */ dboid = pool_get_database_oid(); ereport(DEBUG1, (errmsg("memcache: adding table oid maps"), errdetail("dboid %d", dboid))); if (dboid <= 0) { ereport(WARNING, (errmsg("memcache: adding table oid maps, failed to get database OID"))); return; } snprintf(path, sizeof(path), "%s/%d", dir, dboid); if (mkdir(path, S_IREAD|S_IWRITE|S_IEXEC) == -1) { if (errno != EEXIST) { ereport(WARNING, (errmsg("memcache: adding table oid maps, failed to create directory:\"%s\". error:\"%s\"", path, strerror(errno)))); return; } } if (pool_is_shmem_cache()) { len = sizeof(cachekey->cacheid); } else { len = sizeof(cachekey->hashkey); } for (i=0;imemqcache_oiddir); if(system(command) == -1) ereport(WARNING, (errmsg("unable to execute command \"%s\"",command), errdetail("system() command failed with error \"%s\"",strerror(errno)))); } void pool_discard_oid_maps_by_db(int dboid) { char command[1024]; if (pool_is_shmem_cache()) { snprintf(command, sizeof(command), "/bin/rm -fr %s/%d/", pool_config->memqcache_oiddir, dboid); ereport(DEBUG1, (errmsg("memcache: discarding oid maps by db"), errdetail("command: '%s\'", command))); if(system(command) == -1) ereport(WARNING, (errmsg("unable to execute command \"%s\"",command), errdetail("system() command failed with error \"%s\"",strerror(errno)))); } } /* * Reading cache id(shmem case) or hash key(memcached case) from table * oid map file according to table_oids and discard cache entries. If * unlink is true, the file will be unlinked after successful cache * removal. */ static void pool_invalidate_query_cache(int num_table_oids, int *table_oid, bool unlinkp, int dboid) { char *dir; char path[1024]; int i; int len; POOL_CACHEKEY buf; /* * Create memqcache_oiddir */ dir = pool_config->memqcache_oiddir; if (mkdir(dir, S_IREAD|S_IWRITE|S_IEXEC) == -1) { if (errno != EEXIST) { ereport(WARNING, (errmsg("memcache: invalidating query cache, failed to create directory:\"%s\". error:\"%s\"", dir, strerror(errno)))); return; } } /* * Create memqcache_oiddir/database_oid */ if (dboid == 0) { dboid = pool_get_database_oid(); ereport(DEBUG1, (errmsg("memcache invalidating query cache"), errdetail("dboid %d", dboid))); if (dboid <= 0) { ereport(WARNING, (errmsg("memcache: invalidating query cache, could not get database OID"))); return; } } snprintf(path, sizeof(path), "%s/%d", dir, dboid); if (mkdir(path, S_IREAD|S_IWRITE|S_IEXEC) == -1) { if (errno != EEXIST) { ereport(WARNING, (errmsg("memcache: invalidating query cache, failed to create directory:\"%s\". error:\"%s\"", path, strerror(errno)))); return; } } if (pool_is_shmem_cache()) { len = sizeof(buf.cacheid); } else { len = sizeof(buf.hashkey); } for (i=0;iquery_cache_array) { POOL_TEMP_QUERY_CACHE *cache; ereport(DEBUG1, (errmsg("memcache reset buffer"), errdetail("discard: %p", session_context->query_cache_array))); pool_discard_query_cache_array(session_context->query_cache_array); session_context->query_cache_array = pool_create_query_cache_array(); ereport(DEBUG1, (errmsg("memcache reset buffer"), errdetail("create: %p", session_context->query_cache_array))); /* * if the query context is still under use, we cannot discard * temporary cache. */ if (can_query_context_destroy(session_context->query_context)) { ereport(DEBUG1, (errmsg("memcache reset buffer"), errdetail("discard temp buffer of %p (%s)", session_context->query_context, session_context->query_context->original_query))); cache = pool_get_current_cache(); pool_discard_temp_query_cache(cache); /* * Reset temp_cache pointer in the current query context * so that we don't double free memory. */ session_context->query_context->temp_cache = NULL; } } pool_discard_dml_table_oid(); pool_tmp_stats_reset_num_selects(); } /* * Return true if memory cache method is "shmem". The purpose of this * function is to cache the result of stcmp and to save a few cycle. */ bool pool_is_shmem_cache(void) { static int result = -1; if (result == -1) { result = strcmp(pool_config->memqcache_method, "shmem"); } return (result==0)?true:false; } /* * Remember memory cache number of blocks. */ static int memqcache_num_blocks; static void pool_set_memqcache_blocks(int num_blocks) { memqcache_num_blocks = num_blocks; } /* * Return memory cache number of blocks. */ static int pool_get_memqcache_blocks(void) { return memqcache_num_blocks; } /* * Query cache on shared memory management modules. */ /* * Calculate necessary shared memory size. */ size_t pool_shared_memory_cache_size(void) { int64 num_blocks; size_t size; if (pool_config->memqcache_maxcache > pool_config->memqcache_cache_block_size) ereport(FATAL, (errmsg("invalid memory cache configuration"), errdetail("memqcache_cache_block_size %d should be greater or equal to memqcache_maxcache %d", pool_config->memqcache_cache_block_size, pool_config->memqcache_maxcache))); num_blocks = pool_config->memqcache_total_size/ pool_config->memqcache_cache_block_size; if (num_blocks == 0) ereport(FATAL, (errmsg("invalid memory cache configuration"), errdetail("memqcache_total_size %ld should be greater or equal to memqcache_cache_block_size %d", pool_config->memqcache_total_size, pool_config->memqcache_cache_block_size))); ereport(LOG, (errmsg("memory cache initialized"), errdetail("memcache blocks :%ld",num_blocks))); /* Remember # of blocks */ pool_set_memqcache_blocks(num_blocks); size = pool_config->memqcache_cache_block_size * num_blocks; return size; } /* * Acquire and initialize shared memory cache. This should be called * only once from pgpool main process at the process staring up time. */ static void *shmem; int pool_init_memory_cache(size_t size) { ereport(DEBUG1, (errmsg("memory cache request size : %zd",size))); shmem = pool_shared_memory_create(size); return 0; } /* * Clear all the shared memory cache and reset FSMM and hash table. */ void pool_clear_memory_cache(void) { size_t size; #ifdef HAVE_SIGPROCMASK sigset_t oldmask; #else int oldmask; #endif POOL_SETMASK2(&BlockSig, &oldmask); pool_shmem_lock(); PG_TRY(); { size = pool_shared_memory_cache_size(); memset(shmem, 0, size); size = pool_shared_memory_fsmm_size(); pool_reset_fsmm(size); pool_discard_oid_maps(); pool_hash_reset(pool_config->memqcache_max_num_cache); } PG_CATCH(); { pool_shmem_unlock(); POOL_SETMASK(&oldmask); PG_RE_THROW(); } PG_END_TRY(); pool_shmem_unlock(); POOL_SETMASK(&oldmask); } /* * Return shared memory cache address */ static void *pool_memory_cache_address(void) { return shmem; } /* * Initialize new block */ /* * Free space management map * * Free space management map (FSMM) consists of bytes. Each byte * corresponds to block id. For example, if you have 1GB cache and * block size is 8Kb, number of blocks = 131,072, thus total size of * FSMM is 128Kb. Each FSMM entry has value from 0 to 255. Those * values describes total free space in each block. * For example, if the value is 2, the free space can be between 64 * bytes and 95 bytes. * * value free space(in bytes) * 0 0-31 * 1 32-63 * 2 64-95 * 3 96-127 * : * 255 8160-8192 */ /* * Calculate necessary shared memory size for FSMM. Should be called after * pool_shared_memory_cache_size. */ size_t pool_shared_memory_fsmm_size(void) { size_t size; size = pool_get_memqcache_blocks() * sizeof(char); return size; } /* * Acquire and initialize shared memory cache for FSMM. This should be * called after pool_shared_memory_cache_size only once from pgpool * main process at the process staring up time. */ static void *fsmm; int pool_init_fsmm(size_t size) { int maxblock = pool_get_memqcache_blocks(); int encode_value; fsmm = pool_shared_memory_create(size); encode_value = POOL_MAX_FREE_SPACE/POOL_FSMM_RATIO; memset(fsmm, encode_value, maxblock); return 0; } /* * Return shared memory fsmm address */ static void *pool_fsmm_address(void) { return fsmm; } /* * Clock algorithm shared query cache management modules. */ /* * Clock hand pointing to next victim block */ static int *pool_fsmm_clock_hand; /* * Allocate and initialize clock hand on shmem */ void pool_allocate_fsmm_clock_hand(void) { pool_fsmm_clock_hand = pool_shared_memory_create(sizeof(*pool_fsmm_clock_hand)); *pool_fsmm_clock_hand = 0; } /* * Reset FSMM. */ static void pool_reset_fsmm(size_t size) { int encode_value; encode_value = POOL_MAX_FREE_SPACE/POOL_FSMM_RATIO; memset(fsmm, encode_value, size); *pool_fsmm_clock_hand = 0; } /* * Find victim block using clock algorithm and make it free. * Returns new free block id. */ static POOL_CACHE_BLOCKID pool_reuse_block(void) { int maxblock = pool_get_memqcache_blocks(); char *block = block_address(*pool_fsmm_clock_hand); POOL_CACHE_BLOCK_HEADER *bh = (POOL_CACHE_BLOCK_HEADER *)block; POOL_CACHE_BLOCKID reused_block; POOL_CACHE_ITEM_POINTER *cip; char *p; int i; bh->flags = 0; reused_block = *pool_fsmm_clock_hand; p = block_address(reused_block); for (i=0;inum_items;i++) { cip = item_pointer(p, i); if (!(POOL_ITEM_DELETED & cip->flags)) { pool_hash_delete(&cip->query_hash); ereport(DEBUG1, (errmsg("pool_reuse_block: blockid: %d item: %d", reused_block, i))); } } pool_init_cache_block(reused_block); pool_update_fsmm(reused_block, POOL_MAX_FREE_SPACE); (*pool_fsmm_clock_hand)++; if (*pool_fsmm_clock_hand >= maxblock) *pool_fsmm_clock_hand = 0; ereport(LOG, (errmsg("pool_reuse_block: blockid: %d", reused_block))); return reused_block; } /* * Get block id which has enough space */ static POOL_CACHE_BLOCKID pool_get_block(size_t free_space) { int encode_value; unsigned char *p = pool_fsmm_address(); int i; int maxblock = pool_get_memqcache_blocks(); POOL_CACHE_BLOCK_HEADER *bh; if (p == NULL) { ereport(WARNING, (errmsg("memcache: getting block: FSMM is not initialized"))); return -1; } if (free_space > POOL_MAX_FREE_SPACE) { ereport(WARNING, (errmsg("memcache: getting block: invalid free space:%zd", free_space), errdetail("requested free space: %zd is more than maximum allowed space:%lu",free_space,POOL_MAX_FREE_SPACE))); return -1; } encode_value = free_space/POOL_FSMM_RATIO; for (i=0;i= encode_value) { /* * This block *may" have enough space. * We need to make sure it actually has enough space. */ bh = (POOL_CACHE_BLOCK_HEADER *)block_address(i); if (bh->free_bytes >= free_space) { return (POOL_CACHE_BLOCKID)i; } } } /* * No enough space found. Reuse victim block */ return pool_reuse_block(); } /* * Update free space info for specified block */ static void pool_update_fsmm(POOL_CACHE_BLOCKID blockid, size_t free_space) { int encode_value; char *p = pool_fsmm_address(); if (p == NULL) { ereport(WARNING, (errmsg("memcache: updating free space in block: FSMM is not initialized"))); return; } if (blockid >= pool_get_memqcache_blocks()) { ereport(WARNING, (errmsg("memcache: updating free space in block: block id:%d in invalid",blockid))); return; } if (free_space > POOL_MAX_FREE_SPACE) { ereport(WARNING, (errmsg("memcache: updating free space in block: invalid free space:%zd", free_space), errdetail("requested free space: %zd is more than maximum allowed space:%lu",free_space,POOL_MAX_FREE_SPACE))); return; } encode_value = free_space/POOL_FSMM_RATIO; p[blockid] = encode_value; return; } /* * Add item data to shared memory cache. * On successful registration, returns cache id. * The cache id is overwritten by the subsequent call to this function. * On error returns NULL. */ static POOL_CACHEID *pool_add_item_shmem_cache(POOL_QUERY_HASH *query_hash, char *data, int size) { static POOL_CACHEID cacheid; POOL_CACHE_BLOCKID blockid; POOL_CACHE_BLOCK_HEADER *bh; POOL_CACHE_ITEM_POINTER *cip; POOL_CACHE_ITEM ci; POOL_CACHE_ITEM_POINTER cip_body; char *item; int request_size; char *p; int i; char *src; char *dst; int num_deleted; char *dcip; char *dci; bool need_pack; char *work_buffer; int index; if (query_hash == NULL) { ereport(LOG, (errmsg("error while adding item to shmem cache, query hash is NULL"))); return NULL; } if (data == NULL) { ereport(LOG, (errmsg("error while adding item to shmem cache, data is NULL"))); return NULL; } if (size <= 0) { ereport(LOG, (errmsg("error while adding item to shmem cache, invalid request size: %d", size))); return NULL; } /* Add overhead */ request_size = size + sizeof(POOL_CACHE_ITEM_POINTER) + sizeof(POOL_CACHE_ITEM_HEADER); /* Get cache block which has enough space */ blockid = pool_get_block(request_size); if (blockid == -1) { return NULL; } /* * Initialize the block if necessary. If no live items are * remained, we also initialize the block. If there's contiguous * deleted items, we turn them into free space as well. */ pool_init_cache_block(blockid); /* * Make sure that we have at least one free hash element. */ while (!is_free_hash_element()) { /* If not, reuse next victim block */ blockid = pool_reuse_block(); pool_init_cache_block(blockid); } /* Get block address on shmem */ p = block_address(blockid); bh = (POOL_CACHE_BLOCK_HEADER *)p; /* * Create contiguous free space. We assume that item bodies are * ordered from bottom to top of the block, and corresponding item * pointers are ordered from the youngest to the oldest in the * beginning of the block. */ /* * Optimization. If there's no deleted items, we don't need to * pack it to create contiguous free space. */ need_pack = false; for (i=0;inum_items;i++) { cip = item_pointer(p, i); if (POOL_ITEM_DELETED & cip->flags) /* Deleted item? */ { need_pack = true; ereport(DEBUG1, (errmsg("memcache adding item"), errdetail("start creating contiguous space"))); break; } } /* * We disable packing for now. * Revisit and remove following code fragment later. */ need_pack = false; if (need_pack) { /* * Pack and create contiguous free space. */ dcip = calloc(1, pool_config->memqcache_cache_block_size); if (!dcip) { ereport(WARNING, (errmsg("memcache: adding item to cache: calloc failed"))); return NULL; } work_buffer = dcip; dci = dcip + pool_config->memqcache_cache_block_size; num_deleted = 0; index = 0; for (i=0;inum_items;i++) { int total_length; POOL_CACHEID cid; cip = item_pointer(p, i); if (POOL_ITEM_DELETED & cip->flags) /* Deleted item? */ { num_deleted++; continue; } /* Copy item body */ src = p + cip->offset; total_length = item_header(p, i)->total_length; dst = dci - total_length; cip->offset = dst - work_buffer; memcpy(dst, src, total_length); dci -= total_length; /* Copy item pointer */ src = (char *)cip; dst = (char *)item_pointer(dcip, index); memcpy(dst, src, sizeof(POOL_CACHE_ITEM_POINTER)); /* Update hash index */ cid.blockid = blockid; cid.itemid = index; pool_hash_insert(&cip->query_hash, &cid, true); ereport(DEBUG1, (errmsg("memcache adding item"), errdetail("item cid updated. old:%d %d new:%d %d", blockid, i, blockid, index))); index++; } /* All items deleted? */ if (num_deleted > 0 && num_deleted == bh->num_items) { ereport(DEBUG1, (errmsg("memcache adding item"), errdetail("all items deleted, total deleted:%d", num_deleted))); bh->flags = 0; pool_init_cache_block(blockid); pool_update_fsmm(blockid, POOL_MAX_FREE_SPACE); } else { /* Update number of items */ bh->num_items -= num_deleted; /* Copy back the packed block except block header */ memcpy(p+sizeof(POOL_CACHE_BLOCK_HEADER), work_buffer+sizeof(POOL_CACHE_BLOCK_HEADER), pool_config->memqcache_cache_block_size-sizeof(POOL_CACHE_BLOCK_HEADER)); } free(work_buffer); } /* * Make sure that we have enough free space */ if (bh->free_bytes < request_size) { /* This should not happen */ ereport(WARNING, (errmsg("memcache: adding item to cache: not enough space"), errdetail("free space: %d required: %d block id:%d", bh->free_bytes, request_size, blockid))); return NULL; } /* * At this point, new item can be located at block_header->num_items */ /* Fill in cache item header */ ci.header.timestamp = time(NULL); ci.header.total_length = sizeof(POOL_CACHE_ITEM_HEADER) + size; /* Calculate item body address */ if (bh->num_items == 0) { /* This is the #0 item. So address is block_bottom - * data_length */ item = p + pool_config->memqcache_cache_block_size - ci.header.total_length; /* Mark this block used */ bh->flags = POOL_BLOCK_USED; } else { cip = item_pointer(p, bh->num_items-1); item = p + cip->offset - ci.header.total_length; } /* Copy item header */ memcpy(item, &ci, sizeof(POOL_CACHE_ITEM_HEADER)); bh->free_bytes -= sizeof(POOL_CACHE_ITEM_HEADER); /* Copy item body */ memcpy(item + sizeof(POOL_CACHE_ITEM_HEADER), data, size); bh->free_bytes -= size; /* Copy cache item pointer */ memcpy(&cip_body.query_hash, query_hash, sizeof(POOL_QUERY_HASH)); memset(&cip_body.next, 0, sizeof(POOL_CACHEID)); cip_body.offset = item - p; cip_body.flags = POOL_ITEM_USED; memcpy(item_pointer(p, bh->num_items), &cip_body, sizeof(POOL_CACHE_ITEM_POINTER)); bh->free_bytes -= sizeof(POOL_CACHE_ITEM_POINTER); /* Update FSMM */ pool_update_fsmm(blockid, bh->free_bytes); cacheid.blockid = blockid; cacheid.itemid = bh->num_items; ereport(DEBUG1, (errmsg("memcache adding item"), errdetail("new item inserted. blockid: %d itemid:%d", cacheid.blockid, cacheid.itemid))); /* Add up number of items */ bh->num_items++; /* Update hash table */ if (pool_hash_insert(query_hash, &cacheid, false) < 0) { ereport(LOG, (errmsg("error while adding item to shmem cache, hash insert failed"))); /* Since we have failed to insert hash index entry, we need to * undo the addition of cache entry. */ pool_delete_item_shmem_cache(&cacheid); return NULL; } ereport(DEBUG1, (errmsg("memcache adding item"), errdetail("block: %d item: %d", cacheid.blockid, cacheid.itemid))); #ifdef SHMEMCACHE_DEBUG dump_shmem_cache(blockid); #endif return &cacheid; } /* * Returns item data address on shared memory cache specified by query hash. * Also data length is set to *size. * On error or data not found case returns NULL. * Detail is set to *sts. (0: success, 1: not found, -1: error) */ static char *pool_get_item_shmem_cache(POOL_QUERY_HASH *query_hash, int *size, int *sts) { POOL_CACHEID *cacheid; POOL_CACHE_ITEM_HEADER *cih; if (sts == NULL) { ereport(LOG, (errmsg("error while getting item from shmem cache, sts is NULL"))); return NULL; } *sts = -1; if (query_hash == NULL) { ereport(LOG, (errmsg("error while getting item from shmem cache, query hash is NULL"))); return NULL; } if (size == NULL) { ereport(LOG, (errmsg("error while getting item from shmem cache, size is NULL"))); return NULL; } /* * Find cache header by using hash table */ cacheid = pool_find_item_on_shmem_cache(query_hash); if (cacheid == NULL) { /* Not found */ *sts = 1; return NULL; } cih = pool_cache_item_header(cacheid); *size = cih->total_length - sizeof(POOL_CACHE_ITEM_HEADER); return (char *)cih + sizeof(POOL_CACHE_ITEM_HEADER); } /* * Find data on shared memory cache specified query hash. * On success returns cache id. * The cache id is overwritten by the subsequent call to this function. */ static POOL_CACHEID *pool_find_item_on_shmem_cache(POOL_QUERY_HASH *query_hash) { static POOL_CACHEID cacheid; POOL_CACHEID *c; POOL_CACHE_ITEM_HEADER *cih; time_t now; c = pool_hash_search(query_hash); if (!c) { return NULL; } cih = item_header(block_address(c->blockid), c->itemid); /* Check cache expiration */ if (pool_config->memqcache_expire > 0) { now = time(NULL); if (now > (cih->timestamp + pool_config->memqcache_expire)) { ereport(DEBUG1, (errmsg("memcache finding item"), errdetail("cache expired: now: %ld timestamp: %ld", now, cih->timestamp + pool_config->memqcache_expire))); pool_delete_item_shmem_cache(c); return NULL; } } cacheid.blockid = c->blockid; cacheid.itemid = c->itemid; return &cacheid; } /* * Delete item data specified cache id from shmem. * On successful deletion, returns 0. * Other wise return -1. * FSMM is also updated. */ static int pool_delete_item_shmem_cache(POOL_CACHEID *cacheid) { POOL_CACHE_BLOCK_HEADER *bh; POOL_CACHE_ITEM_POINTER *cip; POOL_CACHE_ITEM_HEADER *cih; POOL_QUERY_HASH key; int size; ereport(DEBUG1, (errmsg("memcache deleting item data"), errdetail("cacheid:%d itemid:%d",cacheid->blockid, cacheid->itemid))); if (cacheid->blockid >= pool_get_memqcache_blocks()) { ereport(LOG, (errmsg("error while deleting item from shmem cache, invalid block: %d", cacheid->blockid))); return -1; } bh = (POOL_CACHE_BLOCK_HEADER *)block_address(cacheid->blockid); if (!(bh->flags & POOL_BLOCK_USED)) { ereport(LOG, (errmsg("error while deleting item from shmem cache, block: %d is not used", cacheid->blockid))); return -1; } if (cacheid->itemid >= bh->num_items) { /* * This could happen if the block is reused. Since contents * of oid map file is not updated when the block is reused. */ ereport(DEBUG1, (errmsg("memcache error deleting item data"), errdetail("invalid item id %d in block:%d", cacheid->itemid, cacheid->blockid))); return -1; } cip = item_pointer(block_address(cacheid->blockid), cacheid->itemid); if (!(cip->flags & POOL_ITEM_USED)) { ereport(LOG, (errmsg("error while deleting item from shmem cache, item: %d was not used", cacheid->itemid))); return -1; } if (cip->flags & POOL_ITEM_DELETED) { ereport(LOG, (errmsg("error while deleting item from shmem cache, item: %d was already deleted", cacheid->itemid))); return -1; } /* Save cache key */ memcpy(&key, &cip->query_hash, sizeof(POOL_QUERY_HASH)); cih = pool_cache_item_header(cacheid); size = cih->total_length + sizeof(POOL_CACHE_ITEM_POINTER); /* Delete item pointer */ cip->flags |= POOL_ITEM_DELETED; /* * We do NOT count down bh->num_items here. The deleted space will be recycled * by pool_add_item_shmem_cache(). However, if this is the last item, we can * recycle whole block. * * 2012/4/1: Now we do not pack data in * pool_add_item_shmem_cache() for performance reason. Also we * count down num_items if it is the last one. */ if ((bh->num_items -1) == 0) { ereport(DEBUG1, (errmsg("memcache deleting item data"), errdetail("no item remains. initialize block"))); bh->flags = 0; pool_init_cache_block(cacheid->blockid); } /* Remove hash index */ pool_hash_delete(&key); /* * If the deleted item is last one in the block, we add it to the free space. */ if (cacheid->itemid == (bh->num_items -1)) { bh->free_bytes += size; ereport(DEBUG1, (errmsg("memcache deleting item data"), errdetail("deleted %d bytes, freebytes is = %d", size, bh->free_bytes))); bh->num_items--; } /* Update FSMM */ pool_update_fsmm(cacheid->blockid, bh->free_bytes); return 0; } /* * Returns item header specified by cache id. */ static POOL_CACHE_ITEM_HEADER *pool_cache_item_header(POOL_CACHEID *cacheid) { POOL_CACHE_BLOCK_HEADER *bh; if (cacheid->blockid >= pool_get_memqcache_blocks()) { ereport(WARNING, (errmsg("error while getting cache item header, invalid block id: %d", cacheid->blockid))); return NULL; } bh = (POOL_CACHE_BLOCK_HEADER *)block_address(cacheid->blockid); if (cacheid->itemid >= bh->num_items) { ereport(WARNING, (errmsg("error while getting cache item header, invalid item id: %d", cacheid->itemid))); return NULL; } return item_header((char *)bh, cacheid->itemid); } /* * Initialize specified block. */ static int pool_init_cache_block(POOL_CACHE_BLOCKID blockid) { char *p; POOL_CACHE_BLOCK_HEADER *bh; if (blockid >= pool_get_memqcache_blocks()) { ereport(WARNING, (errmsg("error while initializing cache block, invalid block id: %d", blockid))); return -1; } p = block_address(blockid); bh = (POOL_CACHE_BLOCK_HEADER *)p; /* Is this block used? */ if (!(bh->flags & POOL_BLOCK_USED)) { /* Initialize empty block */ memset(p, 0, pool_config->memqcache_cache_block_size); bh->free_bytes = pool_config->memqcache_cache_block_size - sizeof(POOL_CACHE_BLOCK_HEADER); } return 0; } #if NOT_USED /* * Delete all items in the block. */ static void pool_wipe_out_cache_block(POOL_CACHE_BLOCKID blockid) { char *p; POOL_CACHE_BLOCK_HEADER *bh; POOL_CACHE_ITEM_POINTER *cip; POOL_CACHEID cacheid; int i; /* Get block address on shmem */ p = block_address(blockid); bh = (POOL_CACHE_BLOCK_HEADER *)p; cacheid.blockid = blockid; for (i=0;inum_items;i++) { cip = item_pointer(p, i); if ((POOL_ITEM_DELETED & cip->flags) == 0) /* Not deleted item? */ { cacheid.itemid = i; pool_delete_item_shmem_cache(&cacheid); } } bh->flags = 0; pool_init_cache_block(blockid); pool_update_fsmm(blockid, POOL_MAX_FREE_SPACE); } #endif /* * Acquire lock: XXX giant lock */ void pool_shmem_lock(void) { if (pool_is_shmem_cache()) { pool_semaphore_lock(SHM_CACHE_SEM); } } /* * Release lock */ void pool_shmem_unlock(void) { if (pool_is_shmem_cache()) { pool_semaphore_unlock(SHM_CACHE_SEM); } } /* * Returns cache block address specified by block id */ static char *block_address(int blockid) { char *p; p = pool_memory_cache_address() + blockid * pool_config->memqcache_cache_block_size; return p; } /* * Returns i th item pointer in block address block */ static POOL_CACHE_ITEM_POINTER *item_pointer(char *block, int i) { return (POOL_CACHE_ITEM_POINTER *)(block + sizeof(POOL_CACHE_BLOCK_HEADER) + sizeof(POOL_CACHE_ITEM_POINTER) * i); } /* * Returns i th item header in block address block */ static POOL_CACHE_ITEM_HEADER *item_header(char *block, int i) { POOL_CACHE_ITEM_POINTER *cip; cip = item_pointer(block, i); return (POOL_CACHE_ITEM_HEADER *)(block + cip->offset); } #ifdef SHMEMCACHE_DEBUG /* * Dump shmem cache block */ static void dump_shmem_cache(POOL_CACHE_BLOCKID blockid) { POOL_CACHE_BLOCK_HEADER *bh; POOL_CACHE_ITEM_POINTER *cip; POOL_CACHE_ITEM_HEADER *cih; int i; bh = (POOL_CACHE_BLOCK_HEADER *)block_address(blockid); fprintf(stderr, "shmem: block header(%lu bytes): flags:%x num_items:%d free_bytes:%d\n", sizeof(*bh), bh->flags, bh->num_items, bh->free_bytes); for (i=0;inum_items;i++) { cip = item_pointer((char *)bh, i); fprintf(stderr, "shmem: block: %d %d th item pointer(%lu bytes): offset:%d flags:%x\n", blockid, i, sizeof(*cip), cip->offset, cip->flags); cih = item_header((char *)bh, i); fprintf(stderr, "shmem: block: %d %d th item header(%lu bytes): timestamp:%ld length:%d\n", blockid, i, sizeof(*cih), cih->timestamp, cih->total_length); } } #endif /* * SELECT query result array modules */ POOL_QUERY_CACHE_ARRAY *pool_create_query_cache_array(void) { #define POOL_QUERY_CACHE_ARRAY_ALLOCATE_NUM 128 #define POOL_QUERY_CACHE_ARRAY_HEADER_SIZE (sizeof(int)+sizeof(int)) size_t size; POOL_QUERY_CACHE_ARRAY *p; POOL_SESSION_CONTEXT *session_context =pool_get_session_context(false); MemoryContext old_context = MemoryContextSwitchTo(session_context->memory_context); size = POOL_QUERY_CACHE_ARRAY_HEADER_SIZE + POOL_QUERY_CACHE_ARRAY_ALLOCATE_NUM * sizeof(POOL_TEMP_QUERY_CACHE *); p = palloc(size); p->num_caches = 0; p->array_size = POOL_QUERY_CACHE_ARRAY_ALLOCATE_NUM; MemoryContextSwitchTo(old_context); return p; } /* * Discard query cache array */ void pool_discard_query_cache_array(POOL_QUERY_CACHE_ARRAY *cache_array) { int i; if (!cache_array) return; ereport(DEBUG1, (errmsg("memcache discarding query cache array"), errdetail("num_caches: %d", cache_array->num_caches))); for (i=0;inum_caches;i++) { ereport(DEBUG2, (errmsg("memcache discarding query cache array"), errdetail("cache no: %d cache: %p", i, cache_array->caches[i]))); pool_discard_temp_query_cache(cache_array->caches[i]); } pfree(cache_array); } /* * Add query cache array */ static POOL_QUERY_CACHE_ARRAY * pool_add_query_cache_array(POOL_QUERY_CACHE_ARRAY *cache_array, POOL_TEMP_QUERY_CACHE *cache) { size_t size; POOL_QUERY_CACHE_ARRAY *cp = cache_array; if (!cache_array) return cp; ereport(DEBUG2, (errmsg("memcache adding query cache array"), errdetail("num_caches: %d cache: %p", cache_array->num_caches, cache))); if (cache_array->num_caches >= cache_array->array_size) { cache_array->array_size += POOL_QUERY_CACHE_ARRAY_ALLOCATE_NUM; size = POOL_QUERY_CACHE_ARRAY_HEADER_SIZE + cache_array->array_size * sizeof(POOL_TEMP_QUERY_CACHE *); cache_array = repalloc(cache_array, size); } cache_array->caches[cache_array->num_caches++] = cache; return cache_array; } /* * SELECT query result temporary cache modules */ /* * Create SELECT result temporary cache */ POOL_TEMP_QUERY_CACHE *pool_create_temp_query_cache(char *query) { POOL_SESSION_CONTEXT *session_context =pool_get_session_context(false); MemoryContext old_context = MemoryContextSwitchTo(session_context->memory_context); POOL_TEMP_QUERY_CACHE *p; p = palloc(sizeof(*p)); p->query = pstrdup(query); p->buffer = pool_create_buffer(); p->oids = pool_create_buffer(); p->num_oids = 0; p->is_exceeded = false; p->is_discarded = false; MemoryContextSwitchTo(old_context); return p; } /* * Discard temp query cache */ void pool_discard_temp_query_cache(POOL_TEMP_QUERY_CACHE *temp_cache) { if (!temp_cache) return; if (temp_cache->query) pfree(temp_cache->query); if (temp_cache->buffer) pool_discard_buffer(temp_cache->buffer); if (temp_cache->oids) pool_discard_buffer(temp_cache->oids); pfree(temp_cache); } /* * Add data to temp query cache. * Data must be FE/BE protocol packet. */ static void pool_add_temp_query_cache(POOL_TEMP_QUERY_CACHE *temp_cache, char kind, char *data, int data_len) { POOL_INTERNAL_BUFFER *buffer; size_t buflen; int send_len; if (temp_cache == NULL) { /* This could happen if cache exceeded in previous query * execution in the same unnamed portal. */ ereport(DEBUG1, (errmsg("memcache adding temporary query cache"), errdetail("POOL_TEMP_QUERY_CACHE is NULL"))); return; } if (temp_cache->is_exceeded) { ereport(DEBUG1, (errmsg("memcache adding temporary query cache"), errdetail("memqcache_maxcache exceeds"))); return; } /* * We only store T(Table Description), D(Data row), C(Command Complete), * 1(ParseComplete), 2(BindComplete) */ if (kind != 'T' && kind != 'D' && kind != 'C' && kind != '1' && kind != '2') { return; } /* Check data limit */ buffer = temp_cache->buffer; buflen = pool_get_buffer_length(buffer); if ((buflen+data_len+sizeof(int)+1) > pool_config->memqcache_maxcache) { ereport(DEBUG1, (errmsg("memcache adding temporary query cache"), errdetail("data size exceeds memqcache_maxcache. current:%zd requested:%zd memq_maxcache:%d", buflen, data_len+sizeof(int)+1, pool_config->memqcache_maxcache))); temp_cache->is_exceeded = true; return; } pool_add_buffer(buffer, &kind, 1); send_len = htonl(data_len + sizeof(int)); pool_add_buffer(buffer, (char *)&send_len, sizeof(int)); pool_add_buffer(buffer, data, data_len); return; } /* * Add table oids used by SELECT to temp query cache. */ static void pool_add_oids_temp_query_cache(POOL_TEMP_QUERY_CACHE *temp_cache, int num_oids, int *oids) { POOL_INTERNAL_BUFFER *buffer; if (!temp_cache || num_oids <= 0) return; buffer = temp_cache->oids; pool_add_buffer(buffer, oids, num_oids*sizeof(int)); temp_cache->num_oids = num_oids; } /* * Internal buffer management modules. * Usage: * 1) Create buffer using pool_create_buffer(). * 2) Add data to buffer using pool_add_buffer(). * 3) Extract (copied) data from buffer using pool_get_buffer(). * 4) Optionally you can: * Obtain buffer length by using pool_get_buffer_length(). * Obtain buffer pointer by using pool_get_buffer_pointer(). * 5) Discard buffer using pool_discard_buffer(). */ /* * Create and return internal buffer */ static POOL_INTERNAL_BUFFER *pool_create_buffer(void) { POOL_INTERNAL_BUFFER *p; p = palloc0(sizeof(*p)); return p; } /* * Discard internal buffer */ static void pool_discard_buffer(POOL_INTERNAL_BUFFER *buffer) { if (buffer) { if (buffer->buf) pfree(buffer->buf); pfree(buffer); } } /* * Add data to internal buffer */ static void pool_add_buffer(POOL_INTERNAL_BUFFER *buffer, void *data, size_t len) { #define POOL_ALLOCATE_UNIT 8192 /* Sanity check */ if (!buffer || !data || len == 0) return; POOL_SESSION_CONTEXT *session_context =pool_get_session_context(false); MemoryContext old_context = MemoryContextSwitchTo(session_context->memory_context); /* Check if we need to increase the buffer size */ if ((buffer->buflen + len) > buffer->bufsize) { size_t allocate_size = ((buffer->buflen + len)/POOL_ALLOCATE_UNIT +1)*POOL_ALLOCATE_UNIT; ereport(DEBUG2, (errmsg("memcache adding data to internal buffer"), errdetail("realloc old size:%zd new size:%zd", buffer->bufsize, allocate_size))); buffer->bufsize = allocate_size; buffer->buf = (char *)repalloc(buffer->buf, buffer->bufsize); } /* Add data to buffer */ memcpy(buffer->buf+buffer->buflen, data, len); buffer->buflen += len; ereport(DEBUG2, (errmsg("memcache adding data to internal buffer"), errdetail("len:%zd, total:%zd bufsize:%zd", len, buffer->buflen, buffer->bufsize))); MemoryContextSwitchTo(old_context); return; } /* * Get data from internal buffer. * Data is stored in newly malloc memory. * Data length is returned to len. */ static void *pool_get_buffer(POOL_INTERNAL_BUFFER *buffer, size_t *len) { void *p; if (buffer->bufsize == 0 || buffer->buflen == 0 || buffer->buf == NULL) { *len = 0; return NULL; } p = palloc(buffer->buflen); memcpy(p, buffer->buf, buffer->buflen); *len = buffer->buflen; return p; } /* * Get internal buffer length. */ static size_t pool_get_buffer_length(POOL_INTERNAL_BUFFER *buffer) { if (buffer == NULL) return 0; return buffer->buflen; } /* * Get internal buffer pointer. */ static char *pool_get_buffer_pointer(POOL_INTERNAL_BUFFER *buffer) { if (buffer == NULL) return NULL; return buffer->buf; } /* * Get query cache buffer struct of current query context */ POOL_TEMP_QUERY_CACHE *pool_get_current_cache(void) { POOL_SESSION_CONTEXT *session_context; POOL_QUERY_CONTEXT *query_context; POOL_TEMP_QUERY_CACHE *p = NULL; session_context = pool_get_session_context(true); if (session_context) { query_context = session_context->query_context; if (query_context) { p = query_context->temp_cache; } } return p; } /* * Get query cache buffer of current query context */ static char *pool_get_current_cache_buffer(size_t *len) { char *p = NULL; *len = 0; POOL_TEMP_QUERY_CACHE *cache; cache = pool_get_current_cache(); if (cache) { p = pool_get_buffer(cache->buffer, len); } return p; } /* * Mark this temporary query cache buffer discarded if the SELECT * uses the table oid specified by oids. */ static void pool_check_and_discard_cache_buffer(int num_oids, int *oids) { POOL_SESSION_CONTEXT *session_context; POOL_TEMP_QUERY_CACHE *cache; int num_caches; size_t len; int *soids; int i, j, k; session_context = pool_get_session_context(true); if (!session_context || !session_context->query_cache_array) return; num_caches = session_context->query_cache_array->num_caches; for (i=0;iquery_cache_array->caches[i]; if (!cache || cache->is_discarded) continue; soids = (int *)pool_get_buffer(cache->oids, &len); for(j=0;jnum_oids;j++) { if (cache->is_discarded) break; for (k=0;kquery))); cache->is_discarded = true; break; } } } pfree(soids); } } /* * At Ready for Query handle query cache. * Supposed to be called from ReadyForQuery(). */ void pool_handle_query_cache(POOL_CONNECTION_POOL *backend, char *query, Node *node, char state) { POOL_SESSION_CONTEXT *session_context; char *cache_buffer; size_t len; int num_oids; int *oids; int i; #ifdef HAVE_SIGPROCMASK sigset_t oldmask; #else int oldmask; #endif session_context = pool_get_session_context(true); /* Ok to cache SELECT result? */ if (pool_is_cache_safe()) { SelectContext ctx; MemoryContext old_context; old_context = MemoryContextSwitchTo(session_context->memory_context); num_oids = pool_extract_table_oids_from_select_stmt(node, &ctx); MemoryContextSwitchTo(old_context); oids = ctx.table_oids; ereport(DEBUG2, (errmsg("query cache handler for ReadyForQuery"), errdetail("num_oids: %d oid: %d", num_oids, *oids))); if (state == 'I') /* Not inside a transaction? */ { /* * Make sure that temporary cache is not exceeded. */ if (!pool_is_cache_exceeded()) { /* * If we are not inside a transaction, we can * immediately register to cache storage. */ /* Register to memcached or shmem */ POOL_SETMASK2(&BlockSig, &oldmask); pool_shmem_lock(); cache_buffer = pool_get_current_cache_buffer(&len); if (cache_buffer) { if (pool_commit_cache(backend, query, cache_buffer, len, num_oids, oids) != 0) { ereport(WARNING, (errmsg("ReadyForQuery: pool_commit_cache failed"))); } pfree(cache_buffer); } pool_shmem_unlock(); POOL_SETMASK(&oldmask); } /* Count up SELECT stats */ pool_stats_count_up_num_selects(1); /* Reset temp buffer */ pool_reset_memqcache_buffer(); } else { POOL_TEMP_QUERY_CACHE *cache = pool_get_current_cache(); /* In transaction. Keep to temp query cache array */ pool_add_oids_temp_query_cache(cache, num_oids, oids); /* * If temp cache has been overflowed, just trash the half * baked temp cache. */ if (pool_is_cache_exceeded()) { POOL_TEMP_QUERY_CACHE *cache; cache = pool_get_current_cache(); pool_discard_temp_query_cache(cache); /* * Reset temp_cache pointer in the current query context * so that we don't double free memory. */ session_context->query_context->temp_cache = NULL; } /* * Otherwise add to the temp cache array. */ else { session_context->query_cache_array = pool_add_query_cache_array(session_context->query_cache_array, cache); /* * Reset temp_cache pointer in the current query * context so that we don't add the same temp cache to * the cache array. This is necessary such that case * when next query is just a "bind message", without * "parse message". In the case the query context is * reused and same cache pointer will be added to the * query_cache_array which we do not want. */ session_context->query_context->temp_cache = NULL; } /* Count up temporary SELECT stats */ pool_tmp_stats_count_up_num_selects(); } } else if (is_rollback_query(node)) /* Rollback? */ { /* Discard buffered data */ pool_reset_memqcache_buffer(); } else if (is_commit_query(node)) /* Commit? */ { int num_caches; POOL_SETMASK2(&BlockSig, &oldmask); pool_shmem_lock(); /* Invalidate query cache */ if (pool_config->memqcache_auto_cache_invalidation) { num_oids = pool_get_dml_table_oid(&oids); pool_invalidate_query_cache(num_oids, oids, true, 0); } /* * If we have something in the query cache buffer, that means * either: * - We only had SELECTs in the transaction * - We had only SELECTs after last DML * Thus we can register SELECT results to cache storage. */ num_caches = session_context->query_cache_array->num_caches; for (i=0;iquery_cache_array->caches[i]; if (!cache || cache->is_discarded) continue; num_oids = cache->num_oids; oids = pool_get_buffer(cache->oids, &len); cache_buffer = pool_get_buffer(cache->buffer, &len); if (pool_commit_cache(backend, cache->query, cache_buffer, len, num_oids, oids) != 0) { ereport(WARNING, (errmsg("ReadyForQuery: pool_commit_cache failed"))); } if (oids) pfree(oids); if (cache_buffer) pfree(cache_buffer); } pool_shmem_unlock(); POOL_SETMASK(&oldmask); /* Count up number of SELECT stats */ pool_stats_count_up_num_selects(pool_tmp_stats_get_num_selects()); pool_reset_memqcache_buffer(); } else /* Non cache safe queries */ { /* Non cachable SELECT */ if (node && IsA(node, SelectStmt)) { if (state == 'I') { /* Count up SELECT stats */ pool_stats_count_up_num_selects(1); pool_reset_memqcache_buffer(); } else { /* Count up temporary SELECT stats */ pool_tmp_stats_count_up_num_selects(); } } /* * If the query is DROP DATABASE, discard both of caches in shmem/memcached and * oidmap in memqcache_oiddir. */ else if (is_drop_database(node) && session_context->query_context->dboid != 0) { int dboid = session_context->query_context->dboid; num_oids = pool_get_dropdb_table_oids(&oids, dboid); if (num_oids > 0 && pool_config->memqcache_auto_cache_invalidation) { pool_shmem_lock(); pool_invalidate_query_cache(num_oids, oids, true, dboid); pool_discard_oid_maps_by_db(dboid); pool_shmem_unlock(); pool_reset_memqcache_buffer(); pfree(oids); ereport(DEBUG2, (errmsg("query cache handler for ReadyForQuery"), errdetail("deleted all cache files for the DROPped DB"))); } } else { /* * DML/DCL/DDL case */ /* Extract table oids from buffer */ num_oids = pool_get_dml_table_oid(&oids); if (num_oids > 0 && pool_config->memqcache_auto_cache_invalidation) { /* * If we are not inside a transaction, we can * immediately invalidate query cache. */ if (state == 'I') { POOL_SETMASK2(&BlockSig, &oldmask); pool_shmem_lock(); pool_invalidate_query_cache(num_oids, oids, true, 0); pool_shmem_unlock(); POOL_SETMASK(&oldmask); pool_reset_memqcache_buffer(); } else { /* * If we are inside a transaction, we * cannot invalidate query cache * yet. However we can clear cache buffer, * if DML/DDL modifies the TABLE which SELECT uses. */ pool_check_and_discard_cache_buffer(num_oids, oids); } } } } } /* * Create and initialize query cache stats */ static POOL_QUERY_CACHE_STATS *stats; int pool_init_memqcache_stats(void) { stats = pool_shared_memory_create(sizeof(POOL_QUERY_CACHE_STATS)); pool_reset_memqcache_stats(); return 0; } /* * Returns copy of stats area. The copy is in static area and will be * overwritten by next call to this function. */ POOL_QUERY_CACHE_STATS *pool_get_memqcache_stats(void) { static POOL_QUERY_CACHE_STATS mystats; #ifdef HAVE_SIGPROCMASK sigset_t oldmask; #else int oldmask; #endif memset(&mystats, 0, sizeof(POOL_QUERY_CACHE_STATS)); if (stats) { POOL_SETMASK2(&BlockSig, &oldmask); pool_semaphore_lock(QUERY_CACHE_STATS_SEM); memcpy(&mystats, stats, sizeof(POOL_QUERY_CACHE_STATS)); pool_semaphore_unlock(QUERY_CACHE_STATS_SEM); POOL_SETMASK(&oldmask); } return &mystats; } /* * Reset query cache stats. Caller must lock QUERY_CACHE_STATS_SEM if * necessary. */ void pool_reset_memqcache_stats(void) { memset(stats, 0, sizeof(POOL_QUERY_CACHE_STATS)); stats->start_time = time(NULL); } /* * Count up number of successful SELECTs and returns the number. * QUERY_CACHE_STATS_SEM lock is acquired in this function. */ long long int pool_stats_count_up_num_selects(long long int num) { #ifdef HAVE_SIGPROCMASK sigset_t oldmask; #else int oldmask; #endif POOL_SETMASK2(&BlockSig, &oldmask); pool_semaphore_lock(QUERY_CACHE_STATS_SEM); stats->num_selects += num; pool_semaphore_unlock(QUERY_CACHE_STATS_SEM); POOL_SETMASK(&oldmask); return stats->num_selects; } /* * Count up number of successful SELECTs in temporary area and returns * the number. */ long long int pool_tmp_stats_count_up_num_selects(void) { POOL_SESSION_CONTEXT *session_context; session_context = pool_get_session_context(false); session_context->num_selects++; return session_context->num_selects; } /* * Return number of successful SELECTs in temporary area. */ long long int pool_tmp_stats_get_num_selects(void) { POOL_SESSION_CONTEXT *session_context; session_context = pool_get_session_context(false); return session_context->num_selects; } /* * Reset number of successful SELECTs in temporary area. */ void pool_tmp_stats_reset_num_selects(void) { POOL_SESSION_CONTEXT *session_context; session_context = pool_get_session_context(false); session_context->num_selects = 0; } /* * Count up number of SELECTs extracted from cache returns the number. * QUERY_CACHE_STATS_SEM lock is acquired in this function. */ long long int pool_stats_count_up_num_cache_hits(void) { #ifdef HAVE_SIGPROCMASK sigset_t oldmask; #else int oldmask; #endif POOL_SETMASK2(&BlockSig, &oldmask); pool_semaphore_lock(QUERY_CACHE_STATS_SEM); stats->num_cache_hits++; pool_semaphore_unlock(QUERY_CACHE_STATS_SEM); POOL_SETMASK(&oldmask); return stats->num_cache_hits; } /* * On shared memory hash table implementation. We use sub part of md5 * hash key as hash function. The experiment has shown that has_any() * of PostgreSQL is a little bit better than the method using part of * md5 hash value, but it seems adding some cpu cycles to call * hash_any() is not worth the trouble. */ static volatile POOL_HASH_HEADER *hash_header; static volatile POOL_HASH_ELEMENT *hash_elements; static volatile POOL_HASH_ELEMENT hash_free_body; static volatile POOL_HASH_ELEMENT *hash_free; /* * Initialize hash table on shared memory "nelements" is max number of * hash keys. The actual number of hash key is rounded up to power of * 2. */ #undef POOL_HASH_DEBUG int pool_hash_init(int nelements) { size_t size; int nelements2; /* number of rounded up hash keys */ int shift; uint32 mask; POOL_HASH_HEADER hh; int i; if (nelements <= 0) ereport(ERROR, (errmsg("initializing hash table on shared memory, invalid number of elements: %d",nelements))); /* Round up to power of 2 */ shift = 32; nelements2 = 1; do { nelements2 <<= 1; shift--; } while (nelements2 < nelements); mask = ~0; mask >>= shift; size = (char *)&hh.elements - (char *)&hh + sizeof(POOL_HEADER_ELEMENT)*nelements2; hash_header = pool_shared_memory_create(size); hash_header->nhash = nelements2; hash_header->mask = mask; #ifdef POOL_HASH_DEBUG ereport(LOG, (errmsg("initializing hash table on shared memory"), errdetail("size:%zd nelements2:%d", size, nelements2))); #endif size = sizeof(POOL_HASH_ELEMENT)*nelements2; hash_elements = pool_shared_memory_create(size); #ifdef POOL_HASH_DEBUG ereport(LOG, (errmsg("initializing hash table on shared memory"), errdetail("size:%zd nelements2:%d", size, nelements2))); #endif for (i=0;i>= shift; size = (char *)&hh.elements - (char *)&hh + sizeof(POOL_HEADER_ELEMENT)*nelements2; memset((void *)hash_header, 0, size); hash_header->nhash = nelements2; hash_header->mask = mask; size = sizeof(POOL_HASH_ELEMENT)*nelements2; memset((void *)hash_elements, 0, size); for (i=0;i= hash_header->nhash) { ereport(WARNING, (errmsg("memcache: searching cacheid from hash. invalid hash key"), errdetail("invalid hash key: %uld nhash: %ld", hash_key, hash_header->nhash))); return NULL; } { char md5[POOL_MD5_HASHKEYLEN+1]; memcpy(md5, key->query_hash, POOL_MD5_HASHKEYLEN); md5[POOL_MD5_HASHKEYLEN] = '\0'; #ifdef POOL_HASH_DEBUG ereport(LOG, (errmsg("searching hash table"), errdetail("hash_key:%d md5:%s", hash_key, md5))); #endif } element = hash_header->elements[hash_key].element; while (element) { { char md5[POOL_MD5_HASHKEYLEN+1]; memcpy(md5, key->query_hash, POOL_MD5_HASHKEYLEN); md5[POOL_MD5_HASHKEYLEN] = '\0'; #ifdef POOL_HASH_DEBUG ereport(LOG, (errmsg("searching hash table"), errdetail("element md5:%s", md5))); #endif } if (memcmp((const void *)element->hashkey.query_hash, (const void *)key->query_hash, sizeof(key->query_hash)) == 0) { return (POOL_CACHEID *)&element->cacheid; } element = element->next; } return NULL; } /* * Insert MD5 key and associated cache id into shmem hash table. If * "update" is true, replace cacheid associated with the MD5 key, * rather than throw an error. */ static int pool_hash_insert(POOL_QUERY_HASH *key, POOL_CACHEID *cacheid, bool update) { POOL_HASH_ELEMENT *element; POOL_HASH_ELEMENT *new_element; uint32 hash_key = create_hash_key(key); if (hash_key >= hash_header->nhash) { ereport(WARNING, (errmsg("memcache: adding cacheid to hash. invalid hash key"), errdetail("invalid hash key: %uld nhash: %ld", hash_key, hash_header->nhash))); return -1; } { char md5[POOL_MD5_HASHKEYLEN+1]; memcpy(md5, key->query_hash, POOL_MD5_HASHKEYLEN); md5[POOL_MD5_HASHKEYLEN] = '\0'; #ifdef POOL_HASH_DEBUG ereport(LOG, (errmsg("searching hash table"), errdetail("hash_key:%d md5:%s block:%d item:%d", hash_key, md5, cacheid->blockid, cacheid->itemid))); #endif } /* * Look for hash key. */ element = hash_header->elements[hash_key].element; while (element) { if (memcmp((const void *)element->hashkey.query_hash, (const void *)key->query_hash, sizeof(key->query_hash)) == 0) { /* Hash key found. If "update" is false, just throw an error. */ char md5[POOL_MD5_HASHKEYLEN+1]; if (!update) { memcpy(md5, key->query_hash, POOL_MD5_HASHKEYLEN); md5[POOL_MD5_HASHKEYLEN] = '\0'; ereport(LOG, (errmsg("memcache: adding cacheid to hash. hash key:\"%s\" already exists",md5))); return -1; } else { /* Update cache id */ memcpy((void *)&element->cacheid, cacheid, sizeof(POOL_CACHEID)); return 0; } } element = element->next; } /* * Ok, same key did not exist. Just insert new hash key. */ new_element = (POOL_HASH_ELEMENT *)get_new_hash_element(); if (!new_element) { ereport(LOG, (errmsg("memcache: adding cacheid to hash. failed to get new element"))); return -1; } element = hash_header->elements[hash_key].element; hash_header->elements[hash_key].element = new_element; new_element->next = element; memcpy((void *)new_element->hashkey.query_hash, key->query_hash, POOL_MD5_HASHKEYLEN); memcpy((void *)&new_element->cacheid, cacheid, sizeof(POOL_CACHEID)); return 0; } /* * Delete MD5 key and associated cache id into shmem hash table. */ int pool_hash_delete(POOL_QUERY_HASH *key) { POOL_HASH_ELEMENT *element; POOL_HASH_ELEMENT **delete_point; bool found; uint32 hash_key = create_hash_key(key); if (hash_key >= hash_header->nhash) { ereport(LOG, (errmsg("memcache: deleting key from hash. invalid key"), errdetail("invalid hash key: %uld nhash: %ld", hash_key, hash_header->nhash))); return -1; } /* * Look for delete location */ found = false; delete_point = (POOL_HASH_ELEMENT **)&(hash_header->elements[hash_key].element); element = hash_header->elements[hash_key].element; while (element) { if (memcmp(element->hashkey.query_hash, key->query_hash, sizeof(key->query_hash)) == 0) { found = true; break; } delete_point = &element->next; element = element->next; } if (!found) { char md5[POOL_MD5_HASHKEYLEN+1]; memcpy(md5, key->query_hash, POOL_MD5_HASHKEYLEN); md5[POOL_MD5_HASHKEYLEN] = '\0'; ereport(LOG, (errmsg("memcache: deleting key from hash. key:\"%s\" not found",md5))); return -1; } /* * Put back the element to free list */ *delete_point = element->next; put_back_hash_element(element); return 0; } /* * Calculate 32bit binary hash key(i.e. location in hash header) from MD5 * string. We use top most 8 characters of MD5 string for calculation. */ static uint32 create_hash_key(POOL_QUERY_HASH *key) { #define POOL_HASH_NCHARS 8 char md5[POOL_HASH_NCHARS+1]; uint32 mask; memcpy(md5, key->query_hash, POOL_HASH_NCHARS); md5[POOL_HASH_NCHARS] = '\0'; mask = strtoul(md5, NULL, 16); mask &= hash_header->mask; return mask; } /* * Get new free hash element from free list. */ static volatile POOL_HASH_ELEMENT *get_new_hash_element(void) { volatile POOL_HASH_ELEMENT *elm; if (!hash_free->next) { /* No free element */ return NULL; } #ifdef POOL_HASH_DEBUG ereport(LOG, (errmsg("getting new hash element"), errdetail("hash_free->next:%p hash_free->next->next:%p", hash_free->next, hash_free->next->next))); #endif elm = hash_free->next; hash_free->next = elm->next; return elm; } /* * Put back hash element to free list. */ static void put_back_hash_element(volatile POOL_HASH_ELEMENT *element) { POOL_HASH_ELEMENT *elm; #ifdef POOL_HASH_DEBUG ereport(LOG, (errmsg("getting new hash element"), errdetail("hash_free->next:%p hash_free->next->next:%p", hash_free->next, hash_free->next->next))); #endif elm = hash_free->next; hash_free->next = (POOL_HASH_ELEMENT *)element; element->next = elm; } /* * Return true if there's a free hash element. */ static bool is_free_hash_element(void) { return hash_free->next != NULL; } /* * Returns shared memory cache stats. * Subsequent call to this function will break return value * because its in static memory. * Caller must hold shmem_lock before calling this function. * If in memory query cache is not enabled, all stats are 0. */ POOL_SHMEM_STATS *pool_get_shmem_storage_stats(void) { static POOL_SHMEM_STATS mystats; POOL_HASH_ELEMENT *element; int nblocks; int i; memset(&mystats, 0, sizeof(POOL_SHMEM_STATS)); if (!pool_config-> memory_cache_enabled) return &mystats; /* * Cop cache hit data */ mystats.cache_stats.num_selects = stats->num_selects; mystats.cache_stats.num_cache_hits = stats->num_cache_hits; if (strcmp(pool_config-> memqcache_method, "shmem")) return &mystats; /* number of total hash entries */ mystats.num_hash_entries = hash_header->nhash; /* number of used hash entries */ for (i=0;inhash;i++) { element = hash_header->elements[i].element; while (element) { mystats.used_hash_entries++; element = element->next; } } nblocks = pool_get_memqcache_blocks(); for (i=0;iflags & POOL_BLOCK_USED) { for (j=0;jnum_items;j++) { cip = item_pointer(p, j); if (POOL_ITEM_DELETED & cip->flags) { mystats.fragment_cache_entries_size += item_header(p, j)->total_length; } else { /* number of used cache entries */ mystats.num_cache_entries++; /* total size of used cache entries */ mystats.used_cache_entries_size += (item_header(p, j)->total_length + sizeof(POOL_CACHE_ITEM_POINTER)); } } mystats.used_cache_entries_size += sizeof(POOL_CACHE_BLOCK_HEADER); /* total size of free(usable) cache entries */ mystats.free_cache_entries_size += bh->free_bytes; } else { mystats.free_cache_entries_size += pool_config->memqcache_cache_block_size; } } /* * Copy POOL_QUERY_CACHE_STATS */ memcpy(&mystats.cache_stats, stats, sizeof(mystats.cache_stats)); return &mystats; } pgpool-II-3.4.3/src/pcp_con/0002775000076400007640000000000012554350617012555 500000000000000pgpool-II-3.4.3/src/pcp_con/recovery.c0000664000076400007640000002643412554350605014503 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2014 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation, and that the name of the * author not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. The author makes no representations about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * * recovery.c: online recovery process * */ #include "config.h" #include #include #include "utils/elog.h" #include "pool.h" #include "pool_config.h" #include "libpq-fe.h" #include "watchdog/watchdog.h" #include "watchdog/wd_ext.h" #define WAIT_RETRY_COUNT (pool_config->recovery_timeout / 3) #define FIRST_STAGE 0 #define SECOND_STAGE 1 static void exec_checkpoint(PGconn *conn); static void exec_recovery(PGconn *conn, BackendInfo *master_backend, BackendInfo *recovery_backend, char stage); static void exec_remote_start(PGconn *conn, BackendInfo *backend); static PGconn *connect_backend_libpq(BackendInfo *backend); static void check_postmaster_started(BackendInfo *backend); static char recovery_command[1024]; extern volatile sig_atomic_t pcp_wakeup_request; /* * Start online recovery. * "recovery_node" is the node to be recovered. * Master or primary node is chosen in this function. */ void start_recovery(int recovery_node) { int node_id; BackendInfo *backend; BackendInfo *recovery_backend; PGconn *conn; int failback_wait_count; #define FAILBACK_WAIT_MAX_RETRY 5 /* 5 seconds should be enough for failback operation */ ereport(LOG, (errmsg("starting recovering node %d", recovery_node))); if ( (recovery_node < 0) || (recovery_node >= pool_config->backend_desc->num_backends) ) ereport(ERROR, (errmsg("node recovery failed, node id: %d is not valid", recovery_node))); if (VALID_BACKEND(recovery_node)) ereport(ERROR, (errmsg("node recovery failed, node id: %d is alive", recovery_node))); /* select master/primary node */ node_id = MASTER_SLAVE ? PRIMARY_NODE_ID : REAL_MASTER_NODE_ID; backend = &pool_config->backend_desc->backend_info[node_id]; /* get node info to be recovered */ recovery_backend = &pool_config->backend_desc->backend_info[recovery_node]; conn = connect_backend_libpq(backend); if (conn == NULL) ereport(ERROR, (errmsg("node recovery failed, unable to connect to master node: %d ", node_id))); PG_TRY(); { /* 1st stage */ if (REPLICATION) { exec_checkpoint(conn); ereport(LOG, (errmsg("node recovery, CHECKPOINT in the 1st stage done"))); } exec_recovery(conn, backend, recovery_backend, FIRST_STAGE); ereport(LOG, (errmsg("node recovery, 1st stage is done"))); if (REPLICATION) { ereport(LOG, (errmsg("node recovery, starting 2nd stage"))); /* 2nd stage */ *InRecovery = RECOVERY_ONLINE; if (pool_config->use_watchdog) { /* announce start recovery */ if (WD_OK != wd_start_recovery()) ereport(ERROR, (errmsg("node recovery failed, failed to send start recovery packet"))); } if (wait_connection_closed() != 0) ereport(ERROR, (errmsg("node recovery failed, waiting connection closed in the other pgpools timeout"))); ereport(LOG, (errmsg("node recovery, all connections from clients have been closed"))); exec_checkpoint(conn); ereport(LOG, (errmsg("node recovery"), errdetail("CHECKPOINT in the 2nd stage done"))); exec_recovery(conn, backend, recovery_backend, SECOND_STAGE); } exec_remote_start(conn, recovery_backend); check_postmaster_started(recovery_backend); ereport(LOG, (errmsg("node recovery, node: %d restarted", recovery_node))); /* * reset failover completion flag. this is necessary since * previous failover/failback will set the flag to 1. */ pcp_wakeup_request = 0; /* send failback request to pgpool parent */ send_failback_request(recovery_node); /* wait for failback */ failback_wait_count = 0; while (!pcp_wakeup_request) { struct timeval t = {1, 0}; /* polling SIGUSR2 signal every 1 sec */ select(0, NULL, NULL, NULL, &t); failback_wait_count++; if (failback_wait_count >= FAILBACK_WAIT_MAX_RETRY) { ereport(LOG, (errmsg("node recovery"), errdetail("waiting for wake up request is timeout(%d seconds)", FAILBACK_WAIT_MAX_RETRY))); break; } } pcp_wakeup_request = 0; } PG_CATCH(); { PQfinish(conn); PG_RE_THROW(); } PG_END_TRY(); PQfinish(conn); ereport(LOG, (errmsg("recovery done"))); } /* * Notice all children finishing recovery. */ void finish_recovery(void) { /* announce end recovery */ if (pool_config->use_watchdog && *InRecovery != RECOVERY_INIT) { wd_end_recovery(); } *InRecovery = RECOVERY_INIT; pool_signal_parent(SIGUSR2); } /* * Execute CHECKPOINT */ static void exec_checkpoint(PGconn *conn) { PGresult *result; ereport(DEBUG1, (errmsg("recovery execute checkpoint, start checkpoint"))); result = PQexec(conn, "CHECKPOINT"); if(PQresultStatus(result) != PGRES_COMMAND_OK) ereport(ERROR, (errmsg("executing recovery, execute CHECKPOINT failed"))); PQclear(result); ereport(DEBUG1, (errmsg("recovery execute checkpoint, finish checkpoint"))); } /* * Call pgpool_recovery() function. */ static void exec_recovery(PGconn *conn, BackendInfo *master_backend, BackendInfo *recovery_backend, char stage) { PGresult *result; char *hostname; char *script; if (strlen(recovery_backend->backend_hostname) == 0 || *(recovery_backend->backend_hostname) == '/') hostname = "localhost"; else hostname = recovery_backend->backend_hostname; script = (stage == FIRST_STAGE) ? pool_config->recovery_1st_stage_command : pool_config->recovery_2nd_stage_command; if (script == NULL || strlen(script) == 0) { /* do not execute script */ return; } /* * Execute recovery command */ snprintf(recovery_command, sizeof(recovery_command), "SELECT pgpool_recovery('%s', '%s', '%s', '%d')", script, hostname, recovery_backend->backend_data_directory, master_backend->backend_port); ereport(LOG, (errmsg("executing recovery"), errdetail("starting recovery command: \"%s\"", recovery_command))); ereport(LOG, (errmsg("executing recovery"), errdetail("disabling statement_timeout"))); result = PQexec(conn, "SET statement_timeout To 0"); if(PQresultStatus(result) != PGRES_COMMAND_OK) ereport(ERROR, (errmsg("executing recovery, SET STATEMENT_TIMEOUT failed at \"%s\"", (stage == FIRST_STAGE) ? "1st stage" : "2nd stage"))); PQclear(result); ereport(DEBUG1, (errmsg("executing recovery, start recovery"))); result = PQexec(conn, recovery_command); if(PQresultStatus(result) != PGRES_TUPLES_OK) ereport(ERROR, (errmsg("executing recovery, execution of command failed at \"%s\"", (stage == FIRST_STAGE) ? "1st stage" : "2nd stage"), errdetail("command:\"%s\"",script))); PQclear(result); ereport(DEBUG1, (errmsg("executing recovery, finish recovery"))); } /* * Call pgpool_remote_start() function. */ static void exec_remote_start(PGconn *conn, BackendInfo *backend) { PGresult *result; char *hostname; if (strlen(backend->backend_hostname) == 0 || *(backend->backend_hostname) == '/') hostname = "localhost"; else hostname = backend->backend_hostname; snprintf(recovery_command, sizeof(recovery_command), "SELECT pgpool_remote_start('%s', '%s')", hostname, backend->backend_data_directory); ereport(DEBUG1, (errmsg("executing remote start"), errdetail("start pgpool_remote_start"))); result = PQexec(conn, recovery_command); if(PQresultStatus(result) != PGRES_TUPLES_OK) ereport(ERROR, (errmsg("executing remote start failed with error: \"%s\"",PQresultErrorMessage(result)))); PQclear(result); ereport(DEBUG1, (errmsg("executing remote start"), errdetail("finish pgpool_remote_start"))); } /* * Check postmaster is started. */ static void check_postmaster_started(BackendInfo *backend) { int i = 0; char port_str[16]; PGconn *conn; char *dbname; snprintf(port_str, sizeof(port_str),"%d", backend->backend_port); /* * First we try with "postgres" database. */ dbname = "postgres"; do { ConnStatusType r; ereport(LOG, (errmsg("checking if postmaster is started"), errdetail("trying to connect to postmaster on hostname:%s database:%s user:%s (retry %d times)", backend->backend_hostname, dbname, pool_config->recovery_user, i))); conn = PQsetdbLogin(backend->backend_hostname, port_str, NULL, NULL, dbname, pool_config->recovery_user, pool_config->recovery_password); r = PQstatus(conn); PQfinish(conn); if (r == CONNECTION_OK) return; ereport(LOG, (errmsg("checking if postmaster is started"), errdetail("failed to connect to postmaster on hostname:%s database:%s user:%s", backend->backend_hostname, dbname, pool_config->recovery_user))); sleep(3); } while (i++ < 3); /* XXX Hard coded retry (9 seconds) */ /* * Retry with "template1" database. */ dbname = "template1"; i = 0; do { ConnStatusType r; ereport(LOG, (errmsg("checking if postmaster is started"), errdetail("trying to connect to postmaster on hostname:%s database:%s user:%s (retry %d times)", backend->backend_hostname, dbname, pool_config->recovery_user, i))); conn = PQsetdbLogin(backend->backend_hostname, port_str, NULL, NULL, dbname, pool_config->recovery_user, pool_config->recovery_password); r = PQstatus(conn); PQfinish(conn); if (r == CONNECTION_OK) return; ereport(LOG, (errmsg("checking if postmaster is started"), errdetail("failed to connect to postmaster on hostname:%s database:%s user:%s", backend->backend_hostname, dbname, pool_config->recovery_user))); if (WAIT_RETRY_COUNT != 0) sleep(3); } while (i++ < WAIT_RETRY_COUNT); ereport(ERROR, (errmsg("recovery is checking if postmaster is started"), errdetail("postmaster on hostname:\"%s\" database:\"%s\" user:\"%s\" failed to start in %d second", backend->backend_hostname, dbname, pool_config->recovery_user, pool_config->recovery_timeout))); } static PGconn *connect_backend_libpq(BackendInfo *backend) { char port_str[16]; PGconn *conn; snprintf(port_str, sizeof(port_str), "%d", backend->backend_port); conn = PQsetdbLogin(backend->backend_hostname, port_str, NULL, NULL, "template1", pool_config->recovery_user, pool_config->recovery_password); if (PQstatus(conn) != CONNECTION_OK) { PQfinish(conn); return NULL; } return conn; } /* * Wait all connections are closed. */ int wait_connection_closed(void) { int i = 0; do { if (Req_info->conn_counter == 0) return 0; if (WAIT_RETRY_COUNT != 0) sleep(3); } while (i++ < WAIT_RETRY_COUNT); ereport(LOG, (errmsg("wait_connection_closed: existing connections did not close in %d sec.", pool_config->recovery_timeout))); return 1; } pgpool-II-3.4.3/src/pcp_con/pcp_child.c0000664000076400007640000012102612554350605014563 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2011 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation, and that the name of the * author not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. The author makes no representations about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * * pcp_child.c: PCP child process main * */ #include "config.h" #include "pool.h" #include "utils/palloc.h" #include "utils/memutils.h" #include #include #include #include #include #include #ifdef HAVE_NETINET_TCP_H #include #endif #ifdef HAVE_SYS_SELECT_H #include #endif #include #include #include #include #include #include #include #ifdef HAVE_FCNTL_H #include #endif #include "pool.h" #include "pcp/pcp_stream.h" #include "pcp/pcp.h" #include "auth/md5.h" #include "pool_config.h" #include "context/pool_process_context.h" #include "utils/pool_process_reporting.h" #include "watchdog/wd_ext.h" #include "utils/elog.h" #define MAX_FILE_LINE_LEN 512 #define MAX_USER_PASSWD_LEN 128 extern void pcp_set_timeout(long sec); volatile sig_atomic_t pcp_exit_request; /* non 0 means SIGTERM(smart shutdown) or SIGINT(fast shutdown) has arrived */ static RETSIGTYPE die(int sig); static PCP_CONNECTION *pcp_do_accept(int unix_fd, int inet_fd); static void unset_nonblock(int fd); static int user_authenticate(char *buf, char *passwd_file, char *salt, int salt_len); static RETSIGTYPE wakeup_handler(int sig); static RETSIGTYPE reload_config_handler(int sig); static RETSIGTYPE restart_handler(int sig); static int pool_detach_node(int node_id, bool gracefully); static int pool_promote_node(int node_id, bool gracefully); static volatile sig_atomic_t pcp_got_sighup = 0; volatile sig_atomic_t pcp_wakeup_request = 0; static volatile sig_atomic_t pcp_restart_request = 0; static void do_pcp_flush(PCP_CONNECTION *frontend); static void inform_process_count(PCP_CONNECTION *frontend); static void inform_process_info(PCP_CONNECTION *frontend, char *buf); static void inform_systemDB_info(PCP_CONNECTION *frontend); static void inform_watchdog_info(PCP_CONNECTION *frontend, char *buf); static void inform_node_info(PCP_CONNECTION *frontend, char *buf); static void inform_node_count(PCP_CONNECTION *frontend); static void process_detach_node(PCP_CONNECTION *frontend,char *buf,char tos); static void process_attach_node(PCP_CONNECTION *frontend,char *buf); static void process_recovery_request(PCP_CONNECTION *frontend,char *buf); static void process_status_request(PCP_CONNECTION *frontend); static void process_promote_node(PCP_CONNECTION *frontend,char *buf, char tos); static void process_shutown_request(char mode); static void process_authentication(PCP_CONNECTION *frontend, char *buf, char *pcp_conf_file, char* salt, int *random_salt,volatile int *authenticated); static void send_md5salt(PCP_CONNECTION *frontend, char* salt); #define CHECK_RESTART_REQUEST \ do { \ if (pcp_restart_request) \ { \ ereport(LOG,(errmsg("restart request received in pcp child process"))); \ exit(1); \ } \ else \ { \ pool_initialize_private_backend_status(); \ } \ } while (0) void pcp_do_child(int unix_fd, int inet_fd, char *pcp_conf_file) { sigjmp_buf local_sigjmp_buf; MemoryContext PCPMemoryContext; PCP_CONNECTION* volatile frontend = NULL; volatile int authenticated = 0; struct timeval uptime; char salt[4]; int random_salt = 0; char tos; int rsize; char *buf = NULL; ereport(DEBUG1, (errmsg("I am PCP child with pid:%d",getpid()))); /* Identify myself via ps */ init_ps_display("", "", "", ""); gettimeofday(&uptime, NULL); srandom((unsigned int) (getpid() ^ uptime.tv_usec)); /* set pcp_read() timeout */ pcp_set_timeout(pool_config->pcp_timeout); /* set up signal handlers */ signal(SIGTERM, die); signal(SIGINT, die); signal(SIGHUP, reload_config_handler); signal(SIGQUIT, die); signal(SIGCHLD, SIG_DFL); signal(SIGUSR1, restart_handler); signal(SIGUSR2, wakeup_handler); signal(SIGPIPE, SIG_IGN); signal(SIGALRM, SIG_IGN); /* Create per loop iteration memory context */ PCPMemoryContext = AllocSetContextCreate(TopMemoryContext, "PCP_main_loop", ALLOCSET_DEFAULT_MINSIZE, ALLOCSET_DEFAULT_INITSIZE, ALLOCSET_DEFAULT_MAXSIZE); MemoryContextSwitchTo(TopMemoryContext); /* Initialize my backend status */ pool_initialize_private_backend_status(); /* Initialize process context */ pool_init_process_context(); if (sigsetjmp(local_sigjmp_buf, 1) != 0) { pool_signal(SIGALRM, SIG_IGN); if(frontend) pcp_close(frontend); frontend = NULL; authenticated = 0; error_context_stack = NULL; EmitErrorReport(); MemoryContextSwitchTo(TopMemoryContext); FlushErrorState(); } /* We can now handle ereport(ERROR) */ PG_exception_stack = &local_sigjmp_buf; for(;;) { MemoryContextSwitchTo(PCPMemoryContext); MemoryContextResetAndDeleteChildren(PCPMemoryContext); errno = 0; CHECK_RESTART_REQUEST; if (frontend == NULL) { frontend = pcp_do_accept(unix_fd, inet_fd); if (frontend == NULL) continue; unset_nonblock(frontend->fd); } /* read a PCP packet */ if (pcp_read(frontend, &tos, 1)) { if (errorcode == TIMEOUTERR) { ereport(ERROR, (errmsg("unable to read from client"), errdetail("pcp_read time out"))); } ereport(FATAL, (errmsg("unable to read from client"), errdetail("pcp_read failed with error : \"%s\"",strerror(errno)))); } if (pcp_read(frontend, &rsize, sizeof(int))) { if (errorcode == TIMEOUTERR) { ereport(ERROR, (errmsg("unable to read from client"), errdetail("pcp_read time out"))); } ereport(FATAL, (errmsg("unable to read from client"), errdetail("pcp_read failed with error : \"%s\"",strerror(errno)))); } rsize = ntohl(rsize); if ((rsize - sizeof(int)) > 0) { buf = (char *)palloc(rsize - sizeof(int)); if (pcp_read(frontend, buf, rsize - sizeof(int))) { if (errorcode == TIMEOUTERR) { ereport(ERROR, (errmsg("unable to read from client"), errdetail("pcp_read time out"))); } ereport(FATAL, (errmsg("unable to read from client"), errdetail("pcp_read failed with error : \"%s\"",strerror(errno)))); } } /* is this connection authenticated? if not disconnect immediately*/ if ((! authenticated) && (tos != 'R' && tos != 'M')) { ereport(ERROR, (errmsg("authentication failed for new PCP connection"), errdetail("connection not authorized"))); } /* process a request */ ereport(DEBUG1, (errmsg("received PCP packet"), errdetail("PCP packet type of service '%c'", tos))); set_ps_display("PCP: processing a request", false); if (tos == 'C' || tos == 'd' || tos == 'D' || tos == 'j' || tos == 'J' || tos == 'O' || tos == 'T') { if (Req_info->switching) { int len; int wsize; char *msg = "OperationInProgress"; if(Req_info->request_queue_tail != Req_info->request_queue_head) { POOL_REQUEST_KIND reqkind; reqkind = Req_info->request[(Req_info->request_queue_head +1) % MAX_REQUEST_QUEUE_SIZE].kind; if (reqkind == NODE_UP_REQUEST) msg = "FailbackInProgress"; else if (reqkind == NODE_DOWN_REQUEST) msg = "FailoverInProgress"; else if (reqkind == PROMOTE_NODE_REQUEST) msg = "PromotionInProgress"; } len = strlen(msg) + 1; pcp_write(frontend, "e", 1); wsize = htonl(sizeof(int) + len); pcp_write(frontend, &wsize, sizeof(int)); pcp_write(frontend, msg, len); } } switch (tos) { case 'R': /* authentication */ process_authentication(frontend, buf, pcp_conf_file, salt, &random_salt, &authenticated); break; case 'M': /* md5 salt */ send_md5salt(frontend, salt); random_salt = 1; break; case 'L': /* node count */ inform_node_count(frontend); break; case 'I': /* node info */ inform_node_info(frontend, buf); break; case 'N': /* process count */ inform_process_count(frontend); break; case 'P': /* process info */ inform_process_info(frontend, buf); break; case 'S': /* SystemDB info */ inform_systemDB_info(frontend); break; case 'W': /* watchdog info */ inform_watchdog_info(frontend, buf); break; case 'D': /* detach node */ case 'd': /* detach node gracefully */ process_detach_node(frontend, buf, tos); break; case 'C': /* attach node */ process_attach_node(frontend, buf); break; case 'T': process_shutown_request(buf[0]); break; case 'O': /* recovery request */ process_recovery_request(frontend, buf); break; case 'B': /* status request*/ process_status_request(frontend); break; case 'J': /* promote node */ case 'j': /* promote node gracefully */ process_promote_node(frontend,buf,tos); break; case 'F': ereport(DEBUG1, (errmsg("PCP processing request, stop online recovery"))); break; case 'X': /* disconnect */ ereport(DEBUG1, (errmsg("PCP processing request, client disconnecting"), errdetail("closing PCP connection"))); authenticated = 0; pcp_close(frontend); frontend = NULL; break; default: ereport(FATAL, (errmsg("PCP processing request"), errdetail("unknown PCP packet type \"%c\"",tos))); } /* seems ok. cancel idle check timer */ pool_signal(SIGALRM, SIG_IGN); } exit(0); } static RETSIGTYPE die(int sig) { pcp_exit_request = 1; ereport(DEBUG1, (errmsg("PCP child receives shutdown request signal %d", sig))); switch (sig) { case SIGTERM: /* smart shutdown */ case SIGINT: /* fast shutdown */ case SIGQUIT: /* immediate shutdown */ exit(0); break; default: break; } exit(1); } static RETSIGTYPE wakeup_handler(int sig) { pcp_wakeup_request = 1; } static RETSIGTYPE restart_handler(int sig) { pcp_restart_request = 1; } static PCP_CONNECTION * pcp_do_accept(int unix_fd, int inet_fd) { PCP_CONNECTION *pc = NULL; fd_set readmask; int fds; struct sockaddr addr; socklen_t addrlen; int fd = 0; int afd; int inet = 0; set_ps_display("PCP: wait for connection request", false); FD_ZERO(&readmask); FD_SET(unix_fd, &readmask); if (inet_fd) FD_SET(inet_fd, &readmask); fds = select(Max(unix_fd, inet_fd)+1, &readmask, NULL, NULL, NULL); if (fds == -1) { if (errno == EAGAIN || errno == EINTR) return NULL; ereport(ERROR, (errmsg("unable to accept new pcp connection"), errdetail("select system call failed with error : \"%s\"",strerror(errno)))); } if (FD_ISSET(unix_fd, &readmask)) { fd = unix_fd; } if (FD_ISSET(inet_fd, &readmask)) { fd = inet_fd; inet++; } addrlen = sizeof(addr); afd = accept(fd, &addr, &addrlen); if (afd < 0) { /* * "Resource temporarily unavailable" (EAGAIN or EWOULDBLOCK) * can be silently ignored. */ if (errno != EAGAIN && errno != EWOULDBLOCK) ereport(ERROR, (errmsg("unable to accept new pcp connection"), errdetail("socket accept system call failed with error : \"%s\"",strerror(errno)))); } if (pcp_got_sighup) { MemoryContext oldContext = MemoryContextSwitchTo(TopMemoryContext); pool_get_config(get_config_file_name(), RELOAD_CONFIG); MemoryContextSwitchTo(oldContext); pcp_got_sighup = 0; } ereport(DEBUG2, (errmsg("I am PCP child with PID:%d and accept fd:%d", getpid(), afd))); if (inet) { int on = 1; if (setsockopt(afd, IPPROTO_TCP, TCP_NODELAY, (char *) &on, sizeof(on)) < 0) { close(afd); ereport(ERROR, (errmsg("unable to accept new pcp connection"), errdetail("setsockopt system call failed with error : \"%s\"",strerror(errno)))); } if (setsockopt(afd, SOL_SOCKET, SO_KEEPALIVE, (char *) &on, sizeof(on)) < 0) { close(afd); ereport(ERROR, (errmsg("unable to accept new pcp connection"), errdetail("setsockopt system call failed with error : \"%s\"",strerror(errno)))); } } pc = pcp_open(afd); return pc; } /* * unset non-block flag */ static void unset_nonblock(int fd) { int var; /* set fd to non-blocking */ var = fcntl(fd, F_GETFL, 0); if (var == -1) { ereport(FATAL, (errmsg("unable to connect"), errdetail("fcntl system call failed with error : \"%s\"",strerror(errno)))); } if (fcntl(fd, F_SETFL, var & ~O_NONBLOCK) == -1) { ereport(FATAL, (errmsg("unable to connect"), errdetail("fcntl system call failed with error : \"%s\"",strerror(errno)))); } } /* * see if received username and password matches with one in the file */ static int user_authenticate(char *buf, char *passwd_file, char *salt, int salt_len) { FILE *fp = NULL; char packet_username[MAX_USER_PASSWD_LEN+1]; char packet_password[MAX_USER_PASSWD_LEN+1]; char encrypt_buf[(MD5_PASSWD_LEN+1)*2]; char file_username[MAX_USER_PASSWD_LEN+1]; char file_password[MAX_USER_PASSWD_LEN+1]; char *index = NULL; static char line[MAX_FILE_LINE_LEN+1]; int i, len; /* strcpy() should be OK, but use strncpy() to be extra careful */ strncpy(packet_username, buf, MAX_USER_PASSWD_LEN); index = (char *) memchr(buf, '\0', MAX_USER_PASSWD_LEN); if (index == NULL) { ereport(LOG, (errmsg("failed to authenticate PCP user"), errdetail("error while reading authentication packet"))); return 0; } strncpy(packet_password, ++index, MAX_USER_PASSWD_LEN); fp = fopen(passwd_file, "r"); if (fp == NULL) { ereport(LOG, (errmsg("failed to authenticate PCP user"), errdetail("could not open %s. reason: %s", passwd_file, strerror(errno)))); return 0; } /* for now, I don't care if duplicate username exists in the config file */ while ((fgets(line, MAX_FILE_LINE_LEN, fp)) != NULL) { i = 0; len = 0; if (line[0] == '\n') continue; if (line[0] == '#') continue; while (line[i] != ':') { len++; if (++i > MAX_USER_PASSWD_LEN) { fclose(fp); ereport(LOG, (errmsg("failed to authenticate PCP user"), errdetail("username read from file \"%s\" is larger than maximum allowed username length [%d]", passwd_file, MAX_USER_PASSWD_LEN))); return 0; } } memcpy(file_username, line, len); file_username[len] = '\0'; if (strcmp(packet_username, file_username) != 0) continue; i++; len = 0; while (line[i] != '\n' && line[i] != '\0') { len++; if (++i > MAX_USER_PASSWD_LEN) { fclose(fp); ereport(LOG, (errmsg("failed to authenticate PCP user"), errdetail("password read from file \"%s\" is larger than maximum allowed password length [%d]", passwd_file, MAX_USER_PASSWD_LEN))); return 0; } } memcpy(file_password, line+strlen(file_username)+1, len); file_password[len] = '\0'; pool_md5_encrypt(file_password, file_username, strlen(file_username), encrypt_buf + MD5_PASSWD_LEN + 1); encrypt_buf[(MD5_PASSWD_LEN+1)*2-1] = '\0'; pool_md5_encrypt(encrypt_buf+MD5_PASSWD_LEN+1, salt, salt_len, encrypt_buf); encrypt_buf[MD5_PASSWD_LEN] = '\0'; if (strcmp(encrypt_buf, packet_password) == 0) { fclose(fp); return 1; } } fclose(fp); return 0; } /* SIGHUP handler */ static RETSIGTYPE reload_config_handler(int sig) { pcp_got_sighup = 1; } /* Dedatch a node */ static int pool_detach_node(int node_id, bool gracefully) { int nRet = 0; if (!gracefully) { if (degenerate_backend_set_ex(&node_id, 1, false, false) == false) { ereport(LOG, (errmsg("PCP: processing detach node failed"), errdetail("detaching Node ID %d", node_id))); return -1; } return 0; } /* Check if the NODE DOWN can be executed on * the given node id. */ if (degenerate_backend_set_ex(&node_id, 1, false, true) == false) { ereport(LOG, (errmsg("PCP: processing graceful detach node failed"), errdetail("detaching Node ID %d", node_id))); return -1; } /* * Wait until all frontends exit */ *InRecovery = RECOVERY_DETACH; /* This wiil ensure that new incoming * connection requests are blocked */ if (wait_connection_closed()) { /* wait timed out */ finish_recovery(); return -1; } /* * Now all frontends have gone. Let's do failover. */ if (degenerate_backend_set_ex(&node_id, 1, false, false) == false) { nRet = -1; pcp_wakeup_request = 1; ereport(LOG, (errmsg("PCP: processing graceful detach node failed"), errdetail("detaching Node ID %d", node_id))); } else { /* * Wait for failover completed. */ pcp_wakeup_request = 0; } while (!pcp_wakeup_request) { struct timeval t = {1, 0}; select(0, NULL, NULL, NULL, &t); } pcp_wakeup_request = 0; /* * Start to accept incoming connections and send SIGUSR2 to pgpool * parent to distribute SIGUSR2 all pgpool children. */ finish_recovery(); return nRet; } /* Promote a node */ static int pool_promote_node(int node_id, bool gracefully) { if (!gracefully) { promote_backend(node_id); /* send promote request */ return 0; } /* * Wait until all frontends exit */ *InRecovery = RECOVERY_PROMOTE; /* This wiil ensure that new incoming * connection requests are blocked */ if (wait_connection_closed()) { /* wait timed out */ finish_recovery(); return -1; } /* * Now all frontends have gone. Let's do failover. */ promote_backend(node_id); /* send promote request */ /* * Wait for failover completed. */ pcp_wakeup_request = 0; while (!pcp_wakeup_request) { struct timeval t = {1, 0}; select(0, NULL, NULL, NULL, &t); } pcp_wakeup_request = 0; /* * Start to accept incoming connections and send SIGUSR2 to pgpool * parent to distribute SIGUSR2 all pgpool children. */ finish_recovery(); return 0; } static void inform_process_count(PCP_CONNECTION *frontend) { int wsize; int process_count; char process_count_str[16]; int *process_list = NULL; char code[] = "CommandComplete"; char *mesg = NULL; int i; int total_port_len = 0; process_list = pool_get_process_list(&process_count); mesg = (char *)palloc(6*process_count); /* port# is at most 5 characters long (MAX:65535) */ snprintf(process_count_str, sizeof(process_count_str), "%d", process_count); for (i = 0; i < process_count; i++) { char port[6]; snprintf(port, sizeof(port), "%d", process_list[i]); snprintf(mesg+total_port_len, strlen(port)+1, "%s", port); total_port_len += strlen(port)+1; } pcp_write(frontend, "n", 1); wsize = htonl(sizeof(code) + strlen(process_count_str)+1 + total_port_len + sizeof(int)); pcp_write(frontend, &wsize, sizeof(int)); pcp_write(frontend, code, sizeof(code)); pcp_write(frontend, process_count_str, strlen(process_count_str)+1); pcp_write(frontend, mesg, total_port_len); do_pcp_flush(frontend); pfree(process_list); pfree(mesg); ereport(DEBUG1, (errmsg("PCP: informing process count"), errdetail("%d process(es) found", process_count))); } static void inform_process_info(PCP_CONNECTION *frontend,char *buf) { int proc_id; int wsize; int num_proc = pool_config->num_init_children; int i; proc_id = atoi(buf); if ((proc_id != 0) && (pool_get_process_info(proc_id) == NULL)) { char code[] = "InvalidProcessID"; pcp_write(frontend, "e", 1); wsize = htonl(sizeof(code) + sizeof(int)); pcp_write(frontend, &wsize, sizeof(int)); pcp_write(frontend, code, sizeof(code)); do_pcp_flush(frontend); ereport(DEBUG1, (errmsg("PCP: informing process info"), errdetail("invalid process ID"))); } else { /* First, send array size of connection_info */ char arr_code[] = "ArraySize"; char con_info_size[16]; /* Finally, indicate that all data is sent */ char fin_code[] = "CommandComplete"; POOL_REPORT_POOLS *pools = get_pools(&num_proc); if (proc_id == 0) { snprintf(con_info_size, sizeof(con_info_size), "%d", num_proc); } else { snprintf(con_info_size, sizeof(con_info_size), "%d", pool_config->max_pool * NUM_BACKENDS); } pcp_write(frontend, "p", 1); wsize = htonl(sizeof(arr_code) + strlen(con_info_size)+1 + sizeof(int)); pcp_write(frontend, &wsize, sizeof(int)); pcp_write(frontend, arr_code, sizeof(arr_code)); pcp_write(frontend, con_info_size, strlen(con_info_size)+1); do_pcp_flush(frontend); /* Second, send process information for all connection_info */ for (i=0; isystem_db_status = SYSDB_STATUS; snprintf(port, sizeof(port), "%d", si->port); snprintf(status, sizeof(status), "%d", si->system_db_status); snprintf(dist_def_num, sizeof(dist_def_num), "%d", si->dist_def_num); pcp_write(frontend, "s", 1); wsize = htonl(sizeof(code) + strlen(si->hostname)+1 + strlen(port)+1 + strlen(si->user)+1 + strlen(si->password)+1 + strlen(si->schema_name)+1 + strlen(si->database_name)+1 + strlen(dist_def_num)+1 + strlen(status)+1 + sizeof(int)); pcp_write(frontend, &wsize, sizeof(int)); pcp_write(frontend, code, sizeof(code)); pcp_write(frontend, si->hostname, strlen(si->hostname)+1); pcp_write(frontend, port, strlen(port)+1); pcp_write(frontend, si->user, strlen(si->user)+1); pcp_write(frontend, si->password, strlen(si->password)+1); pcp_write(frontend, si->schema_name, strlen(si->schema_name)+1); pcp_write(frontend, si->database_name, strlen(si->database_name)+1); pcp_write(frontend, dist_def_num, strlen(dist_def_num)+1); pcp_write(frontend, status, strlen(status)+1); do_pcp_flush(frontend); /* second, send DistDefInfo if any */ if (si->dist_def_num > 0) { char dist_code[] = "DistDefInfo"; char col_num[16]; int col_list_total_len; int type_list_total_len; char *col_list = NULL; char *type_list = NULL; int col_list_offset; int type_list_offset; DistDefInfo *ddi; int i, j; for (i = 0; i < si->dist_def_num; i++) { ddi = &si->dist_def_slot[i]; snprintf(col_num, sizeof(col_num), "%d", ddi->col_num); col_list_total_len = type_list_total_len = 0; for (j = 0; j < ddi->col_num; j++) { col_list_total_len += strlen(ddi->col_list[j]) + 1; type_list_total_len += strlen(ddi->type_list[j]) + 1; } col_list = (char *)palloc(col_list_total_len); type_list = (char *)palloc(type_list_total_len); col_list_offset = type_list_offset = 0; for (j = 0; j < ddi->col_num; j++) { snprintf(col_list + col_list_offset, strlen(ddi->col_list[j])+1, "%s", ddi->col_list[j]); snprintf(type_list + type_list_offset, strlen(ddi->type_list[j])+1, "%s", ddi->type_list[j]); col_list_offset += strlen(ddi->col_list[j]) + 1; type_list_offset += strlen(ddi->type_list[j]) + 1; } pcp_write(frontend, "s", 1); wsize = htonl(sizeof(dist_code) + strlen(ddi->dbname)+1 + strlen(ddi->schema_name)+1 + strlen(ddi->table_name)+1 + strlen(ddi->dist_key_col_name)+1 + strlen(col_num)+1 + col_list_total_len + type_list_total_len + strlen(ddi->dist_def_func)+1 + sizeof(int)); pcp_write(frontend, &wsize, sizeof(int)); pcp_write(frontend, dist_code, sizeof(dist_code)); pcp_write(frontend, ddi->dbname, strlen(ddi->dbname)+1); pcp_write(frontend, ddi->schema_name, strlen(ddi->schema_name)+1); pcp_write(frontend, ddi->table_name, strlen(ddi->table_name)+1); pcp_write(frontend, ddi->dist_key_col_name, strlen(ddi->dist_key_col_name)+1); pcp_write(frontend, col_num, strlen(col_num)+1); pcp_write(frontend, col_list, col_list_total_len); pcp_write(frontend, type_list, type_list_total_len); pcp_write(frontend, ddi->dist_def_func, strlen(ddi->dist_def_func)+1); do_pcp_flush(frontend); pfree(col_list); pfree(type_list); } } pcp_write(frontend, "s", 1); wsize = htonl(sizeof(fin_code) + sizeof(int)); pcp_write(frontend, &wsize, sizeof(int)); pcp_write(frontend, fin_code, sizeof(fin_code)); do_pcp_flush(frontend); ereport(DEBUG1, (errmsg("PCP: informing systemDB info"), errdetail("retrieved SystemDB information from shared memory"))); } } static void inform_watchdog_info(PCP_CONNECTION *frontend,char *buf) { int wd_index; int wsize; WdInfo *wi = NULL; if (!pool_config->use_watchdog) { char code[] = "watchdog not enabled"; pcp_write(frontend, "e", 1); wsize = htonl(sizeof(code) + sizeof(int)); pcp_write(frontend, &wsize, sizeof(int)); pcp_write(frontend, code, sizeof(code)); do_pcp_flush(frontend); ereport(DEBUG1, (errmsg("PCP: informing watchdog info"), errdetail("watcdhog not enabled"))); return; } wd_index = atoi(buf); wi = wd_get_watchdog_info(wd_index); if (wi == NULL) { char code[] = "Invalid watchdog index"; pcp_write(frontend, "e", 1); wsize = htonl(sizeof(code) + sizeof(int)); pcp_write(frontend, &wsize, sizeof(int)); pcp_write(frontend, code, sizeof(code)); do_pcp_flush(frontend); ereport(DEBUG1, (errmsg("PCP: informing watchdog info"), errdetail("invalid watchdog index"))); } else { char code[] = "CommandComplete"; char pgpool_port_str[6]; char wd_port_str[6]; char status[2]; snprintf(pgpool_port_str, sizeof(pgpool_port_str), "%d", wi->pgpool_port); snprintf(wd_port_str, sizeof(wd_port_str), "%d", wi->wd_port); snprintf(status, sizeof(status), "%d", wi->status); pcp_write(frontend, "w", 1); wsize = htonl(sizeof(code) + strlen(wi->hostname)+1 + strlen(pgpool_port_str)+1 + strlen(wd_port_str)+1 + strlen(status)+1 + sizeof(int)); pcp_write(frontend, &wsize, sizeof(int)); pcp_write(frontend, code, sizeof(code)); pcp_write(frontend, wi->hostname, strlen(wi->hostname)+1); pcp_write(frontend, pgpool_port_str, strlen(pgpool_port_str)+1); pcp_write(frontend, wd_port_str, strlen(wd_port_str)+1); pcp_write(frontend, status, strlen(status)+1); do_pcp_flush(frontend); ereport(DEBUG1, (errmsg("PCP: informing watchdog info"), errdetail("retrieved node information from shared memory"))); } } static void inform_node_info(PCP_CONNECTION *frontend,char *buf) { int node_id; int wsize; BackendInfo *bi = NULL; node_id = atoi(buf); bi = pool_get_node_info(node_id); if (bi == NULL) { char code[] = "Invalid Node ID"; pcp_write(frontend, "e", 1); wsize = htonl(sizeof(code) + sizeof(int)); pcp_write(frontend, &wsize, sizeof(int)); pcp_write(frontend, code, sizeof(code)); do_pcp_flush(frontend); ereport(DEBUG1, (errmsg("PCP: informing node info"), errdetail("invalid node ID"))); } else { char code[] = "CommandComplete"; char port_str[6]; char status[2]; char weight_str[20]; snprintf(port_str, sizeof(port_str), "%d", bi->backend_port); snprintf(status, sizeof(status), "%d", bi->backend_status); snprintf(weight_str, sizeof(weight_str), "%f", bi->backend_weight); pcp_write(frontend, "i", 1); wsize = htonl(sizeof(code) + strlen(bi->backend_hostname)+1 + strlen(port_str)+1 + strlen(status)+1 + strlen(weight_str)+1 + sizeof(int)); pcp_write(frontend, &wsize, sizeof(int)); pcp_write(frontend, code, sizeof(code)); pcp_write(frontend, bi->backend_hostname, strlen(bi->backend_hostname)+1); pcp_write(frontend, port_str, strlen(port_str)+1); pcp_write(frontend, status, strlen(status)+1); pcp_write(frontend, weight_str, strlen(weight_str)+1); do_pcp_flush(frontend); ereport(DEBUG1, (errmsg("PCP: informing node info"), errdetail("retrieved node information from shared memory"))); } } static void inform_node_count(PCP_CONNECTION *frontend) { int wsize; int node_count = pool_get_node_count(); char code[] = "CommandComplete"; char mesg[16]; snprintf(mesg, sizeof(mesg), "%d", node_count); pcp_write(frontend, "l", 1); wsize = htonl(sizeof(code) + strlen(mesg)+1 + sizeof(int)); pcp_write(frontend, &wsize, sizeof(int)); pcp_write(frontend, code, sizeof(code)); pcp_write(frontend, mesg, strlen(mesg)+1); do_pcp_flush(frontend); ereport(DEBUG1, (errmsg("PCP: informing node count"), errdetail("%d node(s) found", node_count))); } static void process_detach_node(PCP_CONNECTION *frontend,char *buf, char tos) { int node_id; int wsize; char *code; bool gracefully; if (tos == 'D') gracefully = false; else gracefully = true; node_id = atoi(buf); ereport(DEBUG1, (errmsg("PCP: processing detach node"), errdetail("detaching Node ID %d", node_id))); if (pool_detach_node(node_id, gracefully) == 0) code = "CommandComplete"; else code = "CommandFailed"; pcp_write(frontend, "d", 1); wsize = htonl(strlen(code) + 1 + sizeof(int)); pcp_write(frontend, &wsize, sizeof(int)); pcp_write(frontend, code, strlen(code) + 1); do_pcp_flush(frontend); } static void process_attach_node(PCP_CONNECTION *frontend,char *buf) { int node_id; int wsize; char code[] = "CommandComplete"; node_id = atoi(buf); ereport(DEBUG1, (errmsg("PCP: processing attach node"), errdetail("attaching Node ID %d", node_id))); send_failback_request(node_id); pcp_write(frontend, "c", 1); wsize = htonl(sizeof(code) + sizeof(int)); pcp_write(frontend, &wsize, sizeof(int)); pcp_write(frontend, code, sizeof(code)); do_pcp_flush(frontend); } static void process_recovery_request(PCP_CONNECTION *frontend,char *buf) { int node_id; int wsize; char code[] = "CommandComplete"; node_id = atoi(buf); if ( (node_id < 0) || (node_id >= pool_config->backend_desc->num_backends) ) { char code[] = "NodeIdOutOfRange"; pcp_write(frontend, "e", 1); wsize = htonl(sizeof(code) + sizeof(int)); pcp_write(frontend, &wsize, sizeof(int)); pcp_write(frontend, code, sizeof(code)); do_pcp_flush(frontend); ereport(FATAL, (errmsg("could not process recovery request"), errdetail("node id %d is not valid", node_id))); } if ((!REPLICATION && !(MASTER_SLAVE && !strcmp(pool_config->master_slave_sub_mode, MODE_STREAMREP))) || (MASTER_SLAVE && !strcmp(pool_config->master_slave_sub_mode, MODE_STREAMREP) && node_id == PRIMARY_NODE_ID)) { int len; char *msg; if (MASTER_SLAVE && !strcmp(pool_config->master_slave_sub_mode, MODE_STREAMREP)) msg = "primary server cannot be recovered by online recovery."; else msg = "recovery request is accepted only in replication mode or stereaming replication mode. "; len = strlen(msg)+1; pcp_write(frontend, "e", 1); wsize = htonl(sizeof(int) + len); pcp_write(frontend, &wsize, sizeof(int)); pcp_write(frontend, msg, len); } else { ereport(DEBUG1, (errmsg("PCP: processing recovery request"), errdetail("start online recovery"))); PG_TRY(); { start_recovery(node_id); finish_recovery(); pcp_write(frontend, "c", 1); wsize = htonl(sizeof(code) + sizeof(int)); pcp_write(frontend, &wsize, sizeof(int)); pcp_write(frontend, code, sizeof(code)); do_pcp_flush(frontend); } PG_CATCH(); { finish_recovery(); int len = strlen("recovery failed") + 1; pcp_write(frontend, "e", 1); wsize = htonl(sizeof(int) + len); pcp_write(frontend, &wsize, sizeof(int)); pcp_write(frontend, "recovery failed", len); do_pcp_flush(frontend); PG_RE_THROW(); }PG_END_TRY(); } do_pcp_flush(frontend); } static void process_status_request(PCP_CONNECTION *frontend) { int nrows = 0; int i; POOL_REPORT_CONFIG *status = get_config(&nrows); int len = 0; /* First, send array size of connection_info */ char arr_code[] = "ArraySize"; char code[] = "ProcessConfig"; /* Finally, indicate that all data is sent */ char fin_code[] = "CommandComplete"; pcp_write(frontend, "b", 1); len = htonl(sizeof(arr_code) + sizeof(int) + sizeof(int)); pcp_write(frontend, &len, sizeof(int)); pcp_write(frontend, arr_code, sizeof(arr_code)); len = htonl(nrows); pcp_write(frontend, &len, sizeof(int)); do_pcp_flush(frontend); for (i = 0; i < nrows; i++) { pcp_write(frontend, "b", 1); len = htonl(sizeof(int) + sizeof(code) + strlen(status[i].name) + 1 + strlen(status[i].value) + 1 + strlen(status[i].desc) + 1 ); pcp_write(frontend, &len, sizeof(int)); pcp_write(frontend, code, sizeof(code)); pcp_write(frontend, status[i].name, strlen(status[i].name)+1); pcp_write(frontend, status[i].value, strlen(status[i].value)+1); pcp_write(frontend, status[i].desc, strlen(status[i].desc)+1); } pcp_write(frontend, "b", 1); len = htonl(sizeof(fin_code) + sizeof(int)); pcp_write(frontend, &len, sizeof(int)); pcp_write(frontend, fin_code, sizeof(fin_code)); do_pcp_flush(frontend); pfree(status); ereport(DEBUG1, (errmsg("PCP: processing status request"), errdetail("retrieved status information"))); } static void process_promote_node(PCP_CONNECTION *frontend, char *buf, char tos) { int node_id; int wsize; char code[] = "CommandComplete"; bool gracefully; if (tos == 'J') gracefully = false; else gracefully = true; node_id = atoi(buf); if ( (node_id < 0) || (node_id >= pool_config->backend_desc->num_backends) ) { char code[] = "NodeIdOutOfRange"; pcp_write(frontend, "e", 1); wsize = htonl(sizeof(code) + sizeof(int)); pcp_write(frontend, &wsize, sizeof(int)); pcp_write(frontend, code, sizeof(code)); do_pcp_flush(frontend); ereport(FATAL, (errmsg("could not process recovery request"), errdetail("node id %d is not valid", node_id))); } /* promoting node is reserved to Streaming Replication */ if (!MASTER_SLAVE || (strcmp(pool_config->master_slave_sub_mode, MODE_STREAMREP) != 0)) { char code[] = "NotInStreamingReplication"; pcp_write(frontend, "e", 1); wsize = htonl(sizeof(code) + sizeof(int)); pcp_write(frontend, &wsize, sizeof(int)); pcp_write(frontend, code, sizeof(code)); do_pcp_flush(frontend); ereport(FATAL, (errmsg("invalid pgpool mode for the command"), errdetail("not in streaming replication mode, can't promote node id %d", node_id))); } if (node_id == PRIMARY_NODE_ID) { char code[] = "NodeIdAlreadyPrimary"; pcp_write(frontend, "e", 1); wsize = htonl(sizeof(code) + sizeof(int)); pcp_write(frontend, &wsize, sizeof(int)); pcp_write(frontend, code, sizeof(code)); do_pcp_flush(frontend); ereport(FATAL, (errmsg("invalid pgpool mode for the command"), errdetail("specified node is already primary node, can't promote node id %d", node_id))); } ereport(DEBUG1, (errmsg("PCP: processing promote node"), errdetail("promoting Node ID %d", node_id))); pool_promote_node(node_id, gracefully); pcp_write(frontend, "d", 1); wsize = htonl(sizeof(code) + sizeof(int)); pcp_write(frontend, &wsize, sizeof(int)); pcp_write(frontend, code, sizeof(code)); do_pcp_flush(frontend); } static void process_authentication(PCP_CONNECTION *frontend, char *buf, char *pcp_conf_file, char* salt, int *random_salt,volatile int *authenticated) { int wsize; if (*random_salt) { *authenticated = user_authenticate(buf, pcp_conf_file, salt, 4); } if (!*random_salt || !*authenticated) { char code[] = "AuthenticationFailed"; char mesg[] = "username and/or password do not match"; pcp_write(frontend, "r", 1); wsize = htonl(sizeof(code) + sizeof(mesg) + sizeof(int)); pcp_write(frontend, &wsize, sizeof(int)); pcp_write(frontend, code, sizeof(code)); pcp_write(frontend, mesg, sizeof(mesg)); do_pcp_flush(frontend); *random_salt = 0; ereport(ERROR, (errmsg("authentication failed"), errdetail("username and/or password do not match"))); } else { char code[] = "AuthenticationOK"; pcp_write(frontend, "r", 1); wsize = htonl(sizeof(code) + sizeof(int)); pcp_write(frontend, &wsize, sizeof(int)); pcp_write(frontend, code, sizeof(code)); do_pcp_flush(frontend); *random_salt = 0; ereport(DEBUG1, (errmsg("PCP: processing authentication request"), errdetail("authentication OK"))); } } static void send_md5salt(PCP_CONNECTION *frontend, char* salt) { int wsize; pool_random_salt(salt); // random_salt = 1; pcp_write(frontend, "m", 1); wsize = htonl(sizeof(int) + 4); pcp_write(frontend, &wsize, sizeof(int)); pcp_write(frontend, salt, 4); do_pcp_flush(frontend); ereport(DEBUG1, (errmsg("PCP: sent md5 salt to client"))); } static void process_shutown_request(char mode) { pid_t ppid = getppid(); if (mode == 's') { ereport(DEBUG1, (errmsg("PCP: processing shutdown request"), errdetail("sending SIGTERM to the parent process with PID:%d", ppid))); pool_signal_parent(SIGTERM); } else if (mode == 'f') { ereport(DEBUG1, (errmsg("PCP: processing shutdown request"), errdetail("sending SIGINT to the parent process with PID:%d", ppid))); pool_signal_parent(SIGINT); } else if (mode == 'i') { ereport(DEBUG1, (errmsg("PCP: processing shutdown request"), errdetail("sending SIGQUIT to the parent process with PID:%d", ppid))); pool_signal_parent(SIGQUIT); } else { ereport(DEBUG1, (errmsg("PCP: error while processing shutdown request"), errdetail("invalid shutdown mode \"%c\"", mode))); } } /* * Wrapper around pcp_flush which throws FATAL error when pcp_flush fails */ static void do_pcp_flush(PCP_CONNECTION *frontend) { if (pcp_flush(frontend) < 0) ereport(FATAL, (errmsg("failed to flush data to client"), errdetail("pcp_flush failed with error : \"%s\"",strerror(errno)))); } pgpool-II-3.4.3/src/parallel_query/0002775000076400007640000000000012554350617014155 500000000000000pgpool-II-3.4.3/src/parallel_query/pool_rewrite_outfuncs.c0000664000076400007640000101062612554350605020702 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Portions Copyright (c) 2003-2013 PgPool Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation, and that the name of the * author not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. The author makes no representations about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * * This file was created based on outfuncs.c of PostgreSQL. I retain * original header comment of the file below. */ /*------------------------------------------------------------------------- * * outfuncs.c * Output functions for Postgres tree nodes. * * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION * $PostgreSQL: pgsql/src/dblink/nodes/outfuncs.c,v 1.261.2.1 2005/11/14 23:54:34 tgl Exp $ * * NOTES * Every node type that can appear in stored rules' parsetrees *must* * have an output function defined here (as well as an input function * in readfuncs.c). For use in debugging, we also provide output * functions for nodes that appear in raw parsetrees, path, and plan trees. * These nodes however need not have input functions. * *------------------------------------------------------------------------- */ #include #include #include "pool.h" #include "utils/palloc.h" #include "utils/elog.h" #include "parser/parser.h" #include "parser/pool_string.h" #include "parser/pg_list.h" #include "parser/pg_trigger.h" #include "parser/parsenodes.h" #include "parallel_query/pool_rewrite_query.h" #define booltostr(x) ((x) ? "true" : "false") extern void _outNode(String *str, void *obj); static void _rewriteNode(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, void *obj); static void _rewriteList(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, List *node); static void _rewriteIdList(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, List *node); static void _rewriteAlias(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, Alias *node); static void _rewriteRangeVar(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, RangeVar *node); static void _rewriteVar(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, Var *node); static void _rewriteConst(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, Const *node); static void _rewriteParam(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, Param *node); static void _rewriteAggref(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, Aggref *node); static void _rewriteArrayRef(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, ArrayRef *node); static void _rewriteFuncExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, FuncExpr *node); static void _rewriteNameArgExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, NamedArgExpr *node); static void _rewriteOpExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, OpExpr *node); static void _rewriteDistinctExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, DistinctExpr *node); static void _rewriteScalarArrayOpExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, ScalarArrayOpExpr *node); static void _rewriteBoolExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, BoolExpr *node); static void _rewriteSubLink(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, SubLink *node); static void _rewriteSubPlan(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, SubPlan *node); static void _rewriteFieldSelect(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, FieldSelect *node); static void _rewriteFieldStore(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, FieldStore *node); static void _rewriteRelabelType(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, RelabelType *node); static void _rewriteConvertRowtypeExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, ConvertRowtypeExpr *node); static void _rewriteCaseExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CaseExpr *node); static void _rewriteCaseWhen(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CaseWhen *node); static void _rewriteCaseTestExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CaseTestExpr *node); static void _rewriteArrayExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, ArrayExpr *node); static void _rewriteRowExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, RowExpr *node); static void _rewriteCoalesceExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CoalesceExpr *node); static void _rewriteMinMaxExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, MinMaxExpr *node); static void _rewriteNullIfExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, NullIfExpr *node); static void _rewriteNullTest(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, NullTest *node); static void _rewriteBooleanTest(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, BooleanTest *node); static void _rewriteCoerceToDomain(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CoerceToDomain *node); static void _rewriteCoerceToDomainValue(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CoerceToDomainValue *node); static void _rewriteSetToDefault(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, SetToDefault *node); static void _rewriteTargetEntry(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, TargetEntry *node); static void _rewriteRangeTblRef(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, RangeTblRef *node); static void _rewriteJoinExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, JoinExpr *node); static void _rewriteFromExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, FromExpr *node); static void _rewriteCreateStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CreateStmt *node); static void _rewriteIndexStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, IndexStmt *node); static void _rewriteNotifyStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, NotifyStmt *node); static void _rewriteDeclareCursorStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, DeclareCursorStmt *node); static void _rewriteSelectStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, SelectStmt *node); static void _rewriteFuncCall(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, FuncCall *node); static void _rewriteDefElem(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, DefElem *node); static void _rewriteLockingClause(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, LockingClause *node); static void _rewriteColumnDef(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, ColumnDef *node); static void _rewriteTypeName(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, TypeName *node); static void _rewriteTypeCast(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, TypeCast *node); static void _rewriteIndexElem(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, IndexElem *node); static void _rewriteSortGroupClause(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, SortGroupClause *node); static void _rewriteWindowClause(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, WindowClause *node); static void _rewriteSetOperationStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, SetOperationStmt *node); static void _rewriteAExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, A_Expr *node); static void _rewriteValue(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, Value *value); static void _rewriteColumnRef(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, ColumnRef *node); static void _rewriteParamRef(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, ParamRef *node); static void _rewriteAConst(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, A_Const *node); static void _rewriteA_Indices(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, A_Indices *node); static void _rewriteA_Indirection(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, A_Indirection *node); static void _rewriteA_ArrayExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, A_ArrayExpr *node); static void _rewriteResTarget(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, ResTarget *node); static void _rewriteConstraint(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, Constraint *node); static void _rewriteSortBy(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, SortBy *node); static void _rewriteInsertStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, InsertStmt *node); static void _rewriteUpdateStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, UpdateStmt *node); static void _rewriteDeleteStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, DeleteStmt *node); static void _rewriteTransactionStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, TransactionStmt *node); static void _rewriteTruncateStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, TruncateStmt *node); static void _rewriteVacuumStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, VacuumStmt *node); static void _rewriteExplainStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, ExplainStmt *node); static void _rewriteClusterStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, ClusterStmt *node); static void _rewriteCheckPointStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CheckPointStmt *node); static void _rewriteClosePortalStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, ClosePortalStmt *node); static void _rewriteListenStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, ListenStmt *node); static void _rewriteUnlistenStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, UnlistenStmt *node); static void _rewriteLoadStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, LoadStmt *node); static void _rewriteCopyStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CopyStmt *node); static void _rewriteDeallocateStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, DeallocateStmt *node); static void _rewriteRenameStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, RenameStmt *node); static void _rewriteCreateRoleStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CreateRoleStmt *node); static void _rewriteAlterRoleStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, AlterRoleStmt *node); static void _rewriteDropRoleStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, DropRoleStmt *node); static void _rewriteCreateSchemaStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CreateSchemaStmt *node); static void _rewriteVariableSetStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, VariableSetStmt *node); static void _rewriteVariableShowStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, VariableShowStmt *node); static void _rewriteConstraintsSetStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, ConstraintsSetStmt *node); static void _rewriteAlterTableStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, AlterTableStmt *node); static void _rewriteCreateSeqStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CreateSeqStmt *node); static void _rewriteAlterSeqStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, AlterSeqStmt *node); static void _rewriteCreatePLangStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CreatePLangStmt *node); static void _rewriteCreateTableSpaceStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CreateTableSpaceStmt *node); static void _rewriteDropTableSpaceStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, DropTableSpaceStmt *node); static void _rewriteCreateTrigStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CreateTrigStmt *node); static void _rewriteDefineStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, DefineStmt *node); static void _rewriteCreateOpClassStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CreateOpClassStmt *node); static void _rewriteDropStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, DropStmt *node); static void _rewriteFetchStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, FetchStmt *node); static void _rewriteGrantStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, GrantStmt *node); static void _rewriteGrantRoleStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, GrantRoleStmt *node); static void _rewriteCreateFunctionStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CreateFunctionStmt *node); static void _rewriteAlterFunctionStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, AlterFunctionStmt *node); static void _rewriteCreateCastStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CreateCastStmt *node); static void _rewriteReindexStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, ReindexStmt *node); static void _rewriteRuleStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, RuleStmt *node); static void _rewriteViewStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, ViewStmt *node); static void _rewriteCreatedbStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CreatedbStmt *node); static void _rewriteAlterDatabaseStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, AlterDatabaseStmt *node); static void _rewriteAlterDatabaseSetStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, AlterDatabaseSetStmt *node); static void _rewriteDropdbStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, DropdbStmt *node); static void _rewriteCreateDomainStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CreateDomainStmt *node); static void _rewriteAlterDomainStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, AlterDomainStmt *node); static void _rewriteCreateConversionStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CreateConversionStmt *node); static void _rewritePrepareStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, PrepareStmt *node); static void _rewriteExecuteStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, ExecuteStmt *node); static void _rewriteLockStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, LockStmt *node); static void _rewriteCommentStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CommentStmt *node); static void _rewriteFuncName(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, List *func_name); static void _rewriteSetRest(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, VariableSetStmt *node); static void _rewriteSetTransactionModeList(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, List *list); static void _rewriteAlterTableCmd(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, AlterTableCmd *node); static void _rewriteOptSeqList(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, List *options); static void _rewritePrivGrantee(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, PrivGrantee *node); static void _rewriteFuncWithArgs(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, FuncWithArgs *node); static void _rewriteFunctionParameter(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, FunctionParameter *node); static void _rewritePrivilegeList(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, List *list); static void _rewriteFuncOptList(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, List *list); static void _rewriteCreatedbOptList(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, List *options); static void _rewriteOperatorArgTypes(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, List *args); static void _rewriteRangeFunction(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, RangeFunction *node); static void _rewriteWithDefinition(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, List *def_list); /* analyze */ static void KeepRewriteQueryCode(RewriteQuery *message, int current_select); static void KeepMessages(RewriteQuery *message,int current_select,int part); static int CheckWhereCaluse(Node *BaseSelect,RewriteQuery *message,ConInfoTodblink *dblink,String *str,int true_count); static int _writewhereClause(A_Expr *expr,RewriteQuery *message,ConInfoTodblink *dblink, String *str,int true_count); static char *escape_string(char *str); static void delay_string_append_char(RewriteQuery *message,String *str, char *parts); static void build_range_info(RewriteQuery *message,DistDefInfo *info,RepliDefInfo *info2,SelectDefInfo *info3,char *alias,int select_num,int i_num); static void AnalyzeReturnRecord(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, List *list); static void build_virtual_table(RewriteQuery *message,void *obj, int next); static char *search_type_from_virtual(VirtualTable *virtual,char *table,char *col); static int _checkVirtualColumn(ColumnRef *col,RewriteQuery *message); static void SeekColumnName(Aggexpr *agg,ColumnRef *node,int state); /* rewirte */ static void writeSelectHeader(RewriteQuery *message,ConInfoTodblink *dblink, String *str,int parallel,int state); static void writeSelectFooter(RewriteQuery *message,String *str,AnalyzeSelect *analyze,int state); static void KeepRewriteQueryReturnCode(RewriteQuery *message, int r_code); static void writeRangeHeader(RewriteQuery *message,ConInfoTodblink *dblink, String *str,DistDefInfo *info, RepliDefInfo *info2,char *alias); static void writeRangeFooter(RewriteQuery *message,ConInfoTodblink *dblink, String *str,DistDefInfo *info, RepliDefInfo *info2,char *alias); static bool CheckAggOpt(RewriteQuery *message); static char *GetNameFromColumnRef(ColumnRef *node,bool state); static void AvgFuncCall(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, FuncCall *node); static void _rewriteFuncNameList(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, List *list); /* under define is used in _rewritejoinExpr */ #define JDEFAULT 0 #define JNORMAL 1 #define JNATURAL_INNER 2 #define JNATURAL_LEFT 3 #define JNATURAL_RIGHT 4 #define JNATURAL_FULL 5 #define JINNER 6 #define JLEFT 7 #define JRIGHT 8 #define JFULL 9 #define JUSING 10 #define LOADBALANCE false #define PARALLEL true #define SELECT_START -1 #define SELECT_FROMCLAUSE 0 #define SELECT_TARGETLIST 1 #define SELECT_WHERECLAUSE 2 #define SELECT_GROUPBYCLAUSE 3 #define SELECT_HAVINGCLAUSE 4 #define SELECT_SORTCLAUSE 5 #define SELECT_OFFSETCLAUSE 6 #define SELECT_LIMITCLAUSE 7 #define SELECT_OTHER 8 static char *escape_string(char *str) { int len = strlen(str), i, j; char *es = palloc0(len * 2 + 1); if (es == NULL) { return NULL; } for (i = 0, j = 0; i < len; i++, j++) { if (str[i] == '\'') { es[j++] = '\''; } else if (str[i] == '\\') { es[j++] = '\\'; } es[j] = str[i]; } return es; } static void delay_string_append_char(RewriteQuery *message,String *str, char *parts) { if(message->r_code == SELECT_DEFAULT && message->ignore_rewrite == -1) { if(parts) { string_append_char( str, parts); ereport(DEBUG4, (errmsg("debug Rewrite Query %s", str->data))); } else message->r_code = SELECT_RELATION_ERROR; } } /* * Is this column member of table (message->table_relname) ? * return 1 -- member * return 0 or -1 -- not mmeber */ static int _checkVirtualColumn(ColumnRef *col,RewriteQuery *message) { ListCell *c; List *list; VirtualTable *virtual = NULL; AnalyzeSelect *analyze = NULL; char first = 0; char *tmp_table = NULL; char *colname = NULL; char *table = NULL; int check_col = 0; int no = message->current_select; int v_colnum; int i; list = col->fields; analyze = message->analyze[no]; if(list->length > 2 || list->length == 0) { /* send error message */ return -1; } foreach (c, col->fields) { Node *n = (Node *) lfirst(c); if (IsA(n, String)) { Value *v = (Value *) lfirst(c); if(list->length == 2 && first == 0) { first = 1; tmp_table = v->val.str; } else colname = v->val.str; } } if(!colname) return check_col; if(analyze->partstate[SELECT_FROMCLAUSE] == 'S') { if (message->table_relname) { if(tmp_table && strcmp(message->table_relname,tmp_table) != 0) { return check_col; } table = message->table_relname; } else { return check_col; } virtual = analyze->virtual; v_colnum = virtual->col_num; for(i = 0; i < v_colnum; i++) { if(!strcmp(virtual->table_list[i],table) && !strcmp(virtual->col_list[i],colname)) { check_col = 1; break; } } } else { virtual = analyze->virtual; v_colnum = virtual->col_num; for(i = 0; i < v_colnum; i++) { if(tmp_table) { if(!strcmp(virtual->table_list[i],tmp_table) && !strcmp(virtual->col_list[i],colname)) { check_col = 1; break; } } else { if(!strcmp(virtual->col_list[i],colname)) { check_col = 1; break; } } } } return check_col; } static void KeepMessages(RewriteQuery *message,int current_select,int part) { message->current_select = current_select; message->part = part; } static void KeepRewriteQueryCode(RewriteQuery *message, int current_select) { message->current_select = current_select; } static void KeepRewriteQueryReturnCode(RewriteQuery *message, int r_code) { if((message->r_code != SELECT_RELATION_ERROR) && (message->r_code != SELECT_PGCATALOG)) message->r_code = r_code; } /* * A_Expr check * if A_Expr-tree use subquery,function,or other table member * rewrite expression as "TRUE" * * return value is counter of rewriting query. */ static int _writewhereClause(A_Expr *expr,RewriteQuery *message,ConInfoTodblink *dblink, String *str,int true_count) { int message_r_code = message->r_code; switch (expr->kind) { case AEXPR_OP: if (list_length(expr->name) == 1) { KeepRewriteQueryReturnCode(message, SELECT_AEXPR); _rewriteNode(NULL, message, dblink, str, expr->lexpr); if(message->r_code == SELECT_AEXPR) { _rewriteNode(NULL, message, dblink, str, expr->rexpr); if(message->r_code == SELECT_AEXPR) { Value *op = (Value *) lfirst(list_head(expr->name)); KeepRewriteQueryReturnCode(message, message_r_code); _rewriteNode(NULL, message, dblink, str, expr->lexpr); delay_string_append_char(message, str, op->val.str); _rewriteNode(NULL, message, dblink, str, expr->rexpr); KeepRewriteQueryReturnCode(message, message_r_code); } else { KeepRewriteQueryReturnCode(message, message_r_code); delay_string_append_char(message, str,"TRUE"); true_count++; break; } } else { KeepRewriteQueryReturnCode(message, message_r_code); delay_string_append_char(message, str,"TRUE"); true_count++; } break; } else { delay_string_append_char(message, str,"TRUE"); true_count++; } break; case AEXPR_AND: delay_string_append_char(message, str, " ("); true_count = true_count + CheckWhereCaluse(expr->lexpr,message,dblink,str,true_count); delay_string_append_char(message, str, " AND "); true_count = true_count + CheckWhereCaluse(expr->rexpr,message,dblink,str,true_count); delay_string_append_char(message, str, ")"); break; case AEXPR_OR: delay_string_append_char(message, str, " ("); true_count = true_count + CheckWhereCaluse(expr->lexpr,message,dblink,str,true_count); delay_string_append_char(message, str, " OR "); true_count = true_count + CheckWhereCaluse(expr->rexpr,message,dblink,str,true_count); delay_string_append_char(message, str, ")"); break; case AEXPR_OP_ANY: /* not implemented yet */ break; case AEXPR_OP_ALL: /* not implemented yet */ break; #if 0 case AEXPR_NOT: delay_string_append_char(message, str, " (NOT "); CheckWhereCaluse(expr->rexpr,str,tablename,dbname, schemaname,aliasname); delay_string_append_char(message, str, ")"); break; case AEXPR_DISTINCT: delay_string_append_char(message, str, " ("); _rewriteNode(BaseSelect, message, dblink, str, node->lexpr); delay_string_append_char(message, str, " IS DISTINCT FROM "); _rewriteNode(BaseSelect, message, dblink, str, node->rexpr); delay_string_append_char(message, str, ")"); break; case AEXPR_NULLIF: delay_string_append_char(message, str, " NULLIF("); _rewriteNode(BaseSelect, message, dblink, str, node->lexpr); delay_string_append_char(message, str, ", "); _rewriteNode(BaseSelect, message, dblink, str, node->rexpr); delay_string_append_char(message, str, ")"); break; case AEXPR_OF: _rewriteNode(BaseSelect, message, dblink, str, node->lexpr); if (*(char *)lfirst(list_head(node->name)) == '!') delay_string_append_char(message, str, " IS NOT OF ("); else delay_string_append_char(message, str, " IS OF ("); _rewriteNode(BaseSelect, message, dblink, str, node->rexpr); delay_string_append_char(message, str, ")"); break; #endif default: delay_string_append_char(message, str,"TRUE"); true_count++; break; } return true_count; } /* * Start whereClasue check * call _writewherelause(); * * if messgae->r_code is SELECT DEFAULT, * write down whereClause * else * check whereClause * * return value is counter of rewriting query * if return value is zero, all whereclause can insert dblink function. */ static int CheckWhereCaluse(Node *BaseSelect,RewriteQuery *message,ConInfoTodblink *dblink,String *str,int true_count) { A_Expr *expr = NULL; if(!IsA(BaseSelect, A_Expr)) { delay_string_append_char(message, str, "TRUE"); true_count++; return true_count; } expr = (A_Expr *) BaseSelect; if(expr->kind == AEXPR_NOT) { delay_string_append_char(message, str, "TRUE"); true_count++; return true_count; } true_count = _writewhereClause(expr,message,dblink,str,true_count); return true_count; } static void _rewriteIdList(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, List *node) { ListCell *lc; char first = 0; foreach(lc, node) { Value *v = lfirst(lc); if (first == 0) first = 1; else delay_string_append_char(message, str, ", "); delay_string_append_char(message, str, "\""); delay_string_append_char(message, str, v->val.str); delay_string_append_char(message, str, "\""); } } static void _rewriteList(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, List *node) { ListCell *lc; char first = 0; char state = (char)0; int loop = 0; bool from; int current_select = message->current_select; bool lock = false; AnalyzeSelect *analyze; analyze = message->analyze[current_select]; if(message->r_code == SELECT_DEFAULT && message->ignore_rewrite == -1 && analyze->part == SELECT_TARGETLIST) { if(analyze->retlock == false) { lock = true; analyze->retlock = true; } } foreach(lc, node) { if (first == 0) { first = 1; } else { if(lfirst(lc) && !IsA(lfirst(lc),A_Indices)) delay_string_append_char(message, str, ","); } /* init JoinTable */ if(message->r_code == SELECT_ANALYZE && message->fromClause) { if(lfirst(lc) && IsA(lfirst(lc),JoinExpr)) { if(!analyze->join) { analyze->join = (JoinTable *) palloc(sizeof(JoinTable)); } analyze->join->col_num = 0; analyze->join->col_list = NULL; analyze->join->type_list = NULL; analyze->join->table_list = NULL; analyze->join->using_list = NULL; analyze->join->using_length = 0; analyze->join->state = (char)0; } } from = message->fromClause; _rewriteNode(BaseSelect, message, dblink, str, lfirst(lc)); message->current_select = current_select; message->fromClause = from; if(message->r_code == SELECT_ANALYZE && message->fromClause) { /* if(lfirst(lc)) { if(IsA(lfirst(lc),JoinExpr)) { JoinExpr *join = lfirst(lc); if (join->quals) { _rewriteNode(BaseSelect, message, dblink, str, join->quals); } } } */ if(loop == 0) { state = message->table_state; } else { if(state =='L' && message->table_state == 'L') { message->table_state = 'L'; } else if (state == 'L' && message->table_state == 'P') { message->table_state = 'P'; } else if (state == 'P' && message->table_state == 'L') { message->table_state = 'P'; } else { state = 'S'; message->table_state = 'S'; } } } loop++; if(message->r_code == SELECT_DEFAULT && message->ignore_rewrite == -1 && analyze->part == SELECT_TARGETLIST) { ereport(DEBUG2, (errmsg("rewriteList select=%d,count=%d", current_select,message->analyze[current_select]->ret_count))); if(lock) message->analyze[current_select]->ret_count++; } } if(message->r_code == SELECT_DEFAULT && message->ignore_rewrite == -1 && analyze->part == SELECT_TARGETLIST) { if(analyze->retlock && lock) { analyze->retlock = false; } } } /***************************************************************************** * * Stuff from primnodes.h. * *****************************************************************************/ static void _rewriteAlias(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, Alias *node) { delay_string_append_char(message, str, " AS "); delay_string_append_char(message, str, node->aliasname); delay_string_append_char(message, str, " "); if (node->colnames) { delay_string_append_char(message, str, "("); _rewriteNode(BaseSelect, message, dblink, str, node->colnames); delay_string_append_char(message, str, ")"); } } static void append_all_virtual(AnalyzeSelect *analyze,char *table) { VirtualTable *virtual; SelectDefInfo *select_ret; int num; int test_num; int base; int i; int counter = 0; virtual = analyze->virtual; test_num = virtual->col_num; select_ret = analyze->select_ret; base = select_ret->col_num; if(!table) { num = test_num; } else { num = 0; for(i = 0; i< test_num; i++) { if(!strcmp(virtual->table_list[i],table)) num++; } } if(base == 0) { select_ret->col_list = (char **) palloc(num * sizeof(char *)); select_ret->type_list = (char **) palloc(num * sizeof(char *)); select_ret->return_list = (int *) palloc(num * sizeof(int)); } else { select_ret->col_list = (char **) repalloc(select_ret->col_list,(base + num) * sizeof(char *)); select_ret->type_list = (char **) repalloc(select_ret->type_list,(base + num) * sizeof(char *)); select_ret->return_list = (int *) repalloc(select_ret->return_list,(base + num) * sizeof(int)); } for(i = 0; i< test_num;i++) { if(table && strcmp(virtual->table_list[i],table)) { continue; } select_ret->col_list[base + counter] = virtual->col_list[i]; select_ret->type_list[base + counter] = virtual->type_list[i]; select_ret->return_list[base + counter] = -1; ereport(DEBUG2, (errmsg("append_all_virtual: analyze[%d] col=%s,type=%s", analyze->now_select, select_ret->col_list[base + counter],select_ret->type_list[base + counter]))); counter++; } select_ret->col_num = base + num; } static void append_select_def_info(SelectDefInfo *select_ret,char *col,char *type) { int base; base = select_ret->col_num; ereport(DEBUG2, (errmsg("append_select_def_info: base=%d",base))); if(!type) { type = (char *)palloc(sizeof(char) * strlen("text") + 1); strcpy(type,"text"); } if(base == 0) { select_ret->col_list = (char **) palloc(sizeof(char *)); select_ret->type_list = (char **) palloc(sizeof(char *)); select_ret->return_list = (int *) palloc(sizeof(int)); } else { select_ret->col_list = (char **) repalloc(select_ret->col_list,(base + 1) * sizeof(char *)); select_ret->type_list = (char **) repalloc(select_ret->type_list,(base + 1) * sizeof(char *)); select_ret->return_list = (int *) repalloc(select_ret->return_list,(base + 1) * sizeof(int)); } select_ret->col_list[base] = col; select_ret->type_list[base] = type; select_ret->return_list[base] = -1; select_ret->col_num++; ereport(DEBUG2, (errmsg("append_select_def_info: col=%s,type=%s base=%d", select_ret->col_list[base],select_ret->type_list[base],select_ret->col_num))); } static char *search_type_from_virtual(VirtualTable *virtual,char *table,char *col) { int num = virtual->col_num; int i; for(i = 0; i < num; i++) { if(table) { if(!strcmp(virtual->table_list[i],table) && !strcmp(virtual->col_list[i],col)) return virtual->type_list[i]; } else { if(!strcmp(virtual->col_list[i],col)) return virtual->type_list[i]; } } return NULL; } static void AnalyzeReturnRecord(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, List *list) { int select_num; AnalyzeSelect *analyze; VirtualTable *virtual; ListCell *lc; int n_sublink = 0; int c_sublink = 0; select_num = message->current_select; analyze=message->analyze[select_num]; virtual = analyze->virtual; analyze->select_ret = (SelectDefInfo *) palloc(sizeof(SelectDefInfo)); analyze->select_ret->valid = false; analyze->select_ret->col_num = 0; ereport(DEBUG2, (errmsg("AnalyzeReturnRecord: current_select=%d",select_num))); foreach(lc, list) { ResTarget *target = NULL; Node *n = lfirst(lc); void *obj; char *alias = NULL; char *typecast = NULL; char *colname = NULL; char *table_name = NULL; char *gettype = NULL; target = (ResTarget *) n; /* alias name */ if(target->name) alias = target->name; /* type name */ if(IsA(target->val, TypeCast)) { TypeCast *type = (TypeCast *) target->val; TypeName *typename = (TypeName *)type->typeName; obj = type->arg; typecast = strVal(lfirst(list_head(typename->names))); } else { obj = target->val; } if(typecast && alias) { append_select_def_info(analyze->select_ret,alias,typecast); continue; } /* column name */ if (obj && (IsA(obj, ColumnRef))) { int first = 0; ListCell *c; ColumnRef *col = NULL; col = (ColumnRef *) obj; foreach (c, col->fields) { Node *n = (Node *) lfirst(c); if (IsA(n, String)) { Value *v = (Value *) lfirst(c); if(col->fields->length == 2 && first == 0) { first = 1; table_name = v->val.str; } else colname = v->val.str; } else if (IsA(n, A_Star)) { colname = "*"; } } } else if(obj && (IsA(obj, A_Expr))) { if(alias) append_select_def_info(analyze->select_ret,alias,typecast); else { char *colname; colname = (char *)palloc(sizeof(char) * strlen("\"?column?\"") + 1); strcpy(colname,"\"?column?\""); append_select_def_info(analyze->select_ret,colname,typecast); } continue; } else if(obj && (IsA(obj, FuncCall))) { if(alias) { append_select_def_info(analyze->select_ret,alias,typecast); } else { FuncCall *func = NULL; char *funcname; func = (FuncCall *) obj; funcname = strVal(lfirst(list_head(func->funcname))); append_select_def_info(analyze->select_ret,funcname,typecast); } continue; } else if (obj && (IsA(obj,SubLink))) { int i; int max = message->analyze_num; AnalyzeSelect *sublink = NULL; for(i = select_num + 1; i < max;i++) { sublink = message->analyze[i]; if(sublink->last_select == select_num && sublink->part == 1 && c_sublink == n_sublink) break; } n_sublink++; if(sublink && (sublink->select_ret->col_num == 1)) { if(alias) { append_select_def_info(analyze->select_ret,alias,sublink->select_ret->type_list[0]); continue; } else { char *column; column = (char *)palloc(sizeof(char) * strlen("\"?column?\"") + 1); strcpy(column,"\"?column?\""); append_select_def_info(analyze->select_ret,column,sublink->select_ret->type_list[0]); continue; } } } else if(obj && (IsA(obj,A_Const))) { char *column = NULL; if(!alias) { column = (char *)palloc(sizeof(char) * strlen("\"?column?\"") + 1); strcpy(column,"\"?column?\""); alias = column; } append_select_def_info(analyze->select_ret,alias,typecast); continue; } if(colname && !strcmp(colname,"*")) { append_all_virtual(analyze,table_name); continue; } if(colname) gettype = search_type_from_virtual(virtual,table_name,colname); else { char *column = NULL; column = (char *)palloc(sizeof(char) * strlen("\"?column?\"") + 1); strcpy(column,"\"?column?\""); append_select_def_info(analyze->select_ret,column,NULL); continue; } if(gettype) { char *t_n; char *t_t; if(alias) t_n = alias; else t_n = colname; if(typecast) t_t = typecast; else t_t = gettype; append_select_def_info(analyze->select_ret,t_n,t_t); } } } static void append_virtual_table(RewriteQuery *message,VirtualTable *virtual,char **col_list,char **type_list,int col_num,char *table_name,char state,int next) { int base; int i; if(virtual->col_num == 0) { base = 0; virtual->col_list = (char**) palloc(sizeof(char*) * col_num); virtual->type_list = (char**) palloc(sizeof(char*) * col_num); virtual->table_list = (char**) palloc(sizeof(char*) * col_num); virtual->state_list = (char*) palloc(sizeof(char) * col_num); virtual->column_no = (int*) palloc(sizeof(int) * col_num); virtual->valid = (int*) palloc(sizeof(int) * col_num); } else { base = virtual->col_num; virtual->col_list = (char**) repalloc(virtual->col_list,sizeof(char*) * (base + col_num)); virtual->type_list = (char**) repalloc(virtual->type_list,sizeof(char*) * (base + col_num)); virtual->table_list = (char**) repalloc(virtual->table_list,sizeof(char*)* (base + col_num)); virtual->state_list = (char*) repalloc(virtual->state_list,sizeof(char) * (base + col_num)); virtual->column_no = (int*) repalloc(virtual->column_no,sizeof(int) * (base + col_num)); virtual->valid = (int*) repalloc(virtual->valid,sizeof(int) * (base + col_num)); } for(i = 0; i< col_num; i++) { int j = base + i; virtual->col_list[j] = col_list[i]; virtual->type_list[j] = type_list[i]; virtual->table_list[j] = table_name; virtual->state_list[j] = state; /* (next > 0) means this function call from RangeSubselect */ if(next > 0) { AnalyzeSelect *analyze = message->analyze[next]; SelectDefInfo *select_ret; select_ret = analyze->select_ret; select_ret->return_list[i] = message->column; ereport(DEBUG2, (errmsg("append_virtual_table return_list[%d]=%d,analyze[%d]",i,message->column,next))); } virtual->column_no[j] = message->column; message->column++; virtual->valid[j] = -1; ereport(DEBUG2, (errmsg("append_virtual_table select=%d, no=%d,col=%s,type=%s,table=%s,state=%c,valid=%d", message->current_select, virtual->column_no[j],virtual->col_list[j],virtual->type_list[j] ,virtual->table_list[j],virtual->state_list[j],virtual->valid[j]))); } virtual->col_num = base + col_num; } static void append_join_using(AnalyzeSelect *analyze,char **col_list,char **type_list,int col_num,char *table_name) { int num,i,j,k; int same[analyze->join->col_num]; int lvalid[analyze->join->col_num]; int rvalid[col_num]; char **using; int lc = 0; int rc = 0; int sc = 0; int total; JoinTable *join = analyze->join; JoinTable *new = (JoinTable *) palloc(sizeof(JoinTable)); using = join->using_list; num = join->using_length; for(i = 0; i < join->col_num; i++) { char *colname = join->col_list[i]; for(j = 0; j < num; j++) { if(!strcmp(colname, using[j])) { same[sc] = i; sc++; } else { lvalid[lc] = i; lc++; } } } for(i = 0; i < col_num; i++) { char *colname = col_list[i]; for(j = 0; j < num; j++) { if(strcmp(colname, using[j])) { rvalid[rc] = i; rc++; } } } total= sc + lc + rc; new->col_num = total; new->col_list = (char**) palloc(sizeof(char*) * (total)); new->type_list = (char**) palloc(sizeof(char*) * (total)); new->table_list = (char**) palloc(sizeof(char*) * (total)); for(k = 0; k < sc; k++) { new->col_list[k] = join->col_list[same[k]]; new->type_list[k] = join->type_list[same[k]]; new->table_list[k] = join->table_list[same[k]]; } for(k = sc; k < sc + lc; k++) { new->col_list[k] = join->col_list[lvalid[k - sc]]; new->type_list[k] = join->type_list[lvalid[k - sc]]; new->table_list[k] = join->table_list[lvalid[k - sc]]; } for(k = sc + lc; k < sc + lc + rc; k++) { new->col_list[k] = col_list[rvalid[k - lc - sc]]; new->type_list[k] = type_list[rvalid[k - lc - sc]]; if(table_name) { new->table_list[k] = table_name; } else new->table_list[k] = NULL; } analyze->join = new; for(i = 0; i< analyze->join->col_num; i++) { ereport(DEBUG2, (errmsg("append_join_using no = %d ,col=%s,type=%s,table=%s", i,new->col_list[i],new->type_list[i],new->table_list[i]))); } } static void append_join_natural(AnalyzeSelect *analyze,char **col_list,char **type_list,int base,int col_num,char *table_name) { int same[base + 1]; int rvalid[base + 1]; int linvalid[col_num + 1]; int lvalid[col_num +1]; int i,j,k; int sc = 0; int vc = 0; int ic = 0; int total = 0; int count; JoinTable *join = analyze->join; JoinTable *new = (JoinTable *) palloc(sizeof(JoinTable)); for(i = 0; i < base; i++) { char *colname = join->col_list[i]; int match = 0; int array = -1; for(j = 0; j < col_num; j++) { if(!strcmp(colname, col_list[j])) { match++; array = j; } } if(match == 0) { rvalid[vc] = i; vc++; } else if(match == 1) { same[sc] = i; linvalid[ic] = array; sc++; ic++; } else { /* XXX */ } } total=sc + vc + (col_num - ic); new->col_num = total; new->col_list = (char**) palloc(sizeof(char*) * (total)); new->type_list = (char**) palloc(sizeof(char*) * (total)); new->table_list = (char**) palloc(sizeof(char*) * (total)); for(k = 0; k < sc; k++) { new->col_list[k] = join->col_list[same[k]]; new->type_list[k] = join->type_list[same[k]]; if(table_name) { new->table_list[k] = table_name; } else new->table_list[k] = join->table_list[same[k]]; } for(k = sc; k < sc + vc; k++) { new->col_list[k] = join->col_list[rvalid[k - sc]]; new->type_list[k] = join->type_list[rvalid[k - sc]]; if(table_name) { new->table_list[k] = table_name; } else new->table_list[k] = join->table_list[rvalid[k - sc]]; } count = 0; for(k = 0; k col_list[k] = col_list[lvalid[k - sc - vc]]; new->type_list[k] = type_list[lvalid[k - sc - vc]]; if(table_name) { new->table_list[k] = table_name; } else new->table_list[k] = NULL; } analyze->join = new; for(i = 0; i< analyze->join->col_num; i++) { ereport(DEBUG2, (errmsg("append_join_natural no = %d ,col=%s,type=%s,table=%s", i,new->col_list[i],new->type_list[i],new->table_list[i]))); } } static void append_join_simple(JoinTable *join,char **col_list,char **type_list,int col_num,char *table_name) { int base; int i; ereport(DEBUG2, (errmsg("append_join_table start"))); if(join->col_num == 0) { base = 0; join->col_list = (char**) palloc(sizeof(char*) * col_num); join->type_list = (char**) palloc(sizeof(char*) * col_num); join->table_list = (char**) palloc(sizeof(char*) * col_num); } else { base = join->col_num; join->col_list = (char**) repalloc(join->col_list,sizeof(char*) * (base + col_num)); join->type_list = (char**) repalloc(join->type_list,sizeof(char*) * (base + col_num)); join->table_list = (char**) repalloc(join->table_list,sizeof(char*) * (base + col_num)); } for(i = 0; i< col_num; i++) { join->col_list[base + i] = col_list[i]; join->type_list[base + i] = type_list[i]; join->table_list[base + i] = table_name; ereport(DEBUG2, (errmsg("append_join_table no = %d ,col=%s,type=%s,table=%s", base + i,join->col_list[base + i],join->type_list[base + i],join->table_list[base + i]))); } join->col_num = base + col_num; } static void build_join_table(RewriteQuery *message,char *alias, int type) { char *table_name = NULL; char state; char lstate; int left_num,right_num,range_num,select_num; DistDefInfo *distinfo = NULL; RepliDefInfo *repliinfo = NULL; SelectDefInfo *selectinfo = NULL; JoinTable *join; RangeInfo *range; AnalyzeSelect *analyze; select_num = message->current_select; analyze=message->analyze[select_num]; join = analyze->join; left_num = join->col_num; range_num = analyze->rangeinfo_num; range = analyze->range[range_num - 1]; state = range->state; lstate = join->state; right_num = 0; distinfo = range->distinfo; repliinfo = range->repliinfo; selectinfo = range->selectinfo; if(alias) table_name = alias; else if(!alias && range->alias) table_name = range->alias; if(distinfo && !repliinfo && !selectinfo) { right_num = distinfo->col_num; if(!table_name) table_name = distinfo->table_name; ereport(DEBUG2, (errmsg("inside build_join_info dist state=%c %s",range->state,table_name))); if(type == JNATURAL_INNER || type == JNATURAL_RIGHT || type == JNATURAL_LEFT || type == JNATURAL_FULL) append_join_natural(analyze,distinfo->col_list,distinfo->type_list,join->col_num,distinfo->col_num,table_name); else append_join_simple(join,distinfo->col_list,distinfo->type_list,distinfo->col_num,table_name); } else if (repliinfo && !distinfo && !selectinfo) { right_num = repliinfo->col_num; if(!table_name) table_name = repliinfo->table_name; ereport(DEBUG2, (errmsg("inside build_join_info repli state=%c %s",range->state,table_name))); if(type == JNATURAL_INNER || type == JNATURAL_RIGHT || type == JNATURAL_LEFT || type == JNATURAL_FULL) append_join_natural(analyze,repliinfo->col_list,repliinfo->type_list,join->col_num,repliinfo->col_num,table_name); else if(join->using_length != 0) append_join_using(analyze,repliinfo->col_list,repliinfo->type_list,repliinfo->col_num,table_name); else append_join_simple(join,repliinfo->col_list,repliinfo->type_list,repliinfo->col_num,table_name); } else if (selectinfo && !repliinfo && !distinfo) { ereport(DEBUG2, (errmsg("inside build_join_info select state=%c %s",range->state,table_name))); right_num = selectinfo->col_num; if(type == JNATURAL_INNER || type == JNATURAL_RIGHT || type == JNATURAL_LEFT || type == JNATURAL_FULL) append_join_natural(analyze,selectinfo->col_list,selectinfo->type_list,join->col_num,selectinfo->col_num,table_name); else if(join->using_length != 0) append_join_using(analyze,selectinfo->col_list,selectinfo->type_list,selectinfo->col_num,table_name); else append_join_simple(join,selectinfo->col_list,selectinfo->type_list,selectinfo->col_num,table_name); } if(type == JDEFAULT) { join->state = state; return; } join =analyze->join; if(lstate =='E' || state == 'E') { join->state = 'E'; return; } if(lstate =='L' && state =='L') { join->state = 'L'; return; } if(lstate =='L' && state =='P') { int total = left_num + right_num; if(type == JRIGHT || type == JNORMAL || type == JINNER || type == JNATURAL_INNER) join->state = 'P'; else if((join->col_num <= total) && (type == JNATURAL_RIGHT)) join->state = 'P'; else if((join->col_num == total) && (type == JNATURAL_LEFT)) join->state = 'P'; else join->state = 'S'; } else if(lstate =='P' && state == 'L') { int total = left_num + right_num; if(type == JLEFT || type == JNORMAL || type == JINNER || type == JNATURAL_INNER) join->state ='P'; else if((join->col_num <= total) && (type == JNATURAL_LEFT)) join->state = 'P'; else if((join->col_num == total) && (type == JNATURAL_RIGHT)) join->state = 'P'; else join->state ='S'; } else join->state = 'S'; } static void change_analyze_state(AnalyzeSelect *analyze,char state) { if(state == 'E' || analyze->state == 'E') return; if(!analyze->state) { analyze->state = state; } else if(analyze->state == 'P' && state =='L') { analyze->state = 'P'; } else if(analyze->state == 'L' && state =='P') { analyze->state = 'P'; } else if(analyze->state == 'L' && state =='L') { return; } else analyze->state = 'S'; } static void build_virtual_table(RewriteQuery *message,void *obj,int next) { int select_num; int range_num; char *alias = NULL; char *table_name = NULL; char state; AnalyzeSelect *analyze; VirtualTable *virtual; RangeInfo *range; DistDefInfo *distinfo; RepliDefInfo *repliinfo; SelectDefInfo *selectinfo; select_num = message->current_select; analyze=message->analyze[select_num]; virtual = analyze->virtual; /* last range */ range_num = analyze->rangeinfo_num; range = analyze->range[range_num - 1]; distinfo = range->distinfo; repliinfo = range->repliinfo; selectinfo = range->selectinfo; if(range->alias) alias = range->alias; state = range->state; if(distinfo && !repliinfo && !selectinfo) { if(alias) table_name =alias; else table_name = distinfo->table_name; ereport(DEBUG2, (errmsg("inside build_virtual_info dist state=%c %s",range->state,table_name))); append_virtual_table(message,virtual,distinfo->col_list,distinfo->type_list,distinfo->col_num,table_name,state,-2); change_analyze_state(analyze,state); return; } else if (repliinfo && !distinfo && !selectinfo) { if(alias) table_name =alias; else table_name = repliinfo->table_name; ereport(DEBUG2, (errmsg("inside build_virtual_info repli state=%c %s",range->state,table_name))); append_virtual_table(message,virtual,repliinfo->col_list,repliinfo->type_list,repliinfo->col_num,table_name,state,-3); change_analyze_state(analyze,state); return; } else if (selectinfo && !repliinfo && !distinfo) { table_name = alias; ereport(DEBUG2, (errmsg("inside build_virtual_info select state=%c %s",range->state,table_name))); append_virtual_table(message,virtual,selectinfo->col_list,selectinfo->type_list,selectinfo->col_num,table_name,state,next); change_analyze_state(analyze,state); return; } else if (!selectinfo && !repliinfo && !distinfo) { ereport(DEBUG2, (errmsg("inside build_virtual_info no dist state=%c %s",range->state,alias))); change_analyze_state(analyze,'E'); } } static void build_range_info(RewriteQuery *message,DistDefInfo *info,RepliDefInfo *info2,SelectDefInfo *info3,char *alias, int select_num,int i_num) { int num; AnalyzeSelect *analyze; analyze=message->analyze[select_num]; if(analyze->range) { ++analyze->rangeinfo_num; num = analyze->rangeinfo_num; analyze->range = (RangeInfo **) repalloc(analyze->range,sizeof(RangeInfo *) * num); analyze->range[num-1] = (RangeInfo *) palloc(sizeof(RangeInfo)); ereport(DEBUG2, (errmsg("inside build_range_info num= %d current_select=%d",num,select_num))); } else { num = 1; analyze->range = (RangeInfo **) palloc(sizeof(RangeInfo *)); analyze->range[0] = (RangeInfo *) palloc(sizeof(RangeInfo)); analyze->rangeinfo_num = 1; ereport(DEBUG2, (errmsg("inside build_range_info num= %d current_select=%d",num,select_num))); } analyze->range[num -1]->ret_num = num - 1; analyze->range[num -1]->selectinfo = NULL; /* set dist_def_info */ if(info && !info2 && !info3) { message->is_loadbalance = false; analyze->range[num -1]->distinfo = info; analyze->range[num -1]->repliinfo = NULL; analyze->select_ret = NULL; analyze->range[num -1]->alias = alias; analyze->range[num -1]->state = 'P'; ereport(DEBUG2, (errmsg("inside build_range_info dist %d",select_num))); } /* set repli_def_info */ if(info2 && !info && !info3) { analyze->range[num -1]->distinfo = NULL; analyze->range[num -1]->repliinfo = info2; analyze->select_ret = NULL; analyze->range[num -1]->alias = alias; analyze->range[num -1]->state = 'L'; ereport(DEBUG2, (errmsg("inside build_range_info repli %d",select_num))); return; } /* CALL FROM _rertiteRangeSubselect */ if(info3 && !info && !info2) { char state = (char)0; analyze->range[num -1]->distinfo = NULL; analyze->range[num -1]->repliinfo = NULL; analyze->range[num -1]->selectinfo = info3; analyze->range[num -1]->alias = alias; state = message->analyze[i_num]->state; analyze->range[num -1]->state = state; ereport(DEBUG2, (errmsg("inside build_range_info select %d, state = %c (%c)",select_num,state,analyze->state))); return; } if(info && info2) { /*TODO: error*/ analyze->select_ret = NULL; ereport(DEBUG2, (errmsg("inside build_range_info error %d",select_num))); return; } if(!info && !info2 && !info3) { /*TODO: error*/ message->is_loadbalance = true; analyze->range[num -1]->distinfo = NULL; analyze->range[num -1]->repliinfo = NULL; analyze->range[num -1]->state = 'E'; analyze->select_ret = NULL; analyze->range[num -1]->alias = alias; ereport(DEBUG2, (errmsg("inside build_range_info const or func %d",select_num))); } } static void _rewriteRangeVar(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, RangeVar *node) { DistDefInfo *info = NULL; RepliDefInfo *info2 = NULL; if(message->r_code == SELECT_ANALYZE) { info = pool_get_dist_def_info(dblink->dbname, node->schemaname, node->relname); info2 = pool_get_repli_def_info(dblink->dbname, node->schemaname, node->relname); } if(!(message->r_code == SELECT_DEFAULT && message->rewritelock == -1 && message->ignore_rewrite == -1)) { if (node->catalogname) { delay_string_append_char(message, str, node->catalogname); delay_string_append_char(message, str, "."); } if (node->schemaname) { delay_string_append_char(message, str, node->schemaname); delay_string_append_char(message, str, "."); if(strcmp(node->schemaname,"pg_catalog") == 0) { message->is_pg_catalog = true; } } delay_string_append_char(message, str, node->relname); if (node->alias) { Alias *alias = node->alias; _rewriteNode(BaseSelect, message, dblink, str, node->alias); if(message->r_code == SELECT_ANALYZE) build_range_info(message,info,info2,NULL,alias->aliasname,message->current_select,-1); } else { if(message->r_code == SELECT_ANALYZE) build_range_info(message,info,info2,NULL,node->relname,message->current_select,-1); } if (node->inhOpt == INH_YES) { delay_string_append_char(message, str, " * "); } } else { /* rewrite query using dblink connection */ char *alias_name = NULL; SelectStmt *select = (SelectStmt *)BaseSelect; if(node->alias) { alias_name = node->alias->aliasname; } /* * iff schemaname is pg_catalog, send query to * one node not system db. */ if(node->schemaname && (strcmp(node->schemaname,"pg_catalog") == 0)) { message->is_pg_catalog =true; return; } info = pool_get_dist_def_info(dblink->dbname, node->schemaname, node->relname); info2 = pool_get_repli_def_info(dblink->dbname, node->schemaname, node->relname); writeRangeHeader(message,dblink,str,info,info2,alias_name); if (node->catalogname) { delay_string_append_char(message, str, node->catalogname); delay_string_append_char(message, str, "."); } if (node->schemaname) { delay_string_append_char(message, str, node->schemaname); delay_string_append_char(message, str, "."); message->schemaname = node->schemaname; if(strcmp(node->schemaname,"pg_catalog") == 0) { message->is_pg_catalog = true; } } else message->schemaname = NULL; delay_string_append_char(message, str, node->relname); if (alias_name) { delay_string_append_char(message, str, " AS "); delay_string_append_char(message, str, alias_name); } if(select->whereClause && !(message->r_code == SELECT_PGCATALOG)) { char * temp = NULL; int message_code = message->r_code; delay_string_append_char(message, str, " WHERE "); if(message->table_relname) temp = message->table_relname; if(alias_name) message->table_relname = alias_name; else message->table_relname = node->relname; message->rewritelock = message->current_select; CheckWhereCaluse(select->whereClause, message,dblink,str,0); message->rewritelock = -1; message->table_relname = temp; KeepRewriteQueryReturnCode(message, message_code); } writeRangeFooter(message,dblink,str,info,info2,alias_name); if (node->inhOpt == INH_YES) { delay_string_append_char(message, str, " * "); } } /*2009/07/27*/ if(message->r_code == SELECT_ANALYZE && message->fromClause) { int next = message->analyze_num; build_virtual_table(message,node,next); } } static void _rewriteVar(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, Var *node) { } static void _rewriteConst(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, Const *node) { } static void _rewriteParam(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, Param *node) { } static void _rewriteAggref(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, Aggref *node) { } static void _rewriteArrayRef(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, ArrayRef *node) { } static void _rewriteFuncExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, FuncExpr *node) { } static void _rewriteNameArgExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, NamedArgExpr *node) { delay_string_append_char(message, str, node->name); delay_string_append_char(message, str, " := "); _rewriteNode(BaseSelect, message, dblink, str, node->arg); } static void _rewriteOpExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, OpExpr *node) { } static void _rewriteDistinctExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, DistinctExpr *node) { } static void _rewriteScalarArrayOpExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, ScalarArrayOpExpr *node) { } static void _rewriteBoolExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, BoolExpr *node) { } static void _rewriteSubLink(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, SubLink *node) { if(message->r_code == SELECT_AEXPR) { KeepRewriteQueryReturnCode(message, SELECT_AEXPR_FALSE); return; } _rewriteNode(BaseSelect, message, dblink, str, node->testexpr); if (node->operName != NIL) { Value *v = linitial(node->operName); if (strcmp(v->val.str, "=") == 0) delay_string_append_char(message, str, " IN "); else { delay_string_append_char(message, str, v->val.str); } } switch (node->subLinkType) { case EXISTS_SUBLINK: delay_string_append_char(message, str, " EXISTS "); break; case ARRAY_SUBLINK: delay_string_append_char(message, str, " ARRAY "); break; case ANY_SUBLINK: if (node->operName != NIL) { Value *v = linitial(node->operName); if (strcmp(v->val.str, "=") != 0) { delay_string_append_char(message, str, v->val.str); delay_string_append_char(message, str, " ANY "); } } break; case ALL_SUBLINK: delay_string_append_char(message, str, " ALL "); break; default: break; } if (node->subselect) { int count = message->current_select; int part = message->part; delay_string_append_char(message, str, "("); _rewriteNode(BaseSelect, message, dblink, str, node->subselect); delay_string_append_char(message, str, ")"); KeepMessages(message,count,part); } } static void _rewriteSubPlan(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, SubPlan *node) { } static void _rewriteFieldSelect(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, FieldSelect *node) { } static void _rewriteFieldStore(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, FieldStore *node) { } static void _rewriteRelabelType(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, RelabelType *node) { } static void _rewriteConvertRowtypeExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, ConvertRowtypeExpr *node) { } static void _rewriteCaseExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CaseExpr *node) { ListCell *lc; delay_string_append_char(message, str, "CASE "); if (node->arg) _rewriteNode(BaseSelect, message, dblink, str, node->arg); foreach (lc, node->args) { _rewriteNode(BaseSelect, message, dblink, str, lfirst(lc)); } if (node->defresult) { delay_string_append_char(message, str, " ELSE "); _rewriteNode(BaseSelect, message, dblink, str, node->defresult); } delay_string_append_char(message, str, " END"); } static void _rewriteCaseWhen(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CaseWhen *node) { delay_string_append_char(message, str, " WHEN "); _rewriteNode(BaseSelect, message, dblink, str, node->expr); delay_string_append_char(message, str, " THEN "); _rewriteNode(BaseSelect, message, dblink, str, node->result); } static void _rewriteCaseTestExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CaseTestExpr *node) { } static void _rewriteArrayExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, ArrayExpr *node) { delay_string_append_char(message, str, "["); _rewriteNode(BaseSelect, message, dblink, str, node->elements); delay_string_append_char(message, str, "]"); } static void _rewriteRowExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, RowExpr *node) { if (node->args == NIL) delay_string_append_char(message, str, "ROW ()"); else { delay_string_append_char(message, str, "ROW ("); _rewriteNode(BaseSelect, message, dblink, str, node->args); delay_string_append_char(message, str, ")"); } } static void _rewriteCoalesceExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CoalesceExpr *node) { delay_string_append_char(message, str, "COALESCE ("); _rewriteNode(BaseSelect, message, dblink, str, node->args); delay_string_append_char(message, str, ")"); } static void _rewriteMinMaxExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, MinMaxExpr *node) { if (node->op == IS_GREATEST) { delay_string_append_char(message, str, "GREATEST ("); _rewriteNode(BaseSelect, message, dblink, str, node->args); delay_string_append_char(message, str, ")"); } else if (node->op == IS_LEAST) { delay_string_append_char(message, str, "LEAST ("); _rewriteNode(BaseSelect, message, dblink, str, node->args); delay_string_append_char(message, str, ")"); } } static void _rewriteNullIfExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, NullIfExpr *node) { } static void _rewriteNullTest(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, NullTest *node) { _rewriteNode(BaseSelect, message, dblink, str, node->arg); if (node->nulltesttype == IS_NOT_NULL) delay_string_append_char(message, str, " IS NOT NULL"); else delay_string_append_char(message, str, " IS NULL"); } static void _rewriteBooleanTest(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, BooleanTest *node) { _rewriteNode(BaseSelect, message, dblink, str, node->arg); switch (node->booltesttype) { case IS_TRUE: delay_string_append_char(message, str, " IS TRUE"); break; case IS_NOT_TRUE: delay_string_append_char(message, str, " IS NOT TRUE"); break; case IS_FALSE: delay_string_append_char(message, str, " IS FALSE"); break; case IS_NOT_FALSE: delay_string_append_char(message, str, " IS NOT FALSE"); break; case IS_UNKNOWN: delay_string_append_char(message, str, " IS UNKNOWN"); break; case IS_NOT_UNKNOWN: delay_string_append_char(message, str, " IS NOT UNKNOWN"); break; } } static void _rewriteCoerceToDomain(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CoerceToDomain *node) { } static void _rewriteCoerceToDomainValue(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CoerceToDomainValue *node) { } static void _rewriteSetToDefault(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, SetToDefault *node) { delay_string_append_char(message, str, "DEFAULT"); } static void _rewriteTargetEntry(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, TargetEntry *node) { } static void _rewriteRangeTblRef(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, RangeTblRef *node) { } static int RetVirtualColumn(VirtualTable *virtual, char *tablename, char *colname) { int col_num = virtual->col_num; int i; if (tablename && colname) { for( i = 0; i < col_num; i++) { if(strcmp(virtual->col_list[i], colname) == 0 && strcmp(virtual->table_list[i], tablename) == 0) { return virtual->column_no[i]; } } } /* Error */ return -1; } static void SearchVirtualColumnID(VirtualTable *virtual, Node *node, char *colname, int *col_id, bool *ambiguous) { int tmp_id; char *name = NULL; if(IsA(node, RangeVar)) { RangeVar *range = (RangeVar *)node; if(range->alias) { Alias *alias = range->alias; name = alias->aliasname; } else { name = range->relname; } } else if (IsA(node,RangeSubselect)) { RangeSubselect *select = (RangeSubselect *)node; Alias *alias = select->alias; name = alias->aliasname; } else if (IsA(node,JoinExpr)) { JoinExpr *jexpr = (JoinExpr *)node; if (jexpr->larg) SearchVirtualColumnID(virtual, jexpr->larg, colname, col_id, ambiguous); if (jexpr->rarg) SearchVirtualColumnID(virtual, jexpr->rarg, colname, col_id, ambiguous); } if (name && (tmp_id = RetVirtualColumn(virtual, name, colname)) != -1) { if (*col_id == -1) *col_id = tmp_id; else *ambiguous = true; } } static int GetVirtualColumnID(VirtualTable *virtual, Node *node, char *colname) { int col_id = -1; bool ambiguous = false; SearchVirtualColumnID(virtual, node, colname, &col_id, &ambiguous); if (ambiguous) return -1; else return col_id; } static void ConvertFromUsingToON(RewriteQuery *message, String *str, JoinExpr *node, int select_num) { char comma = 0; ListCell *lc; VirtualTable *virtual = message->analyze[select_num]->virtual; delay_string_append_char(message, str, " ON"); foreach (lc, node->usingClause) { Value *value; char lbuf[16]; char rbuf[16]; if (comma == 0) comma = 1; else delay_string_append_char(message, str, " AND "); value = lfirst(lc); snprintf(lbuf, 16, "%d", GetVirtualColumnID(virtual, node->larg, value->val.str)); snprintf(rbuf, 16, "%d", GetVirtualColumnID(virtual, node->rarg, value->val.str)); delay_string_append_char(message, str, " \"pool_c$"); delay_string_append_char(message, str, lbuf); delay_string_append_char(message, str, "\""); delay_string_append_char(message, str, " = "); delay_string_append_char(message, str, "\"pool_c$"); delay_string_append_char(message, str, rbuf); delay_string_append_char(message, str, "\""); delay_string_append_char(message, str, " "); } } static void _rewriteJoinExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, JoinExpr *node) { bool from; int select_num; bool natural = false; bool inner = false; bool cross = false; bool full = false; bool left = false; bool right = false; char *aliasname; int using_length = 0; char **using_list; Alias *alias = node->alias; if(alias) aliasname = alias->aliasname; else aliasname = NULL; from = message->fromClause; select_num = message->current_select; _rewriteNode(BaseSelect, message, dblink, str, node->larg); /* reset message */ message->fromClause = from; message->current_select = select_num; if(message->r_code == SELECT_ANALYZE && (IsA(node->larg, RangeVar) || IsA(node->larg,RangeSubselect))) { build_join_table(message,aliasname,JDEFAULT); } if (node->isNatural == TRUE) { natural = true; delay_string_append_char(message, str, " NATURAL"); } if (node->jointype == JOIN_INNER) { if (node->usingClause == NIL && node->quals == NULL && !node->isNatural) { cross = true; delay_string_append_char(message, str, " CROSS JOIN "); } else { delay_string_append_char(message, str, " JOIN "); inner = true; } } else if (node->jointype == JOIN_LEFT) { delay_string_append_char(message, str, " LEFT OUTER JOIN "); left = true; } else if (node->jointype == JOIN_FULL) { delay_string_append_char(message, str, " FULL OUTER JOIN "); full = true; } else if (node->jointype == JOIN_RIGHT) { delay_string_append_char(message, str, " RIGHT OUTER JOIN "); right = true; } _rewriteNode(BaseSelect, message, dblink, str, node->rarg); message->fromClause = from; message->current_select = select_num; if(message->r_code == SELECT_ANALYZE) { if(cross && (IsA(node->rarg, RangeVar) || IsA(node->rarg,RangeSubselect))) build_join_table(message,aliasname,JNORMAL); if(IsA(node->rarg, RangeVar) || IsA(node->rarg,RangeSubselect)) { if(natural && inner) build_join_table(message,aliasname,JNATURAL_INNER); else if(natural && left) build_join_table(message,aliasname,JNATURAL_LEFT); else if(natural && right) build_join_table(message,aliasname,JNATURAL_RIGHT); else if(natural && full) build_join_table(message,aliasname,JFULL); } } if (node->usingClause != NIL && IsA(node->usingClause, List)) { ListCell *lc; char comma = 0; int count = 0; using_length= list_length(node->usingClause); using_list = (char **) palloc(sizeof(char *) * using_length); if(message->r_code == SELECT_DEFAULT && message->rewritelock == -1 && message->analyze[select_num]->state == 'S') { /* Rewrite Using Cluase to On Clause */ ConvertFromUsingToON(message, str, node, select_num); } else { delay_string_append_char(message, str, " USING("); foreach (lc, node->usingClause) { Value *value; if (comma == 0) comma = 1; else delay_string_append_char(message, str, ","); value = lfirst(lc); delay_string_append_char(message, str, value->val.str); using_list[count] = value->val.str; count++; } message->analyze[select_num]->join->using_length = using_length; message->analyze[select_num]->join->using_list = using_list; delay_string_append_char(message, str, ")"); } } if(message->r_code == SELECT_ANALYZE) { if(IsA(node->rarg, RangeVar) || IsA(node->rarg,RangeSubselect)) { if(!natural && inner) build_join_table(message,aliasname,JINNER); else if(!natural && left) build_join_table(message,aliasname,JLEFT); else if(!natural && right) build_join_table(message,aliasname,JRIGHT); else if(!natural && full) build_join_table(message,aliasname,JFULL); } message->analyze[select_num]->state = message->analyze[select_num]->join->state; } if (node->quals) { int on_select = message->analyze_num - 1; delay_string_append_char(message, str, " ON "); _rewriteNode(BaseSelect, message, dblink, str, node->quals); /* This condition means that the sub select is in ON CLAUSE*/ if(on_select < message->analyze_num -1) { int count = message->analyze_num - 1 - on_select; char joinstate = message->analyze[select_num]->state; if(joinstate == 'S') return; else { int i; for(i= on_select + 1; i < count + on_select + 1;i++) { char onstate = message->analyze[i]->state; if (onstate == 'S' || onstate == 'P') { message->analyze[select_num]->state = 'S'; ereport(DEBUG2, (errmsg("_rewriteJoinExpr: Change Join state from %c to %c",joinstate, message->analyze[select_num]->state))); return; } } } } } } static void _rewriteFromExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, FromExpr *node) { } /***************************************************************************** * * Stuff from parsenodes.h. * *****************************************************************************/ static void _rewriteCreateStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CreateStmt *node) { delay_string_append_char(message, str, "CREATE "); if (node->relation->relpersistence) delay_string_append_char(message, str, "TEMP "); delay_string_append_char(message, str, "TABLE "); _rewriteNode(BaseSelect, message, dblink, str, node->relation); delay_string_append_char(message, str, " ("); _rewriteNode(BaseSelect, message, dblink, str, node->tableElts); delay_string_append_char(message, str, ") "); if (node->inhRelations != NIL) { delay_string_append_char(message, str, "INHERITS ("); _rewriteNode(BaseSelect, message, dblink, str, node->inhRelations); delay_string_append_char(message, str, ")"); } if (node->options) _rewriteWithDefinition(BaseSelect, message, dblink, str, node->options); switch (node->oncommit) { case ONCOMMIT_DROP: delay_string_append_char(message, str, " ON COMMIT DROP"); break; case ONCOMMIT_DELETE_ROWS: delay_string_append_char(message, str, " ON COMMIT DELETE ROWS"); case ONCOMMIT_PRESERVE_ROWS: delay_string_append_char(message, str, " ON COMMIT PRESERVE ROWS"); break; default: break; } if (node->tablespacename) { delay_string_append_char(message, str, " TABLESPACE \""); delay_string_append_char(message, str, node->tablespacename); delay_string_append_char(message, str, "\""); } } static void _rewriteIndexStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, IndexStmt *node) { delay_string_append_char(message, str, "CREATE "); if (node->unique == TRUE) delay_string_append_char(message, str, "UNIQUE "); if (node->concurrent == true) delay_string_append_char(message, str, "INDEX CONCURRENTLY \""); else delay_string_append_char(message, str, "INDEX "); if (node->idxname) { delay_string_append_char(message, str, "\""); delay_string_append_char(message, str, node->idxname); delay_string_append_char(message, str, "\" "); } delay_string_append_char(message, str, "\" ON "); _rewriteNode(BaseSelect, message, dblink, str, node->relation); if (strcmp(node->accessMethod, DEFAULT_INDEX_TYPE)) { delay_string_append_char(message, str, " USING "); delay_string_append_char(message, str, node->accessMethod); } delay_string_append_char(message, str, "("); _rewriteNode(BaseSelect, message, dblink, str, node->indexParams); delay_string_append_char(message, str, ")"); if (node->tableSpace) { delay_string_append_char(message, str, " TABLESPACE \""); delay_string_append_char(message, str, node->tableSpace); delay_string_append_char(message, str, "\""); } if (node->whereClause) { delay_string_append_char(message, str, " WHERE "); _rewriteNode(BaseSelect, message, dblink, str, node->whereClause); } } static void _rewriteNotifyStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, NotifyStmt *node) { delay_string_append_char(message, str, "NOTIFY "); delay_string_append_char(message, str, "\""); _rewriteNode(BaseSelect, message, dblink, str, node->conditionname); delay_string_append_char(message, str, "\""); } static void _rewriteDeclareCursorStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, DeclareCursorStmt *node) { delay_string_append_char(message, str, "DECLARE \""); delay_string_append_char(message, str, node->portalname); delay_string_append_char(message, str, "\" "); if (node->options & CURSOR_OPT_SCROLL) delay_string_append_char(message, str, "SCROLL "); if (node->options & CURSOR_OPT_BINARY) delay_string_append_char(message, str, "BINARY "); if (node->options & CURSOR_OPT_INSENSITIVE) delay_string_append_char(message, str, "INSENSITIVE "); delay_string_append_char(message, str, "CURSOR "); if (node->options & CURSOR_OPT_HOLD) delay_string_append_char(message, str, "WITH HOLD "); delay_string_append_char(message, str, "FOR"); _rewriteNode(BaseSelect, message, dblink, str, node->query); } static void initSelectStmt(RewriteQuery *message,SelectStmt *node) { int count; int last; int i; AnalyzeSelect *analyze; if(message->r_code != SELECT_ANALYZE && message->r_code != SELECT_DEFAULT) return; count = message->analyze_num++; last = message->current_select; message->current_select = count; if(message->r_code == SELECT_ANALYZE) { if(count == 0) { message->analyze = (AnalyzeSelect **) palloc(sizeof(AnalyzeSelect *)); message->analyze[count]=(AnalyzeSelect *) palloc(sizeof(AnalyzeSelect)); message->part = SELECT_START; analyze = message->analyze[count]; analyze->now_select = 0; analyze->last_select = -1; analyze->part = SELECT_START; analyze->call_part = SELECT_START; } else { message->analyze = (AnalyzeSelect **) repalloc(message->analyze,sizeof(AnalyzeSelect *) * (count+1)); message->analyze[count]=(AnalyzeSelect *) palloc(sizeof(AnalyzeSelect)); analyze = message->analyze[count]; analyze->now_select = count; analyze->last_select = last; analyze->part = message->part; analyze->call_part = message->analyze[last]->part; } analyze->range =NULL; analyze->rangeinfo_num =-1; analyze->virtual = NULL; analyze->join = NULL; analyze->state = (char) 0; analyze->aggregate = false; analyze->aggexpr = NULL; analyze->table_name = NULL; analyze->select_range = false; analyze->rarg_count = -1; analyze->larg_count = -1; analyze->ret_count = 0; analyze->retlock = false; for(i = 0; i< 8; i++) analyze->partstate[i] = (char)0; if(node->larg && node->rarg) analyze->select_union = true; else analyze->select_union = false; ereport(DEBUG2, (errmsg("initSelectStmt: ANALYZE now(%d)",message->current_select))); /* set default table_state */ /* S means that tuples was create by systemdb */ /* L means that tuples was create by one node */ /* P means that tuples was create by parallel node */ message->table_state = 'S'; } } static void writeRangeHeader(RewriteQuery *message,ConInfoTodblink *dblink, String *str,DistDefInfo *info, RepliDefInfo *info2,char *alias) { char port[8]; char *table = NULL; ereport(DEBUG2, (errmsg("writeRangeHeader select_no=%d",message->current_select))); sprintf(port,"%d",dblink->port); delay_string_append_char(message, str, "dblink("); delay_string_append_char(message, str, "'"); delay_string_append_char(message, str, "host="); delay_string_append_char(message, str, dblink->hostaddr); delay_string_append_char(message, str, " dbname="); delay_string_append_char(message, str, dblink->dbname); delay_string_append_char(message, str, " port="); delay_string_append_char(message, str, port); delay_string_append_char(message, str, " user="); delay_string_append_char(message, str, dblink->user); if(strlen(dblink->password)) { delay_string_append_char(message, str, " password="); delay_string_append_char(message, str, dblink->password); } delay_string_append_char(message, str, "'"); delay_string_append_char(message, str, ","); delay_string_append_char(message, str, "'"); if(info && !info2) { delay_string_append_char(message, str, "SELECT pool_parallel(\""); if(alias) table = alias; else table = info->table_name; } else if (!info && info2) { delay_string_append_char(message, str, "SELECT pool_loadbalance(\""); if(alias) table = alias; else table = info2->table_name; } { VirtualTable *virtual = NULL; int no = message->current_select; int v_colnum; int i; int first = 0; AnalyzeSelect *analyze = message->analyze[no]; virtual = analyze->virtual; v_colnum = virtual->col_num; delay_string_append_char(message, str, "SELECT "); if(table) { for(i = 0; i < v_colnum; i++) { if(!strcmp(virtual->table_list[i],table) && virtual->valid[i] != -1) { if(first == 0) { delay_string_append_char(message, str, virtual->table_list[i]); delay_string_append_char(message, str, "."); delay_string_append_char(message, str, virtual->col_list[i]); first = 1; } else { delay_string_append_char(message, str, ", "); delay_string_append_char(message, str, virtual->table_list[i]); delay_string_append_char(message, str, "."); delay_string_append_char(message, str, virtual->col_list[i]); } } } } if(first == 0) delay_string_append_char(message, str, " * "); delay_string_append_char(message, str, " FROM "); } } static void writeRangeFooter(RewriteQuery *message,ConInfoTodblink *dblink, String *str,DistDefInfo *info, RepliDefInfo *info2,char *alias) { int i,num; char *table = NULL; delay_string_append_char(message, str, "\""); delay_string_append_char(message, str, ")"); delay_string_append_char(message, str, "'"); delay_string_append_char(message, str, ",false)"); delay_string_append_char(message, str," AS "); if(alias) table = alias; else { if(info && !info2) { table = info->table_name; } else if (!info && info2) { table = info2->table_name; } } /* send one node */ if(!table) { message->r_code = SELECT_RELATION_ERROR; /* * since we are unable to get the table name so nothing much we can * do so bailout */ return; } delay_string_append_char(message, str, table); delay_string_append_char(message, str, "("); { VirtualTable *virtual = NULL; int first = 0; int no = message->current_select; AnalyzeSelect *analyze = message->analyze[no]; virtual = analyze->virtual; num = virtual->col_num; for(i = 0; i < num; i++) { char buf[16]; if(!strcmp(virtual->table_list[i],table) && virtual->valid[i] != -1) { if(first == 0) first = 1; else delay_string_append_char(message, str, ","); snprintf(buf, 16, "%d", analyze->virtual->column_no[i]); delay_string_append_char(message, str,"\"pool_c$"); delay_string_append_char(message, str,buf); delay_string_append_char(message, str, "\""); delay_string_append_char(message, str, " "); delay_string_append_char(message, str,virtual->type_list[i]); } } if(first == 0) { for(i = 0; i < num; i++) { char buf[16]; if(!strcmp(virtual->table_list[i],table)) { if(first == 0) first = 1; else delay_string_append_char(message, str, ","); snprintf(buf, 16, "%d", analyze->virtual->column_no[i]); delay_string_append_char(message, str,"\"pool_c$"); delay_string_append_char(message, str,buf); delay_string_append_char(message, str,"\""); delay_string_append_char(message, str, " "); delay_string_append_char(message, str,virtual->type_list[i]); } } } delay_string_append_char(message, str, ")"); } } static void writeSelectAggHeader(RewriteQuery *message,ConInfoTodblink *dblink, String *str,int state) { char port[8]; int count = message->current_select; AnalyzeSelect *analyze; Aggexpr *agg; int i; int ret_count = 0; analyze = message->analyze[count]; agg = analyze->aggexpr; ret_count = agg->t_num + agg->c_num + agg->h_num; sprintf(port,"%d",dblink->port); ereport(DEBUG2, (errmsg("writeSelectAggHeader select_no=%d state=%d",message->current_select,state))); delay_string_append_char(message, str, "dblink("); delay_string_append_char(message, str, "'"); delay_string_append_char(message, str, "host="); delay_string_append_char(message, str, dblink->hostaddr); delay_string_append_char(message, str, " dbname="); delay_string_append_char(message, str, dblink->dbname); delay_string_append_char(message, str, " port="); delay_string_append_char(message, str, port); delay_string_append_char(message, str, " user="); delay_string_append_char(message, str, dblink->user); if(strlen(dblink->password)) { delay_string_append_char(message, str, " password="); delay_string_append_char(message, str, dblink->password); } delay_string_append_char(message, str, "'"); delay_string_append_char(message, str, ","); delay_string_append_char(message, str, "'"); delay_string_append_char(message, str, "SELECT pool_parallel(\""); delay_string_append_char(message, str, "SELECT "); message->rewritelock = count; for(i = 0; i< agg->t_num; i++) { char *funcname = NULL; funcname = strVal(lfirst(list_head(agg->tfunc_p[i]->funcname))); if(strcmp(funcname,"avg")) { _rewriteFuncCall(NULL,message,NULL,str,agg->tfunc_p[i]); } else { AvgFuncCall(NULL,message,NULL,str,agg->tfunc_p[i]); } ret_count--; if(ret_count != 0) delay_string_append_char(message, str, ","); } for(i = 0; i< agg->c_num; i++) { _rewriteColumnRef(NULL,message,NULL,str,agg->col_p[i]); ret_count--; if(ret_count != 0) delay_string_append_char(message, str, ","); } for(i = 0; i< agg->h_num; i++) { char *funcname = NULL; funcname = strVal(lfirst(list_head(agg->hfunc_p[i]->funcname))); if(strcmp(funcname,"avg")) { _rewriteFuncCall(NULL,message,NULL,str,agg->hfunc_p[i]); } else { AvgFuncCall(NULL,message,NULL,str,agg->hfunc_p[i]); } ret_count--; if(ret_count != 0) delay_string_append_char(message, str, ","); } delay_string_append_char(message, str, " FROM "); } static void writeSelectHeader(RewriteQuery *message,ConInfoTodblink *dblink, String *str,int parallel,int state) { char port[8]; sprintf(port,"%d",dblink->port); ereport(DEBUG2, (errmsg("writeSelectHeader select_no=%d state=%d",message->current_select,state))); if(state == SELECT_START) { delay_string_append_char(message, str, "SELECT * FROM "); } delay_string_append_char(message, str, "dblink("); delay_string_append_char(message, str, "'"); delay_string_append_char(message, str, "host="); delay_string_append_char(message, str, dblink->hostaddr); delay_string_append_char(message, str, " dbname="); delay_string_append_char(message, str, dblink->dbname); delay_string_append_char(message, str, " port="); delay_string_append_char(message, str, port); delay_string_append_char(message, str, " user="); delay_string_append_char(message, str, dblink->user); if(strlen(dblink->password)) { delay_string_append_char(message, str, " password="); delay_string_append_char(message, str, dblink->password); } delay_string_append_char(message, str, "'"); delay_string_append_char(message, str, ","); delay_string_append_char(message, str, "'"); if(parallel) delay_string_append_char(message, str, "SELECT pool_parallel(\""); else delay_string_append_char(message, str, "SELECT pool_loadbalance(\""); if(state == SELECT_FROMCLAUSE) { int no = message->current_select; int v_colnum; int i; int first = 0; AnalyzeSelect *analyze = message->analyze[no]; v_colnum = analyze->virtual->col_num; delay_string_append_char(message, str, "SELECT "); for(i = 0; i < v_colnum; i++) { if(analyze->virtual->valid[i] != -1) { char *col_name = analyze->virtual->col_list[i]; if(first == 0) { if(strcmp(col_name,"\"?column?\"")) delay_string_append_char(message, str, col_name); else { delay_string_append_char(message, str, "\""); delay_string_append_char(message, str, col_name); delay_string_append_char(message, str, "\""); } first = 1; } else { delay_string_append_char(message, str, ", "); delay_string_append_char(message, str, analyze->virtual->table_list[i]); delay_string_append_char(message, str, "."); if(strcmp(col_name,"\"?column?\"")) delay_string_append_char(message, str, col_name); else { delay_string_append_char(message, str, "\""); delay_string_append_char(message, str, col_name); delay_string_append_char(message, str, "\""); } } } } if(first == 0) delay_string_append_char(message, str, " * "); delay_string_append_char(message, str, " FROM "); } } static char *estimateFuncTypes(AnalyzeSelect *analyze,FuncCall *func) { char *funcname = NULL; void *obj; char *type; obj = lfirst(list_head(func->args)); funcname = strVal(lfirst(list_head(func->funcname))); if(!strcmp(funcname,"max") || !strcmp(funcname,"min")) { if (obj && (IsA(obj, ColumnRef))) { char *table_name = NULL; char *column_name = NULL; VirtualTable *virtual = analyze->virtual; column_name = GetNameFromColumnRef((ColumnRef *) obj,true); table_name = GetNameFromColumnRef((ColumnRef *) obj ,false); type = search_type_from_virtual(virtual,table_name,column_name); return type; } else if( obj && (IsA(obj,TypeCast))) { TypeCast *typecast = (TypeCast *) obj; TypeName *typename = (TypeName *)typecast->typeName; type = strVal(lfirst(list_head(typename->names))); return type; } else { char *numeric = "numeric"; type = (char *) palloc(sizeof(char) * strlen(numeric) +1); strcpy(type,numeric); return type; } } else if(!strcmp(funcname,"sum")) { char *numeric = "numeric"; type = (char *) palloc(sizeof(char) * strlen(numeric) +1); strcpy(type,numeric); return type; } return "numeric"; } static void writeSelectAggFooter(RewriteQuery *message,String *str,AnalyzeSelect *analyze) { int count = message->current_select; Aggexpr *agg; int i; int ret_count = 0; int group_count = 0; analyze = message->analyze[count]; agg = analyze->aggexpr; ret_count = agg->t_num + agg->c_num + agg->h_num; group_count = agg->c_num; if(group_count != 0) { delay_string_append_char(message, str, " GROUP BY "); for(i = 0; i< agg->c_num; i++) { _rewriteColumnRef(NULL,message,NULL,str,agg->col_p[i]); group_count--; if(group_count != 0) delay_string_append_char(message, str, ","); } } delay_string_append_char(message, str, "\""); delay_string_append_char(message, str, ")"); delay_string_append_char(message, str, "'"); delay_string_append_char(message, str, ",false)"); delay_string_append_char(message, str," AS "); delay_string_append_char(message, str, analyze->table_name); /* symbol of aggregate opt */ delay_string_append_char(message, str,"g"); delay_string_append_char(message, str, " ("); message->rewritelock = -1; for(i = 0; i < ret_count; i++) { char buf[16]; snprintf(buf, 16, "%d", i); delay_string_append_char(message, str, "pool_g$"); delay_string_append_char(message, str, buf); delay_string_append_char(message, str, " "); if(i < agg->t_num) { char *funcname = NULL; funcname = strVal(lfirst(list_head(agg->tfunc_p[i]->funcname))); if(!strcmp(funcname,"count")) delay_string_append_char(message, str, "bigint "); else if(!strcmp(funcname,"avg")) { delay_string_append_char(message, str, "numeric "); delay_string_append_char(message, str, ","); delay_string_append_char(message, str, "pool_g$"); delay_string_append_char(message, str, buf); delay_string_append_char(message, str, "c"); delay_string_append_char(message, str, " "); delay_string_append_char(message, str, "bigint "); } else { char *type = estimateFuncTypes(analyze,agg->tfunc_p[i]); delay_string_append_char(message, str, type); } } else if(i >= agg->t_num && i < agg->t_num + agg->c_num) { char *table_name = NULL; char *column_name = NULL; char *type = NULL; VirtualTable *virtual = analyze->virtual; column_name = GetNameFromColumnRef(agg->col_p[i - agg->t_num],true); table_name = GetNameFromColumnRef(agg->col_p[i - agg->t_num],false); type = search_type_from_virtual(virtual,table_name,column_name); delay_string_append_char(message, str, type); } else if(i >= agg->t_num + agg->c_num) { char *funcname = NULL; int arg = i - agg->t_num - agg->c_num; funcname = strVal(lfirst(list_head(agg->hfunc_p[arg]->funcname))); if(!strcmp(funcname,"count")) delay_string_append_char(message, str, "bigint "); else if(!strcmp(funcname,"avg")) { delay_string_append_char(message, str, "numeric "); delay_string_append_char(message, str, ","); delay_string_append_char(message, str, "pool_g$"); delay_string_append_char(message, str, buf); delay_string_append_char(message, str, "c"); delay_string_append_char(message, str, " "); delay_string_append_char(message, str, "bigint "); } else { char *type = estimateFuncTypes(analyze,agg->hfunc_p[arg]); delay_string_append_char(message, str, type); } } if( i + 1 != ret_count) delay_string_append_char(message, str, ","); } delay_string_append_char(message, str, ") "); } static void writeSelectFooter(RewriteQuery *message,String *str,AnalyzeSelect *analyze,int state) { int i,num; delay_string_append_char(message, str, "\""); delay_string_append_char(message, str, ")"); delay_string_append_char(message, str, "'"); delay_string_append_char(message, str, ",false)"); delay_string_append_char(message, str," AS "); delay_string_append_char(message, str, analyze->table_name); delay_string_append_char(message, str, "("); ereport(DEBUG2, (errmsg("writeSelectFooter %s",analyze->table_name))); if(state != SELECT_FROMCLAUSE) { num = analyze->select_ret->col_num; for(i = 0; i < num; i++) { delay_string_append_char(message, str, analyze->select_ret->col_list[i]); delay_string_append_char(message, str, " "); delay_string_append_char(message, str, analyze->select_ret->type_list[i]); if (i != num -1) delay_string_append_char(message, str, ","); } delay_string_append_char(message, str, ")"); } else { int first = 0; num = analyze->virtual->col_num; for(i = 0; i < num; i++) { if(analyze->virtual->valid[i] != -1) { char buf[16]; if(first == 0) { snprintf(buf, 16, "%d", analyze->virtual->column_no[i]); delay_string_append_char(message, str, "\"pool_c$"); delay_string_append_char(message, str, buf); delay_string_append_char(message, str, "\""); delay_string_append_char(message, str, " "); delay_string_append_char(message, str, analyze->virtual->type_list[i]); first = 1; } else { delay_string_append_char(message, str, ","); snprintf(buf, 16, "%d", analyze->virtual->column_no[i]); delay_string_append_char(message, str, "\"pool_c$"); delay_string_append_char(message, str, buf); delay_string_append_char(message, str, "\""); delay_string_append_char(message, str, " "); delay_string_append_char(message, str, analyze->virtual->type_list[i]); } } } if(first == 0) { for(i = 0; i < num; i++) { if(first == 0) { delay_string_append_char(message, str, analyze->virtual->col_list[i]); delay_string_append_char(message, str, " "); delay_string_append_char(message, str, analyze->virtual->type_list[i]); first = 1; } else { delay_string_append_char(message, str, ","); delay_string_append_char(message, str, analyze->virtual->col_list[i]); delay_string_append_char(message, str, " "); delay_string_append_char(message, str, analyze->virtual->type_list[i]); } } } delay_string_append_char(message, str, ")"); } } static void CopyFromLeftArg(RewriteQuery *message,int current_num) { AnalyzeSelect *l_analyze = message->analyze[current_num + 1]; AnalyzeSelect *analyze = message->analyze[current_num]; VirtualTable *virtual = message->analyze[current_num]->virtual; int col_num; int i; char **col_list = NULL; char **type_list = NULL; char state; char *table_name; table_name = l_analyze->table_name; col_list = l_analyze->select_ret->col_list; type_list = l_analyze->select_ret->type_list; col_num = l_analyze->select_ret->col_num; state = l_analyze->state; append_virtual_table(message,virtual,col_list,type_list,col_num,table_name,state,current_num + 1); analyze->select_ret = (SelectDefInfo *) palloc(sizeof(SelectDefInfo)); analyze->select_ret->valid = false; analyze->select_ret->col_num = 0; for(i =0; iselect_ret,col_list[i],type_list[i]); } } static void ChangeStateByCluase(RewriteQuery *message,void *obj,int before, int after) { AnalyzeSelect *analyze; int count = message->current_select; if(message->r_code != SELECT_ANALYZE) return; analyze = message->analyze[count]; if (obj && analyze->partstate[before] == 'P') analyze->partstate[after] = 'S'; else analyze->partstate[after] = analyze->partstate[before]; } static void ChangeStateRewriteFooter(RewriteQuery *message,String *str,int defore, int after) { AnalyzeSelect *analyze; int count = message->current_select; char state; if(message->r_code != SELECT_DEFAULT) return; analyze = message->analyze[count]; if(analyze->state == 'S' && message->rewritelock == count && message->ignore_rewrite == -1) { state = analyze->partstate[defore]; if(state == 'L' || state == 'P') { if(state != analyze->partstate[after]) { writeSelectFooter(message,str,analyze,SELECT_FROMCLAUSE); message->rewritelock = -1; } } } } static bool CheckUnionFromClause(RewriteQuery *message) { int check; int count = message->current_select; AnalyzeSelect *analyze; analyze = message->analyze[count]; check = analyze->last_select; ereport(DEBUG2, (errmsg("CheckUnion select=%d last_select=%d", count,check))); if(check == -1) return false; else { if(message->analyze[check]->select_union && message->analyze[check]->call_part == SELECT_FROMCLAUSE) { ereport(DEBUG2, (errmsg("CheckUnion true"))); return true; } else return false; } } static void _rewriteSelectStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, SelectStmt *node) { BaseSelect = (Node *) node; AnalyzeSelect *analyze; int count; int target_analyze = 0; int from_analyze = 0; bool lock = false; bool direct = false; bool aggrewrite = false; count = message->analyze_num; /* Allocate Memory Space and initialize some Flags*/ initSelectStmt(message,node); if(message->r_code == SELECT_DEFAULT) { if(message->current_select == 0) ereport(DEBUG2, (errmsg("_rewriteSelectStmt:START QueryRewrite"))); } analyze = message->analyze[count]; analyze->part = SELECT_START; if(message->r_code == SELECT_DEFAULT && message->rewritelock == -1 && message->ignore_rewrite == -1) { #if 0 if(analyze->state == 'P') { if(analyze->call_part != SELECT_FROMCLAUSE || !CheckUnionFromClause(message)) { writeSelectHeader(message,dblink,str,PARALLEL,analyze->part); message->rewritelock = count; direct = true; } else lock =true; } #endif if(analyze->state == 'L') { if(analyze->call_part != SELECT_FROMCLAUSE && !CheckUnionFromClause(message)) { writeSelectHeader(message,dblink,str,LOADBALANCE,analyze->part); message->rewritelock = count; direct = true; } else lock =true; } } if (node->larg) /* SETOP */ { if(message->r_code == SELECT_ANALYZE) { char buf[16]; char *temp = "pool_t$"; analyze->virtual = (VirtualTable *) palloc(sizeof(VirtualTable)); snprintf(buf, 16, "%d", message->virtual_num); message->virtual_num++; analyze->table_name = (char *) palloc(sizeof(char) * (strlen(temp) + strlen(buf) + 1)); strcpy(analyze->table_name,temp); strcat(analyze->table_name,buf); analyze->virtual->col_num = 0; } delay_string_append_char(message, str, "("); message->part = SELECT_START; _rewriteNode(BaseSelect, message, dblink, str, node->larg); ereport(DEBUG2, (errmsg("union larg select_no=%d(%d)",count,message->analyze_num))); delay_string_append_char(message, str, ")"); KeepMessages(message,count,SELECT_START); /* COPY analyze of left arg */ if(message->r_code == SELECT_ANALYZE) { analyze->larg_count = count + 1; analyze->rarg_count = message->analyze_num; ereport(DEBUG2, (errmsg("_rewriteSelectStmt: COUNT larg=%d, rarg=%d",analyze->larg_count, analyze->rarg_count))); } switch (node->op) { case SETOP_UNION: delay_string_append_char(message, str, " UNION "); break; case SETOP_INTERSECT: delay_string_append_char(message, str, " INTERSECT "); break; case SETOP_EXCEPT: delay_string_append_char(message, str, " EXCEPT "); default: break; } if (node->all) delay_string_append_char(message, str, "ALL "); if (node->rarg) { delay_string_append_char(message, str, "("); message->part = SELECT_START; _rewriteNode(BaseSelect, message, dblink, str, node->rarg); delay_string_append_char(message, str, ")"); KeepMessages(message,count,SELECT_START); if(message->r_code == SELECT_ANALYZE) CopyFromLeftArg(message,count); } if(message->r_code == SELECT_ANALYZE) { ereport(DEBUG2, (errmsg("_rewriteSelectStmt: STATE larg=%c, rarg=%c", message->analyze[analyze->larg_count]->state, message->analyze[analyze->rarg_count]->state))); } if(message->r_code == SELECT_DEFAULT) { ereport(DEBUG2, (errmsg("_rewriteSelectStmt: DEFAULT COUNT larg=%d, rarg=%d",analyze->larg_count, analyze->rarg_count))); } if(message->r_code == SELECT_ANALYZE) { int lcount = analyze->larg_count; int rcount = analyze->rarg_count; if(message->analyze[lcount]->state == 'L' && message->analyze[rcount]->state == 'L') { int j; for(j = 0; j < SELECT_SORTCLAUSE; j++) { analyze->partstate[j]='L'; } } else { int j; for(j = 0; j < SELECT_SORTCLAUSE; j++) { analyze->partstate[j]='S'; } } } } else { if (node->intoClause) { IntoClause *into = node->intoClause; RangeVar *rel = (RangeVar *)into->rel; delay_string_append_char(message, str, "CREATE "); if (rel->relpersistence == true) delay_string_append_char(message, str, "TEMP "); delay_string_append_char(message, str, "TABLE "); _rewriteNode(BaseSelect, message, dblink, str, into->rel); KeepRewriteQueryReturnCode(message, SELECT_RELATION_ERROR); if (into->colNames) { delay_string_append_char(message, str, " ("); _rewriteNode(BaseSelect, message, dblink, str, into->colNames); delay_string_append_char(message, str, ") "); KeepRewriteQueryReturnCode(message, SELECT_RELATION_ERROR); } if (into->options) _rewriteWithDefinition(BaseSelect, message, dblink, str, into->options); switch (into->onCommit) { case ONCOMMIT_DROP: delay_string_append_char(message, str, " ON COMMIT DROP"); break; case ONCOMMIT_DELETE_ROWS: delay_string_append_char(message, str, " ON COMMIT DELETE ROWS"); break; case ONCOMMIT_PRESERVE_ROWS: delay_string_append_char(message, str, " ON COMMIT PRESERVE ROWS"); break; default: break; } delay_string_append_char(message, str, " AS"); } delay_string_append_char(message, str, " SELECT "); /* * Check from-clause before Checking target-list */ if(node->fromClause) { message->part = SELECT_FROMCLAUSE; analyze->part = SELECT_FROMCLAUSE; message->fromClause = true; if(message->r_code == SELECT_ANALYZE) { char buf[16]; char *temp = "pool_t$"; analyze->virtual = (VirtualTable *) palloc(sizeof(VirtualTable)); snprintf(buf, 16, "%d", message->virtual_num); message->virtual_num++; analyze->table_name = (char *) palloc(sizeof(char) * (strlen(temp) + strlen(buf) + 1)); strcpy(analyze->table_name,temp); strcat(analyze->table_name,buf); analyze->virtual->col_num = 0; } if(message->r_code == SELECT_DEFAULT && message->ignore_rewrite == -1) message->ignore_rewrite = count; /* remember analyze_num */ from_analyze = message->analyze_num; _rewriteNode(BaseSelect, message, dblink, str, node->fromClause); if(message->r_code == SELECT_DEFAULT && message->ignore_rewrite == count) message->ignore_rewrite = -1; message->fromClause = false; if(message->r_code == SELECT_ANALYZE) { message->table_state = analyze->state; analyze->partstate[SELECT_FROMCLAUSE] = analyze->state; } } else { /* this is const or function call*/ message->part = SELECT_TARGETLIST; if(message->r_code == SELECT_ANALYZE) build_range_info(message,NULL,NULL,NULL,NULL,message->current_select,-1); } message->part = SELECT_OTHER; analyze->part = SELECT_OTHER; if (message->r_code == SELECT_ANALYZE && node->groupClause) { analyze->aggregate = true; } if (node->distinctClause) { if(message->r_code == SELECT_ANALYZE) analyze->partstate[SELECT_TARGETLIST] = 'S'; #if 0 /* TODO * DISTINCT optimization */ if(message->r_code == SELECT_ANALYZE) analyze->aggregate = true; #endif delay_string_append_char(message, str, "DISTINCT "); if (lfirst(list_head(node->distinctClause)) != NIL) { delay_string_append_char(message, str, "ON ("); _rewriteNode(BaseSelect, message, dblink,str, node->distinctClause); KeepMessages(message,count,SELECT_OTHER); delay_string_append_char(message, str, ") "); } } message->part = SELECT_TARGETLIST; analyze->part = SELECT_TARGETLIST; if(analyze->partstate[SELECT_FROMCLAUSE] == 'P' && analyze->aggregate) analyze->partstate[SELECT_TARGETLIST] = 'S'; /* TARGETLIST START */ _rewriteNode(BaseSelect, message, dblink, str, node->targetList); aggrewrite = CheckAggOpt(message); target_analyze = message->analyze_num; if(message->r_code == SELECT_ANALYZE) { if (analyze->aggregate && (analyze->partstate[SELECT_FROMCLAUSE] == 'P' || analyze->partstate[SELECT_TARGETLIST] == 'P')) analyze->partstate[SELECT_TARGETLIST] = 'S'; else if (!analyze->partstate[SELECT_TARGETLIST]) analyze->partstate[SELECT_TARGETLIST] = analyze->partstate[SELECT_FROMCLAUSE]; } KeepMessages(message,count,SELECT_TARGETLIST); if (node->fromClause && message->r_code != SELECT_ANALYZE) { message->analyze_num = from_analyze; message->part = SELECT_FROMCLAUSE; analyze->part = SELECT_FROMCLAUSE; delay_string_append_char(message, str, " FROM "); if(message->r_code == SELECT_DEFAULT && (analyze->state == 'S' || lock) && message->rewritelock == -1 && message->ignore_rewrite ==-1) { if(analyze->partstate[SELECT_FROMCLAUSE] == 'L') { writeSelectHeader(message,dblink,str,LOADBALANCE, message->part); message->rewritelock = count; } else if(analyze->partstate[SELECT_FROMCLAUSE] == 'P') { if(aggrewrite) { writeSelectAggHeader(message,dblink,str, message->part); } else { writeSelectHeader(message,dblink,str,PARALLEL, message->part); } message->rewritelock = count; } } message->fromClause = true; _rewriteNode(BaseSelect, message, dblink, str, node->fromClause); message->fromClause = false; KeepMessages(message,count,SELECT_FROMCLAUSE); if(message->r_code == SELECT_DEFAULT && analyze->state == 'S' && message->rewritelock == count && message->ignore_rewrite == -1) { if(analyze->partstate[SELECT_FROMCLAUSE] == 'L') { if(analyze->partstate[SELECT_WHERECLAUSE] != 'L') { if(node->whereClause) { int message_code = message->r_code; delay_string_append_char(message, str, " WHERE "); CheckWhereCaluse(node->whereClause, message,dblink,str,0); KeepRewriteQueryReturnCode(message, message_code); } writeSelectFooter(message,str,analyze,SELECT_FROMCLAUSE); message->rewritelock = -1; } } else if(analyze->partstate[SELECT_FROMCLAUSE] == 'P') { if(analyze->partstate[SELECT_WHERECLAUSE] != 'P') { if(node->whereClause) { int message_code = message->r_code; delay_string_append_char(message, str, " WHERE "); CheckWhereCaluse(node->whereClause, message,dblink,str,0); KeepRewriteQueryReturnCode(message, message_code); } writeSelectFooter(message,str,analyze,SELECT_FROMCLAUSE); message->rewritelock = -1; } } } message->analyze_num = target_analyze; } /* WHERE CLAUSE */ message->part = SELECT_OTHER; if (node->whereClause) BaseSelect = NULL; if (node->whereClause) { message->part = SELECT_WHERECLAUSE; analyze->part = SELECT_WHERECLAUSE; delay_string_append_char(message, str, " WHERE "); _rewriteNode(BaseSelect, message, dblink, str, node->whereClause); KeepMessages(message,count,SELECT_OTHER); } if(!analyze->partstate[SELECT_WHERECLAUSE] && message->r_code == SELECT_ANALYZE) analyze->partstate[SELECT_WHERECLAUSE] = analyze->partstate[SELECT_FROMCLAUSE]; if(aggrewrite) writeSelectAggFooter(message,str,analyze); else ChangeStateRewriteFooter(message,str,SELECT_WHERECLAUSE, SELECT_GROUPBYCLAUSE); /* GROUPBY CLAUSE */ if (node->groupClause) { analyze->part = SELECT_GROUPBYCLAUSE; delay_string_append_char(message, str, " GROUP BY "); _rewriteNode(BaseSelect, message, dblink, str, node->groupClause); KeepMessages(message,count,SELECT_OTHER); } ChangeStateByCluase(message,node->groupClause,SELECT_WHERECLAUSE,SELECT_GROUPBYCLAUSE); /* HAVING CLAUSE */ if (node->havingClause) { analyze->part = SELECT_HAVINGCLAUSE; delay_string_append_char(message, str, " HAVING "); _rewriteNode(BaseSelect, message, dblink, str, node->havingClause); KeepMessages(message,count,SELECT_OTHER); } if(message->r_code == SELECT_ANALYZE) analyze->partstate[SELECT_HAVINGCLAUSE] = analyze->partstate[SELECT_GROUPBYCLAUSE]; } ChangeStateRewriteFooter(message,str,SELECT_HAVINGCLAUSE, SELECT_SORTCLAUSE); if (node->sortClause) { analyze->part = SELECT_SORTCLAUSE; delay_string_append_char(message, str, " ORDER BY "); _rewriteNode(BaseSelect, message, dblink, str, node->sortClause); KeepMessages(message,count,SELECT_OTHER); } ChangeStateByCluase(message,node->sortClause,SELECT_HAVINGCLAUSE,SELECT_SORTCLAUSE); ChangeStateRewriteFooter(message,str, SELECT_SORTCLAUSE, SELECT_OFFSETCLAUSE); if (node->limitOffset) { analyze->part = SELECT_OFFSETCLAUSE; delay_string_append_char(message, str, " OFFSET "); _rewriteNode(BaseSelect, message, dblink, str, node->limitOffset); KeepMessages(message,count,SELECT_OTHER); } ChangeStateByCluase(message,node->limitOffset,SELECT_SORTCLAUSE,SELECT_OFFSETCLAUSE); ChangeStateRewriteFooter(message,str,SELECT_OFFSETCLAUSE,SELECT_LIMITCLAUSE); if (node->limitCount) { analyze->part = SELECT_LIMITCLAUSE; delay_string_append_char(message, str, " LIMIT "); if (IsA(node->limitCount, A_Const) && ((A_Const *)node->limitCount)->val.type == T_Null) { delay_string_append_char(message, str, "ALL "); } else { _rewriteNode(BaseSelect, message, dblink, str, node->limitCount); KeepMessages(message,count,SELECT_OTHER); } } ChangeStateByCluase(message,node->limitCount,SELECT_OFFSETCLAUSE,SELECT_LIMITCLAUSE); if(message->r_code == SELECT_ANALYZE) { int i; analyze->state = analyze->partstate[SELECT_LIMITCLAUSE]; for(i = 0; i< 8; i++) { char s = analyze->partstate[i]; if(s == 'S') { analyze->state = s; break; } } } _rewriteNode(BaseSelect, message, dblink, str, node->lockingClause); KeepMessages(message,count,SELECT_OTHER); if(message->r_code == SELECT_ANALYZE) { if(node->targetList) AnalyzeReturnRecord(BaseSelect,message,dblink,str,node->targetList); ereport(DEBUG2, (errmsg("_rewriteSelectStmt select_no=%d state=%s",message->current_select,analyze->partstate))); if(strstr(analyze->partstate,"E")) message->is_loadbalance = true; /* change state */ if(count != 0) { AnalyzeSelect *last = message->analyze[analyze->last_select]; if(last->part == SELECT_WHERECLAUSE) { char fromstate = last->partstate[SELECT_FROMCLAUSE]; char wherestate = (char) 0; if(last->partstate[SELECT_WHERECLAUSE]) wherestate = last->partstate[SELECT_WHERECLAUSE]; if(fromstate == 'P' && analyze->state == 'L') { if(wherestate && wherestate == 'P') last->partstate[SELECT_WHERECLAUSE] = 'P'; } else if(fromstate == 'L' && analyze->state == 'L') { last->partstate[SELECT_WHERECLAUSE] = 'L'; } else last->partstate[SELECT_WHERECLAUSE] = 'S'; } if(last->part == SELECT_TARGETLIST) { char fromstate = last->partstate[SELECT_FROMCLAUSE]; if(fromstate == 'P' && analyze->state == 'L') { last->partstate[SELECT_TARGETLIST] = 'P'; } else if(fromstate == 'L' && analyze->state == 'L') { last->partstate[SELECT_TARGETLIST] = 'L'; } else last->partstate[SELECT_TARGETLIST] = 'S'; } } } if(message->r_code == SELECT_DEFAULT && message->rewritelock == count && message->ignore_rewrite ==-1 ) { if(direct) writeSelectFooter(message,str,analyze,analyze->call_part); else writeSelectFooter(message,str,analyze,SELECT_FROMCLAUSE); message->rewritelock = -1; } } static void initAggexpr(AnalyzeSelect *analyze) { Aggexpr *agg; if(analyze->aggexpr) return; analyze->aggexpr = (Aggexpr *) palloc(sizeof(Aggexpr)); agg = analyze->aggexpr; agg->usec_p = NULL; agg->tfunc_p = NULL; agg->col_p = NULL; agg->hfunc_p = NULL; agg->umapc = NULL; agg->u_num = 0; agg->t_num = 0; agg->c_num = 0; agg->h_num = 0; agg->hc_num = 0; agg->s_num = 0; agg->sc_num = 0; agg->opt = true; } static int FuncChangebyAggregate(AnalyzeSelect *analyze, FuncCall *fnode) { Aggexpr *agg; int i; if(analyze->aggregate && analyze->aggexpr) agg = analyze->aggexpr; else return -1; if(!agg->opt) return -1; if(analyze->part == SELECT_TARGETLIST) { for(i = 0; i < agg->t_num; i++) { if(fnode == agg->tfunc_p[i]) { return i; } } } else if(analyze->part == SELECT_HAVINGCLAUSE) { for(i = 0; i < agg->h_num; i++) { if(fnode == agg->hfunc_p[i]) { return i; } } } else if(analyze->part == SELECT_SORTCLAUSE) { String *sortfunc; sortfunc = init_string(""); _outNode(sortfunc, fnode); for(i = 0; i < agg->t_num; i++) { String *having; having = init_string(""); _outNode(having, agg->tfunc_p[i]); if(!strcmp(sortfunc->data,having->data)) { free_string(having); free_string(sortfunc); return i; } else { free_string(having); } } free_string(sortfunc); } return -1; } static int ColumnChangebyAggregate(AnalyzeSelect *analyze,ColumnRef *cnode) { Aggexpr *agg; int i; if(analyze->aggregate && analyze->aggexpr) agg = analyze->aggexpr; else return -1; if(!agg->opt) return -1; if(analyze->part == SELECT_GROUPBYCLAUSE) { for(i = 0; i < agg->c_num; i++) { if(cnode == agg->col_p[i]) { return agg->t_num + i; } } } else if(analyze->part == SELECT_TARGETLIST) { for(i = 0; i < agg->u_num; i++) { char *n_c = NULL; char *n_t = NULL; char *c_c = NULL; char *c_t = NULL; n_c = GetNameFromColumnRef(cnode,true); n_t = GetNameFromColumnRef(cnode,false); c_c = GetNameFromColumnRef(agg->usec_p[i],true); c_t = GetNameFromColumnRef(agg->usec_p[i],false); if(n_t && c_t) { if(!strcmp(n_t,c_t) && !strcmp(n_c,c_c)) return agg->t_num + agg->umapc[i]; } else { if(!strcmp(n_c,c_c)) return agg->t_num + agg->umapc[i]; } } } else if(analyze->part == SELECT_HAVINGCLAUSE || analyze->part == SELECT_SORTCLAUSE) { for(i = 0; i < agg->c_num; i++) { char *n_c = NULL; char *n_t = NULL; char *c_c = NULL; char *c_t = NULL; n_c = GetNameFromColumnRef(cnode,true); n_t = GetNameFromColumnRef(cnode,false); c_c = GetNameFromColumnRef(agg->col_p[i],true); c_t = GetNameFromColumnRef(agg->col_p[i],false); if(n_t && c_t) { if(!strcmp(n_t,c_t) && !strcmp(n_c,c_c)) return agg->t_num + i; } else { if(!strcmp(n_c,c_c)) return agg->t_num + i; } } } return -1; } static void AppendAggregate(AnalyzeSelect *analyze,FuncCall *fnode,ColumnRef *cnode) { Aggexpr *agg; initAggexpr(analyze); agg = analyze->aggexpr; if(analyze->part == SELECT_GROUPBYCLAUSE) { if(!agg->col_p) { agg->col_p = (ColumnRef **) palloc(sizeof(ColumnRef *)); } else { agg->col_p = (ColumnRef **) repalloc(agg->col_p,(agg->c_num + 1) *sizeof(ColumnRef *)); } agg->col_p[agg->c_num] = cnode; SeekColumnName(agg,cnode,SELECT_GROUPBYCLAUSE); agg->c_num++; } else if(analyze->part == SELECT_TARGETLIST) { if(fnode) /* for function */ { if(!agg->tfunc_p) { agg->tfunc_p = (FuncCall **) palloc(sizeof(FuncCall *)); } else { agg->tfunc_p = (FuncCall **) repalloc(agg->tfunc_p,(agg->t_num + 1) *sizeof(FuncCall *)); } agg->tfunc_p[agg->t_num] = fnode; agg->t_num++; } else { /* for Column */ if(!agg->usec_p) { agg->usec_p = (ColumnRef **) palloc(sizeof(ColumnRef *)); agg->umapc = (int *) palloc(sizeof(int)); } else { agg->usec_p = (ColumnRef **) repalloc(agg->usec_p,(agg->u_num + 1) *sizeof(ColumnRef *)); agg->umapc = (int *) repalloc(agg->umapc,(agg->u_num + 1) *sizeof(int)); } agg->usec_p[agg->u_num] = cnode; agg->u_num++; } } else if(analyze->part == SELECT_HAVINGCLAUSE) { if(fnode) /* for function */ { if(!agg->hfunc_p) { agg->hfunc_p = (FuncCall **) palloc(sizeof(FuncCall *)); } else { agg->hfunc_p = (FuncCall **) repalloc(agg->hfunc_p,(agg->h_num + 1) *sizeof(FuncCall *)); } agg->hfunc_p[agg->h_num] = fnode; agg->h_num++; } } } static void _rewriteFuncCall(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, FuncCall *node) { char *funcname; bool avg_flag = false; if(message->r_code == SELECT_AEXPR) { KeepRewriteQueryReturnCode(message, SELECT_AEXPR_FALSE); return; } funcname = strVal(lfirst(list_head(node->funcname))); if (CheckAggOpt(message)) { int i; AnalyzeSelect *analyze; int no = message->current_select; analyze = message->analyze[no]; i = FuncChangebyAggregate(analyze,node); if(i != -1) { if(!strcmp(funcname,"count")) delay_string_append_char(message, str, "sum"); else if(!strcmp(funcname,"avg")) { delay_string_append_char(message, str, "(sum"); avg_flag =true; } else _rewriteFuncName(BaseSelect, message, dblink, str, node->funcname); } else _rewriteFuncName(BaseSelect, message, dblink, str, node->funcname); } else _rewriteFuncName(BaseSelect, message, dblink, str, node->funcname); if(message->r_code == SELECT_ANALYZE && funcname) { /* aggregate functions */ if(!strcmp(funcname,"count") || !strcmp(funcname,"max") || !strcmp(funcname,"min") || !strcmp(funcname,"sum") || !strcmp(funcname,"avg") || !strcmp(funcname,"bit_and") || !strcmp(funcname,"bit_or") || !strcmp(funcname,"bool_and") || !strcmp(funcname,"bool_or") || !strcmp(funcname,"every") || !strcmp(funcname,"corr") || !strcmp(funcname,"covar_pop") || !strcmp(funcname,"covar_samp") || !strcmp(funcname,"regr_avgx") || !strcmp(funcname,"regr_avgy") || !strcmp(funcname,"regr_count") || !strcmp(funcname,"regr_intercept") || !strcmp(funcname,"regr_r2") || !strcmp(funcname,"regr_slope") || !strcmp(funcname,"regr_sxx") || !strcmp(funcname,"regr_sxy") || !strcmp(funcname,"regr_syy") || !strcmp(funcname,"stddev") || !strcmp(funcname,"stddev_pop") || !strcmp(funcname,"stddev_samp") || !strcmp(funcname,"variance") || !strcmp(funcname,"var_pop") || !strcmp(funcname,"var_samp")) { AnalyzeSelect *analyze; int no = message->current_select; analyze = message->analyze[no]; analyze->aggregate = true; if(analyze->part == SELECT_TARGETLIST || analyze->part == SELECT_HAVINGCLAUSE) { if(!strcmp(funcname,"count") || !strcmp(funcname,"max") || !strcmp(funcname,"min") || !strcmp(funcname,"sum") || !strcmp(funcname,"avg")) { AppendAggregate(analyze,node,NULL); } else { initAggexpr(analyze); analyze->aggexpr->opt = false; } } } } if(funcname && (strcmp(funcname,"user") == 0 || strcmp(funcname,"current_user") == 0 || strcmp(funcname,"session_user") == 0 || strcmp(funcname,"current_role") == 0)) return ; delay_string_append_char(message, str, "("); if (node->func_variadic == TRUE) delay_string_append_char(message, str, "VARIADIC "); if (node->agg_distinct == TRUE) delay_string_append_char(message, str, "DISTINCT "); if (CheckAggOpt(message)) { int i; AnalyzeSelect *analyze; int no = message->current_select; analyze = message->analyze[no]; i = FuncChangebyAggregate(analyze,node); if(i != -1) { char buf[16]; snprintf(buf, 16, "%d", i); delay_string_append_char(message, str, "pool_g$"); delay_string_append_char(message, str, buf); ereport(DEBUG2, (errmsg("_FuncCall: aggregate no = %d",i))); delay_string_append_char(message, str, ")"); if(avg_flag) { delay_string_append_char(message, str, "/"); delay_string_append_char(message, str, "sum("); delay_string_append_char(message, str, "pool_g$"); delay_string_append_char(message, str, buf); delay_string_append_char(message, str, "c"); delay_string_append_char(message, str, "))"); } return ; } } if (node->agg_star == TRUE) delay_string_append_char(message, str, "*"); else _rewriteNode(BaseSelect, message, dblink, str, node->args); if (node->agg_order != NIL) { delay_string_append_char(message, str, " ORDER BY "); _rewriteNode(BaseSelect, message, dblink, str, node->agg_order); } delay_string_append_char(message, str, ")"); } static void AvgFuncCall(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, FuncCall *node) { if(message->r_code == SELECT_AEXPR) { KeepRewriteQueryReturnCode(message, SELECT_AEXPR_FALSE); return; } delay_string_append_char(message, str, "sum"); delay_string_append_char(message, str, "("); if (node->agg_distinct == TRUE) delay_string_append_char(message, str, "DISTINCT "); _rewriteNode(BaseSelect, message, dblink, str, node->args); delay_string_append_char(message, str, ")"); delay_string_append_char(message, str, ","); delay_string_append_char(message, str, "count"); delay_string_append_char(message, str, "("); if (node->agg_distinct == TRUE) delay_string_append_char(message, str, "DISTINCT "); _rewriteNode(BaseSelect, message, dblink, str, node->args); delay_string_append_char(message, str, ")"); } static void _rewriteDefElem(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, DefElem *node) { } static void _rewriteLockingClause(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, LockingClause *node) { if (node == NULL) return; switch(node->strength) { case LCS_FORKEYSHARE: delay_string_append_char(message, str, " FOR KEY SHARE"); break; case LCS_FORSHARE: delay_string_append_char(message, str, " FOR SHARE"); break; case LCS_FORNOKEYUPDATE: delay_string_append_char(message, str, " FOR NO KEY UPDATE"); break; case LCS_FORUPDATE: delay_string_append_char(message, str, " FOR UPDATE"); break; } _rewriteNode(BaseSelect, message, dblink, str, node->lockedRels); if (node->noWait == TRUE) delay_string_append_char(message, str, " NOWAIT "); } static void _rewriteColumnDef(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, ColumnDef *node) { delay_string_append_char(message, str, "\""); delay_string_append_char(message, str, node->colname); delay_string_append_char(message, str, "\" "); _rewriteNode(BaseSelect, message, dblink, str, node->typeName); _rewriteNode(BaseSelect, message, dblink, str, node->constraints); } static void _rewriteTypeName(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, TypeName *node) { if (list_length(node->names) == 2 && strcmp("pg_catalog", strVal(linitial(node->names))) == 0) { delay_string_append_char(message, str, strVal(lsecond(node->names))); if (strcmp("interval", strVal(lsecond(node->names))) == 0) { if (node->typmods != NIL) { A_Const *v = (A_Const *) linitial(node->typmods); int mask = v->val.val.ival; /* precision for SECOND field. * backword comaptibility. * use `'1.2 second'::interval(0) second' * not `'1.2 second'::interval second(0)'(standarad for 8.4). */ if ((INTERVAL_MASK(SECOND) & mask) && list_length(node->typmods) == 2) { delay_string_append_char(message, str, "("); _rewriteAConst(BaseSelect, message, dblink, str, lsecond(node->typmods)); delay_string_append_char(message, str, ")"); } /* optional fields */ if (mask == INTERVAL_MASK(YEAR)) delay_string_append_char(message, str, " YEAR"); else if (mask == INTERVAL_MASK(MONTH)) delay_string_append_char(message, str, " MONTH"); else if (mask == INTERVAL_MASK(DAY)) delay_string_append_char(message, str, " DAY"); else if (mask == INTERVAL_MASK(HOUR)) delay_string_append_char(message, str, " HOUR"); else if (mask == INTERVAL_MASK(MINUTE)) delay_string_append_char(message, str, " MINUTE"); else if (mask == INTERVAL_MASK(SECOND)) delay_string_append_char(message, str, " SECOND"); else if (mask == (INTERVAL_MASK(YEAR) | INTERVAL_MASK(MONTH))) delay_string_append_char(message, str, " YEAR TO MONTH"); else if (mask == (INTERVAL_MASK(DAY) | INTERVAL_MASK(HOUR))) delay_string_append_char(message, str, " DAY TO HOUR"); else if (mask == (INTERVAL_MASK(DAY) | INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE))) delay_string_append_char(message, str, " DAY TO MINUTE"); else if (mask == (INTERVAL_MASK(DAY) | INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE) | INTERVAL_MASK(SECOND))) delay_string_append_char(message, str, " DAY TO SECOND"); else if (mask == (INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE))) delay_string_append_char(message, str, " HOUR TO MINUTE"); else if (mask == (INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE) | INTERVAL_MASK(SECOND))) delay_string_append_char(message, str, " HOUR TO SECOND"); else if (mask == (INTERVAL_MASK(MINUTE) | INTERVAL_MASK(SECOND))) delay_string_append_char(message, str, " MINUTE TO SECOND"); } return; } } else { ListCell *lc; char dot = 0; foreach (lc, node->names) { Value *v = (Value *) lfirst(lc); char *typename = v->val.str; if (dot == 0) dot = 1; else delay_string_append_char(message, str, "."); if(node->typemod < 0) { if(message->rewritelock != -1) { delay_string_append_char(message, str, "\"\""); delay_string_append_char(message, str, typename); delay_string_append_char(message, str, "\"\""); } else { delay_string_append_char(message, str, typename); } } else { delay_string_append_char(message, str, typename); } } } /* precisions */ if (node->typmods) { delay_string_append_char(message, str, "("); _rewriteList(BaseSelect, message, dblink, str, node->typmods); delay_string_append_char(message, str, ")"); } } static void _rewriteTypeCast(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, TypeCast *node) { _rewriteNode(BaseSelect, message, dblink, str, node->arg); delay_string_append_char(message, str, "::"); _rewriteNode(BaseSelect, message, dblink, str, node->typeName); } static void _rewriteIndexElem(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, IndexElem *node) { if (node->name) { delay_string_append_char(message, str, "\""); delay_string_append_char(message, str, node->name); delay_string_append_char(message, str, "\""); if (node->opclass != NIL) _rewriteNode(BaseSelect, message, dblink, str, node->opclass); } else { delay_string_append_char(message, str, "("); _rewriteNode(BaseSelect, message, dblink, str, node->expr); delay_string_append_char(message, str, ")"); if (node->opclass != NIL) _rewriteNode(BaseSelect, message, dblink, str, node->opclass); } } static void _rewriteSortGroupClause(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, SortGroupClause *node) { } static void _rewriteWindowClause(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, WindowClause *node) { } static void _rewriteSetOperationStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, SetOperationStmt *node) { } static void _rewriteAExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, A_Expr *node) { Value *v; switch (node->kind) { case AEXPR_OP: if (list_length(node->name) == 1) { Value *op = (Value *) lfirst(list_head(node->name)); delay_string_append_char(message, str, " ("); _rewriteNode(BaseSelect, message, dblink, str, node->lexpr); delay_string_append_char(message, str, op->val.str); _rewriteNode(BaseSelect, message, dblink, str, node->rexpr); delay_string_append_char(message, str, " )"); } break; case AEXPR_AND: delay_string_append_char(message, str, " ("); _rewriteNode(BaseSelect, message, dblink, str, node->lexpr); delay_string_append_char(message, str, " AND "); _rewriteNode(BaseSelect, message, dblink, str, node->rexpr); delay_string_append_char(message, str, ")"); break; case AEXPR_OR: delay_string_append_char(message, str, " ("); _rewriteNode(BaseSelect, message, dblink, str, node->lexpr); delay_string_append_char(message, str, " OR "); _rewriteNode(BaseSelect, message, dblink, str, node->rexpr); delay_string_append_char(message, str, ")"); break; case AEXPR_NOT: delay_string_append_char(message, str, " (NOT "); _rewriteNode(BaseSelect, message, dblink, str, node->rexpr); delay_string_append_char(message, str, ")"); break; case AEXPR_OP_ANY: _rewriteNode(BaseSelect,message,dblink,str, node->lexpr); v = linitial(node->name); delay_string_append_char(message,str, v->val.str); delay_string_append_char(message,str, "ANY("); _rewriteNode(BaseSelect,message,dblink,str, node->rexpr); delay_string_append_char(message,str, ")"); break; case AEXPR_OP_ALL: _rewriteNode(BaseSelect,message,dblink,str, node->lexpr); v = linitial(node->name); delay_string_append_char(message,str, v->val.str); delay_string_append_char(message,str, "ALL("); _rewriteNode(BaseSelect,message,dblink,str, node->rexpr); delay_string_append_char(message,str, ")"); break; case AEXPR_DISTINCT: delay_string_append_char(message, str, " ("); _rewriteNode(BaseSelect, message, dblink, str, node->lexpr); delay_string_append_char(message, str, " IS DISTINCT FROM "); _rewriteNode(BaseSelect, message, dblink, str, node->rexpr); delay_string_append_char(message, str, ")"); break; case AEXPR_NULLIF: delay_string_append_char(message, str, " NULLIF("); _rewriteNode(BaseSelect, message, dblink, str, node->lexpr); delay_string_append_char(message, str, ", "); _rewriteNode(BaseSelect, message, dblink, str, node->rexpr); delay_string_append_char(message, str, ")"); break; case AEXPR_OF: _rewriteNode(BaseSelect, message, dblink, str, node->lexpr); v = linitial(node->name); if (v->val.str[0] == '!') delay_string_append_char(message, str, " IS NOT OF ("); else delay_string_append_char(message, str, " IS OF ("); _rewriteNode(BaseSelect, message, dblink, str, node->rexpr); delay_string_append_char(message, str, ")"); break; case AEXPR_IN: _rewriteNode(BaseSelect,message,dblink,str, node->lexpr); v = (Value *)lfirst(list_head(node->name)); if (v->val.str[0] == '=') delay_string_append_char(message,str, " IN ("); else delay_string_append_char(message,str, " NOT IN ("); _rewriteNode(BaseSelect,message,dblink,str, node->rexpr); delay_string_append_char(message,str, ")"); break; default: break; } } static void _rewriteValue(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, Value *value) { char buf[16]; switch (value->type) { case T_Integer: sprintf(buf, "%ld", value->val.ival); delay_string_append_char(message, str, buf); break; case T_Float: delay_string_append_char(message, str, value->val.str); break; case T_String: /* delay_string_append_char(message, str, "'"); */ delay_string_append_char(message, str, escape_string(value->val.str)); /* delay_string_append_char(message, str, "'"); */ break; case T_Null: delay_string_append_char(message, str, "NULL"); break; default: break; } } static char GetInnerRef(RewriteQuery *message,int last,char *table_name,char *column,char state) { AnalyzeSelect *analyze; VirtualTable *virtual; int num, i; bool get = false; analyze = message->analyze[last]; virtual = analyze->virtual; num = virtual->col_num; for(i=0; i < num; i++) { char *vcol = virtual->col_list[i]; char *vtable = virtual->table_list[i]; if(table_name && !strcmp(table_name,vtable) && !strcmp(column,vcol)) { ereport(DEBUG2, (errmsg("GetInnerRef state = %c now select(%d), table_name=(%s), col_name=(%s) detect",state,last,vtable,vcol))); get = true; break; } else if(!table_name && !strcmp(column,vcol)) { ereport(DEBUG2, (errmsg("GetInnerRef state = %c now select(%d), table_name=(%s), col_name=(%s) detect",state,last,vtable,vcol))); get = true; break; } } if(get) return state; else { /* there isn't the inner refarence at parallel part */ if(state == 'P' || analyze->partstate[SELECT_FROMCLAUSE] =='P') return 'S'; if(last == 0) return 'E'; else return GetInnerRef(message,analyze->last_select,table_name,column,state); } } static void ChangeStatebyColumnRef(RewriteQuery *message,ColumnRef *col) { AnalyzeSelect *analyze; ListCell *c; List *list; char first = 0; char *table_name = NULL; char *column = NULL; int no; list = col->fields; no = message->current_select; analyze = message->analyze[no]; if(list->length > 2 || list->length == 0) { /* Is this error ? */ message->analyze[no]->state = 'S'; return; } foreach (c, col->fields) { Node *n = (Node *) lfirst(c); if (IsA(n, String)) { Value *v = (Value *) lfirst(c); if(list->length == 2 && first == 0) { first = 1; table_name = v->val.str; } else column = v->val.str; } } if(!column) { message->table_state = 'S'; return; } ereport(DEBUG2, (errmsg("ChangeStatebyColumnRef %s now(%d),last(%d) part(%d) call_part(%d)", column, analyze->now_select, analyze->last_select, analyze->part, analyze->call_part ))); if(message->part==SELECT_WHERECLAUSE || message->part == SELECT_TARGETLIST) { if(analyze->partstate[message->part] != 'S') { analyze->partstate[message->part] = GetInnerRef(message,no,table_name,column,analyze->partstate[SELECT_FROMCLAUSE]); ereport(DEBUG2, (errmsg("return state is %c",analyze->partstate[message->part]))); } } } static bool DetectValidColumn(RewriteQuery *message,char *table_name,char *column_name,int no, int call) { AnalyzeSelect *analyze; VirtualTable *virtual; int v_num,i; int get = 0; int call_num; bool star = false; call_num = message->current_select; if(call != -1 && no != call_num && call == SELECT_FROMCLAUSE) { int last = message->analyze[no]->last_select; int call_part = message->analyze[no]->call_part; if(last == -1) { return false; } else { return DetectValidColumn(message,table_name,column_name,last,call_part); } } analyze = message->analyze[no]; virtual = analyze->virtual; v_num = virtual->col_num; for(i = 0; i< v_num; i++) { char *vcol = virtual->col_list[i]; char *vtable = virtual->table_list[i]; if(table_name && !strcmp(table_name,vtable) && !strcmp(column_name,"*")) { virtual->valid[i] = message->current_select; star = true; } else if (!table_name && !strcmp(column_name,"*")) { virtual->valid[i] = message->current_select; star = true; } if(table_name && !strcmp(table_name,vtable) && !strcmp(column_name,vcol)) { ereport(DEBUG2, (errmsg("DetectValidColumn no = %d, table_name=(%s), col_name=(%s) detect",no, vtable, vcol))); get++; if(virtual->valid[i] == -1) { virtual->valid[i] = message->current_select; } else if (virtual->valid[i] > no) { virtual->valid[i] = message->current_select; } } else if(!table_name && !strcmp(column_name,vcol)) { ereport(DEBUG2, (errmsg("DetectValidColumn no = %d, col_name=(%s) detect",no, vcol))); get++; if(virtual->valid[i] == -1) { virtual->valid[i] = message->current_select; } else if (virtual->valid[i] > no) { virtual->valid[i] = message->current_select; } } } if(star) return true; if(get == 1) { return true; } else if(get == 0) { int last = analyze->last_select; if(last != -1) { return DetectValidColumn(message,table_name,column_name,analyze->last_select,analyze->call_part); } } else if(get>= 2) ereport(DEBUG2, (errmsg("DetectValidColumn select_no=(%d) col_name=(%s) ambiguous",message->current_select,column_name))); return false; } static bool GetPoolColumn(RewriteQuery *message,String *str,char *table_name,char *column_name,int no, int call,bool state) { AnalyzeSelect *analyze; #if 0 AnalyzeSelect *analyze_now; #endif VirtualTable *virtual; int v_num,i; int get = 0; int call_num; bool star = false; call_num = message->current_select; if(call != -1 && no != call_num && call == SELECT_FROMCLAUSE) { int last = message->analyze[no]->last_select; int call_part = message->analyze[no]->call_part; if(last == -1) { return false; } else { return GetPoolColumn(message,str,table_name,column_name,last,call_part,state); } } analyze = message->analyze[no]; #if 0 analyze_now = message->analyze[call_num]; #endif virtual = analyze->virtual; v_num = virtual->col_num; for(i = 0; i< v_num; i++) { char *vcol = virtual->col_list[i]; char *vtable = virtual->table_list[i]; if(table_name && !strcmp(table_name,vtable) && !strcmp(column_name,"*")) { star = true; break; } else if (!table_name && !strcmp(column_name,"*")) { star = true; break; } if(table_name && !strcmp(table_name,vtable) && !strcmp(column_name,vcol)) { ereport(DEBUG2, (errmsg("GetPoolColumn no = %d, table_name=(%s), col_name=(%s) new_colname$%d detect",no, vtable, vcol,i))); get++; break; } else if(!table_name && !strcmp(column_name,vcol)) { ereport(DEBUG2, (errmsg("GetPoolColumn no = %d, col_name=(%s) new_colname=pool_c$%d detect",no, vcol,i))); get++; break; } } if(star) { if(table_name) { int first = 0; for(i = 0; i < v_num; i++) { char buf[16]; if(!strcmp(virtual->table_list[i],table_name) && virtual->valid[i] != -1) { if(first == 0) first = 1; else delay_string_append_char(message, str, ","); if(message->rewritelock == -1) { snprintf(buf, 16, "%d", analyze->virtual->column_no[i]); delay_string_append_char(message, str,"\"pool_c$"); delay_string_append_char(message, str,buf); delay_string_append_char(message, str, "\""); if(message->ignore_rewrite == -1 && call_num != 0 && analyze->call_part == SELECT_FROMCLAUSE) { char buf2[16]; int col_no = analyze->select_ret->return_list[analyze->ret_count]; delay_string_append_char(message, str, " AS "); snprintf(buf2, 16, "%d", col_no); delay_string_append_char(message, str,"\"pool_c$"); delay_string_append_char(message, str,buf2); delay_string_append_char(message, str, "\""); delay_string_append_char(message, str," "); ereport(DEBUG2, (errmsg("GetPoolColumn analyze[%d] targetlist=* => pool_c$%s AS pool_c$%s", no,buf,buf2))); analyze->ret_count++; continue; } } else { delay_string_append_char(message, str,analyze->virtual->col_list[i]); } delay_string_append_char(message, str, " "); if(state && message->rewritelock == -1) { delay_string_append_char(message, str, " AS "); delay_string_append_char(message, str, "\""); delay_string_append_char(message, str, analyze->select_ret->col_list[message->ret_num]); delay_string_append_char(message, str, "\" "); message->ret_num++; } } } } else { int first = 0; for(i = 0; i < v_num; i++) { char buf[16]; if(virtual->valid[i] != -1) { if(first == 0) first = 1; else delay_string_append_char(message, str, ","); if(message->rewritelock == -1) { snprintf(buf, 16, "%d", analyze->virtual->column_no[i]); delay_string_append_char(message, str,"\"pool_c$"); delay_string_append_char(message, str,buf); delay_string_append_char(message, str,"\""); if(message->ignore_rewrite == -1 && call_num != 0 && analyze->call_part == SELECT_FROMCLAUSE) { char buf2[16]; int col_no = analyze->select_ret->return_list[analyze->ret_count]; delay_string_append_char(message, str, " AS "); snprintf(buf2, 16, "%d", col_no); delay_string_append_char(message, str,"\"pool_c$"); delay_string_append_char(message, str,buf2); delay_string_append_char(message, str,"\""); delay_string_append_char(message, str," "); analyze->ret_count++; ereport(DEBUG2, (errmsg("GetPoolColumn analyze[%d] targetlist=%s => pool_c$%s AS pool_c$%s", no,column_name,buf,buf2))); continue; } } else { delay_string_append_char(message, str,analyze->virtual->col_list[i]); } delay_string_append_char(message, str, " "); if(state && message->rewritelock == -1) { delay_string_append_char(message, str, " AS "); delay_string_append_char(message, str, analyze->select_ret->col_list[message->ret_num]); message->ret_num++; } } } } return true; } if(get == 1) { char buf[16]; snprintf(buf, 16, "%d", virtual->column_no[i]); #if 0 if(analyze_now->partstate[SELECT_FROMCLAUSE] != 'S') { delay_string_append_char(message, str, analyze->table_name); delay_string_append_char(message, str, "."); } else { delay_string_append_char(message, str, virtual->table_list[i]); delay_string_append_char(message, str, "."); } #endif delay_string_append_char(message, str, "\"pool_c$"); delay_string_append_char(message, str, buf); delay_string_append_char(message, str, "\""); return true; } else if(get == 0) { int last = analyze->last_select; if(last != -1) { return GetPoolColumn(message,str,table_name,column_name,analyze->last_select,analyze->call_part,state); } else return false; } return false; } static void SeekColumnName(Aggexpr *agg,ColumnRef *node, int state) { char *column = NULL; char *table = NULL; int i; /* get column & table name from group by */ column = GetNameFromColumnRef(node,true); table = GetNameFromColumnRef(node,false); if(state == SELECT_GROUPBYCLAUSE) { for(i = 0; i < agg->u_num; i++) { ColumnRef *unode = agg->usec_p[i]; char *t_column = NULL; char *t_table = NULL; t_column = GetNameFromColumnRef(unode,true); t_table = GetNameFromColumnRef(unode,false); if(table && t_table) { if(!strcmp(table,t_table) && !strcmp(column,t_column)) { agg->umapc[i] = agg->c_num; return; } } else { if(!strcmp(column,t_column)) { agg->umapc[i] = agg->c_num; return; } } } } } static bool CheckAggOpt(RewriteQuery *message) { AnalyzeSelect *analyze; if(message->r_code != SELECT_DEFAULT) return false; analyze = message->analyze[message->current_select]; if(analyze->aggregate && analyze->aggexpr && analyze->aggexpr->opt && (analyze->part == SELECT_TARGETLIST || analyze->part == SELECT_GROUPBYCLAUSE || analyze->part == SELECT_HAVINGCLAUSE || analyze->part == SELECT_SORTCLAUSE) && analyze->partstate[SELECT_FROMCLAUSE] == 'P' && analyze->partstate[SELECT_TARGETLIST] == 'S' && analyze->partstate[SELECT_WHERECLAUSE] == 'P') return true; return false; } static char *GetNameFromColumnRef(ColumnRef *node,bool state) { ListCell *c; List *list; list = node->fields; int first = 0; char *table_name = NULL; char *column_name = NULL; foreach (c, node->fields) { Node *n = (Node *) lfirst(c); if (IsA(n, String)) { Value *v = (Value *) lfirst(c); if(list->length == 2 && first == 0) { first = 1; table_name = v->val.str; } else column_name = v->val.str; } } if(state) return column_name; else return table_name; } static void _rewriteColumnRef(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, ColumnRef *node) { ListCell *c; List *list; char first = 0; char *table_name = NULL; char *column_name = ""; if(CheckAggOpt(message)) { int i; AnalyzeSelect *analyze = message->analyze[message->current_select]; i = ColumnChangebyAggregate(analyze,node); if(i != -1) { char buf[16]; snprintf(buf, 16, "%d", i); delay_string_append_char(message, str, "pool_g$"); delay_string_append_char(message, str, buf); ereport(DEBUG2, (errmsg("_rewriteColumnRef: aggregate no = %d",i))); return ; } } list = node->fields; foreach (c, node->fields) { Node *n = (Node *) lfirst(c); if (IsA(n, String)) { if(message->r_code == SELECT_AEXPR && (_checkVirtualColumn(node, message) != 1)) { KeepRewriteQueryReturnCode(message, SELECT_AEXPR_FALSE); return; } Value *v = (Value *) lfirst(c); if(list->length == 2 && first == 0) { first = 1; table_name = v->val.str; } else column_name = v->val.str; } else if (IsA(n, A_Star)) { column_name = "*"; } } if(message->r_code == SELECT_ANALYZE) { AnalyzeSelect *analyze = message->analyze[message->current_select]; if(analyze->part == SELECT_GROUPBYCLAUSE || analyze->part == SELECT_TARGETLIST) AppendAggregate(analyze,NULL,node); if(!DetectValidColumn(message,table_name,column_name,message->current_select,-1)) { message->is_loadbalance = true; ereport(DEBUG2, (errmsg("_rewriteColumnRef: wrong column select_no=%d",message->current_select))); } if(strcmp(column_name,"*")) ChangeStatebyColumnRef(message,node); } else if(message->r_code == SELECT_DEFAULT) { if(message->rewritelock == -1) { if(!GetPoolColumn(message,str,table_name,column_name,message->current_select,-1,false)) delay_string_append_char(message, str, column_name); } else { if(table_name) { if(message->rewritelock == -1) { AnalyzeSelect *analyze = message->analyze[message->current_select]; char s = analyze->partstate[SELECT_FROMCLAUSE]; if(s == 'L' || s =='P') { delay_string_append_char(message, str, analyze->table_name); } } else delay_string_append_char(message, str, table_name); delay_string_append_char(message, str, "."); } delay_string_append_char(message, str, column_name); } } } static void _rewriteParamRef(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, ParamRef *node) { char buf[16]; snprintf(buf, 16, "%d", node->number); delay_string_append_char(message, str, "$"); delay_string_append_char(message, str, buf); } static void _rewriteAConst(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, A_Const *node) { char buf[16]; switch (node->val.type) { case T_Integer: sprintf(buf, "%ld", node->val.val.ival); delay_string_append_char(message, str, buf); break; case T_Float: delay_string_append_char(message, str, node->val.val.str); break; case T_String: if(message->rewritelock != -1) { delay_string_append_char(message, str, "\'\'"); delay_string_append_char(message, str, escape_string(node->val.val.str)); delay_string_append_char(message, str, "\'\'"); } else { delay_string_append_char(message, str, "\'"); delay_string_append_char(message, str, escape_string(node->val.val.str)); delay_string_append_char(message, str, "\'"); } break; case T_Null: delay_string_append_char(message, str, "NULL"); break; default: break; } } static void _rewriteA_Indices(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, A_Indices *node) { delay_string_append_char(message, str, "["); if (node->lidx) { _rewriteNode(BaseSelect, message, dblink, str, node->lidx); delay_string_append_char(message, str, ":"); } _rewriteNode(BaseSelect, message, dblink, str, node->uidx); delay_string_append_char(message, str, "]"); } static void _rewriteA_Indirection(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, A_Indirection *node) { _rewriteNode(BaseSelect, message, dblink, str, node->arg); _rewriteNode(BaseSelect, message, dblink, str, node->indirection); } static void _rewriteA_ArrayExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, A_ArrayExpr *node) { delay_string_append_char(message, str, "ARRAY ["); _rewriteNode(BaseSelect, message, dblink, str, node->elements); delay_string_append_char(message, str, "]"); } static bool AliasToResTargetCondition(RewriteQuery *message,String *str) { int select_no = message->current_select; AnalyzeSelect *n_analyze; AnalyzeSelect *u_analyze; char buf[16]; int ret; int col_no; if(select_no == 0 || message->r_code != SELECT_DEFAULT || message->rewritelock != -1 || message->ignore_rewrite != -1) return false; n_analyze=message->analyze[select_no]; u_analyze=message->analyze[select_no - 1]; if(n_analyze->call_part == SELECT_FROMCLAUSE) { ret = n_analyze->ret_count; col_no = n_analyze->select_ret->return_list[n_analyze->ret_count]; ereport(DEBUG2, (errmsg("AliasToResTargetCondition select no =%d,ret_no = %d,col_no =%d,colname=%s", select_no,ret,col_no,n_analyze->select_ret->col_list[ret]))); delay_string_append_char(message, str, " AS "); snprintf(buf, 16, "%d", col_no); delay_string_append_char(message, str,"\"pool_c$"); delay_string_append_char(message, str,buf); delay_string_append_char(message, str,"\""); delay_string_append_char(message, str," "); return true; } else if(u_analyze->select_union && u_analyze->call_part == SELECT_FROMCLAUSE) { ret = u_analyze->ret_count; col_no = u_analyze->select_ret->return_list[u_analyze->ret_count]; ereport(DEBUG2, (errmsg("AliasToResTargetCondition(union) select now=%d up=%d,ret_no = %d,col_no =%d,colname=%s", select_no,select_no-1,ret,col_no,u_analyze->select_ret->col_list[ret]))); delay_string_append_char(message, str, " AS "); snprintf(buf, 16, "%d", col_no); delay_string_append_char(message, str,"\"pool_c$"); delay_string_append_char(message, str,buf); delay_string_append_char(message, str,"\""); delay_string_append_char(message, str," "); u_analyze->ret_count++; return true; } else return false; } static void _rewriteResTarget(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, ResTarget *node) { int select_no = message->current_select; AnalyzeSelect *analyze = NULL; SelectDefInfo *select = NULL; if(message->r_code == SELECT_DEFAULT) { analyze= message->analyze[select_no]; select = analyze->select_ret; } if (node->indirection != NIL) { delay_string_append_char(message, str, "\""); delay_string_append_char(message, str, node->name); delay_string_append_char(message, str, "\"="); _rewriteNode(BaseSelect, message, dblink, str, node->val); } else { char *star = NULL; char *table_name = NULL; if(message->r_code == SELECT_DEFAULT && !node->name) { if (node->val && (IsA(node->val, ColumnRef))) { int first = 0; ListCell *c; ColumnRef *col; col = (ColumnRef *) node->val; foreach (c, col->fields) { Node *n = (Node *) lfirst(c); if (IsA(n, String)) { Value *v = (Value *) lfirst(c); if(col->fields->length == 2 && first == 0) { first = 1; table_name = v->val.str; } else star = v->val.str; } else if (IsA(n, A_Star)) { star = "*"; } } } if(star && strcmp(star,"*")) { star = NULL; } } if(select_no == 0 && star) { GetPoolColumn(message,str,table_name,star,message->current_select,-1,true); return; } else { _rewriteNode(BaseSelect, message, dblink, str, node->val); if(star) return; } if(AliasToResTargetCondition(message,str)) return; if (node->name) { delay_string_append_char(message, str, " AS "); delay_string_append_char(message, str, node->name); if(message->r_code == SELECT_DEFAULT && select_no == 0) message->ret_num++; return; } else if(message->r_code == SELECT_DEFAULT && select_no == 0 && !node->name) { char *col_name = select->col_list[message->ret_num]; ereport(DEBUG2, (errmsg("_rewriteResTarget: check(%d) ret_num=%d",message->current_select,message->ret_num))); ereport(DEBUG2, (errmsg("_rewriteResTarget: col ret_num=%d col_name=%s",message->current_select,col_name))); delay_string_append_char(message, str, " AS "); delay_string_append_char(message, str, col_name); message->ret_num++; } } } static void _rewriteConstraint(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, Constraint *node) { if (node->conname) { delay_string_append_char(message, str, "CONSTRAINT \""); delay_string_append_char(message, str, node->conname); delay_string_append_char(message, str, "\""); } switch (node->contype) { case CONSTR_CHECK: delay_string_append_char(message, str, " CHECK ("); _rewriteNode(BaseSelect, message, dblink, str, node->raw_expr); delay_string_append_char(message, str, ")"); break; case CONSTR_UNIQUE: delay_string_append_char(message, str, " UNIQUE"); if (node->keys) { delay_string_append_char(message, str, "("); _rewriteIdList(BaseSelect, message, dblink, str, node->keys); delay_string_append_char(message, str, ")"); } if (node->indexspace) { delay_string_append_char(message, str, " USING INDEX TABLESPACE \""); delay_string_append_char(message, str, node->indexspace); delay_string_append_char(message, str, "\""); } break; case CONSTR_PRIMARY: delay_string_append_char(message, str, " PRIMARY KEY"); if (node->keys) { delay_string_append_char(message, str, "("); _rewriteIdList(BaseSelect, message, dblink, str, node->keys); delay_string_append_char(message, str, ")"); } if (node->indexspace) { delay_string_append_char(message, str, " USING INDEX TABLESPACE \""); delay_string_append_char(message, str, node->indexspace); delay_string_append_char(message, str, "\""); } break; case CONSTR_FOREIGN: if (node->fk_attrs != NIL) { delay_string_append_char(message, str, " FOREIGN KEY ("); _rewriteIdList(BaseSelect, message, dblink, str, node->fk_attrs); delay_string_append_char(message, str, ")" ); } delay_string_append_char(message, str, " REFERENCES "); _rewriteNode(BaseSelect, message, dblink, str, node->pktable); if (node->pk_attrs != NIL) { delay_string_append_char(message, str, "("); _rewriteIdList(BaseSelect, message, dblink, str, node->pk_attrs); delay_string_append_char(message, str, ")"); } switch (node->fk_matchtype) { case FKCONSTR_MATCH_FULL: delay_string_append_char(message, str, " MATCH FULL"); break; case FKCONSTR_MATCH_PARTIAL: delay_string_append_char(message, str, " MATCH PARTIAL"); break; default: break; } switch (node->fk_upd_action) { case FKCONSTR_ACTION_RESTRICT: delay_string_append_char(message, str, " ON UPDATE RESTRICT"); break; case FKCONSTR_ACTION_CASCADE: delay_string_append_char(message, str, " ON UPDATE CASCADE"); break; case FKCONSTR_ACTION_SETNULL: delay_string_append_char(message, str, " ON UPDATE SET NULL"); break; case FKCONSTR_ACTION_SETDEFAULT: delay_string_append_char(message, str, " ON UPDATE SET DEFAULT"); break; default: break; } switch (node->fk_del_action) { case FKCONSTR_ACTION_RESTRICT: delay_string_append_char(message, str, " ON DELETE RESTRICT"); break; case FKCONSTR_ACTION_CASCADE: delay_string_append_char(message, str, " ON DELETE CASCADE"); break; case FKCONSTR_ACTION_SETNULL: delay_string_append_char(message, str, " ON DELETE SET NULL"); break; case FKCONSTR_ACTION_SETDEFAULT: delay_string_append_char(message, str, " ON DELETE SET DEFAULT"); break; default: break; } if (node->deferrable) delay_string_append_char(message, str, " DEFERRABLE"); if (node->initdeferred) delay_string_append_char(message, str, " INITIALLY DEFERRED"); break; case CONSTR_NOTNULL: delay_string_append_char(message, str, " NOT NULL"); break; case CONSTR_NULL: delay_string_append_char(message, str, " NULL"); break; case CONSTR_DEFAULT: delay_string_append_char(message, str, "DEFAULT "); _rewriteNode(BaseSelect, message, dblink, str, node->raw_expr); break; default: break; } } static void _rewriteSortBy(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, SortBy *node) { _rewriteNode(BaseSelect, message, dblink, str, node->node); if (node->sortby_dir == SORTBY_USING) { delay_string_append_char(message, str, " USING "); _rewriteNode(BaseSelect, message, dblink, str, node->useOp); } else if (node->sortby_dir == SORTBY_DESC) delay_string_append_char(message, str, " DESC "); if (node->sortby_nulls == SORTBY_NULLS_FIRST) delay_string_append_char(message, str, " NULLS FIRST "); else if (node->sortby_nulls == SORTBY_NULLS_LAST) delay_string_append_char(message, str, " NULLS LAST "); } static void _rewriteInsertStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, InsertStmt *node) { delay_string_append_char(message, str, "INSERT INTO "); _rewriteNode(BaseSelect, message, dblink, str, node->relation); if (node->cols == NIL && node->selectStmt == NULL) delay_string_append_char(message, str, " DEFAULT VALUES"); if (node->cols) { char comma = 0; ListCell *lc; delay_string_append_char(message, str, "("); foreach (lc, node->cols) { ResTarget *node = lfirst(lc); if (comma == 0) comma = 1; else delay_string_append_char(message, str, ", "); delay_string_append_char(message, str, "\""); delay_string_append_char(message, str, node->name); delay_string_append_char(message, str, "\""); } delay_string_append_char(message, str, ")"); } if (node->selectStmt) { _rewriteNode(BaseSelect, message, dblink, str, node->selectStmt); } if (node->returningList) { delay_string_append_char(message, str, " RETURNING "); _rewriteNode(BaseSelect, message, dblink, str, node->returningList); } } static void _rewriteUpdateStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, UpdateStmt *node) { ListCell *lc; char comma = 0; delay_string_append_char(message, str, "UPDATE "); _rewriteNode(BaseSelect, message, dblink, str, node->relation); delay_string_append_char(message, str, " SET "); foreach (lc, node->targetList) { ResTarget *node = lfirst(lc); if (comma == 0) comma = 1; else delay_string_append_char(message, str, ", "); delay_string_append_char(message, str, "\""); delay_string_append_char(message, str, node->name); delay_string_append_char(message, str, "\" ="); _rewriteNode(BaseSelect, message, dblink, str, node->val); } if (node->fromClause) { delay_string_append_char(message, str, " FROM "); _rewriteNode(BaseSelect, message, dblink, str, node->fromClause); } if (node->whereClause) { delay_string_append_char(message, str, " WHERE "); _rewriteNode(BaseSelect, message, dblink, str, node->whereClause); } if (node->returningList) { delay_string_append_char(message, str, " RETURNING "); _rewriteNode(BaseSelect, message, dblink, str, node->returningList); } } static void _rewriteDeleteStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, DeleteStmt *node) { delay_string_append_char(message, str, "DELETE FROM "); _rewriteNode(BaseSelect, message, dblink, str, node->relation); if (node->usingClause) { delay_string_append_char(message, str, " USING "); _rewriteNode(BaseSelect, message, dblink, str, node->usingClause); } if (node->whereClause) { delay_string_append_char(message, str, " WHERE "); _rewriteNode(BaseSelect, message, dblink, str, node->whereClause); } if (node->returningList) { delay_string_append_char(message, str, " RETURNING "); _rewriteNode(BaseSelect, message, dblink, str, node->returningList); } } static void _rewriteTransactionStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, TransactionStmt *node) { switch (node->kind) { case TRANS_STMT_BEGIN: delay_string_append_char(message, str, "BEGIN "); break; case TRANS_STMT_START: delay_string_append_char(message, str, "START TRANSACTION "); break; case TRANS_STMT_COMMIT: delay_string_append_char(message, str, "COMMIT "); break; case TRANS_STMT_ROLLBACK: delay_string_append_char(message, str, "ABORT "); break; case TRANS_STMT_SAVEPOINT: delay_string_append_char(message, str, "SAVEPOINT "); break; case TRANS_STMT_RELEASE: delay_string_append_char(message, str, "RELEASE "); break; case TRANS_STMT_ROLLBACK_TO: delay_string_append_char(message, str, "ROLLBACK TO "); break; case TRANS_STMT_PREPARE: delay_string_append_char(message, str, "PREPARE TRANSACTION "); break; case TRANS_STMT_COMMIT_PREPARED: delay_string_append_char(message, str, "COMMIT PREPARED "); break; case TRANS_STMT_ROLLBACK_PREPARED: delay_string_append_char(message, str, "ROLLBACK PREPARED "); break; default: break; } if (node->options) _rewriteSetTransactionModeList(BaseSelect, message, dblink, str, node->options); if (node->gid) delay_string_append_char(message, str, node->gid); } static void _rewriteTruncateStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, TruncateStmt *node) { delay_string_append_char(message, str, "TRUNCATE "); _rewriteNode(BaseSelect, message, dblink, str, node->relations); } static void _rewriteVacuumStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, VacuumStmt *node) { if (node->options & VACOPT_VACUUM) delay_string_append_char(message, str, "VACUUM "); else delay_string_append_char(message, str, "ANALYZE "); if (node->options & VACOPT_FULL) delay_string_append_char(message, str, "FULL "); if (node->options & VACOPT_FREEZE) delay_string_append_char(message, str, "FREEZE "); if (node->options & VACOPT_VERBOSE) delay_string_append_char(message, str, "VERBOSE "); if (node->options & VACOPT_ANALYZE) delay_string_append_char(message, str, "ANALYZE "); _rewriteNode(BaseSelect, message, dblink, str, node->va_cols); } static void _rewriteExplainStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, ExplainStmt *node) { ListCell *lc; delay_string_append_char(message, str, "EXPLAIN "); if (server_version_num < 90000) { foreach(lc, node->options) { DefElem *opt = (DefElem *) lfirst(lc); if (strcmp(opt->defname, "analyze") == 0) delay_string_append_char(message, str, "ANALYZE "); else if (strcmp(opt->defname, "verbose") == 0) delay_string_append_char(message, str, "VERBOSE "); } } else { if (node->options) { delay_string_append_char(message, str, "("); foreach(lc, node->options) { DefElem *opt = (DefElem *) lfirst(lc); if (list_head(node->options) != lc) delay_string_append_char(message, str, ", "); delay_string_append_char(message, str, opt->defname); delay_string_append_char(message, str, " "); if (opt->arg) _rewriteNode(BaseSelect, message, dblink, str, opt->arg); } delay_string_append_char(message, str, ")"); } } _rewriteNode(BaseSelect, message, dblink, str, node->query); } static void _rewriteClusterStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, ClusterStmt *node) { delay_string_append_char(message, str, "CLUSTER "); if (node->indexname) { delay_string_append_char(message, str, "\""); delay_string_append_char(message, str, node->indexname); delay_string_append_char(message, str, "\" ON "); } if (node->relation) _rewriteNode(BaseSelect, message, dblink, str, node->relation); } static void _rewriteCheckPointStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CheckPointStmt *node) { delay_string_append_char(message, str, "CHECKPOINT"); } static void _rewriteClosePortalStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, ClosePortalStmt *node) { delay_string_append_char(message, str, "CLOSE "); delay_string_append_char(message, str, "\""); delay_string_append_char(message, str, node->portalname); delay_string_append_char(message, str, "\""); } static void _rewriteListenStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, ListenStmt *node) { delay_string_append_char(message, str, "LISTEN "); delay_string_append_char(message, str, "\""); _rewriteNode(BaseSelect, message, dblink, str, node->conditionname); delay_string_append_char(message, str, "\""); } static void _rewriteUnlistenStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, UnlistenStmt *node) { delay_string_append_char(message, str, "UNLISTEN "); if (node->conditionname == NULL) delay_string_append_char(message, str, "*"); else { delay_string_append_char(message, str, "\""); _rewriteNode(BaseSelect, message, dblink, str, node->conditionname); delay_string_append_char(message, str, "\""); } } static void _rewriteLoadStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, LoadStmt *node) { delay_string_append_char(message, str, "LOAD '"); delay_string_append_char(message, str, node->filename); delay_string_append_char(message, str, "'"); } static void _rewriteCopyStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CopyStmt *node) { ListCell *lc; delay_string_append_char(message, str, "COPY "); if (node->query) { delay_string_append_char(message, str, "("); _rewriteNode(BaseSelect, message, dblink, str, node->query); delay_string_append_char(message, str, ")"); } _rewriteNode(BaseSelect, message, dblink, str, node->relation); if (node->attlist) { delay_string_append_char(message, str, "("); _rewriteNode(BaseSelect, message, dblink, str, node->attlist); delay_string_append_char(message, str, ")"); } if (node->is_from == TRUE) delay_string_append_char(message, str, " FROM "); else delay_string_append_char(message, str, " TO "); if (node->filename) { delay_string_append_char(message, str, "'"); delay_string_append_char(message, str, node->filename); delay_string_append_char(message, str, "' "); } else delay_string_append_char(message, str, node->is_from == TRUE ? "STDIN " : "STDOUT "); if (server_version_num < 90000) { foreach (lc, node->options) { DefElem *e = lfirst(lc); if (strcmp(e->defname, "format") == 0) { char *fmt = strVal(e->arg); if (strcmp(fmt, "text") == 0) ; else if (strcmp(fmt, "binary") == 0) delay_string_append_char(message, str, "BINARY "); else if (strcmp(fmt, "csv") == 0) delay_string_append_char(message, str, "CSV "); } else if (strcmp(e->defname, "oids") == 0) delay_string_append_char(message, str, "OIDS "); else if (strcmp(e->defname, "delimiter") == 0) { delay_string_append_char(message, str, "DELIMITERS "); _rewriteValue(BaseSelect, message, dblink, str, (Value *) e->arg); delay_string_append_char(message, str, " "); } else if (strcmp(e->defname, "null") == 0) { delay_string_append_char(message, str, "NULL "); _rewriteValue(BaseSelect, message, dblink, str, (Value *) e->arg); delay_string_append_char(message, str, " "); } else if (strcmp(e->defname, "header") == 0) delay_string_append_char(message, str, "HEADER "); else if (strcmp(e->defname, "quote") == 0) { delay_string_append_char(message, str, "QUOTE "); _rewriteValue(BaseSelect, message, dblink, str, (Value *) e->arg); delay_string_append_char(message, str, " "); } else if (strcmp(e->defname, "escape") == 0) { delay_string_append_char(message, str, "ESCAPE "); _rewriteValue(BaseSelect, message, dblink, str, (Value *) e->arg); delay_string_append_char(message, str, " "); } else if (strcmp(e->defname, "force_quote") == 0) { delay_string_append_char(message, str, "FORCE QUOTE "); _rewriteIdList(BaseSelect, message, dblink, str, (List *) e->arg); } else if (strcmp(e->defname, "force_not_null") == 0) { delay_string_append_char(message, str, "FORCE NOT NULL "); _rewriteIdList(BaseSelect, message, dblink, str, (List *) e->arg); } } } else { /* version_num >= 90000 */ if (node->options) { delay_string_append_char(message, str, "("); foreach (lc, node->options) { DefElem *e = lfirst(lc); if (list_head(node->options) != lc) delay_string_append_char(message, str, ", "); delay_string_append_char(message, str, e->defname); delay_string_append_char(message, str, " "); if (strcmp(e->defname, "format") == 0 || strcmp(e->defname, "oids") == 0 || strcmp(e->defname, "delimiter") == 0 || strcmp(e->defname, "null") == 0 || strcmp(e->defname, "header") == 0 || strcmp(e->defname, "quote") == 0 || strcmp(e->defname, "escape") == 0) _rewriteValue(BaseSelect, message, dblink, str, (Value *) e->arg); else if (strcmp(e->defname, "force_not_null") == 0) { delay_string_append_char(message, str, "("); _rewriteIdList(BaseSelect, message, dblink, str, (List *) e->arg); delay_string_append_char(message, str, ")"); } else if (strcmp(e->defname, "force_quote") == 0) { if (IsA(e->arg, A_Star)) delay_string_append_char(message, str, "*"); else if (IsA(e->arg, List)) { delay_string_append_char(message, str, "("); _rewriteIdList(BaseSelect, message, dblink, str, (List *) e->arg); delay_string_append_char(message, str, ")"); } } } delay_string_append_char(message, str, ")"); } } } static void _rewriteDeallocateStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, DeallocateStmt *node) { delay_string_append_char(message, str, "DEALLOCATE \""); delay_string_append_char(message, str, node->name); delay_string_append_char(message, str, "\""); } static void _rewriteRenameStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, RenameStmt *node) { ListCell *lc; char comma = 0; delay_string_append_char(message, str, "ALTER "); switch (node->renameType) { case OBJECT_AGGREGATE: delay_string_append_char(message, str, "AGGREGATE "); _rewriteNode(BaseSelect, message, dblink, str, node->object); delay_string_append_char(message, str, " ("); delay_string_append_char(message, str, ") RENAME TO \""); delay_string_append_char(message, str, node->newname); delay_string_append_char(message, str, "\""); break; case OBJECT_CONVERSION: delay_string_append_char(message, str, "CONVERSION "); _rewriteNode(BaseSelect, message, dblink, str, node->object); delay_string_append_char(message, str, " RENAME TO \""); delay_string_append_char(message, str, node->newname); delay_string_append_char(message, str, "\""); break; case OBJECT_DATABASE: delay_string_append_char(message, str, "DATABASE \""); delay_string_append_char(message, str, node->subname); delay_string_append_char(message, str, "\" RENAME TO \""); delay_string_append_char(message, str, node->newname); delay_string_append_char(message, str, "\""); break; case OBJECT_FUNCTION: delay_string_append_char(message, str, "FUNCTION "); foreach (lc, node->object) { Node *n = lfirst(lc); if (IsA(n, String)) { Value *value = (Value *) n; if (comma == 0) comma = 1; else delay_string_append_char(message, str, "."); delay_string_append_char(message, str, "\""); delay_string_append_char(message, str, value->val.str); delay_string_append_char(message, str, "\""); } else _rewriteNode(BaseSelect, message, dblink, str, n); } delay_string_append_char(message, str, "("); _rewriteNode(BaseSelect, message, dblink, str, node->objarg); delay_string_append_char(message, str, ")"); delay_string_append_char(message, str, " RENAME TO \""); delay_string_append_char(message, str, node->newname); delay_string_append_char(message, str, "\""); break; case OBJECT_ROLE: delay_string_append_char(message, str, "ROLE \""); delay_string_append_char(message, str, node->subname); delay_string_append_char(message, str, "\" RENAME TO \""); delay_string_append_char(message, str, node->newname); delay_string_append_char(message, str, "\""); break; case OBJECT_LANGUAGE: delay_string_append_char(message, str, "LANGUAGE \""); delay_string_append_char(message, str, node->subname); delay_string_append_char(message, str, "\" RENAME TO \""); delay_string_append_char(message, str, node->newname); delay_string_append_char(message, str, "\""); break; case OBJECT_OPCLASS: delay_string_append_char(message, str, "OPERATOR CLASS "); _rewriteNode(BaseSelect, message, dblink, str, node->object); delay_string_append_char(message, str, " USING "); delay_string_append_char(message, str, node->subname); delay_string_append_char(message, str, " RENAME TO \""); delay_string_append_char(message, str, node->newname); delay_string_append_char(message, str, "\""); break; case OBJECT_SCHEMA: delay_string_append_char(message, str, "SCHEMA \""); delay_string_append_char(message, str, node->subname); delay_string_append_char(message, str, "\" RENAME TO \""); delay_string_append_char(message, str, node->newname); delay_string_append_char(message, str, "\""); break; case OBJECT_TABLE: delay_string_append_char(message, str, "TABLE "); _rewriteNode(BaseSelect, message, dblink, str, node->relation); delay_string_append_char(message, str, " RENAME TO \""); delay_string_append_char(message, str, node->newname); delay_string_append_char(message, str, "\""); break; case OBJECT_INDEX: delay_string_append_char(message, str, "INDEX "); _rewriteNode(BaseSelect, message, dblink, str, node->relation); delay_string_append_char(message, str, " RENAME TO \""); delay_string_append_char(message, str, node->newname); delay_string_append_char(message, str, "\""); break; case OBJECT_COLUMN: delay_string_append_char(message, str, "TABLE "); _rewriteNode(BaseSelect, message, dblink, str, node->relation); delay_string_append_char(message, str, " RENAME \""); delay_string_append_char(message, str, node->subname); delay_string_append_char(message, str, "\" TO \""); delay_string_append_char(message, str, node->newname); delay_string_append_char(message, str, "\""); break; case OBJECT_TRIGGER: delay_string_append_char(message, str, "TRIGGER \""); delay_string_append_char(message, str, node->subname); delay_string_append_char(message, str, "\" ON "); _rewriteNode(BaseSelect, message, dblink, str, node->relation); delay_string_append_char(message, str, " RENAME TO \""); delay_string_append_char(message, str, node->newname); delay_string_append_char(message, str, "\""); break; case OBJECT_TABLESPACE: delay_string_append_char(message, str, "TABLESPACE \""); delay_string_append_char(message, str, node->subname); delay_string_append_char(message, str, "\" RENAME TO \""); delay_string_append_char(message, str, node->newname); delay_string_append_char(message, str, "\""); break; default: break; } } static void _rewriteOptRoleList(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, List *options) { ListCell *lc; foreach (lc, options) { DefElem *elem = lfirst(lc); Value *value = (Value *) elem->arg; if (strcmp(elem->defname, "password") == 0) { if (value == NULL) delay_string_append_char(message, str, " PASSWORD NULL"); else { delay_string_append_char(message, str, " PASSWORD '"); delay_string_append_char(message, str, value->val.str); delay_string_append_char(message, str, "'"); } } else if (strcmp(elem->defname, "encryptedPassword") == 0) { delay_string_append_char(message, str, " ENCRYPTED PASSWORD '"); delay_string_append_char(message, str, value->val.str); delay_string_append_char(message, str, "'"); } else if (strcmp(elem->defname, "unencryptedPassword") == 0) { delay_string_append_char(message, str, " UNENCRYPTED PASSWORD '"); delay_string_append_char(message, str, value->val.str); delay_string_append_char(message, str, "'"); } else if (strcmp(elem->defname, "superuser") == 0) { if (value->val.ival == TRUE) delay_string_append_char(message, str, " SUPERUSER"); else delay_string_append_char(message, str, " NOSUPERUSER"); } else if (strcmp(elem->defname, "inherit") == 0) { if (value->val.ival == TRUE) delay_string_append_char(message, str, " INHERIT"); else delay_string_append_char(message, str, " NOINHERIT"); } else if (strcmp(elem->defname, "createdb") == 0) { if (value->val.ival == TRUE) delay_string_append_char(message, str, " CREATEDB"); else delay_string_append_char(message, str, " NOCREATEDB"); } else if (strcmp(elem->defname, "createrole") == 0) { if (value->val.ival == TRUE) delay_string_append_char(message, str, " CREATEROLE"); else delay_string_append_char(message, str, " NOCREATEROLE"); } else if (strcmp(elem->defname, "canlogin") == 0) { if (value->val.ival == TRUE) delay_string_append_char(message, str, " LOGIN"); else delay_string_append_char(message, str, " NOLOGIN"); } else if (strcmp(elem->defname, "connectionlimit") == 0) { char buf[16]; delay_string_append_char(message, str, " CONNECTION LIMIT "); snprintf(buf, 16, "%ld", value->val.ival); delay_string_append_char(message, str, buf); } else if (strcmp(elem->defname, "validUntil") == 0) { delay_string_append_char(message, str, " VALID UNTIL '"); delay_string_append_char(message, str, value->val.str); delay_string_append_char(message, str, "'"); } else if (strcmp(elem->defname, "rolemembers") == 0) { delay_string_append_char(message, str, " ROLE "); _rewriteIdList(BaseSelect, message, dblink, str, (List *) elem->arg); } else if (strcmp(elem->defname, "sysid") == 0) { char buf[16]; delay_string_append_char(message, str, " SYSID "); snprintf(buf, 16, "%ld", value->val.ival); delay_string_append_char(message, str, buf); } else if (strcmp(elem->defname, "adminmembers") == 0) { delay_string_append_char(message, str, " ADMIN "); _rewriteIdList(BaseSelect, message, dblink, str, (List *) elem->arg); } else if (strcmp(elem->defname, "addroleto") == 0) { delay_string_append_char(message, str, " IN ROLE "); _rewriteIdList(BaseSelect, message, dblink, str, (List *) elem->arg); } } } static void _rewriteCreateRoleStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CreateRoleStmt *node) { delay_string_append_char(message, str, "CREATE "); switch (node->stmt_type) { case ROLESTMT_ROLE: delay_string_append_char(message, str, "ROLE \""); break; case ROLESTMT_USER: delay_string_append_char(message, str, "USER \""); break; case ROLESTMT_GROUP: delay_string_append_char(message, str, "GROUP \""); break; } delay_string_append_char(message, str, node->role); delay_string_append_char(message, str, "\""); _rewriteOptRoleList(BaseSelect, message, dblink, str, node->options); } static void _rewriteAlterRoleStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, AlterRoleStmt *node) { delay_string_append_char(message, str, "ALTER ROLE \""); delay_string_append_char(message, str, node->role); delay_string_append_char(message, str, "\""); if (node->options) _rewriteOptRoleList(BaseSelect, message, dblink, str, node->options); } static void _rewriteAlterRoleSetStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, AlterRoleSetStmt *node) { delay_string_append_char(message, str, "ALTER ROLE \""); delay_string_append_char(message, str, node->role); delay_string_append_char(message, str, "\" "); if (node->setstmt) { _rewriteNode(BaseSelect, message, dblink, str, node->setstmt); } } static void _rewriteSetTransactionModeList(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, List *list) { ListCell *lc; char comma = 0; foreach (lc, list) { DefElem *elem = lfirst(lc); if (comma == 0) comma = 1; else delay_string_append_char(message, str, ","); if (strcmp(elem->defname, "transaction_isolation") == 0) { A_Const *v = (A_Const *) elem->arg; delay_string_append_char(message, str, " ISOLATION LEVEL "); delay_string_append_char(message, str, v->val.val.str); } else if (strcmp(elem->defname, "transaction_read_only") == 0) { A_Const *n = (A_Const *) elem->arg; if (n->val.val.ival == TRUE) delay_string_append_char(message, str, "READ ONLY "); else delay_string_append_char(message, str, "READ WRITE "); } } } static void _rewriteSetRest(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, VariableSetStmt *node) { if (strcmp(node->name, "timezone") == 0) { delay_string_append_char(message, str, "TIME ZONE "); if (node->kind != VAR_RESET) _rewriteNode(BaseSelect, message, dblink, str, node->args); } else if (strcmp(node->name, "TRANSACTION") == 0) { delay_string_append_char(message, str, "TRANSACTION "); _rewriteSetTransactionModeList(BaseSelect, message, dblink, str, node->args); } else if (strcmp(node->name, "SESSION CHARACTERISTICS") == 0) { delay_string_append_char(message, str, "SESSION CHARACTERISTICS AS TRANSACTION "); _rewriteSetTransactionModeList(BaseSelect, message, dblink, str, node->args); } else if (strcmp(node->name, "role") == 0) { delay_string_append_char(message, str, "ROLE "); if (node->kind != VAR_RESET) _rewriteNode(BaseSelect, message, dblink, str, node->args); } else if (strcmp(node->name, "session_authorization") == 0) { delay_string_append_char(message, str, "SESSION AUTHORIZATION "); if (node->args == NIL && node->kind != VAR_RESET) delay_string_append_char(message, str, "DEFAULT"); else _rewriteNode(BaseSelect, message, dblink, str, node->args); } else if (strcmp(node->name, "transaction_isolation") == 0) { delay_string_append_char(message, str, "TRANSACTION ISOLATION LEVEL"); if (node->kind != VAR_RESET) _rewriteSetTransactionModeList(BaseSelect, message, dblink, str, node->args); } else if (strcmp(node->name, "xmloption") == 0) { A_Const *v = linitial(node->args); delay_string_append_char(message, str, "XML OPTOIN "); delay_string_append_char(message, str, v->val.val.str); } else { delay_string_append_char(message, str, node->name); if (node->kind != VAR_RESET) { if (node->kind == VAR_SET_CURRENT) { delay_string_append_char(message, str, " FROM CURRENT"); } else { delay_string_append_char(message, str, " TO "); if (node->args == NULL) { delay_string_append_char(message, str, "DEFAULT"); } else _rewriteNode(BaseSelect, message, dblink, str, node->args); } } } } static void _rewriteDropRoleStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, DropRoleStmt *node) { delay_string_append_char(message, str, "DROP ROLE "); if (node->missing_ok == TRUE) delay_string_append_char(message, str, "IF EXISTS "); _rewriteIdList(BaseSelect, message, dblink, str, node->roles); } static void _rewriteCreateSchemaStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CreateSchemaStmt *node) { delay_string_append_char(message, str, "CREATE SCHEMA \""); delay_string_append_char(message, str, node->schemaname); delay_string_append_char(message, str, "\""); if (node->authid) { delay_string_append_char(message, str, "AUTHORIZATION \""); delay_string_append_char(message, str, node->authid); delay_string_append_char(message, str, "\" "); } _rewriteNode(BaseSelect, message, dblink, str, node->schemaElts); } static void _rewriteVariableSetStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, VariableSetStmt *node) { if (node->kind == VAR_RESET_ALL) { delay_string_append_char(message, str, "RESET ALL"); return; } if (node->kind == VAR_RESET) delay_string_append_char(message, str, "RESET "); else delay_string_append_char(message, str, "SET "); if (node->is_local) delay_string_append_char(message, str, "LOCAL "); _rewriteSetRest(BaseSelect, message, dblink, str, node); } static void _rewriteVariableShowStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, VariableShowStmt *node) { if (strcmp(node->name, "timezone") == 0) delay_string_append_char(message, str, "SHOW TIME ZONE"); else if (strcmp(node->name, "transaction_isolation") == 0) delay_string_append_char(message, str, "SHOW TRANSACTION ISOLATION LEVEL"); else if (strcmp(node->name, "session_authorization") == 0) delay_string_append_char(message, str, "SHOW SESSION AUTHORIZATION"); else if (strcmp(node->name, "all") == 0) delay_string_append_char(message, str, "SHOW ALL"); else { delay_string_append_char(message, str, "SHOW "); delay_string_append_char(message, str, node->name); } } static void _rewriteConstraintsSetStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, ConstraintsSetStmt *node) { delay_string_append_char(message, str, "SET CONSTRAINTS "); if (node->constraints == NIL) delay_string_append_char(message, str, "ALL"); else _rewriteNode(BaseSelect, message, dblink, str, node->constraints); delay_string_append_char(message, str, node->deferred == TRUE ? " DEFERRED" : " IMMEDIATE"); } static void _rewriteAlterTableCmd(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, AlterTableCmd *node) { char buf[16]; switch (node->subtype) { case AT_AddColumn: delay_string_append_char(message, str, "ADD "); _rewriteNode(BaseSelect, message, dblink, str, node->def); break; case AT_ColumnDefault: delay_string_append_char(message, str, "ALTER \""); delay_string_append_char(message, str, node->name); delay_string_append_char(message, str, "\" "); if (node->def == NULL) delay_string_append_char(message, str, "DROP DEFAULT"); else { delay_string_append_char(message, str, "SET DEFAULT "); _rewriteNode(BaseSelect, message, dblink, str, node->def); } break; case AT_DropNotNull: delay_string_append_char(message, str, "ALTER \""); delay_string_append_char(message, str, node->name); delay_string_append_char(message, str, "\" DROP NOT NULL"); break; case AT_SetNotNull: delay_string_append_char(message, str, "ALTER \""); delay_string_append_char(message, str, node->name); delay_string_append_char(message, str, "\" SET NOT NULL"); break; case AT_SetStatistics: delay_string_append_char(message, str, "ALTER \""); delay_string_append_char(message, str, node->name); delay_string_append_char(message, str, "\" SET STATISTICS "); snprintf(buf, 16, "%ld", ((Value *) node->def)->val.ival); delay_string_append_char(message, str, buf); break; case AT_SetStorage: delay_string_append_char(message, str, "ALTER \""); delay_string_append_char(message, str, node->name); delay_string_append_char(message, str, "\" SET STORAGE "); delay_string_append_char(message, str, ((Value *) node->def)->val.str); break; case AT_DropColumn: delay_string_append_char(message, str, "DROP \""); delay_string_append_char(message, str, node->name); delay_string_append_char(message, str, "\" "); if (node->behavior == DROP_CASCADE) delay_string_append_char(message, str, "CASCADE"); break; case AT_AlterColumnType: delay_string_append_char(message, str, "ALTER \""); delay_string_append_char(message, str, node->name); delay_string_append_char(message, str, "\" TYPE "); _rewriteNode(BaseSelect, message, dblink, str, node->def); break; case AT_AddConstraint: delay_string_append_char(message, str, "ADD "); _rewriteNode(BaseSelect, message, dblink, str, node->def); break; case AT_DropConstraint: delay_string_append_char(message, str, "DROP CONSTRAINT \""); delay_string_append_char(message, str, node->name); delay_string_append_char(message, str, "\""); if (node->behavior == DROP_CASCADE) delay_string_append_char(message, str, " CASCADE"); break; case AT_DropOids: delay_string_append_char(message, str, "SET WITHOUT OIDS"); break; case AT_ClusterOn: delay_string_append_char(message, str, "CLUSTER ON \""); delay_string_append_char(message, str, node->name); delay_string_append_char(message, str, "\""); break; case AT_EnableAlwaysTrig: /* not implemented */ break; case AT_EnableReplicaTrig: /* not implemented */ break; case AT_DropCluster: delay_string_append_char(message, str, "SET WITHOUT CLUSTER"); break; case AT_EnableTrig: delay_string_append_char(message, str, "ENABLE TRIGGER \""); delay_string_append_char(message, str, node->name); delay_string_append_char(message, str, "\""); break; case AT_EnableTrigAll: delay_string_append_char(message, str, "ENABLE TRIGGER ALL"); break; case AT_EnableRule: /* not implemented */ break; case AT_EnableReplicaRule: /* not implemented */ break; case AT_EnableAlwaysRule: /* not implemented */ break; case AT_DisableRule: /* not implemented */ break; case AT_AddInherit: /* not implemented */ break; case AT_EnableTrigUser: delay_string_append_char(message, str, "ENABLE TRIGGER USER"); break; case AT_DisableTrig: delay_string_append_char(message, str, "DISABLE TRIGGER \""); delay_string_append_char(message, str, node->name); delay_string_append_char(message, str, "\""); break; case AT_DisableTrigAll: delay_string_append_char(message, str, "DISABLE TRIGGER ALL"); break; case AT_DisableTrigUser: delay_string_append_char(message, str, "DISABLE TRIGGER USER"); break; case AT_ChangeOwner: delay_string_append_char(message, str, "OWNER TO \""); delay_string_append_char(message, str, node->name); delay_string_append_char(message, str, "\""); break; case AT_SetTableSpace: delay_string_append_char(message, str, "SET TABLESPACE \""); delay_string_append_char(message, str, node->name); delay_string_append_char(message, str, "\""); break; case AT_SetRelOptions: /* not implemented */ break; case AT_ResetRelOptions: /* not implemented */ break; default: break; } } static void _rewriteAlterTableStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, AlterTableStmt *node) { if (node->relkind == OBJECT_TABLE) delay_string_append_char(message, str, "ALTER TABLE "); else delay_string_append_char(message, str, "ALTER INDEX "); _rewriteNode(BaseSelect, message, dblink, str, node->relation); delay_string_append_char(message, str, " "); _rewriteNode(BaseSelect, message, dblink, str, node->cmds); } static void _rewriteOptSeqList(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, List *options) { ListCell *lc; foreach (lc, options) { DefElem *e = lfirst(lc); Value *v = (Value *)e->arg; char buf[16]; if (strcmp(e->defname, "cycle") == 0) { if (v->val.ival == TRUE) delay_string_append_char(message, str, " CYCLE"); else delay_string_append_char(message, str, " NO CYCLE"); } else if (strcmp(e->defname, "minvalue") == 0 && !v) delay_string_append_char(message, str, " NO MINVALUE"); else if (strcmp(e->defname, "maxvalue") == 0 && !v) delay_string_append_char(message, str, " NO MAXVALUE"); else if (strcmp(e->defname, "owned_by") == 0) { delay_string_append_char(message, str, " OWNED BY "); _rewriteIdList(BaseSelect, message, dblink, str, (List *)e->arg); } else { if (strcmp(e->defname, "cache") == 0) delay_string_append_char(message, str, " CACHE "); else if (strcmp(e->defname, "increment") == 0) delay_string_append_char(message, str, " INCREMENT "); else if (strcmp(e->defname, "maxvalue") == 0 && v) delay_string_append_char(message, str, " MAXVALUE "); else if (strcmp(e->defname, "minvalue") == 0 && v) delay_string_append_char(message, str, " MINVALUE "); else if (strcmp(e->defname, "start") == 0) delay_string_append_char(message, str, " START "); else if (strcmp(e->defname, "restart") == 0) delay_string_append_char(message, str, " RESTART "); if (IsA(e->arg, String)) delay_string_append_char(message, str, v->val.str); else { snprintf(buf, 16, "%ld", v->val.ival); delay_string_append_char(message, str, buf); } } } } static void _rewriteCreateSeqStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CreateSeqStmt *node) { delay_string_append_char(message, str, "CREATE "); if (node->sequence->relpersistence) delay_string_append_char(message, str, "TEMP "); delay_string_append_char(message, str, "SEQUENCE "); _rewriteNode(BaseSelect, message, dblink, str, node->sequence); _rewriteOptSeqList(BaseSelect, message, dblink, str, node->options); } static void _rewriteAlterSeqStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, AlterSeqStmt *node) { delay_string_append_char(message, str, "ALTER SEQUENCE "); _rewriteNode(BaseSelect, message, dblink, str, node->sequence); _rewriteOptSeqList(BaseSelect, message, dblink, str, node->options); } static void _rewriteCreatePLangStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CreatePLangStmt *node) { delay_string_append_char(message, str, "CREATE "); if (node->pltrusted == true) delay_string_append_char(message, str, "TRUSTED "); delay_string_append_char(message, str, "LANGUAGE \""); delay_string_append_char(message, str, node->plname); delay_string_append_char(message, str, "\""); if (node->plhandler != NIL) { ListCell *lc; char dot = 0; delay_string_append_char(message, str, " HANDLER "); foreach (lc, node->plhandler) { Value *v = lfirst(lc); if (dot == 0) dot = 1; else delay_string_append_char(message, str, "."); delay_string_append_char(message, str, "\""); delay_string_append_char(message, str, v->val.str); delay_string_append_char(message, str, "\""); } } if (node->plvalidator != NIL) { ListCell *lc; char dot = 0; delay_string_append_char(message, str, " VALIDATOR "); foreach (lc, node->plvalidator) { Value *v = lfirst(lc); if (dot == 0) dot = 1; else delay_string_append_char(message, str, "."); delay_string_append_char(message, str, "\""); delay_string_append_char(message, str, v->val.str); delay_string_append_char(message, str, "\""); } } } static void _rewriteCreateTableSpaceStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CreateTableSpaceStmt *node) { delay_string_append_char(message, str, "CREATE TABLESPACE \""); delay_string_append_char(message, str, node->tablespacename); delay_string_append_char(message, str, "\" "); if (node->owner) { delay_string_append_char(message, str, "OWNER \""); delay_string_append_char(message, str, node->owner); delay_string_append_char(message, str, "\" "); } delay_string_append_char(message, str, "LOCATION '"); delay_string_append_char(message, str, node->location); delay_string_append_char(message, str, "'"); } static void _rewriteDropTableSpaceStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, DropTableSpaceStmt *node) { delay_string_append_char(message, str, "DROP TABLESPACE \""); delay_string_append_char(message, str, node->tablespacename); delay_string_append_char(message, str, "\""); } static void _rewriteFuncName(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, List *func_name) { ListCell *lc; Value *v; char dot = 0; if (func_name == NULL) return; foreach (lc, func_name) { v = (Value *) lfirst(lc); if (dot == 0) dot = 1; else delay_string_append_char(message, str, "."); if (IsA(v, String)) { delay_string_append_char(message, str, v->val.str); } } } static void _rewriteCreateTrigStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CreateTrigStmt *node) { bool has_events = false; if (node->isconstraint == TRUE) delay_string_append_char(message, str, "CREATE CONSTRAINT TRIGGER \""); else delay_string_append_char(message, str, "CREATE TRIGGER \""); delay_string_append_char(message, str, node->trigname); delay_string_append_char(message, str, "\" "); if (node->timing == TRUE) delay_string_append_char(message, str, "BEFORE "); else delay_string_append_char(message, str, "AFTER "); if (node->events & TRIGGER_TYPE_INSERT) { delay_string_append_char(message, str, "INSERT "); has_events = true; } if (node->events & TRIGGER_TYPE_DELETE) { if (has_events) delay_string_append_char(message, str, "OR "); delay_string_append_char(message, str, "DELETE "); has_events = true; } if (node->events & TRIGGER_TYPE_UPDATE) { if (has_events) delay_string_append_char(message, str, "OR "); delay_string_append_char(message, str, "UPDATE "); has_events = true; } if (node->events & TRIGGER_TYPE_TRUNCATE) { if (has_events) delay_string_append_char(message, str, "OR "); delay_string_append_char(message, str, "TRUNCATE "); has_events = true; } delay_string_append_char(message, str, "ON "); _rewriteNode(BaseSelect, message, dblink, str, node->relation); if (node->constrrel) { delay_string_append_char(message, str, " FROM "); _rewriteNode(BaseSelect, message, dblink, str, node->constrrel); } if (node->deferrable) delay_string_append_char(message, str, " DEFERRABLE"); if (node->initdeferred) delay_string_append_char(message, str, " INITIALLY DEFERRED"); if (node->row == TRUE) delay_string_append_char(message, str, " FOR EACH ROW "); else delay_string_append_char(message, str, " FOR EACH STATEMENT "); delay_string_append_char(message, str, "EXECUTE PROCEDURE "); _rewriteFuncName(BaseSelect, message, dblink, str, node->funcname); delay_string_append_char(message, str, "("); _rewriteNode(BaseSelect, message, dblink, str, node->args); delay_string_append_char(message, str, ")"); } static void _rewriteDefinition(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, List *definition) { ListCell *lc; char comma = 0; if (definition == NIL) return; delay_string_append_char(message, str, "("); foreach (lc, definition) { DefElem *e = lfirst(lc); if (comma == 0) comma = 1; else delay_string_append_char(message, str, ", "); delay_string_append_char(message, str, "\""); delay_string_append_char(message, str, e->defname); delay_string_append_char(message, str, "\""); if (e->arg) { delay_string_append_char(message, str, "="); _rewriteNode(BaseSelect, message, dblink, str, e->arg); } } delay_string_append_char(message, str, ")"); } static void _rewriteDefineStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, DefineStmt *node) { ListCell *lc; char dot = 0; switch (node->kind) { case OBJECT_AGGREGATE: delay_string_append_char(message, str, "CREATE AGGREGATE "); _rewriteFuncName(BaseSelect, message, dblink, str, node->defnames); delay_string_append_char(message, str, " "); _rewriteDefinition(BaseSelect, message, dblink, str, node->definition); break; case OBJECT_OPERATOR: delay_string_append_char(message, str, "CREATE OPERATOR "); foreach (lc, node->defnames) { Value *v = lfirst(lc); if (dot == 0) dot = 1; else delay_string_append_char(message, str, "."); delay_string_append_char(message, str, v->val.str); } delay_string_append_char(message, str, " "); _rewriteDefinition(BaseSelect, message, dblink, str, node->definition); break; case OBJECT_TYPE: delay_string_append_char(message, str, "CREATE TYPE"); _rewriteFuncName(BaseSelect, message, dblink, str, node->defnames); delay_string_append_char(message, str, " "); _rewriteDefinition(BaseSelect, message, dblink, str, node->definition); break; case OBJECT_TSPARSER: delay_string_append_char(message, str, "CREATE TEXT SEARCH PARSER "); _rewriteIdList(BaseSelect, message, dblink, str, node->defnames); _rewriteDefinition(BaseSelect, message, dblink, str, node->definition); break; case OBJECT_TSDICTIONARY: delay_string_append_char(message, str, "CREATE TEXT SEARCH DICTIONARY "); _rewriteIdList(BaseSelect, message, dblink, str, node->defnames); _rewriteDefinition(BaseSelect, message, dblink, str, node->definition); break; case OBJECT_TSTEMPLATE: delay_string_append_char(message, str, "CREATE TEXT SEARCH TEMPLATE "); _rewriteIdList(BaseSelect, message, dblink, str, node->defnames); _rewriteDefinition(BaseSelect, message, dblink, str, node->definition); break; case OBJECT_TSCONFIGURATION: delay_string_append_char(message, str, "CREATE TEXT SEARCH CONFIGURATION "); _rewriteIdList(BaseSelect, message, dblink, str, node->defnames); _rewriteDefinition(BaseSelect, message, dblink, str, node->definition); break; default: break; } } static void _rewriteOperatorName(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, List *list) { char dot = 0; ListCell *lc; foreach (lc, list) { Value *v = lfirst(lc); if (dot == 0) dot = 1; else delay_string_append_char(message, str, "."); delay_string_append_char(message, str, v->val.str); } } static void _rewriteCreateOpClassItem(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CreateOpClassItem *node) { char buf[16]; switch (node->itemtype) { case OPCLASS_ITEM_OPERATOR: delay_string_append_char(message, str, "OPERATOR "); snprintf(buf, 16, "%d", node->number); delay_string_append_char(message, str, buf); delay_string_append_char(message, str, " "); _rewriteOperatorName(BaseSelect, message, dblink, str, node->name); if (node->args != NIL) { delay_string_append_char(message, str, "("); _rewriteNode(BaseSelect, message, dblink, str, node->args); delay_string_append_char(message, str, ")"); } /* XXX if (node->recheck == TRUE) delay_string_append_char(message, str, " RECHECK"); */ break; case OPCLASS_ITEM_FUNCTION: delay_string_append_char(message, str, "FUNCTION "); snprintf(buf, 16, "%d", node->number); delay_string_append_char(message, str, buf); delay_string_append_char(message, str, " "); _rewriteFuncName(BaseSelect, message, dblink, str, node->name); delay_string_append_char(message, str, "("); _rewriteNode(BaseSelect, message, dblink, str, node->args); delay_string_append_char(message, str, ")"); break; case OPCLASS_ITEM_STORAGETYPE: delay_string_append_char(message, str, "STORAGE "); _rewriteNode(BaseSelect, message, dblink, str, node->storedtype); break; default: break; } } static void _rewriteCreateOpClassStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CreateOpClassStmt *node) { delay_string_append_char(message, str, "CREATE OPERATOR CLASS "); _rewriteFuncName(BaseSelect, message, dblink, str, node->opclassname); if (node->isDefault == TRUE) delay_string_append_char(message, str, " DEFAULT"); delay_string_append_char(message, str, " FOR TYPE "); _rewriteNode(BaseSelect, message, dblink, str, node->datatype); delay_string_append_char(message, str, " USING "); delay_string_append_char(message, str, node->amname); delay_string_append_char(message, str, " AS "); _rewriteNode(BaseSelect, message, dblink, str, node->items); } static void _rewriteDropStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, DropStmt *node) { //ListCell *lc; //char comma = 0; /* * types of drop statement * 1: DROP obj1, target2, ... * 2: DROP obj (arg1, arg2, ...) * 3: DROP obj ON obj * 0: other */ int drop_stmt_type = 1; delay_string_append_char(message, str, "DROP "); switch (node->removeType) { case OBJECT_TABLE: delay_string_append_char(message, str, "TABLE "); break; case OBJECT_SEQUENCE: delay_string_append_char(message, str, "SEQUENCE "); break; case OBJECT_VIEW: delay_string_append_char(message, str, "VIEW "); break; case OBJECT_INDEX: delay_string_append_char(message, str, "INDEX "); break; case OBJECT_TYPE: delay_string_append_char(message, str, "TYPE "); break; case OBJECT_DOMAIN: delay_string_append_char(message, str, "DOMAIN "); break; case OBJECT_CONVERSION: delay_string_append_char(message, str, "CONVERSION "); break; case OBJECT_SCHEMA: delay_string_append_char(message, str, "SCHEMA "); break; case OBJECT_FUNCTION: drop_stmt_type = 2; delay_string_append_char(message, str, "FUNCTION "); break; case OBJECT_AGGREGATE: drop_stmt_type = 2; delay_string_append_char(message, str, "AGGREGATE "); break; case OBJECT_OPERATOR: drop_stmt_type = 2; delay_string_append_char(message, str, "OPERATOR CLASS "); break; case OBJECT_TRIGGER: drop_stmt_type = 3; delay_string_append_char(message, str, "TRIGGER "); break; case OBJECT_RULE: drop_stmt_type = 3; delay_string_append_char(message, str, "RULE "); break; case OBJECT_LANGUAGE: delay_string_append_char(message, str, "LANGUAGE "); break; case OBJECT_CAST: drop_stmt_type = 0; delay_string_append_char(message, str, "CAST ("); //_rewriteNode(BaseSelect, message, dblink, str, node->objects); _rewriteFuncNameList(BaseSelect, message, dblink, str, node->objects); delay_string_append_char(message, str, " AS "); //_rewriteNode(BaseSelect, message, dblink, str, node->arguments); _rewriteFuncNameList(BaseSelect, message, dblink, str, node->arguments); delay_string_append_char(message, str, ")"); break; case OBJECT_OPCLASS: drop_stmt_type = 0; delay_string_append_char(message, str, "OPERATOR CLASS "); //_rewriteFuncName(BaseSelect, message, dblink, str, node->objects); _rewriteFuncNameList(BaseSelect, message, dblink, str, node->objects); delay_string_append_char(message, str, " USING "); //delay_string_append_char(message, str, node->arguments); _rewriteFuncNameList(BaseSelect, message, dblink, str, node->arguments); break; default: break; } /* IF EXISTS */ if (node->missing_ok) delay_string_append_char(message, str, "IF EXISTS "); switch (drop_stmt_type) { case 1: /* DROP obj1, obj2, ... */ /* foreach Array(lc, node->objects) { if (comma == 0) comma = 1; else delay_string_append_char(message, str, ", "); _rewriteFuncName(BaseSelect, message, dblink, str, lfirst(lc)); } */ _rewriteFuncNameList(BaseSelect, message, dblink, str, node->objects); break; case 2: /* DROP obj (arg1, arg2, ...) */ delay_string_append_char(message, str, " ("); _rewriteNode(BaseSelect, message, dblink, str, node->arguments); delay_string_append_char(message, str, ")"); break; case 3: /* DROP obj ON obj */ //delay_string_append_char(message, str, node->objects); // ??? _rewriteFuncNameList(BaseSelect, message, dblink, str, node->objects); delay_string_append_char(message, str, "\" ON "); _rewriteNode(BaseSelect, message, dblink, str, node->objects); break; default: break; } /* CASCADE */ if (node->behavior == DROP_CASCADE) delay_string_append_char(message, str, " CASCADE"); } static void _rewriteFuncNameList(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, List *list) { ListCell *lc; char comma = 0; foreach (lc, list) { if (comma == 0) comma = 1; else delay_string_append_char(message, str, ", "); _rewriteFuncName(BaseSelect, message, dblink, str, lfirst(lc)); } } static void _rewriteFetchStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, FetchStmt *node) { char buf[16]; snprintf(buf, 16, "%ld", node->howMany); if (node->ismove == TRUE) delay_string_append_char(message, str, "MOVE "); else delay_string_append_char(message, str, "FETCH "); switch (node->direction) { case FETCH_FORWARD: delay_string_append_char(message, str, "FORWARD "); if (node->howMany == FETCH_ALL) delay_string_append_char(message, str, "ALL "); else { delay_string_append_char(message, str, buf); delay_string_append_char(message, str, " "); } break; case FETCH_BACKWARD: delay_string_append_char(message, str, "BACKWARD "); if (node->howMany == FETCH_ALL) delay_string_append_char(message, str, "ALL "); else { delay_string_append_char(message, str, buf); delay_string_append_char(message, str, " "); } break; case FETCH_ABSOLUTE: if (node->howMany == 1) delay_string_append_char(message, str, "FIRST "); else if (node->howMany == -1) delay_string_append_char(message, str, "LAST "); else { delay_string_append_char(message, str, "ABSOLUTE "); delay_string_append_char(message, str, buf); delay_string_append_char(message, str, " "); } break; case FETCH_RELATIVE: delay_string_append_char(message, str, "RELATIVE "); delay_string_append_char(message, str, buf); delay_string_append_char(message, str, " "); break; } delay_string_append_char(message, str, "IN \""); delay_string_append_char(message, str, node->portalname); delay_string_append_char(message, str, "\""); } static void _rewritePrivilegeList(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, List *list) { ListCell *lc; char comma = 0; if (list == NIL) delay_string_append_char(message, str, "ALL"); else { foreach (lc, list) { Value *v = lfirst(lc); if (comma == 0) comma = 1; else delay_string_append_char(message, str, ", "); delay_string_append_char(message, str, v->val.str); } } } static void _rewriteFunctionParameter(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, FunctionParameter *node) { switch (node->mode) { case FUNC_PARAM_OUT: delay_string_append_char(message, str, "OUT "); break; case FUNC_PARAM_INOUT: delay_string_append_char(message, str, "INOUT "); break; default: break; } /* function name */ if (node->name) { delay_string_append_char(message, str, "\""); delay_string_append_char(message, str, node->name); delay_string_append_char(message, str, "\" "); } _rewriteNode(BaseSelect, message, dblink, str, node->argType); } static void _rewriteFuncWithArgs(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, FuncWithArgs *node) { _rewriteFuncName(BaseSelect, message, dblink, str, node->funcname); delay_string_append_char(message, str, "("); _rewriteNode(BaseSelect, message, dblink, str, node->funcargs); delay_string_append_char(message, str, ")"); } static void _rewritePrivGrantee(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, PrivGrantee *node) { if (node->rolname == NULL) delay_string_append_char(message, str, "PUBLIC"); else { delay_string_append_char(message, str, "\""); delay_string_append_char(message, str, node->rolname); delay_string_append_char(message, str, "\""); } } static void _rewriteGrantStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, GrantStmt *node) { if (node->is_grant == true) delay_string_append_char(message, str, "GRANT "); else { delay_string_append_char(message, str, "REVOKE "); if (node->grant_option == true) delay_string_append_char(message, str, "GRANT OPTION FOR "); } _rewritePrivilegeList(BaseSelect, message, dblink, str, node->privileges); delay_string_append_char(message, str, " ON "); switch (node->objtype) { case ACL_OBJECT_RELATION: _rewriteNode(BaseSelect, message, dblink, str, node->objects); break; case ACL_OBJECT_SEQUENCE: delay_string_append_char(message, str, "SEQUENCE "); _rewriteNode(BaseSelect, message, dblink, str, node->objects); break; case ACL_OBJECT_FUNCTION: delay_string_append_char(message, str, "FUNCTION "); _rewriteNode(BaseSelect, message, dblink, str, node->objects); break; case ACL_OBJECT_DATABASE: delay_string_append_char(message, str, "DATABASE "); _rewriteIdList(BaseSelect, message, dblink, str, node->objects); break; case ACL_OBJECT_LANGUAGE: delay_string_append_char(message, str, "LANGUAGE "); _rewriteIdList(BaseSelect, message, dblink, str, node->objects); break; case ACL_OBJECT_NAMESPACE: delay_string_append_char(message, str, "SCHEMA "); _rewriteIdList(BaseSelect, message, dblink, str, node->objects); break; case ACL_OBJECT_TABLESPACE: delay_string_append_char(message, str, "TABLESPACE "); _rewriteIdList(BaseSelect, message, dblink, str, node->objects); break; case ACL_OBJECT_COLUMN: case ACL_OBJECT_FDW: case ACL_OBJECT_FOREIGN_SERVER: ereport(LOG, (errmsg("rewriting GRANT statement"), errdetail("modules for ACL_OBJECT_COLUMN, ACL_OBJECT_FDW and ACL_OBJECT_FOREIGN_SERVER are not implemented yet"))); break; default: ereport(LOG, (errmsg("rewriting GRANT statement"), errdetail("unknowm node type %d", node->objtype))); break; } if (node->is_grant == true) delay_string_append_char(message, str, " TO "); else delay_string_append_char(message, str, " FROM "); _rewriteNode(BaseSelect, message, dblink, str, node->grantees); if (node->is_grant == true && node->grant_option == TRUE) delay_string_append_char(message, str, " WITH GRANT OPTION"); if (node->behavior == DROP_CASCADE) delay_string_append_char(message, str, " CASCADE"); } static void _rewriteGrantRoleStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, GrantRoleStmt *node) { if (node->is_grant == true) delay_string_append_char(message, str, "GRANT "); else { delay_string_append_char(message, str, "REVOKE "); if (node->admin_opt == true) delay_string_append_char(message, str, "ADMIN OPTION FOR "); } _rewriteIdList(BaseSelect, message, dblink, str, node->granted_roles); delay_string_append_char(message, str, node->is_grant == true ? " TO " : " FROM "); _rewriteIdList(BaseSelect, message, dblink, str, node->grantee_roles); if (node->admin_opt == true && node->is_grant == true) delay_string_append_char(message, str, " WITH ADMIN OPTION"); if (node->grantor != NULL) { delay_string_append_char(message, str, " GRANTED BY \""); delay_string_append_char(message, str, node->grantor); delay_string_append_char(message, str, "\""); } if (node->behavior == DROP_CASCADE) delay_string_append_char(message, str, " CASCADE"); } static void _rewriteFuncOptList(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, List *list) { ListCell *lc; foreach (lc, list) { DefElem *e = lfirst(lc); Value *v = (Value *) e->arg; if (strcmp(e->defname, "strict") == 0) { if (v->val.ival == TRUE) delay_string_append_char(message, str, " STRICT"); else delay_string_append_char(message, str, " CALLED ON NULL INPUT"); } else if (strcmp(e->defname, "volatility") == 0) { char *s = v->val.str; if (strcmp(s, "immutable") == 0) delay_string_append_char(message, str, " IMMUTABLE"); else if (strcmp(s, "stable") == 0) delay_string_append_char(message, str, " STABLE"); else if (strcmp(s, "volatile") == 0) delay_string_append_char(message, str, " VOLATILE"); } else if (strcmp(e->defname, "security") == 0) { if (v->val.ival == TRUE) delay_string_append_char(message, str, " SECURITY DEFINER"); else delay_string_append_char(message, str, " SECURITY INVOKER"); } else if (strcmp(e->defname, "as") == 0) { delay_string_append_char(message, str, " AS "); _rewriteNode(BaseSelect, message, dblink, str, e->arg); } else if (strcmp(e->defname, "language") == 0) { delay_string_append_char(message, str, " LANGUAGE '"); delay_string_append_char(message, str, v->val.str); delay_string_append_char(message, str, "'"); } } } static void _rewriteCreateFunctionStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CreateFunctionStmt *node) { delay_string_append_char(message, str, "CREATE "); if (node->replace == true) delay_string_append_char(message, str, "OR REPLACE "); delay_string_append_char(message, str, "FUNCTION "); _rewriteFuncName(BaseSelect, message, dblink, str, node->funcname); delay_string_append_char(message, str, " ("); _rewriteNode(BaseSelect, message, dblink, str, node->parameters); delay_string_append_char(message, str, ")"); if (node->returnType) { delay_string_append_char(message, str, " RETURNS "); _rewriteNode(BaseSelect, message, dblink, str, node->returnType); } _rewriteFuncOptList(BaseSelect, message, dblink, str, node->options); if (node->withClause) { delay_string_append_char(message, str, " WITH "); _rewriteDefinition(BaseSelect, message, dblink, str, node->withClause); } } static void _rewriteAlterFunctionStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, AlterFunctionStmt *node) { delay_string_append_char(message, str, "ALTER FUNCTION "); _rewriteNode(BaseSelect, message, dblink, str, node->func); _rewriteFuncOptList(BaseSelect, message, dblink, str, node->actions); } static void _rewriteCreateCastStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CreateCastStmt *node) { delay_string_append_char(message, str, "CREATE CAST ("); _rewriteNode(BaseSelect, message, dblink, str, node->sourcetype); delay_string_append_char(message, str, " AS "); _rewriteNode(BaseSelect, message, dblink, str, node->targettype); delay_string_append_char(message, str, ") WITH FUNCTION "); _rewriteNode(BaseSelect, message, dblink, str, node->func); switch (node->context) { case COERCION_IMPLICIT: delay_string_append_char(message, str, " AS IMPLICIT"); break; case COERCION_ASSIGNMENT: delay_string_append_char(message, str, " AS ASSIGNMENT"); break; default: break; } } static void _rewriteReindexStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, ReindexStmt *node) { delay_string_append_char(message, str, "REINDEX "); switch (node->kind) { case OBJECT_DATABASE: if (node->do_system == true && node->do_user == false) delay_string_append_char(message, str, "SYSTEM "); else delay_string_append_char(message, str, "DATABASE "); break; case OBJECT_INDEX: delay_string_append_char(message, str, "INDEX "); break; case OBJECT_TABLE: delay_string_append_char(message, str, "TABLE "); break; default: break; } if (node->relation) _rewriteNode(BaseSelect, message, dblink, str, node->relation); if (node->name) { delay_string_append_char(message, str, "\""); delay_string_append_char(message, str, (char *) node->name); delay_string_append_char(message, str, "\""); } } static void _rewriteAlterObjectSchemaStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, AlterObjectSchemaStmt *node) { delay_string_append_char(message, str, "ALTER "); switch (node->objectType) { case OBJECT_AGGREGATE: delay_string_append_char(message, str, "AGGREGATE "); _rewriteFuncName(BaseSelect, message, dblink, str, node->object); delay_string_append_char(message, str, "("); if (lfirst(list_head(node->objarg)) == NULL) delay_string_append_char(message, str, "*"); else _rewriteNode(BaseSelect, message, dblink, str, lfirst(list_head(node->objarg))); delay_string_append_char(message, str, ") SET SCHAME \""); delay_string_append_char(message, str, node->newschema); delay_string_append_char(message, str, "\""); break; case OBJECT_DOMAIN: delay_string_append_char(message, str, "DOMAIN "); _rewriteFuncName(BaseSelect, message, dblink, str, node->object); delay_string_append_char(message, str, " SET SCHEMA \""); delay_string_append_char(message, str, node->newschema); delay_string_append_char(message, str, "\""); break; case OBJECT_FUNCTION: delay_string_append_char(message, str, "FUNCTION "); _rewriteFuncName(BaseSelect, message, dblink, str, node->object); delay_string_append_char(message, str, "("); _rewriteNode(BaseSelect, message, dblink, str, node->objarg); delay_string_append_char(message, str, ") SET SCHEMA \""); delay_string_append_char(message, str, node->newschema); delay_string_append_char(message, str, "\""); break; case OBJECT_SEQUENCE: delay_string_append_char(message, str, "SEQUENCE "); _rewriteNode(BaseSelect, message, dblink, str, node->relation); delay_string_append_char(message, str, " SET SCHEMA \""); delay_string_append_char(message, str, node->newschema); delay_string_append_char(message, str, "\""); break; case OBJECT_TABLE: delay_string_append_char(message, str, "TABLE "); _rewriteNode(BaseSelect, message, dblink, str, node->relation); delay_string_append_char(message, str, " SET SCHEMA \""); delay_string_append_char(message, str, node->newschema); delay_string_append_char(message, str, "\""); break; case OBJECT_TYPE: delay_string_append_char(message, str, "TYPE "); _rewriteFuncName(BaseSelect, message, dblink, str, node->object); delay_string_append_char(message, str, " SET SCHEMA \""); delay_string_append_char(message, str, node->newschema); delay_string_append_char(message, str, "\""); break; default: break; } } static void _rewriteAlterOwnerStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, AlterOwnerStmt *node) { delay_string_append_char(message, str, "ALTER "); switch (node->objectType) { case OBJECT_AGGREGATE: delay_string_append_char(message, str, "AGGREGATE "); _rewriteFuncName(BaseSelect, message, dblink, str, node->object); delay_string_append_char(message, str, "("); if (lfirst(list_head(node->objarg)) == NULL) delay_string_append_char(message, str, "*"); else _rewriteNode(BaseSelect, message, dblink, str, lfirst(list_head(node->objarg))); delay_string_append_char(message, str, ") OWNER TO \""); delay_string_append_char(message, str, node->newowner); delay_string_append_char(message, str, "\""); break; case OBJECT_CONVERSION: delay_string_append_char(message, str, "CONVERSION "); _rewriteFuncName(BaseSelect, message, dblink, str, node->object); delay_string_append_char(message, str, " OWNER TO \""); delay_string_append_char(message, str, node->newowner); delay_string_append_char(message, str, "\""); break; case OBJECT_DATABASE: delay_string_append_char(message, str, "DATABASE \""); _rewriteIdList(BaseSelect, message, dblink, str, node->object); delay_string_append_char(message, str, "\" OWNER TO \""); delay_string_append_char(message, str, node->newowner); delay_string_append_char(message, str, "\""); break; case OBJECT_DOMAIN: delay_string_append_char(message, str, "DOMAIN "); _rewriteFuncName(BaseSelect, message, dblink, str, node->object); delay_string_append_char(message, str, " OWNER TO \""); delay_string_append_char(message, str, node->newowner); delay_string_append_char(message, str, "\""); break; case OBJECT_FUNCTION: delay_string_append_char(message, str, "FUNCTION "); _rewriteFuncName(BaseSelect, message, dblink, str, node->object); delay_string_append_char(message, str, "("); _rewriteNode(BaseSelect, message, dblink, str, node->objarg); delay_string_append_char(message, str, ") OWNER TO \""); delay_string_append_char(message, str, node->newowner); delay_string_append_char(message, str, "\""); break; case OBJECT_OPERATOR: delay_string_append_char(message, str, "OPERATOR "); _rewriteOperatorName(BaseSelect, message, dblink, str, node->object); delay_string_append_char(message, str, "("); _rewriteOperatorArgTypes(BaseSelect, message, dblink, str, node->objarg); delay_string_append_char(message, str, ") OWNER TO \""); delay_string_append_char(message, str, node->newowner); delay_string_append_char(message, str, "\""); break; case OBJECT_OPCLASS: delay_string_append_char(message, str, "OPERATOR CLASS "); _rewriteFuncName(BaseSelect, message, dblink, str, node->object); delay_string_append_char(message, str, " USING "); delay_string_append_char(message, str, linitial(node->objarg)); delay_string_append_char(message, str, " OWNER TO \""); delay_string_append_char(message, str, node->newowner); delay_string_append_char(message, str, "\""); break; case OBJECT_SCHEMA: delay_string_append_char(message, str, "SCHEMA \""); delay_string_append_char(message, str, linitial(node->object)); delay_string_append_char(message, str, "\" OWNER TO \""); delay_string_append_char(message, str, node->newowner); delay_string_append_char(message, str, "\""); break; case OBJECT_TYPE: delay_string_append_char(message, str, "TYPE "); _rewriteFuncName(BaseSelect, message, dblink, str, node->object); delay_string_append_char(message, str, " OWNER TO \""); delay_string_append_char(message, str, node->newowner); delay_string_append_char(message, str, "\""); break; case OBJECT_TABLESPACE: delay_string_append_char(message, str, "TABLESPACE \""); delay_string_append_char(message, str, linitial(node->object)); delay_string_append_char(message, str, "\" OWNER TO \""); delay_string_append_char(message, str, node->newowner); delay_string_append_char(message, str, "\""); break; default: break; } } static void _rewriteRuleStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, RuleStmt *node) { delay_string_append_char(message, str, "CREATE "); if (node->replace) delay_string_append_char(message, str, "OR REPLACE "); delay_string_append_char(message, str, "RULE \""); delay_string_append_char(message, str, node->rulename); delay_string_append_char(message, str, "\" AS ON "); switch (node->event) { case CMD_SELECT: delay_string_append_char(message, str, "SELECT"); break; case CMD_UPDATE: delay_string_append_char(message, str, "UPDATE"); break; case CMD_DELETE: delay_string_append_char(message, str, "DELETE"); break; case CMD_INSERT: delay_string_append_char(message, str, "INSERT"); break; default: break; } delay_string_append_char(message, str, " TO "); _rewriteNode(BaseSelect, message, dblink, str, node->relation); if (node->whereClause) { delay_string_append_char(message, str, " WHERE "); _rewriteNode(BaseSelect, message, dblink, str, node->whereClause); } delay_string_append_char(message, str, " DO "); if (node->instead) delay_string_append_char(message, str, "INSTEAD "); if (node->actions == NIL) delay_string_append_char(message, str, "NOTHING"); else if (list_length(node->actions) == 1) _rewriteNode(BaseSelect, message, dblink, str, linitial(node->actions)); else { ListCell *lc; char semi = 0; delay_string_append_char(message, str, "("); foreach (lc, node->actions) { if (semi == 0) semi = 1; else delay_string_append_char(message, str, ";"); _rewriteNode(BaseSelect, message, dblink, str, lfirst(lc)); } delay_string_append_char(message, str, ")"); } } static void _rewriteViewStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, ViewStmt *node) { if (node->replace) delay_string_append_char(message, str, "CREATE OR REPLACE "); else delay_string_append_char(message, str, "CREATE "); if (node->view->relpersistence == TRUE) delay_string_append_char(message, str, "TEMP "); delay_string_append_char(message, str, "VIEW "); _rewriteNode(BaseSelect, message, dblink, str, node->view); if (node->aliases) { delay_string_append_char(message, str, "("); _rewriteIdList(BaseSelect, message, dblink, str, node->aliases); delay_string_append_char(message, str, ")"); } delay_string_append_char(message, str, " AS"); _rewriteNode(BaseSelect, message, dblink, str, node->query); } static void _rewriteCreatedbOptList(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, List *options) { ListCell *lc; foreach (lc, options) { DefElem *e = lfirst(lc); Value *v = (Value *) e->arg; int sconst = false; /* keyword */ if (strcmp(e->defname, "template") == 0) delay_string_append_char(message, str, " TEMPLATE "); else if (strcmp(e->defname, "location") == 0) { delay_string_append_char(message, str, " LOCATION "); sconst = true; } else if (strcmp(e->defname, "tablespace") == 0) delay_string_append_char(message, str, " TABLESPACE "); else if (strcmp(e->defname, "encoding") == 0) { delay_string_append_char(message, str, " ENCODING "); sconst = true; } else if (strcmp(e->defname, "owner") == 0) delay_string_append_char(message, str, " OWNER "); else if (strcmp(e->defname, "connectionlimit") == 0) delay_string_append_char(message, str, " CONNECTION LIMIT "); /* value */ if (v == NULL) delay_string_append_char(message, str, "DEFAULT"); else if (IsA((Node *)v, String)) { delay_string_append_char(message, str, sconst ? "'" : "'"); delay_string_append_char(message, str, v->val.str); delay_string_append_char(message, str, sconst ? "'" : "'"); } else { char buf[16]; snprintf(buf, 16, "%ld", v->val.ival); delay_string_append_char(message, str, buf); } } } static void _rewriteCreatedbStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CreatedbStmt *node) { delay_string_append_char(message, str, "CREATE DATABASE \""); delay_string_append_char(message, str, node->dbname); delay_string_append_char(message, str, "\""); _rewriteCreatedbOptList(BaseSelect, message, dblink, str, node->options); } static void _rewriteAlterDatabaseStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, AlterDatabaseStmt *node) { delay_string_append_char(message, str, "ALTER DATABASE \""); delay_string_append_char(message, str, node->dbname); delay_string_append_char(message, str, "\" "); _rewriteCreatedbOptList(BaseSelect, message, dblink, str, node->options); } static void _rewriteAlterDatabaseSetStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, AlterDatabaseSetStmt *node) { delay_string_append_char(message, str, "ALTER DATABASE \""); delay_string_append_char(message, str, node->dbname); delay_string_append_char(message, str, "\" "); _rewriteNode(BaseSelect, message, dblink, str, node->setstmt); } static void _rewriteDropdbStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, DropdbStmt *node) { delay_string_append_char(message, str, "DROP DATABASE \""); delay_string_append_char(message, str, node->dbname); delay_string_append_char(message, str, "\""); } static void _rewriteCreateDomainStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CreateDomainStmt *node) { ListCell *lc; delay_string_append_char(message, str, "CREATE DOMAIN "); _rewriteFuncName(BaseSelect, message, dblink, str, node->domainname); delay_string_append_char(message, str, " "); _rewriteNode(BaseSelect, message, dblink, str, node->typeName); foreach (lc, node->constraints) { delay_string_append_char(message, str, " "); _rewriteNode(BaseSelect, message, dblink, str, lfirst(lc)); } } static void _rewriteAlterDomainStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, AlterDomainStmt *node) { delay_string_append_char(message, str, "ALTER DOMAIN "); _rewriteFuncName(BaseSelect, message, dblink, str, node->typeName); switch (node->subtype) { case 'T': if (node->def) { delay_string_append_char(message, str, " SET DEFAULT "); _rewriteNode(BaseSelect, message, dblink, str, node->def); } else delay_string_append_char(message, str, " DROP DEFAULT"); break; case 'N': delay_string_append_char(message, str, " DROP NOT NULL"); break; case 'O': delay_string_append_char(message, str, " SET NOT NULL"); break; case 'C': delay_string_append_char(message, str, " ADD "); _rewriteNode(BaseSelect, message, dblink, str, node->def); break; case 'X': delay_string_append_char(message, str, " DROP CONSTRAINT \""); delay_string_append_char(message, str, node->name); delay_string_append_char(message, str, "\""); if (node->behavior == DROP_CASCADE) delay_string_append_char(message, str, " CASCADE"); break; } } static void _rewriteCreateConversionStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CreateConversionStmt *node) { delay_string_append_char(message, str, "CREATE "); if (node->def == TRUE) delay_string_append_char(message, str, "DEFAULT "); delay_string_append_char(message, str, "CONVERSION "); _rewriteFuncName(BaseSelect, message, dblink, str, node->conversion_name); delay_string_append_char(message, str, " FOR '"); delay_string_append_char(message, str, node->for_encoding_name); delay_string_append_char(message, str, "' TO '"); delay_string_append_char(message, str, node->to_encoding_name); delay_string_append_char(message, str, " FROM "); _rewriteFuncName(BaseSelect, message, dblink, str, node->func_name); } static void _rewritePrepareStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, PrepareStmt *node) { delay_string_append_char(message, str, "PREPARE \""); delay_string_append_char(message, str, node->name); delay_string_append_char(message, str, "\" "); if (node->argtypes != NIL) { delay_string_append_char(message, str, "("); _rewriteNode(BaseSelect, message, dblink, str, node->argtypes); delay_string_append_char(message, str, ") "); } delay_string_append_char(message, str, "AS "); _rewriteNode(BaseSelect, message, dblink, str, node->query); } static void _rewriteExecuteStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, ExecuteStmt *node) { if (IsA(node, CreateTableAsStmt)) { IntoClause *into = ((CreateTableAsStmt *)node)->into; RangeVar *rel = into->rel; delay_string_append_char(message, str, "CREATE "); if (rel->relpersistence == TRUE) delay_string_append_char(message, str, "TEMP "); delay_string_append_char(message, str, "TABLE "); _rewriteNode(BaseSelect, message, dblink, str, into->rel); delay_string_append_char(message, str, " AS "); } delay_string_append_char(message, str, "EXECUTE \""); delay_string_append_char(message, str, node->name); delay_string_append_char(message, str, "\" "); if (node->params != NIL) { delay_string_append_char(message, str, "("); _rewriteNode(BaseSelect, message, dblink, str, node->params); delay_string_append_char(message, str, ")"); } } static void _rewriteLockStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, LockStmt *node) { delay_string_append_char(message, str, "LOCK TABLE "); _rewriteNode(BaseSelect, message, dblink, str, node->relations); delay_string_append_char(message, str, " IN "); switch (node->mode) { case AccessShareLock: delay_string_append_char(message, str, "ACCESS SHARE "); break; case RowShareLock: delay_string_append_char(message, str, "ROW SHARE "); break; case RowExclusiveLock: delay_string_append_char(message, str, "ROW EXCLUSIVE "); break; case ShareUpdateExclusiveLock: delay_string_append_char(message, str, "SHARE UPDATE EXCLUSIVE "); break; case ShareLock: delay_string_append_char(message, str, "SHARE "); break; case ShareRowExclusiveLock: delay_string_append_char(message, str, "SHARE ROW EXCLUSIVE "); break; case ExclusiveLock: delay_string_append_char(message, str, "EXCLUSIVE "); break; case AccessExclusiveLock: delay_string_append_char(message, str, "ACCESS EXCLUSIVE "); break; } delay_string_append_char(message, str, "MODE"); if (node->nowait == TRUE) delay_string_append_char(message, str, " NOWAIT"); } static void _rewriteOperatorArgTypes(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, List *args) { TypeName *left, *right; left = linitial(args); right = lsecond(args); if (left) _rewriteNode(BaseSelect, message, dblink, str, left); else delay_string_append_char(message, str, "NONE"); delay_string_append_char(message, str, ", "); if (right) _rewriteNode(BaseSelect, message, dblink, str, right); else delay_string_append_char(message, str, "NONE"); } static void _rewriteCommentStmt(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CommentStmt *node) { TypeName *t; Value *v; char buf[16]; delay_string_append_char(message, str, "COMMENT ON "); switch (node->objtype) { case OBJECT_AGGREGATE: delay_string_append_char(message, str, "AGGREGATE "); _rewriteFuncName(BaseSelect, message, dblink, str, node->objname); delay_string_append_char(message, str, "("); t = linitial(node->objargs); if (t) _rewriteNode(BaseSelect, message, dblink, str, t); else delay_string_append_char(message, str, "*"); delay_string_append_char(message, str, ")"); break; case OBJECT_FUNCTION: delay_string_append_char(message, str, "FUNCTION "); _rewriteFuncName(BaseSelect, message, dblink, str, node->objname); delay_string_append_char(message, str, "("); _rewriteNode(BaseSelect, message, dblink, str, node->objargs); delay_string_append_char(message, str, ")"); break; case OBJECT_OPERATOR: delay_string_append_char(message, str, "OPERATOR "); _rewriteOperatorName(BaseSelect, message, dblink, str, node->objname); delay_string_append_char(message, str, "("); _rewriteOperatorArgTypes(BaseSelect, message, dblink, str, node->objargs); delay_string_append_char(message, str, ")"); break; case OBJECT_CONSTRAINT: delay_string_append_char(message, str, "CONSTRAINT \""); v = lsecond(node->objname); delay_string_append_char(message, str, v->val.str); delay_string_append_char(message, str, "\" ON "); _rewriteFuncName(BaseSelect, message, dblink, str, linitial(node->objargs)); break; case OBJECT_RULE: delay_string_append_char(message, str, "RULE \""); v = lsecond(node->objname); delay_string_append_char(message, str, v->val.str); delay_string_append_char(message, str, "\" ON "); _rewriteFuncName(BaseSelect, message, dblink, str, linitial(node->objargs)); break; case OBJECT_TRIGGER: delay_string_append_char(message, str, "TRIGGER \""); v = lsecond(node->objname); delay_string_append_char(message, str, v->val.str); delay_string_append_char(message, str, "\" ON "); _rewriteFuncName(BaseSelect, message, dblink, str, linitial(node->objargs)); break; case OBJECT_OPCLASS: delay_string_append_char(message, str, "OPERATOR CLASS "); _rewriteFuncName(BaseSelect, message, dblink, str, node->objname); delay_string_append_char(message, str, " USING "); v = linitial(node->objargs); delay_string_append_char(message, str, v->val.str); break; case OBJECT_LARGEOBJECT: delay_string_append_char(message, str, "LARGE OBJECT "); v = linitial(node->objname); if (IsA(v, String)) delay_string_append_char(message, str, v->val.str); else if (IsA(v, Integer)) { snprintf(buf, 16, "%ld", v->val.ival); delay_string_append_char(message, str, buf); } break; case OBJECT_CAST: delay_string_append_char(message, str, "CAST ("); _rewriteNode(BaseSelect, message, dblink, str, linitial(node->objname)); delay_string_append_char(message, str, " AS "); _rewriteNode(BaseSelect, message, dblink, str, linitial(node->objargs)); delay_string_append_char(message, str, ")"); break; case OBJECT_LANGUAGE: delay_string_append_char(message, str, "LANGUAGE "); _rewriteFuncName(BaseSelect, message, dblink, str, node->objname); break; default: switch (node->objtype) { case OBJECT_COLUMN: delay_string_append_char(message, str, "COLUMN "); break; case OBJECT_DATABASE: delay_string_append_char(message, str, "DATABASE "); break; case OBJECT_SCHEMA: delay_string_append_char(message, str, "SCHEMA "); break; case OBJECT_INDEX: delay_string_append_char(message, str, "INDEX "); break; case OBJECT_SEQUENCE: delay_string_append_char(message, str, "SEQUENCE "); break; case OBJECT_TABLE: delay_string_append_char(message, str, "TABLE "); break; case OBJECT_DOMAIN: delay_string_append_char(message, str, "DOMAIN "); break; case OBJECT_TYPE: delay_string_append_char(message, str, "TYPE "); break; case OBJECT_VIEW: delay_string_append_char(message, str, "VIEW "); break; default: break; } _rewriteFuncName(BaseSelect, message, dblink, str, node->objname); break; } delay_string_append_char(message, str, " IS "); if (node->comment) { delay_string_append_char(message, str, "'"); delay_string_append_char(message, str, node->comment); delay_string_append_char(message, str, "'"); } else delay_string_append_char(message, str, "NULL"); } static void _rewriteRangeSubselect(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, RangeSubselect *node) { Assert(node && node->alias); int last = message->current_select; Alias *alias = node->alias; char *table_name = alias->aliasname; int sub_no = message->analyze_num; int CallFromClause = 0; int next = message->analyze_num; if(message->r_code == SELECT_AEXPR) { KeepRewriteQueryReturnCode(message, SELECT_AEXPR_FALSE); return; } if(message->r_code == SELECT_ANALYZE && message->fromClause) CallFromClause = 1; delay_string_append_char(message, str, "("); _rewriteNode(BaseSelect, message, dblink, str, node->subquery); delay_string_append_char(message, str, ")"); if(message->r_code == SELECT_ANALYZE) { AnalyzeSelect *analyze; analyze=message->analyze[sub_no]; if(node->alias->colnames) { ListCell *lc; int num = list_length(node->alias->colnames); // XXXX: segfault occurs here int ret_num = message->analyze[last + 1]->select_ret->col_num; if(num == ret_num) { char **col_list; int i = 0; col_list = (char **) palloc(sizeof(char *) * num); foreach(lc,node->alias->colnames) { Node *n = lfirst(lc); Value *value = (Value *) n; col_list[i] = value->val.str; i++; } message->analyze[last+1]->select_ret->col_list = col_list; } } message->analyze[last]->select_range = true; ereport(DEBUG2, (errmsg("_rewriteRangeSubSelect: select range ture %d",sub_no))); build_range_info(message,NULL,NULL,analyze->select_ret,table_name,last,sub_no); /*2009/07/27*/ if(CallFromClause) { int temp = message->current_select; /* now Subquery's current_select is set * change the current_select */ message->current_select = last; build_virtual_table(message,node,next); message->current_select = temp; } } else if(message->r_code == SELECT_DEFAULT && message->ignore_rewrite == -1) { Alias *alias = (Alias *) node->alias; delay_string_append_char(message, str, " AS "); delay_string_append_char(message, str, alias->aliasname); delay_string_append_char(message, str, " "); if (alias->colnames) { AnalyzeSelect *analyze; int ret_num; int i; analyze = message->analyze[last + 1]; ret_num = analyze->select_ret->col_num; delay_string_append_char(message, str, "("); for (i = 0; i< ret_num; i++) { char buf[16]; snprintf(buf, 16, "%d", analyze->select_ret->return_list[i]); delay_string_append_char(message, str," \"pool_c$"); delay_string_append_char(message, str,buf); delay_string_append_char(message, str,"\""); if(i != ret_num -1) delay_string_append_char(message, str,","); } delay_string_append_char(message, str, ")"); } } else { _rewriteNode(BaseSelect, message, dblink, str, node->alias); } } static void _rewriteRangeFunction(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, RangeFunction *node) { _rewriteNode(BaseSelect, message, dblink, str, node->functions); //TODO if (node->alias) { _rewriteNode(BaseSelect, message, dblink, str, node->alias); } if (node->coldeflist) { delay_string_append_char(message, str, " ("); _rewriteNode(BaseSelect, message, dblink, str, node->coldeflist); delay_string_append_char(message, str, ")"); } } static void _rewriteWithDefinition(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, List *def_list) { int oid = 0; if (list_length(def_list) == 1) { DefElem *elem; elem = linitial(def_list); if (strcmp(elem->defname, "oids") == 0) { Value *v = (Value *)elem->arg; if (v->val.ival == 1) delay_string_append_char(message, str, " WITH OIDS "); else delay_string_append_char(message, str, " WITHOUT OIDS "); oid = 1; } } if (oid == 1) return; delay_string_append_char(message, str, " WITH "); _rewriteDefinition(BaseSelect, message, dblink, str, def_list); } static void _rewriteCurrentOfExpr(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, CurrentOfExpr *node) { delay_string_append_char(message, str, "CURRENT OF "); if (node->cursor_name == NULL) { char n[10]; snprintf(n, sizeof(n), "$%d", node->cursor_param); delay_string_append_char(message, str, n); } else delay_string_append_char(message, str, node->cursor_name); } /* * _rewriteNode - * converts a Node into ascii string and append it to 'str' */ static void _rewriteNode(Node *BaseSelect, RewriteQuery *message, ConInfoTodblink *dblink, String *str, void *obj) { if(!obj) return; else if (IsA(obj, List) ||IsA(obj, IntList) || IsA(obj, OidList)) _rewriteList(BaseSelect, message, dblink, str, obj); else if (IsA(obj, Integer) || IsA(obj, Float) || IsA(obj, String) || IsA(obj, BitString)) { /* nodeRead does not want to see { } around these! */ _rewriteValue(BaseSelect, message, dblink, str, obj); } else { switch (nodeTag(obj)) { case T_Alias: _rewriteAlias(BaseSelect, message, dblink, str, obj); break; case T_RangeVar: _rewriteRangeVar(BaseSelect, message, dblink, str, obj); break; case T_Var: _rewriteVar(BaseSelect, message, dblink, str, obj); break; case T_Const: _rewriteConst(BaseSelect, message, dblink, str, obj); break; case T_Param: _rewriteParam(BaseSelect, message, dblink, str, obj); break; case T_Aggref: _rewriteAggref(BaseSelect, message, dblink, str, obj); break; case T_ArrayRef: _rewriteArrayRef(BaseSelect, message, dblink, str, obj); break; case T_FuncExpr: _rewriteFuncExpr(BaseSelect, message, dblink, str, obj); break; case T_NamedArgExpr: _rewriteNameArgExpr(BaseSelect, message, dblink, str, obj); break; case T_OpExpr: _rewriteOpExpr(BaseSelect, message, dblink, str, obj); break; case T_DistinctExpr: _rewriteDistinctExpr(BaseSelect, message, dblink, str, obj); break; case T_ScalarArrayOpExpr: _rewriteScalarArrayOpExpr(BaseSelect, message, dblink, str, obj); break; case T_BoolExpr: _rewriteBoolExpr(BaseSelect, message, dblink, str, obj); break; case T_SubLink: _rewriteSubLink(BaseSelect, message, dblink, str, obj); break; case T_SubPlan: _rewriteSubPlan(BaseSelect, message, dblink, str, obj); break; case T_FieldSelect: _rewriteFieldSelect(BaseSelect, message, dblink, str, obj); break; case T_FieldStore: _rewriteFieldStore(BaseSelect, message, dblink, str, obj); break; case T_RelabelType: _rewriteRelabelType(BaseSelect, message, dblink, str, obj); break; case T_ConvertRowtypeExpr: _rewriteConvertRowtypeExpr(BaseSelect, message, dblink, str, obj); break; case T_CaseExpr: _rewriteCaseExpr(BaseSelect, message, dblink, str, obj); break; case T_CaseWhen: _rewriteCaseWhen(BaseSelect, message, dblink, str, obj); break; case T_CaseTestExpr: _rewriteCaseTestExpr(BaseSelect, message, dblink, str, obj); break; case T_ArrayExpr: _rewriteArrayExpr(BaseSelect, message, dblink, str, obj); break; case T_RowExpr: _rewriteRowExpr(BaseSelect, message, dblink, str, obj); break; case T_CoalesceExpr: _rewriteCoalesceExpr(BaseSelect, message, dblink, str, obj); break; case T_MinMaxExpr: _rewriteMinMaxExpr(BaseSelect, message, dblink, str, obj); break; case T_NullIfExpr: _rewriteNullIfExpr(BaseSelect, message, dblink, str, obj); break; case T_NullTest: _rewriteNullTest(BaseSelect, message, dblink, str, obj); break; case T_BooleanTest: _rewriteBooleanTest(BaseSelect, message, dblink, str, obj); break; case T_CoerceToDomain: _rewriteCoerceToDomain(BaseSelect, message, dblink, str, obj); break; case T_CoerceToDomainValue: _rewriteCoerceToDomainValue(BaseSelect, message, dblink, str, obj); break; case T_SetToDefault: _rewriteSetToDefault(BaseSelect, message, dblink, str, obj); break; case T_TargetEntry: _rewriteTargetEntry(BaseSelect, message, dblink, str, obj); break; case T_RangeTblRef: _rewriteRangeTblRef(BaseSelect, message, dblink, str, obj); break; case T_JoinExpr: _rewriteJoinExpr(BaseSelect, message, dblink, str, obj); break; case T_FromExpr: _rewriteFromExpr(BaseSelect, message, dblink, str, obj); break; case T_CreateStmt: _rewriteCreateStmt(BaseSelect, message, dblink, str, obj); break; case T_IndexStmt: _rewriteIndexStmt(BaseSelect, message, dblink, str, obj); break; case T_NotifyStmt: _rewriteNotifyStmt(BaseSelect, message, dblink, str, obj); break; case T_DeclareCursorStmt: _rewriteDeclareCursorStmt(BaseSelect, message, dblink, str, obj); break; case T_SelectStmt: _rewriteSelectStmt(BaseSelect, message, dblink, str, obj); break; case T_ColumnDef: _rewriteColumnDef(BaseSelect, message, dblink, str, obj); break; case T_TypeName: _rewriteTypeName(BaseSelect, message, dblink, str, obj); break; case T_TypeCast: _rewriteTypeCast(BaseSelect, message, dblink, str, obj); break; case T_IndexElem: _rewriteIndexElem(BaseSelect, message, dblink, str, obj); break; case T_SortGroupClause: _rewriteSortGroupClause(BaseSelect, message, dblink, str, obj); break; case T_WindowClause: _rewriteWindowClause(BaseSelect, message, dblink, str, obj); break; case T_SetOperationStmt: _rewriteSetOperationStmt(BaseSelect, message, dblink, str, obj); break; /* case T_RangeTblEntry: _rewriteRangeTblEntry(BaseSelect, message, dblink, str, obj); break;*/ case T_A_Expr: _rewriteAExpr(BaseSelect, message, dblink, str, obj); break; case T_ColumnRef: _rewriteColumnRef(BaseSelect, message, dblink, str, obj); break; case T_ParamRef: _rewriteParamRef(BaseSelect, message, dblink, str, obj); break; case T_A_Const: _rewriteAConst(BaseSelect, message, dblink, str, obj); break; case T_A_Indices: _rewriteA_Indices(BaseSelect, message, dblink, str, obj); break; case T_A_ArrayExpr: _rewriteA_ArrayExpr(BaseSelect, message, dblink, str, obj); break; case T_A_Indirection: _rewriteA_Indirection(BaseSelect, message, dblink, str, obj); break; case T_ResTarget: _rewriteResTarget(BaseSelect, message, dblink, str, obj); break; case T_Constraint: _rewriteConstraint(BaseSelect, message, dblink, str, obj); break; case T_FuncCall: _rewriteFuncCall(BaseSelect, message, dblink, str, obj); break; case T_DefElem: _rewriteDefElem(BaseSelect, message, dblink, str, obj); break; case T_LockingClause: _rewriteLockingClause(BaseSelect, message, dblink, str, obj); break; case T_SortBy: _rewriteSortBy(BaseSelect, message, dblink, str, obj); break; case T_InsertStmt: _rewriteInsertStmt(BaseSelect, message, dblink, str, obj); break; case T_UpdateStmt: _rewriteUpdateStmt(BaseSelect, message, dblink, str, obj); break; case T_DeleteStmt: _rewriteDeleteStmt(BaseSelect, message, dblink, str, obj); break; case T_TransactionStmt: _rewriteTransactionStmt(BaseSelect, message, dblink, str, obj); break; case T_TruncateStmt: _rewriteTruncateStmt(BaseSelect, message, dblink, str, obj); break; case T_VacuumStmt: _rewriteVacuumStmt(BaseSelect, message, dblink, str, obj); break; case T_ExplainStmt: _rewriteExplainStmt(BaseSelect, message, dblink, str, obj); break; case T_ClusterStmt: _rewriteClusterStmt(BaseSelect, message, dblink, str, obj); break; case T_CheckPointStmt: _rewriteCheckPointStmt(BaseSelect, message, dblink, str, obj); break; case T_ClosePortalStmt: _rewriteClosePortalStmt(BaseSelect, message, dblink, str, obj); break; case T_ListenStmt: _rewriteListenStmt(BaseSelect, message, dblink, str, obj); break; case T_UnlistenStmt: _rewriteUnlistenStmt(BaseSelect, message, dblink, str, obj); break; case T_LoadStmt: _rewriteLoadStmt(BaseSelect, message, dblink, str, obj); break; case T_CopyStmt: _rewriteCopyStmt(BaseSelect, message, dblink, str, obj); break; case T_DeallocateStmt: _rewriteDeallocateStmt(BaseSelect, message, dblink, str, obj); break; case T_RenameStmt: _rewriteRenameStmt(BaseSelect, message, dblink, str, obj); break; case T_CreateRoleStmt: _rewriteCreateRoleStmt(BaseSelect, message, dblink, str, obj); break; case T_AlterRoleStmt: _rewriteAlterRoleStmt(BaseSelect, message, dblink, str, obj); break; case T_AlterRoleSetStmt: _rewriteAlterRoleSetStmt(BaseSelect, message, dblink, str, obj); break; case T_DropRoleStmt: _rewriteDropRoleStmt(BaseSelect, message, dblink, str, obj); break; case T_CreateSchemaStmt: _rewriteCreateSchemaStmt(BaseSelect, message, dblink, str, obj); break; case T_VariableSetStmt: _rewriteVariableSetStmt(BaseSelect, message, dblink, str, obj); break; case T_VariableShowStmt: _rewriteVariableShowStmt(BaseSelect, message, dblink, str, obj); break; case T_ConstraintsSetStmt: _rewriteConstraintsSetStmt(BaseSelect, message, dblink, str, obj); break; case T_AlterTableStmt: _rewriteAlterTableStmt(BaseSelect, message, dblink, str, obj); break; case T_AlterTableCmd: _rewriteAlterTableCmd(BaseSelect, message, dblink, str, obj); break; case T_CreateSeqStmt: _rewriteCreateSeqStmt(BaseSelect, message, dblink, str, obj); break; case T_AlterSeqStmt: _rewriteAlterSeqStmt(BaseSelect, message, dblink, str, obj); break; case T_CreatePLangStmt: _rewriteCreatePLangStmt(BaseSelect, message, dblink, str, obj); break; case T_CreateTableSpaceStmt: _rewriteCreateTableSpaceStmt(BaseSelect, message, dblink, str, obj); break; case T_DropTableSpaceStmt: _rewriteDropTableSpaceStmt(BaseSelect, message, dblink, str, obj); break; case T_CreateTrigStmt: _rewriteCreateTrigStmt(BaseSelect, message, dblink, str, obj); break; case T_DefineStmt: _rewriteDefineStmt(BaseSelect, message, dblink, str, obj); break; case T_CreateOpClassStmt: _rewriteCreateOpClassStmt(BaseSelect, message, dblink, str, obj); break; case T_CreateOpClassItem: _rewriteCreateOpClassItem(BaseSelect, message, dblink, str, obj); break; case T_DropStmt: _rewriteDropStmt(BaseSelect, message, dblink, str, obj); break; case T_FetchStmt: _rewriteFetchStmt(BaseSelect, message, dblink, str, obj); break; case T_GrantStmt: _rewriteGrantStmt(BaseSelect, message, dblink, str, obj); break; case T_FuncWithArgs: _rewriteFuncWithArgs(BaseSelect, message, dblink, str, obj); break; case T_FunctionParameter: _rewriteFunctionParameter(BaseSelect, message, dblink, str, obj); break; case T_PrivGrantee: _rewritePrivGrantee(BaseSelect, message, dblink, str, obj); break; case T_GrantRoleStmt: _rewriteGrantRoleStmt(BaseSelect, message, dblink, str, obj); break; case T_CreateFunctionStmt: _rewriteCreateFunctionStmt(BaseSelect, message, dblink, str, obj); break; case T_AlterFunctionStmt: _rewriteAlterFunctionStmt(BaseSelect, message, dblink, str, obj); break; case T_CreateCastStmt: _rewriteCreateCastStmt(BaseSelect, message, dblink, str, obj); break; case T_ReindexStmt: _rewriteReindexStmt(BaseSelect, message, dblink, str, obj); break; case T_AlterObjectSchemaStmt: _rewriteAlterObjectSchemaStmt(BaseSelect, message, dblink, str, obj); break; case T_AlterOwnerStmt: _rewriteAlterOwnerStmt(BaseSelect, message, dblink, str, obj); break; case T_RuleStmt: _rewriteRuleStmt(BaseSelect, message, dblink, str, obj); break; case T_ViewStmt: _rewriteViewStmt(BaseSelect, message, dblink, str, obj); break; case T_CreatedbStmt: _rewriteCreatedbStmt(BaseSelect, message, dblink, str, obj); break; case T_AlterDatabaseStmt: _rewriteAlterDatabaseStmt(BaseSelect, message, dblink, str, obj); break; case T_AlterDatabaseSetStmt: _rewriteAlterDatabaseSetStmt(BaseSelect, message, dblink, str, obj); break; case T_DropdbStmt: _rewriteDropdbStmt(BaseSelect, message, dblink, str, obj); break; case T_CreateDomainStmt: _rewriteCreateDomainStmt(BaseSelect, message, dblink, str, obj); break; case T_AlterDomainStmt: _rewriteAlterDomainStmt(BaseSelect, message, dblink, str, obj); break; case T_CreateConversionStmt: _rewriteCreateConversionStmt(BaseSelect, message, dblink, str, obj); break; case T_PrepareStmt: _rewritePrepareStmt(BaseSelect, message, dblink, str, obj); break; case T_ExecuteStmt: _rewriteExecuteStmt(BaseSelect, message, dblink, str, obj); break; case T_LockStmt: _rewriteLockStmt(BaseSelect, message, dblink, str, obj); break; case T_CommentStmt: _rewriteCommentStmt(BaseSelect, message, dblink, str, obj); break; case T_RangeSubselect: _rewriteRangeSubselect(BaseSelect, message, dblink, str, obj); break; case T_RangeFunction: _rewriteRangeFunction(BaseSelect, message, dblink, str, obj); break; case T_CurrentOfExpr: _rewriteCurrentOfExpr(BaseSelect, message, dblink, str, obj); break; case T_DiscardStmt: case T_CreateOpFamilyStmt: case T_AlterOpFamilyStmt: case T_CreateEnumStmt: case T_DropOwnedStmt: case T_ReassignOwnedStmt: case T_AlterTSDictionaryStmt: case T_AlterTSConfigurationStmt: case T_XmlSerialize: break; default: KeepRewriteQueryCode(message, SELECT_RELATION_ERROR); break; } } } /* * nodeToString - * returns the ascii representation of the Node as a palloc'd string */ void nodeToRewriteString(RewriteQuery *message, ConInfoTodblink *dblink, void *obj) { String *str; str = init_string(""); message->analyze_num = 0; _rewriteNode(NULL, message, dblink, str, obj); message->rewrite_query = str->data; } pgpool-II-3.4.3/src/parallel_query/pool_rewrite_query.c0000664000076400007640000005222112554350605020175 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2010 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation, and that the name of the * author not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. The author makes no representations about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * * pool_rewrite_query.c: rewrite_query * */ #include "pool.h" #include "pool_config.h" #include "parallel_query/pool_rewrite_query.h" #include "protocol/pool_proto_modules.h" #include "context/pool_session_context.h" #include "utils/elog.h" #include #include #include static int getInsertRule(ListCell *lc,List *list_t ,DistDefInfo *info, int div_key_num); static void examInsertStmt(Node *node,POOL_CONNECTION_POOL *backend,RewriteQuery *message); static void examSelectStmt(Node *node,POOL_CONNECTION_POOL *backend,RewriteQuery *message); static char *delimistr(char *str); static int direct_parallel_query(RewriteQuery *message); static void initMessage(RewriteQuery *message); static void initdblink(ConInfoTodblink *dblink, POOL_CONNECTION_POOL *backend); static void analyze_debug(RewriteQuery *message); /* create error message */ char *pool_error_message(char *message) { String *str; str = init_string(""); string_append_char(str,message); return str->data; } /* * search DistDefInfo(this info is build in starting process * and get node id where a query send. */ static int getInsertRule(ListCell *lc,List *list_t ,DistDefInfo *info,int div_key_num) { int loop_counter = 0; int node_number = -1; ListCell *cell; if(list_t->length != 1) return -1; cell = list_head(list_t); if(!cell && !IsA(cell,List)) return 1; foreach(lc,lfirst(cell)) { A_Const *constant; Value value; void *obj = NULL; obj = lfirst(lc); /* it supports casting syntax such as "A::B::C" */ while (obj && IsA(obj, TypeCast)) { TypeCast *type = (TypeCast *) obj; obj = type->arg; } if(!obj || !IsA(obj, A_Const)) return -1; if (loop_counter == div_key_num) { constant = (A_Const *) obj; value = constant->val; if (value.type == T_Integer) { char temp[16]; sprintf(temp,"%ld",value.val.ival); node_number = pool_get_id(info,temp); break; } else { if(value.val.str) node_number = pool_get_id(info, value.val.str); else return -1; break; } } loop_counter++; } /* if node_number is -1, cannot get return value from pool_get_id() */ return node_number; } /* * This function processes the decision whether to * distribute the insert sentence to the node. */ static void examInsertStmt(Node *node,POOL_CONNECTION_POOL *backend, RewriteQuery *message) { RangeVar *table; int cell_num; int node_number; DistDefInfo *info = NULL; ListCell *lc = NULL; List *list_t = NULL; int div_key_num = 0; int dist_def_flag = 0; InsertStmt *insert = (InsertStmt *) node; message->type = node->type; /* insert target table */ table = insert->relation; if (!table) { /* send error message to frontend */ message->r_code = INSERT_SQL_RESTRICTION; message->r_node = -1; message->rewrite_query = pool_error_message("cannot find table name"); return; } info = pool_get_dist_def_info(MASTER_CONNECTION(backend)->sp->database, table->schemaname, table->relname); if (!info) { /* send error message to frontend */ message->r_code = INSERT_DIST_NO_RULE; return; } /* the source SELECT ? */ if (insert->selectStmt && ((SelectStmt *)insert->selectStmt)->targetList) { /* send error message to frontend */ message->r_code = INSERT_SQL_RESTRICTION; message->r_node = -1; message->rewrite_query = pool_error_message("cannot use SelectStmt in InsertStmt"); return; } list_t = insert->selectStmt ? (List *)(((SelectStmt *)insert->selectStmt)->valuesLists) : NULL; if (!list_t) { /* send error message to frontend */ message->r_code = INSERT_SQL_RESTRICTION; message->r_node = -1; message->rewrite_query = pool_error_message("cannot find target List"); return; } /* number of target list */ if(list_t->length == 1 && IsA(lfirst(list_head(list_t)),List)) { cell_num = ((List *) lfirst(list_head(list_t)))->length; } else { /* send error message to frontend */ message->r_code = INSERT_SQL_RESTRICTION; message->r_node = -1; message->rewrite_query = pool_error_message("cannot analyze this InsertStmt"); return; } /* Is the target columns ?*/ if (!insert->cols) { div_key_num = info->dist_key_col_id; dist_def_flag = 1; ereport(DEBUG2, (errmsg("cell number %d, div key num %d, div_key columname %s",cell_num,div_key_num,info->col_list[div_key_num]))); if (cell_num < div_key_num) { /* send error message to frontend */ message->r_code = INSERT_SQL_RESTRICTION; message->r_node = -1; message->rewrite_query = pool_error_message("cannot find dividing key in InsertStmt"); return; } } else { List *list_cols = (List *) insert->cols; foreach(lc, list_cols) { Node *n; ResTarget *target; n = lfirst(lc); target = (ResTarget *) n; if (strcmp(target->name,info->dist_key_col_name) == 0) { dist_def_flag = 1; break; } div_key_num++; } if (cell_num < div_key_num) { /* send error message to frontend */ message->r_code = INSERT_SQL_RESTRICTION; message->r_node = -1; message->rewrite_query = pool_error_message("cannot find dividing key in InsertStmt"); return; } } if (dist_def_flag != 1) { /* send error message to frontend */ message->r_code = INSERT_SQL_RESTRICTION; message->r_node = -1; message->rewrite_query = pool_error_message("cannot find dividing key in InsertStmt"); return; } /* this loop get insert one args of divide rule */ node_number = getInsertRule(lc, list_t, info, div_key_num); if (node_number < 0) { /* send error message to frontend */ message->r_code = INSERT_SQL_RESTRICTION; message->r_node = -1; message->rewrite_query = pool_error_message("cannot get node_id from system db"); return; } ereport(DEBUG1, (errmsg("insert node_number = %d",node_number))); message->r_code = 0; message->r_node = node_number; message->rewrite_query = nodeToString(node); } /* start of rewriting query */ static void examSelectStmt(Node *node,POOL_CONNECTION_POOL *backend,RewriteQuery *message) { static ConInfoTodblink dblink; /* initialize dblink info */ initdblink(&dblink,backend); /* initialize message */ initMessage(message); message->type = node->type; message->r_code = SELECT_DEFAULT; /* do rewrite query */ nodeToRewriteString(message,&dblink,node); } /* initialize Message */ static void initMessage(RewriteQuery *message) { message->r_code = 0; message->r_node = 0; message->column = 0; message->virtual_num = 0; message->is_pg_catalog = false; message->is_loadbalance = false; message->is_parallel = false; message->table_relname = NULL; message->table_alias = NULL; message->dbname = NULL; message->schemaname = NULL; message->rewrite_query = NULL; message->rewritelock = -1; message->ignore_rewrite = -1; message->ret_num = 0; } /* set dblink info */ static void initdblink(ConInfoTodblink *dblink,POOL_CONNECTION_POOL *backend) { dblink->dbname = MASTER_CONNECTION(backend)->sp->database; dblink->hostaddr = pool_config->pgpool2_hostname; dblink->user = MASTER_CONNECTION(backend)->sp->user; dblink->port = pool_config->port; dblink->password = MASTER_CONNECTION(backend)->con->password; } /* reference of pg_catalog or not */ int IsSelectpgcatalog(Node *node,POOL_CONNECTION_POOL *backend) { static ConInfoTodblink dblink; static RewriteQuery message; /* initialize dblink info */ initdblink(&dblink,backend); /* initialize message */ initMessage(&message); message.type = node->type; initdblink(&dblink,backend); if(message.is_pg_catalog) return 1; return 0; } /* * SELECT statement or INSERT statement is special, * peculiar process is needed in parallel mode. */ RewriteQuery *rewrite_query_stmt(Node *node,POOL_CONNECTION *frontend,POOL_CONNECTION_POOL *backend,RewriteQuery *message) { MemoryContext oldContext = CurrentMemoryContext; PG_TRY(); { switch(node->type) { case T_SelectStmt: { SelectStmt *stmt = (SelectStmt *)node; /* Because "SELECT INTO" cannot be used in a parallel mode, * the error message is generated and send "ready for query" to frontend. */ if(stmt->intoClause) { pool_send_error_message(frontend, MAJOR(backend), "XX000", "pgpool2 sql restriction", "cannot use select into ...", "", __FILE__, __LINE__); pool_send_readyforquery(frontend); message->status=POOL_CONTINUE; break; } /* * The Query is actually rewritten based on analytical information on the Query. */ examSelectStmt(node,backend,message); if (message->r_code != SELECT_PGCATALOG && message->r_code != SELECT_RELATION_ERROR) { /* * The rewritten Query is transmitted to system db, * and execution status is received. */ POOL_CONNECTION_POOL_SLOT *system_db = pool_system_db_connection(); message->status = OneNode_do_command(frontend, system_db->con, message->rewrite_query, backend->info->database); } else { if(TSTATE(backend, MASTER_NODE_ID) == 'T' && message->r_code == SELECT_RELATION_ERROR) { /* * In the case of message->r_code == SELECT_RELATION_ERROR and in the transaction, * Transmit the Query to all back ends, and to abort transaction. */ ereport(DEBUG1, (errmsg("rewriting query statement(INSERT)"), errdetail("Inside transaction. Abort transaction"))); message->rewrite_query = nodeToString(node); message->status = pool_parallel_exec(frontend,backend,message->rewrite_query,node,true); } else { /* * Other cases of message->r_code == SELECT_RELATION_ERROR * or SELECT_PG_CATALOG, * Transmit the Query to Master node and receive status. */ ereport(DEBUG1, (errmsg("rewriting query statement"), errdetail("executed by Master"))); message->rewrite_query = nodeToString(node); message->status = OneNode_do_command(frontend, MASTER(backend), message->rewrite_query, backend->info->database); } } ereport(DEBUG1, (errmsg("rewriting query statement"), errdetail("select message_code %d",message->r_code))); } break; case T_InsertStmt: /* The distribution of the INSERT sentence. */ examInsertStmt(node,backend,message); if(message->r_code == 0 ) { /* send the INSERT sentence */ message->status = OneNode_do_command(frontend, CONNECTION(backend,message->r_node), message->rewrite_query, backend->info->database); } else if (message->r_code == INSERT_SQL_RESTRICTION) { /* Restriction case of INSERT sentence */ pool_send_error_message(frontend, MAJOR(backend), "XX000", "pgpool2 sql restriction", message->rewrite_query, "", __FILE__, __LINE__); if(TSTATE(backend, MASTER_NODE_ID) == 'T') { /* In Transaction, send the invalid message to backend to abort this transaction */ ereport(DEBUG1, (errmsg("rewriting query statement(INSERT)"), errdetail("Inside transaction. Abort transaction"))); message->status = pool_parallel_exec(frontend,backend, "POOL_RESET_TSTATE",node,false); } else { /* return "ready for query" to frontend */ pool_send_readyforquery(frontend); message->status=POOL_CONTINUE; } } break; #if 0 case T_UpdateStmt: /* Improve UpdateStmt for complex query */ break; #endif default: message->type = node->type; message->status = POOL_CONTINUE; break; } } PG_CATCH(); { message->status= POOL_END; MemoryContextSwitchTo(oldContext); FlushErrorState(); } PG_END_TRY(); ereport(DEBUG2, (errmsg("rewriting query statement"), errdetail("query rule %d",node->type))); return message; } #define POOL_PARALLEL "pool_parallel" #define POOL_LOADBALANCE "pool_loadbalance" /* * After analyzing query, check the analyze[0]->state. * if the analyze[0]->state ==`P`, this query can be executed * on parallel engine. */ static int direct_parallel_query(RewriteQuery *message) { if(message && message->analyze[0] && message->analyze[0]->state == 'P') return 1; else return 0; } /* escape delimiter character */ static char *delimistr(char *str) { char *result; int i,j = 0; int len = strlen(str); result = palloc(len -1); for(i = 0; i < len; i++) { char c = (unsigned char) str[i]; if((i != 0) && (i != len -1)) { if(c=='\'' && (char) str[i+1]=='\'') i++; result[j] = c; j++; } } result[j] = '\0'; return result; } /* for debug */ void analyze_debug(RewriteQuery *message) { int analyze_num,i; analyze_num = message->analyze_num; for(i = 0; i< analyze_num; i++) { AnalyzeSelect *analyze = message->analyze[i]; ereport(DEBUG1, (errmsg("analyze_debug :select no(%d), last select(%d), last_part(%d), state(%c)", analyze->now_select,analyze->last_select,analyze->call_part,analyze->state))); } } /* * This function checks the KEYWORD(POOL_PARALLEL,POOL_LOADBALANCE) * if the special function(like pool_parallel() or pool_loadbalance()) * is used, mark the r_code,is_parallel and is_loadbalance. * In other cases, It is necessary to analyze the Query. */ RewriteQuery *is_parallel_query(Node *node, POOL_CONNECTION_POOL *backend) { static RewriteQuery message; static ConInfoTodblink dblink; initMessage(&message); if (IsA(node, SelectStmt)) { SelectStmt *stmt; Node *n; int direct_ok; stmt = (SelectStmt *) node; /* Check the special function is used in this query*/ if (!(stmt->distinctClause || stmt->intoClause || stmt->fromClause || stmt->groupClause || stmt->havingClause || stmt->sortClause || stmt->limitOffset || stmt->limitCount || stmt->lockingClause || stmt->larg || stmt->rarg) && (n = lfirst(list_head(stmt->targetList))) && IsA(n, ResTarget)) { ResTarget *target = (ResTarget *) n; if (target->val && IsA(target->val, FuncCall)) { FuncCall *func = (FuncCall *) target->val; if (list_length(func->funcname) == 1 && func->args) { Node *func_args = (Node *) lfirst(list_head(func->args)); message.rewrite_query = delimistr(nodeToString(func_args)); /* pool_parallel() is used in this query */ if(strcmp(strVal(lfirst(list_head(func->funcname))), POOL_PARALLEL) == 0) { message.r_code = SEND_PARALLEL_ENGINE; message.is_parallel = true; message.is_loadbalance = false; ereport(DEBUG1, (errmsg("checking if query can be executed in parallel mode"), errdetail("pool_parallel_exec \"%s\"",message.rewrite_query))); return &message; } else /* pool_loadbalance() is used in this query */ if(strcmp(strVal(lfirst(list_head(func->funcname))), POOL_LOADBALANCE) == 0) { message.r_code = SEND_LOADBALANCE_ENGINE; message.is_loadbalance = true; message.is_parallel = false; ereport(DEBUG1, (errmsg("checking if query can be executed in parallel mode"), errdetail("loadbalance_mode \"%s\"",message.rewrite_query))); return &message; } } } } /* ANALYZE QUERY */ message.r_code = SELECT_ANALYZE; message.is_loadbalance = true; initdblink(&dblink,backend); nodeToRewriteString(&message,&dblink,node); if(message.is_pg_catalog) { message.is_loadbalance = false; message.is_parallel = false; ereport(DEBUG1, (errmsg("checking if query can be executed in parallel mode"), errdetail("query is load balanced (pgcatalog)"))); return &message; } if(message.is_loadbalance) { message.is_parallel = false; ereport(DEBUG1, (errmsg("checking if query can be executed in parallel mode"), errdetail("query is load balanced"))); return &message; } /* Analyzing Query Start */ analyze_debug(&message); /* After the analyzing query, * this query can be executed as parallel exec, is_parallel flag is turned on */ direct_ok = direct_parallel_query(&message); if(direct_ok == 1) { message.rewrite_query = nodeToString(node); message.is_parallel = true; message.is_loadbalance = false; ereport(DEBUG1, (errmsg("checking if query can be executed in parallel mode"), errdetail("query: \"%s\"",message.rewrite_query))); return &message; } } else if (IsA(node, CopyStmt)) { /* For Copy Statement, check the table name, mark the is_parallel flag. */ CopyStmt *stmt = (CopyStmt *)node; if (stmt->is_from == FALSE && stmt->filename == NULL) { RangeVar *relation = (RangeVar *)stmt->relation; /* check on distribution table or replicate table */ if(pool_get_dist_def_info (MASTER_CONNECTION(backend)->sp->database, relation->schemaname, relation->relname)) { message.rewrite_query = nodeToString(stmt); message.is_parallel = true; message.is_loadbalance = false; message.r_code = SEND_PARALLEL_ENGINE; } } } return &message; } POOL_STATUS pool_do_parallel_query(POOL_CONNECTION *frontend, POOL_CONNECTION_POOL *backend, Node *node, bool *parallel, char **string, int *len) { /* The Query is analyzed first in a parallel mode(in_parallel_query), * and, next, the Query is rewritten(rewrite_query_stmt). */ /* analyze the query */ RewriteQuery *r_query = is_parallel_query(node,backend); if(r_query->is_loadbalance) { /* Usual processing of pgpool is done by using the rewritten Query * if judged a possible load-balancing as a result of analyzing * the Query. * Of course, the load is distributed only for load_balance_mode=true. */ if(r_query->r_code == SEND_LOADBALANCE_ENGINE) { /* use rewritten query */ *string = r_query->rewrite_query; /* change query length */ *len = strlen(*string)+1; } ereport(DEBUG1, (errmsg("doing parallel query"), errdetail("load balancing query: \"%s\"",*string))); } else if (r_query->is_parallel) { /* * For the Query that the parallel processing is possible. * Call parallel exe engine and return status to the upper layer. */ POOL_STATUS stats = pool_parallel_exec(frontend,backend,r_query->rewrite_query, node,true); pool_unset_query_in_progress(); return stats; } else if(!r_query->is_pg_catalog) { /* rewrite query and execute */ r_query = rewrite_query_stmt(node,frontend,backend,r_query); if(r_query->type == T_InsertStmt) { /* free_parser(); */ if(r_query->r_code != INSERT_DIST_NO_RULE) { pool_unset_query_in_progress(); pool_set_skip_reading_from_backends(); return r_query->status; } } else if(r_query->type == T_SelectStmt) { pool_unset_query_in_progress(); pool_set_skip_reading_from_backends(); return r_query->status; } } *parallel = false; return POOL_CONTINUE; } pgpool-II-3.4.3/src/context/0002775000076400007640000000000012554350617012620 500000000000000pgpool-II-3.4.3/src/context/pool_query_context.c0000664000076400007640000011613312554350605016646 00000000000000/* -*-pgsql-c-*- */ /* * * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2014 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation, and that the name of the * author not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. The author makes no representations about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * */ #include "pool.h" #include "pool_config.h" #include "protocol/pool_proto_modules.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "utils/elog.h" #include "utils/pool_select_walker.h" #include "context/pool_session_context.h" #include "context/pool_query_context.h" #include "parser/nodes.h" #include #include #include /* * Where to send query */ typedef enum { POOL_PRIMARY, POOL_STANDBY, POOL_EITHER, POOL_BOTH } POOL_DEST; #define CHECK_QUERY_CONTEXT_IS_VALID \ do { \ if (!query_context) \ ereport(ERROR, \ (errmsg("setting db node for query to be sent, no query context")));\ } while (0) static POOL_DEST send_to_where(Node *node, char *query); static void where_to_send_deallocate(POOL_QUERY_CONTEXT *query_context, Node *node); static char* remove_read_write(int len, const char *contents, int *rewritten_len); /* * Create and initialize per query session context */ POOL_QUERY_CONTEXT *pool_init_query_context(void) { MemoryContext memory_context = AllocSetContextCreate(QueryContext, "QueryContextMemoryContext", ALLOCSET_SMALL_MINSIZE, ALLOCSET_SMALL_INITSIZE, ALLOCSET_SMALL_MAXSIZE); MemoryContext oldcontext = MemoryContextSwitchTo(memory_context); POOL_QUERY_CONTEXT *qc; qc = palloc0(sizeof(*qc)); qc->memory_context = memory_context; MemoryContextSwitchTo(oldcontext); return qc; } /* * Destroy query context */ void pool_query_context_destroy(POOL_QUERY_CONTEXT *query_context) { POOL_SESSION_CONTEXT *session_context; if (query_context) { MemoryContext memory_context = query_context->memory_context; session_context = pool_get_session_context(false); pool_unset_query_in_progress(); query_context->original_query = NULL; session_context->query_context = NULL; pfree(query_context); MemoryContextDelete(memory_context); } } /* * Start query */ void pool_start_query(POOL_QUERY_CONTEXT *query_context, char *query, int len, Node *node) { POOL_SESSION_CONTEXT *session_context; if (query_context) { MemoryContext old_context; session_context = pool_get_session_context(false); old_context = MemoryContextSwitchTo(query_context->memory_context); query_context->original_length = len; query_context->rewritten_length = -1; query_context->original_query = pstrdup(query); query_context->rewritten_query = NULL; query_context->parse_tree = node; query_context->virtual_master_node_id = my_master_node_id; query_context->is_cache_safe = false; query_context->num_original_params = -1; if (pool_config->memory_cache_enabled) query_context->temp_cache = pool_create_temp_query_cache(query); pool_set_query_in_progress(); session_context->query_context = query_context; MemoryContextSwitchTo(old_context); } } /* * Specify DB node to send query */ void pool_set_node_to_be_sent(POOL_QUERY_CONTEXT *query_context, int node_id) { CHECK_QUERY_CONTEXT_IS_VALID; if (node_id < 0 || node_id >= MAX_NUM_BACKENDS) ereport(ERROR, (errmsg("setting db node for query to be sent, invalid node id:%d",node_id), errdetail("backend node id: %d out of range, node id can be between 0 and %d",node_id,MAX_NUM_BACKENDS))); query_context->where_to_send[node_id] = true; return; } /* * Unspecify DB node to send query */ void pool_unset_node_to_be_sent(POOL_QUERY_CONTEXT *query_context, int node_id) { CHECK_QUERY_CONTEXT_IS_VALID; if (node_id < 0 || node_id >= MAX_NUM_BACKENDS) ereport(ERROR, (errmsg("un setting db node for query to be sent, invalid node id:%d",node_id), errdetail("backend node id: %d out of range, node id can be between 0 and %d",node_id,MAX_NUM_BACKENDS))); query_context->where_to_send[node_id] = false; return; } /* * Clear DB node map */ void pool_clear_node_to_be_sent(POOL_QUERY_CONTEXT *query_context) { CHECK_QUERY_CONTEXT_IS_VALID; memset(query_context->where_to_send, false, sizeof(query_context->where_to_send)); return; } /* * Set all DB node map entry */ void pool_setall_node_to_be_sent(POOL_QUERY_CONTEXT *query_context) { int i; POOL_SESSION_CONTEXT *sc; sc = pool_get_session_context(false); CHECK_QUERY_CONTEXT_IS_VALID; for (i=0;imaster_slave_mode && !strcmp(pool_config->master_slave_sub_mode, MODE_STREAMREP) && i != PRIMARY_NODE_ID && i != sc->load_balance_node_id) { continue; } query_context->where_to_send[i] = true; } } return; } /* * Return true if multiple nodes are targets */ bool pool_multi_node_to_be_sent(POOL_QUERY_CONTEXT *query_context) { int i; int cnt = 0; CHECK_QUERY_CONTEXT_IS_VALID; for (i=0;iwhere_to_send[i]) { cnt++; if (cnt > 1) { return true; } } } return false; } /* * Return if the DB node is needed to send query */ bool pool_is_node_to_be_sent(POOL_QUERY_CONTEXT *query_context, int node_id) { CHECK_QUERY_CONTEXT_IS_VALID; if (node_id < 0 || node_id >= MAX_NUM_BACKENDS) ereport(ERROR, (errmsg("checking if db node is needed to be sent, invalid node id:%d",node_id), errdetail("backend node id: %d out of range, node id can be between 0 and %d",node_id,MAX_NUM_BACKENDS))); return query_context->where_to_send[node_id]; } /* * Returns true if the DB node is needed to send query. * Intended to be called from VALID_BACKEND */ bool pool_is_node_to_be_sent_in_current_query(int node_id) { POOL_SESSION_CONTEXT *sc; if (RAW_MODE) return node_id == REAL_MASTER_NODE_ID; sc = pool_get_session_context(true); if (!sc) return true; if (pool_is_query_in_progress() && sc->query_context) { return pool_is_node_to_be_sent(sc->query_context, node_id); } return true; } /* * Returns virtual master DB node id, */ int pool_virtual_master_db_node_id(void) { POOL_SESSION_CONTEXT *sc; sc = pool_get_session_context(true); if (!sc) { return REAL_MASTER_NODE_ID; } if (sc->query_context) { return sc->query_context->virtual_master_node_id; } /* * No query context exists. If in master/slave mode, returns * primary node if exists. Otherwise returns my_master_node_id, * which represents the last REAL_MASTER_NODE_ID. */ if (MASTER_SLAVE) { return PRIMARY_NODE_ID; } return my_master_node_id; } /* * Decide where to send queries(thus expecting response) */ void pool_where_to_send(POOL_QUERY_CONTEXT *query_context, char *query, Node *node) { POOL_SESSION_CONTEXT *session_context; POOL_CONNECTION_POOL *backend; int i; CHECK_QUERY_CONTEXT_IS_VALID; session_context = pool_get_session_context(false); backend = session_context->backend; /* * Zap out DB node map */ pool_clear_node_to_be_sent(query_context); /* * If there is "NO LOAD BALANCE" comment, we send only to master node. */ if (!strncasecmp(query, NO_LOAD_BALANCE, NO_LOAD_BALANCE_COMMENT_SZ)) { pool_set_node_to_be_sent(query_context, MASTER_SLAVE ? PRIMARY_NODE_ID : REAL_MASTER_NODE_ID); for (i=0;iwhere_to_send[i]) { query_context->virtual_master_node_id = i; break; } } return; } /* * In raw mode, we send only to master node. Simple enough. */ if (RAW_MODE) { pool_set_node_to_be_sent(query_context, REAL_MASTER_NODE_ID); } else if (MASTER_SLAVE && query_context->is_multi_statement) { /* * If we are in master/slave mode and we have multi statement * query, we should send it to primary server only. Otherwise * it is possible to send a write query to standby servers * because we only use the first element of the multi * statement query and don't care about the rest. Typical * situation where we are bugged by this is, "BEGIN;DELETE * FROM table;END". Note that from pgpool-II 3.1.0 * transactional statements such as "BEGIN" is unconditionally * sent to all nodes(see send_to_where() for more details). * Someday we might be able to understand all part of multi * statement queries, but until that day we need this band * aid. */ if (query_context->is_multi_statement) { pool_set_node_to_be_sent(query_context, PRIMARY_NODE_ID); } } else if (MASTER_SLAVE) { POOL_DEST dest; dest = send_to_where(node, query); ereport(DEBUG1, (errmsg("decide where to send the queries"), errdetail("destination = %d for query= \"%s\"", dest, query))); /* Should be sent to primary only? */ if (dest == POOL_PRIMARY) { pool_set_node_to_be_sent(query_context, PRIMARY_NODE_ID); } /* Should be sent to both primary and standby? */ else if (dest == POOL_BOTH) { pool_setall_node_to_be_sent(query_context); } /* * Ok, we might be able to load balance the SELECT query. */ else { if (pool_config->load_balance_mode && is_select_query(node, query) && MAJOR(backend) == PROTO_MAJOR_V3) { /* * If (we are outside of an explicit transaction) OR * (the transaction has not issued a write query yet, AND * transaction isolation level is not SERIALIZABLE) * we might be able to load balance. */ if (TSTATE(backend, PRIMARY_NODE_ID) == 'I' || (!pool_is_writing_transaction() && !pool_is_failed_transaction() && pool_get_transaction_isolation() != POOL_SERIALIZABLE)) { BackendInfo *bkinfo = pool_get_node_info(session_context->load_balance_node_id); /* * Load balance if possible */ /* * If replication delay is too much, we prefer to send to the primary. */ if (!strcmp(pool_config->master_slave_sub_mode, MODE_STREAMREP) && pool_config->delay_threshold && bkinfo->standby_delay > pool_config->delay_threshold) { pool_set_node_to_be_sent(query_context, PRIMARY_NODE_ID); } /* * If a writing function call is used, * we prefer to send to the primary. */ else if (pool_has_function_call(node)) { pool_set_node_to_be_sent(query_context, PRIMARY_NODE_ID); } /* * If system catalog is used in the SELECT, we * prefer to send to the primary. Example: SELECT * * FROM pg_class WHERE relname = 't1'; Because * 't1' is a constant, it's hard to recognize as * table name. Most use case such query is * against system catalog, and the table name can * be a temporary table, it's best to query * against primary system catalog. * Please note that this test must be done *before* * test using pool_has_temp_table. */ else if (pool_has_system_catalog(node)) { pool_set_node_to_be_sent(query_context, PRIMARY_NODE_ID); } /* * If temporary table is used in the SELECT, * we prefer to send to the primary. */ else if (pool_config->check_temp_table && pool_has_temp_table(node)) { pool_set_node_to_be_sent(query_context, PRIMARY_NODE_ID); } /* * If unlogged table is used in the SELECT, * we prefer to send to the primary. */ else if (pool_config->check_unlogged_table && pool_has_unlogged_table(node)) { pool_set_node_to_be_sent(query_context, PRIMARY_NODE_ID); } else { pool_set_node_to_be_sent(query_context, session_context->load_balance_node_id); } } else { /* Send to the primary only */ pool_set_node_to_be_sent(query_context, PRIMARY_NODE_ID); } } else { /* Send to the primary only */ pool_set_node_to_be_sent(query_context, PRIMARY_NODE_ID); } } } else if (REPLICATION || PARALLEL_MODE) { if (pool_config->load_balance_mode && is_select_query(node, query) && MAJOR(backend) == PROTO_MAJOR_V3) { /* * If a writing function call is used or replicate_select is true, * we prefer to send to all nodes. */ if (pool_has_function_call(node) || pool_config->replicate_select) { pool_setall_node_to_be_sent(query_context); } /* * If (we are outside of an explicit transaction) OR * (the transaction has not issued a write query yet, AND * transaction isolation level is not SERIALIZABLE) * we might be able to load balance. */ else if (TSTATE(backend, MASTER_NODE_ID) == 'I' || (!pool_is_writing_transaction() && !pool_is_failed_transaction() && pool_get_transaction_isolation() != POOL_SERIALIZABLE)) { /* load balance */ pool_set_node_to_be_sent(query_context, session_context->load_balance_node_id); } else { /* only send to master node */ pool_set_node_to_be_sent(query_context, REAL_MASTER_NODE_ID); } } else { if (is_select_query(node, query) && !pool_config->replicate_select && !pool_has_function_call(node)) { /* only send to master node */ pool_set_node_to_be_sent(query_context, REAL_MASTER_NODE_ID); } else { /* send to all nodes */ pool_setall_node_to_be_sent(query_context); } } } else { ereport(WARNING, (errmsg("unknown pgpool-II mode while deciding for where to send query"))); return; } /* * EXECUTE? */ if (IsA(node, ExecuteStmt)) { POOL_SENT_MESSAGE *msg; msg = pool_get_sent_message('Q', ((ExecuteStmt *)node)->name); if (!msg) msg = pool_get_sent_message('P', ((ExecuteStmt *)node)->name); if (msg) pool_copy_prep_where(msg->query_context->where_to_send, query_context->where_to_send); } /* * DEALLOCATE? */ else if (IsA(node, DeallocateStmt)) { where_to_send_deallocate(query_context, node); } for (i=0;iwhere_to_send[i]) { query_context->virtual_master_node_id = i; break; } } return; } /* * Send simple query and wait for response * send_type: * -1: do not send this node_id * 0: send to all nodes * >0: send to this node_id */ POOL_STATUS pool_send_and_wait(POOL_QUERY_CONTEXT *query_context, int send_type, int node_id) { POOL_SESSION_CONTEXT *session_context; POOL_CONNECTION *frontend; POOL_CONNECTION_POOL *backend; bool is_commit; bool is_begin_read_write; int i; int len; char *string; session_context = pool_get_session_context(false); frontend = session_context->frontend; backend = session_context->backend; is_commit = is_commit_or_rollback_query(query_context->parse_tree); is_begin_read_write = false; len = 0; string = NULL; /* * If the query is BEGIN READ WRITE or * BEGIN ... SERIALIZABLE in master/slave mode, * we send BEGIN to slaves/standbys instead. * original_query which is BEGIN READ WRITE is sent to primary. * rewritten_query which is BEGIN is sent to standbys. */ if (pool_need_to_treat_as_if_default_transaction(query_context)) { is_begin_read_write = true; } else { if (query_context->rewritten_query) { len = query_context->rewritten_length; string = query_context->rewritten_query; } else { len = query_context->original_length; string = query_context->original_query; } } /* Send query */ for (i=0;i 0 && i != node_id) continue; /* * If in master/slave mode, we do not send COMMIT/ABORT to * slaves/standbys if it's in I(idle) state. */ if (is_commit && MASTER_SLAVE && !IS_MASTER_NODE_ID(i) && TSTATE(backend, i) == 'I') { pool_unset_node_to_be_sent(query_context, i); continue; } /* * If in reset context, we send COMMIT/ABORT to nodes those * are not in I(idle) state. This will ensure that * transactions are closed. */ if (is_commit && session_context->reset_context && TSTATE(backend, i) == 'I') { pool_unset_node_to_be_sent(query_context, i); continue; } if (is_begin_read_write) { if (REAL_PRIMARY_NODE_ID == i) { len = query_context->original_length; string = query_context->original_query; } else { len = query_context->rewritten_length; string = query_context->rewritten_query; } } per_node_statement_log(backend, i, string); send_simplequery_message(CONNECTION(backend, i), len, string, MAJOR(backend)); } /* Wait for response */ for (i=0;i 0 && i != node_id) continue; #ifdef NOT_USED /* * If in master/slave mode, we do not send COMMIT/ABORT to * slaves/standbys if it's in I(idle) state. */ if (is_commit && MASTER_SLAVE && !IS_MASTER_NODE_ID(i) && TSTATE(backend, i) == 'I') { continue; } #endif if (is_begin_read_write) { if(REAL_PRIMARY_NODE_ID == i) string = query_context->original_query; else string = query_context->rewritten_query; } wait_for_query_response_with_trans_cleanup(frontend, CONNECTION(backend, i), MAJOR(backend), MASTER_CONNECTION(backend)->pid, MASTER_CONNECTION(backend)->key); /* * Check if some error detected. If so, emit * log. This is useful when invalid encoding error * occurs. In this case, PostgreSQL does not report * what statement caused that error and make users * confused. */ per_node_error_log(backend, i, string, "pool_send_and_wait: Error or notice message from backend: ", true); } return POOL_CONTINUE; } /* * Send extended query and wait for response * send_type: * -1: do not send this node_id * 0: send to all nodes * >0: send to this node_id */ POOL_STATUS pool_extended_send_and_wait(POOL_QUERY_CONTEXT *query_context, char *kind, int len, char *contents, int send_type, int node_id) { POOL_SESSION_CONTEXT *session_context; POOL_CONNECTION *frontend; POOL_CONNECTION_POOL *backend; bool is_commit; bool is_begin_read_write; int i; int str_len; int rewritten_len; char *str; char *rewritten_begin; session_context = pool_get_session_context(false); frontend = session_context->frontend; backend = session_context->backend; is_commit = is_commit_or_rollback_query(query_context->parse_tree); is_begin_read_write = false; str_len = 0; rewritten_len = 0; str = NULL; rewritten_begin = NULL; /* * If the query is BEGIN READ WRITE or * BEGIN ... SERIALIZABLE in master/slave mode, * we send BEGIN to slaves/standbys instead. * original_query which is BEGIN READ WRITE is sent to primary. * rewritten_query which is BEGIN is sent to standbys. */ if (pool_need_to_treat_as_if_default_transaction(query_context)) { is_begin_read_write = true; if (*kind == 'P') rewritten_begin = remove_read_write(len, contents, &rewritten_len); } if (!rewritten_begin) { str_len = len; str = contents; } /* Send query */ for (i=0;i 0 && i != node_id) continue; /* * If in reset context, we send COMMIT/ABORT to nodes those * are not in I(idle) state. This will ensure that * transactions are closed. */ if (is_commit && session_context->reset_context && TSTATE(backend, i) == 'I') { pool_unset_node_to_be_sent(query_context, i); continue; } if (rewritten_begin) { if (REAL_PRIMARY_NODE_ID == i) { str = contents; str_len = len; } else { str = rewritten_begin; str_len = rewritten_len; } } if (pool_config->log_per_node_statement) { char msgbuf[QUERY_STRING_BUFFER_LEN]; char *stmt; if (*kind == 'P' || *kind == 'E') { if (query_context->rewritten_query) { if (is_begin_read_write) { if (REAL_PRIMARY_NODE_ID == i) stmt = query_context->original_query; else stmt = query_context->rewritten_query; } else { stmt = query_context->rewritten_query; } } else { stmt = query_context->original_query; } if (*kind == 'P') snprintf(msgbuf, sizeof(msgbuf), "Parse: %s", stmt); else snprintf(msgbuf, sizeof(msgbuf), "Execute: %s", stmt); } else { snprintf(msgbuf, sizeof(msgbuf), "%c message", *kind); } per_node_statement_log(backend, i, msgbuf); } send_extended_protocol_message(backend, i, kind, str_len, str); } if (!is_begin_read_write) { if (query_context->rewritten_query) str = query_context->rewritten_query; else str = query_context->original_query; } /* Wait for response */ for (i=0;i 0 && i != node_id) continue; /* * If in master/slave mode, we do not send COMMIT/ABORT to * slaves/standbys if it's in I(idle) state. */ if (is_commit && MASTER_SLAVE && !IS_MASTER_NODE_ID(i) && TSTATE(backend, i) == 'I') { continue; } if (is_begin_read_write) { if (REAL_PRIMARY_NODE_ID == i) str = query_context->original_query; else str = query_context->rewritten_query; } wait_for_query_response_with_trans_cleanup(frontend, CONNECTION(backend, i), MAJOR(backend), MASTER_CONNECTION(backend)->pid, MASTER_CONNECTION(backend)->key); /* * Check if some error detected. If so, emit * log. This is useful when invalid encoding error * occurs. In this case, PostgreSQL does not report * what statement caused that error and make users * confused. */ per_node_error_log(backend, i, str, "pool_send_and_wait: Error or notice message from backend: ", true); } if(rewritten_begin) pfree(rewritten_begin); return POOL_CONTINUE; } /* * From syntactically analysis decide the statement to be sent to the * primary, the standby or either or both in master/slave+HR/SR mode. */ static POOL_DEST send_to_where(Node *node, char *query) { /* From storage/lock.h */ #define NoLock 0 #define AccessShareLock 1 /* SELECT */ #define RowShareLock 2 /* SELECT FOR UPDATE/FOR SHARE */ #define RowExclusiveLock 3 /* INSERT, UPDATE, DELETE */ #define ShareUpdateExclusiveLock 4 /* VACUUM (non-FULL),ANALYZE, CREATE * INDEX CONCURRENTLY */ #define ShareLock 5 /* CREATE INDEX (WITHOUT CONCURRENTLY) */ #define ShareRowExclusiveLock 6 /* like EXCLUSIVE MODE, but allows ROW * SHARE */ #define ExclusiveLock 7 /* blocks ROW SHARE/SELECT...FOR * UPDATE */ #define AccessExclusiveLock 8 /* ALTER TABLE, DROP TABLE, VACUUM * FULL, and unqualified LOCK TABLE */ /* From 9.0 include/nodes/node.h */ static NodeTag nodemap[] = { T_PlannedStmt, T_InsertStmt, T_DeleteStmt, T_UpdateStmt, T_SelectStmt, T_AlterTableStmt, T_AlterTableCmd, T_AlterDomainStmt, T_SetOperationStmt, T_GrantStmt, T_GrantRoleStmt, /* T_AlterDefaultPrivilegesStmt, Our parser does not support yet */ T_ClosePortalStmt, T_ClusterStmt, T_CopyStmt, T_CreateStmt, /* CREATE TABLE */ T_DefineStmt, /* CREATE AGGREGATE, OPERATOR, TYPE */ T_DropStmt, /* DROP TABLE etc. */ T_TruncateStmt, T_CommentStmt, T_FetchStmt, T_IndexStmt, /* CREATE INDEX */ T_CreateFunctionStmt, T_AlterFunctionStmt, /* T_DoStmt, Our parser does not support yet */ T_RenameStmt, /* ALTER AGGREGATE etc. */ T_RuleStmt, /* CREATE RULE */ T_NotifyStmt, T_ListenStmt, T_UnlistenStmt, T_TransactionStmt, T_ViewStmt, /* CREATE VIEW */ T_LoadStmt, T_CreateDomainStmt, T_CreatedbStmt, T_DropdbStmt, T_VacuumStmt, T_ExplainStmt, T_CreateSeqStmt, T_AlterSeqStmt, T_VariableSetStmt, /* SET */ T_VariableShowStmt, T_DiscardStmt, T_CreateTrigStmt, T_CreatePLangStmt, T_CreateRoleStmt, T_AlterRoleStmt, T_DropRoleStmt, T_LockStmt, T_ConstraintsSetStmt, T_ReindexStmt, T_CheckPointStmt, T_CreateSchemaStmt, T_AlterDatabaseStmt, T_AlterDatabaseSetStmt, T_AlterRoleSetStmt, T_CreateConversionStmt, T_CreateCastStmt, T_CreateOpClassStmt, T_CreateOpFamilyStmt, T_AlterOpFamilyStmt, T_PrepareStmt, T_ExecuteStmt, T_DeallocateStmt, /* DEALLOCATE */ T_DeclareCursorStmt, /* DECLARE */ T_CreateTableSpaceStmt, T_DropTableSpaceStmt, T_AlterObjectSchemaStmt, T_AlterOwnerStmt, T_DropOwnedStmt, T_ReassignOwnedStmt, T_CompositeTypeStmt, /* CREATE TYPE */ T_CreateEnumStmt, T_AlterTSDictionaryStmt, T_AlterTSConfigurationStmt, T_CreateFdwStmt, T_AlterFdwStmt, T_CreateForeignServerStmt, T_AlterForeignServerStmt, T_CreateUserMappingStmt, T_AlterUserMappingStmt, T_DropUserMappingStmt, /* T_AlterTableSpaceOptionsStmt, Our parser does not support yet */ }; if (bsearch(&nodeTag(node), nodemap, sizeof(nodemap)/sizeof(nodemap[0]), sizeof(NodeTag), compare) != NULL) { /* * SELECT INTO * SELECT FOR SHARE or UPDATE */ if (IsA(node, SelectStmt)) { /* SELECT INTO or SELECT FOR SHARE or UPDATE ? */ if (pool_has_insertinto_or_locking_clause(node)) return POOL_PRIMARY; return POOL_EITHER; } /* * COPY FROM */ else if (IsA(node, CopyStmt)) { return (((CopyStmt *)node)->is_from)?POOL_PRIMARY:POOL_EITHER; } /* * LOCK */ else if (IsA(node, LockStmt)) { return (((LockStmt *)node)->mode >= RowExclusiveLock)?POOL_PRIMARY:POOL_BOTH; } /* * Transaction commands */ else if (IsA(node, TransactionStmt)) { /* * Check "BEGIN READ WRITE" "START TRANSACTION READ WRITE" */ if (is_start_transaction_query(node)) { /* But actually, we send BEGIN to standby if it's BEGIN READ WRITE or START TRANSACTION READ WRITE */ if (is_read_write((TransactionStmt *)node)) return POOL_BOTH; /* Other TRANSACTION start commands are sent to both primary and standby */ else return POOL_BOTH; } /* SAVEPOINT related commands are sent to both primary and standby */ else if (is_savepoint_query(node)) return POOL_BOTH; /* * 2PC commands */ else if (is_2pc_transaction_query(node)) return POOL_PRIMARY; else /* COMMIT etc. */ return POOL_BOTH; } /* * SET */ else if (IsA(node, VariableSetStmt)) { ListCell *list_item; bool ret = POOL_BOTH; /* * SET transaction_read_only TO off */ if (((VariableSetStmt *)node)->kind == VAR_SET_VALUE && !strcmp(((VariableSetStmt *)node)->name, "transaction_read_only")) { List *options = ((VariableSetStmt *)node)->args; foreach(list_item, options) { A_Const *v = (A_Const *)lfirst(list_item); switch (v->val.type) { case T_String: if (!strcasecmp(v->val.val.str, "off") || !strcasecmp(v->val.val.str, "f") || !strcasecmp(v->val.val.str, "false")) ret = POOL_PRIMARY; break; case T_Integer: if (v->val.val.ival) ret = POOL_PRIMARY; default: break; } } return ret; } /* SET TRANSACTION ISOLATION LEVEL SERIALIZABLE or * SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL SERIALIZABLE or * SET transaction_isolation TO 'serializable' * SET default_transaction_isolation TO 'serializable' */ else if (is_set_transaction_serializable(node)) { return POOL_PRIMARY; } /* * Check "SET TRANSACTION READ WRITE" "SET SESSION * CHARACTERISTICS AS TRANSACTION READ WRITE" */ else if (((VariableSetStmt *)node)->kind == VAR_SET_MULTI && (!strcmp(((VariableSetStmt *)node)->name, "TRANSACTION") || !strcmp(((VariableSetStmt *)node)->name, "SESSION CHARACTERISTICS"))) { List *options = ((VariableSetStmt *)node)->args; foreach(list_item, options) { DefElem *opt = (DefElem *) lfirst(list_item); if (!strcmp("transaction_read_only", opt->defname)) { bool read_only; read_only = ((A_Const *)opt->arg)->val.val.ival; if (!read_only) return POOL_PRIMARY; } } return POOL_BOTH; } else { /* * All other SET command sent to both primary and * standby */ return POOL_BOTH; } } /* * DISCARD */ else if (IsA(node, DiscardStmt)) { return POOL_BOTH; } /* * PREPARE */ else if (IsA(node, PrepareStmt)) { PrepareStmt *prepare_statement = (PrepareStmt *)node; char *string = nodeToString(prepare_statement->query); /* Note that this is a recursive call */ return send_to_where((Node *)(prepare_statement->query), string); } /* * EXECUTE */ else if (IsA(node, ExecuteStmt)) { /* This is temporary decision. where_to_send will inherit * same destination AS PREPARE. */ return POOL_PRIMARY; } /* * DEALLOCATE */ else if (IsA(node, DeallocateStmt)) { /* This is temporary decision. where_to_send will inherit * same destination AS PREPARE. */ return POOL_PRIMARY; } /* * Other statements are sent to primary */ return POOL_PRIMARY; } /* * All unknown statements are sent to primary */ return POOL_PRIMARY; } static void where_to_send_deallocate(POOL_QUERY_CONTEXT *query_context, Node *node) { DeallocateStmt *d = (DeallocateStmt *)node; POOL_SENT_MESSAGE *msg; /* DEALLOCATE ALL? */ if (d->name == NULL) { pool_setall_node_to_be_sent(query_context); } else { msg = pool_get_sent_message('Q', d->name); if (!msg) msg = pool_get_sent_message('P', d->name); if (msg) { /* Inherit same map from PREPARE or PARSE */ pool_copy_prep_where(msg->query_context->where_to_send, query_context->where_to_send); return; } /* prepared statement was not found */ pool_setall_node_to_be_sent(query_context); } } /* * Returns parse tree for current query. * Precondition: the query is in progress state. */ Node *pool_get_parse_tree(void) { POOL_SESSION_CONTEXT *sc; sc = pool_get_session_context(true); if (!sc) return NULL; if (pool_is_query_in_progress() && sc->query_context) { return sc->query_context->parse_tree; } return NULL; } /* * Returns raw query string for current query. * Precondition: the query is in progress state. */ char *pool_get_query_string(void) { POOL_SESSION_CONTEXT *sc; sc = pool_get_session_context(true); if (!sc) return NULL; if (pool_is_query_in_progress() && sc->query_context) { return sc->query_context->original_query; } return NULL; } /* * Return true if the query is: * SET TRANSACTION ISOLATION LEVEL SERIALIZABLE or * SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL SERIALIZABLE or * SET transaction_isolation TO 'serializable' * SET default_transaction_isolation TO 'serializable' */ bool is_set_transaction_serializable(Node *node) { ListCell *list_item; if (!IsA(node, VariableSetStmt)) return false; if (((VariableSetStmt *)node)->kind == VAR_SET_VALUE && !strcmp(((VariableSetStmt *)node)->name, "transaction_isolation")) { List *options = ((VariableSetStmt *)node)->args; foreach(list_item, options) { A_Const *v = (A_Const *)lfirst(list_item); switch (v->val.type) { case T_String: if (!strcasecmp(v->val.val.str, "serializable")) return true; break; default: break; } } return false; } else if (((VariableSetStmt *)node)->kind == VAR_SET_MULTI && (!strcmp(((VariableSetStmt *)node)->name, "TRANSACTION") || !strcmp(((VariableSetStmt *)node)->name, "SESSION CHARACTERISTICS"))) { List *options = ((VariableSetStmt *)node)->args; foreach(list_item, options) { DefElem *opt = (DefElem *) lfirst(list_item); if (!strcmp("transaction_isolation", opt->defname) || !strcmp("default_transaction_isolation", opt->defname)) { A_Const *v = (A_Const *)opt->arg; if (!strcasecmp(v->val.val.str, "serializable")) return true; } } } return false; } /* * Returns true if SQL is transaction starting command (START * TRANSACTION or BEGIN) */ bool is_start_transaction_query(Node *node) { TransactionStmt *stmt; if (node == NULL || !IsA(node, TransactionStmt)) return false; stmt = (TransactionStmt *)node; return stmt->kind == TRANS_STMT_START || stmt->kind == TRANS_STMT_BEGIN; } /* * Return true if start transaction query with "READ WRITE" option. */ bool is_read_write(TransactionStmt *node) { ListCell *list_item; List *options = node->options; foreach(list_item, options) { DefElem *opt = (DefElem *) lfirst(list_item); if (!strcmp("transaction_read_only", opt->defname)) { bool read_only; read_only = ((A_Const *)opt->arg)->val.val.ival; if (read_only) return false; /* TRANSACTION READ ONLY */ else /* * TRANSACTION READ WRITE specified. This sounds a little bit strange, * but actually the parse code works in the way. */ return true; } } /* * No TRANSACTION READ ONLY/READ WRITE clause specified. */ return false; } /* * Return true if start transaction query with "SERIALIZABLE" option. */ bool is_serializable(TransactionStmt *node) { ListCell *list_item; List *options = node->options; foreach(list_item, options) { DefElem *opt = (DefElem *) lfirst(list_item); if (!strcmp("transaction_isolation", opt->defname) && IsA(opt->arg, A_Const) && ((A_Const *)opt->arg)->val.type == T_String && !strcmp("serializable", ((A_Const *)opt->arg)->val.val.str)) return true; } return false; } /* * If the query is BEGIN READ WRITE or * BEGIN ... SERIALIZABLE in master/slave mode, * we send BEGIN to slaves/standbys instead. * original_query which is BEGIN READ WRITE is sent to primary. * rewritten_query which is BEGIN is sent to standbys. */ bool pool_need_to_treat_as_if_default_transaction(POOL_QUERY_CONTEXT *query_context) { return (MASTER_SLAVE && is_start_transaction_query(query_context->parse_tree) && (is_read_write((TransactionStmt *)query_context->parse_tree) || is_serializable((TransactionStmt *)query_context->parse_tree))); } /* * Return true if the query is SAVEPOINT related query. */ bool is_savepoint_query(Node *node) { if (((TransactionStmt *)node)->kind == TRANS_STMT_SAVEPOINT || ((TransactionStmt *)node)->kind == TRANS_STMT_ROLLBACK_TO || ((TransactionStmt *)node)->kind == TRANS_STMT_RELEASE) return true; return false; } /* * Return true if the query is 2PC transaction query. */ bool is_2pc_transaction_query(Node *node) { if (((TransactionStmt *)node)->kind == TRANS_STMT_PREPARE || ((TransactionStmt *)node)->kind == TRANS_STMT_COMMIT_PREPARED || ((TransactionStmt *)node)->kind == TRANS_STMT_ROLLBACK_PREPARED) return true; return false; } /* * Set query state, if a current state is before it than the specified state. */ void pool_set_query_state(POOL_QUERY_CONTEXT *query_context, POOL_QUERY_STATE state) { int i; CHECK_QUERY_CONTEXT_IS_VALID; for (i = 0; i < NUM_BACKENDS; i++) { if (query_context->where_to_send[i] && statecmp(query_context->query_state[i], state) < 0) query_context->query_state[i] = state; } } /* * Return -1, 0 or 1 according to s1 is "before, equal or after" s2 in terms of state * transition order. * The State transition order is defined as: UNPARSED < PARSE_COMPLETE < BIND_COMPLETE < EXECUTE_COMPLETE */ int statecmp(POOL_QUERY_STATE s1, POOL_QUERY_STATE s2) { int ret; switch (s2) { case POOL_UNPARSED: ret = (s1 == s2) ? 0 : 1; break; case POOL_PARSE_COMPLETE: if (s1 == POOL_UNPARSED) ret = -1; else ret = (s1 == s2) ? 0 : 1; break; case POOL_BIND_COMPLETE: if (s1 == POOL_UNPARSED || s1 == POOL_PARSE_COMPLETE) ret = -1; else ret = (s1 == s2) ? 0 : 1; break; case POOL_EXECUTE_COMPLETE: ret = (s1 == s2) ? 0 : -1; break; default: ret = -2; break; } return ret; } /* * Remove READ WRITE option from the packet of START TRANSACTION command. * To free the return value is required. */ static char* remove_read_write(int len, const char* contents, int *rewritten_len) { char *rewritten_query; char *rewritten_contents; const char *name; const char *stmt; rewritten_query = "BEGIN"; name = contents; stmt = contents + strlen(name) + 1; *rewritten_len = len - strlen(stmt) + strlen(rewritten_query); if (len < *rewritten_len) { ereport(ERROR, (errmsg("invalid message length of transaction packet"))); } rewritten_contents = palloc(*rewritten_len); strcpy(rewritten_contents, name); strcpy(rewritten_contents + strlen(name) + 1, rewritten_query); memcpy(rewritten_contents + strlen(name) + strlen(rewritten_query) + 2, stmt + strlen(stmt) + 1, len - (strlen(name) + strlen(stmt) + 2)); return rewritten_contents; } /* * Return true if current query is safe to cache. */ bool pool_is_cache_safe(void) { POOL_SESSION_CONTEXT *sc; sc = pool_get_session_context(true); if (!sc) return false; if (pool_is_query_in_progress() && sc->query_context) { return sc->query_context->is_cache_safe; } return false; } /* * Set safe to cache. */ void pool_set_cache_safe(void) { POOL_SESSION_CONTEXT *sc; sc = pool_get_session_context(true); if (!sc) return; if (sc->query_context) { sc->query_context->is_cache_safe = true; } } /* * Unset safe to cache. */ void pool_unset_cache_safe(void) { POOL_SESSION_CONTEXT *sc; sc = pool_get_session_context(true); if (!sc) return; if (sc->query_context) { sc->query_context->is_cache_safe = false; } } /* * Return true if current temporary query cache is exceeded */ bool pool_is_cache_exceeded(void) { POOL_SESSION_CONTEXT *sc; sc = pool_get_session_context(true); if (!sc) return false; if (pool_is_query_in_progress() && sc->query_context) { if (sc->query_context->temp_cache) return sc->query_context->temp_cache->is_exceeded; return true; } return false; } /* * Set current temporary query cache is exceeded */ void pool_set_cache_exceeded(void) { POOL_SESSION_CONTEXT *sc; sc = pool_get_session_context(true); if (!sc) return; if (sc->query_context && sc->query_context->temp_cache) { sc->query_context->temp_cache->is_exceeded = true; } } /* * Unset current temporary query cache is exceeded */ void pool_unset_cache_exceeded(void) { POOL_SESSION_CONTEXT *sc; sc = pool_get_session_context(true); if (!sc) return; if (sc->query_context && sc->query_context->temp_cache) { sc->query_context->temp_cache->is_exceeded = false; } } pgpool-II-3.4.3/src/context/pool_session_context.c0000664000076400007640000004672312554350605017173 00000000000000/* -*-pgsql-c-*- */ /* * * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2011 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation, and that the name of the * author not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. The author makes no representations about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * */ #include #include #include #include "pool.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "utils/elog.h" #include "pool_config.h" #include "context/pool_session_context.h" static POOL_SESSION_CONTEXT session_context_d; static POOL_SESSION_CONTEXT *session_context = NULL; static void GetTranIsolationErrorCb(void *arg); static void init_sent_message_list(void); /* * Initialize per session context */ void pool_init_session_context(POOL_CONNECTION *frontend, POOL_CONNECTION_POOL *backend) { session_context = &session_context_d; /* Get Process context */ session_context->process_context = pool_get_process_context(); if (!session_context->process_context) ereport(ERROR, (errmsg("failed to get process context"))); /* Set connection info */ session_context->frontend = frontend; session_context->backend = backend; /* Initialize query context */ session_context->query_context = NULL; /* Initialize local session id */ pool_incremnet_local_session_id(); /* Create memory context */ /* TODO re-think about the parent for this context ??*/ session_context->memory_context = AllocSetContextCreate(ProcessLoopContext, "SessionContext", ALLOCSET_SMALL_MINSIZE, ALLOCSET_SMALL_INITSIZE, ALLOCSET_SMALL_MAXSIZE); /* Initialize sent message list */ init_sent_message_list(); /* Choose load balancing node if necessary */ if (pool_config->load_balance_mode) { ProcessInfo *process_info = pool_get_my_process_info(); if (!process_info) ereport(ERROR, (errmsg("failed to get process info for current process"))); session_context->load_balance_node_id = process_info->connection_info->load_balancing_node = select_load_balancing_node(); ereport(DEBUG1, (errmsg("initializing session context"), errdetail("selected load balancing node: %d", backend->info->load_balancing_node))); } /* Unset query is in progress */ pool_unset_query_in_progress(); /* The command in progress has not succeeded yet */ pool_unset_command_success(); /* We don't have a write query in this transaction yet */ pool_unset_writing_transaction(); /* Error doesn't occur in this transaction yet */ pool_unset_failed_transaction(); /* Forget transaction isolation mode */ pool_unset_transaction_isolation(); /* We don't skip reading from backends */ pool_unset_skip_reading_from_backends(); /* Backends have not ignored messages yet */ pool_unset_ignore_till_sync(); /* Initialize where to send map for PREPARE statements */ #ifdef NOT_USED memset(&session_context->prep_where, 0, sizeof(session_context->prep_where)); session_context->prep_where.nelem = POOL_MAX_PREPARED_STATEMENTS; #endif /* NOT_USED */ /* Reset flag to indicate difference in number of affected tuples * in UPDATE/DELETE. */ session_context->mismatch_ntuples = false; if (pool_config->memory_cache_enabled) { session_context->query_cache_array = pool_create_query_cache_array(); session_context->num_selects = 0; } } /* * Destroy session context. */ void pool_session_context_destroy(void) { if (session_context) { pool_clear_sent_message_list(); pfree(session_context->message_list.sent_messages); if (pool_config->memory_cache_enabled) { pool_discard_query_cache_array(session_context->query_cache_array); session_context->num_selects = 0; } if (session_context->query_context) pool_query_context_destroy(session_context->query_context); MemoryContextDelete(session_context->memory_context); } /* XXX For now, just zap memory */ memset(&session_context_d, 0, sizeof(session_context_d)); session_context = NULL; } /* * Return session context */ POOL_SESSION_CONTEXT *pool_get_session_context(bool noerror) { if (!session_context && !noerror) { ereport(FATAL, (return_code(2), errmsg("unable to get session context"))); } return session_context; } /* * Return local session id */ int pool_get_local_session_id(void) { return pool_get_session_context(false)->process_context->local_session_id; } /* * Return true if query is in progress */ bool pool_is_query_in_progress(void) { return pool_get_session_context(false)->in_progress; } /* * Set query is in progress */ void pool_set_query_in_progress(void) { ereport(DEBUG1, (errmsg("session context: setting query in progress. DONE"))); pool_get_session_context(false)->in_progress = true; } /* * Unset query is in progress */ void pool_unset_query_in_progress(void) { pool_get_session_context(false)->in_progress = false; } /* * Return true if we skip reading from backends */ bool pool_is_skip_reading_from_backends(void) { return pool_get_session_context(false)->skip_reading_from_backends; } /* * Set skip_reading_from_backends */ void pool_set_skip_reading_from_backends(void) { ereport(DEBUG1, (errmsg("session context: setting skip reading from backends. DONE"))); pool_get_session_context(false)->skip_reading_from_backends = true; } /* * Unset skip_reading_from_backends */ void pool_unset_skip_reading_from_backends(void) { ereport(DEBUG1, (errmsg("session context: clearing skip reading from backends. DONE"))); pool_get_session_context(false)->skip_reading_from_backends = false; } /* * Return true if we are doing extended query message */ bool pool_is_doing_extended_query_message(void) { return pool_get_session_context(false)->doing_extended_query_message; } /* * Set doing_extended_query_message */ void pool_set_doing_extended_query_message(void) { ereport(DEBUG1, (errmsg("session context: setting doing extended query messaging. DONE"))); pool_get_session_context(false)->doing_extended_query_message = true; } /* * Unset doing_extended_query_message */ void pool_unset_doing_extended_query_message(void) { ereport(DEBUG1, (errmsg("session context: clearing doing extended query messaging. DONE"))); pool_get_session_context(false)->doing_extended_query_message = false; } /* * Return true if backends ignore extended query message */ bool pool_is_ignore_till_sync(void) { return pool_get_session_context(false)->ignore_till_sync; } /* * Set ignore_till_sync */ void pool_set_ignore_till_sync(void) { ereport(DEBUG1, (errmsg("session context: setting ignore till sync. DONE"))); pool_get_session_context(false)->ignore_till_sync = true; } /* * Unset ignore_till_sync */ void pool_unset_ignore_till_sync(void) { ereport(DEBUG1, (errmsg("session context: clearing ignore till sync. DONE"))); pool_get_session_context(false)->ignore_till_sync = false; } /* * Remove a sent message */ bool pool_remove_sent_message(char kind, const char *name) { int i; POOL_SENT_MESSAGE_LIST *msglist; msglist = &pool_get_session_context(false)->message_list; for (i = 0; i < msglist->size; i++) { if (msglist->sent_messages[i]->kind == kind && !strcmp(msglist->sent_messages[i]->name, name)) { pool_sent_message_destroy(msglist->sent_messages[i]); break; } } /* sent message not found */ if (i == msglist->size) return false; if (i != msglist->size - 1) { memmove(&msglist->sent_messages[i], &msglist->sent_messages[i+1], sizeof(POOL_SENT_MESSAGE *) * (msglist->size - i - 1)); } msglist->size--; return true; } /* * Remove same kind of sent messages */ void pool_remove_sent_messages(char kind) { int i; POOL_SENT_MESSAGE_LIST *msglist; msglist = &pool_get_session_context(false)->message_list; for (i = 0; i < msglist->size; i++) { if (msglist->sent_messages[i]->kind == kind) { if (pool_remove_sent_message(kind, msglist->sent_messages[i]->name)) i--; /* for relocation by removing */ } } } /* * Destroy sent message */ void pool_sent_message_destroy(POOL_SENT_MESSAGE *message) { bool in_progress; POOL_QUERY_CONTEXT *qc = NULL; in_progress = pool_is_query_in_progress(); if (message) { if (message->contents) pfree(message->contents); if (message->name) pfree(message->name); if (message->query_context) { if (session_context->query_context != message->query_context) qc = session_context->query_context; if (can_query_context_destroy(message->query_context)) { pool_query_context_destroy(message->query_context); /* * set in_progress flag, because pool_query_context_destroy() * unsets in_progress flag */ if (in_progress) pool_set_query_in_progress(); /* * set query_context of session_context, because * pool_query_context_destroy() sets it to NULL. */ if (qc) session_context->query_context = qc; } } if (session_context->memory_context) pfree(message); } } /* * Clear sent message list */ void pool_clear_sent_message_list(void) { POOL_SENT_MESSAGE_LIST *msglist; msglist = &pool_get_session_context(false)->message_list; while (msglist->size > 0) { pool_remove_sent_messages(msglist->sent_messages[0]->kind); } } /* * Create a sent message * kind: one of 'P':Parse, 'B':Bind or'Q':Query(PREPARE) * len: message length that is not network byte order * contents: message contents * num_tsparams: number of timestamp parameters * name: prepared statement name or portal name */ POOL_SENT_MESSAGE *pool_create_sent_message(char kind, int len, char *contents, int num_tsparams, const char *name, POOL_QUERY_CONTEXT *query_context) { POOL_SENT_MESSAGE *msg; if (!session_context) ereport(ERROR, (errmsg("unable to create message"), errdetail("cannot get the session context"))); MemoryContext old_context = MemoryContextSwitchTo(session_context->memory_context); msg = palloc(sizeof(POOL_SENT_MESSAGE)); msg->kind = kind; msg->len = len; msg->contents = palloc(len); memcpy(msg->contents, contents, len); msg->num_tsparams = num_tsparams; msg->name = pstrdup(name); msg->query_context = query_context; MemoryContextSwitchTo(old_context); return msg; } /* * Add a sent message to sent message list */ void pool_add_sent_message(POOL_SENT_MESSAGE *message) { POOL_SENT_MESSAGE *old_msg; POOL_SENT_MESSAGE_LIST *msglist; if (!message) { ereport(DEBUG1, (errmsg("adding sent message to list"), errdetail("message is null"))); return; } old_msg = pool_get_sent_message(message->kind, message->name); msglist = &session_context->message_list; if (old_msg) { if (message->kind == 'B') ereport(DEBUG1, (errmsg("adding sent message to list"), errdetail("portal \"%s\" already exists",message->name))); else ereport(DEBUG1, (errmsg("adding sent message to list"), errdetail("prepared statement \"%s\" already exists",message->name))); if (*message->name == '\0') pool_remove_sent_message(old_msg->kind, old_msg->name); else return; } if (msglist->size == msglist->capacity) { msglist->capacity *= 2; MemoryContext oldContext = MemoryContextSwitchTo(session_context->memory_context); msglist->sent_messages = repalloc(msglist->sent_messages, sizeof(POOL_SENT_MESSAGE *) * msglist->capacity); MemoryContextSwitchTo(oldContext); } msglist->sent_messages[msglist->size++] = message; } /* * Get a sent message */ POOL_SENT_MESSAGE *pool_get_sent_message(char kind, const char *name) { int i; POOL_SENT_MESSAGE_LIST *msglist; msglist = &pool_get_session_context(false)->message_list; for (i = 0; i < msglist->size; i++) { if (msglist->sent_messages[i]->kind == kind && !strcmp(msglist->sent_messages[i]->name, name)) return msglist->sent_messages[i]; } return NULL; } /* * We don't have a write query in this transaction yet. */ void pool_unset_writing_transaction(void) { ereport(DEBUG1, (errmsg("session context: clearing writing transaction. DONE"))); pool_get_session_context(false)->writing_transaction = false; } /* * We have a write query in this transaction. */ void pool_set_writing_transaction(void) { ereport(DEBUG1, (errmsg("session context: setting writing transaction. DONE"))); pool_get_session_context(false)->writing_transaction = true; } /* * Do we have a write query in this transaction? */ bool pool_is_writing_transaction(void) { return pool_get_session_context(false)->writing_transaction; } /* * Error doesn't occur in this transaction yet. */ void pool_unset_failed_transaction(void) { ereport(DEBUG1, (errmsg("session context: clearing failed transaction. DONE"))); pool_get_session_context(false)->failed_transaction = false; } /* * Error occurred in this transaction. */ void pool_set_failed_transaction(void) { ereport(DEBUG1, (errmsg("session context: setting failed transaction. DONE"))); pool_get_session_context(false)->failed_transaction = true; } /* * Did error occur in this transaction? */ bool pool_is_failed_transaction(void) { return pool_get_session_context(false)->failed_transaction; } /* * Forget transaction isolation mode */ void pool_unset_transaction_isolation(void) { ereport(DEBUG1, (errmsg("session context: clearing failed transaction. DONE"))); pool_get_session_context(false)->transaction_isolation = POOL_UNKNOWN; } /* * Set transaction isolation mode */ void pool_set_transaction_isolation(POOL_TRANSACTION_ISOLATION isolation_level) { ereport(DEBUG1, (errmsg("session context: setting transaction isolation. DONE"))); pool_get_session_context(false)->transaction_isolation = isolation_level; } /* * Get or return cached transaction isolation mode */ POOL_TRANSACTION_ISOLATION pool_get_transaction_isolation(void) { POOL_SELECT_RESULT *res; POOL_TRANSACTION_ISOLATION ret; ErrorContextCallback callback; if (!session_context) { ereport(WARNING, (errmsg("error while getting transaction isolation, session context is not initialized"))); return POOL_UNKNOWN; } /* It seems cached result is usable. Return it. */ if (session_context->transaction_isolation != POOL_UNKNOWN) return session_context->transaction_isolation; /* * Register a error context callback to throw proper context message */ callback.callback = GetTranIsolationErrorCb; callback.arg = NULL; callback.previous = error_context_stack; error_context_stack = &callback; /* No cached data is available. Ask backend. */ do_query(MASTER(session_context->backend), "SELECT current_setting('transaction_isolation')", &res, MAJOR(session_context->backend)); error_context_stack = callback.previous; if (res->numrows <= 0) { ereport(WARNING, (errmsg("error while getting transaction isolation, do_query returns no rows"))); free_select_result(res); return POOL_UNKNOWN; } if (res->data[0] == NULL) { ereport(WARNING, (errmsg("error while getting transaction isolation, do_query returns no data"))); free_select_result(res); return POOL_UNKNOWN; } if (res->nullflags[0] == -1) { ereport(WARNING, (errmsg("error while getting transaction isolation, do_query returns NULL"))); free_select_result(res); return POOL_UNKNOWN; } if (!strcmp(res->data[0], "read uncommitted")) ret = POOL_READ_UNCOMMITTED; else if (!strcmp(res->data[0], "read committed")) ret = POOL_READ_COMMITTED; else if (!strcmp(res->data[0], "repeatable read")) ret = POOL_REPEATABLE_READ; else if (!strcmp(res->data[0], "serializable")) ret = POOL_SERIALIZABLE; else { ereport(WARNING, (errmsg("error while getting transaction isolation, unknown transaction isolation level:%s",res->data[0]))); ret = POOL_UNKNOWN; } free_select_result(res); if (ret != POOL_UNKNOWN) session_context->transaction_isolation = ret; return ret; } static void GetTranIsolationErrorCb(void *arg) { errcontext("while getting transaction isolation"); } /* * The command in progress has not succeeded yet. */ void pool_unset_command_success(void) { ereport(DEBUG1, (errmsg("session context: clearing transaction isolation. DONE"))); pool_get_session_context(false)->command_success = false; } /* * The command in progress has succeeded. */ void pool_set_command_success(void) { ereport(DEBUG1, (errmsg("session context: setting command success. DONE"))); pool_get_session_context(false)->command_success = true; } /* * Has the command in progress succeeded? */ bool pool_is_command_success(void) { return pool_get_session_context(false)->command_success; } /* * Copy send map */ void pool_copy_prep_where(bool *src, bool *dest) { memcpy(dest, src, sizeof(bool)*MAX_NUM_BACKENDS); } #ifdef NOT_USED /* * Add to send map a PREPARED statement */ void pool_add_prep_where(char *name, bool *map) { int i; if (!session_context) { ereport(ERROR, (errmsg("pool_add_prep_where: session context is not initialized"))); return; } for (i=0;iprep_where.name[i] == '\0') { strncpy(session_context->prep_where.name[i], name, POOL_MAX_PREPARED_NAME); pool_copy_prep_where(map, session_context->prep_where.where_to_send[i]); return; } } ereport(ERROR, (errmsg("pool_add_prep_where: no empty slot found"))); } /* * Search send map by PREPARED statement name */ bool *pool_get_prep_where(char *name) { int i; if (!session_context) ereport(ERROR, (errmsg("pool_get_prep_where: session context is not initialized"))); for (i=0;iprep_where.name[i], name)) { return session_context->prep_where.where_to_send[i]; } } return NULL; } /* * Remove PREPARED statement by name */ void pool_delete_prep_where(char *name) { int i; if (!session_context) ereport(ERROR, (errmsg("pool_delete_prep_where: session context is not initialized"))); for (i=0;iprep_where.name[i], name)) { memset(&session_context->prep_where.where_to_send[i], 0, sizeof(bool)*MAX_NUM_BACKENDS); *session_context->prep_where.name[i] = '\0'; return; } } } #endif /* NOT_USED */ /* * Initialize sent message list */ static void init_sent_message_list(void) { POOL_SENT_MESSAGE_LIST *msglist; msglist = &session_context->message_list; msglist->size = 0; msglist->capacity = INIT_LIST_SIZE; MemoryContext oldContext = MemoryContextSwitchTo(session_context->memory_context); msglist->sent_messages = palloc(sizeof(POOL_SENT_MESSAGE *) * INIT_LIST_SIZE); MemoryContextSwitchTo(oldContext); } /* * Look for extended message list to check if given query context qc * is used. Returns true if it is not used. */ bool can_query_context_destroy(POOL_QUERY_CONTEXT *qc) { int i; int count = 0; POOL_SENT_MESSAGE_LIST *msglist; msglist = &session_context->message_list; for (i = 0; i < msglist->size; i++) { if (msglist->sent_messages[i]->query_context == qc) count++; } if (count > 1) { ereport(DEBUG1, (errmsg("checking if query context can be safely destroyed"), errdetail("query context %p is still used %d times. query:\"%s\"", qc, count,qc->original_query))); return false; } return true; } pgpool-II-3.4.3/src/context/pool_process_context.c0000664000076400007640000001321512554350605017154 00000000000000/* -*-pgsql-c-*- */ /* * * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2015 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation, and that the name of the * author not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. The author makes no representations about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * */ #include "pool.h" #include "utils/elog.h" #include "context/pool_process_context.h" #include "pool_config.h" /* remove me afterwards */ static POOL_PROCESS_CONTEXT process_context_d; static POOL_PROCESS_CONTEXT *process_context; /* * Initialize per process context */ void pool_init_process_context(void) { process_context = &process_context_d; if (!process_info) ereport(FATAL, (return_code(1), errmsg("process info is not set"))); process_context->process_info = process_info; if (!pool_config->backend_desc) ereport(FATAL, (return_code(1), errmsg("backend desc is not set"))); process_context->backend_desc = pool_config->backend_desc; process_context->proc_id = my_proc_id; process_context->local_session_id = 0; /* initialize local session counter */ } /* * Return process context */ POOL_PROCESS_CONTEXT *pool_get_process_context(void) { return process_context; } /* * Return my process info */ ProcessInfo *pool_get_my_process_info(void) { if (!process_context) ereport(FATAL, (return_code(1), errmsg("process context is not initialized"))); return &process_context->process_info[process_context->proc_id]; } /* * Increment local session id */ void pool_incremnet_local_session_id(void) { POOL_PROCESS_CONTEXT *p = pool_get_process_context(); if (!p) ereport(ERROR, (errmsg("failed to get process context"))); p->local_session_id++; } /* * Return byte size of connection info(ConnectionInfo) on shmem. */ int pool_coninfo_size(void) { int size; size = pool_config->num_init_children * pool_config->max_pool * MAX_NUM_BACKENDS * sizeof(ConnectionInfo); ereport(DEBUG1, (errmsg("pool_coninfo_size: num_init_children (%d) * max_pool (%d) * MAX_NUM_BACKENDS (%d) * sizeof(ConnectionInfo) (%zu) = %d bytes requested for shared memory", pool_config->num_init_children, pool_config->max_pool, MAX_NUM_BACKENDS, sizeof(ConnectionInfo), size))); return size; } /* * Return number of elements of connection info(ConnectionInfo) on shmem. */ int pool_coninfo_num(void) { int nelm; nelm = pool_config->num_init_children * pool_config->max_pool * MAX_NUM_BACKENDS; return nelm; } /* * Return pointer to i th child, j th connection pool and k th backend * of connection info on shmem. */ ConnectionInfo *pool_coninfo(int child, int connection_pool, int backend) { if (child < 0 || child >= pool_config->num_init_children) { ereport(WARNING, (errmsg("failed to get connection info, invalid child number: %d", child))); return NULL; } if (connection_pool < 0 || connection_pool >= pool_config->max_pool) { ereport(WARNING, (errmsg("failed to get connection info, invalid connection pool number: %d", connection_pool))); return NULL; } if (backend < 0 || backend >= MAX_NUM_BACKENDS) { ereport(WARNING, (errmsg("failed to get connection info, invalid backend number: %d", backend))); return NULL; } return &con_info[child*pool_config->max_pool*MAX_NUM_BACKENDS+ connection_pool*MAX_NUM_BACKENDS+ backend]; } /* * Return pointer to child which has OS process id pid, j th connection * pool and k th backend of connection info on shmem. */ ConnectionInfo *pool_coninfo_pid(int pid, int connection_pool, int backend) { int child = -1; int i; for (i = 0; i < pool_config->num_init_children; i++) { if (process_info[i].pid == pid) { child = i; break; } } if (child < 0) elog(ERROR,"failed to get child pid, invalid child PID:%d",pid); if (child < 0 || child >= pool_config->num_init_children) elog(ERROR,"failed to get child pid, invalid child no:%d",child); if (connection_pool < 0 || connection_pool >= pool_config->max_pool) elog(ERROR,"failed to get child pid, invalid connection pool no:%d",connection_pool); if (backend < 0 || backend >= MAX_NUM_BACKENDS) elog(ERROR,"failed to get child pid, invalid backend no:%d",backend); return &con_info[child*pool_config->max_pool*MAX_NUM_BACKENDS+ connection_pool*MAX_NUM_BACKENDS+ backend]; } /* * Set frontend connected flag */ void pool_coninfo_set_frontend_connected(int proc_id, int pool_index) { ConnectionInfo *con; int i; for (i=0;iconnected = true; } } /* * Unset frontend connected flag */ void pool_coninfo_unset_frontend_connected(int proc_id, int pool_index) { ConnectionInfo *con; int i; for (i=0;iconnected = false; } } pgpool-II-3.4.3/src/parser/0002775000076400007640000000000012554350620012422 500000000000000pgpool-II-3.4.3/src/parser/gram.h0000664000076400007640000004620112554350605013445 00000000000000/* A Bison parser, made by GNU Bison 3.0.2. */ /* Bison interface for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ #ifndef YY_BASE_YY_GRAM_H_INCLUDED # define YY_BASE_YY_GRAM_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif #if YYDEBUG extern int base_yydebug; #endif /* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { IDENT = 258, FCONST = 259, SCONST = 260, BCONST = 261, XCONST = 262, Op = 263, ICONST = 264, PARAM = 265, TYPECAST = 266, DOT_DOT = 267, COLON_EQUALS = 268, ABORT_P = 269, ABSOLUTE_P = 270, ACCESS = 271, ACTION = 272, ADD_P = 273, ADMIN = 274, AFTER = 275, AGGREGATE = 276, ALL = 277, ALSO = 278, ALTER = 279, ALWAYS = 280, ANALYSE = 281, ANALYZE = 282, AND = 283, ANY = 284, ARRAY = 285, AS = 286, ASC = 287, ASSERTION = 288, ASSIGNMENT = 289, ASYMMETRIC = 290, AT = 291, ATTRIBUTE = 292, AUTHORIZATION = 293, BACKWARD = 294, BEFORE = 295, BEGIN_P = 296, BETWEEN = 297, BIGINT = 298, BINARY = 299, BIT = 300, BOOLEAN_P = 301, BOTH = 302, BY = 303, CACHE = 304, CALLED = 305, CASCADE = 306, CASCADED = 307, CASE = 308, CAST = 309, CATALOG_P = 310, CHAIN = 311, CHAR_P = 312, CHARACTER = 313, CHARACTERISTICS = 314, CHECK = 315, CHECKPOINT = 316, CLASS = 317, CLOSE = 318, CLUSTER = 319, COALESCE = 320, COLLATE = 321, COLLATION = 322, COLUMN = 323, COMMENT = 324, COMMENTS = 325, COMMIT = 326, COMMITTED = 327, CONCURRENTLY = 328, CONFIGURATION = 329, CONNECTION = 330, CONSTRAINT = 331, CONSTRAINTS = 332, CONTENT_P = 333, CONTINUE_P = 334, CONVERSION_P = 335, COPY = 336, COST = 337, CREATE = 338, CROSS = 339, CSV = 340, CURRENT_P = 341, CURRENT_CATALOG = 342, CURRENT_DATE = 343, CURRENT_ROLE = 344, CURRENT_SCHEMA = 345, CURRENT_TIME = 346, CURRENT_TIMESTAMP = 347, CURRENT_USER = 348, CURSOR = 349, CYCLE = 350, DATA_P = 351, DATABASE = 352, DAY_P = 353, DEALLOCATE = 354, DEC = 355, DECIMAL_P = 356, DECLARE = 357, DEFAULT = 358, DEFAULTS = 359, DEFERRABLE = 360, DEFERRED = 361, DEFINER = 362, DELETE_P = 363, DELIMITER = 364, DELIMITERS = 365, DESC = 366, DICTIONARY = 367, DISABLE_P = 368, DISCARD = 369, DISTINCT = 370, DO = 371, DOCUMENT_P = 372, DOMAIN_P = 373, DOUBLE_P = 374, DROP = 375, EACH = 376, ELSE = 377, ENABLE_P = 378, ENCODING = 379, ENCRYPTED = 380, END_P = 381, ENUM_P = 382, ESCAPE = 383, EVENT = 384, EXCEPT = 385, EXCLUDE = 386, EXCLUDING = 387, EXCLUSIVE = 388, EXECUTE = 389, EXISTS = 390, EXPLAIN = 391, EXTENSION = 392, EXTERNAL = 393, EXTRACT = 394, FALSE_P = 395, FAMILY = 396, FETCH = 397, FILTER = 398, FIRST_P = 399, FLOAT_P = 400, FOLLOWING = 401, FOR = 402, FORCE = 403, FOREIGN = 404, FORWARD = 405, FREEZE = 406, FROM = 407, FULL = 408, FUNCTION = 409, FUNCTIONS = 410, GLOBAL = 411, GRANT = 412, GRANTED = 413, GREATEST = 414, GROUP_P = 415, HANDLER = 416, HAVING = 417, HEADER_P = 418, HOLD = 419, HOUR_P = 420, IDENTITY_P = 421, IF_P = 422, ILIKE = 423, IMMEDIATE = 424, IMMUTABLE = 425, IMPLICIT_P = 426, IN_P = 427, INCLUDING = 428, INCREMENT = 429, INDEX = 430, INDEXES = 431, INHERIT = 432, INHERITS = 433, INITIALLY = 434, INLINE_P = 435, INNER_P = 436, INOUT = 437, INPUT_P = 438, INSENSITIVE = 439, INSERT = 440, INSTEAD = 441, INT_P = 442, INTEGER = 443, INTERSECT = 444, INTERVAL = 445, INTO = 446, INVOKER = 447, IS = 448, ISNULL = 449, ISOLATION = 450, JOIN = 451, KEY = 452, LABEL = 453, LANGUAGE = 454, LARGE_P = 455, LAST_P = 456, LATERAL_P = 457, LC_COLLATE_P = 458, LC_CTYPE_P = 459, LEADING = 460, LEAKPROOF = 461, LEAST = 462, LEFT = 463, LEVEL = 464, LIKE = 465, LIMIT = 466, LISTEN = 467, LOAD = 468, LOCAL = 469, LOCALTIME = 470, LOCALTIMESTAMP = 471, LOCATION = 472, LOCK_P = 473, MAPPING = 474, MATCH = 475, MATERIALIZED = 476, MAXVALUE = 477, MINUTE_P = 478, MINVALUE = 479, MODE = 480, MONTH_P = 481, MOVE = 482, NAME_P = 483, NAMES = 484, NATIONAL = 485, NATURAL = 486, NCHAR = 487, NEXT = 488, NO = 489, NONE = 490, NOT = 491, NOTHING = 492, NOTIFY = 493, NOTNULL = 494, NOWAIT = 495, NULL_P = 496, NULLIF = 497, NULLS_P = 498, NUMERIC = 499, OBJECT_P = 500, OF = 501, OFF = 502, OFFSET = 503, OIDS = 504, ON = 505, ONLY = 506, OPERATOR = 507, OPTION = 508, OPTIONS = 509, OR = 510, ORDER = 511, ORDINALITY = 512, OUT_P = 513, OUTER_P = 514, OVER = 515, OVERLAPS = 516, OVERLAY = 517, OWNED = 518, OWNER = 519, PARSER = 520, PARTIAL = 521, PARTITION = 522, PASSING = 523, PASSWORD = 524, PLACING = 525, PLANS = 526, POSITION = 527, PRECEDING = 528, PRECISION = 529, PRESERVE = 530, PREPARE = 531, PREPARED = 532, PRIMARY = 533, PRIOR = 534, PRIVILEGES = 535, PROCEDURAL = 536, PROCEDURE = 537, PROGRAM = 538, QUOTE = 539, RANGE = 540, READ = 541, REAL = 542, REASSIGN = 543, RECHECK = 544, RECURSIVE = 545, REF = 546, REFERENCES = 547, REFRESH = 548, REINDEX = 549, RELATIVE_P = 550, RELEASE = 551, RENAME = 552, REPEATABLE = 553, REPLACE = 554, REPLICA = 555, RESET = 556, RESTART = 557, RESTRICT = 558, RETURNING = 559, RETURNS = 560, REVOKE = 561, RIGHT = 562, ROLE = 563, ROLLBACK = 564, ROW = 565, ROWS = 566, RULE = 567, SAVEPOINT = 568, SCHEMA = 569, SCROLL = 570, SEARCH = 571, SECOND_P = 572, SECURITY = 573, SELECT = 574, SEQUENCE = 575, SEQUENCES = 576, SERIALIZABLE = 577, SERVER = 578, SESSION = 579, SESSION_USER = 580, SET = 581, SETOF = 582, SHARE = 583, SHOW = 584, SIMILAR = 585, SIMPLE = 586, SMALLINT = 587, SNAPSHOT = 588, SOME = 589, STABLE = 590, STANDALONE_P = 591, START = 592, STATEMENT = 593, STATISTICS = 594, STDIN = 595, STDOUT = 596, STORAGE = 597, STRICT_P = 598, STRIP_P = 599, SUBSTRING = 600, SYMMETRIC = 601, SYSID = 602, SYSTEM_P = 603, TABLE = 604, TABLES = 605, TABLESPACE = 606, TEMP = 607, TEMPLATE = 608, TEMPORARY = 609, TEXT_P = 610, THEN = 611, TIME = 612, TIMESTAMP = 613, TO = 614, TRAILING = 615, TRANSACTION = 616, TREAT = 617, TRIGGER = 618, TRIM = 619, TRUE_P = 620, TRUNCATE = 621, TRUSTED = 622, TYPE_P = 623, TYPES_P = 624, UNBOUNDED = 625, UNCOMMITTED = 626, UNENCRYPTED = 627, UNION = 628, UNIQUE = 629, UNKNOWN = 630, UNLISTEN = 631, UNLOGGED = 632, UNTIL = 633, UPDATE = 634, USER = 635, USING = 636, VACUUM = 637, VALID = 638, VALIDATE = 639, VALIDATOR = 640, VALUE_P = 641, VALUES = 642, VARCHAR = 643, VARIADIC = 644, VARYING = 645, VERBOSE = 646, VERSION_P = 647, VIEW = 648, VIEWS = 649, VOLATILE = 650, WHEN = 651, WHERE = 652, WHITESPACE_P = 653, WINDOW = 654, WITH = 655, WITHIN = 656, WITHOUT = 657, WORK = 658, WRAPPER = 659, WRITE = 660, XML_P = 661, XMLATTRIBUTES = 662, XMLCONCAT = 663, XMLELEMENT = 664, XMLEXISTS = 665, XMLFOREST = 666, XMLPARSE = 667, XMLPI = 668, XMLROOT = 669, XMLSERIALIZE = 670, YEAR_P = 671, YES_P = 672, ZONE = 673, NULLS_FIRST = 674, NULLS_LAST = 675, WITH_ORDINALITY = 676, WITH_TIME = 677, POSTFIXOP = 678, UMINUS = 679 }; #endif /* Tokens. */ #define IDENT 258 #define FCONST 259 #define SCONST 260 #define BCONST 261 #define XCONST 262 #define Op 263 #define ICONST 264 #define PARAM 265 #define TYPECAST 266 #define DOT_DOT 267 #define COLON_EQUALS 268 #define ABORT_P 269 #define ABSOLUTE_P 270 #define ACCESS 271 #define ACTION 272 #define ADD_P 273 #define ADMIN 274 #define AFTER 275 #define AGGREGATE 276 #define ALL 277 #define ALSO 278 #define ALTER 279 #define ALWAYS 280 #define ANALYSE 281 #define ANALYZE 282 #define AND 283 #define ANY 284 #define ARRAY 285 #define AS 286 #define ASC 287 #define ASSERTION 288 #define ASSIGNMENT 289 #define ASYMMETRIC 290 #define AT 291 #define ATTRIBUTE 292 #define AUTHORIZATION 293 #define BACKWARD 294 #define BEFORE 295 #define BEGIN_P 296 #define BETWEEN 297 #define BIGINT 298 #define BINARY 299 #define BIT 300 #define BOOLEAN_P 301 #define BOTH 302 #define BY 303 #define CACHE 304 #define CALLED 305 #define CASCADE 306 #define CASCADED 307 #define CASE 308 #define CAST 309 #define CATALOG_P 310 #define CHAIN 311 #define CHAR_P 312 #define CHARACTER 313 #define CHARACTERISTICS 314 #define CHECK 315 #define CHECKPOINT 316 #define CLASS 317 #define CLOSE 318 #define CLUSTER 319 #define COALESCE 320 #define COLLATE 321 #define COLLATION 322 #define COLUMN 323 #define COMMENT 324 #define COMMENTS 325 #define COMMIT 326 #define COMMITTED 327 #define CONCURRENTLY 328 #define CONFIGURATION 329 #define CONNECTION 330 #define CONSTRAINT 331 #define CONSTRAINTS 332 #define CONTENT_P 333 #define CONTINUE_P 334 #define CONVERSION_P 335 #define COPY 336 #define COST 337 #define CREATE 338 #define CROSS 339 #define CSV 340 #define CURRENT_P 341 #define CURRENT_CATALOG 342 #define CURRENT_DATE 343 #define CURRENT_ROLE 344 #define CURRENT_SCHEMA 345 #define CURRENT_TIME 346 #define CURRENT_TIMESTAMP 347 #define CURRENT_USER 348 #define CURSOR 349 #define CYCLE 350 #define DATA_P 351 #define DATABASE 352 #define DAY_P 353 #define DEALLOCATE 354 #define DEC 355 #define DECIMAL_P 356 #define DECLARE 357 #define DEFAULT 358 #define DEFAULTS 359 #define DEFERRABLE 360 #define DEFERRED 361 #define DEFINER 362 #define DELETE_P 363 #define DELIMITER 364 #define DELIMITERS 365 #define DESC 366 #define DICTIONARY 367 #define DISABLE_P 368 #define DISCARD 369 #define DISTINCT 370 #define DO 371 #define DOCUMENT_P 372 #define DOMAIN_P 373 #define DOUBLE_P 374 #define DROP 375 #define EACH 376 #define ELSE 377 #define ENABLE_P 378 #define ENCODING 379 #define ENCRYPTED 380 #define END_P 381 #define ENUM_P 382 #define ESCAPE 383 #define EVENT 384 #define EXCEPT 385 #define EXCLUDE 386 #define EXCLUDING 387 #define EXCLUSIVE 388 #define EXECUTE 389 #define EXISTS 390 #define EXPLAIN 391 #define EXTENSION 392 #define EXTERNAL 393 #define EXTRACT 394 #define FALSE_P 395 #define FAMILY 396 #define FETCH 397 #define FILTER 398 #define FIRST_P 399 #define FLOAT_P 400 #define FOLLOWING 401 #define FOR 402 #define FORCE 403 #define FOREIGN 404 #define FORWARD 405 #define FREEZE 406 #define FROM 407 #define FULL 408 #define FUNCTION 409 #define FUNCTIONS 410 #define GLOBAL 411 #define GRANT 412 #define GRANTED 413 #define GREATEST 414 #define GROUP_P 415 #define HANDLER 416 #define HAVING 417 #define HEADER_P 418 #define HOLD 419 #define HOUR_P 420 #define IDENTITY_P 421 #define IF_P 422 #define ILIKE 423 #define IMMEDIATE 424 #define IMMUTABLE 425 #define IMPLICIT_P 426 #define IN_P 427 #define INCLUDING 428 #define INCREMENT 429 #define INDEX 430 #define INDEXES 431 #define INHERIT 432 #define INHERITS 433 #define INITIALLY 434 #define INLINE_P 435 #define INNER_P 436 #define INOUT 437 #define INPUT_P 438 #define INSENSITIVE 439 #define INSERT 440 #define INSTEAD 441 #define INT_P 442 #define INTEGER 443 #define INTERSECT 444 #define INTERVAL 445 #define INTO 446 #define INVOKER 447 #define IS 448 #define ISNULL 449 #define ISOLATION 450 #define JOIN 451 #define KEY 452 #define LABEL 453 #define LANGUAGE 454 #define LARGE_P 455 #define LAST_P 456 #define LATERAL_P 457 #define LC_COLLATE_P 458 #define LC_CTYPE_P 459 #define LEADING 460 #define LEAKPROOF 461 #define LEAST 462 #define LEFT 463 #define LEVEL 464 #define LIKE 465 #define LIMIT 466 #define LISTEN 467 #define LOAD 468 #define LOCAL 469 #define LOCALTIME 470 #define LOCALTIMESTAMP 471 #define LOCATION 472 #define LOCK_P 473 #define MAPPING 474 #define MATCH 475 #define MATERIALIZED 476 #define MAXVALUE 477 #define MINUTE_P 478 #define MINVALUE 479 #define MODE 480 #define MONTH_P 481 #define MOVE 482 #define NAME_P 483 #define NAMES 484 #define NATIONAL 485 #define NATURAL 486 #define NCHAR 487 #define NEXT 488 #define NO 489 #define NONE 490 #define NOT 491 #define NOTHING 492 #define NOTIFY 493 #define NOTNULL 494 #define NOWAIT 495 #define NULL_P 496 #define NULLIF 497 #define NULLS_P 498 #define NUMERIC 499 #define OBJECT_P 500 #define OF 501 #define OFF 502 #define OFFSET 503 #define OIDS 504 #define ON 505 #define ONLY 506 #define OPERATOR 507 #define OPTION 508 #define OPTIONS 509 #define OR 510 #define ORDER 511 #define ORDINALITY 512 #define OUT_P 513 #define OUTER_P 514 #define OVER 515 #define OVERLAPS 516 #define OVERLAY 517 #define OWNED 518 #define OWNER 519 #define PARSER 520 #define PARTIAL 521 #define PARTITION 522 #define PASSING 523 #define PASSWORD 524 #define PLACING 525 #define PLANS 526 #define POSITION 527 #define PRECEDING 528 #define PRECISION 529 #define PRESERVE 530 #define PREPARE 531 #define PREPARED 532 #define PRIMARY 533 #define PRIOR 534 #define PRIVILEGES 535 #define PROCEDURAL 536 #define PROCEDURE 537 #define PROGRAM 538 #define QUOTE 539 #define RANGE 540 #define READ 541 #define REAL 542 #define REASSIGN 543 #define RECHECK 544 #define RECURSIVE 545 #define REF 546 #define REFERENCES 547 #define REFRESH 548 #define REINDEX 549 #define RELATIVE_P 550 #define RELEASE 551 #define RENAME 552 #define REPEATABLE 553 #define REPLACE 554 #define REPLICA 555 #define RESET 556 #define RESTART 557 #define RESTRICT 558 #define RETURNING 559 #define RETURNS 560 #define REVOKE 561 #define RIGHT 562 #define ROLE 563 #define ROLLBACK 564 #define ROW 565 #define ROWS 566 #define RULE 567 #define SAVEPOINT 568 #define SCHEMA 569 #define SCROLL 570 #define SEARCH 571 #define SECOND_P 572 #define SECURITY 573 #define SELECT 574 #define SEQUENCE 575 #define SEQUENCES 576 #define SERIALIZABLE 577 #define SERVER 578 #define SESSION 579 #define SESSION_USER 580 #define SET 581 #define SETOF 582 #define SHARE 583 #define SHOW 584 #define SIMILAR 585 #define SIMPLE 586 #define SMALLINT 587 #define SNAPSHOT 588 #define SOME 589 #define STABLE 590 #define STANDALONE_P 591 #define START 592 #define STATEMENT 593 #define STATISTICS 594 #define STDIN 595 #define STDOUT 596 #define STORAGE 597 #define STRICT_P 598 #define STRIP_P 599 #define SUBSTRING 600 #define SYMMETRIC 601 #define SYSID 602 #define SYSTEM_P 603 #define TABLE 604 #define TABLES 605 #define TABLESPACE 606 #define TEMP 607 #define TEMPLATE 608 #define TEMPORARY 609 #define TEXT_P 610 #define THEN 611 #define TIME 612 #define TIMESTAMP 613 #define TO 614 #define TRAILING 615 #define TRANSACTION 616 #define TREAT 617 #define TRIGGER 618 #define TRIM 619 #define TRUE_P 620 #define TRUNCATE 621 #define TRUSTED 622 #define TYPE_P 623 #define TYPES_P 624 #define UNBOUNDED 625 #define UNCOMMITTED 626 #define UNENCRYPTED 627 #define UNION 628 #define UNIQUE 629 #define UNKNOWN 630 #define UNLISTEN 631 #define UNLOGGED 632 #define UNTIL 633 #define UPDATE 634 #define USER 635 #define USING 636 #define VACUUM 637 #define VALID 638 #define VALIDATE 639 #define VALIDATOR 640 #define VALUE_P 641 #define VALUES 642 #define VARCHAR 643 #define VARIADIC 644 #define VARYING 645 #define VERBOSE 646 #define VERSION_P 647 #define VIEW 648 #define VIEWS 649 #define VOLATILE 650 #define WHEN 651 #define WHERE 652 #define WHITESPACE_P 653 #define WINDOW 654 #define WITH 655 #define WITHIN 656 #define WITHOUT 657 #define WORK 658 #define WRAPPER 659 #define WRITE 660 #define XML_P 661 #define XMLATTRIBUTES 662 #define XMLCONCAT 663 #define XMLELEMENT 664 #define XMLEXISTS 665 #define XMLFOREST 666 #define XMLPARSE 667 #define XMLPI 668 #define XMLROOT 669 #define XMLSERIALIZE 670 #define YEAR_P 671 #define YES_P 672 #define ZONE 673 #define NULLS_FIRST 674 #define NULLS_LAST 675 #define WITH_ORDINALITY 676 #define WITH_TIME 677 #define POSTFIXOP 678 #define UMINUS 679 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE YYSTYPE; union YYSTYPE { #line 211 "gram.y" /* yacc.c:1909 */ core_YYSTYPE core_yystype; /* these fields must match core_YYSTYPE: */ int ival; char *str; const char *keyword; char chr; bool boolean; JoinType jtype; DropBehavior dbehavior; OnCommitAction oncommit; List *list; Node *node; Value *value; ObjectType objtype; TypeName *typnam; FunctionParameter *fun_param; FunctionParameterMode fun_param_mode; FuncWithArgs *funwithargs; DefElem *defelt; SortBy *sortby; WindowDef *windef; JoinExpr *jexpr; IndexElem *ielem; Alias *alias; RangeVar *range; IntoClause *into; WithClause *with; A_Indices *aind; ResTarget *target; struct PrivTarget *privtarget; AccessPriv *accesspriv; InsertStmt *istmt; VariableSetStmt *vsetstmt; #line 939 "gram.h" /* yacc.c:1909 */ }; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif /* Location type. */ #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED typedef struct YYLTYPE YYLTYPE; struct YYLTYPE { int first_line; int first_column; int last_line; int last_column; }; # define YYLTYPE_IS_DECLARED 1 # define YYLTYPE_IS_TRIVIAL 1 #endif int base_yyparse (core_yyscan_t yyscanner); #endif /* !YY_BASE_YY_GRAM_H_INCLUDED */ pgpool-II-3.4.3/src/parser/scan.l0000664000076400007640000012141212554350605013445 00000000000000%{ /*------------------------------------------------------------------------- * * scan.l * lexical scanner for PostgreSQL * * NOTE NOTE NOTE: * * The rules in this file must be kept in sync with psql's lexer!!! * * The rules are designed so that the scanner never has to backtrack, * in the sense that there is always a rule that can match the input * consumed so far (the rule action may internally throw back some input * with yyless(), however). As explained in the flex manual, this makes * for a useful speed increase --- about a third faster than a plain -CF * lexer, in simple testing. The extra complexity is mostly in the rules * for handling float numbers and continued string literals. If you change * the lexical rules, verify that you haven't broken the no-backtrack * property by running flex with the "-b" option and checking that the * resulting "lex.backup" file says that no backing up is needed. (As of * Postgres 9.2, this check is made automatically by the Makefile.) * * * Portions Copyright (c) 2003-2014, PgPool Global Development Group * Portions Copyright (c) 1996-2014, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION * src/backend/parser/scan.l * *------------------------------------------------------------------------- */ #include "pool_parser.h" #include #include #include "parser.h" /* only needed for GUC variables */ #include "scanner.h" #include "scansup.h" #include "pg_wchar.h" #include "gram.h" #include "utils/palloc.h" /* Avoid exit() on fatal scanner errors (a bit ugly -- see yy_fatal_error) */ #undef fprintf #define fprintf(file, fmt, msg) fprintf_to_ereport(fmt, msg) static void fprintf_to_ereport(const char *fmt, const char *msg) { ereport(ERROR, (errmsg_internal("%s", msg))); } /* * GUC variables. This is a DIRECT violation of the warning given at the * head of gram.y, ie flex/bison code must not depend on any GUC variables; * as such, changing their values can induce very unintuitive behavior. * But we shall have to live with it as a short-term thing until the switch * to SQL-standard string syntax is complete. */ int backslash_quote = BACKSLASH_QUOTE_SAFE_ENCODING; bool escape_string_warning = true; bool standard_conforming_strings = true; /* * Set the type of YYSTYPE. */ #define YYSTYPE core_YYSTYPE /* * Set the type of yyextra. All state variables used by the scanner should * be in yyextra, *not* statically allocated. */ #define YY_EXTRA_TYPE core_yy_extra_type * /* * Each call to yylex must set yylloc to the location of the found token * (expressed as a byte offset from the start of the input text). * When we parse a token that requires multiple lexer rules to process, * this should be done in the first such rule, else yylloc will point * into the middle of the token. */ #define SET_YYLLOC() (*(yylloc) = yytext - yyextra->scanbuf) /* * Advance yylloc by the given number of bytes. */ #define ADVANCE_YYLLOC(delta) ( *(yylloc) += (delta) ) #define startlit() ( yyextra->literallen = 0 ) static void addlit(char *ytext, int yleng, core_yyscan_t yyscanner); static void addlitchar(unsigned char ychar, core_yyscan_t yyscanner); static char *litbufdup(core_yyscan_t yyscanner); static char *litbuf_udeescape(unsigned char escape, core_yyscan_t yyscanner); static unsigned char unescape_single_char(unsigned char c, core_yyscan_t yyscanner); static int process_integer_literal(const char *token, YYSTYPE *lval); static bool is_utf16_surrogate_first(pg_wchar c); static bool is_utf16_surrogate_second(pg_wchar c); static pg_wchar surrogate_pair_to_codepoint(pg_wchar first, pg_wchar second); static void addunicode(pg_wchar c, yyscan_t yyscanner); static bool check_uescapechar(unsigned char escape); #define yyerror(msg) scanner_yyerror(msg, yyscanner) #define lexer_errposition() scanner_errposition(*(yylloc), yyscanner) static void check_string_escape_warning(unsigned char ychar, core_yyscan_t yyscanner); static void check_escape_warning(core_yyscan_t yyscanner); /* * Work around a bug in flex 2.5.35: it emits a couple of functions that * it forgets to emit declarations for. Since we use -Wmissing-prototypes, * this would cause warnings. Providing our own declarations should be * harmless even when the bug gets fixed. */ extern int core_yyget_column(yyscan_t yyscanner); extern void core_yyset_column(int column_no, yyscan_t yyscanner); %} %option reentrant %option bison-bridge %option bison-locations %option 8bit %option never-interactive %option nodefault %option noinput %option nounput %option noyywrap %option noyyalloc %option noyyrealloc %option noyyfree %option warn %option prefix="core_yy" /* * OK, here is a short description of lex/flex rules behavior. * The longest pattern which matches an input string is always chosen. * For equal-length patterns, the first occurring in the rules list is chosen. * INITIAL is the starting state, to which all non-conditional rules apply. * Exclusive states change parsing rules while the state is active. When in * an exclusive state, only those rules defined for that state apply. * * We use exclusive states for quoted strings, extended comments, * and to eliminate parsing troubles for numeric strings. * Exclusive states: * bit string literal * extended C-style comments * delimited identifiers (double-quoted identifiers) * hexadecimal numeric string * standard quoted strings * extended quoted strings (support backslash escape sequences) * $foo$ quoted strings * quoted identifier with Unicode escapes * end of a quoted identifier with Unicode escapes, UESCAPE can follow * quoted string with Unicode escapes * end of a quoted string with Unicode escapes, UESCAPE can follow * Unicode surrogate pair in extended quoted string * * Remember to add an <> case whenever you add a new exclusive state! * The default one is probably not the right thing. */ %x xb %x xc %x xd %x xh %x xe %x xq %x xdolq %x xui %x xuiend %x xus %x xusend %x xeu /* * In order to make the world safe for Windows and Mac clients as well as * Unix ones, we accept either \n or \r as a newline. A DOS-style \r\n * sequence will be seen as two successive newlines, but that doesn't cause * any problems. Comments that start with -- and extend to the next * newline are treated as equivalent to a single whitespace character. * * NOTE a fine point: if there is no newline following --, we will absorb * everything to the end of the input as a comment. This is correct. Older * versions of Postgres failed to recognize -- as a comment if the input * did not end with a newline. * * XXX perhaps \f (formfeed) should be treated as a newline as well? * * XXX if you change the set of whitespace characters, fix scanner_isspace() * to agree, and see also the plpgsql lexer. */ space [ \t\n\r\f] horiz_space [ \t\f] newline [\n\r] non_newline [^\n\r] comment ("--"{non_newline}*) whitespace ({space}+|{comment}) /* * SQL requires at least one newline in the whitespace separating * string literals that are to be concatenated. Silly, but who are we * to argue? Note that {whitespace_with_newline} should not have * after * it, whereas {whitespace} should generally have a * after it... */ special_whitespace ({space}+|{comment}{newline}) horiz_whitespace ({horiz_space}|{comment}) whitespace_with_newline ({horiz_whitespace}*{newline}{special_whitespace}*) /* * To ensure that {quotecontinue} can be scanned without having to back up * if the full pattern isn't matched, we include trailing whitespace in * {quotestop}. This matches all cases where {quotecontinue} fails to match, * except for {quote} followed by whitespace and just one "-" (not two, * which would start a {comment}). To cover that we have {quotefail}. * The actions for {quotestop} and {quotefail} must throw back characters * beyond the quote proper. */ quote ' quotestop {quote}{whitespace}* quotecontinue {quote}{whitespace_with_newline}{quote} quotefail {quote}{whitespace}*"-" /* Bit string * It is tempting to scan the string for only those characters * which are allowed. However, this leads to silently swallowed * characters if illegal characters are included in the string. * For example, if xbinside is [01] then B'ABCD' is interpreted * as a zero-length string, and the ABCD' is lost! * Better to pass the string forward and let the input routines * validate the contents. */ xbstart [bB]{quote} xbinside [^']* /* Hexadecimal number */ xhstart [xX]{quote} xhinside [^']* /* National character */ xnstart [nN]{quote} /* Quoted string that allows backslash escapes */ xestart [eE]{quote} xeinside [^\\']+ xeescape [\\][^0-7] xeoctesc [\\][0-7]{1,3} xehexesc [\\]x[0-9A-Fa-f]{1,2} xeunicode [\\](u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8}) xeunicodefail [\\](u[0-9A-Fa-f]{0,3}|U[0-9A-Fa-f]{0,7}) /* Extended quote * xqdouble implements embedded quote, '''' */ xqstart {quote} xqdouble {quote}{quote} xqinside [^']+ /* $foo$ style quotes ("dollar quoting") * The quoted string starts with $foo$ where "foo" is an optional string * in the form of an identifier, except that it may not contain "$", * and extends to the first occurrence of an identical string. * There is *no* processing of the quoted text. * * {dolqfailed} is an error rule to avoid scanner backup when {dolqdelim} * fails to match its trailing "$". */ dolq_start [A-Za-z\200-\377_] dolq_cont [A-Za-z\200-\377_0-9] dolqdelim \$({dolq_start}{dolq_cont}*)?\$ dolqfailed \${dolq_start}{dolq_cont}* dolqinside [^$]+ /* Double quote * Allows embedded spaces and other special characters into identifiers. */ dquote \" xdstart {dquote} xdstop {dquote} xddouble {dquote}{dquote} xdinside [^"]+ /* Unicode escapes */ uescape [uU][eE][sS][cC][aA][pP][eE]{whitespace}*{quote}[^']{quote} /* error rule to avoid backup */ uescapefail [uU][eE][sS][cC][aA][pP][eE]{whitespace}*"-"|[uU][eE][sS][cC][aA][pP][eE]{whitespace}*{quote}[^']|[uU][eE][sS][cC][aA][pP][eE]{whitespace}*{quote}|[uU][eE][sS][cC][aA][pP][eE]{whitespace}*|[uU][eE][sS][cC][aA][pP]|[uU][eE][sS][cC][aA]|[uU][eE][sS][cC]|[uU][eE][sS]|[uU][eE]|[uU] /* Quoted identifier with Unicode escapes */ xuistart [uU]&{dquote} /* Quoted string with Unicode escapes */ xusstart [uU]&{quote} /* Optional UESCAPE after a quoted string or identifier with Unicode escapes. */ xustop1 {uescapefail}? xustop2 {uescape} /* error rule to avoid backup */ xufailed [uU]& /* C-style comments * * The "extended comment" syntax closely resembles allowable operator syntax. * The tricky part here is to get lex to recognize a string starting with * slash-star as a comment, when interpreting it as an operator would produce * a longer match --- remember lex will prefer a longer match! Also, if we * have something like plus-slash-star, lex will think this is a 3-character * operator whereas we want to see it as a + operator and a comment start. * The solution is two-fold: * 1. append {op_chars}* to xcstart so that it matches as much text as * {operator} would. Then the tie-breaker (first matching rule of same * length) ensures xcstart wins. We put back the extra stuff with yyless() * in case it contains a star-slash that should terminate the comment. * 2. In the operator rule, check for slash-star within the operator, and * if found throw it back with yyless(). This handles the plus-slash-star * problem. * Dash-dash comments have similar interactions with the operator rule. */ xcstart \/\*{op_chars}* xcstop \*+\/ xcinside [^*/]+ digit [0-9] ident_start [A-Za-z\200-\377_] ident_cont [A-Za-z\200-\377_0-9\$] identifier {ident_start}{ident_cont}* typecast "::" dot_dot \.\. colon_equals ":=" /* * "self" is the set of chars that should be returned as single-character * tokens. "op_chars" is the set of chars that can make up "Op" tokens, * which can be one or more characters long (but if a single-char token * appears in the "self" set, it is not to be returned as an Op). Note * that the sets overlap, but each has some chars that are not in the other. * * If you change either set, adjust the character lists appearing in the * rule for "operator"! */ self [,()\[\].;\:\+\-\*\/\%\^\<\>\=] op_chars [\~\!\@\#\^\&\|\`\?\+\-\*\/\%\<\>\=] operator {op_chars}+ /* we no longer allow unary minus in numbers. * instead we pass it separately to parser. there it gets * coerced via doNegate() -- Leon aug 20 1999 * * {decimalfail} is used because we would like "1..10" to lex as 1, dot_dot, 10. * * {realfail1} and {realfail2} are added to prevent the need for scanner * backup when the {real} rule fails to match completely. */ integer {digit}+ decimal (({digit}*\.{digit}+)|({digit}+\.{digit}*)) decimalfail {digit}+\.\. real ({integer}|{decimal})[Ee][-+]?{digit}+ realfail1 ({integer}|{decimal})[Ee] realfail2 ({integer}|{decimal})[Ee][-+] param \${integer} other . /* * Dollar quoted strings are totally opaque, and no escaping is done on them. * Other quoted strings must allow some special characters such as single-quote * and newline. * Embedded single-quotes are implemented both in the SQL standard * style of two adjacent single quotes "''" and in the Postgres/Java style * of escaped-quote "\'". * Other embedded escaped characters are matched explicitly and the leading * backslash is dropped from the string. * Note that xcstart must appear before operator, as explained above! * Also whitespace (comment) must appear before operator. */ %% {whitespace} { /* ignore */ } {xcstart} { /* Set location in case of syntax error in comment */ SET_YYLLOC(); yyextra->xcdepth = 0; BEGIN(xc); /* Put back any characters past slash-star; see above */ yyless(2); } {xcstart} { (yyextra->xcdepth)++; /* Put back any characters past slash-star; see above */ yyless(2); } {xcstop} { if (yyextra->xcdepth <= 0) BEGIN(INITIAL); else (yyextra->xcdepth)--; } {xcinside} { /* ignore */ } {op_chars} { /* ignore */ } \*+ { /* ignore */ } <> { yyerror("unterminated /* comment"); } {xbstart} { /* Binary bit type. * At some point we should simply pass the string * forward to the parser and label it there. * In the meantime, place a leading "b" on the string * to mark it for the input routine as a binary string. */ SET_YYLLOC(); BEGIN(xb); startlit(); addlitchar('b', yyscanner); } {quotestop} | {quotefail} { yyless(1); BEGIN(INITIAL); yylval->str = litbufdup(yyscanner); return BCONST; } {xhinside} | {xbinside} { addlit(yytext, yyleng, yyscanner); } {quotecontinue} | {quotecontinue} { /* ignore */ } <> { yyerror("unterminated bit string literal"); } {xhstart} { /* Hexadecimal bit type. * At some point we should simply pass the string * forward to the parser and label it there. * In the meantime, place a leading "x" on the string * to mark it for the input routine as a hex string. */ SET_YYLLOC(); BEGIN(xh); startlit(); addlitchar('x', yyscanner); } {quotestop} | {quotefail} { yyless(1); BEGIN(INITIAL); yylval->str = litbufdup(yyscanner); return XCONST; } <> { yyerror("unterminated hexadecimal string literal"); } {xnstart} { /* National character. * We will pass this along as a normal character string, * but preceded with an internally-generated "NCHAR". */ const ScanKeyword *keyword; SET_YYLLOC(); yyless(1); /* eat only 'n' this time */ keyword = ScanKeywordLookup("nchar", yyextra->keywords, yyextra->num_keywords); if (keyword != NULL) { yylval->keyword = keyword->name; return keyword->value; } else { /* If NCHAR isn't a keyword, just return "n" */ yylval->str = pstrdup("n"); return IDENT; } } {xqstart} { yyextra->warn_on_first_escape = true; yyextra->saw_non_ascii = false; SET_YYLLOC(); if (standard_conforming_strings) BEGIN(xq); else BEGIN(xe); startlit(); } {xestart} { yyextra->warn_on_first_escape = false; yyextra->saw_non_ascii = false; SET_YYLLOC(); BEGIN(xe); startlit(); } {xusstart} { SET_YYLLOC(); if (!standard_conforming_strings) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("unsafe use of string constant with Unicode escapes"), errdetail("String constants with Unicode escapes cannot be used when standard_conforming_strings is off."), lexer_errposition())); BEGIN(xus); startlit(); } {quotestop} | {quotefail} { yyless(1); BEGIN(INITIAL); /* * check that the data remains valid if it might have been * made invalid by unescaping any chars. */ if (yyextra->saw_non_ascii) pg_verifymbstr(yyextra->literalbuf, yyextra->literallen, false); yylval->str = litbufdup(yyscanner); return SCONST; } {quotestop} | {quotefail} { /* throw back all but the quote */ yyless(1); /* xusend state looks for possible UESCAPE */ BEGIN(xusend); } {whitespace} { /* stay in xusend state over whitespace */ } {other} | {xustop1} | <> { /* no UESCAPE after the quote, throw back everything */ yyless(0); BEGIN(INITIAL); yylval->str = litbuf_udeescape('\\', yyscanner); return SCONST; } {xustop2} { /* found UESCAPE after the end quote */ BEGIN(INITIAL); if (!check_uescapechar(yytext[yyleng-2])) { SET_YYLLOC(); ADVANCE_YYLLOC(yyleng-2); yyerror("invalid Unicode escape character"); } yylval->str = litbuf_udeescape(yytext[yyleng-2], yyscanner); return SCONST; } {xqdouble} { addlitchar('\'', yyscanner); } {xqinside} { addlit(yytext, yyleng, yyscanner); } {xeinside} { addlit(yytext, yyleng, yyscanner); } {xeunicode} { pg_wchar c = strtoul(yytext+2, NULL, 16); check_escape_warning(yyscanner); if (is_utf16_surrogate_first(c)) { yyextra->utf16_first_part = c; BEGIN(xeu); } else if (is_utf16_surrogate_second(c)) yyerror("invalid Unicode surrogate pair"); else addunicode(c, yyscanner); } {xeunicode} { pg_wchar c = strtoul(yytext+2, NULL, 16); if (!is_utf16_surrogate_second(c)) yyerror("invalid Unicode surrogate pair"); c = surrogate_pair_to_codepoint(yyextra->utf16_first_part, c); addunicode(c, yyscanner); BEGIN(xe); } . { yyerror("invalid Unicode surrogate pair"); } \n { yyerror("invalid Unicode surrogate pair"); } <> { yyerror("invalid Unicode surrogate pair"); } {xeunicodefail} { ereport(ERROR, (errcode(ERRCODE_INVALID_ESCAPE_SEQUENCE), errmsg("invalid Unicode escape"), errhint("Unicode escapes must be \\uXXXX or \\UXXXXXXXX."), lexer_errposition())); } {xeescape} { #ifdef PGPOOL_NOT_USED if (yytext[1] == '\'') { if (backslash_quote == BACKSLASH_QUOTE_OFF || (backslash_quote == BACKSLASH_QUOTE_SAFE_ENCODING && PG_ENCODING_IS_CLIENT_ONLY(pg_get_client_encoding()))) ereport(ERROR, (errcode(ERRCODE_NONSTANDARD_USE_OF_ESCAPE_CHARACTER), errmsg("unsafe use of \\' in a string literal"), errhint("Use '' to write quotes in strings. \\' is insecure in client-only encodings."), lexer_errposition())); } #endif check_string_escape_warning(yytext[1], yyscanner); addlitchar(unescape_single_char(yytext[1], yyscanner), yyscanner); } {xeoctesc} { unsigned char c = strtoul(yytext+1, NULL, 8); check_escape_warning(yyscanner); addlitchar(c, yyscanner); if (c == '\0' || IS_HIGHBIT_SET(c)) yyextra->saw_non_ascii = true; } {xehexesc} { unsigned char c = strtoul(yytext+2, NULL, 16); check_escape_warning(yyscanner); addlitchar(c, yyscanner); if (c == '\0' || IS_HIGHBIT_SET(c)) yyextra->saw_non_ascii = true; } {quotecontinue} { /* ignore */ } . { /* This is only needed for \ just before EOF */ addlitchar(yytext[0], yyscanner); } <> { yyerror("unterminated quoted string"); } {dolqdelim} { SET_YYLLOC(); yyextra->dolqstart = pstrdup(yytext); BEGIN(xdolq); startlit(); } {dolqfailed} { SET_YYLLOC(); /* throw back all but the initial "$" */ yyless(1); /* and treat it as {other} */ return yytext[0]; } {dolqdelim} { if (strcmp(yytext, yyextra->dolqstart) == 0) { pfree(yyextra->dolqstart); yyextra->dolqstart = NULL; BEGIN(INITIAL); yylval->str = litbufdup(yyscanner); return SCONST; } else { /* * When we fail to match $...$ to dolqstart, transfer * the $... part to the output, but put back the final * $ for rescanning. Consider $delim$...$junk$delim$ */ addlit(yytext, yyleng-1, yyscanner); yyless(yyleng-1); } } {dolqinside} { addlit(yytext, yyleng, yyscanner); } {dolqfailed} { addlit(yytext, yyleng, yyscanner); } . { /* This is only needed for $ inside the quoted text */ addlitchar(yytext[0], yyscanner); } <> { yyerror("unterminated dollar-quoted string"); } {xdstart} { SET_YYLLOC(); BEGIN(xd); startlit(); } {xuistart} { SET_YYLLOC(); BEGIN(xui); startlit(); } {xdstop} { char *ident; BEGIN(INITIAL); if (yyextra->literallen == 0) yyerror("zero-length delimited identifier"); ident = litbufdup(yyscanner); if (yyextra->literallen >= NAMEDATALEN) truncate_identifier(ident, yyextra->literallen, true); yylval->str = ident; return IDENT; } {dquote} { yyless(1); /* xuiend state looks for possible UESCAPE */ BEGIN(xuiend); } {whitespace} { /* stay in xuiend state over whitespace */ } {other} | {xustop1} | <> { /* no UESCAPE after the quote, throw back everything */ char *ident; int identlen; yyless(0); BEGIN(INITIAL); if (yyextra->literallen == 0) yyerror("zero-length delimited identifier"); ident = litbuf_udeescape('\\', yyscanner); identlen = strlen(ident); if (identlen >= NAMEDATALEN) truncate_identifier(ident, identlen, true); yylval->str = ident; return IDENT; } {xustop2} { /* found UESCAPE after the end quote */ char *ident; int identlen; BEGIN(INITIAL); if (yyextra->literallen == 0) yyerror("zero-length delimited identifier"); if (!check_uescapechar(yytext[yyleng-2])) { SET_YYLLOC(); ADVANCE_YYLLOC(yyleng-2); yyerror("invalid Unicode escape character"); } ident = litbuf_udeescape(yytext[yyleng - 2], yyscanner); identlen = strlen(ident); if (identlen >= NAMEDATALEN) truncate_identifier(ident, identlen, true); yylval->str = ident; return IDENT; } {xddouble} { addlitchar('"', yyscanner); } {xdinside} { addlit(yytext, yyleng, yyscanner); } <> { yyerror("unterminated quoted identifier"); } {xufailed} { char *ident; SET_YYLLOC(); /* throw back all but the initial u/U */ yyless(1); /* and treat it as {identifier} */ ident = downcase_truncate_identifier(yytext, yyleng, true); yylval->str = ident; return IDENT; } {typecast} { SET_YYLLOC(); return TYPECAST; } {dot_dot} { SET_YYLLOC(); return DOT_DOT; } {colon_equals} { SET_YYLLOC(); return COLON_EQUALS; } {self} { SET_YYLLOC(); return yytext[0]; } {operator} { /* * Check for embedded slash-star or dash-dash; those * are comment starts, so operator must stop there. * Note that slash-star or dash-dash at the first * character will match a prior rule, not this one. */ int nchars = yyleng; char *slashstar = strstr(yytext, "/*"); char *dashdash = strstr(yytext, "--"); if (slashstar && dashdash) { /* if both appear, take the first one */ if (slashstar > dashdash) slashstar = dashdash; } else if (!slashstar) slashstar = dashdash; if (slashstar) nchars = slashstar - yytext; /* * For SQL compatibility, '+' and '-' cannot be the * last char of a multi-char operator unless the operator * contains chars that are not in SQL operators. * The idea is to lex '=-' as two operators, but not * to forbid operator names like '?-' that could not be * sequences of SQL operators. */ while (nchars > 1 && (yytext[nchars-1] == '+' || yytext[nchars-1] == '-')) { int ic; for (ic = nchars-2; ic >= 0; ic--) { if (strchr("~!@#^&|`?%", yytext[ic])) break; } if (ic >= 0) break; /* found a char that makes it OK */ nchars--; /* else remove the +/-, and check again */ } SET_YYLLOC(); if (nchars < yyleng) { /* Strip the unwanted chars from the token */ yyless(nchars); /* * If what we have left is only one char, and it's * one of the characters matching "self", then * return it as a character token the same way * that the "self" rule would have. */ if (nchars == 1 && strchr(",()[].;:+-*/%^<>=", yytext[0])) return yytext[0]; } /* * Complain if operator is too long. Unlike the case * for identifiers, we make this an error not a notice- * and-truncate, because the odds are we are looking at * a syntactic mistake anyway. */ if (nchars >= NAMEDATALEN) yyerror("operator too long"); /* Convert "!=" operator to "<>" for compatibility */ if (strcmp(yytext, "!=") == 0) yylval->str = pstrdup("<>"); else yylval->str = pstrdup(yytext); return Op; } {param} { SET_YYLLOC(); yylval->ival = atol(yytext + 1); return PARAM; } {integer} { SET_YYLLOC(); return process_integer_literal(yytext, yylval); } {decimal} { SET_YYLLOC(); yylval->str = pstrdup(yytext); return FCONST; } {decimalfail} { /* throw back the .., and treat as integer */ yyless(yyleng-2); SET_YYLLOC(); return process_integer_literal(yytext, yylval); } {real} { SET_YYLLOC(); yylval->str = pstrdup(yytext); return FCONST; } {realfail1} { /* * throw back the [Ee], and treat as {decimal}. Note * that it is possible the input is actually {integer}, * but since this case will almost certainly lead to a * syntax error anyway, we don't bother to distinguish. */ yyless(yyleng-1); SET_YYLLOC(); yylval->str = pstrdup(yytext); return FCONST; } {realfail2} { /* throw back the [Ee][+-], and proceed as above */ yyless(yyleng-2); SET_YYLLOC(); yylval->str = pstrdup(yytext); return FCONST; } {identifier} { const ScanKeyword *keyword; char *ident; SET_YYLLOC(); /* Is it a keyword? */ keyword = ScanKeywordLookup(yytext, yyextra->keywords, yyextra->num_keywords); if (keyword != NULL) { yylval->keyword = keyword->name; return keyword->value; } /* * No. Convert the identifier to lower case, and truncate * if necessary. */ ident = downcase_truncate_identifier(yytext, yyleng, true); yylval->str = ident; return IDENT; } {other} { SET_YYLLOC(); return yytext[0]; } <> { SET_YYLLOC(); yyterminate(); } %% /* * Arrange access to yyextra for subroutines of the main yylex() function. * We expect each subroutine to have a yyscanner parameter. Rather than * use the yyget_xxx functions, which might or might not get inlined by the * compiler, we cheat just a bit and cast yyscanner to the right type. */ #undef yyextra #define yyextra (((struct yyguts_t *) yyscanner)->yyextra_r) /* Likewise for a couple of other things we need. */ #undef yylloc #define yylloc (((struct yyguts_t *) yyscanner)->yylloc_r) #undef yyleng #define yyleng (((struct yyguts_t *) yyscanner)->yyleng_r) /* * scanner_errposition * Report a lexer or grammar error cursor position, if possible. * * This is expected to be used within an ereport() call. The return value * is a dummy (always 0, in fact). * * Note that this can only be used for messages emitted during raw parsing * (essentially, scan.l and gram.y), since it requires the yyscanner struct * to still be available. */ int scanner_errposition(int location, core_yyscan_t yyscanner) { #ifdef PGPOOL_NOT_USED int pos; if (location < 0) return 0; /* no-op if location is unknown */ /* Convert byte offset to character number */ pos = pg_mbstrlen_with_len(yyextra->scanbuf, location) + 1; /* And pass it to the ereport mechanism */ return errposition(pos); #endif return 0; } /* * scanner_yyerror * Report a lexer or grammar error. * * The message's cursor position is whatever YYLLOC was last set to, * ie, the start of the current token if called within yylex(), or the * most recently lexed token if called from the grammar. * This is OK for syntax error messages from the Bison parser, because Bison * parsers report error as soon as the first unparsable token is reached. * Beware of using yyerror for other purposes, as the cursor position might * be misleading! */ void scanner_yyerror(const char *message, core_yyscan_t yyscanner) { const char *loc = yyextra->scanbuf + *yylloc; if (*loc == YY_END_OF_BUFFER_CHAR) { ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), /* translator: %s is typically the translation of "syntax error" */ errmsg("%s at end of input", _(message)), lexer_errposition())); } else { ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), /* translator: first %s is typically the translation of "syntax error" */ errmsg("%s at or near \"%s\"", _(message), loc), lexer_errposition())); } } /* * Called before any actual parsing is done */ core_yyscan_t scanner_init(const char *str, core_yy_extra_type *yyext, const ScanKeyword *keywords, int num_keywords) { Size slen = strlen(str); yyscan_t scanner; if (yylex_init(&scanner) != 0) elog(ERROR, "yylex_init() failed: %m"); core_yyset_extra(yyext, scanner); yyext->keywords = keywords; yyext->num_keywords = num_keywords; /* * Make a scan buffer with special termination needed by flex. */ yyext->scanbuf = (char *) palloc(slen + 2); yyext->scanbuflen = slen; memcpy(yyext->scanbuf, str, slen); yyext->scanbuf[slen] = yyext->scanbuf[slen + 1] = YY_END_OF_BUFFER_CHAR; yy_scan_buffer(yyext->scanbuf, slen + 2, scanner); /* initialize literal buffer to a reasonable but expansible size */ yyext->literalalloc = 1024; yyext->literalbuf = (char *) palloc(yyext->literalalloc); yyext->literallen = 0; return scanner; } /* * Called after parsing is done to clean up after scanner_init() */ void scanner_finish(core_yyscan_t yyscanner) { /* * We don't bother to call yylex_destroy(), because all it would do * is pfree a small amount of control storage. It's cheaper to leak * the storage until the parsing context is destroyed. The amount of * space involved is usually negligible compared to the output parse * tree anyway. * * We do bother to pfree the scanbuf and literal buffer, but only if they * represent a nontrivial amount of space. The 8K cutoff is arbitrary. */ if (yyextra->scanbuflen >= 8192) pfree(yyextra->scanbuf); if (yyextra->literalalloc >= 8192) pfree(yyextra->literalbuf); } static void addlit(char *ytext, int yleng, core_yyscan_t yyscanner) { /* enlarge buffer if needed */ if ((yyextra->literallen + yleng) >= yyextra->literalalloc) { do { yyextra->literalalloc *= 2; } while ((yyextra->literallen + yleng) >= yyextra->literalalloc); yyextra->literalbuf = (char *) repalloc(yyextra->literalbuf, yyextra->literalalloc); } /* append new data */ memcpy(yyextra->literalbuf + yyextra->literallen, ytext, yleng); yyextra->literallen += yleng; } static void addlitchar(unsigned char ychar, core_yyscan_t yyscanner) { /* enlarge buffer if needed */ if ((yyextra->literallen + 1) >= yyextra->literalalloc) { yyextra->literalalloc *= 2; yyextra->literalbuf = (char *) repalloc(yyextra->literalbuf, yyextra->literalalloc); } /* append new data */ yyextra->literalbuf[yyextra->literallen] = ychar; yyextra->literallen += 1; } /* * Create a palloc'd copy of literalbuf, adding a trailing null. */ static char * litbufdup(core_yyscan_t yyscanner) { int llen = yyextra->literallen; char *new; new = palloc(llen + 1); memcpy(new, yyextra->literalbuf, llen); new[llen] = '\0'; return new; } static int process_integer_literal(const char *token, YYSTYPE *lval) { long val; char *endptr; errno = 0; val = strtol(token, &endptr, 10); if (*endptr != '\0' || errno == ERANGE #ifdef HAVE_LONG_INT_64 /* if long > 32 bits, check for overflow of int4 */ || val != (long) ((int32) val) #endif ) { /* integer too large, treat it as a float */ lval->str = pstrdup(token); return FCONST; } lval->ival = val; return ICONST; } static unsigned int hexval(unsigned char c) { if (c >= '0' && c <= '9') return c - '0'; if (c >= 'a' && c <= 'f') return c - 'a' + 0xA; if (c >= 'A' && c <= 'F') return c - 'A' + 0xA; elog(ERROR, "invalid hexadecimal digit"); return 0; /* not reached */ } static void check_unicode_value(pg_wchar c, char *loc, core_yyscan_t yyscanner) { if (GetDatabaseEncoding() == PG_UTF8) return; if (c > 0x7F) { ADVANCE_YYLLOC(loc - yyextra->literalbuf + 3); /* 3 for U&" */ yyerror("Unicode escape values cannot be used for code point values above 007F when the server encoding is not UTF8"); } } static bool is_utf16_surrogate_first(pg_wchar c) { return (c >= 0xD800 && c <= 0xDBFF); } static bool is_utf16_surrogate_second(pg_wchar c) { return (c >= 0xDC00 && c <= 0xDFFF); } static pg_wchar surrogate_pair_to_codepoint(pg_wchar first, pg_wchar second) { return ((first & 0x3FF) << 10) + 0x10000 + (second & 0x3FF); } static void addunicode(pg_wchar c, core_yyscan_t yyscanner) { char buf[8]; if (c == 0 || c > 0x10FFFF) yyerror("invalid Unicode escape value"); if (c > 0x7F) { if (GetDatabaseEncoding() != PG_UTF8) yyerror("Unicode escape values cannot be used for code point values above 007F when the server encoding is not UTF8"); yyextra->saw_non_ascii = true; } unicode_to_utf8(c, (unsigned char *) buf); addlit(buf, pg_mblen(buf), yyscanner); } /* is 'escape' acceptable as Unicode escape character (UESCAPE syntax) ? */ static bool check_uescapechar(unsigned char escape) { if (isxdigit(escape) || escape == '+' || escape == '\'' || escape == '"' || scanner_isspace(escape)) { return false; } else return true; } /* like litbufdup, but handle unicode escapes */ static char * litbuf_udeescape(unsigned char escape, core_yyscan_t yyscanner) { char *new; char *litbuf, *in, *out; pg_wchar pair_first = 0; /* Make literalbuf null-terminated to simplify the scanning loop */ litbuf = yyextra->literalbuf; litbuf[yyextra->literallen] = '\0'; /* * This relies on the subtle assumption that a UTF-8 expansion * cannot be longer than its escaped representation. */ new = palloc(yyextra->literallen + 1); in = litbuf; out = new; while (*in) { if (in[0] == escape) { if (in[1] == escape) { if (pair_first) { ADVANCE_YYLLOC(in - litbuf + 3); /* 3 for U&" */ yyerror("invalid Unicode surrogate pair"); } *out++ = escape; in += 2; } else if (isxdigit((unsigned char) in[1]) && isxdigit((unsigned char) in[2]) && isxdigit((unsigned char) in[3]) && isxdigit((unsigned char) in[4])) { pg_wchar unicode; unicode = (hexval(in[1]) << 12) + (hexval(in[2]) << 8) + (hexval(in[3]) << 4) + hexval(in[4]); check_unicode_value(unicode, in, yyscanner); if (pair_first) { if (is_utf16_surrogate_second(unicode)) { unicode = surrogate_pair_to_codepoint(pair_first, unicode); pair_first = 0; } else { ADVANCE_YYLLOC(in - litbuf + 3); /* 3 for U&" */ yyerror("invalid Unicode surrogate pair"); } } else if (is_utf16_surrogate_second(unicode)) yyerror("invalid Unicode surrogate pair"); if (is_utf16_surrogate_first(unicode)) pair_first = unicode; else { unicode_to_utf8(unicode, (unsigned char *) out); out += pg_mblen(out); } in += 5; } else if (in[1] == '+' && isxdigit((unsigned char) in[2]) && isxdigit((unsigned char) in[3]) && isxdigit((unsigned char) in[4]) && isxdigit((unsigned char) in[5]) && isxdigit((unsigned char) in[6]) && isxdigit((unsigned char) in[7])) { pg_wchar unicode; unicode = (hexval(in[2]) << 20) + (hexval(in[3]) << 16) + (hexval(in[4]) << 12) + (hexval(in[5]) << 8) + (hexval(in[6]) << 4) + hexval(in[7]); check_unicode_value(unicode, in, yyscanner); if (pair_first) { if (is_utf16_surrogate_second(unicode)) { unicode = surrogate_pair_to_codepoint(pair_first, unicode); pair_first = 0; } else { ADVANCE_YYLLOC(in - litbuf + 3); /* 3 for U&" */ yyerror("invalid Unicode surrogate pair"); } } else if (is_utf16_surrogate_second(unicode)) yyerror("invalid Unicode surrogate pair"); if (is_utf16_surrogate_first(unicode)) pair_first = unicode; else { unicode_to_utf8(unicode, (unsigned char *) out); out += pg_mblen(out); } in += 8; } else { ADVANCE_YYLLOC(in - litbuf + 3); /* 3 for U&" */ yyerror("invalid Unicode escape value"); } } else { if (pair_first) { ADVANCE_YYLLOC(in - litbuf + 3); /* 3 for U&" */ yyerror("invalid Unicode surrogate pair"); } *out++ = *in++; } } *out = '\0'; /* * We could skip pg_verifymbstr if we didn't process any non-7-bit-ASCII * codes; but it's probably not worth the trouble, since this isn't * likely to be a performance-critical path. */ pg_verifymbstr(new, out - new, false); return new; } static unsigned char unescape_single_char(unsigned char c, core_yyscan_t yyscanner) { switch (c) { case 'b': return '\b'; case 'f': return '\f'; case 'n': return '\n'; case 'r': return '\r'; case 't': return '\t'; default: /* check for backslash followed by non-7-bit-ASCII */ if (c == '\0' || IS_HIGHBIT_SET(c)) yyextra->saw_non_ascii = true; return c; } } static void check_string_escape_warning(unsigned char ychar, core_yyscan_t yyscanner) { if (ychar == '\'') { if (yyextra->warn_on_first_escape && escape_string_warning) ereport(WARNING, (errcode(ERRCODE_NONSTANDARD_USE_OF_ESCAPE_CHARACTER), errmsg("nonstandard use of \\' in a string literal"), errhint("Use '' to write quotes in strings, or use the escape string syntax (E'...')."), lexer_errposition())); yyextra->warn_on_first_escape = false; /* warn only once per string */ } else if (ychar == '\\') { if (yyextra->warn_on_first_escape && escape_string_warning) ereport(WARNING, (errcode(ERRCODE_NONSTANDARD_USE_OF_ESCAPE_CHARACTER), errmsg("nonstandard use of \\\\ in a string literal"), errhint("Use the escape string syntax for backslashes, e.g., E'\\\\'."), lexer_errposition())); yyextra->warn_on_first_escape = false; /* warn only once per string */ } else check_escape_warning(yyscanner); } static void check_escape_warning(core_yyscan_t yyscanner) { if (yyextra->warn_on_first_escape && escape_string_warning) ereport(WARNING, (errcode(ERRCODE_NONSTANDARD_USE_OF_ESCAPE_CHARACTER), errmsg("nonstandard use of escape in a string literal"), errhint("Use the escape string syntax for escapes, e.g., E'\\r\\n'."), lexer_errposition())); yyextra->warn_on_first_escape = false; /* warn only once per string */ } /* * Interface functions to make flex use palloc() instead of malloc(). * It'd be better to make these static, but flex insists otherwise. */ void * core_yyalloc(yy_size_t bytes, core_yyscan_t yyscanner) { return palloc(bytes); } void * core_yyrealloc(void *ptr, yy_size_t bytes, core_yyscan_t yyscanner) { if (ptr) return repalloc(ptr, bytes); else return palloc(bytes); } void core_yyfree(void *ptr, core_yyscan_t yyscanner) { if (ptr) pfree(ptr); } pgpool-II-3.4.3/src/parser/scansup.c0000664000076400007640000001176412554350605014174 00000000000000/*------------------------------------------------------------------------- * * scansup.c * support routines for the lex/flex scanner, used by both the normal * backend as well as the bootstrap backend * * Portions Copyright (c) 1996-2013, PgPool Global Development Group * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION * src/backend/parser/scansup.c * *------------------------------------------------------------------------- */ #include "pool_parser.h" #include "utils/palloc.h" #include #include #include "scansup.h" #include "pg_wchar.h" /* ---------------- * scanstr * * if the string passed in has escaped codes, map the escape codes to actual * chars * * the string returned is palloc'd and should eventually be pfree'd by the * caller! * ---------------- */ char * scanstr(const char *s) { char *newStr; int len, i, j; if (s == NULL || s[0] == '\0') return pstrdup(""); len = strlen(s); newStr = palloc(len + 1); /* string cannot get longer */ for (i = 0, j = 0; i < len; i++) { if (s[i] == '\'') { /* * Note: if scanner is working right, unescaped quotes can only * appear in pairs, so there should be another character. */ i++; newStr[j] = s[i]; } else if (s[i] == '\\') { i++; switch (s[i]) { case 'b': newStr[j] = '\b'; break; case 'f': newStr[j] = '\f'; break; case 'n': newStr[j] = '\n'; break; case 'r': newStr[j] = '\r'; break; case 't': newStr[j] = '\t'; break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': { int k; long octVal = 0; for (k = 0; s[i + k] >= '0' && s[i + k] <= '7' && k < 3; k++) octVal = (octVal << 3) + (s[i + k] - '0'); i += k - 1; newStr[j] = ((char) octVal); } break; default: newStr[j] = s[i]; break; } /* switch */ } /* s[i] == '\\' */ else newStr[j] = s[i]; j++; } newStr[j] = '\0'; return newStr; } /* * downcase_truncate_identifier() --- do appropriate downcasing and * truncation of an unquoted identifier. Optionally warn of truncation. * * Returns a palloc'd string containing the adjusted identifier. * * Note: in some usages the passed string is not null-terminated. * * Note: the API of this function is designed to allow for downcasing * transformations that increase the string length, but we don't yet * support that. If you want to implement it, you'll need to fix * SplitIdentifierString() in utils/adt/varlena.c. */ char * downcase_truncate_identifier(const char *ident, int len, bool warn) { char *result; int i; result = palloc(len + 1); /* * SQL99 specifies Unicode-aware case normalization, which we don't yet * have the infrastructure for. Instead we use tolower() to provide a * locale-aware translation. However, there are some locales where this * is not right either (eg, Turkish may do strange things with 'i' and * 'I'). Our current compromise is to use tolower() for characters with * the high bit set, and use an ASCII-only downcasing for 7-bit * characters. */ for (i = 0; i < len; i++) { unsigned char ch = (unsigned char) ident[i]; if (ch >= 'A' && ch <= 'Z') ch += 'a' - 'A'; else if (IS_HIGHBIT_SET(ch) && isupper(ch)) ch = tolower(ch); result[i] = (char) ch; } result[i] = '\0'; if (i >= NAMEDATALEN) truncate_identifier(result, i, warn); return result; } /* * truncate_identifier() --- truncate an identifier to NAMEDATALEN-1 bytes. * * The given string is modified in-place, if necessary. A warning is * issued if requested. * * We require the caller to pass in the string length since this saves a * strlen() call in some common usages. */ void truncate_identifier(char *ident, int len, bool warn) { #if PGPOOL_NOT_USED if (len >= NAMEDATALEN) { len = pg_mbcliplen(ident, len, NAMEDATALEN - 1); if (warn) { /* * We avoid using %.*s here because it can misbehave if the data * is not valid in what libc thinks is the prevailing encoding. */ char buf[NAMEDATALEN]; memcpy(buf, ident, len); buf[len] = '\0'; ereport(NOTICE, (errcode(ERRCODE_NAME_TOO_LONG), errmsg("identifier \"%s\" will be truncated to \"%s\"", ident, buf))); } ident[len] = '\0'; } #endif } /* * scanner_isspace() --- return TRUE if flex scanner considers char whitespace * * This should be used instead of the potentially locale-dependent isspace() * function when it's important to match the lexer's behavior. * * In principle we might need similar functions for isalnum etc, but for the * moment only isspace seems needed. */ bool scanner_isspace(char ch) { /* This must match scan.l's list of {space} characters */ if (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r' || ch == '\f') return true; return false; } pgpool-II-3.4.3/src/parser/stringinfo.c0000664000076400007640000001670212554350605014677 00000000000000/*------------------------------------------------------------------------- * * stringinfo.c * * StringInfo provides an indefinitely-extensible string data type. * It can be used to buffer either ordinary C strings (null-terminated text) * or arbitrary binary data. All storage is allocated with palloc(). * * Portions Copyright (c) 2003-2013, PgPool Global Development Group * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/backend/lib/stringinfo.c * *------------------------------------------------------------------------- */ #include #include #include "pool_type.h" #include "stringinfo.h" #include "utils/palloc.h" /* * makeStringInfo * * Create an empty 'StringInfoData' & return a pointer to it. */ StringInfo makeStringInfo(void) { StringInfo res; res = (StringInfo) palloc(sizeof(StringInfoData)); initStringInfo(res); return res; } /* * initStringInfo * * Initialize a StringInfoData struct (with previously undefined contents) * to describe an empty string. */ void initStringInfo(StringInfo str) { int size = 1024; /* initial default buffer size */ str->data = (char *) palloc(size); str->maxlen = size; resetStringInfo(str); } /* * resetStringInfo * * Reset the StringInfo: the data buffer remains valid, but its * previous content, if any, is cleared. */ void resetStringInfo(StringInfo str) { str->data[0] = '\0'; str->len = 0; str->cursor = 0; } /* * appendStringInfo * * Format text data under the control of fmt (an sprintf-style format string) * and append it to whatever is already in str. More space is allocated * to str if necessary. This is sort of like a combination of sprintf and * strcat. */ void appendStringInfo(StringInfo str, const char *fmt,...) { for (;;) { va_list args; bool success; /* Try to format the data. */ va_start(args, fmt); success = appendStringInfoVA(str, fmt, args); va_end(args); if (success) break; /* Double the buffer size and try again. */ enlargeStringInfo(str, str->maxlen); } } /* * appendStringInfoVA * * Attempt to format text data under the control of fmt (an sprintf-style * format string) and append it to whatever is already in str. If successful * return true; if not (because there's not enough space), return false * without modifying str. Typically the caller would enlarge str and retry * on false return --- see appendStringInfo for standard usage pattern. * * XXX This API is ugly, but there seems no alternative given the C spec's * restrictions on what can portably be done with va_list arguments: you have * to redo va_start before you can rescan the argument list, and we can't do * that from here. */ bool appendStringInfoVA(StringInfo str, const char *fmt, va_list args) { int avail, nprinted; /* * If there's hardly any space, don't bother trying, just fail to make the * caller enlarge the buffer first. */ avail = str->maxlen - str->len - 1; if (avail < 16) return false; /* * Assert check here is to catch buggy vsnprintf that overruns the * specified buffer length. Solaris 7 in 64-bit mode is an example of a * platform with such a bug. */ #ifdef USE_ASSERT_CHECKING str->data[str->maxlen - 1] = '\0'; #endif nprinted = pvsnprintf(str->data + str->len, (size_t) avail, fmt, args); /* * Note: some versions of vsnprintf return the number of chars actually * stored, but at least one returns -1 on failure. Be conservative about * believing whether the print worked. */ if (nprinted >= 0 && nprinted < avail - 1) { /* Success. Note nprinted does not include trailing null. */ str->len += nprinted; return true; } /* Restore the trailing null so that str is unmodified. */ str->data[str->len] = '\0'; return false; } /* * appendStringInfoString * * Append a null-terminated string to str. * Like appendStringInfo(str, "%s", s) but faster. */ void appendStringInfoString(StringInfo str, const char *s) { appendBinaryStringInfo(str, s, strlen(s)); } /* * appendStringInfoChar * * Append a single byte to str. * Like appendStringInfo(str, "%c", ch) but much faster. */ void appendStringInfoChar(StringInfo str, char ch) { /* Make more room if needed */ if (str->len + 1 >= str->maxlen) enlargeStringInfo(str, 1); /* OK, append the character */ str->data[str->len] = ch; str->len++; str->data[str->len] = '\0'; } /* * appendStringInfoSpaces * * Append the specified number of spaces to a buffer. */ void appendStringInfoSpaces(StringInfo str, int count) { if (count > 0) { /* Make more room if needed */ enlargeStringInfo(str, count); /* OK, append the spaces */ while (--count >= 0) str->data[str->len++] = ' '; str->data[str->len] = '\0'; } } /* * appendBinaryStringInfo * * Append arbitrary binary data to a StringInfo, allocating more space * if necessary. */ void appendBinaryStringInfo(StringInfo str, const char *data, int datalen) { /* Make more room if needed */ enlargeStringInfo(str, datalen); /* OK, append the data */ memcpy(str->data + str->len, data, datalen); str->len += datalen; /* * Keep a trailing null in place, even though it's probably useless for * binary data. (Some callers are dealing with text but call this because * their input isn't null-terminated.) */ str->data[str->len] = '\0'; } /* * enlargeStringInfo * * Make sure there is enough space for 'needed' more bytes * ('needed' does not include the terminating null). * * External callers usually need not concern themselves with this, since * all stringinfo.c routines do it automatically. However, if a caller * knows that a StringInfo will eventually become X bytes large, it * can save some palloc overhead by enlarging the buffer before starting * to store data in it. * * NB: because we use repalloc() to enlarge the buffer, the string buffer * will remain allocated in the same memory context that was current when * initStringInfo was called, even if another context is now current. * This is the desired and indeed critical behavior! */ void enlargeStringInfo(StringInfo str, int needed) { int newlen; /* * Guard against out-of-range "needed" values. Without this, we can get * an overflow or infinite loop in the following. */ #if 0 if (needed < 0) /* should not happen */ elog(ERROR, "invalid string enlargement request size: %d", needed); if (((Size) needed) >= (MaxAllocSize - (Size) str->len)) ereport(ERROR, (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("out of memory"), errdetail("Cannot enlarge string buffer containing %d bytes by %d more bytes.", str->len, needed))); #endif needed += str->len + 1; /* total space required now */ /* Because of the above test, we now have needed <= MaxAllocSize */ if (needed <= str->maxlen) return; /* got enough space already */ /* * We don't want to allocate just a little more space with each append; * for efficiency, double the buffer size each time it overflows. * Actually, we might need to more than double it if 'needed' is big... */ newlen = 2 * str->maxlen; while (needed > newlen) newlen = 2 * newlen; /* * Clamp to MaxAllocSize in case we went past it. Note we are assuming * here that MaxAllocSize <= INT_MAX/2, else the above loop could * overflow. We will still have newlen >= needed. */ if (newlen > (int) MaxAllocSize) newlen = (int) MaxAllocSize; str->data = (char *) repalloc(str->data, newlen); str->maxlen = newlen; } pgpool-II-3.4.3/src/parser/parser.c0000664000076400007640000001412712554350605014010 00000000000000/*------------------------------------------------------------------------- * * parser.c * Main entry point/driver for PostgreSQL grammar * * Note that the grammar is not allowed to perform any table access * (since we need to be able to do basic parsing even while inside an * aborted transaction). Therefore, the data structures returned by * the grammar are "raw" parsetrees that still need to be analyzed by * analyze.c and related files. * * * Portions Copyright (c) 2003-2014, PgPool Global Development Group * Portions Copyright (c) 1996-2014, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION * src/backend/parser/parser.c * *------------------------------------------------------------------------- */ #include #include "pool_parser.h" #include "utils/palloc.h" #include "gramparse.h" /* required before parser/gram.h! */ #include "gram.h" #include "parser.h" #include "pg_wchar.h" #include "utils/elog.h" List *parsetree; /* result of parsing is left here */ int server_version_num = 0; static pg_enc server_encoding = PG_SQL_ASCII; static bool in_parser_context = false; static int parse_version(const char *versionString); /* * raw_parser * Given a query in string form, do lexical and grammatical analysis. * * Returns a list of raw (un-analyzed) parse trees. */ List * raw_parser(const char *str) { core_yyscan_t yyscanner; base_yy_extra_type yyextra; int yyresult; MemoryContext oldContext = CurrentMemoryContext; parsetree = NIL; /* in case grammar forgets to set it */ /* initialize the flex scanner */ yyscanner = scanner_init(str, &yyextra.core_yy_extra, ScanKeywords, NumScanKeywords); /* base_yylex() only needs this much initialization */ yyextra.have_lookahead = false; /* initialize the bison parser */ parser_init(&yyextra); in_parser_context = true; PG_TRY(); { yyresult = base_yyparse(yyscanner); scanner_finish(yyscanner); in_parser_context = false; } PG_CATCH(); { MemoryContextSwitchTo(oldContext); scanner_finish(yyscanner); in_parser_context = false; yyresult = -1; FlushErrorState(); } PG_END_TRY(); if (yyresult) /* error */ return NIL; return yyextra.parsetree; } /* * Intermediate filter between parser and core lexer (core_yylex in scan.l). * * The filter is needed because in some cases the standard SQL grammar * requires more than one token lookahead. We reduce these cases to one-token * lookahead by combining tokens here, in order to keep the grammar LALR(1). * * Using a filter is simpler than trying to recognize multiword tokens * directly in scan.l, because we'd have to allow for comments between the * words. Furthermore it's not clear how to do it without re-introducing * scanner backtrack, which would cost more performance than this filter * layer does. * * The filter also provides a convenient place to translate between * the core_YYSTYPE and YYSTYPE representations (which are really the * same thing anyway, but notationally they're different). */ int base_yylex(YYSTYPE *lvalp, YYLTYPE *llocp, core_yyscan_t yyscanner) { base_yy_extra_type *yyextra = pg_yyget_extra(yyscanner); int cur_token; int next_token; core_YYSTYPE cur_yylval; YYLTYPE cur_yylloc; /* Get next token --- we might already have it */ if (yyextra->have_lookahead) { cur_token = yyextra->lookahead_token; lvalp->core_yystype = yyextra->lookahead_yylval; *llocp = yyextra->lookahead_yylloc; yyextra->have_lookahead = false; } else cur_token = core_yylex(&(lvalp->core_yystype), llocp, yyscanner); /* Do we need to look ahead for a possible multiword token? */ switch (cur_token) { case NULLS_P: /* * NULLS FIRST and NULLS LAST must be reduced to one token */ cur_yylval = lvalp->core_yystype; cur_yylloc = *llocp; next_token = core_yylex(&(lvalp->core_yystype), llocp, yyscanner); switch (next_token) { case FIRST_P: cur_token = NULLS_FIRST; break; case LAST_P: cur_token = NULLS_LAST; break; default: /* save the lookahead token for next time */ yyextra->lookahead_token = next_token; yyextra->lookahead_yylval = lvalp->core_yystype; yyextra->lookahead_yylloc = *llocp; yyextra->have_lookahead = true; /* and back up the output info to cur_token */ lvalp->core_yystype = cur_yylval; *llocp = cur_yylloc; break; } break; case WITH: /* * WITH TIME and WITH ORDINALITY must each be reduced to one token */ cur_yylval = lvalp->core_yystype; cur_yylloc = *llocp; next_token = core_yylex(&(lvalp->core_yystype), llocp, yyscanner); switch (next_token) { case TIME: cur_token = WITH_TIME; break; case ORDINALITY: cur_token = WITH_ORDINALITY; break; default: /* save the lookahead token for next time */ yyextra->lookahead_token = next_token; yyextra->lookahead_yylval = lvalp->core_yystype; yyextra->lookahead_yylloc = *llocp; yyextra->have_lookahead = true; /* and back up the output info to cur_token */ lvalp->core_yystype = cur_yylval; *llocp = cur_yylloc; break; } break; default: break; } return cur_token; } static int parse_version(const char *versionString) { int cnt; int vmaj, vmin, vrev; cnt = sscanf(versionString, "%d.%d.%d", &vmaj, &vmin, &vrev); if (cnt < 2) return -1; if (cnt == 2) vrev = 0; return (100 * vmaj + vmin) * 100 + vrev; } void parser_set_param(const char *name, const char *value) { if (strcmp(name, "server_version") == 0) { server_version_num = parse_version(value); } else if (strcmp(name, "server_encoding") == 0) { if (strcmp(value, "UTF8") == 0) server_encoding = PG_UTF8; else server_encoding = PG_SQL_ASCII; } else if (strcmp(name, "standard_conforming_strings") == 0) { if (strcmp(value, "on") == 0) standard_conforming_strings = true; else standard_conforming_strings = false; } } int GetDatabaseEncoding(void) { return server_encoding; } int pg_mblen(const char *mbstr) { return pg_utf_mblen((const unsigned char *) mbstr); } pgpool-II-3.4.3/src/parser/outfuncs.c0000664000076400007640000040122612554350605014362 00000000000000/*------------------------------------------------------------------------- * * outfuncs.c * Output functions for Postgres tree nodes. * * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION * $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.360 2009/06/11 14:48:58 momjian Exp $ * * NOTES * Every node type that can appear in stored rules' parsetrees *must* * have an output function defined here (as well as an input function * in readfuncs.c). For use in debugging, we also provide output * functions for nodes that appear in raw parsetrees, path, and plan trees. * These nodes however need not have input functions. * *------------------------------------------------------------------------- */ #include #include #include "pool_type.h" #include "utils/palloc.h" #include "utils/elog.h" #include "parser.h" #include "pool_string.h" #include "pg_list.h" #include "parsenodes.h" #include "pg_class.h" #include "pg_trigger.h" #include "value.h" #define booltostr(x) ((x) ? "true" : "false") void _outNode(String *str, void *obj); static void _outList(String *str, List *node); static void _outIdList(String *str, List *node); static void _outAlias(String *str, Alias *node); static void _outRangeVar(String *str, RangeVar *node); static void _outVar(String *str, Var *node); static void _outConst(String *str, Const *node); static void _outParam(String *str, Param *node); static void _outAggref(String *str, Aggref *node); static void _outArrayRef(String *str, ArrayRef *node); static void _outFuncExpr(String *str, FuncExpr *node); static void _outNamedArgExpr(String *str, NamedArgExpr *node); static void _outOpExpr(String *str, OpExpr *node); static void _outDistinctExpr(String *str, DistinctExpr *node); static void _outScalarArrayOpExpr(String *str, ScalarArrayOpExpr *node); static void _outBoolExpr(String *str, BoolExpr *node); static void _outSubLink(String *str, SubLink *node); static void _outSubPlan(String *str, SubPlan *node); static void _outFieldSelect(String *str, FieldSelect *node); static void _outFieldStore(String *str, FieldStore *node); static void _outRelabelType(String *str, RelabelType *node); static void _outConvertRowtypeExpr(String *str, ConvertRowtypeExpr *node); static void _outCaseExpr(String *str, CaseExpr *node); static void _outCaseWhen(String *str, CaseWhen *node); static void _outCaseTestExpr(String *str, CaseTestExpr *node); static void _outArrayExpr(String *str, ArrayExpr *node); static void _outRowExpr(String *str, RowExpr *node); static void _outCoalesceExpr(String *str, CoalesceExpr *node); static void _outMinMaxExpr(String *str, MinMaxExpr *node); static void _outNullIfExpr(String *str, NullIfExpr *node); static void _outNullTest(String *str, NullTest *node); static void _outBooleanTest(String *str, BooleanTest *node); static void _outCoerceToDomain(String *str, CoerceToDomain *node); static void _outCoerceToDomainValue(String *str, CoerceToDomainValue *node); static void _outSetToDefault(String *str, SetToDefault *node); static void _outTargetEntry(String *str, TargetEntry *node); static void _outRangeTblRef(String *str, RangeTblRef *node); static void _outJoinExpr(String *str, JoinExpr *node); static void _outFromExpr(String *str, FromExpr *node); static void _outCreateStmt(String *str, CreateStmt *node); static void _outCreateTableAsStmt(String *str, CreateTableAsStmt *node); static void _outIndexStmt(String *str, IndexStmt *node); static void _outNotifyStmt(String *str, NotifyStmt *node); static void _outDeclareCursorStmt(String *str, DeclareCursorStmt *node); static void _outSelectStmt(String *str, SelectStmt *node); static void _outFuncCall(String *str, FuncCall *node); static void _outDefElem(String *str, DefElem *node); static void _outLockingClause(String *str, LockingClause *node); static void _outColumnDef(String *str, ColumnDef *node); static void _outTypeName(String *str, TypeName *node); static void _outTypeCast(String *str, TypeCast *node); static void _outIndexElem(String *str, IndexElem *node); static void _outWithClause(String *str, WithClause *node); static void _outCommonTableExpr(String *str, CommonTableExpr *node); static void _outSetOperationStmt(String *str, SetOperationStmt *node); static void _outAExpr(String *str, A_Expr *node); static void _outValue(String *str, Value *value); static void _outColumnRef(String *str, ColumnRef *node); static void _outParamRef(String *str, ParamRef *node); static void _outAConst(String *str, A_Const *node); static void _outA_Indices(String *str, A_Indices *node); static void _outA_Indirection(String *str, A_Indirection *node); static void _outResTarget(String *str, ResTarget *node); static void _outA_ArrayExpr(String *str, A_ArrayExpr *node); static void _outWindowDef(String *str, WindowDef *node); static void _outConstraint(String *str, Constraint *node); static void _outSortBy(String *str, SortBy *node); static void _outInsertStmt(String *str, InsertStmt *node); static void _outUpdateStmt(String *str, UpdateStmt *node); static void _outDeleteStmt(String *str, DeleteStmt *node); static void _outTransactionStmt(String *str, TransactionStmt *node); static void _outTruncateStmt(String *str, TruncateStmt *node); #ifdef NOT_USED_IN_PGPOOL /* 9.0 does have this */ static void _outVacuumStmt(String *str, VacuumStmt *node); #endif static void _outExplainStmt(String *str, ExplainStmt *node); static void _outClusterStmt(String *str, ClusterStmt *node); static void _outCheckPointStmt(String *str, CheckPointStmt *node); static void _outClosePortalStmt(String *str, ClosePortalStmt *node); static void _outListenStmt(String *str, ListenStmt *node); static void _outUnlistenStmt(String *str, UnlistenStmt *node); static void _outLoadStmt(String *str, LoadStmt *node); static void _outCopyStmt(String *str, CopyStmt *node); static void _outDeallocateStmt(String *str, DeallocateStmt *node); static void _outRenameStmt(String *str, RenameStmt *node); static void _outCreateRoleStmt(String *str, CreateRoleStmt *node); static void _outAlterRoleStmt(String *str, AlterRoleStmt *node); static void _outDropRoleStmt(String *str, DropRoleStmt *node); static void _outCreateSchemaStmt(String *str, CreateSchemaStmt *node); static void _outVariableSetStmt(String *str, VariableSetStmt *node); static void _outVariableShowStmt(String *str, VariableShowStmt *node); static void _outConstraintsSetStmt(String *str, ConstraintsSetStmt *node); static void _outAlterTableStmt(String *str, AlterTableStmt *node); static void _outCreateSeqStmt(String *str, CreateSeqStmt *node); static void _outAlterSeqStmt(String *str, AlterSeqStmt *node); static void _outCreatePLangStmt(String *str, CreatePLangStmt *node); static void _outCreateTableSpaceStmt(String *str, CreateTableSpaceStmt *node); static void _outDropTableSpaceStmt(String *str, DropTableSpaceStmt *node); static void _outCreateTrigStmt(String *str, CreateTrigStmt *node); static void _outDefineStmt(String *str, DefineStmt *node); static void _outCreateOpClassStmt(String *str, CreateOpClassStmt *node); static void _outDropStmt(String *str, DropStmt *node); static void _outFetchStmt(String *str, FetchStmt *node); static void _outGrantStmt(String *str, GrantStmt *node); static void _outGrantRoleStmt(String *str, GrantRoleStmt *node); static void _outCreateFunctionStmt(String *str, CreateFunctionStmt *node); static void _outAlterFunctionStmt(String *str, AlterFunctionStmt *node); static void _outCreateCastStmt(String *str, CreateCastStmt *node); static void _outReindexStmt(String *str, ReindexStmt *node); static void _outRuleStmt(String *str, RuleStmt *node); static void _outViewStmt(String *str, ViewStmt *node); static void _outCreatedbStmt(String *str, CreatedbStmt *node); static void _outAlterDatabaseStmt(String *str, AlterDatabaseStmt *node); static void _outAlterDatabaseSetStmt(String *str, AlterDatabaseSetStmt *node); static void _outDropdbStmt(String *str, DropdbStmt *node); static void _outCreateDomainStmt(String *str, CreateDomainStmt *node); static void _outAlterDomainStmt(String *str, AlterDomainStmt *node); static void _outCreateConversionStmt(String *str, CreateConversionStmt *node); static void _outPrepareStmt(String *str, PrepareStmt *node); static void _outExecuteStmt(String *str, ExecuteStmt *node); static void _outLockStmt(String *str, LockStmt *node); static void _outCommentStmt(String *str, CommentStmt *node); static void _outDiscardStmt(String *str, DiscardStmt *node); static void _outCreateOpFamilyStmt(String *str, CreateOpFamilyStmt *node); static void _outAlterOpFamilyStmt(String *str, AlterOpFamilyStmt *node); static void _outCreateEnumStmt(String *str, CreateEnumStmt *node); static void _outDropOwnedStmt(String *str, DropOwnedStmt *node); static void _outReassignOwnedStmt(String *str, ReassignOwnedStmt *node); static void _outAlterTSDictionaryStmt(String *str, AlterTSDictionaryStmt *node); static void _outAlterTSConfigurationStmt(String *str, AlterTSConfigurationStmt *node); static void _outXmlExpr(String *str, XmlExpr *node); static void _outXmlSerialize(String *str, XmlSerialize *node); static void _outFuncName(String *str, List *func_name); static void _outSetRest(String *str, VariableSetStmt *node); static void _outSetTransactionModeList(String *str, List *list); static void _outAlterTableCmd(String *str, AlterTableCmd *node); static void _outOptSeqList(String *str, List *options); static void _outPrivGrantee(String *str, PrivGrantee *node); static void _outFuncWithArgs(String *str, FuncWithArgs *node); static void _outFunctionParameter(String *str, FunctionParameter *node); static void _outPrivilegeList(String *str, List *list); static void _outFuncOptList(String *str, List *list); static void _outCreatedbOptList(String *str, List *options); static void _outOperatorArgTypes(String *str, List *args); static void _outRangeFunction(String *str, RangeFunction *node); static void _outInhRelation(String *str, TableLikeClause *node); static void _outWithDefinition(String *str, List *def_list); static void _outCurrentOfExpr(String *str, CurrentOfExpr *node); /* * Borrowed from backend/catalog/namespace.c * NameListToString * Utility routine to convert a qualified-name list into a string. * * This is used primarily to form error messages, and so we do not quote * the list elements, for the sake of legibility. * * In most scenarios the list elements should always be Value strings, * but we also allow A_Star for the convenience of ColumnRef processing. */ char * NameListToString(List *names) { StringInfoData string; ListCell *l; initStringInfo(&string); foreach(l, names) { Node *name = (Node *) lfirst(l); if (l != list_head(names)) appendStringInfoChar(&string, '.'); if (IsA(name, String)) appendStringInfoString(&string, strVal(name)); else if (IsA(name, A_Star)) appendStringInfoString(&string, "*"); else elog(ERROR, "unexpected node type in name list: %d", (int) nodeTag(name)); } return string.data; } static char *escape_string(char *str) { int len = strlen(str), i, j; char *es = palloc0(len * 2 + 1); if (es == NULL) { return NULL; } for (i = 0, j = 0; i < len; i++, j++) { if (str[i] == '\'') { es[j++] = '\''; } else if (str[i] == '\\') { es[j++] = '\\'; } es[j] = str[i]; } return es; } static void _outIdList(String *str, List *node) { ListCell *lc; char first = 0; foreach(lc, node) { Value *v = lfirst(lc); if (first == 0) first = 1; else string_append_char(str, ", "); string_append_char(str, "\""); string_append_char(str, v->val.str); string_append_char(str, "\""); } } static void _outList(String *str, List *node) { ListCell *lc; char first = 0; foreach(lc, node) { if (first == 0) first = 1; else { if (!IsA(lfirst(lc), A_Indices)) string_append_char(str, ","); } _outNode(str, lfirst(lc)); } } /***************************************************************************** * * Stuff from primnodes.h. * *****************************************************************************/ static void _outAlias(String *str, Alias *node) { string_append_char(str, " AS \""); string_append_char(str, node->aliasname); string_append_char(str, "\""); if (node->colnames) { string_append_char(str, "("); _outNode(str, node->colnames); string_append_char(str, ")"); } } static void _outRangeVar(String *str, RangeVar *node) { if (node->catalogname) { string_append_char(str, "\""); string_append_char(str, node->catalogname); string_append_char(str, "\"."); } if (node->schemaname) { string_append_char(str, "\""); string_append_char(str, node->schemaname); string_append_char(str, "\"."); } string_append_char(str, "\""); string_append_char(str, node->relname); string_append_char(str, "\""); if (node->alias) _outNode(str, node->alias); if (node->inhOpt == INH_YES) { string_append_char(str, " * "); } } static void _outVar(String *str, Var *node) { } static void _outConst(String *str, Const *node) { } static void _outParam(String *str, Param *node) { } static void _outAggref(String *str, Aggref *node) { } static void _outArrayRef(String *str, ArrayRef *node) { } static void _outFuncExpr(String *str, FuncExpr *node) { } static void _outNamedArgExpr(String *str, NamedArgExpr *node) { string_append_char(str, node->name); string_append_char(str, " := "); _outNode(str, node->arg); } static void _outOpExpr(String *str, OpExpr *node) { } static void _outDistinctExpr(String *str, DistinctExpr *node) { } static void _outScalarArrayOpExpr(String *str, ScalarArrayOpExpr *node) { } static void _outBoolExpr(String *str, BoolExpr *node) { } static void _outSubLink(String *str, SubLink *node) { _outNode(str, node->testexpr); if (node->operName != NIL) { Value *v = linitial(node->operName); if (strcmp(v->val.str, "=") == 0) string_append_char(str, " IN "); else { string_append_char(str, v->val.str); } } switch (node->subLinkType) { case EXISTS_SUBLINK: string_append_char(str, " EXISTS "); break; case ARRAY_SUBLINK: string_append_char(str, " ARRAY "); break; case ANY_SUBLINK: if (node->operName != NIL) { Value *v = linitial(node->operName); if (strcmp(v->val.str, "=") != 0) { string_append_char(str, v->val.str); string_append_char(str, " ANY "); } } break; case ALL_SUBLINK: string_append_char(str, " ALL "); break; default: break; } if (node->subselect) { string_append_char(str, "("); _outNode(str, node->subselect); string_append_char(str, ")"); } } static void _outSubPlan(String *str, SubPlan *node) { } static void _outFieldSelect(String *str, FieldSelect *node) { } static void _outFieldStore(String *str, FieldStore *node) { } static void _outRelabelType(String *str, RelabelType *node) { } static void _outConvertRowtypeExpr(String *str, ConvertRowtypeExpr *node) { } static void _outCaseExpr(String *str, CaseExpr *node) { ListCell *lc; string_append_char(str, "CASE "); if (node->arg) _outNode(str, node->arg); foreach (lc, node->args) { _outNode(str, lfirst(lc)); } if (node->defresult) { string_append_char(str, " ELSE "); _outNode(str, node->defresult); } string_append_char(str, " END"); } static void _outCaseWhen(String *str, CaseWhen *node) { string_append_char(str, " WHEN "); _outNode(str, node->expr); string_append_char(str, " THEN "); _outNode(str, node->result); } static void _outCaseTestExpr(String *str, CaseTestExpr *node) { } static void _outArrayExpr(String *str, ArrayExpr *node) { string_append_char(str, "["); _outNode(str, node->elements); string_append_char(str, "]"); } static void _outRowExpr(String *str, RowExpr *node) { if (node->args == NIL) string_append_char(str, "ROW ()"); else { string_append_char(str, "ROW ("); _outNode(str, node->args); string_append_char(str, ")"); } } static void _outCoalesceExpr(String *str, CoalesceExpr *node) { string_append_char(str, "COALESCE ("); _outNode(str, node->args); string_append_char(str, ")"); } static void _outMinMaxExpr(String *str, MinMaxExpr *node) { if (node->op == IS_GREATEST) { string_append_char(str, "GREATEST ("); _outNode(str, node->args); string_append_char(str, ")"); } else if (node->op == IS_LEAST) { string_append_char(str, "LEAST ("); _outNode(str, node->args); string_append_char(str, ")"); } } static void _outNullIfExpr(String *str, NullIfExpr *node) { } static void _outNullTest(String *str, NullTest *node) { _outNode(str, node->arg); if (node->nulltesttype == IS_NOT_NULL) string_append_char(str, " IS NOT NULL"); else string_append_char(str, " IS NULL"); } static void _outBooleanTest(String *str, BooleanTest *node) { _outNode(str, node->arg); switch (node->booltesttype) { case IS_TRUE: string_append_char(str, " IS TRUE"); break; case IS_NOT_TRUE: string_append_char(str, " IS NOT TRUE"); break; case IS_FALSE: string_append_char(str, " IS FALSE"); break; case IS_NOT_FALSE: string_append_char(str, " IS NOT FALSE"); break; case IS_UNKNOWN: string_append_char(str, " IS UNKNOWN"); break; case IS_NOT_UNKNOWN: string_append_char(str, " IS NOT UNKNOWN"); break; } } static void _outCoerceToDomain(String *str, CoerceToDomain *node) { } static void _outCoerceToDomainValue(String *str, CoerceToDomainValue *node) { } static void _outSetToDefault(String *str, SetToDefault *node) { string_append_char(str, "DEFAULT"); } static void _outTargetEntry(String *str, TargetEntry *node) { } static void _outRangeTblRef(String *str, RangeTblRef *node) { } static void _outJoinExpr(String *str, JoinExpr *node) { _outNode(str, node->larg); if (node->isNatural == TRUE) string_append_char(str, " NATURAL"); if (node->jointype == JOIN_INNER) { if (node->usingClause == NIL && node->quals == NULL && !node->isNatural) string_append_char(str, " CROSS JOIN "); else string_append_char(str, " JOIN "); } else if (node->jointype == JOIN_INNER) string_append_char(str, " JOIN "); else if (node->jointype == JOIN_LEFT) string_append_char(str, " LEFT OUTER JOIN "); else if (node->jointype == JOIN_FULL) string_append_char(str, " FULL OUTER JOIN "); else if (node->jointype == JOIN_RIGHT) string_append_char(str, " RIGHT OUTER JOIN "); _outNode(str, node->rarg); if (node->usingClause != NIL && IsA(node->usingClause, List)) { ListCell *lc; char comma = 0; string_append_char(str, " USING("); foreach (lc, node->usingClause) { Value *value; if (comma == 0) comma = 1; else string_append_char(str, ","); value = lfirst(lc); string_append_char(str, "\""); string_append_char(str, value->val.str); string_append_char(str, "\""); } string_append_char(str, ")"); } if (node->quals) { string_append_char(str, " ON "); _outNode(str, node->quals); } } static void _outFromExpr(String *str, FromExpr *node) { } /***************************************************************************** * * Stuff from parsenodes.h. * *****************************************************************************/ static void _outCreateStmt(String *str, CreateStmt *node) { string_append_char(str, "CREATE "); if (node->relation->relpersistence == RELPERSISTENCE_TEMP) string_append_char(str, "TEMP "); string_append_char(str, "TABLE "); _outNode(str, node->relation); string_append_char(str, " ("); _outNode(str, node->tableElts); string_append_char(str, ") "); if (node->inhRelations != NIL) { string_append_char(str, "INHERITS ("); _outNode(str, node->inhRelations); string_append_char(str, ")"); } if (node->options) _outWithDefinition(str, node->options); switch (node->oncommit) { case ONCOMMIT_DROP: string_append_char(str, " ON COMMIT DROP"); break; case ONCOMMIT_DELETE_ROWS: string_append_char(str, " ON COMMIT DELETE ROWS"); break; case ONCOMMIT_PRESERVE_ROWS: string_append_char(str, " ON COMMIT PRESERVE ROWS"); break; default: break; } if (node->tablespacename) { string_append_char(str, " TABLESPACE \""); string_append_char(str, node->tablespacename); string_append_char(str, "\""); } } static void _outCreateTableAsStmt(String *str, CreateTableAsStmt *node) { string_append_char(str, "CREATE "); if (node->into->rel->relpersistence == RELPERSISTENCE_TEMP) string_append_char(str, "TEMP "); string_append_char(str, "TABLE "); _outNode(str, node->into->rel); if (node->into->colNames) { string_append_char(str, " ("); _outIdList(str, node->into->colNames); string_append_char(str, ") "); } if (node->into->options) _outWithDefinition(str, node->into->options); switch (node->into->onCommit) { case ONCOMMIT_DROP: string_append_char(str, " ON COMMIT DROP"); break; case ONCOMMIT_DELETE_ROWS: string_append_char(str, " ON COMMIT DELETE ROWS"); break; case ONCOMMIT_PRESERVE_ROWS: string_append_char(str, " ON COMMIT PRESERVE ROWS"); break; default: break; } if (node->into->tableSpaceName) { string_append_char(str, " TABLESPACE \""); string_append_char(str, node->into->tableSpaceName); string_append_char(str, "\""); } if (node->query) { string_append_char(str, " AS"); _outSelectStmt(str, (SelectStmt *)node->query); } } static void _outIndexStmt(String *str, IndexStmt *node) { string_append_char(str, "CREATE "); if (node->unique == TRUE) string_append_char(str, "UNIQUE "); if (node->concurrent == true) string_append_char(str, "INDEX CONCURRENTLY "); else string_append_char(str, "INDEX "); if (node->idxname) { string_append_char(str, "\""); string_append_char(str, node->idxname); string_append_char(str, "\" "); } string_append_char(str, "ON "); _outNode(str, node->relation); if (strcmp(node->accessMethod, DEFAULT_INDEX_TYPE)) { string_append_char(str, " USING "); string_append_char(str, node->accessMethod); } string_append_char(str, "("); _outNode(str, node->indexParams); string_append_char(str, ")"); if (node->tableSpace) { string_append_char(str, " TABLESPACE \""); string_append_char(str, node->tableSpace); string_append_char(str, "\""); } if (node->whereClause) { string_append_char(str, " WHERE "); _outNode(str, node->whereClause); } } static void _outNotifyStmt(String *str, NotifyStmt *node) { string_append_char(str, "NOTIFY "); string_append_char(str, "\""); string_append_char(str, node->conditionname); string_append_char(str, "\""); } static void _outDeclareCursorStmt(String *str, DeclareCursorStmt *node) { string_append_char(str, "DECLARE \""); string_append_char(str, node->portalname); string_append_char(str, "\" "); if (node->options & CURSOR_OPT_SCROLL) string_append_char(str, "SCROLL "); if (node->options & CURSOR_OPT_BINARY) string_append_char(str, "BINARY "); if (node->options & CURSOR_OPT_INSENSITIVE) string_append_char(str, "INSENSITIVE "); string_append_char(str, "CURSOR "); if (node->options & CURSOR_OPT_HOLD) string_append_char(str, "WITH HOLD "); string_append_char(str, "FOR"); _outNode(str, node->query); } static void _outSelectStmt(String *str, SelectStmt *node) { if (node->larg) /* SETOP */ { string_append_char(str, "("); _outNode(str, node->larg); string_append_char(str, ") "); switch (node->op) { case SETOP_UNION: string_append_char(str, " UNION "); break; case SETOP_INTERSECT: string_append_char(str, " INTERSECT "); break; case SETOP_EXCEPT: string_append_char(str, " EXCEPT "); default: break; } if (node->all) string_append_char(str, "ALL "); if (node->rarg) { string_append_char(str, "("); _outNode(str, node->rarg); string_append_char(str, ") "); } } else if (node->valuesLists) /* VALUES ... */ { ListCell *lc; int comma = 0; string_append_char(str, " VALUES"); foreach (lc, node->valuesLists) { if (comma == 0) comma = 1; else string_append_char(str, ","); string_append_char(str, " ("); _outNode(str, lfirst(lc)); string_append_char(str, ")"); } } else { if (node->intoClause) { IntoClause *into = (IntoClause *)node->intoClause; RangeVar *rel = (RangeVar *)into->rel; string_append_char(str, "CREATE "); if (rel->relpersistence == RELPERSISTENCE_TEMP) string_append_char(str, "TEMP "); string_append_char(str, "TABLE "); _outNode(str, into->rel); if (into->colNames) { string_append_char(str, " ("); _outNode(str, into->colNames); string_append_char(str, ") "); } if (into->options) _outWithDefinition(str, into->options); switch (into->onCommit) { case ONCOMMIT_DROP: string_append_char(str, " ON COMMIT DROP"); break; case ONCOMMIT_DELETE_ROWS: string_append_char(str, " ON COMMIT DELETE ROWS"); break; case ONCOMMIT_PRESERVE_ROWS: string_append_char(str, " ON COMMIT PRESERVE ROWS"); break; default: break; } string_append_char(str, " AS"); } if (node->withClause) _outWithClause(str, node->withClause); string_append_char(str, " SELECT "); if (node->distinctClause) { string_append_char(str, "DISTINCT "); if (lfirst(list_head(node->distinctClause)) != NIL) { string_append_char(str, "ON ("); _outNode(str, node->distinctClause); string_append_char(str, " ) "); } } _outNode(str, node->targetList); if (node->fromClause) { string_append_char(str, " FROM "); _outNode(str, node->fromClause); } if (node->whereClause) { string_append_char(str, " WHERE "); _outNode(str, node->whereClause); } if (node->groupClause) { string_append_char(str, " GROUP BY "); _outNode(str, node->groupClause); } if (node->havingClause) { string_append_char(str, " HAVING "); _outNode(str, node->havingClause); } if (node->windowClause) { string_append_char(str, " WINDOW "); _outNode(str, node->windowClause); } } if (node->sortClause) { string_append_char(str, " ORDER BY "); _outNode(str, node->sortClause); } if (node->limitOffset) { string_append_char(str, " OFFSET "); _outNode(str, node->limitOffset); } if (node->limitCount) { string_append_char(str, " LIMIT "); if (IsA(node->limitCount, A_Const) && ((A_Const *)node->limitCount)->val.type == T_Null) { string_append_char(str, "ALL "); } else { _outNode(str, node->limitCount); } } _outNode(str, node->lockingClause); } static void _outFuncCall(String *str, FuncCall *node) { char *funcname; _outFuncName(str, node->funcname); funcname = strVal(lfirst(list_head(node->funcname))); if(strcmp(funcname,"user") == 0 || strcmp(funcname,"current_user") == 0 || strcmp(funcname,"session_user") == 0 || strcmp(funcname,"current_role") == 0) return ; string_append_char(str, "("); if (node->func_variadic == TRUE) string_append_char(str, "VARIADIC "); if (node->agg_distinct == TRUE) string_append_char(str, "DISTINCT "); if (node->agg_star == TRUE) string_append_char(str, "*"); else _outNode(str, node->args); if (node->agg_order != NIL) { string_append_char(str, " ORDER BY "); _outNode(str, node->agg_order); } string_append_char(str, ")"); if (node->over) { string_append_char(str, " OVER "); if (node->over->name) { string_append_char(str, "\""); string_append_char(str, node->over->name); string_append_char(str, "\""); } else _outWindowDef(str, node->over); } } static void _outDefElem(String *str, DefElem *node) { } static void _outLockingClause(String *str, LockingClause *node) { if (node == NULL) return; switch(node->strength) { case LCS_FORKEYSHARE: string_append_char(str, " FOR KEY SHARE"); break; case LCS_FORSHARE: string_append_char(str, " FOR SHARE"); break; case LCS_FORNOKEYUPDATE: string_append_char(str, " FOR NO KEY UPDATE"); break; case LCS_FORUPDATE: string_append_char(str, " FOR UPDATE"); break; } _outNode(str, node->lockedRels); if (node->noWait == TRUE) string_append_char(str, " NOWAIT "); } static void _outColumnDef(String *str, ColumnDef *node) { string_append_char(str, "\""); string_append_char(str, node->colname); string_append_char(str, "\" "); _outNode(str, node->typeName); _outNode(str, node->constraints); } static void _outTypeName(String *str, TypeName *node) { /* don't quote SystemType name, because * 1. char is not "char". * 2. in 8.4, interval with fields cause error. * =# SELECT '1'::"interval" year; * ERROR: syntax error at or near "year" * LINE 1: SELECT '1'::"interval" year; */ if (list_length(node->names) == 2 && strcmp("pg_catalog", strVal(linitial(node->names))) == 0) { string_append_char(str, strVal(lsecond(node->names))); if (strcmp("interval", strVal(lsecond(node->names))) == 0) { if (node->typmods != NIL) { A_Const *v = (A_Const *) linitial(node->typmods); int mask = v->val.val.ival; /* precision for SECOND field. * backword comaptibility. * use `'1.2 second'::interval(0) second' * not `'1.2 second'::interval second(0)'(standarad for 8.4). */ if ((INTERVAL_MASK(SECOND) & mask) && list_length(node->typmods) == 2) { string_append_char(str, "("); _outAConst(str, lsecond(node->typmods)); string_append_char(str, ")"); } /* optional fields */ if (mask == INTERVAL_MASK(YEAR)) string_append_char(str, " YEAR"); else if (mask == INTERVAL_MASK(MONTH)) string_append_char(str, " MONTH"); else if (mask == INTERVAL_MASK(DAY)) string_append_char(str, " DAY"); else if (mask == INTERVAL_MASK(HOUR)) string_append_char(str, " HOUR"); else if (mask == INTERVAL_MASK(MINUTE)) string_append_char(str, " MINUTE"); else if (mask == INTERVAL_MASK(SECOND)) string_append_char(str, " SECOND"); else if (mask == (INTERVAL_MASK(YEAR) | INTERVAL_MASK(MONTH))) string_append_char(str, " YEAR TO MONTH"); else if (mask == (INTERVAL_MASK(DAY) | INTERVAL_MASK(HOUR))) string_append_char(str, " DAY TO HOUR"); else if (mask == (INTERVAL_MASK(DAY) | INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE))) string_append_char(str, " DAY TO MINUTE"); else if (mask == (INTERVAL_MASK(DAY) | INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE) | INTERVAL_MASK(SECOND))) string_append_char(str, " DAY TO SECOND"); else if (mask == (INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE))) string_append_char(str, " HOUR TO MINUTE"); else if (mask == (INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE) | INTERVAL_MASK(SECOND))) string_append_char(str, " HOUR TO SECOND"); else if (mask == (INTERVAL_MASK(MINUTE) | INTERVAL_MASK(SECOND))) string_append_char(str, " MINUTE TO SECOND"); } return; } } else { ListCell *lc; char dot = 0; foreach (lc, node->names) { Value *v = (Value *) lfirst(lc); char *typename = v->val.str; if (dot == 0) dot = 1; else string_append_char(str, "."); if(node->typemod < 0) { string_append_char(str, "\""); string_append_char(str, typename); string_append_char(str, "\""); } else string_append_char(str, typename); } } /* precisions */ if (node->typmods) { string_append_char(str, "("); _outList(str, node->typmods); string_append_char(str, ")"); } if (node->arrayBounds != NIL) { ListCell *lc; foreach (lc, node->arrayBounds) { if (intVal(lfirst(lc)) == -1) string_append_char(str, "[]"); else { string_append_char(str, "["); _outNode(str, lfirst(lc)); string_append_char(str, "]"); } } } } static void _outTypeCast(String *str, TypeCast *node) { _outNode(str, node->arg); string_append_char(str, "::"); _outNode(str, node->typeName); } static void _outIndexElem(String *str, IndexElem *node) { if (node->name) { string_append_char(str, "\""); string_append_char(str, node->name); string_append_char(str, "\""); if (node->opclass != NIL) _outNode(str, node->opclass); } else { string_append_char(str, "("); _outNode(str, node->expr); string_append_char(str, ")"); if (node->opclass != NIL) _outNode(str, node->opclass); } } static void _outWithClause(String *str, WithClause *node) { string_append_char(str, " WITH "); if (node->recursive) string_append_char(str, "RECURSIVE "); _outList(str, node->ctes); } static void _outCommonTableExpr(String *str, CommonTableExpr *node) { string_append_char(str, "\""); string_append_char(str, node->ctename); string_append_char(str, "\" "); if (node->aliascolnames) { string_append_char(str, "("); _outIdList(str, node->aliascolnames); string_append_char(str, ") "); } string_append_char(str, "AS ("); _outNode(str, node->ctequery); string_append_char(str, ")"); } static void _outSetOperationStmt(String *str, SetOperationStmt *node) { } static void _outAExpr(String *str, A_Expr *node) { Value *v; switch (node->kind) { case AEXPR_OP: if (list_length(node->name) == 1) { Value *op = (Value *) lfirst(list_head(node->name)); string_append_char(str, " ("); _outNode(str, node->lexpr); string_append_char(str, op->val.str); _outNode(str, node->rexpr); string_append_char(str, " )"); } break; case AEXPR_AND: string_append_char(str, " ("); _outNode(str, node->lexpr); string_append_char(str, " AND "); _outNode(str, node->rexpr); string_append_char(str, ")"); break; case AEXPR_OR: string_append_char(str, " ("); _outNode(str, node->lexpr); string_append_char(str, " OR "); _outNode(str, node->rexpr); string_append_char(str, ")"); break; case AEXPR_NOT: string_append_char(str, " (NOT "); _outNode(str, node->rexpr); string_append_char(str, ")"); break; case AEXPR_OP_ANY: _outNode(str, node->lexpr); v = linitial(node->name); string_append_char(str, v->val.str); string_append_char(str, "ANY("); _outNode(str, node->rexpr); string_append_char(str, ")"); break; case AEXPR_OP_ALL: _outNode(str, node->lexpr); v = linitial(node->name); string_append_char(str, v->val.str); string_append_char(str, "ALL("); _outNode(str, node->rexpr); string_append_char(str, ")"); break; case AEXPR_DISTINCT: string_append_char(str, " ("); _outNode(str, node->lexpr); string_append_char(str, " IS DISTINCT FROM "); _outNode(str, node->rexpr); string_append_char(str, ")"); break; case AEXPR_NULLIF: string_append_char(str, " NULLIF("); _outNode(str, node->lexpr); string_append_char(str, ", "); _outNode(str, node->rexpr); string_append_char(str, ")"); break; case AEXPR_OF: _outNode(str, node->lexpr); v = linitial(node->name); if (v->val.str[0] == '!') string_append_char(str, " IS NOT OF ("); else string_append_char(str, " IS OF ("); _outNode(str, node->rexpr); string_append_char(str, ")"); break; case AEXPR_IN: _outNode(str, node->lexpr); v = (Value *)lfirst(list_head(node->name)); if (v->val.str[0] == '=') string_append_char(str, " IN ("); else string_append_char(str, " NOT IN ("); _outNode(str, node->rexpr); string_append_char(str, ")"); break; default: break; } } static void _outValue(String *str, Value *value) { char buf[16]; switch (value->type) { case T_Integer: sprintf(buf, "%ld", value->val.ival); string_append_char(str, buf); break; case T_Float: string_append_char(str, value->val.str); break; case T_String: string_append_char(str, "'"); string_append_char(str, escape_string(value->val.str)); string_append_char(str, "'"); break; case T_Null: string_append_char(str, "NULL"); break; default: break; } } static void _outColumnRef(String *str, ColumnRef *node) { ListCell *c; char first = 0; foreach (c, node->fields) { Node *n = (Node *) lfirst(c); if (IsA(n, String)) { Value *v = (Value *) lfirst(c); if (first == 0) first = 1; else string_append_char(str, "."); string_append_char(str, "\""); string_append_char(str, v->val.str); string_append_char(str, "\""); } else if (IsA(n, A_Star)) { if (first == 0) first = 1; else string_append_char(str, "."); string_append_char(str, "*"); } } } static void _outParamRef(String *str, ParamRef *node) { char buf[16]; snprintf(buf, 16, "%d", node->number); string_append_char(str, "$"); string_append_char(str, buf); } static void _outAConst(String *str, A_Const *node) { char buf[16]; switch (node->val.type) { case T_Integer: sprintf(buf, "%ld", node->val.val.ival); string_append_char(str, buf); break; case T_Float: string_append_char(str, node->val.val.str); break; case T_String: string_append_char(str, "'"); string_append_char(str, escape_string(node->val.val.str)); string_append_char(str, "'"); break; case T_Null: string_append_char(str, "NULL"); break; default: break; } } static void _outA_Indices(String *str, A_Indices *node) { string_append_char(str, "["); if (node->lidx) { _outNode(str, node->lidx); string_append_char(str, ":"); } _outNode(str, node->uidx); string_append_char(str, "]"); } static void _outA_Indirection(String *str, A_Indirection *node) { ListCell *lc; if (node->indirection != NIL) { if (IsA(node->arg, ParamRef)) /* "$1[1]" OR "$1.foo" */ _outParamRef(str, (ParamRef *) node->arg); else { /* "(ARRAY[1])[1]" */ string_append_char(str, "("); _outNode(str, node->arg); string_append_char(str, ")"); } foreach (lc, node->indirection) { Node *ind = lfirst(lc); if (IsA(ind, A_Star)) /* foo.* */ string_append_char(str, ".*"); else if (IsA(ind, String)) { /* foo.bar */ string_append_char(str, ".\""); string_append_char(str, strVal(ind)); string_append_char(str, "\""); } else /* foo[1] (A_Indices)*/ _outNode(str, ind); } } } static void _outA_ArrayExpr(String *str, A_ArrayExpr *node) { string_append_char(str, "ARRAY ["); _outNode(str, node->elements); string_append_char(str,"]"); } static void _outResTarget(String *str, ResTarget *node) { if (node->indirection != NIL) { string_append_char(str, "\""); string_append_char(str, node->name); string_append_char(str, "\"="); _outNode(str, node->val); } else { _outNode(str, node->val); if (node->name) { string_append_char(str, " AS "); string_append_char(str, "\""); string_append_char(str, node->name); string_append_char(str, "\" "); } } } static void _outWindowDef(String *str, WindowDef *node) { if (node->name) { string_append_char(str, "\""); string_append_char(str, node->name); string_append_char(str, "\" AS "); } string_append_char(str, "("); if (node->refname) { string_append_char(str, "\""); string_append_char(str, node->refname); string_append_char(str, "\" "); } if (node->partitionClause) { string_append_char(str, " PARTITION BY "); _outNode(str, node->partitionClause); } if (node->orderClause) { string_append_char(str, " ORDER BY "); _outNode(str, node->orderClause); } if (node->frameOptions != FRAMEOPTION_DEFAULTS) { if (node->frameOptions & FRAMEOPTION_RANGE) string_append_char(str, " RANGE"); else if (node->frameOptions & FRAMEOPTION_ROWS) string_append_char(str, " ROWS"); if (node->frameOptions & FRAMEOPTION_BETWEEN) string_append_char(str, " BETWEEN"); if (node->frameOptions & FRAMEOPTION_START_UNBOUNDED_PRECEDING) string_append_char(str, " UNBOUNDED PRECEDING"); else if (node->frameOptions & FRAMEOPTION_START_UNBOUNDED_FOLLOWING) string_append_char(str, " UNBOUNDED FOLLOWING"); else if (node->frameOptions & FRAMEOPTION_START_CURRENT_ROW) string_append_char(str, " UNBOUNDED CURRENT ROW"); else if (node->frameOptions & FRAMEOPTION_START_VALUE_PRECEDING) { string_append_char(str, " "); _outNode(str, node->startOffset); string_append_char(str, " PRECEDING"); } else if (node->frameOptions & FRAMEOPTION_START_VALUE_FOLLOWING) { string_append_char(str, " "); _outNode(str, node->startOffset); string_append_char(str, " FOLLOWING"); } if (node->frameOptions & FRAMEOPTION_BETWEEN) { string_append_char(str, " AND"); if (node->frameOptions & FRAMEOPTION_END_UNBOUNDED_PRECEDING) string_append_char(str, " UNBOUNDED PRECEDING"); else if (node->frameOptions & FRAMEOPTION_END_UNBOUNDED_FOLLOWING) string_append_char(str, " UNBOUNDED FOLLOWING"); else if (node->frameOptions & FRAMEOPTION_END_CURRENT_ROW) string_append_char(str, " UNBOUNDED CURRENT ROW"); else if (node->frameOptions & FRAMEOPTION_END_VALUE_PRECEDING) { string_append_char(str, " "); _outNode(str, node->endOffset); string_append_char(str, " PRECEDING"); } else if (node->frameOptions & FRAMEOPTION_END_VALUE_FOLLOWING) { string_append_char(str, " "); _outNode(str, node->endOffset); string_append_char(str, " FOLLOWING"); } } } string_append_char(str, ")"); } static void _outConstraint(String *str, Constraint *node) { if (node->conname) { string_append_char(str, "CONSTRAINT \""); string_append_char(str, node->conname); string_append_char(str, "\""); } switch (node->contype) { case CONSTR_CHECK: string_append_char(str, " CHECK ("); _outNode(str, node->raw_expr); string_append_char(str, ")"); break; case CONSTR_UNIQUE: string_append_char(str, " UNIQUE"); if (node->keys) { string_append_char(str, "("); _outIdList(str, node->keys); string_append_char(str, ")"); } if (node->options) { _outWithDefinition(str, node->options); } if (node->indexspace) { string_append_char(str, " USING INDEX TABLESPACE \""); string_append_char(str, node->indexspace); string_append_char(str, "\""); } break; case CONSTR_PRIMARY: string_append_char(str, " PRIMARY KEY"); if (node->keys) { string_append_char(str, "("); _outIdList(str, node->keys); string_append_char(str, ")"); } if (node->options) ; if (node->indexspace) { string_append_char(str, " USING INDEX TABLESPACE \""); string_append_char(str, node->indexspace); string_append_char(str, "\""); } break; case CONSTR_FOREIGN: if (node->fk_attrs != NIL) { string_append_char(str, " FOREIGN KEY("); _outIdList(str, node->fk_attrs); string_append_char(str, ")"); } string_append_char(str, " REFERENCES "); _outNode(str, node->pktable); if (node->pk_attrs != NIL) { string_append_char(str, "("); _outIdList(str, node->pk_attrs); string_append_char(str, ")"); } switch (node->fk_matchtype) { case FKCONSTR_MATCH_FULL: string_append_char(str, " MATCH FULL"); break; case FKCONSTR_MATCH_PARTIAL: string_append_char(str, " MATCH PARTIAL"); break; default: break; } switch (node->fk_upd_action) { case FKCONSTR_ACTION_RESTRICT: string_append_char(str, " ON UPDATE RESTRICT"); break; case FKCONSTR_ACTION_CASCADE: string_append_char(str, " ON UPDATE CASCADE"); break; case FKCONSTR_ACTION_SETNULL: string_append_char(str, " ON UPDATE SET NULL"); break; case FKCONSTR_ACTION_SETDEFAULT: string_append_char(str, " ON UPDATE SET DEFAULT"); break; default: break; } switch (node->fk_del_action) { case FKCONSTR_ACTION_RESTRICT: string_append_char(str, " ON DELETE RESTRICT"); break; case FKCONSTR_ACTION_CASCADE: string_append_char(str, " ON DELETE CASCADE"); break; case FKCONSTR_ACTION_SETNULL: string_append_char(str, " ON DELETE SET NULL"); break; case FKCONSTR_ACTION_SETDEFAULT: string_append_char(str, " ON DELETE SET DEFAULT"); break; default: break; } if (node->deferrable) string_append_char(str, " DEFERRABLE"); if (node->initdeferred) string_append_char(str, " INITIALLY DEFERRED"); break; case CONSTR_NOTNULL: string_append_char(str, " NOT NULL"); break; case CONSTR_NULL: string_append_char(str, " NULL"); break; case CONSTR_DEFAULT: string_append_char(str, "DEFAULT "); _outNode(str, node->raw_expr); break; default: break; } } static void _outSortBy(String *str, SortBy *node) { _outNode(str, node->node); if (node->sortby_dir == SORTBY_USING) { string_append_char(str, " USING "); _outNode(str, node->useOp); } else if (node->sortby_dir == SORTBY_DESC) string_append_char(str, " DESC "); if (node->sortby_nulls == SORTBY_NULLS_FIRST) string_append_char(str, " NULLS FIRST "); else if (node->sortby_nulls == SORTBY_NULLS_LAST) string_append_char(str, " NULLS LAST "); } static void _outInsertStmt(String *str, InsertStmt *node) { string_append_char(str, "INSERT INTO "); _outNode(str, node->relation); if (node->cols == NIL && node->selectStmt == NULL) string_append_char(str, " DEFAULT VALUES"); if (node->cols) { char comma = 0; ListCell *lc; string_append_char(str, "("); foreach (lc, node->cols) { ResTarget *node = lfirst(lc); ListCell *lc_ind; if (comma == 0) comma = 1; else string_append_char(str, ", "); string_append_char(str, "\""); string_append_char(str, node->name); string_append_char(str, "\""); foreach (lc_ind, node->indirection) { Node *ind = lfirst(lc_ind); if (IsA(ind, String)) { /* foo.bar */ string_append_char(str, ".\""); string_append_char(str, strVal(ind)); string_append_char(str, "\""); } else /* foo[1] (A_Indices) */ _outNode(str, ind); } } string_append_char(str, ")"); } if (node->selectStmt) { _outNode(str, node->selectStmt); } if (node->returningList) { string_append_char(str, " RETURNING "); _outNode(str, node->returningList); } } static void _outUpdateStmt(String *str, UpdateStmt *node) { ListCell *lc; char comma = 0; string_append_char(str, "UPDATE "); _outNode(str, node->relation); string_append_char(str, " SET "); foreach (lc, node->targetList) { ResTarget *node = lfirst(lc); ListCell *lc_ind; if (comma == 0) comma = 1; else string_append_char(str, ", "); string_append_char(str, "\""); string_append_char(str, node->name); string_append_char(str, "\""); foreach (lc_ind, node->indirection) { Node *ind = lfirst(lc_ind); if (IsA(ind, String)) { string_append_char(str, ".\""); string_append_char(str, strVal(ind)); string_append_char(str, "\""); } else /* foo[1] (A_Indices) */ _outNode(str, ind); } string_append_char(str, " = "); _outNode(str, node->val); } if (node->fromClause) { string_append_char(str, " FROM "); _outNode(str, node->fromClause); } if (node->whereClause) { string_append_char(str, " WHERE "); _outNode(str, node->whereClause); } if (node->returningList) { string_append_char(str, " RETURNING "); _outNode(str, node->returningList); } } static void _outDeleteStmt(String *str, DeleteStmt *node) { string_append_char(str, "DELETE FROM "); _outNode(str, node->relation); if (node->usingClause) { string_append_char(str, " USING "); _outNode(str, node->usingClause); } if (node->whereClause) { string_append_char(str, " WHERE "); _outNode(str, node->whereClause); } if (node->returningList) { string_append_char(str, " RETURNING "); _outNode(str, node->returningList); } } static void _outTransactionStmt(String *str, TransactionStmt *node) { switch (node->kind) { case TRANS_STMT_BEGIN: string_append_char(str, "BEGIN "); break; case TRANS_STMT_START: string_append_char(str, "START TRANSACTION "); break; case TRANS_STMT_COMMIT: string_append_char(str, "COMMIT "); break; case TRANS_STMT_ROLLBACK: string_append_char(str, "ABORT "); break; case TRANS_STMT_SAVEPOINT: string_append_char(str, "SAVEPOINT "); break; case TRANS_STMT_RELEASE: string_append_char(str, "RELEASE "); break; case TRANS_STMT_ROLLBACK_TO: string_append_char(str, "ROLLBACK TO "); break; case TRANS_STMT_PREPARE: string_append_char(str, "PREPARE TRANSACTION "); break; case TRANS_STMT_COMMIT_PREPARED: string_append_char(str, "COMMIT PREPARED "); break; case TRANS_STMT_ROLLBACK_PREPARED: string_append_char(str, "ROLLBACK PREPARED "); break; default: break; } if (node->options) _outSetTransactionModeList(str, node->options); if (node->gid) string_append_char(str, node->gid); } static void _outTruncateStmt(String *str, TruncateStmt *node) { string_append_char(str, "TRUNCATE "); _outNode(str, node->relations); } #ifdef NOT_USED_IN_PGPOOL /* 9.0 does not have */ static void _outVacuumStmt(String *str, VacuumStmt *node) { if (node->vacuum == true) string_append_char(str, "VACUUM "); else string_append_char(str, "ANALYZE "); if (node->full == TRUE) string_append_char(str, "FULL "); if (node->freeze_min_age == 0) string_append_char(str, "FREEZE "); if (node->verbose == TRUE) string_append_char(str, "VERBOSE "); if (node->analyze) string_append_char(str, "ANALYZE "); _outNode(str, node->relation); if (node->va_cols) { string_append_char(str, "("); _outIdList(str, node->va_cols); string_append_char(str, ") "); } } #endif static void _outExplainStmt(String *str, ExplainStmt *node) { ListCell *lc; string_append_char(str, "EXPLAIN "); if (server_version_num < 90000) { foreach(lc, node->options) { DefElem *opt = (DefElem *) lfirst(lc); if (strcmp(opt->defname, "analyze") == 0) string_append_char(str, "ANALYZE "); else if (strcmp(opt->defname, "verbose") == 0) string_append_char(str, "VERBOSE "); } } else { if (node->options) { string_append_char(str, "("); foreach(lc, node->options) { DefElem *opt = (DefElem *) lfirst(lc); if (list_head(node->options) != lc) string_append_char(str, ", "); string_append_char(str, opt->defname); string_append_char(str, " "); if (opt->arg) _outValue(str, (Value *) opt->arg); } string_append_char(str, ")"); } } _outNode(str, node->query); } static void _outClusterStmt(String *str, ClusterStmt *node) { string_append_char(str, "CLUSTER "); if (node->indexname) { string_append_char(str, "\""); string_append_char(str, node->indexname); string_append_char(str, "\" ON "); } if (node->relation) _outNode(str, node->relation); } static void _outCheckPointStmt(String *str, CheckPointStmt *node) { string_append_char(str, "CHECKPOINT"); } static void _outClosePortalStmt(String *str, ClosePortalStmt *node) { string_append_char(str, "CLOSE "); string_append_char(str, "\""); string_append_char(str, node->portalname); string_append_char(str, "\""); } static void _outListenStmt(String *str, ListenStmt *node) { string_append_char(str, "LISTEN "); string_append_char(str, "\""); string_append_char(str, node->conditionname); string_append_char(str, "\""); } static void _outUnlistenStmt(String *str, UnlistenStmt *node) { string_append_char(str, "UNLISTEN "); if (node->conditionname == NULL) string_append_char(str, "*"); else { string_append_char(str, "\""); string_append_char(str, node->conditionname); string_append_char(str, "\""); } } static void _outLoadStmt(String *str, LoadStmt *node) { string_append_char(str, "LOAD '"); string_append_char(str, node->filename); string_append_char(str, "'"); } static void _outCopyStmt(String *str, CopyStmt *node) { ListCell *lc; string_append_char(str, "COPY "); if (node->query) { string_append_char(str, "("); _outNode(str, node->query); string_append_char(str, ")"); } _outNode(str, node->relation); if (node->attlist) { string_append_char(str, "("); _outIdList(str, node->attlist); string_append_char(str, ")"); } if (node->is_from == TRUE) string_append_char(str, " FROM "); else string_append_char(str, " TO "); if (node->filename) { string_append_char(str, "'"); string_append_char(str, node->filename); string_append_char(str, "' "); } else string_append_char(str, node->is_from == TRUE ? "STDIN " : "STDOUT "); if (server_version_num < 90000) { foreach (lc, node->options) { DefElem *e = lfirst(lc); if (strcmp(e->defname, "format") == 0) { char *fmt = strVal(e->arg); if (strcmp(fmt, "text") == 0) ; else if (strcmp(fmt, "binary") == 0) string_append_char(str, "BINARY "); else if (strcmp(fmt, "csv") == 0) string_append_char(str, "CSV "); } else if (strcmp(e->defname, "oids") == 0) string_append_char(str, "OIDS "); else if (strcmp(e->defname, "delimiter") == 0) { string_append_char(str, "DELIMITERS "); _outValue(str, (Value *) e->arg); string_append_char(str, " "); } else if (strcmp(e->defname, "null") == 0) { string_append_char(str, "NULL "); _outValue(str, (Value *) e->arg); string_append_char(str, " "); } else if (strcmp(e->defname, "header") == 0) string_append_char(str, "HEADER "); else if (strcmp(e->defname, "quote") == 0) { string_append_char(str, "QUOTE "); _outValue(str, (Value *) e->arg); string_append_char(str, " "); } else if (strcmp(e->defname, "escape") == 0) { string_append_char(str, "ESCAPE "); _outValue(str, (Value *) e->arg); string_append_char(str, " "); } else if (strcmp(e->defname, "force_quote") == 0) { string_append_char(str, "FORCE QUOTE "); _outIdList(str, (List *) e->arg); } else if (strcmp(e->defname, "force_not_null") == 0) { string_append_char(str, "FORCE NOT NULL "); _outIdList(str, (List *) e->arg); } } } else { /* version_num >= 90000 */ if (node->options) { string_append_char(str, "("); foreach (lc, node->options) { DefElem *e = lfirst(lc); if (list_head(node->options) != lc) string_append_char(str, ", "); string_append_char(str, e->defname); string_append_char(str, " "); if (strcmp(e->defname, "format") == 0 || strcmp(e->defname, "oids") == 0 || strcmp(e->defname, "delimiter") == 0 || strcmp(e->defname, "null") == 0 || strcmp(e->defname, "header") == 0 || strcmp(e->defname, "quote") == 0 || strcmp(e->defname, "escape") == 0) _outValue(str, (Value *) e->arg); else if (strcmp(e->defname, "force_not_null") == 0) { string_append_char(str, "("); _outIdList(str, (List *) e->arg); string_append_char(str, ")"); } else if (strcmp(e->defname, "force_quote") == 0) { if (IsA(e->arg, A_Star)) string_append_char(str, "*"); else if (IsA(e->arg, List)) { string_append_char(str, "("); _outIdList(str, (List *) e->arg); string_append_char(str, ")"); } } } string_append_char(str, ")"); } } } static void _outDeallocateStmt(String *str, DeallocateStmt *node) { string_append_char(str, "DEALLOCATE \""); string_append_char(str, node->name); string_append_char(str, "\""); } static void _outRenameStmt(String *str, RenameStmt *node) { ListCell *lc; char comma = 0; string_append_char(str, "ALTER "); switch (node->renameType) { case OBJECT_AGGREGATE: string_append_char(str, "AGGREGATE "); _outNode(str, node->object); string_append_char(str, " ("); string_append_char(str, ") RENAME TO \""); string_append_char(str, node->newname); string_append_char(str, "\""); break; case OBJECT_CONVERSION: string_append_char(str, "CONVERSION "); _outNode(str, node->object); string_append_char(str, " RENAME TO \""); string_append_char(str, node->newname); string_append_char(str, "\""); break; case OBJECT_DATABASE: string_append_char(str, "DATABASE \""); string_append_char(str, node->subname); string_append_char(str, "\" RENAME TO \""); string_append_char(str, node->newname); string_append_char(str, "\""); break; case OBJECT_FUNCTION: string_append_char(str, "FUNCTION "); foreach (lc, node->object) { Node *n = lfirst(lc); if (IsA(n, String)) { Value *value = (Value *) n; if (comma == 0) comma = 1; else string_append_char(str, "."); string_append_char(str, "\""); string_append_char(str, value->val.str); string_append_char(str, "\""); } else _outNode(str, n); } string_append_char(str, "("); _outNode(str, node->objarg); string_append_char(str, ")"); string_append_char(str, " RENAME TO \""); string_append_char(str, node->newname); string_append_char(str, "\""); break; case OBJECT_ROLE: string_append_char(str, "ROLE \""); string_append_char(str, node->subname); string_append_char(str, "\" RENAME TO \""); string_append_char(str, node->newname); string_append_char(str, "\""); break; case OBJECT_LANGUAGE: string_append_char(str, "LANGUAGE \""); string_append_char(str, node->subname); string_append_char(str, "\" RENAME TO \""); string_append_char(str, node->newname); string_append_char(str, "\""); break; case OBJECT_OPCLASS: string_append_char(str, "OPERATOR CLASS "); _outNode(str, node->object); string_append_char(str, " USING "); string_append_char(str, node->subname); string_append_char(str, " RENAME TO \""); string_append_char(str, node->newname); string_append_char(str, "\""); break; case OBJECT_SCHEMA: string_append_char(str, "SCHEMA \""); string_append_char(str, node->subname); string_append_char(str, "\" RENAME TO \""); string_append_char(str, node->newname); string_append_char(str, "\""); break; case OBJECT_TABLE: string_append_char(str, "TABLE "); _outNode(str, node->relation); string_append_char(str, " RENAME TO \""); string_append_char(str, node->newname); string_append_char(str, "\""); break; case OBJECT_INDEX: string_append_char(str, "INDEX "); _outNode(str, node->relation); string_append_char(str, " RENAME TO \""); string_append_char(str, node->newname); string_append_char(str, "\""); break; case OBJECT_COLUMN: string_append_char(str, "TABLE "); _outNode(str, node->relation); string_append_char(str, " RENAME \""); string_append_char(str, node->subname); string_append_char(str, "\" TO \""); string_append_char(str, node->newname); string_append_char(str, "\""); break; case OBJECT_TRIGGER: string_append_char(str, "TRIGGER \""); string_append_char(str, node->subname); string_append_char(str, "\" ON "); _outNode(str, node->relation); string_append_char(str, " RENAME TO \""); string_append_char(str, node->newname); string_append_char(str, "\""); break; case OBJECT_TABLESPACE: string_append_char(str, "TABLESPACE \""); string_append_char(str, node->subname); string_append_char(str, "\" RENAME TO \""); string_append_char(str, node->newname); string_append_char(str, "\""); break; default: break; } } static void _outOptRoleList(String *str, List *options) { ListCell *lc; foreach (lc, options) { DefElem *elem = lfirst(lc); Value *value = (Value *) elem->arg; if (strcmp(elem->defname, "password") == 0) { if (value == NULL) string_append_char(str, " PASSWORD NULL"); else { string_append_char(str, " PASSWORD '"); string_append_char(str, value->val.str); string_append_char(str, "'"); } } else if (strcmp(elem->defname, "encryptedPassword") == 0) { string_append_char(str, " ENCRYPTED PASSWORD '"); string_append_char(str, value->val.str); string_append_char(str, "'"); } else if (strcmp(elem->defname, "unencryptedPassword") == 0) { string_append_char(str, " UNENCRYPTED PASSWORD '"); string_append_char(str, value->val.str); string_append_char(str, "'"); } else if (strcmp(elem->defname, "superuser") == 0) { if (value->val.ival == TRUE) string_append_char(str, " SUPERUSER"); else string_append_char(str, " NOSUPERUSER"); } else if (strcmp(elem->defname, "inherit") == 0) { if (value->val.ival == TRUE) string_append_char(str, " INHERIT"); else string_append_char(str, " NOINHERIT"); } else if (strcmp(elem->defname, "createdb") == 0) { if (value->val.ival == TRUE) string_append_char(str, " CREATEDB"); else string_append_char(str, " NOCREATEDB"); } else if (strcmp(elem->defname, "createrole") == 0) { if (value->val.ival == TRUE) string_append_char(str, " CREATEROLE"); else string_append_char(str, " NOCREATEROLE"); } else if (strcmp(elem->defname, "canlogin") == 0) { if (value->val.ival == TRUE) string_append_char(str, " LOGIN"); else string_append_char(str, " NOLOGIN"); } else if (strcmp(elem->defname, "connectionlimit") == 0) { char buf[16]; string_append_char(str, " CONNECTION LIMIT "); snprintf(buf, 16, "%ld", value->val.ival); string_append_char(str, buf); } else if (strcmp(elem->defname, "validUntil") == 0) { string_append_char(str, " VALID UNTIL '"); string_append_char(str, value->val.str); string_append_char(str, "'"); } else if (strcmp(elem->defname, "rolemembers") == 0) { string_append_char(str, " ROLE "); _outIdList(str, (List *) elem->arg); } else if (strcmp(elem->defname, "sysid") == 0) { char buf[16]; string_append_char(str, " SYSID "); snprintf(buf, 16, "%ld", value->val.ival); string_append_char(str, buf); } else if (strcmp(elem->defname, "adminmembers") == 0) { string_append_char(str, " ADMIN "); _outIdList(str, (List *) elem->arg); } else if (strcmp(elem->defname, "addroleto") == 0) { string_append_char(str, " IN ROLE "); _outIdList(str, (List *) elem->arg); } } } static void _outCreateRoleStmt(String *str, CreateRoleStmt *node) { string_append_char(str, "CREATE "); switch (node->stmt_type) { case ROLESTMT_ROLE: string_append_char(str, "ROLE \""); break; case ROLESTMT_USER: string_append_char(str, "USER \""); break; case ROLESTMT_GROUP: string_append_char(str, "GROUP \""); break; } string_append_char(str, node->role); string_append_char(str, "\""); _outOptRoleList(str, node->options); } static void _outAlterRoleStmt(String *str, AlterRoleStmt *node) { string_append_char(str, "ALTER ROLE \""); string_append_char(str, node->role); string_append_char(str, "\""); if (node->options) _outOptRoleList(str, node->options); } static void _outAlterRoleSetStmt(String *str, AlterRoleSetStmt *node) { string_append_char(str, "ALTER ROLE \""); string_append_char(str, node->role); string_append_char(str, "\" "); if (node->setstmt) { _outNode(str, node->setstmt); } } static void _outSetTransactionModeList(String *str, List *list) { ListCell *lc; char comma = 0; foreach (lc, list) { DefElem *elem = lfirst(lc); if (comma == 0) comma = 1; else string_append_char(str, ","); if (strcmp(elem->defname, "transaction_isolation") == 0) { A_Const *v = (A_Const *) elem->arg; string_append_char(str, " ISOLATION LEVEL "); string_append_char(str, v->val.val.str); } else if (strcmp(elem->defname, "transaction_read_only") == 0) { A_Const *n = (A_Const *) elem->arg; if (n->val.val.ival == TRUE) string_append_char(str, "READ ONLY "); else string_append_char(str, "READ WRITE "); } } } static void _outSetRest(String *str, VariableSetStmt *node) { if (strcmp(node->name, "timezone") == 0) { string_append_char(str, "TIME ZONE "); if (node->kind != VAR_RESET) _outNode(str, node->args); } else if (strcmp(node->name, "TRANSACTION") == 0) { string_append_char(str, "TRANSACTION "); _outSetTransactionModeList(str, node->args); } else if (strcmp(node->name, "SESSION CHARACTERISTICS") == 0) { string_append_char(str, "SESSION CHARACTERISTICS AS TRANSACTION "); _outSetTransactionModeList(str, node->args); } else if (strcmp(node->name, "role") == 0) { string_append_char(str, "ROLE "); if (node->kind != VAR_RESET) _outNode(str, node->args); } else if (strcmp(node->name, "session_authorization") == 0) { string_append_char(str, "SESSION AUTHORIZATION "); if (node->args == NIL && node->kind != VAR_RESET) string_append_char(str, "DEFAULT"); else _outNode(str, node->args); } else if (strcmp(node->name, "transaction_isolation") == 0) { string_append_char(str, "TRANSACTION ISOLATION LEVEL"); if (node->kind != VAR_RESET) _outSetTransactionModeList(str, node->args); } else if (strcmp(node->name, "xmloption") == 0) { A_Const *v = linitial(node->args); string_append_char(str, "XML OPTOIN "); string_append_char(str, v->val.val.str); } else { string_append_char(str, node->name); if (node->kind != VAR_RESET) { if (node->kind == VAR_SET_CURRENT) { string_append_char(str, " FROM CURRENT"); } else { string_append_char(str, " TO "); if (node->args == NULL) { string_append_char(str, "DEFAULT"); } else _outNode(str, node->args); } } } } static void _outDropRoleStmt(String *str, DropRoleStmt *node) { string_append_char(str, "DROP ROLE "); if (node->missing_ok == TRUE) string_append_char(str, "IF EXISTS "); _outIdList(str, node->roles); } static void _outCreateSchemaStmt(String *str, CreateSchemaStmt *node) { string_append_char(str, "CREATE SCHEMA \""); string_append_char(str, node->schemaname); string_append_char(str, "\""); if (node->authid) { string_append_char(str, "AUTHORIZATION \""); string_append_char(str, node->authid); string_append_char(str, "\" "); } _outNode(str, node->schemaElts); } static void _outVariableSetStmt(String *str, VariableSetStmt *node) { if (node->kind == VAR_RESET_ALL) { string_append_char(str, "RESET ALL"); return; } if (node->kind == VAR_RESET) string_append_char(str, "RESET "); else string_append_char(str, "SET "); if (node->is_local) string_append_char(str, "LOCAL "); _outSetRest(str, node); } static void _outVariableShowStmt(String *str, VariableShowStmt *node) { if (strcmp(node->name, "timezone") == 0) string_append_char(str, "SHOW TIME ZONE"); else if (strcmp(node->name, "transaction_isolation") == 0) string_append_char(str, "SHOW TRANSACTION ISOLATION LEVEL"); else if (strcmp(node->name, "session_authorization") == 0) string_append_char(str, "SHOW SESSION AUTHORIZATION"); else if (strcmp(node->name, "all") == 0) string_append_char(str, "SHOW ALL"); else { string_append_char(str, "SHOW "); string_append_char(str, node->name); } } static void _outConstraintsSetStmt(String *str, ConstraintsSetStmt *node) { string_append_char(str, "SET CONSTRAINTS "); if (node->constraints == NIL) string_append_char(str, "ALL"); else _outNode(str, node->constraints); string_append_char(str, node->deferred == TRUE ? " DEFERRED" : " IMMEDIATE"); } static void _outAlterTableCmd(String *str, AlterTableCmd *node) { char buf[16]; switch (node->subtype) { case AT_AddColumn: string_append_char(str, "ADD "); _outNode(str, node->def); break; case AT_ColumnDefault: string_append_char(str, "ALTER \""); string_append_char(str, node->name); string_append_char(str, "\" "); if (node->def == NULL) string_append_char(str, "DROP DEFAULT"); else { string_append_char(str, "SET DEFAULT "); _outNode(str, node->def); } break; case AT_DropNotNull: string_append_char(str, "ALTER \""); string_append_char(str, node->name); string_append_char(str, "\" DROP NOT NULL"); break; case AT_SetNotNull: string_append_char(str, "ALTER \""); string_append_char(str, node->name); string_append_char(str, "\" SET NOT NULL"); break; case AT_SetStatistics: string_append_char(str, "ALTER \""); string_append_char(str, node->name); string_append_char(str, "\" SET STATISTICS "); snprintf(buf, 16, "%ld", ((Value *) node->def)->val.ival); string_append_char(str, buf); break; case AT_SetStorage: string_append_char(str, "ALTER \""); string_append_char(str, node->name); string_append_char(str, "\" SET STORAGE "); string_append_char(str, ((Value *) node->def)->val.str); break; case AT_DropColumn: string_append_char(str, "DROP \""); string_append_char(str, node->name); string_append_char(str, "\" "); if (node->behavior == DROP_CASCADE) string_append_char(str, "CASCADE"); break; case AT_AlterColumnType: string_append_char(str, "ALTER \""); string_append_char(str, node->name); string_append_char(str, "\" TYPE "); _outNode(str, node->def); #ifdef NOT_USED_IN_PGPOOL if (node->transform) { string_append_char(str, " USING "); _outNode(str, node->transform); } #endif break; case AT_AddConstraint: string_append_char(str, "ADD "); _outNode(str, node->def); break; case AT_DropConstraint: string_append_char(str, "DROP CONSTRAINT \""); string_append_char(str, node->name); string_append_char(str, "\""); if (node->behavior == DROP_CASCADE) string_append_char(str, " CASCADE"); break; case AT_DropOids: string_append_char(str, "SET WITHOUT OIDS"); break; case AT_ClusterOn: string_append_char(str, "CLUSTER ON \""); string_append_char(str, node->name); string_append_char(str, "\""); break; case AT_DropCluster: string_append_char(str, "SET WITHOUT CLUSTER"); break; case AT_EnableTrig: string_append_char(str, "ENABLE TRIGGER \""); string_append_char(str, node->name); string_append_char(str, "\""); break; case AT_EnableAlwaysTrig: /* not implemented */ break; case AT_EnableReplicaTrig: /* not implemented */ break; case AT_EnableTrigAll: string_append_char(str, "ENABLE TRIGGER ALL"); break; case AT_EnableTrigUser: string_append_char(str, "ENABLE TRIGGER USER"); break; case AT_DisableTrig: string_append_char(str, "DISABLE TRIGGER \""); string_append_char(str, node->name); string_append_char(str, "\""); break; case AT_DisableTrigAll: string_append_char(str, "DISABLE TRIGGER ALL"); break; case AT_DisableTrigUser: string_append_char(str, "DISABLE TRIGGER USER"); break; case AT_EnableRule: /* not implemented */ break; case AT_EnableReplicaRule: /* not implemented */ break; case AT_EnableAlwaysRule: /* not implemented */ break; case AT_DisableRule: /* not implemented */ break; case AT_AddInherit: /* not implemented */ break; case AT_ChangeOwner: string_append_char(str, "OWNER TO \""); string_append_char(str, node->name); string_append_char(str, "\""); break; case AT_SetTableSpace: string_append_char(str, "SET TABLESPACE \""); string_append_char(str, node->name); string_append_char(str, "\""); break; case AT_SetRelOptions: /* not implemented */ break; case AT_ResetRelOptions: /* not implemented */ break; default: break; } } static void _outAlterTableStmt(String *str, AlterTableStmt *node) { if (node->relkind == OBJECT_TABLE) string_append_char(str, "ALTER TABLE "); else string_append_char(str, "ALTER INDEX "); _outNode(str, node->relation); string_append_char(str, " "); _outNode(str, node->cmds); } static void _outOptSeqList(String *str, List *options) { ListCell *lc; foreach (lc, options) { DefElem *e = lfirst(lc); Value *v = (Value *)e->arg; char buf[16]; if (strcmp(e->defname, "cycle") == 0) { if (v->val.ival == TRUE) string_append_char(str, " CYCLE"); else string_append_char(str, " NO CYCLE"); } else if (strcmp(e->defname, "minvalue") == 0 && !v) string_append_char(str, " NO MINVALUE"); else if (strcmp(e->defname, "maxvalue") == 0 && !v) string_append_char(str, " NO MAXVALUE"); else if (strcmp(e->defname, "owned_by") == 0) { string_append_char(str, " OWNED BY "); _outIdList(str, (List *)e->arg); } else { if (strcmp(e->defname, "cache") == 0) string_append_char(str, " CACHE "); else if (strcmp(e->defname, "increment") == 0) string_append_char(str, " INCREMENT "); else if (strcmp(e->defname, "maxvalue") == 0 && v) string_append_char(str, " MAXVALUE "); else if (strcmp(e->defname, "minvalue") == 0 && v) string_append_char(str, " MINVALUE "); else if (strcmp(e->defname, "start") == 0) string_append_char(str, " START "); else if (strcmp(e->defname, "restart") == 0) string_append_char(str, " RESTART "); if (IsA(e->arg, String)) string_append_char(str, v->val.str); else { snprintf(buf, 16, "%ld", v->val.ival); string_append_char(str, buf); } } } } static void _outCreateSeqStmt(String *str, CreateSeqStmt *node) { string_append_char(str, "CREATE "); if (node->sequence->relpersistence == RELPERSISTENCE_TEMP) string_append_char(str, "TEMP "); string_append_char(str, "SEQUENCE "); _outNode(str, node->sequence); _outOptSeqList(str, node->options); } static void _outAlterSeqStmt(String *str, AlterSeqStmt *node) { string_append_char(str, "ALTER SEQUENCE "); _outNode(str, node->sequence); _outOptSeqList(str, node->options); } static void _outCreatePLangStmt(String *str, CreatePLangStmt *node) { string_append_char(str, "CREATE "); if (node->pltrusted == true) string_append_char(str, "TRUSTED "); string_append_char(str, "LANGUAGE \""); string_append_char(str, node->plname); string_append_char(str, "\""); if (node->plhandler != NIL) { ListCell *lc; char dot = 0; string_append_char(str, " HANDLER "); foreach (lc, node->plhandler) { Value *v = lfirst(lc); if (dot == 0) dot = 1; else string_append_char(str, "."); string_append_char(str, "\""); string_append_char(str, v->val.str); string_append_char(str, "\""); } } if (node->plvalidator != NIL) { ListCell *lc; char dot = 0; string_append_char(str, " VALIDATOR "); foreach (lc, node->plvalidator) { Value *v = lfirst(lc); if (dot == 0) dot = 1; else string_append_char(str, "."); string_append_char(str, "\""); string_append_char(str, v->val.str); string_append_char(str, "\""); } } } static void _outCreateTableSpaceStmt(String *str, CreateTableSpaceStmt *node) { string_append_char(str, "CREATE TABLESPACE \""); string_append_char(str, node->tablespacename); string_append_char(str, "\" "); if (node->owner) { string_append_char(str, "OWNER \""); string_append_char(str, node->owner); string_append_char(str, "\" "); } string_append_char(str, "LOCATION '"); string_append_char(str, node->location); string_append_char(str, "'"); } static void _outDropTableSpaceStmt(String *str, DropTableSpaceStmt *node) { string_append_char(str, "DROP TABLESPACE \""); string_append_char(str, node->tablespacename); string_append_char(str, "\""); } static void _outFuncName(String *str, List *func_name) { ListCell *lc; Value *v; char dot = 0; if (func_name == NULL) return; foreach (lc, func_name) { v = (Value *) lfirst(lc); if (dot == 0) dot = 1; else string_append_char(str, "."); if (IsA(v, String)) { string_append_char(str, "\""); string_append_char(str, v->val.str); string_append_char(str, "\""); } else { _outNode(str, v); } } } static void _outCreateTrigStmt(String *str, CreateTrigStmt *node) { bool has_events = false; if (node->isconstraint == TRUE) string_append_char(str, "CREATE CONSTRAINT TRIGGER \""); else string_append_char(str, "CREATE TRIGGER \""); string_append_char(str, node->trigname); string_append_char(str, "\" "); if (TRIGGER_FOR_BEFORE(node->timing)) string_append_char(str, "BEFORE "); if (TRIGGER_FOR_AFTER(node->timing)) string_append_char(str, "AFTER "); if (node->events & TRIGGER_TYPE_INSERT) { string_append_char(str, "INSERT "); has_events = true; } if (node->events & TRIGGER_TYPE_DELETE) { if (has_events) string_append_char(str, "OR "); string_append_char(str, "DELETE "); has_events = true; } if (node->events & TRIGGER_TYPE_UPDATE) { if (has_events) string_append_char(str, "OR "); string_append_char(str, "UPDATE "); has_events = true; } if (node->events & TRIGGER_TYPE_TRUNCATE) { if (has_events) string_append_char(str, "OR "); string_append_char(str, "TRUNCATE "); has_events = true; } string_append_char(str, "ON "); _outNode(str, node->relation); if (node->constrrel) { string_append_char(str, " FROM "); _outNode(str, node->constrrel); } if (node->deferrable) string_append_char(str, " DEFERRABLE"); if (node->initdeferred) string_append_char(str, " INITIALLY DEFERRED"); if (node->row == TRUE) string_append_char(str, " FOR EACH ROW "); else string_append_char(str, " FOR EACH STATEMENT "); string_append_char(str, "EXECUTE PROCEDURE "); _outFuncName(str, node->funcname); string_append_char(str, "("); _outNode(str, node->args); string_append_char(str, ")"); } static void _outDefinition(String *str, List *definition) { ListCell *lc; char comma = 0; if (definition == NIL) return; string_append_char(str, "("); foreach (lc, definition) { DefElem *e = lfirst(lc); if (comma == 0) comma = 1; else string_append_char(str, ", "); string_append_char(str, "\""); string_append_char(str, e->defname); string_append_char(str, "\""); if (e->arg) { string_append_char(str, "="); _outNode(str, e->arg); } } string_append_char(str, ")"); } static void _outDefineStmt(String *str, DefineStmt *node) { ListCell *lc; char dot = 0; switch (node->kind) { case OBJECT_AGGREGATE: string_append_char(str, "CREATE AGGREGATE "); _outFuncName(str, node->defnames); string_append_char(str, " "); _outDefinition(str, node->definition); break; case OBJECT_OPERATOR: string_append_char(str, "CREATE OPERATOR "); foreach (lc, node->defnames) { Value *v = lfirst(lc); if (dot == 0) dot = 1; else string_append_char(str, "."); string_append_char(str, v->val.str); } string_append_char(str, " "); _outDefinition(str, node->definition); break; case OBJECT_TYPE: string_append_char(str, "CREATE TYPE"); _outFuncName(str, node->defnames); string_append_char(str, " "); _outDefinition(str, node->definition); break; case OBJECT_TSPARSER: string_append_char(str, "CREATE TEXT SEARCH PARSER "); _outIdList(str, node->defnames); _outDefinition(str, node->definition); break; case OBJECT_TSDICTIONARY: string_append_char(str, "CREATE TEXT SEARCH DICTIONARY "); _outIdList(str, node->defnames); _outDefinition(str, node->definition); break; case OBJECT_TSTEMPLATE: string_append_char(str, "CREATE TEXT SEARCH TEMPLATE "); _outIdList(str, node->defnames); _outDefinition(str, node->definition); break; case OBJECT_TSCONFIGURATION: string_append_char(str, "CREATE TEXT SEARCH CONFIGURATION "); _outIdList(str, node->defnames); _outDefinition(str, node->definition); break; default: break; } } static void _outOperatorName(String *str, List *list) { char dot = 0; ListCell *lc; foreach (lc, list) { Value *v = lfirst(lc); if (dot == 0) dot = 1; else string_append_char(str, "."); string_append_char(str, v->val.str); } } static void _outCreateOpClassItem(String *str, CreateOpClassItem *node) { char buf[16]; switch (node->itemtype) { case OPCLASS_ITEM_OPERATOR: string_append_char(str, "OPERATOR "); snprintf(buf, 16, "%d", node->number); string_append_char(str, buf); string_append_char(str, " "); _outOperatorName(str, node->name); if (node->args != NIL) { string_append_char(str, "("); _outNode(str, node->args); string_append_char(str, ")"); } /* XXX if (node->recheck == TRUE) string_append_char(str, " RECHECK"); */ break; case OPCLASS_ITEM_FUNCTION: string_append_char(str, "FUNCTION "); snprintf(buf, 16, "%d", node->number); string_append_char(str, buf); string_append_char(str, " "); _outFuncName(str, node->name); string_append_char(str, "("); _outNode(str, node->args); string_append_char(str, ")"); break; case OPCLASS_ITEM_STORAGETYPE: string_append_char(str, "STORAGE "); _outNode(str, node->storedtype); break; default: break; } } static void _outCreateOpClassStmt(String *str, CreateOpClassStmt *node) { string_append_char(str, "CREATE OPERATOR CLASS "); _outFuncName(str, node->opclassname); if (node->isDefault == TRUE) string_append_char(str, " DEFAULT"); string_append_char(str, " FOR TYPE "); _outNode(str, node->datatype); string_append_char(str, " USING "); string_append_char(str, node->amname); string_append_char(str, " AS "); _outNode(str, node->items); } /* * Handle drop satements. As of pgpool-II 3.3(derived parser from * PostgreSQL 9.2), following types are supported: * * DROP TABLE, DROP SEQUENCE, DROP VIEW, DROP INDEX, DROP FOREIGN * TABLE, DROP TYPE, DROP DOMAIN, DROP COLLATION, DROP CONVERSION, * DROP SCHEMA, DROP TEXT SEARCH PARSER, DROP TEXT SEARCH DICTIONARY, * DROP TEXT SEARCH CONFIGURATION, DROP LANGUAGE, DROP RULE, DROP * OPERATOR, DROP OPERATOR CLASS */ static void add_function_like_objs(String *str, DropStmt *node) { ListCell *lc; char comma = 0; if (node->concurrent) string_append_char(str, "CONCURRENTLY "); if (node->missing_ok) string_append_char(str, "IF EXISTS "); foreach (lc, node->objects) { if (comma == 0) comma = 1; else string_append_char(str, ", "); _outFuncName(str, lfirst(lc)); } } static void _outDropStmt(String *str, DropStmt *node) { List *objname; string_append_char(str, "DROP "); switch (node->removeType) { case OBJECT_TABLE: string_append_char(str, "TABLE "); add_function_like_objs(str, node); break; case OBJECT_SEQUENCE: string_append_char(str, "SEQUENCE "); add_function_like_objs(str, node); break; case OBJECT_VIEW: string_append_char(str, "VIEW "); add_function_like_objs(str, node); break; case OBJECT_INDEX: string_append_char(str, "INDEX "); add_function_like_objs(str, node); break; case OBJECT_FOREIGN_TABLE: string_append_char(str, "FOREIGN TABLE "); add_function_like_objs(str, node); break; case OBJECT_FDW: string_append_char(str, "FOREIGN DATA WRAPPER "); add_function_like_objs(str, node); break; case OBJECT_TYPE: string_append_char(str, "TYPE "); add_function_like_objs(str, node); break; case OBJECT_DOMAIN: string_append_char(str, "DOMAIN "); add_function_like_objs(str, node); break; case OBJECT_COLLATION: string_append_char(str, "COLLATION "); add_function_like_objs(str, node); break; case OBJECT_CONVERSION: string_append_char(str, "CONVERSION "); add_function_like_objs(str, node); break; case OBJECT_SCHEMA: string_append_char(str, "SCHEMA "); add_function_like_objs(str, node); break; case OBJECT_EXTENSION: string_append_char(str, "EXTENSION "); add_function_like_objs(str, node); break; case OBJECT_TSPARSER: string_append_char(str, "TEXT SEARCH PARSER "); add_function_like_objs(str, node); break; case OBJECT_TSDICTIONARY: string_append_char(str, "TEXT SEARCH DICTIONARY "); add_function_like_objs(str, node); break; case OBJECT_TSTEMPLATE: string_append_char(str, "TEXT SEARCH TEMPLATE "); add_function_like_objs(str, node); break; case OBJECT_TSCONFIGURATION: string_append_char(str, "TEXT SEARCH CONFIGURATION "); add_function_like_objs(str, node); break; case OBJECT_LANGUAGE: string_append_char(str, "PROCEDURAL LANGUAGE "); add_function_like_objs(str, node); break; case OBJECT_RULE: string_append_char(str, "DROP RULE "); if (node->missing_ok) string_append_char(str, "IF EXISTS "); objname = lfirst(list_head(node->objects)); string_append_char(str, strVal(llast(objname))); string_append_char(str, " ON "); string_append_char(str, NameListToString(list_truncate(list_copy(objname), list_length(objname) - 1))); break; case OBJECT_OPERATOR: string_append_char(str, "OPERATOR "); add_function_like_objs(str, node); break; case OBJECT_OPCLASS: string_append_char(str, "DROP OPERATOR CLASS "); if (node->missing_ok) string_append_char(str, "IF EXISTS "); objname = lfirst(list_head(node->objects)); string_append_char(str, strVal(llast(objname))); string_append_char(str, " USING "); string_append_char(str, "'"); string_append_char(str, escape_string(NameListToString(list_truncate(list_copy(objname), list_length(objname) - 1)))); string_append_char(str, "'"); break; case OBJECT_CAST: string_append_char(str, "DROP CAST "); if (node->missing_ok) string_append_char(str, "IF EXISTS "); string_append_char(str, "("); objname = linitial(node->objects); _outNode(str, linitial(objname)); string_append_char(str, " AS "); objname = linitial(node->arguments); _outNode(str, linitial(objname)); string_append_char(str, ")"); break; case OBJECT_OPFAMILY: string_append_char(str, "OPERATOR FAMILY "); if (node->missing_ok) string_append_char(str, "IF EXISTS "); objname = linitial(node->objects); _outIdList(str, objname); string_append_char(str, " USING "); objname = linitial(node->arguments); _outIdList(str, objname); break; default: break; } if (node->behavior == DROP_CASCADE) string_append_char(str, " CASCADE"); } static void _outFetchStmt(String *str, FetchStmt *node) { char buf[16]; snprintf(buf, 16, "%ld", node->howMany); if (node->ismove == TRUE) string_append_char(str, "MOVE "); else string_append_char(str, "FETCH "); switch (node->direction) { case FETCH_FORWARD: string_append_char(str, "FORWARD "); if (node->howMany == FETCH_ALL) string_append_char(str, "ALL "); else { string_append_char(str, buf); string_append_char(str, " "); } break; case FETCH_BACKWARD: string_append_char(str, "BACKWARD "); if (node->howMany == FETCH_ALL) string_append_char(str, "ALL "); else { string_append_char(str, buf); string_append_char(str, " "); } break; case FETCH_ABSOLUTE: if (node->howMany == 1) string_append_char(str, "FIRST "); else if (node->howMany == -1) string_append_char(str, "LAST "); else { string_append_char(str, "ABSOLUTE "); string_append_char(str, buf); string_append_char(str, " "); } break; case FETCH_RELATIVE: string_append_char(str, "RELATIVE "); string_append_char(str, buf); string_append_char(str, " "); break; } string_append_char(str, "IN \""); string_append_char(str, node->portalname); string_append_char(str, "\""); } static void _outPrivilegeList(String *str, List *list) { ListCell *lc; char comma = 0; if (list == NIL) string_append_char(str, "ALL"); else { foreach (lc, list) { Value *v = lfirst(lc); if (comma == 0) comma = 1; else string_append_char(str, ", "); string_append_char(str, v->val.str); } } } static void _outFunctionParameter(String *str, FunctionParameter *node) { switch (node->mode) { case FUNC_PARAM_OUT: string_append_char(str, "OUT "); break; case FUNC_PARAM_INOUT: string_append_char(str, "INOUT "); break; default: break; } /* function name */ if (node->name) { string_append_char(str, "\""); string_append_char(str, node->name); string_append_char(str, "\" "); } _outNode(str, node->argType); } static void _outFuncWithArgs(String *str, FuncWithArgs *node) { _outFuncName(str, node->funcname); string_append_char(str, "("); _outNode(str, node->funcargs); string_append_char(str, ")"); } static void _outPrivGrantee(String *str, PrivGrantee *node) { if (node->rolname == NULL) string_append_char(str, "PUBLIC"); else { string_append_char(str, "\""); string_append_char(str, node->rolname); string_append_char(str, "\""); } } static void _outGrantStmt(String *str, GrantStmt *node) { if (node->is_grant == true) string_append_char(str, "GRANT "); else { string_append_char(str, "REVOKE "); if (node->grant_option == true) string_append_char(str, "GRANT OPTION FOR "); } _outPrivilegeList(str, node->privileges); string_append_char(str, " ON "); switch (node->objtype) { case ACL_OBJECT_RELATION: _outNode(str, node->objects); break; case ACL_OBJECT_SEQUENCE: string_append_char(str, "SEQUENCE "); _outNode(str, node->objects); break; case ACL_OBJECT_FUNCTION: string_append_char(str, "FUNCTION "); _outNode(str, node->objects); break; case ACL_OBJECT_DATABASE: string_append_char(str, "DATABASE "); _outIdList(str, node->objects); break; case ACL_OBJECT_LANGUAGE: string_append_char(str, "LANGUAGE "); _outIdList(str, node->objects); break; case ACL_OBJECT_NAMESPACE: string_append_char(str, "SCHEMA "); _outIdList(str, node->objects); break; case ACL_OBJECT_TABLESPACE: string_append_char(str, "TABLESPACE "); _outIdList(str, node->objects); break; case ACL_OBJECT_FDW: string_append_char(str, "FOREIGN DATA WRAPPER "); _outIdList(str, node->objects); break; case ACL_OBJECT_FOREIGN_SERVER: string_append_char(str, "FOREIGN SERVER "); _outIdList(str, node->objects); break; case ACL_OBJECT_COLUMN: case ACL_OBJECT_DOMAIN: case ACL_OBJECT_LARGEOBJECT: case ACL_OBJECT_TYPE: break; } if (node->is_grant == true) string_append_char(str, " TO "); else string_append_char(str, " FROM "); _outNode(str, node->grantees); if (node->is_grant == true && node->grant_option == TRUE) string_append_char(str, " WITH GRANT OPTION"); if (node->behavior == DROP_CASCADE) string_append_char(str, " CASCADE"); } static void _outGrantRoleStmt(String *str, GrantRoleStmt *node) { if (node->is_grant == true) string_append_char(str, "GRANT "); else { string_append_char(str, "REVOKE "); if (node->admin_opt == true) string_append_char(str, "ADMIN OPTION FOR "); } _outIdList(str, node->granted_roles); string_append_char(str, node->is_grant == true ? " TO " : " FROM "); _outIdList(str, node->grantee_roles); if (node->admin_opt == true && node->is_grant == true) string_append_char(str, " WITH ADMIN OPTION"); if (node->grantor != NULL) { string_append_char(str, " GRANTED BY \""); string_append_char(str, node->grantor); string_append_char(str, "\""); } if (node->behavior == DROP_CASCADE) string_append_char(str, " CASCADE"); } static void _outFuncOptList(String *str, List *list) { ListCell *lc; foreach (lc, list) { DefElem *e = lfirst(lc); Value *v = (Value *) e->arg; if (strcmp(e->defname, "strict") == 0) { if (v->val.ival == TRUE) string_append_char(str, " STRICT"); else string_append_char(str, " CALLED ON NULL INPUT"); } else if (strcmp(e->defname, "volatility") == 0) { char *s = v->val.str; if (strcmp(s, "immutable") == 0) string_append_char(str, " IMMUTABLE"); else if (strcmp(s, "stable") == 0) string_append_char(str, " STABLE"); else if (strcmp(s, "volatile") == 0) string_append_char(str, " VOLATILE"); } else if (strcmp(e->defname, "security") == 0) { if (v->val.ival == TRUE) string_append_char(str, " SECURITY DEFINER"); else string_append_char(str, " SECURITY INVOKER"); } else if (strcmp(e->defname, "as") == 0) { string_append_char(str, " AS "); _outNode(str, e->arg); } else if (strcmp(e->defname, "language") == 0) { string_append_char(str, " LANGUAGE '"); string_append_char(str, v->val.str); string_append_char(str, "'"); } } } static void _outCreateFunctionStmt(String *str, CreateFunctionStmt *node) { string_append_char(str, "CREATE "); if (node->replace == true) string_append_char(str, "OR REPLACE "); string_append_char(str, "FUNCTION "); _outFuncName(str, node->funcname); string_append_char(str, " ("); _outNode(str, node->parameters); string_append_char(str, ")"); if (node->returnType) { string_append_char(str, " RETURNS "); _outNode(str, node->returnType); } _outFuncOptList(str, node->options); if (node->withClause) { string_append_char(str, " WITH "); _outDefinition(str, node->withClause); } } static void _outAlterFunctionStmt(String *str, AlterFunctionStmt *node) { string_append_char(str, "ALTER FUNCTION "); _outNode(str, node->func); _outFuncOptList(str, node->actions); } #ifdef NOT_USED_IN_PGPOOL static void _outRemoveFuncStmt(String *str, RemoveFuncStmt *node) { switch (node->kind) { case OBJECT_FUNCTION: string_append_char(str, "DROP FUNCTION "); break; case OBJECT_AGGREGATE: string_append_char(str, "DROP AGGREGATE "); break; case OBJECT_OPERATOR: string_append_char(str, "DROP OPERATOR CLASS "); break; default: break; } if (node->missing_ok) string_append_char(str, "IF EXISTS "); _outFuncName(str, node->name); string_append_char(str, " ("); _outNode(str, node->args); string_append_char(str, ")"); if (node->behavior == DROP_CASCADE) string_append_char(str, " CASCADE"); } #endif static void _outCreateCastStmt(String *str, CreateCastStmt *node) { string_append_char(str, "CREATE CAST ("); _outNode(str, node->sourcetype); string_append_char(str, " AS "); _outNode(str, node->targettype); string_append_char(str, ") WITH FUNCTION "); _outNode(str, node->func); switch (node->context) { case COERCION_IMPLICIT: string_append_char(str, " AS IMPLICIT"); break; case COERCION_ASSIGNMENT: string_append_char(str, " AS ASSIGNMENT"); break; default: break; } } static void _outReindexStmt(String *str, ReindexStmt *node) { string_append_char(str, "REINDEX "); switch (node->kind) { case OBJECT_DATABASE: if (node->do_system == true && node->do_user == false) string_append_char(str, "SYSTEM "); else string_append_char(str, "DATABASE "); break; case OBJECT_INDEX: string_append_char(str, "INDEX "); break; case OBJECT_TABLE: string_append_char(str, "TABLE "); break; default: break; } if (node->relation) _outNode(str, node->relation); if (node->name) { string_append_char(str, "\""); string_append_char(str, (char *) node->name); string_append_char(str, "\""); } } static void _outAlterObjectSchemaStmt(String *str, AlterObjectSchemaStmt *node) { string_append_char(str, "ALTER "); switch (node->objectType) { case OBJECT_AGGREGATE: string_append_char(str, "AGGREGATE "); _outFuncName(str, node->object); string_append_char(str, "("); if (lfirst(list_head(node->objarg)) == NULL) string_append_char(str, "*"); else _outNode(str, lfirst(list_head(node->objarg))); string_append_char(str, ") SET SCHAME \""); string_append_char(str, node->newschema); string_append_char(str, "\""); break; case OBJECT_DOMAIN: string_append_char(str, "DOMAIN "); _outFuncName(str, node->object); string_append_char(str, " SET SCHEMA \""); string_append_char(str, node->newschema); string_append_char(str, "\""); break; case OBJECT_FUNCTION: string_append_char(str, "FUNCTION "); _outFuncName(str, node->object); string_append_char(str, "("); _outNode(str, node->objarg); string_append_char(str, ") SET SCHEMA \""); string_append_char(str, node->newschema); string_append_char(str, "\""); break; case OBJECT_SEQUENCE: string_append_char(str, "SEQUENCE "); _outNode(str, node->relation); string_append_char(str, " SET SCHEMA \""); string_append_char(str, node->newschema); string_append_char(str, "\""); break; case OBJECT_TABLE: string_append_char(str, "TABLE "); _outNode(str, node->relation); string_append_char(str, " SET SCHEMA \""); string_append_char(str, node->newschema); string_append_char(str, "\""); break; case OBJECT_TYPE: string_append_char(str, "TYPE "); _outFuncName(str, node->object); string_append_char(str, " SET SCHEMA \""); string_append_char(str, node->newschema); string_append_char(str, "\""); break; default: break; } } static void _outAlterOwnerStmt(String *str, AlterOwnerStmt *node) { string_append_char(str, "ALTER "); switch (node->objectType) { case OBJECT_AGGREGATE: string_append_char(str, "AGGREGATE "); _outFuncName(str, node->object); string_append_char(str, "("); if (lfirst(list_head(node->objarg)) == NULL) string_append_char(str, "*"); else _outNode(str, lfirst(list_head(node->objarg))); string_append_char(str, ") OWNER TO \""); string_append_char(str, node->newowner); string_append_char(str, "\""); break; case OBJECT_CONVERSION: string_append_char(str, "CONVERSION \""); string_append_char(str, strVal(linitial(node->object))); string_append_char(str, "\" OWNER TO \""); string_append_char(str, node->newowner); string_append_char(str, "\""); break; case OBJECT_DATABASE: string_append_char(str, "DATABASE \""); string_append_char(str, strVal(linitial(node->object))); string_append_char(str, "\" OWNER TO \""); string_append_char(str, node->newowner); string_append_char(str, "\""); break; case OBJECT_DOMAIN: string_append_char(str, "DOMAIN \""); string_append_char(str, strVal(linitial(node->object))); string_append_char(str, "\" OWNER TO \""); string_append_char(str, node->newowner); string_append_char(str, "\""); break; case OBJECT_FUNCTION: string_append_char(str, "FUNCTION "); _outFuncName(str, node->object); string_append_char(str, "("); _outNode(str, node->objarg); string_append_char(str, ") OWNER TO \""); string_append_char(str, node->newowner); string_append_char(str, "\""); break; case OBJECT_LANGUAGE: string_append_char(str, "LANGUAGE \""); string_append_char(str, strVal(linitial(node->object))); string_append_char(str, "\" OWNER TO \""); string_append_char(str, node->newowner); string_append_char(str, "\""); break; case OBJECT_OPERATOR: string_append_char(str, "OPERATOR "); _outOperatorName(str, node->object); string_append_char(str, "("); _outOperatorArgTypes(str, node->objarg); string_append_char(str, ") OWNER TO \""); string_append_char(str, node->newowner); string_append_char(str, "\""); break; case OBJECT_OPCLASS: string_append_char(str, "OPERATOR CLASS "); _outFuncName(str, node->object); string_append_char(str, " USING "); string_append_char(str, strVal(linitial(node->objarg))); string_append_char(str, " OWNER TO \""); string_append_char(str, node->newowner); string_append_char(str, "\""); break; case OBJECT_OPFAMILY: string_append_char(str, "OPERATOR FAMILY "); _outFuncName(str, node->object); string_append_char(str, " USING "); string_append_char(str, strVal(linitial(node->objarg))); string_append_char(str, " OWNER TO \""); string_append_char(str, node->newowner); string_append_char(str, "\""); break; case OBJECT_SCHEMA: string_append_char(str, "SCHEMA \""); string_append_char(str, strVal(linitial(node->object))); string_append_char(str, "\" OWNER TO \""); string_append_char(str, node->newowner); string_append_char(str, "\""); break; case OBJECT_TYPE: string_append_char(str, "TYPE \""); string_append_char(str, strVal(linitial(node->object))); string_append_char(str, "\" OWNER TO \""); string_append_char(str, node->newowner); string_append_char(str, "\""); break; case OBJECT_TABLESPACE: string_append_char(str, "TABLESPACE \""); string_append_char(str, strVal(linitial(node->object))); string_append_char(str, "\" OWNER TO \""); string_append_char(str, node->newowner); string_append_char(str, "\""); break; case OBJECT_TSDICTIONARY: string_append_char(str, "TEXT SEARCH DICTIONARY \""); string_append_char(str, strVal(linitial(node->object))); string_append_char(str, "\" OWNER TO \""); string_append_char(str, node->newowner); string_append_char(str, "\""); break; case OBJECT_TSCONFIGURATION: string_append_char(str, "TEXT SEARCH CONFIGURATION \""); string_append_char(str, strVal(linitial(node->object))); string_append_char(str, "\" OWNER TO \""); string_append_char(str, node->newowner); string_append_char(str, "\""); break; case OBJECT_FDW: string_append_char(str, "FOREIGN DATA WRAPPER \""); string_append_char(str, strVal(linitial(node->object))); string_append_char(str, "\" OWNER TO \""); string_append_char(str, node->newowner); string_append_char(str, "\""); break; case OBJECT_FOREIGN_SERVER: string_append_char(str, "SERVER \""); string_append_char(str, strVal(linitial(node->object))); string_append_char(str, "\" OWNER TO \""); string_append_char(str, node->newowner); string_append_char(str, "\""); break; default: break; } } static void _outRuleStmt(String *str, RuleStmt *node) { string_append_char(str, "CREATE "); if (node->replace) string_append_char(str, "OR REPLACE "); string_append_char(str, "RULE \""); string_append_char(str, node->rulename); string_append_char(str, "\" AS ON "); switch (node->event) { case CMD_SELECT: string_append_char(str, "SELECT"); break; case CMD_UPDATE: string_append_char(str, "UPDATE"); break; case CMD_DELETE: string_append_char(str, "DELETE"); break; case CMD_INSERT: string_append_char(str, "INSERT"); break; default: break; } string_append_char(str, " TO "); _outNode(str, node->relation); if (node->whereClause) { string_append_char(str, " WHERE "); _outNode(str, node->whereClause); } string_append_char(str, " DO "); if (node->instead) string_append_char(str, "INSTEAD "); if (node->actions == NIL) string_append_char(str, "NOTHING"); else if (list_length(node->actions) == 1) _outNode(str, linitial(node->actions)); else { ListCell *lc; char semi = 0; string_append_char(str, "("); foreach (lc, node->actions) { if (semi == 0) semi = 1; else string_append_char(str, ";"); _outNode(str, lfirst(lc)); } string_append_char(str, ")"); } } static void _outViewStmt(String *str, ViewStmt *node) { if (node->replace) string_append_char(str, "CREATE OR REPLACE "); else string_append_char(str, "CREATE "); if (node->view->relpersistence == RELPERSISTENCE_TEMP) string_append_char(str, "TEMP "); string_append_char(str, "VIEW "); _outNode(str, node->view); if (node->aliases) { string_append_char(str, "("); _outIdList(str, node->aliases); string_append_char(str, ")"); } string_append_char(str, " AS"); _outNode(str, node->query); } static void _outCreatedbOptList(String *str, List *options) { ListCell *lc; foreach (lc, options) { DefElem *e = lfirst(lc); Value *v = (Value *) e->arg; int sconst = false; /* keyword */ if (strcmp(e->defname, "template") == 0) string_append_char(str, " TEMPLATE "); else if (strcmp(e->defname, "location") == 0) { string_append_char(str, " LOCATION "); sconst = true; } else if (strcmp(e->defname, "tablespace") == 0) string_append_char(str, " TABLESPACE "); else if (strcmp(e->defname, "encoding") == 0) { string_append_char(str, " ENCODING "); sconst = true; } else if (strcmp(e->defname, "owner") == 0) string_append_char(str, " OWNER "); else if (strcmp(e->defname, "connectionlimit") == 0) string_append_char(str, " CONNECTION LIMIT "); /* value */ if (v == NULL) string_append_char(str, "DEFAULT"); else if (IsA((Node *)v, String)) { string_append_char(str, sconst ? "'" : "'"); string_append_char(str, v->val.str); string_append_char(str, sconst ? "'" : "'"); } else { char buf[16]; snprintf(buf, 16, "%ld", v->val.ival); string_append_char(str, buf); } } } static void _outCreatedbStmt(String *str, CreatedbStmt *node) { string_append_char(str, "CREATE DATABASE \""); string_append_char(str, node->dbname); string_append_char(str, "\""); _outCreatedbOptList(str, node->options); } static void _outAlterDatabaseStmt(String *str, AlterDatabaseStmt *node) { string_append_char(str, "ALTER DATABASE \""); string_append_char(str, node->dbname); string_append_char(str, "\" "); _outCreatedbOptList(str, node->options); } static void _outAlterDatabaseSetStmt(String *str, AlterDatabaseSetStmt *node) { string_append_char(str, "ALTER DATABASE \""); string_append_char(str, node->dbname); string_append_char(str, "\" "); _outNode(str, node->setstmt); } static void _outDropdbStmt(String *str, DropdbStmt *node) { string_append_char(str, "DROP DATABASE \""); string_append_char(str, node->dbname); string_append_char(str, "\""); } static void _outCreateDomainStmt(String *str, CreateDomainStmt *node) { ListCell *lc; string_append_char(str, "CREATE DOMAIN "); _outFuncName(str, node->domainname); string_append_char(str, " "); _outNode(str, node->typeName); foreach (lc, node->constraints) { string_append_char(str, " "); _outNode(str, lfirst(lc)); } } static void _outAlterDomainStmt(String *str, AlterDomainStmt *node) { string_append_char(str, "ALTER DOMAIN "); _outFuncName(str, node->typeName); switch (node->subtype) { case 'T': if (node->def) { string_append_char(str, " SET DEFAULT "); _outNode(str, node->def); } else string_append_char(str, " DROP DEFAULT"); break; case 'N': string_append_char(str, " DROP NOT NULL"); break; case 'O': string_append_char(str, " SET NOT NULL"); break; case 'C': string_append_char(str, " ADD "); _outNode(str, node->def); break; case 'X': string_append_char(str, " DROP CONSTRAINT \""); string_append_char(str, node->name); string_append_char(str, "\""); if (node->behavior == DROP_CASCADE) string_append_char(str, " CASCADE"); break; } } static void _outCreateConversionStmt(String *str, CreateConversionStmt *node) { string_append_char(str, "CREATE "); if (node->def == TRUE) string_append_char(str, "DEFAULT "); string_append_char(str, "CONVERSION "); _outFuncName(str, node->conversion_name); string_append_char(str, " FOR '"); string_append_char(str, node->for_encoding_name); string_append_char(str, "' TO '"); string_append_char(str, node->to_encoding_name); string_append_char(str, " FROM "); _outFuncName(str, node->func_name); } static void _outPrepareStmt(String *str, PrepareStmt *node) { string_append_char(str, "PREPARE \""); string_append_char(str, node->name); string_append_char(str, "\" "); if (node->argtypes != NIL) { string_append_char(str, "("); _outNode(str, node->argtypes); string_append_char(str, ") "); } string_append_char(str, "AS "); _outNode(str, node->query); } static void _outExecuteStmt(String *str, ExecuteStmt *node) { #ifdef NOT_USED_IN_PGPOOL if (node->into) { IntoClause *into = node->into; RangeVar *rel = into->rel; string_append_char(str, "CREATE "); if (rel->relpersistence == RELPERSISTENCE_TEMP) string_append_char(str, "TEMP "); string_append_char(str, "TABLE "); _outNode(str, into->rel); string_append_char(str, " AS "); } #endif string_append_char(str, "EXECUTE \""); string_append_char(str, node->name); string_append_char(str, "\" "); if (node->params != NIL) { string_append_char(str, "("); _outNode(str, node->params); string_append_char(str, ")"); } } static void _outLockStmt(String *str, LockStmt *node) { string_append_char(str, "LOCK TABLE "); _outNode(str, node->relations); string_append_char(str, " IN "); switch (node->mode) { case AccessShareLock: string_append_char(str, "ACCESS SHARE "); break; case RowShareLock: string_append_char(str, "ROW SHARE "); break; case RowExclusiveLock: string_append_char(str, "ROW EXCLUSIVE "); break; case ShareUpdateExclusiveLock: string_append_char(str, "SHARE UPDATE EXCLUSIVE "); break; case ShareLock: string_append_char(str, "SHARE "); break; case ShareRowExclusiveLock: string_append_char(str, "SHARE ROW EXCLUSIVE "); break; case ExclusiveLock: string_append_char(str, "EXCLUSIVE "); break; case AccessExclusiveLock: string_append_char(str, "ACCESS EXCLUSIVE "); break; } string_append_char(str, "MODE"); if (node->nowait == TRUE) string_append_char(str, " NOWAIT"); } static void _outOperatorArgTypes(String *str, List *args) { TypeName *left, *right; left = linitial(args); right = lsecond(args); if (left) _outNode(str, left); else string_append_char(str, "NONE"); string_append_char(str, ", "); if (right) _outNode(str, right); else string_append_char(str, "NONE"); } static void _outCommentStmt(String *str, CommentStmt *node) { TypeName *t; Value *v; char buf[16]; string_append_char(str, "COMMENT ON "); switch (node->objtype) { case OBJECT_AGGREGATE: string_append_char(str, "AGGREGATE "); _outFuncName(str, node->objname); string_append_char(str, "("); t = linitial(node->objargs); if (t) _outNode(str, t); else string_append_char(str, "*"); string_append_char(str, ")"); break; case OBJECT_FUNCTION: string_append_char(str, "FUNCTION "); _outFuncName(str, node->objname); string_append_char(str, "("); _outNode(str, node->objargs); string_append_char(str, ")"); break; case OBJECT_OPERATOR: string_append_char(str, "OPERATOR "); _outOperatorName(str, node->objname); string_append_char(str, "("); _outOperatorArgTypes(str, node->objargs); string_append_char(str, ")"); break; case OBJECT_CONSTRAINT: string_append_char(str, "CONSTRAINT \""); v = lsecond(node->objname); string_append_char(str, v->val.str); string_append_char(str, "\" ON "); _outFuncName(str, linitial(node->objargs)); break; case OBJECT_RULE: string_append_char(str, "RULE \""); v = lsecond(node->objname); string_append_char(str, v->val.str); string_append_char(str, "\" ON "); _outFuncName(str, linitial(node->objargs)); break; case OBJECT_TRIGGER: string_append_char(str, "TRIGGER \""); v = lsecond(node->objname); string_append_char(str, v->val.str); string_append_char(str, "\" ON "); _outFuncName(str, linitial(node->objargs)); break; case OBJECT_OPCLASS: string_append_char(str, "OPERATOR CLASS "); _outFuncName(str, node->objname); string_append_char(str, " USING "); v = linitial(node->objargs); string_append_char(str, v->val.str); break; case OBJECT_LARGEOBJECT: string_append_char(str, "LARGE OBJECT "); v = linitial(node->objname); if (IsA(v, String)) string_append_char(str, v->val.str); else if (IsA(v, Integer)) { snprintf(buf, 16, "%ld", v->val.ival); string_append_char(str, buf); } break; case OBJECT_CAST: string_append_char(str, "CAST ("); _outNode(str, linitial(node->objname)); string_append_char(str, " AS "); _outNode(str, linitial(node->objargs)); string_append_char(str, ")"); break; case OBJECT_LANGUAGE: string_append_char(str, "LANGUAGE "); _outFuncName(str, node->objname); break; default: switch (node->objtype) { case OBJECT_COLUMN: string_append_char(str, "COLUMN "); break; case OBJECT_DATABASE: string_append_char(str, "DATABASE "); break; case OBJECT_SCHEMA: string_append_char(str, "SCHEMA "); break; case OBJECT_INDEX: string_append_char(str, "INDEX "); break; case OBJECT_SEQUENCE: string_append_char(str, "SEQUENCE "); break; case OBJECT_TABLE: string_append_char(str, "TABLE "); break; case OBJECT_DOMAIN: string_append_char(str, "DOMAIN "); break; case OBJECT_TYPE: string_append_char(str, "TYPE "); break; case OBJECT_VIEW: string_append_char(str, "VIEW "); break; default: break; } _outFuncName(str, node->objname); break; } string_append_char(str, " IS "); if (node->comment) { string_append_char(str, "'"); string_append_char(str, node->comment); string_append_char(str, "'"); } else string_append_char(str, "NULL"); } static void _outRangeSubselect(String *str, RangeSubselect *node) { string_append_char(str, "("); _outNode(str, node->subquery); string_append_char(str, ")"); _outNode(str, node->alias); } /*TODO*/ static void _outRangeFunction(String *str, RangeFunction *node) { _outNode(str, node->functions); //TODO if (node->alias) { _outNode(str, node->alias); } if (node->coldeflist) { string_append_char(str, " ("); _outNode(str, node->coldeflist); string_append_char(str, ")"); } } static void _outDiscardStmt(String *str, DiscardStmt *node) { switch (node->target) { case DISCARD_ALL: string_append_char(str, "DISCARD ALL"); break; case DISCARD_TEMP: string_append_char(str, "DISCARD TEMP"); break; case DISCARD_PLANS: string_append_char(str, "DISCARD PLANS"); break; default: break; } } static void _outCreateOpFamilyStmt(String *str, CreateOpFamilyStmt *node) { string_append_char(str, "CREATE OPERATOR FAMILY "); _outIdList(str, node->opfamilyname); string_append_char(str, " USING \""); string_append_char(str, node->amname); string_append_char(str, "\""); } static void _outAlterOpFamilyStmt(String *str, AlterOpFamilyStmt *node) { } #ifdef NOT_USED_IN_PGPOOL static void _outRemoveOpFamilyStmt(String *str, RemoveOpFamilyStmt *node) { string_append_char(str, "DROP OPERATOR FAMILY "); if (node->missing_ok) string_append_char(str, "IF EXISTS "); _outIdList(str, node->opfamilyname); string_append_char(str, " USING \""); string_append_char(str, node->amname); string_append_char(str, "\""); } #endif static void _outCreateEnumStmt(String *str, CreateEnumStmt *node) { string_append_char(str, "CREATE TYPE "); _outIdList(str, node->typeName); string_append_char(str, " AS ENUM ("); _outNode(str, node->vals); string_append_char(str, ")"); } static void _outDropOwnedStmt(String *str, DropOwnedStmt *node) { string_append_char(str, "DROP OWNED BY "); _outIdList(str, node->roles); if (node->behavior == DROP_CASCADE) string_append_char(str, " CASCADE"); } static void _outReassignOwnedStmt(String *str, ReassignOwnedStmt *node) { string_append_char(str, "REASSIGN OWNED BY "); _outIdList(str, node->roles); string_append_char(str, " TO \""); string_append_char(str, node->newrole); string_append_char(str, "\""); } static void _outAlterTSDictionaryStmt(String *str, AlterTSDictionaryStmt *node) { string_append_char(str, "ALTER TEXT SEARCH DICTIONARY "); _outIdList(str, node->dictname); string_append_char(str, "("); _outNode(str, node->options); string_append_char(str, ")"); } static void _outAlterTSConfigurationStmt(String *str, AlterTSConfigurationStmt *node) { string_append_char(str, "ALTER TEXT SEARCH CONFIGURATION "); _outIdList(str, node->cfgname); if (node->override == false && node->replace == false) { string_append_char(str, "ADD MAPPING FOR "); _outIdList(str, node->tokentype); string_append_char(str, " WITH "); _outIdList(str, node->dicts); } else if (node->override == true && node->replace == false) { string_append_char(str, "ALTER MAPPING FOR "); _outIdList(str, node->tokentype); string_append_char(str, " WITH "); _outIdList(str, node->dicts); } else if (node->override == false && node->replace == true) { if (node->tokentype == NIL) string_append_char(str, "ALTER MAPPING "); else { string_append_char(str, "ALTER MAPPING FOR "); _outIdList(str, node->tokentype); } string_append_char(str, "REPLACE "); _outNode(str, linitial(node->dicts)); string_append_char(str, " WITH "); _outNode(str, lsecond(node->dicts)); } else if (node->missing_ok == false) { string_append_char(str, " DROP MAPPING FOR "); _outIdList(str, node->tokentype); } else if (node->missing_ok == true) { string_append_char(str, " DROP MAPPING IF EXISTS FOR "); _outIdList(str, node->tokentype); } } static void _outXmlExpr(String *str, XmlExpr *node) { A_Const *n; switch (node->op) { case IS_DOCUMENT: _outNode(str, node->args); string_append_char(str, " IS DOCUMENT"); break; case IS_XMLCONCAT: string_append_char(str, "XMLCONCAT ("); _outNode(str, node->args); string_append_char(str, ")"); break; case IS_XMLELEMENT: string_append_char(str, "XMLELEMENT ("); if (node->name) { string_append_char(str, "NAME \""); string_append_char(str, node->name); string_append_char(str, "\""); if (node->named_args != NIL) { string_append_char(str, ","); _outIdList(str, node->named_args); } } if (node->args != NIL) { string_append_char(str, ","); _outNode(str, node->args); } string_append_char(str, ")"); break; case IS_XMLFOREST: string_append_char(str, "XMLFOREST ("); _outNode(str, node->named_args); string_append_char(str, ")"); break; case IS_XMLPARSE: string_append_char(str, "XMLPARSE ("); if (node->xmloption == XMLOPTION_DOCUMENT) string_append_char(str, "DOCUMENT "); else string_append_char(str, "CONTENT "); _outNode(str, linitial(node->args)); n = lsecond(node->args); { Node *arg = ((TypeCast *) n)->arg; if (((A_Const *) arg)->val.val.str[0] == 't') string_append_char(str, " PRESERVE WHITESPACE"); } string_append_char(str, ")"); break; default: break; } } static void _outXmlSerialize(String *str, XmlSerialize *node) { } static void _outInhRelation(String *str, TableLikeClause *node) { string_append_char(str, "LIKE "); _outNode(str, node->relation); if (node->options == CREATE_TABLE_LIKE_ALL) string_append_char(str, " INCLUDING ALL"); else { if (node->options & CREATE_TABLE_LIKE_DEFAULTS) string_append_char(str, " INCLUDING DEFAULTS"); if (node->options & CREATE_TABLE_LIKE_CONSTRAINTS) string_append_char(str, " INCLUDING CONSTRAINTS"); if (node->options & CREATE_TABLE_LIKE_INDEXES) string_append_char(str, " INCLUDING INDEXES"); if (server_version_num >= 90000) { if (node->options & CREATE_TABLE_LIKE_STORAGE) string_append_char(str, " INCLUDING STORAGE"); if (node->options & CREATE_TABLE_LIKE_COMMENTS) string_append_char(str, " INCLUDING COMMENTS"); } } } static void _outWithDefinition(String *str, List *def_list) { int oid = 0; if (list_length(def_list) == 1) { DefElem *elem; elem = linitial(def_list); if (strcmp(elem->defname, "oids") == 0) { Value *v = (Value *)elem->arg; if (v->val.ival == 1) string_append_char(str, " WITH OIDS "); else string_append_char(str, " WITHOUT OIDS "); oid = 1; } } if (oid == 1) return; string_append_char(str, " WITH "); _outDefinition(str, def_list); } static void _outCurrentOfExpr(String *str, CurrentOfExpr *node) { string_append_char(str, "CURRENT OF "); if (node->cursor_name == NULL) { char n[10]; snprintf(n, sizeof(n), "$%d", node->cursor_param); string_append_char(str, n); } else string_append_char(str, node->cursor_name); } /* * _outNode - * converts a Node into ascii string and append it to 'str' */ void _outNode(String *str, void *obj) { if (obj == NULL) return; else if (IsA(obj, List) ||IsA(obj, IntList) || IsA(obj, OidList)) _outList(str, obj); else if (IsA(obj, Integer) || IsA(obj, Float) || IsA(obj, String) || IsA(obj, BitString)) { /* nodeRead does not want to see { } around these! */ _outValue(str, obj); } else { switch (nodeTag(obj)) { case T_Alias: _outAlias(str, obj); break; case T_RangeVar: _outRangeVar(str, obj); break; /* case T_IntoClause: _outIntoClause(str, obj); break; */ case T_Var: _outVar(str, obj); break; case T_Const: _outConst(str, obj); break; case T_Param: _outParam(str, obj); break; case T_Aggref: _outAggref(str, obj); break; /* case T_WindowFunc: _outWindowFunc(str, obj); break; */ case T_ArrayRef: _outArrayRef(str, obj); break; case T_FuncExpr: _outFuncExpr(str, obj); break; case T_NamedArgExpr: _outNamedArgExpr(str, obj); break; case T_OpExpr: _outOpExpr(str, obj); break; case T_DistinctExpr: _outDistinctExpr(str, obj); break; case T_ScalarArrayOpExpr: _outScalarArrayOpExpr(str, obj); break; case T_BoolExpr: _outBoolExpr(str, obj); break; case T_SubLink: _outSubLink(str, obj); break; case T_SubPlan: _outSubPlan(str, obj); break; /* case T_AlternativeSubPlan: _outAlternativeSubPlan(str, obj); break; */ case T_FieldSelect: _outFieldSelect(str, obj); break; case T_FieldStore: _outFieldStore(str, obj); break; case T_RelabelType: _outRelabelType(str, obj); break; /* case T_CoerceViaIO: _outCoerceViaIO(str, obj); break; case T_ArrayCoerceExpr: _outArrayCoerceExpr(str, obj); break; */ case T_ConvertRowtypeExpr: _outConvertRowtypeExpr(str, obj); break; case T_CaseExpr: _outCaseExpr(str, obj); break; case T_CaseWhen: _outCaseWhen(str, obj); break; case T_CaseTestExpr: _outCaseTestExpr(str, obj); break; case T_ArrayExpr: _outArrayExpr(str, obj); break; case T_RowExpr: _outRowExpr(str, obj); break; /* case T_RowCompareExpr: _outRowCompareExpr(str, obj); break; */ case T_CoalesceExpr: _outCoalesceExpr(str, obj); break; case T_MinMaxExpr: _outMinMaxExpr(str, obj); break; case T_XmlExpr: _outXmlExpr(str, obj); break; case T_NullIfExpr: _outNullIfExpr(str, obj); break; case T_NullTest: _outNullTest(str, obj); break; case T_BooleanTest: _outBooleanTest(str, obj); break; case T_CoerceToDomain: _outCoerceToDomain(str, obj); break; case T_CoerceToDomainValue: _outCoerceToDomainValue(str, obj); break; case T_SetToDefault: _outSetToDefault(str, obj); break; case T_CurrentOfExpr: _outCurrentOfExpr(str, obj); break; case T_TargetEntry: _outTargetEntry(str, obj); break; case T_RangeTblRef: _outRangeTblRef(str, obj); break; case T_JoinExpr: _outJoinExpr(str, obj); break; case T_FromExpr: _outFromExpr(str, obj); break; case T_CreateStmt: _outCreateStmt(str, obj); break; case T_CreateTableAsStmt: _outCreateTableAsStmt(str, obj); break; case T_IndexStmt: _outIndexStmt(str, obj); break; case T_NotifyStmt: _outNotifyStmt(str, obj); break; case T_DeclareCursorStmt: _outDeclareCursorStmt(str, obj); break; case T_SelectStmt: _outSelectStmt(str, obj); break; case T_ColumnDef: _outColumnDef(str, obj); break; case T_TypeName: _outTypeName(str, obj); break; case T_TypeCast: _outTypeCast(str, obj); break; case T_IndexElem: _outIndexElem(str, obj); break; /* case T_Query: _outQuery(str, obj); break; case T_SortGroupClause: _outSortGroupClause(str, obj); break; case T_WindowClause: _outWindowClause(str, obj); break; case T_RowMarkClause: _outRowMarkClause(str, obj); break; */ case T_WithClause: _outWithClause(str, obj); break; case T_CommonTableExpr: _outCommonTableExpr(str, obj); break; case T_SetOperationStmt: _outSetOperationStmt(str, obj); break; /* case T_RangeTblEntry: _outRangeTblEntry(str, obj); break; */ case T_A_Expr: _outAExpr(str, obj); break; case T_ColumnRef: _outColumnRef(str, obj); break; case T_ParamRef: _outParamRef(str, obj); break; case T_A_Const: _outAConst(str, obj); break; /* case T_A_Star: _outA_Star(str, obj); break; */ case T_A_Indices: _outA_Indices(str, obj); break; case T_A_Indirection: _outA_Indirection(str, obj); break; case T_A_ArrayExpr: _outA_ArrayExpr(str, obj); break; case T_ResTarget: _outResTarget(str, obj); break; case T_SortBy: _outSortBy(str, obj); break; case T_WindowDef: _outWindowDef(str, obj); break; case T_RangeSubselect: _outRangeSubselect(str, obj); break; case T_RangeFunction: _outRangeFunction(str, obj); break; case T_Constraint: _outConstraint(str, obj); break; case T_FuncCall: _outFuncCall(str, obj); break; case T_DefElem: _outDefElem(str, obj); break; case T_LockingClause: _outLockingClause(str, obj); break; case T_XmlSerialize: _outXmlSerialize(str, obj); break; case T_InsertStmt: _outInsertStmt(str, obj); break; case T_UpdateStmt: _outUpdateStmt(str, obj); break; case T_DeleteStmt: _outDeleteStmt(str, obj); break; case T_TransactionStmt: _outTransactionStmt(str, obj); break; case T_TruncateStmt: _outTruncateStmt(str, obj); break; #ifdef NOT_USED_IN_PGPOOL /* 9.0 does not have this */ case T_VacuumStmt: _outVacuumStmt(str, obj); break; #endif case T_ExplainStmt: _outExplainStmt(str, obj); break; case T_ClusterStmt: _outClusterStmt(str, obj); break; case T_CheckPointStmt: _outCheckPointStmt(str, obj); break; case T_ClosePortalStmt: _outClosePortalStmt(str, obj); break; case T_ListenStmt: _outListenStmt(str, obj); break; case T_UnlistenStmt: _outUnlistenStmt(str, obj); break; case T_LoadStmt: _outLoadStmt(str, obj); break; case T_CopyStmt: _outCopyStmt(str, obj); break; case T_DeallocateStmt: _outDeallocateStmt(str, obj); break; case T_RenameStmt: _outRenameStmt(str, obj); break; case T_CreateRoleStmt: _outCreateRoleStmt(str, obj); break; case T_AlterRoleStmt: _outAlterRoleStmt(str, obj); break; case T_AlterRoleSetStmt: _outAlterRoleSetStmt(str, obj); break; case T_DropRoleStmt: _outDropRoleStmt(str, obj); break; case T_CreateSchemaStmt: _outCreateSchemaStmt(str, obj); break; case T_VariableSetStmt: _outVariableSetStmt(str, obj); break; case T_VariableShowStmt: _outVariableShowStmt(str, obj); break; case T_ConstraintsSetStmt: _outConstraintsSetStmt(str, obj); break; case T_AlterTableStmt: _outAlterTableStmt(str, obj); break; case T_AlterTableCmd: _outAlterTableCmd(str, obj); break; case T_CreateSeqStmt: _outCreateSeqStmt(str, obj); break; case T_AlterSeqStmt: _outAlterSeqStmt(str, obj); break; case T_CreatePLangStmt: _outCreatePLangStmt(str, obj); break; #ifdef NOT_USED_IN_PGPOOL case T_DropPLangStmt: _outDropPLangStmt(str, obj); break; #endif case T_CreateTableSpaceStmt: _outCreateTableSpaceStmt(str, obj); break; case T_DropTableSpaceStmt: _outDropTableSpaceStmt(str, obj); break; case T_CreateTrigStmt: _outCreateTrigStmt(str, obj); break; case T_DefineStmt: _outDefineStmt(str, obj); break; case T_CreateOpClassStmt: _outCreateOpClassStmt(str, obj); break; case T_CreateOpClassItem: _outCreateOpClassItem(str, obj); break; #ifdef NOT_USED_IN_PGPOOL case T_RemoveOpClassStmt: _outRemoveOpClassStmt(str, obj); break; #endif case T_DropStmt: _outDropStmt(str, obj); break; case T_FetchStmt: _outFetchStmt(str, obj); break; case T_GrantStmt: _outGrantStmt(str, obj); break; case T_FuncWithArgs: _outFuncWithArgs(str, obj); break; case T_FunctionParameter: _outFunctionParameter(str, obj); break; case T_PrivGrantee: _outPrivGrantee(str, obj); break; case T_GrantRoleStmt: _outGrantRoleStmt(str, obj); break; case T_CreateFunctionStmt: _outCreateFunctionStmt(str, obj); break; case T_AlterFunctionStmt: _outAlterFunctionStmt(str, obj); break; #ifdef NOT_USED_IN_PGPOOL case T_RemoveFuncStmt: _outRemoveFuncStmt(str, obj); break; #endif case T_CreateCastStmt: _outCreateCastStmt(str, obj); break; #ifdef NOT_USED_IN_PGPOOL case T_DropCastStmt: _outDropCastStmt(str, obj); break; #endif case T_ReindexStmt: _outReindexStmt(str, obj); break; case T_AlterObjectSchemaStmt: _outAlterObjectSchemaStmt(str, obj); break; case T_AlterOwnerStmt: _outAlterOwnerStmt(str, obj); break; case T_RuleStmt: _outRuleStmt(str, obj); break; case T_ViewStmt: _outViewStmt(str, obj); break; case T_CreatedbStmt: _outCreatedbStmt(str, obj); break; case T_AlterDatabaseStmt: _outAlterDatabaseStmt(str, obj); break; case T_AlterDatabaseSetStmt: _outAlterDatabaseSetStmt(str, obj); break; case T_DropdbStmt: _outDropdbStmt(str, obj); break; case T_CreateDomainStmt: _outCreateDomainStmt(str, obj); break; case T_AlterDomainStmt: _outAlterDomainStmt(str, obj); break; case T_CreateConversionStmt: _outCreateConversionStmt(str, obj); break; case T_PrepareStmt: _outPrepareStmt(str, obj); break; case T_ExecuteStmt: _outExecuteStmt(str, obj); break; case T_LockStmt: _outLockStmt(str, obj); break; case T_CommentStmt: _outCommentStmt(str, obj); break; case T_DiscardStmt: _outDiscardStmt(str, obj); break; case T_CreateOpFamilyStmt: _outCreateOpFamilyStmt(str, obj); break; case T_AlterOpFamilyStmt: _outAlterOpFamilyStmt(str, obj); break; #ifdef NOT_USED_IN_PGPOOL case T_RemoveOpFamilyStmt: _outRemoveOpFamilyStmt(str, obj); break; #endif case T_CreateEnumStmt: _outCreateEnumStmt(str, obj); break; case T_DropOwnedStmt: _outDropOwnedStmt(str, obj); break; case T_ReassignOwnedStmt: _outReassignOwnedStmt(str, obj); break; case T_AlterTSDictionaryStmt: _outAlterTSDictionaryStmt(str, obj); break; case T_AlterTSConfigurationStmt: _outAlterTSConfigurationStmt(str, obj); break; case T_TableLikeClause: _outInhRelation(str, obj); break; default: break; } } } /* * nodeToString - * returns the ascii representation of the Node as a palloc'd string */ char * nodeToString(const void *obj) { String *str; char *p; str = init_string(""); _outNode(str, (void *)obj); p = palloc(str->len+1); memcpy(p, str->data, str->len); *(p+str->len) = '\0'; free_string(str); return p; } pgpool-II-3.4.3/src/parser/list.c0000664000076400007640000006467312554350605013502 00000000000000/*------------------------------------------------------------------------- * * list.c * implementation for PostgreSQL generic linked list package * * * Portions Copyright (c) 2003-2014, PgPool Global Development Group * Portions Copyright (c) 1996-2014, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION * src/backend/nodes/list.c * *------------------------------------------------------------------------- */ /* see pg_list.h */ //#define PG_LIST_INCLUDE_DEFINITIONS #include "utils/elog.h" #include #include "utils/palloc.h" #include "pg_list.h" /* * Routines to simplify writing assertions about the type of a list; a * NIL list is considered to be an empty list of any type. */ #define IsPointerList(l) ((l) == NIL || IsA((l), List)) #define IsIntegerList(l) ((l) == NIL || IsA((l), IntList)) #define IsOidList(l) ((l) == NIL || IsA((l), OidList)) #ifdef USE_ASSERT_CHECKING /* * Check that the specified List is valid (so far as we can tell). */ static void check_list_invariants(const List *list) { if (list == NIL) return; Assert(list->length > 0); Assert(list->head != NULL); Assert(list->tail != NULL); Assert(list->type == T_List || list->type == T_IntList || list->type == T_OidList); if (list->length == 1) Assert(list->head == list->tail); if (list->length == 2) Assert(list->head->next == list->tail); Assert(list->tail->next == NULL); } #else #define check_list_invariants(l) #endif /* USE_ASSERT_CHECKING */ /* * Return a freshly allocated List. Since empty non-NIL lists are * invalid, new_list() also allocates the head cell of the new list: * the caller should be sure to fill in that cell's data. */ static List * new_list(NodeTag type) { List *new_list; ListCell *new_head; new_head = (ListCell *) palloc(sizeof(*new_head)); new_head->next = NULL; /* new_head->data is left undefined! */ new_list = (List *) palloc(sizeof(*new_list)); new_list->type = type; new_list->length = 1; new_list->head = new_head; new_list->tail = new_head; return new_list; } /* * Allocate a new cell and make it the head of the specified * list. Assumes the list it is passed is non-NIL. * * The data in the new head cell is undefined; the caller should be * sure to fill it in */ static void new_head_cell(List *list) { ListCell *new_head; new_head = (ListCell *) palloc(sizeof(*new_head)); new_head->next = list->head; list->head = new_head; list->length++; } /* * Allocate a new cell and make it the tail of the specified * list. Assumes the list it is passed is non-NIL. * * The data in the new tail cell is undefined; the caller should be * sure to fill it in */ static void new_tail_cell(List *list) { ListCell *new_tail; new_tail = (ListCell *) palloc(sizeof(*new_tail)); new_tail->next = NULL; list->tail->next = new_tail; list->tail = new_tail; list->length++; } /* * Append a pointer to the list. A pointer to the modified list is * returned. Note that this function may or may not destructively * modify the list; callers should always use this function's return * value, rather than continuing to use the pointer passed as the * first argument. */ List * lappend(List *list, void *datum) { Assert(IsPointerList(list)); if (list == NIL) list = new_list(T_List); else new_tail_cell(list); lfirst(list->tail) = datum; check_list_invariants(list); return list; } /* * Append an integer to the specified list. See lappend() */ List * lappend_int(List *list, int datum) { Assert(IsIntegerList(list)); if (list == NIL) list = new_list(T_IntList); else new_tail_cell(list); lfirst_int(list->tail) = datum; check_list_invariants(list); return list; } /* * Append an OID to the specified list. See lappend() */ List * lappend_oid(List *list, Oid datum) { Assert(IsOidList(list)); if (list == NIL) list = new_list(T_OidList); else new_tail_cell(list); lfirst_oid(list->tail) = datum; check_list_invariants(list); return list; } /* * Add a new cell to the list, in the position after 'prev_cell'. The * data in the cell is left undefined, and must be filled in by the * caller. 'list' is assumed to be non-NIL, and 'prev_cell' is assumed * to be non-NULL and a member of 'list'. */ static ListCell * add_new_cell(List *list, ListCell *prev_cell) { ListCell *new_cell; new_cell = (ListCell *) palloc(sizeof(*new_cell)); /* new_cell->data is left undefined! */ new_cell->next = prev_cell->next; prev_cell->next = new_cell; if (list->tail == prev_cell) list->tail = new_cell; list->length++; return new_cell; } /* * Add a new cell to the specified list (which must be non-NIL); * it will be placed after the list cell 'prev' (which must be * non-NULL and a member of 'list'). The data placed in the new cell * is 'datum'. The newly-constructed cell is returned. */ ListCell * lappend_cell(List *list, ListCell *prev, void *datum) { ListCell *new_cell; Assert(IsPointerList(list)); new_cell = add_new_cell(list, prev); lfirst(new_cell) = datum; check_list_invariants(list); return new_cell; } ListCell * lappend_cell_int(List *list, ListCell *prev, int datum) { ListCell *new_cell; Assert(IsIntegerList(list)); new_cell = add_new_cell(list, prev); lfirst_int(new_cell) = datum; check_list_invariants(list); return new_cell; } ListCell * lappend_cell_oid(List *list, ListCell *prev, Oid datum) { ListCell *new_cell; Assert(IsOidList(list)); new_cell = add_new_cell(list, prev); lfirst_oid(new_cell) = datum; check_list_invariants(list); return new_cell; } /* * Prepend a new element to the list. A pointer to the modified list * is returned. Note that this function may or may not destructively * modify the list; callers should always use this function's return * value, rather than continuing to use the pointer passed as the * second argument. * * Caution: before Postgres 8.0, the original List was unmodified and * could be considered to retain its separate identity. This is no longer * the case. */ List * lcons(void *datum, List *list) { Assert(IsPointerList(list)); if (list == NIL) list = new_list(T_List); else new_head_cell(list); lfirst(list->head) = datum; check_list_invariants(list); return list; } /* * Prepend an integer to the list. See lcons() */ List * lcons_int(int datum, List *list) { Assert(IsIntegerList(list)); if (list == NIL) list = new_list(T_IntList); else new_head_cell(list); lfirst_int(list->head) = datum; check_list_invariants(list); return list; } /* * Prepend an OID to the list. See lcons() */ List * lcons_oid(Oid datum, List *list) { Assert(IsOidList(list)); if (list == NIL) list = new_list(T_OidList); else new_head_cell(list); lfirst_oid(list->head) = datum; check_list_invariants(list); return list; } /* * Concatenate list2 to the end of list1, and return list1. list1 is * destructively changed. Callers should be sure to use the return * value as the new pointer to the concatenated list: the 'list1' * input pointer may or may not be the same as the returned pointer. * * The nodes in list2 are merely appended to the end of list1 in-place * (i.e. they aren't copied; the two lists will share some of the same * storage). Therefore, invoking list_free() on list2 will also * invalidate a portion of list1. */ List * list_concat(List *list1, List *list2) { if (list1 == NIL) return list2; if (list2 == NIL) return list1; if (list1 == list2) elog(ERROR, "cannot list_concat() a list to itself"); Assert(list1->type == list2->type); list1->length += list2->length; list1->tail->next = list2->head; list1->tail = list2->tail; check_list_invariants(list1); return list1; } /* * Truncate 'list' to contain no more than 'new_size' elements. This * modifies the list in-place! Despite this, callers should use the * pointer returned by this function to refer to the newly truncated * list -- it may or may not be the same as the pointer that was * passed. * * Note that any cells removed by list_truncate() are NOT pfree'd. */ List * list_truncate(List *list, int new_size) { ListCell *cell; int n; if (new_size <= 0) return NIL; /* truncate to zero length */ /* If asked to effectively extend the list, do nothing */ if (new_size >= list_length(list)) return list; n = 1; foreach(cell, list) { if (n == new_size) { cell->next = NULL; list->tail = cell; list->length = new_size; check_list_invariants(list); return list; } n++; } /* keep the compiler quiet; never reached */ Assert(false); return list; } /* * Locate the n'th cell (counting from 0) of the list. It is an assertion * failure if there is no such cell. */ static ListCell * list_nth_cell(const List *list, int n) { ListCell *match; Assert(list != NIL); Assert(n >= 0); Assert(n < list->length); check_list_invariants(list); /* Does the caller actually mean to fetch the tail? */ if (n == list->length - 1) return list->tail; for (match = list->head; n-- > 0; match = match->next) ; return match; } /* * Return the data value contained in the n'th element of the * specified list. (List elements begin at 0.) */ void * list_nth(const List *list, int n) { Assert(IsPointerList(list)); return lfirst(list_nth_cell(list, n)); } /* * Return the integer value contained in the n'th element of the * specified list. */ int list_nth_int(const List *list, int n) { Assert(IsIntegerList(list)); return lfirst_int(list_nth_cell(list, n)); } /* * Return the OID value contained in the n'th element of the specified * list. */ Oid list_nth_oid(const List *list, int n) { Assert(IsOidList(list)); return lfirst_oid(list_nth_cell(list, n)); } #ifdef NOT_USED_IN_PGPOOL /* * Return true iff 'datum' is a member of the list. Equality is * determined via equal(), so callers should ensure that they pass a * Node as 'datum'. */ bool list_member(const List *list, const void *datum) { const ListCell *cell; Assert(IsPointerList(list)); check_list_invariants(list); foreach(cell, list) { if (equal(lfirst(cell), datum)) return true; } return false; } #endif /*NOT_USED_IN_PGPOOL*/ /* * Return true iff 'datum' is a member of the list. Equality is * determined by using simple pointer comparison. */ bool list_member_ptr(const List *list, const void *datum) { const ListCell *cell; Assert(IsPointerList(list)); check_list_invariants(list); foreach(cell, list) { if (lfirst(cell) == datum) return true; } return false; } /* * Return true iff the integer 'datum' is a member of the list. */ bool list_member_int(const List *list, int datum) { const ListCell *cell; Assert(IsIntegerList(list)); check_list_invariants(list); foreach(cell, list) { if (lfirst_int(cell) == datum) return true; } return false; } /* * Return true iff the OID 'datum' is a member of the list. */ bool list_member_oid(const List *list, Oid datum) { const ListCell *cell; Assert(IsOidList(list)); check_list_invariants(list); foreach(cell, list) { if (lfirst_oid(cell) == datum) return true; } return false; } /* * Delete 'cell' from 'list'; 'prev' is the previous element to 'cell' * in 'list', if any (i.e. prev == NULL iff list->head == cell) * * The cell is pfree'd, as is the List header if this was the last member. */ List * list_delete_cell(List *list, ListCell *cell, ListCell *prev) { check_list_invariants(list); Assert(prev != NULL ? lnext(prev) == cell : list_head(list) == cell); /* * If we're about to delete the last node from the list, free the whole * list instead and return NIL, which is the only valid representation of * a zero-length list. */ if (list->length == 1) { list_free(list); return NIL; } /* * Otherwise, adjust the necessary list links, deallocate the particular * node we have just removed, and return the list we were given. */ list->length--; if (prev) prev->next = cell->next; else list->head = cell->next; if (list->tail == cell) list->tail = prev; pfree(cell); return list; } #ifdef NOT_USED_IN_PGPOOL /* * Delete the first cell in list that matches datum, if any. * Equality is determined via equal(). */ List * list_delete(List *list, void *datum) { ListCell *cell; ListCell *prev; Assert(IsPointerList(list)); check_list_invariants(list); prev = NULL; foreach(cell, list) { if (equal(lfirst(cell), datum)) return list_delete_cell(list, cell, prev); prev = cell; } /* Didn't find a match: return the list unmodified */ return list; } #endif /*NOT_USED_IN_PGPOOL*/ /* As above, but use simple pointer equality */ List * list_delete_ptr(List *list, void *datum) { ListCell *cell; ListCell *prev; Assert(IsPointerList(list)); check_list_invariants(list); prev = NULL; foreach(cell, list) { if (lfirst(cell) == datum) return list_delete_cell(list, cell, prev); prev = cell; } /* Didn't find a match: return the list unmodified */ return list; } /* As above, but for integers */ List * list_delete_int(List *list, int datum) { ListCell *cell; ListCell *prev; Assert(IsIntegerList(list)); check_list_invariants(list); prev = NULL; foreach(cell, list) { if (lfirst_int(cell) == datum) return list_delete_cell(list, cell, prev); prev = cell; } /* Didn't find a match: return the list unmodified */ return list; } /* As above, but for OIDs */ List * list_delete_oid(List *list, Oid datum) { ListCell *cell; ListCell *prev; Assert(IsOidList(list)); check_list_invariants(list); prev = NULL; foreach(cell, list) { if (lfirst_oid(cell) == datum) return list_delete_cell(list, cell, prev); prev = cell; } /* Didn't find a match: return the list unmodified */ return list; } /* * Delete the first element of the list. * * This is useful to replace the Lisp-y code "list = lnext(list);" in cases * where the intent is to alter the list rather than just traverse it. * Beware that the removed cell is freed, whereas the lnext() coding leaves * the original list head intact if there's another pointer to it. */ List * list_delete_first(List *list) { check_list_invariants(list); if (list == NIL) return NIL; /* would an error be better? */ return list_delete_cell(list, list_head(list), NULL); } #ifdef NOT_USED_IN_PGPOOL /* * Generate the union of two lists. This is calculated by copying * list1 via list_copy(), then adding to it all the members of list2 * that aren't already in list1. * * Whether an element is already a member of the list is determined * via equal(). * * The returned list is newly-allocated, although the content of the * cells is the same (i.e. any pointed-to objects are not copied). * * NB: this function will NOT remove any duplicates that are present * in list1 (so it only performs a "union" if list1 is known unique to * start with). Also, if you are about to write "x = list_union(x, y)" * you probably want to use list_concat_unique() instead to avoid wasting * the list cells of the old x list. * * This function could probably be implemented a lot faster if it is a * performance bottleneck. */ List * list_union(const List *list1, const List *list2) { List *result; const ListCell *cell; Assert(IsPointerList(list1)); Assert(IsPointerList(list2)); result = list_copy(list1); foreach(cell, list2) { if (!list_member(result, lfirst(cell))) result = lappend(result, lfirst(cell)); } check_list_invariants(result); return result; } #endif /*NOT_USED_IN_PGPOOL*/ /* * This variant of list_union() determines duplicates via simple * pointer comparison. */ List * list_union_ptr(const List *list1, const List *list2) { List *result; const ListCell *cell; Assert(IsPointerList(list1)); Assert(IsPointerList(list2)); result = list_copy(list1); foreach(cell, list2) { if (!list_member_ptr(result, lfirst(cell))) result = lappend(result, lfirst(cell)); } check_list_invariants(result); return result; } /* * This variant of list_union() operates upon lists of integers. */ List * list_union_int(const List *list1, const List *list2) { List *result; const ListCell *cell; Assert(IsIntegerList(list1)); Assert(IsIntegerList(list2)); result = list_copy(list1); foreach(cell, list2) { if (!list_member_int(result, lfirst_int(cell))) result = lappend_int(result, lfirst_int(cell)); } check_list_invariants(result); return result; } /* * This variant of list_union() operates upon lists of OIDs. */ List * list_union_oid(const List *list1, const List *list2) { List *result; const ListCell *cell; Assert(IsOidList(list1)); Assert(IsOidList(list2)); result = list_copy(list1); foreach(cell, list2) { if (!list_member_oid(result, lfirst_oid(cell))) result = lappend_oid(result, lfirst_oid(cell)); } check_list_invariants(result); return result; } #ifdef NOT_USED_IN_PGPOOL /* * Return a list that contains all the cells that are in both list1 and * list2. The returned list is freshly allocated via palloc(), but the * cells themselves point to the same objects as the cells of the * input lists. * * Duplicate entries in list1 will not be suppressed, so it's only a true * "intersection" if list1 is known unique beforehand. * * This variant works on lists of pointers, and determines list * membership via equal(). Note that the list1 member will be pointed * to in the result. */ List * list_intersection(const List *list1, const List *list2) { List *result; const ListCell *cell; if (list1 == NIL || list2 == NIL) return NIL; Assert(IsPointerList(list1)); Assert(IsPointerList(list2)); result = NIL; foreach(cell, list1) { if (list_member(list2, lfirst(cell))) result = lappend(result, lfirst(cell)); } check_list_invariants(result); return result; } /* * Return a list that contains all the cells in list1 that are not in * list2. The returned list is freshly allocated via palloc(), but the * cells themselves point to the same objects as the cells of the * input lists. * * This variant works on lists of pointers, and determines list * membership via equal() */ List * list_difference(const List *list1, const List *list2) { const ListCell *cell; List *result = NIL; Assert(IsPointerList(list1)); Assert(IsPointerList(list2)); if (list2 == NIL) return list_copy(list1); foreach(cell, list1) { if (!list_member(list2, lfirst(cell))) result = lappend(result, lfirst(cell)); } check_list_invariants(result); return result; } #endif /*NOT_USED_IN_PGPOOL*/ /* * This variant of list_difference() determines list membership via * simple pointer equality. */ List * list_difference_ptr(const List *list1, const List *list2) { const ListCell *cell; List *result = NIL; Assert(IsPointerList(list1)); Assert(IsPointerList(list2)); if (list2 == NIL) return list_copy(list1); foreach(cell, list1) { if (!list_member_ptr(list2, lfirst(cell))) result = lappend(result, lfirst(cell)); } check_list_invariants(result); return result; } /* * This variant of list_difference() operates upon lists of integers. */ List * list_difference_int(const List *list1, const List *list2) { const ListCell *cell; List *result = NIL; Assert(IsIntegerList(list1)); Assert(IsIntegerList(list2)); if (list2 == NIL) return list_copy(list1); foreach(cell, list1) { if (!list_member_int(list2, lfirst_int(cell))) result = lappend_int(result, lfirst_int(cell)); } check_list_invariants(result); return result; } /* * This variant of list_difference() operates upon lists of OIDs. */ List * list_difference_oid(const List *list1, const List *list2) { const ListCell *cell; List *result = NIL; Assert(IsOidList(list1)); Assert(IsOidList(list2)); if (list2 == NIL) return list_copy(list1); foreach(cell, list1) { if (!list_member_oid(list2, lfirst_oid(cell))) result = lappend_oid(result, lfirst_oid(cell)); } check_list_invariants(result); return result; } #ifdef NOT_USED_IN_PGPOOL /* * Append datum to list, but only if it isn't already in the list. * * Whether an element is already a member of the list is determined * via equal(). */ List * list_append_unique(List *list, void *datum) { if (list_member(list, datum)) return list; else return lappend(list, datum); } #endif /*NOT_USED_IN_PGPOOL*/ /* * This variant of list_append_unique() determines list membership via * simple pointer equality. */ List * list_append_unique_ptr(List *list, void *datum) { if (list_member_ptr(list, datum)) return list; else return lappend(list, datum); } /* * This variant of list_append_unique() operates upon lists of integers. */ List * list_append_unique_int(List *list, int datum) { if (list_member_int(list, datum)) return list; else return lappend_int(list, datum); } /* * This variant of list_append_unique() operates upon lists of OIDs. */ List * list_append_unique_oid(List *list, Oid datum) { if (list_member_oid(list, datum)) return list; else return lappend_oid(list, datum); } #ifdef NOT_USED_IN_PGPOOL /* * Append to list1 each member of list2 that isn't already in list1. * * Whether an element is already a member of the list is determined * via equal(). * * This is almost the same functionality as list_union(), but list1 is * modified in-place rather than being copied. Note also that list2's cells * are not inserted in list1, so the analogy to list_concat() isn't perfect. */ List * list_concat_unique(List *list1, List *list2) { ListCell *cell; Assert(IsPointerList(list1)); Assert(IsPointerList(list2)); foreach(cell, list2) { if (!list_member(list1, lfirst(cell))) list1 = lappend(list1, lfirst(cell)); } check_list_invariants(list1); return list1; } #endif /*NOT_USED_IN_PGPOOL*/ /* * This variant of list_concat_unique() determines list membership via * simple pointer equality. */ List * list_concat_unique_ptr(List *list1, List *list2) { ListCell *cell; Assert(IsPointerList(list1)); Assert(IsPointerList(list2)); foreach(cell, list2) { if (!list_member_ptr(list1, lfirst(cell))) list1 = lappend(list1, lfirst(cell)); } check_list_invariants(list1); return list1; } /* * This variant of list_concat_unique() operates upon lists of integers. */ List * list_concat_unique_int(List *list1, List *list2) { ListCell *cell; Assert(IsIntegerList(list1)); Assert(IsIntegerList(list2)); foreach(cell, list2) { if (!list_member_int(list1, lfirst_int(cell))) list1 = lappend_int(list1, lfirst_int(cell)); } check_list_invariants(list1); return list1; } /* * This variant of list_concat_unique() operates upon lists of OIDs. */ List * list_concat_unique_oid(List *list1, List *list2) { ListCell *cell; Assert(IsOidList(list1)); Assert(IsOidList(list2)); foreach(cell, list2) { if (!list_member_oid(list1, lfirst_oid(cell))) list1 = lappend_oid(list1, lfirst_oid(cell)); } check_list_invariants(list1); return list1; } /* * Free all storage in a list, and optionally the pointed-to elements */ static void list_free_private(List *list, bool deep) { ListCell *cell; check_list_invariants(list); cell = list_head(list); while (cell != NULL) { ListCell *tmp = cell; cell = lnext(cell); if (deep) pfree(lfirst(tmp)); pfree(tmp); } if (list) pfree(list); } /* * Free all the cells of the list, as well as the list itself. Any * objects that are pointed-to by the cells of the list are NOT * free'd. * * On return, the argument to this function has been freed, so the * caller would be wise to set it to NIL for safety's sake. */ void list_free(List *list) { list_free_private(list, false); } /* * Free all the cells of the list, the list itself, and all the * objects pointed-to by the cells of the list (each element in the * list must contain a pointer to a palloc()'d region of memory!) * * On return, the argument to this function has been freed, so the * caller would be wise to set it to NIL for safety's sake. */ void list_free_deep(List *list) { /* * A "deep" free operation only makes sense on a list of pointers. */ Assert(IsPointerList(list)); list_free_private(list, true); } /* * Return a shallow copy of the specified list. */ List * list_copy(const List *oldlist) { List *newlist; ListCell *newlist_prev; ListCell *oldlist_cur; if (oldlist == NIL) return NIL; newlist = new_list(oldlist->type); newlist->length = oldlist->length; /* * Copy over the data in the first cell; new_list() has already allocated * the head cell itself */ newlist->head->data = oldlist->head->data; newlist_prev = newlist->head; oldlist_cur = oldlist->head->next; while (oldlist_cur) { ListCell *newlist_cur; newlist_cur = (ListCell *) palloc(sizeof(*newlist_cur)); newlist_cur->data = oldlist_cur->data; newlist_prev->next = newlist_cur; newlist_prev = newlist_cur; oldlist_cur = oldlist_cur->next; } newlist_prev->next = NULL; newlist->tail = newlist_prev; check_list_invariants(newlist); return newlist; } /* * Return a shallow copy of the specified list, without the first N elements. */ List * list_copy_tail(const List *oldlist, int nskip) { List *newlist; ListCell *newlist_prev; ListCell *oldlist_cur; if (nskip < 0) nskip = 0; /* would it be better to elog? */ if (oldlist == NIL || nskip >= oldlist->length) return NIL; newlist = new_list(oldlist->type); newlist->length = oldlist->length - nskip; /* * Skip over the unwanted elements. */ oldlist_cur = oldlist->head; while (nskip-- > 0) oldlist_cur = oldlist_cur->next; /* * Copy over the data in the first remaining cell; new_list() has already * allocated the head cell itself */ newlist->head->data = oldlist_cur->data; newlist_prev = newlist->head; oldlist_cur = oldlist_cur->next; while (oldlist_cur) { ListCell *newlist_cur; newlist_cur = (ListCell *) palloc(sizeof(*newlist_cur)); newlist_cur->data = oldlist_cur->data; newlist_prev->next = newlist_cur; newlist_prev = newlist_cur; oldlist_cur = oldlist_cur->next; } newlist_prev->next = NULL; newlist->tail = newlist_prev; check_list_invariants(newlist); return newlist; } /* * Temporary compatibility functions * * In order to avoid warnings for these function definitions, we need * to include a prototype here as well as in pg_list.h. That's because * we don't enable list API compatibility in list.c, so we * don't see the prototypes for these functions. */ /* * Given a list, return its length. This is merely defined for the * sake of backward compatibility: we can't afford to define a macro * called "length", so it must be a function. New code should use the * list_length() macro in order to avoid the overhead of a function * call. */ int length(const List *list); int length(const List *list) { return list_length(list); } pgpool-II-3.4.3/src/parser/pool_string.c0000664000076400007640000000435712554350605015057 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * Copyright (c) 2006-2008, pgpool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation, and that the name of the * author not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. The author makes no representations about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. */ #include "pool.h" #include "pool_parser.h" #include #include #include #include "utils/palloc.h" #include "pool_string.h" #include "value.h" /* String Library */ String *init_string(char *str) { String *string = palloc(sizeof(String)); int size; string->len = (str != NULL)? strlen(str): 0; size = (string->len + 1) / STRING_SIZE + 1; string->size = size; string->data = palloc(STRING_SIZE * size); memset(string->data, 0, STRING_SIZE * size); if (str != NULL) memcpy(string->data, str, string->len); return string; } void string_append_string(String *string, String *data) { string_append_char(string, data->data); } void string_append_char(String *string, char *append_data) { int len = strlen(append_data); if (string->len + len + 1 > string->size * STRING_SIZE) { int size, old_size; size = (string->len + len + 1) / STRING_SIZE + 1; old_size = string->size; string->size = size; string->data = repalloc(string->data, string->size * STRING_SIZE); memset(string->data + (old_size * STRING_SIZE), 0, STRING_SIZE * (string->size - old_size)); } memcpy(string->data + string->len, append_data, len); string->len += len; } void free_string(String *string) { pfree(string->data); pfree(string); } String *copy_string(String *string) { String *copy = palloc(sizeof(String)); copy->size = string->size; copy->len = string->len; copy->data = palloc(string->size * STRING_SIZE); memcpy(copy->data, string->data, string->size * STRING_SIZE); return copy; } pgpool-II-3.4.3/src/parser/snprintf.c0000664000076400007640000006034012554350605014355 00000000000000/* * Copyright (c) 1983, 1995, 1996 Eric P. Allman * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * src/port/snprintf.c */ /* #include "c.h" #include #ifndef WIN32 #include #endif #include */ #ifndef NL_ARGMAX #define NL_ARGMAX 16 #endif #include #include #include #include #include #include #include #include "pool_parser.h" #include "stringinfo.h" #include "utils/palloc.h" /* --------------------------------------------------------------------- */ /* c.h */ /* --------------------------------------------------------------------- */ /* Get a bit mask of the bits set in non-long aligned addresses */ #define LONG_ALIGN_MASK (sizeof(long) - 1) #define MEMSET_LOOP_LIMIT 1024 /* * MemSet * Exactly the same as standard library function memset(), but considerably * faster for zeroing small word-aligned structures (such as parsetree nodes). * This has to be a macro because the main point is to avoid function-call * overhead. However, we have also found that the loop is faster than * native libc memset() on some platforms, even those with assembler * memset() functions. More research needs to be done, perhaps with * MEMSET_LOOP_LIMIT tests in configure. */ #define MemSet(start, val, len) \ do \ { \ /* must be void* because we don't know if it is integer aligned yet */ \ void *_vstart = (void *) (start); \ int _val = (val); \ Size _len = (len); \ \ if ((((intptr_t) _vstart) & LONG_ALIGN_MASK) == 0 && \ (_len & LONG_ALIGN_MASK) == 0 && \ _val == 0 && \ _len <= MEMSET_LOOP_LIMIT && \ /* \ * If MEMSET_LOOP_LIMIT == 0, optimizer should find \ * the whole "if" false at compile time. \ */ \ MEMSET_LOOP_LIMIT != 0) \ { \ long *_start = (long *) _vstart; \ long *_stop = (long *) ((char *) _start + _len); \ while (_start < _stop) \ *_start++ = 0; \ } \ else \ memset(_vstart, _val, _len); \ } while (0) /* * SNPRINTF, VSNPRINTF and friends * * These versions have been grabbed off the net. They have been * cleaned up to compile properly and support for most of the Single Unix * Specification has been added. Remaining unimplemented features are: * * 1. No locale support: the radix character is always '.' and the ' * (single quote) format flag is ignored. * * 2. No support for the "%n" format specification. * * 3. No support for wide characters ("lc" and "ls" formats). * * 4. No support for "long double" ("Lf" and related formats). * * 5. Space and '#' flags are not implemented. * * * The result values of these functions are not the same across different * platforms. This implementation is compatible with the Single Unix Spec: * * 1. -1 is returned only if processing is abandoned due to an invalid * parameter, such as incorrect format string. (Although not required by * the spec, this happens only when no characters have yet been transmitted * to the destination.) * * 2. For snprintf and sprintf, 0 is returned if str == NULL or count == 0; * no data has been stored. * * 3. Otherwise, the number of bytes actually transmitted to the destination * is returned (excluding the trailing '\0' for snprintf and sprintf). * * For snprintf with nonzero count, the result cannot be more than count-1 * (a trailing '\0' is always stored); it is not possible to distinguish * buffer overrun from exact fit. This is unlike some implementations that * return the number of bytes that would have been needed for the complete * result string. */ /************************************************************** * Original: * Patrick Powell Tue Apr 11 09:48:21 PDT 1995 * A bombproof version of doprnt (dopr) included. * Sigh. This sort of thing is always nasty do deal with. Note that * the version here does not include floating point. (now it does ... tgl) **************************************************************/ /* Prevent recursion */ #undef vsnprintf #undef snprintf #undef sprintf #undef vfprintf #undef fprintf #undef printf /* Info about where the formatted output is going */ typedef struct { char *bufptr; /* next buffer output position */ char *bufstart; /* first buffer element */ char *bufend; /* last buffer element, or NULL */ /* bufend == NULL is for sprintf, where we assume buf is big enough */ FILE *stream; /* eventual output destination, or NULL */ int nchars; /* # chars already sent to stream */ } PrintfTarget; /* * Info about the type and value of a formatting parameter. Note that we * don't currently support "long double", "wint_t", or "wchar_t *" data, * nor the '%n' formatting code; else we'd need more types. Also, at this * level we need not worry about signed vs unsigned values. */ typedef enum { ATYPE_NONE = 0, ATYPE_INT, ATYPE_LONG, ATYPE_LONGLONG, ATYPE_DOUBLE, ATYPE_CHARPTR } PrintfArgType; typedef union { int i; long l; int64 ll; double d; char *cptr; } PrintfArgValue; static void flushbuffer(PrintfTarget *target); static int dopr(PrintfTarget *target, const char *format, va_list args); int pg_vsnprintf(char *str, size_t count, const char *fmt, va_list args) { PrintfTarget target; if (str == NULL || count == 0) return 0; target.bufstart = target.bufptr = str; target.bufend = str + count - 1; target.stream = NULL; /* target.nchars is unused in this case */ if (dopr(&target, fmt, args)) { *(target.bufptr) = '\0'; errno = EINVAL; /* bad format */ return -1; } *(target.bufptr) = '\0'; return target.bufptr - target.bufstart; } #if 0 int pg_snprintf(char *str, size_t count, const char *fmt,...) { int len; va_list args; va_start(args, fmt); len = pg_vsnprintf(str, count, fmt, args); va_end(args); return len; } static int pg_vsprintf(char *str, const char *fmt, va_list args) { PrintfTarget target; if (str == NULL) return 0; target.bufstart = target.bufptr = str; target.bufend = NULL; target.stream = NULL; /* target.nchars is unused in this case */ if (dopr(&target, fmt, args)) { *(target.bufptr) = '\0'; errno = EINVAL; /* bad format */ return -1; } *(target.bufptr) = '\0'; return target.bufptr - target.bufstart; } int pg_sprintf(char *str, const char *fmt,...) { int len; va_list args; va_start(args, fmt); len = pg_vsprintf(str, fmt, args); va_end(args); return len; } int pg_vfprintf(FILE *stream, const char *fmt, va_list args) { PrintfTarget target; char buffer[1024]; /* size is arbitrary */ if (stream == NULL) { errno = EINVAL; return -1; } target.bufstart = target.bufptr = buffer; target.bufend = buffer + sizeof(buffer) - 1; target.stream = stream; target.nchars = 0; if (dopr(&target, fmt, args)) { errno = EINVAL; /* bad format */ return -1; } /* dump any remaining buffer contents */ flushbuffer(&target); return target.nchars; } int pg_fprintf(FILE *stream, const char *fmt,...) { int len; va_list args; va_start(args, fmt); len = pg_vfprintf(stream, fmt, args); va_end(args); return len; } int pg_printf(const char *fmt,...) { int len; va_list args; va_start(args, fmt); len = pg_vfprintf(stdout, fmt, args); va_end(args); return len; } #endif /* call this only when stream is defined */ static void flushbuffer(PrintfTarget *target) { size_t nc = target->bufptr - target->bufstart; if (nc > 0) target->nchars += fwrite(target->bufstart, 1, nc, target->stream); target->bufptr = target->bufstart; } static void fmtstr(char *value, int leftjust, int minlen, int maxwidth, int pointflag, PrintfTarget *target); static void fmtptr(void *value, PrintfTarget *target); static void fmtint(int64 value, char type, int forcesign, int leftjust, int minlen, int zpad, int precision, int pointflag, PrintfTarget *target); static void fmtchar(int value, int leftjust, int minlen, PrintfTarget *target); static void fmtfloat(double value, char type, int forcesign, int leftjust, int minlen, int zpad, int precision, int pointflag, PrintfTarget *target); static void dostr(const char *str, int slen, PrintfTarget *target); static void dopr_outch(int c, PrintfTarget *target); static int adjust_sign(int is_negative, int forcesign, int *signvalue); static void adjust_padlen(int minlen, int vallen, int leftjust, int *padlen); static void leading_pad(int zpad, int *signvalue, int *padlen, PrintfTarget *target); static void trailing_pad(int *padlen, PrintfTarget *target); /* * dopr(): poor man's version of doprintf */ static int dopr(PrintfTarget *target, const char *format, va_list args) { const char *format_start = format; int ch; bool have_dollar; bool have_non_dollar; bool have_star; bool afterstar; int accum; int longlongflag; int longflag; int pointflag; int leftjust; int fieldwidth; int precision; int zpad; int forcesign; int last_dollar; int fmtpos; int cvalue; int64 numvalue; double fvalue; char *strvalue; int i; PrintfArgType argtypes[NL_ARGMAX + 1]; PrintfArgValue argvalues[NL_ARGMAX + 1]; /* * Parse the format string to determine whether there are %n$ format * specs, and identify the types and order of the format parameters. */ have_dollar = have_non_dollar = false; last_dollar = 0; MemSet(argtypes, 0, sizeof(argtypes)); while ((ch = *format++) != '\0') { if (ch != '%') continue; longflag = longlongflag = pointflag = 0; fmtpos = accum = 0; afterstar = false; nextch1: ch = *format++; if (ch == '\0') break; /* illegal, but we don't complain */ switch (ch) { case '-': case '+': goto nextch1; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': accum = accum * 10 + (ch - '0'); goto nextch1; case '.': pointflag = 1; accum = 0; goto nextch1; case '*': if (afterstar) have_non_dollar = true; /* multiple stars */ afterstar = true; accum = 0; goto nextch1; case '$': have_dollar = true; if (accum <= 0 || accum > NL_ARGMAX) return -1; if (afterstar) { if (argtypes[accum] && argtypes[accum] != ATYPE_INT) return -1; argtypes[accum] = ATYPE_INT; last_dollar = Max(last_dollar, accum); afterstar = false; } else fmtpos = accum; accum = 0; goto nextch1; case 'l': if (longflag) longlongflag = 1; else longflag = 1; goto nextch1; case 'h': case '\'': /* ignore these */ goto nextch1; case 'd': case 'i': case 'o': case 'u': case 'x': case 'X': if (fmtpos) { PrintfArgType atype; if (longlongflag) atype = ATYPE_LONGLONG; else if (longflag) atype = ATYPE_LONG; else atype = ATYPE_INT; if (argtypes[fmtpos] && argtypes[fmtpos] != atype) return -1; argtypes[fmtpos] = atype; last_dollar = Max(last_dollar, fmtpos); } else have_non_dollar = true; break; case 'c': if (fmtpos) { if (argtypes[fmtpos] && argtypes[fmtpos] != ATYPE_INT) return -1; argtypes[fmtpos] = ATYPE_INT; last_dollar = Max(last_dollar, fmtpos); } else have_non_dollar = true; break; case 's': case 'p': if (fmtpos) { if (argtypes[fmtpos] && argtypes[fmtpos] != ATYPE_CHARPTR) return -1; argtypes[fmtpos] = ATYPE_CHARPTR; last_dollar = Max(last_dollar, fmtpos); } else have_non_dollar = true; break; case 'e': case 'E': case 'f': case 'g': case 'G': if (fmtpos) { if (argtypes[fmtpos] && argtypes[fmtpos] != ATYPE_DOUBLE) return -1; argtypes[fmtpos] = ATYPE_DOUBLE; last_dollar = Max(last_dollar, fmtpos); } else have_non_dollar = true; break; case '%': break; } /* * If we finish the spec with afterstar still set, there's a * non-dollar star in there. */ if (afterstar) have_non_dollar = true; } /* Per spec, you use either all dollar or all not. */ if (have_dollar && have_non_dollar) return -1; /* * In dollar mode, collect the arguments in physical order. */ for (i = 1; i <= last_dollar; i++) { switch (argtypes[i]) { case ATYPE_NONE: return -1; /* invalid format */ case ATYPE_INT: argvalues[i].i = va_arg(args, int); break; case ATYPE_LONG: argvalues[i].l = va_arg(args, long); break; case ATYPE_LONGLONG: argvalues[i].ll = va_arg(args, int64); break; case ATYPE_DOUBLE: argvalues[i].d = va_arg(args, double); break; case ATYPE_CHARPTR: argvalues[i].cptr = va_arg(args, char *); break; } } /* * At last we can parse the format for real. */ format = format_start; while ((ch = *format++) != '\0') { if (ch != '%') { dopr_outch(ch, target); continue; } fieldwidth = precision = zpad = leftjust = forcesign = 0; longflag = longlongflag = pointflag = 0; fmtpos = accum = 0; have_star = afterstar = false; nextch2: ch = *format++; if (ch == '\0') break; /* illegal, but we don't complain */ switch (ch) { case '-': leftjust = 1; goto nextch2; case '+': forcesign = 1; goto nextch2; case '0': /* set zero padding if no nonzero digits yet */ if (accum == 0 && !pointflag) zpad = '0'; /* FALL THRU */ case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': accum = accum * 10 + (ch - '0'); goto nextch2; case '.': if (have_star) have_star = false; else fieldwidth = accum; pointflag = 1; accum = 0; goto nextch2; case '*': if (have_dollar) { /* process value after reading n$ */ afterstar = true; } else { /* fetch and process value now */ int starval = va_arg(args, int); if (pointflag) { precision = starval; if (precision < 0) { precision = 0; pointflag = 0; } } else { fieldwidth = starval; if (fieldwidth < 0) { leftjust = 1; fieldwidth = -fieldwidth; } } } have_star = true; accum = 0; goto nextch2; case '$': if (afterstar) { /* fetch and process star value */ int starval = argvalues[accum].i; if (pointflag) { precision = starval; if (precision < 0) { precision = 0; pointflag = 0; } } else { fieldwidth = starval; if (fieldwidth < 0) { leftjust = 1; fieldwidth = -fieldwidth; } } afterstar = false; } else fmtpos = accum; accum = 0; goto nextch2; case 'l': if (longflag) longlongflag = 1; else longflag = 1; goto nextch2; case 'h': case '\'': /* ignore these */ goto nextch2; case 'd': case 'i': if (!have_star) { if (pointflag) precision = accum; else fieldwidth = accum; } if (have_dollar) { if (longlongflag) numvalue = argvalues[fmtpos].ll; else if (longflag) numvalue = argvalues[fmtpos].l; else numvalue = argvalues[fmtpos].i; } else { if (longlongflag) numvalue = va_arg(args, int64); else if (longflag) numvalue = va_arg(args, long); else numvalue = va_arg(args, int); } fmtint(numvalue, ch, forcesign, leftjust, fieldwidth, zpad, precision, pointflag, target); break; case 'o': case 'u': case 'x': case 'X': if (!have_star) { if (pointflag) precision = accum; else fieldwidth = accum; } if (have_dollar) { if (longlongflag) numvalue = (uint64) argvalues[fmtpos].ll; else if (longflag) numvalue = (unsigned long) argvalues[fmtpos].l; else numvalue = (unsigned int) argvalues[fmtpos].i; } else { if (longlongflag) numvalue = (uint64) va_arg(args, int64); else if (longflag) numvalue = (unsigned long) va_arg(args, long); else numvalue = (unsigned int) va_arg(args, int); } fmtint(numvalue, ch, forcesign, leftjust, fieldwidth, zpad, precision, pointflag, target); break; case 'c': if (!have_star) { if (pointflag) precision = accum; else fieldwidth = accum; } if (have_dollar) cvalue = (unsigned char) argvalues[fmtpos].i; else cvalue = (unsigned char) va_arg(args, int); fmtchar(cvalue, leftjust, fieldwidth, target); break; case 's': if (!have_star) { if (pointflag) precision = accum; else fieldwidth = accum; } if (have_dollar) strvalue = argvalues[fmtpos].cptr; else strvalue = va_arg(args, char *); fmtstr(strvalue, leftjust, fieldwidth, precision, pointflag, target); break; case 'p': /* fieldwidth/leftjust are ignored ... */ if (have_dollar) strvalue = argvalues[fmtpos].cptr; else strvalue = va_arg(args, char *); fmtptr((void *) strvalue, target); break; case 'e': case 'E': case 'f': case 'g': case 'G': if (!have_star) { if (pointflag) precision = accum; else fieldwidth = accum; } if (have_dollar) fvalue = argvalues[fmtpos].d; else fvalue = va_arg(args, double); fmtfloat(fvalue, ch, forcesign, leftjust, fieldwidth, zpad, precision, pointflag, target); break; case '%': dopr_outch('%', target); break; } } return 0; } static size_t pg_strnlen(const char *str, size_t maxlen) { const char *p = str; while (maxlen-- > 0 && *p) p++; return p - str; } static void fmtstr(char *value, int leftjust, int minlen, int maxwidth, int pointflag, PrintfTarget *target) { int padlen, vallen; /* amount to pad */ /* * If a maxwidth (precision) is specified, we must not fetch more bytes * than that. */ if (pointflag) vallen = pg_strnlen(value, maxwidth); else vallen = strlen(value); adjust_padlen(minlen, vallen, leftjust, &padlen); while (padlen > 0) { dopr_outch(' ', target); --padlen; } dostr(value, vallen, target); trailing_pad(&padlen, target); } static void fmtptr(void *value, PrintfTarget *target) { int vallen; char convert[64]; /* we rely on regular C library's sprintf to do the basic conversion */ vallen = sprintf(convert, "%p", value); dostr(convert, vallen, target); } static void fmtint(int64 value, char type, int forcesign, int leftjust, int minlen, int zpad, int precision, int pointflag, PrintfTarget *target) { uint64 base; int dosign; const char *cvt = "0123456789abcdef"; int signvalue = 0; char convert[64]; int vallen = 0; int padlen = 0; /* amount to pad */ int zeropad; /* extra leading zeroes */ switch (type) { case 'd': case 'i': base = 10; dosign = 1; break; case 'o': base = 8; dosign = 0; break; case 'u': base = 10; dosign = 0; break; case 'x': base = 16; dosign = 0; break; case 'X': cvt = "0123456789ABCDEF"; base = 16; dosign = 0; break; default: return; /* keep compiler quiet */ } /* Handle +/- */ if (dosign && adjust_sign((value < 0), forcesign, &signvalue)) value = -value; /* * SUS: the result of converting 0 with an explicit precision of 0 is no * characters */ if (value == 0 && pointflag && precision == 0) vallen = 0; else { /* make integer string */ uint64 uvalue = (uint64) value; do { convert[vallen++] = cvt[uvalue % base]; uvalue = uvalue / base; } while (uvalue); } zeropad = Max(0, precision - vallen); adjust_padlen(minlen, vallen + zeropad, leftjust, &padlen); leading_pad(zpad, &signvalue, &padlen, target); while (zeropad-- > 0) dopr_outch('0', target); while (vallen > 0) dopr_outch(convert[--vallen], target); trailing_pad(&padlen, target); } static void fmtchar(int value, int leftjust, int minlen, PrintfTarget *target) { int padlen = 0; /* amount to pad */ adjust_padlen(minlen, 1, leftjust, &padlen); while (padlen > 0) { dopr_outch(' ', target); --padlen; } dopr_outch(value, target); trailing_pad(&padlen, target); } static void fmtfloat(double value, char type, int forcesign, int leftjust, int minlen, int zpad, int precision, int pointflag, PrintfTarget *target) { int signvalue = 0; int vallen; char fmt[32]; char convert[512]; int padlen = 0; /* amount to pad */ /* we rely on regular C library's sprintf to do the basic conversion */ if (pointflag) sprintf(fmt, "%%.%d%c", precision, type); else sprintf(fmt, "%%%c", type); if (adjust_sign((value < 0), forcesign, &signvalue)) value = -value; vallen = sprintf(convert, fmt, value); adjust_padlen(minlen, vallen, leftjust, &padlen); leading_pad(zpad, &signvalue, &padlen, target); dostr(convert, vallen, target); trailing_pad(&padlen, target); } static void dostr(const char *str, int slen, PrintfTarget *target) { while (slen > 0) { int avail; if (target->bufend != NULL) avail = target->bufend - target->bufptr; else avail = slen; if (avail <= 0) { /* buffer full, can we dump to stream? */ if (target->stream == NULL) return; /* no, lose the data */ flushbuffer(target); continue; } avail = Min(avail, slen); memmove(target->bufptr, str, avail); target->bufptr += avail; str += avail; slen -= avail; } } static void dopr_outch(int c, PrintfTarget *target) { if (target->bufend != NULL && target->bufptr >= target->bufend) { /* buffer full, can we dump to stream? */ if (target->stream == NULL) return; /* no, lose the data */ flushbuffer(target); } *(target->bufptr++) = c; } static int adjust_sign(int is_negative, int forcesign, int *signvalue) { if (is_negative) { *signvalue = '-'; return true; } else if (forcesign) *signvalue = '+'; return false; } static void adjust_padlen(int minlen, int vallen, int leftjust, int *padlen) { *padlen = minlen - vallen; if (*padlen < 0) *padlen = 0; if (leftjust) *padlen = -(*padlen); } static void leading_pad(int zpad, int *signvalue, int *padlen, PrintfTarget *target) { if (*padlen > 0 && zpad) { if (*signvalue) { dopr_outch(*signvalue, target); --(*padlen); *signvalue = 0; } while (*padlen > 0) { dopr_outch(zpad, target); --(*padlen); } } while (*padlen > (*signvalue != 0)) { dopr_outch(' ', target); --(*padlen); } if (*signvalue) { dopr_outch(*signvalue, target); if (*padlen > 0) --(*padlen); else if (*padlen < 0) ++(*padlen); } } static void trailing_pad(int *padlen, PrintfTarget *target) { while (*padlen < 0) { dopr_outch(' ', target); ++(*padlen); } } pgpool-II-3.4.3/src/parser/value.c0000664000076400007640000000234712554350605013631 00000000000000/*------------------------------------------------------------------------- * * value.c * implementation of Value nodes * * * Portions Copyright (c) 2003-2013, PgPool Global Development Group * Copyright (c) 2003-2012, PostgreSQL Global Development Group * * * IDENTIFICATION * src/backend/nodes/value.c * *------------------------------------------------------------------------- */ /*#include "postgres.h"*/ #include #include "parsenodes.h" #include "utils/palloc.h" /* * makeInteger */ Value * makeInteger(long i) { Value *v = makeNode(Value); v->type = T_Integer; v->val.ival = i; return v; } /* * makeFloat * * Caller is responsible for passing a palloc'd string. */ Value * makeFloat(char *numericStr) { Value *v = makeNode(Value); v->type = T_Float; v->val.str = numericStr; return v; } /* * makeString * * Caller is responsible for passing a palloc'd string. */ Value * makeString(char *str) { Value *v = makeNode(Value); v->type = T_String; v->val.str = str; return v; } /* * makeBitString * * Caller is responsible for passing a palloc'd string. */ Value * makeBitString(char *str) { Value *v = makeNode(Value); v->type = T_BitString; v->val.str = str; return v; } pgpool-II-3.4.3/src/parser/wchar.c0000664000076400007640000013470012554350605013620 00000000000000/* * conversion functions between pg_wchar and multibyte streams. * Tatsuo Ishii * src/backend/utils/mb/wchar.c * */ /* can be used in either frontend or backend */ #include "pool_parser.h" #include "utils/elog.h" #include #include #include "pg_wchar.h" #ifndef WIN32 #define DEF_ENC2NAME(name, codepage) { #name, PG_##name } #else #define DEF_ENC2NAME(name, codepage) { #name, PG_##name, codepage } #endif const pg_enc2name pg_enc2name_tbl[] = { DEF_ENC2NAME(SQL_ASCII, 0), DEF_ENC2NAME(EUC_JP, 20932), DEF_ENC2NAME(EUC_CN, 20936), DEF_ENC2NAME(EUC_KR, 51949), DEF_ENC2NAME(EUC_TW, 0), DEF_ENC2NAME(EUC_JIS_2004, 20932), DEF_ENC2NAME(UTF8, 65001), DEF_ENC2NAME(MULE_INTERNAL, 0), DEF_ENC2NAME(LATIN1, 28591), DEF_ENC2NAME(LATIN2, 28592), DEF_ENC2NAME(LATIN3, 28593), DEF_ENC2NAME(LATIN4, 28594), DEF_ENC2NAME(LATIN5, 28599), DEF_ENC2NAME(LATIN6, 0), DEF_ENC2NAME(LATIN7, 0), DEF_ENC2NAME(LATIN8, 0), DEF_ENC2NAME(LATIN9, 28605), DEF_ENC2NAME(LATIN10, 0), DEF_ENC2NAME(WIN1256, 1256), DEF_ENC2NAME(WIN1258, 1258), DEF_ENC2NAME(WIN866, 866), DEF_ENC2NAME(WIN874, 874), DEF_ENC2NAME(KOI8R, 20866), DEF_ENC2NAME(WIN1251, 1251), DEF_ENC2NAME(WIN1252, 1252), DEF_ENC2NAME(ISO_8859_5, 28595), DEF_ENC2NAME(ISO_8859_6, 28596), DEF_ENC2NAME(ISO_8859_7, 28597), DEF_ENC2NAME(ISO_8859_8, 28598), DEF_ENC2NAME(WIN1250, 1250), DEF_ENC2NAME(WIN1253, 1253), DEF_ENC2NAME(WIN1254, 1254), DEF_ENC2NAME(WIN1255, 1255), DEF_ENC2NAME(WIN1257, 1257), DEF_ENC2NAME(KOI8U, 21866), DEF_ENC2NAME(SJIS, 932), DEF_ENC2NAME(BIG5, 950), DEF_ENC2NAME(GBK, 936), DEF_ENC2NAME(UHC, 0), DEF_ENC2NAME(GB18030, 54936), DEF_ENC2NAME(JOHAB, 0), DEF_ENC2NAME(SHIFT_JIS_2004, 932) }; /* ---------- * These are encoding names for gettext. * * This covers all encodings except MULE_INTERNAL, which is alien to gettext. * ---------- */ const pg_enc2gettext pg_enc2gettext_tbl[] = { {PG_SQL_ASCII, "US-ASCII"}, {PG_UTF8, "UTF-8"}, {PG_LATIN1, "LATIN1"}, {PG_LATIN2, "LATIN2"}, {PG_LATIN3, "LATIN3"}, {PG_LATIN4, "LATIN4"}, {PG_ISO_8859_5, "ISO-8859-5"}, {PG_ISO_8859_6, "ISO_8859-6"}, {PG_ISO_8859_7, "ISO-8859-7"}, {PG_ISO_8859_8, "ISO-8859-8"}, {PG_LATIN5, "LATIN5"}, {PG_LATIN6, "LATIN6"}, {PG_LATIN7, "LATIN7"}, {PG_LATIN8, "LATIN8"}, {PG_LATIN9, "LATIN-9"}, {PG_LATIN10, "LATIN10"}, {PG_KOI8R, "KOI8-R"}, {PG_KOI8U, "KOI8-U"}, {PG_WIN1250, "CP1250"}, {PG_WIN1251, "CP1251"}, {PG_WIN1252, "CP1252"}, {PG_WIN1253, "CP1253"}, {PG_WIN1254, "CP1254"}, {PG_WIN1255, "CP1255"}, {PG_WIN1256, "CP1256"}, {PG_WIN1257, "CP1257"}, {PG_WIN1258, "CP1258"}, {PG_WIN866, "CP866"}, {PG_WIN874, "CP874"}, {PG_EUC_CN, "EUC-CN"}, {PG_EUC_JP, "EUC-JP"}, {PG_EUC_KR, "EUC-KR"}, {PG_EUC_TW, "EUC-TW"}, {PG_EUC_JIS_2004, "EUC-JP"}, {PG_SJIS, "SHIFT-JIS"}, {PG_BIG5, "BIG5"}, {PG_GBK, "GBK"}, {PG_UHC, "UHC"}, {PG_GB18030, "GB18030"}, {PG_JOHAB, "JOHAB"}, {PG_SHIFT_JIS_2004, "SHIFT_JISX0213"}, {0, NULL} }; /* * conversion to pg_wchar is done by "table driven." * to add an encoding support, define mb2wchar_with_len(), mblen(), dsplen() * for the particular encoding. Note that if the encoding is only * supported in the client, you don't need to define * mb2wchar_with_len() function (SJIS is the case). * * These functions generally assume that their input is validly formed. * The "verifier" functions, further down in the file, have to be more * paranoid. We expect that mblen() does not need to examine more than * the first byte of the character to discover the correct length. * * Note: for the display output of psql to work properly, the return values * of the dsplen functions must conform to the Unicode standard. In particular * the NUL character is zero width and control characters are generally * width -1. It is recommended that non-ASCII encodings refer their ASCII * subset to the ASCII routines to ensure consistency. */ /* * SQL/ASCII */ static int pg_ascii2wchar_with_len(const unsigned char *from, pg_wchar *to, int len) { int cnt = 0; while (len > 0 && *from) { *to++ = *from++; len--; cnt++; } *to = 0; return cnt; } static int pg_ascii_mblen(const unsigned char *s) { return 1; } static int pg_ascii_dsplen(const unsigned char *s) { if (*s == '\0') return 0; if (*s < 0x20 || *s == 0x7f) return -1; return 1; } /* * EUC */ static int pg_euc2wchar_with_len(const unsigned char *from, pg_wchar *to, int len) { int cnt = 0; while (len > 0 && *from) { if (*from == SS2 && len >= 2) /* JIS X 0201 (so called "1 byte * KANA") */ { from++; *to = (SS2 << 8) | *from++; len -= 2; } else if (*from == SS3 && len >= 3) /* JIS X 0212 KANJI */ { from++; *to = (SS3 << 16) | (*from++ << 8); *to |= *from++; len -= 3; } else if (IS_HIGHBIT_SET(*from) && len >= 2) /* JIS X 0208 KANJI */ { *to = *from++ << 8; *to |= *from++; len -= 2; } else /* must be ASCII */ { *to = *from++; len--; } to++; cnt++; } *to = 0; return cnt; } static inline int pg_euc_mblen(const unsigned char *s) { int len; if (*s == SS2) len = 2; else if (*s == SS3) len = 3; else if (IS_HIGHBIT_SET(*s)) len = 2; else len = 1; return len; } static inline int pg_euc_dsplen(const unsigned char *s) { int len; if (*s == SS2) len = 2; else if (*s == SS3) len = 2; else if (IS_HIGHBIT_SET(*s)) len = 2; else len = pg_ascii_dsplen(s); return len; } /* * EUC_JP */ static int pg_eucjp2wchar_with_len(const unsigned char *from, pg_wchar *to, int len) { return pg_euc2wchar_with_len(from, to, len); } static int pg_eucjp_mblen(const unsigned char *s) { return pg_euc_mblen(s); } static int pg_eucjp_dsplen(const unsigned char *s) { int len; if (*s == SS2) len = 1; else if (*s == SS3) len = 2; else if (IS_HIGHBIT_SET(*s)) len = 2; else len = pg_ascii_dsplen(s); return len; } /* * EUC_KR */ static int pg_euckr2wchar_with_len(const unsigned char *from, pg_wchar *to, int len) { return pg_euc2wchar_with_len(from, to, len); } static int pg_euckr_mblen(const unsigned char *s) { return pg_euc_mblen(s); } static int pg_euckr_dsplen(const unsigned char *s) { return pg_euc_dsplen(s); } /* * EUC_CN * */ static int pg_euccn2wchar_with_len(const unsigned char *from, pg_wchar *to, int len) { int cnt = 0; while (len > 0 && *from) { if (*from == SS2 && len >= 3) /* code set 2 (unused?) */ { from++; *to = (SS2 << 16) | (*from++ << 8); *to |= *from++; len -= 3; } else if (*from == SS3 && len >= 3) /* code set 3 (unused ?) */ { from++; *to = (SS3 << 16) | (*from++ << 8); *to |= *from++; len -= 3; } else if (IS_HIGHBIT_SET(*from) && len >= 2) /* code set 1 */ { *to = *from++ << 8; *to |= *from++; len -= 2; } else { *to = *from++; len--; } to++; cnt++; } *to = 0; return cnt; } static int pg_euccn_mblen(const unsigned char *s) { int len; if (IS_HIGHBIT_SET(*s)) len = 2; else len = 1; return len; } static int pg_euccn_dsplen(const unsigned char *s) { int len; if (IS_HIGHBIT_SET(*s)) len = 2; else len = pg_ascii_dsplen(s); return len; } /* * EUC_TW * */ static int pg_euctw2wchar_with_len(const unsigned char *from, pg_wchar *to, int len) { int cnt = 0; while (len > 0 && *from) { if (*from == SS2 && len >= 4) /* code set 2 */ { from++; *to = (((uint32) SS2) << 24) | (*from++ << 16); *to |= *from++ << 8; *to |= *from++; len -= 4; } else if (*from == SS3 && len >= 3) /* code set 3 (unused?) */ { from++; *to = (SS3 << 16) | (*from++ << 8); *to |= *from++; len -= 3; } else if (IS_HIGHBIT_SET(*from) && len >= 2) /* code set 2 */ { *to = *from++ << 8; *to |= *from++; len -= 2; } else { *to = *from++; len--; } to++; cnt++; } *to = 0; return cnt; } static int pg_euctw_mblen(const unsigned char *s) { int len; if (*s == SS2) len = 4; else if (*s == SS3) len = 3; else if (IS_HIGHBIT_SET(*s)) len = 2; else len = 1; return len; } static int pg_euctw_dsplen(const unsigned char *s) { int len; if (*s == SS2) len = 2; else if (*s == SS3) len = 2; else if (IS_HIGHBIT_SET(*s)) len = 2; else len = pg_ascii_dsplen(s); return len; } /* * Convert pg_wchar to EUC_* encoding. * caller must allocate enough space for "to", including a trailing zero! * len: length of from. * "from" not necessarily null terminated. */ static int pg_wchar2euc_with_len(const pg_wchar *from, unsigned char *to, int len) { int cnt = 0; while (len > 0 && *from) { unsigned char c; if ((c = (*from >> 24))) { *to++ = c; *to++ = (*from >> 16) & 0xff; *to++ = (*from >> 8) & 0xff; *to++ = *from & 0xff; cnt += 4; } else if ((c = (*from >> 16))) { *to++ = c; *to++ = (*from >> 8) & 0xff; *to++ = *from & 0xff; cnt += 3; } else if ((c = (*from >> 8))) { *to++ = c; *to++ = *from & 0xff; cnt += 2; } else { *to++ = *from; cnt++; } from++; len--; } *to = 0; return cnt; } /* * JOHAB */ static int pg_johab_mblen(const unsigned char *s) { return pg_euc_mblen(s); } static int pg_johab_dsplen(const unsigned char *s) { return pg_euc_dsplen(s); } /* * convert UTF8 string to pg_wchar (UCS-4) * caller must allocate enough space for "to", including a trailing zero! * len: length of from. * "from" not necessarily null terminated. */ static int pg_utf2wchar_with_len(const unsigned char *from, pg_wchar *to, int len) { int cnt = 0; uint32 c1, c2, c3, c4; while (len > 0 && *from) { if ((*from & 0x80) == 0) { *to = *from++; len--; } else if ((*from & 0xe0) == 0xc0) { if (len < 2) break; /* drop trailing incomplete char */ c1 = *from++ & 0x1f; c2 = *from++ & 0x3f; *to = (c1 << 6) | c2; len -= 2; } else if ((*from & 0xf0) == 0xe0) { if (len < 3) break; /* drop trailing incomplete char */ c1 = *from++ & 0x0f; c2 = *from++ & 0x3f; c3 = *from++ & 0x3f; *to = (c1 << 12) | (c2 << 6) | c3; len -= 3; } else if ((*from & 0xf8) == 0xf0) { if (len < 4) break; /* drop trailing incomplete char */ c1 = *from++ & 0x07; c2 = *from++ & 0x3f; c3 = *from++ & 0x3f; c4 = *from++ & 0x3f; *to = (c1 << 18) | (c2 << 12) | (c3 << 6) | c4; len -= 4; } else { /* treat a bogus char as length 1; not ours to raise error */ *to = *from++; len--; } to++; cnt++; } *to = 0; return cnt; } /* * Map a Unicode code point to UTF-8. utf8string must have 4 bytes of * space allocated. */ unsigned char * unicode_to_utf8(pg_wchar c, unsigned char *utf8string) { if (c <= 0x7F) { utf8string[0] = c; } else if (c <= 0x7FF) { utf8string[0] = 0xC0 | ((c >> 6) & 0x1F); utf8string[1] = 0x80 | (c & 0x3F); } else if (c <= 0xFFFF) { utf8string[0] = 0xE0 | ((c >> 12) & 0x0F); utf8string[1] = 0x80 | ((c >> 6) & 0x3F); utf8string[2] = 0x80 | (c & 0x3F); } else { utf8string[0] = 0xF0 | ((c >> 18) & 0x07); utf8string[1] = 0x80 | ((c >> 12) & 0x3F); utf8string[2] = 0x80 | ((c >> 6) & 0x3F); utf8string[3] = 0x80 | (c & 0x3F); } return utf8string; } /* * Trivial conversion from pg_wchar to UTF-8. * caller should allocate enough space for "to" * len: length of from. * "from" not necessarily null terminated. */ static int pg_wchar2utf_with_len(const pg_wchar *from, unsigned char *to, int len) { int cnt = 0; while (len > 0 && *from) { int char_len; unicode_to_utf8(*from, to); char_len = pg_utf_mblen(to); cnt += char_len; to += char_len; from++; len--; } *to = 0; return cnt; } /* * Return the byte length of a UTF8 character pointed to by s * * Note: in the current implementation we do not support UTF8 sequences * of more than 4 bytes; hence do NOT return a value larger than 4. * We return "1" for any leading byte that is either flat-out illegal or * indicates a length larger than we support. * * pg_utf2wchar_with_len(), utf8_to_unicode(), pg_utf8_islegal(), and perhaps * other places would need to be fixed to change this. */ int pg_utf_mblen(const unsigned char *s) { int len; if ((*s & 0x80) == 0) len = 1; else if ((*s & 0xe0) == 0xc0) len = 2; else if ((*s & 0xf0) == 0xe0) len = 3; else if ((*s & 0xf8) == 0xf0) len = 4; #ifdef NOT_USED else if ((*s & 0xfc) == 0xf8) len = 5; else if ((*s & 0xfe) == 0xfc) len = 6; #endif else len = 1; return len; } /* * This is an implementation of wcwidth() and wcswidth() as defined in * "The Single UNIX Specification, Version 2, The Open Group, 1997" * * * Markus Kuhn -- 2001-09-08 -- public domain * * customised for PostgreSQL * * original available at : http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c */ struct mbinterval { unsigned short first; unsigned short last; }; /* auxiliary function for binary search in interval table */ static int mbbisearch(pg_wchar ucs, const struct mbinterval * table, int max) { int min = 0; int mid; if (ucs < table[0].first || ucs > table[max].last) return 0; while (max >= min) { mid = (min + max) / 2; if (ucs > table[mid].last) min = mid + 1; else if (ucs < table[mid].first) max = mid - 1; else return 1; } return 0; } /* The following functions define the column width of an ISO 10646 * character as follows: * * - The null character (U+0000) has a column width of 0. * * - Other C0/C1 control characters and DEL will lead to a return * value of -1. * * - Non-spacing and enclosing combining characters (general * category code Mn or Me in the Unicode database) have a * column width of 0. * * - Other format characters (general category code Cf in the Unicode * database) and ZERO WIDTH SPACE (U+200B) have a column width of 0. * * - Hangul Jamo medial vowels and final consonants (U+1160-U+11FF) * have a column width of 0. * * - Spacing characters in the East Asian Wide (W) or East Asian * FullWidth (F) category as defined in Unicode Technical * Report #11 have a column width of 2. * * - All remaining characters (including all printable * ISO 8859-1 and WGL4 characters, Unicode control characters, * etc.) have a column width of 1. * * This implementation assumes that wchar_t characters are encoded * in ISO 10646. */ static int ucs_wcwidth(pg_wchar ucs) { /* sorted list of non-overlapping intervals of non-spacing characters */ static const struct mbinterval combining[] = { {0x0300, 0x034E}, {0x0360, 0x0362}, {0x0483, 0x0486}, {0x0488, 0x0489}, {0x0591, 0x05A1}, {0x05A3, 0x05B9}, {0x05BB, 0x05BD}, {0x05BF, 0x05BF}, {0x05C1, 0x05C2}, {0x05C4, 0x05C4}, {0x064B, 0x0655}, {0x0670, 0x0670}, {0x06D6, 0x06E4}, {0x06E7, 0x06E8}, {0x06EA, 0x06ED}, {0x070F, 0x070F}, {0x0711, 0x0711}, {0x0730, 0x074A}, {0x07A6, 0x07B0}, {0x0901, 0x0902}, {0x093C, 0x093C}, {0x0941, 0x0948}, {0x094D, 0x094D}, {0x0951, 0x0954}, {0x0962, 0x0963}, {0x0981, 0x0981}, {0x09BC, 0x09BC}, {0x09C1, 0x09C4}, {0x09CD, 0x09CD}, {0x09E2, 0x09E3}, {0x0A02, 0x0A02}, {0x0A3C, 0x0A3C}, {0x0A41, 0x0A42}, {0x0A47, 0x0A48}, {0x0A4B, 0x0A4D}, {0x0A70, 0x0A71}, {0x0A81, 0x0A82}, {0x0ABC, 0x0ABC}, {0x0AC1, 0x0AC5}, {0x0AC7, 0x0AC8}, {0x0ACD, 0x0ACD}, {0x0B01, 0x0B01}, {0x0B3C, 0x0B3C}, {0x0B3F, 0x0B3F}, {0x0B41, 0x0B43}, {0x0B4D, 0x0B4D}, {0x0B56, 0x0B56}, {0x0B82, 0x0B82}, {0x0BC0, 0x0BC0}, {0x0BCD, 0x0BCD}, {0x0C3E, 0x0C40}, {0x0C46, 0x0C48}, {0x0C4A, 0x0C4D}, {0x0C55, 0x0C56}, {0x0CBF, 0x0CBF}, {0x0CC6, 0x0CC6}, {0x0CCC, 0x0CCD}, {0x0D41, 0x0D43}, {0x0D4D, 0x0D4D}, {0x0DCA, 0x0DCA}, {0x0DD2, 0x0DD4}, {0x0DD6, 0x0DD6}, {0x0E31, 0x0E31}, {0x0E34, 0x0E3A}, {0x0E47, 0x0E4E}, {0x0EB1, 0x0EB1}, {0x0EB4, 0x0EB9}, {0x0EBB, 0x0EBC}, {0x0EC8, 0x0ECD}, {0x0F18, 0x0F19}, {0x0F35, 0x0F35}, {0x0F37, 0x0F37}, {0x0F39, 0x0F39}, {0x0F71, 0x0F7E}, {0x0F80, 0x0F84}, {0x0F86, 0x0F87}, {0x0F90, 0x0F97}, {0x0F99, 0x0FBC}, {0x0FC6, 0x0FC6}, {0x102D, 0x1030}, {0x1032, 0x1032}, {0x1036, 0x1037}, {0x1039, 0x1039}, {0x1058, 0x1059}, {0x1160, 0x11FF}, {0x17B7, 0x17BD}, {0x17C6, 0x17C6}, {0x17C9, 0x17D3}, {0x180B, 0x180E}, {0x18A9, 0x18A9}, {0x200B, 0x200F}, {0x202A, 0x202E}, {0x206A, 0x206F}, {0x20D0, 0x20E3}, {0x302A, 0x302F}, {0x3099, 0x309A}, {0xFB1E, 0xFB1E}, {0xFE20, 0xFE23}, {0xFEFF, 0xFEFF}, {0xFFF9, 0xFFFB} }; /* test for 8-bit control characters */ if (ucs == 0) return 0; if (ucs < 0x20 || (ucs >= 0x7f && ucs < 0xa0) || ucs > 0x0010ffff) return -1; /* binary search in table of non-spacing characters */ if (mbbisearch(ucs, combining, sizeof(combining) / sizeof(struct mbinterval) - 1)) return 0; /* * if we arrive here, ucs is not a combining or C0/C1 control character */ return 1 + (ucs >= 0x1100 && (ucs <= 0x115f || /* Hangul Jamo init. consonants */ (ucs >= 0x2e80 && ucs <= 0xa4cf && (ucs & ~0x0011) != 0x300a && ucs != 0x303f) || /* CJK ... Yi */ (ucs >= 0xac00 && ucs <= 0xd7a3) || /* Hangul Syllables */ (ucs >= 0xf900 && ucs <= 0xfaff) || /* CJK Compatibility * Ideographs */ (ucs >= 0xfe30 && ucs <= 0xfe6f) || /* CJK Compatibility Forms */ (ucs >= 0xff00 && ucs <= 0xff5f) || /* Fullwidth Forms */ (ucs >= 0xffe0 && ucs <= 0xffe6) || (ucs >= 0x20000 && ucs <= 0x2ffff))); } /* * Convert a UTF-8 character to a Unicode code point. * This is a one-character version of pg_utf2wchar_with_len. * * No error checks here, c must point to a long-enough string. */ pg_wchar utf8_to_unicode(const unsigned char *c) { if ((*c & 0x80) == 0) return (pg_wchar) c[0]; else if ((*c & 0xe0) == 0xc0) return (pg_wchar) (((c[0] & 0x1f) << 6) | (c[1] & 0x3f)); else if ((*c & 0xf0) == 0xe0) return (pg_wchar) (((c[0] & 0x0f) << 12) | ((c[1] & 0x3f) << 6) | (c[2] & 0x3f)); else if ((*c & 0xf8) == 0xf0) return (pg_wchar) (((c[0] & 0x07) << 18) | ((c[1] & 0x3f) << 12) | ((c[2] & 0x3f) << 6) | (c[3] & 0x3f)); else /* that is an invalid code on purpose */ return 0xffffffff; } static int pg_utf_dsplen(const unsigned char *s) { return ucs_wcwidth(utf8_to_unicode(s)); } /* * convert mule internal code to pg_wchar * caller should allocate enough space for "to" * len: length of from. * "from" not necessarily null terminated. */ static int pg_mule2wchar_with_len(const unsigned char *from, pg_wchar *to, int len) { int cnt = 0; while (len > 0 && *from) { if (IS_LC1(*from) && len >= 2) { *to = *from++ << 16; *to |= *from++; len -= 2; } else if (IS_LCPRV1(*from) && len >= 3) { from++; *to = *from++ << 16; *to |= *from++; len -= 3; } else if (IS_LC2(*from) && len >= 3) { *to = *from++ << 16; *to |= *from++ << 8; *to |= *from++; len -= 3; } else if (IS_LCPRV2(*from) && len >= 4) { from++; *to = *from++ << 16; *to |= *from++ << 8; *to |= *from++; len -= 4; } else { /* assume ASCII */ *to = (unsigned char) *from++; len--; } to++; cnt++; } *to = 0; return cnt; } /* * convert pg_wchar to mule internal code * caller should allocate enough space for "to" * len: length of from. * "from" not necessarily null terminated. */ static int pg_wchar2mule_with_len(const pg_wchar *from, unsigned char *to, int len) { int cnt = 0; while (len > 0 && *from) { unsigned char lb; lb = (*from >> 16) & 0xff; if (IS_LC1(lb)) { *to++ = lb; *to++ = *from & 0xff; cnt += 2; } else if (IS_LC2(lb)) { *to++ = lb; *to++ = (*from >> 8) & 0xff; *to++ = *from & 0xff; cnt += 3; } else if (IS_LCPRV1_A_RANGE(lb)) { *to++ = LCPRV1_A; *to++ = lb; *to++ = *from & 0xff; cnt += 3; } else if (IS_LCPRV1_B_RANGE(lb)) { *to++ = LCPRV1_B; *to++ = lb; *to++ = *from & 0xff; cnt += 3; } else if (IS_LCPRV2_A_RANGE(lb)) { *to++ = LCPRV2_A; *to++ = lb; *to++ = (*from >> 8) & 0xff; *to++ = *from & 0xff; cnt += 4; } else if (IS_LCPRV2_B_RANGE(lb)) { *to++ = LCPRV2_B; *to++ = lb; *to++ = (*from >> 8) & 0xff; *to++ = *from & 0xff; cnt += 4; } else { *to++ = *from & 0xff; cnt += 1; } from++; len--; } *to = 0; return cnt; } int pg_mule_mblen(const unsigned char *s) { int len; if (IS_LC1(*s)) len = 2; else if (IS_LCPRV1(*s)) len = 3; else if (IS_LC2(*s)) len = 3; else if (IS_LCPRV2(*s)) len = 4; else len = 1; /* assume ASCII */ return len; } static int pg_mule_dsplen(const unsigned char *s) { int len; /* * Note: it's not really appropriate to assume that all multibyte charsets * are double-wide on screen. But this seems an okay approximation for * the MULE charsets we currently support. */ if (IS_LC1(*s)) len = 1; else if (IS_LCPRV1(*s)) len = 1; else if (IS_LC2(*s)) len = 2; else if (IS_LCPRV2(*s)) len = 2; else len = 1; /* assume ASCII */ return len; } /* * ISO8859-1 */ static int pg_latin12wchar_with_len(const unsigned char *from, pg_wchar *to, int len) { int cnt = 0; while (len > 0 && *from) { *to++ = *from++; len--; cnt++; } *to = 0; return cnt; } /* * Trivial conversion from pg_wchar to single byte encoding. Just ignores * high bits. * caller should allocate enough space for "to" * len: length of from. * "from" not necessarily null terminated. */ static int pg_wchar2single_with_len(const pg_wchar *from, unsigned char *to, int len) { int cnt = 0; while (len > 0 && *from) { *to++ = *from++; len--; cnt++; } *to = 0; return cnt; } static int pg_latin1_mblen(const unsigned char *s) { return 1; } static int pg_latin1_dsplen(const unsigned char *s) { return pg_ascii_dsplen(s); } /* * SJIS */ static int pg_sjis_mblen(const unsigned char *s) { int len; if (*s >= 0xa1 && *s <= 0xdf) len = 1; /* 1 byte kana? */ else if (IS_HIGHBIT_SET(*s)) len = 2; /* kanji? */ else len = 1; /* should be ASCII */ return len; } static int pg_sjis_dsplen(const unsigned char *s) { int len; if (*s >= 0xa1 && *s <= 0xdf) len = 1; /* 1 byte kana? */ else if (IS_HIGHBIT_SET(*s)) len = 2; /* kanji? */ else len = pg_ascii_dsplen(s); /* should be ASCII */ return len; } /* * Big5 */ static int pg_big5_mblen(const unsigned char *s) { int len; if (IS_HIGHBIT_SET(*s)) len = 2; /* kanji? */ else len = 1; /* should be ASCII */ return len; } static int pg_big5_dsplen(const unsigned char *s) { int len; if (IS_HIGHBIT_SET(*s)) len = 2; /* kanji? */ else len = pg_ascii_dsplen(s); /* should be ASCII */ return len; } /* * GBK */ static int pg_gbk_mblen(const unsigned char *s) { int len; if (IS_HIGHBIT_SET(*s)) len = 2; /* kanji? */ else len = 1; /* should be ASCII */ return len; } static int pg_gbk_dsplen(const unsigned char *s) { int len; if (IS_HIGHBIT_SET(*s)) len = 2; /* kanji? */ else len = pg_ascii_dsplen(s); /* should be ASCII */ return len; } /* * UHC */ static int pg_uhc_mblen(const unsigned char *s) { int len; if (IS_HIGHBIT_SET(*s)) len = 2; /* 2byte? */ else len = 1; /* should be ASCII */ return len; } static int pg_uhc_dsplen(const unsigned char *s) { int len; if (IS_HIGHBIT_SET(*s)) len = 2; /* 2byte? */ else len = pg_ascii_dsplen(s); /* should be ASCII */ return len; } /* * * GB18030 * * Added by Bill Huang , * */ static int pg_gb18030_mblen(const unsigned char *s) { int len; if (!IS_HIGHBIT_SET(*s)) len = 1; /* ASCII */ else { if ((*(s + 1) >= 0x40 && *(s + 1) <= 0x7e) || (*(s + 1) >= 0x80 && *(s + 1) <= 0xfe)) len = 2; else if (*(s + 1) >= 0x30 && *(s + 1) <= 0x39) len = 4; else len = 2; } return len; } static int pg_gb18030_dsplen(const unsigned char *s) { int len; if (IS_HIGHBIT_SET(*s)) len = 2; else len = pg_ascii_dsplen(s); /* ASCII */ return len; } /* *------------------------------------------------------------------- * multibyte sequence validators * * These functions accept "s", a pointer to the first byte of a string, * and "len", the remaining length of the string. If there is a validly * encoded character beginning at *s, return its length in bytes; else * return -1. * * The functions can assume that len > 0 and that *s != '\0', but they must * test for and reject zeroes in any additional bytes of a multibyte character. * * Note that this definition allows the function for a single-byte * encoding to be just "return 1". *------------------------------------------------------------------- */ static int pg_ascii_verifier(const unsigned char *s, int len) { return 1; } #define IS_EUC_RANGE_VALID(c) ((c) >= 0xa1 && (c) <= 0xfe) static int pg_eucjp_verifier(const unsigned char *s, int len) { int l; unsigned char c1, c2; c1 = *s++; switch (c1) { case SS2: /* JIS X 0201 */ l = 2; if (l > len) return -1; c2 = *s++; if (c2 < 0xa1 || c2 > 0xdf) return -1; break; case SS3: /* JIS X 0212 */ l = 3; if (l > len) return -1; c2 = *s++; if (!IS_EUC_RANGE_VALID(c2)) return -1; c2 = *s++; if (!IS_EUC_RANGE_VALID(c2)) return -1; break; default: if (IS_HIGHBIT_SET(c1)) /* JIS X 0208? */ { l = 2; if (l > len) return -1; if (!IS_EUC_RANGE_VALID(c1)) return -1; c2 = *s++; if (!IS_EUC_RANGE_VALID(c2)) return -1; } else /* must be ASCII */ { l = 1; } break; } return l; } static int pg_euckr_verifier(const unsigned char *s, int len) { int l; unsigned char c1, c2; c1 = *s++; if (IS_HIGHBIT_SET(c1)) { l = 2; if (l > len) return -1; if (!IS_EUC_RANGE_VALID(c1)) return -1; c2 = *s++; if (!IS_EUC_RANGE_VALID(c2)) return -1; } else /* must be ASCII */ { l = 1; } return l; } /* EUC-CN byte sequences are exactly same as EUC-KR */ #define pg_euccn_verifier pg_euckr_verifier static int pg_euctw_verifier(const unsigned char *s, int len) { int l; unsigned char c1, c2; c1 = *s++; switch (c1) { case SS2: /* CNS 11643 Plane 1-7 */ l = 4; if (l > len) return -1; c2 = *s++; if (c2 < 0xa1 || c2 > 0xa7) return -1; c2 = *s++; if (!IS_EUC_RANGE_VALID(c2)) return -1; c2 = *s++; if (!IS_EUC_RANGE_VALID(c2)) return -1; break; case SS3: /* unused */ return -1; default: if (IS_HIGHBIT_SET(c1)) /* CNS 11643 Plane 1 */ { l = 2; if (l > len) return -1; /* no further range check on c1? */ c2 = *s++; if (!IS_EUC_RANGE_VALID(c2)) return -1; } else /* must be ASCII */ { l = 1; } break; } return l; } static int pg_johab_verifier(const unsigned char *s, int len) { int l, mbl; unsigned char c; l = mbl = pg_johab_mblen(s); if (len < l) return -1; if (!IS_HIGHBIT_SET(*s)) return mbl; while (--l > 0) { c = *++s; if (!IS_EUC_RANGE_VALID(c)) return -1; } return mbl; } static int pg_mule_verifier(const unsigned char *s, int len) { int l, mbl; unsigned char c; l = mbl = pg_mule_mblen(s); if (len < l) return -1; while (--l > 0) { c = *++s; if (!IS_HIGHBIT_SET(c)) return -1; } return mbl; } static int pg_latin1_verifier(const unsigned char *s, int len) { return 1; } static int pg_sjis_verifier(const unsigned char *s, int len) { int l, mbl; unsigned char c1, c2; l = mbl = pg_sjis_mblen(s); if (len < l) return -1; if (l == 1) /* pg_sjis_mblen already verified it */ return mbl; c1 = *s++; c2 = *s; if (!ISSJISHEAD(c1) || !ISSJISTAIL(c2)) return -1; return mbl; } static int pg_big5_verifier(const unsigned char *s, int len) { int l, mbl; l = mbl = pg_big5_mblen(s); if (len < l) return -1; while (--l > 0) { if (*++s == '\0') return -1; } return mbl; } static int pg_gbk_verifier(const unsigned char *s, int len) { int l, mbl; l = mbl = pg_gbk_mblen(s); if (len < l) return -1; while (--l > 0) { if (*++s == '\0') return -1; } return mbl; } static int pg_uhc_verifier(const unsigned char *s, int len) { int l, mbl; l = mbl = pg_uhc_mblen(s); if (len < l) return -1; while (--l > 0) { if (*++s == '\0') return -1; } return mbl; } static int pg_gb18030_verifier(const unsigned char *s, int len) { int l, mbl; l = mbl = pg_gb18030_mblen(s); if (len < l) return -1; while (--l > 0) { if (*++s == '\0') return -1; } return mbl; } static int pg_utf8_verifier(const unsigned char *s, int len) { int l = pg_utf_mblen(s); if (len < l) return -1; if (!pg_utf8_islegal(s, l)) return -1; return l; } /* * Check for validity of a single UTF-8 encoded character * * This directly implements the rules in RFC3629. The bizarre-looking * restrictions on the second byte are meant to ensure that there isn't * more than one encoding of a given Unicode character point; that is, * you may not use a longer-than-necessary byte sequence with high order * zero bits to represent a character that would fit in fewer bytes. * To do otherwise is to create security hazards (eg, create an apparent * non-ASCII character that decodes to plain ASCII). * * length is assumed to have been obtained by pg_utf_mblen(), and the * caller must have checked that that many bytes are present in the buffer. */ bool pg_utf8_islegal(const unsigned char *source, int length) { unsigned char a; switch (length) { default: /* reject lengths 5 and 6 for now */ return false; case 4: a = source[3]; if (a < 0x80 || a > 0xBF) return false; /* FALL THRU */ case 3: a = source[2]; if (a < 0x80 || a > 0xBF) return false; /* FALL THRU */ case 2: a = source[1]; switch (*source) { case 0xE0: if (a < 0xA0 || a > 0xBF) return false; break; case 0xED: if (a < 0x80 || a > 0x9F) return false; break; case 0xF0: if (a < 0x90 || a > 0xBF) return false; break; case 0xF4: if (a < 0x80 || a > 0x8F) return false; break; default: if (a < 0x80 || a > 0xBF) return false; break; } /* FALL THRU */ case 1: a = *source; if (a >= 0x80 && a < 0xC2) return false; if (a > 0xF4) return false; break; } return true; } #ifndef FRONTEND /* * Generic character incrementer function. * * Not knowing anything about the properties of the encoding in use, we just * keep incrementing the last byte until we get a validly-encoded result, * or we run out of values to try. We don't bother to try incrementing * higher-order bytes, so there's no growth in runtime for wider characters. * (If we did try to do that, we'd need to consider the likelihood that 255 * is not a valid final byte in the encoding.) */ static bool pg_generic_charinc(unsigned char *charptr, int len) { unsigned char *lastbyte = charptr + len - 1; mbverifier mbverify; /* We can just invoke the character verifier directly. */ mbverify = pg_wchar_table[GetDatabaseEncoding()].mbverify; while (*lastbyte < (unsigned char) 255) { (*lastbyte)++; if ((*mbverify) (charptr, len) == len) return true; } return false; } /* * UTF-8 character incrementer function. * * For a one-byte character less than 0x7F, we just increment the byte. * * For a multibyte character, every byte but the first must fall between 0x80 * and 0xBF; and the first byte must be between 0xC0 and 0xF4. We increment * the last byte that's not already at its maximum value. If we can't find a * byte that's less than the maximum allowable value, we simply fail. We also * need some special-case logic to skip regions used for surrogate pair * handling, as those should not occur in valid UTF-8. * * Note that we don't reset lower-order bytes back to their minimums, since * we can't afford to make an exhaustive search (see make_greater_string). */ static bool pg_utf8_increment(unsigned char *charptr, int length) { unsigned char a; unsigned char limit; switch (length) { default: /* reject lengths 5 and 6 for now */ return false; case 4: a = charptr[3]; if (a < 0xBF) { charptr[3]++; break; } /* FALL THRU */ case 3: a = charptr[2]; if (a < 0xBF) { charptr[2]++; break; } /* FALL THRU */ case 2: a = charptr[1]; switch (*charptr) { case 0xED: limit = 0x9F; break; case 0xF4: limit = 0x8F; break; default: limit = 0xBF; break; } if (a < limit) { charptr[1]++; break; } /* FALL THRU */ case 1: a = *charptr; if (a == 0x7F || a == 0xDF || a == 0xEF || a == 0xF4) return false; charptr[0]++; break; } return true; } /* * EUC-JP character incrementer function. * * If the sequence starts with SS2 (0x8e), it must be a two-byte sequence * representing JIS X 0201 characters with the second byte ranging between * 0xa1 and 0xdf. We just increment the last byte if it's less than 0xdf, * and otherwise rewrite the whole sequence to 0xa1 0xa1. * * If the sequence starts with SS3 (0x8f), it must be a three-byte sequence * in which the last two bytes range between 0xa1 and 0xfe. The last byte * is incremented if possible, otherwise the second-to-last byte. * * If the sequence starts with a value other than the above and its MSB * is set, it must be a two-byte sequence representing JIS X 0208 characters * with both bytes ranging between 0xa1 and 0xfe. The last byte is * incremented if possible, otherwise the second-to-last byte. * * Otherwise, the sequence is a single-byte ASCII character. It is * incremented up to 0x7f. */ static bool pg_eucjp_increment(unsigned char *charptr, int length) { unsigned char c1, c2; int i; c1 = *charptr; switch (c1) { case SS2: /* JIS X 0201 */ if (length != 2) return false; c2 = charptr[1]; if (c2 >= 0xdf) charptr[0] = charptr[1] = 0xa1; else if (c2 < 0xa1) charptr[1] = 0xa1; else charptr[1]++; break; case SS3: /* JIS X 0212 */ if (length != 3) return false; for (i = 2; i > 0; i--) { c2 = charptr[i]; if (c2 < 0xa1) { charptr[i] = 0xa1; return true; } else if (c2 < 0xfe) { charptr[i]++; return true; } } /* Out of 3-byte code region */ return false; default: if (IS_HIGHBIT_SET(c1)) /* JIS X 0208? */ { if (length != 2) return false; for (i = 1; i >= 0; i--) { c2 = charptr[i]; if (c2 < 0xa1) { charptr[i] = 0xa1; return true; } else if (c2 < 0xfe) { charptr[i]++; return true; } } /* Out of 2 byte code region */ return false; } else { /* ASCII, single byte */ if (c1 > 0x7e) return false; (*charptr)++; } break; } return true; } #endif /* !FRONTEND */ /* *------------------------------------------------------------------- * encoding info table * XXX must be sorted by the same order as enum pg_enc (in mb/pg_wchar.h) *------------------------------------------------------------------- */ const pg_wchar_tbl pg_wchar_table[] = { {pg_ascii2wchar_with_len, pg_wchar2single_with_len, pg_ascii_mblen, pg_ascii_dsplen, pg_ascii_verifier, 1}, /* PG_SQL_ASCII */ {pg_eucjp2wchar_with_len, pg_wchar2euc_with_len, pg_eucjp_mblen, pg_eucjp_dsplen, pg_eucjp_verifier, 3}, /* PG_EUC_JP */ {pg_euccn2wchar_with_len, pg_wchar2euc_with_len, pg_euccn_mblen, pg_euccn_dsplen, pg_euccn_verifier, 2}, /* PG_EUC_CN */ {pg_euckr2wchar_with_len, pg_wchar2euc_with_len, pg_euckr_mblen, pg_euckr_dsplen, pg_euckr_verifier, 3}, /* PG_EUC_KR */ {pg_euctw2wchar_with_len, pg_wchar2euc_with_len, pg_euctw_mblen, pg_euctw_dsplen, pg_euctw_verifier, 4}, /* PG_EUC_TW */ {pg_eucjp2wchar_with_len, pg_wchar2euc_with_len, pg_eucjp_mblen, pg_eucjp_dsplen, pg_eucjp_verifier, 3}, /* PG_EUC_JIS_2004 */ {pg_utf2wchar_with_len, pg_wchar2utf_with_len, pg_utf_mblen, pg_utf_dsplen, pg_utf8_verifier, 4}, /* PG_UTF8 */ {pg_mule2wchar_with_len, pg_wchar2mule_with_len, pg_mule_mblen, pg_mule_dsplen, pg_mule_verifier, 4}, /* PG_MULE_INTERNAL */ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_LATIN1 */ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_LATIN2 */ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_LATIN3 */ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_LATIN4 */ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_LATIN5 */ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_LATIN6 */ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_LATIN7 */ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_LATIN8 */ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_LATIN9 */ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_LATIN10 */ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_WIN1256 */ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_WIN1258 */ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_WIN866 */ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_WIN874 */ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_KOI8R */ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_WIN1251 */ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_WIN1252 */ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* ISO-8859-5 */ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* ISO-8859-6 */ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* ISO-8859-7 */ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* ISO-8859-8 */ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_WIN1250 */ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_WIN1253 */ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_WIN1254 */ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_WIN1255 */ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_WIN1257 */ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_KOI8U */ {0, 0, pg_sjis_mblen, pg_sjis_dsplen, pg_sjis_verifier, 2}, /* PG_SJIS */ {0, 0, pg_big5_mblen, pg_big5_dsplen, pg_big5_verifier, 2}, /* PG_BIG5 */ {0, 0, pg_gbk_mblen, pg_gbk_dsplen, pg_gbk_verifier, 2}, /* PG_GBK */ {0, 0, pg_uhc_mblen, pg_uhc_dsplen, pg_uhc_verifier, 2}, /* PG_UHC */ {0, 0, pg_gb18030_mblen, pg_gb18030_dsplen, pg_gb18030_verifier, 4}, /* PG_GB18030 */ {0, 0, pg_johab_mblen, pg_johab_dsplen, pg_johab_verifier, 3}, /* PG_JOHAB */ {0, 0, pg_sjis_mblen, pg_sjis_dsplen, pg_sjis_verifier, 2} /* PG_SHIFT_JIS_2004 */ }; /* returns the byte length of a word for mule internal code */ int pg_mic_mblen(const unsigned char *mbstr) { return pg_mule_mblen(mbstr); } /* * Returns the byte length of a multibyte character. */ int pg_encoding_mblen(int encoding, const char *mbstr) { return (PG_VALID_ENCODING(encoding) ? ((*pg_wchar_table[encoding].mblen) ((const unsigned char *) mbstr)) : ((*pg_wchar_table[PG_SQL_ASCII].mblen) ((const unsigned char *) mbstr))); } /* * Returns the display length of a multibyte character. */ int pg_encoding_dsplen(int encoding, const char *mbstr) { return (PG_VALID_ENCODING(encoding) ? ((*pg_wchar_table[encoding].dsplen) ((const unsigned char *) mbstr)) : ((*pg_wchar_table[PG_SQL_ASCII].dsplen) ((const unsigned char *) mbstr))); } /* * Verify the first multibyte character of the given string. * Return its byte length if good, -1 if bad. (See comments above for * full details of the mbverify API.) */ int pg_encoding_verifymb(int encoding, const char *mbstr, int len) { return (PG_VALID_ENCODING(encoding) ? ((*pg_wchar_table[encoding].mbverify) ((const unsigned char *) mbstr, len)) : ((*pg_wchar_table[PG_SQL_ASCII].mbverify) ((const unsigned char *) mbstr, len))); } /* * fetch maximum length of a given encoding */ int pg_encoding_max_length(int encoding) { Assert(PG_VALID_ENCODING(encoding)); return pg_wchar_table[encoding].maxmblen; } #ifndef FRONTEND /* * fetch maximum length of the encoding for the current database */ int pg_database_encoding_max_length(void) { return pg_wchar_table[GetDatabaseEncoding()].maxmblen; } /* * get the character incrementer for the encoding for the current database */ mbcharacter_incrementer pg_database_encoding_character_incrementer(void) { /* * Eventually it might be best to add a field to pg_wchar_table[], but for * now we just use a switch. */ switch (GetDatabaseEncoding()) { case PG_UTF8: return pg_utf8_increment; case PG_EUC_JP: return pg_eucjp_increment; default: return pg_generic_charinc; } } /* * Verify mbstr to make sure that it is validly encoded in the current * database encoding. Otherwise same as pg_verify_mbstr(). */ bool pg_verifymbstr(const char *mbstr, int len, bool noError) { return pg_verify_mbstr_len(GetDatabaseEncoding(), mbstr, len, noError) >= 0; } /* * Verify mbstr to make sure that it is validly encoded in the specified * encoding. */ bool pg_verify_mbstr(int encoding, const char *mbstr, int len, bool noError) { return pg_verify_mbstr_len(encoding, mbstr, len, noError) >= 0; } /* * Verify mbstr to make sure that it is validly encoded in the specified * encoding. * * mbstr is not necessarily zero terminated; length of mbstr is * specified by len. * * If OK, return length of string in the encoding. * If a problem is found, return -1 when noError is * true; when noError is false, ereport() a descriptive message. */ int pg_verify_mbstr_len(int encoding, const char *mbstr, int len, bool noError) { mbverifier mbverify; int mb_len; Assert(PG_VALID_ENCODING(encoding)); /* * In single-byte encodings, we need only reject nulls (\0). */ if (pg_encoding_max_length(encoding) <= 1) { const char *nullpos = memchr(mbstr, 0, len); if (nullpos == NULL) return len; if (noError) return -1; report_invalid_encoding(encoding, nullpos, 1); } /* fetch function pointer just once */ mbverify = pg_wchar_table[encoding].mbverify; mb_len = 0; while (len > 0) { int l; /* fast path for ASCII-subset characters */ if (!IS_HIGHBIT_SET(*mbstr)) { if (*mbstr != '\0') { mb_len++; mbstr++; len--; continue; } if (noError) return -1; report_invalid_encoding(encoding, mbstr, len); } l = (*mbverify) ((const unsigned char *) mbstr, len); if (l < 0) { if (noError) return -1; report_invalid_encoding(encoding, mbstr, len); } mbstr += l; len -= l; mb_len++; } return mb_len; } /* * check_encoding_conversion_args: check arguments of a conversion function * * "expected" arguments can be either an encoding ID or -1 to indicate that * the caller will check whether it accepts the ID. * * Note: the errors here are not really user-facing, so elog instead of * ereport seems sufficient. Also, we trust that the "expected" encoding * arguments are valid encoding IDs, but we don't trust the actuals. */ void check_encoding_conversion_args(int src_encoding, int dest_encoding, int len, int expected_src_encoding, int expected_dest_encoding) { if (!PG_VALID_ENCODING(src_encoding)) elog(ERROR, "invalid source encoding ID: %d", src_encoding); if (src_encoding != expected_src_encoding && expected_src_encoding >= 0) elog(ERROR, "expected source encoding \"%s\", but got \"%s\"", pg_enc2name_tbl[expected_src_encoding].name, pg_enc2name_tbl[src_encoding].name); if (!PG_VALID_ENCODING(dest_encoding)) elog(ERROR, "invalid destination encoding ID: %d", dest_encoding); if (dest_encoding != expected_dest_encoding && expected_dest_encoding >= 0) elog(ERROR, "expected destination encoding \"%s\", but got \"%s\"", pg_enc2name_tbl[expected_dest_encoding].name, pg_enc2name_tbl[dest_encoding].name); if (len < 0) elog(ERROR, "encoding conversion length must not be negative"); } /* * report_invalid_encoding: complain about invalid multibyte character * * note: len is remaining length of string, not length of character; * len must be greater than zero, as we always examine the first byte. */ void report_invalid_encoding(int encoding, const char *mbstr, int len) { int l = pg_encoding_mblen(encoding, mbstr); char buf[8 * 5 + 1]; char *p = buf; int j, jlimit; jlimit = Min(l, len); jlimit = Min(jlimit, 8); /* prevent buffer overrun */ for (j = 0; j < jlimit; j++) { p += sprintf(p, "0x%02x", (unsigned char) mbstr[j]); if (j < jlimit - 1) p += sprintf(p, " "); } ereport(ERROR, (errcode(ERRCODE_CHARACTER_NOT_IN_REPERTOIRE), errmsg("invalid byte sequence for encoding \"%s\": %s", pg_enc2name_tbl[encoding].name, buf))); } /* * report_untranslatable_char: complain about untranslatable character * * note: len is remaining length of string, not length of character; * len must be greater than zero, as we always examine the first byte. */ void report_untranslatable_char(int src_encoding, int dest_encoding, const char *mbstr, int len) { int l = pg_encoding_mblen(src_encoding, mbstr); char buf[8 * 5 + 1]; char *p = buf; int j, jlimit; jlimit = Min(l, len); jlimit = Min(jlimit, 8); /* prevent buffer overrun */ for (j = 0; j < jlimit; j++) { p += sprintf(p, "0x%02x", (unsigned char) mbstr[j]); if (j < jlimit - 1) p += sprintf(p, " "); } ereport(ERROR, (errcode(ERRCODE_UNTRANSLATABLE_CHARACTER), errmsg("character with byte sequence %s in encoding \"%s\" has no equivalent in encoding \"%s\"", buf, pg_enc2name_tbl[src_encoding].name, pg_enc2name_tbl[dest_encoding].name))); } #endif /* !FRONTEND */ pgpool-II-3.4.3/src/parser/keywords.c0000664000076400007640000000161312554350605014357 00000000000000/*------------------------------------------------------------------------- * * keywords.c * lexical token lookup for key words in PostgreSQL * * * Portions Copyright (c) 2003-2013, PgPool Global Development Group * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION * src/backend/parser/keywords.c * *------------------------------------------------------------------------- */ #include "parsenodes.h" #include "gramparse.h" /* required before parser/parse.h! */ #include "keywords.h" #include "gram.h" #define PG_KEYWORD(a,b,c) {a,b,c}, const ScanKeyword ScanKeywords[] = { #include "kwlist.h" }; /* End of ScanKeywords, for use in kwlookup.c and elsewhere */ const ScanKeyword *LastScanKeyword = endof(ScanKeywords); const int NumScanKeywords = lengthof(ScanKeywords); pgpool-II-3.4.3/src/parser/scan.c0000664000076400007640000034434312554350620013443 00000000000000#line 2 "scan.c" #line 4 "scan.c" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ #include #include #include #include /* end standard C headers. */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have . Non-C99 systems may or may not. */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; #endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #endif /* ! FLEXINT_H */ #ifdef __cplusplus /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ /* C99 requires __STDC__ to be defined as 1. */ #if defined (__STDC__) #define YY_USE_CONST #endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* An opaque pointer. */ #ifndef YY_TYPEDEF_YY_SCANNER_T #define YY_TYPEDEF_YY_SCANNER_T typedef void* yyscan_t; #endif /* For convenience, these vars (plus the bison vars far below) are macros in the reentrant scanner. */ #define yyin yyg->yyin_r #define yyout yyg->yyout_r #define yyextra yyg->yyextra_r #define yyleng yyg->yyleng_r #define yytext yyg->yytext_r #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) #define yy_flex_debug yyg->yy_flex_debug_r /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN yyg->yy_start = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START ((yyg->yy_start - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE core_yyrestart(yyin ,yyscanner ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #define YY_BUF_SIZE 16384 #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = yyg->yy_hold_char; \ YY_RESTORE_YY_MORE_OFFSET \ yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via core_yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] void core_yyrestart (FILE *input_file ,yyscan_t yyscanner ); void core_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); YY_BUFFER_STATE core_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner ); void core_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); void core_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); void core_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); void core_yypop_buffer_state (yyscan_t yyscanner ); static void core_yyensure_buffer_stack (yyscan_t yyscanner ); static void core_yy_load_buffer_state (yyscan_t yyscanner ); static void core_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner ); #define YY_FLUSH_BUFFER core_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner) YY_BUFFER_STATE core_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); YY_BUFFER_STATE core_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); YY_BUFFER_STATE core_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner ); void *core_yyalloc (yy_size_t ,yyscan_t yyscanner ); void *core_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner ); void core_yyfree (void * ,yyscan_t yyscanner ); #define yy_new_buffer core_yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ core_yyensure_buffer_stack (yyscanner); \ YY_CURRENT_BUFFER_LVALUE = \ core_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ core_yyensure_buffer_stack (yyscanner); \ YY_CURRENT_BUFFER_LVALUE = \ core_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ #define core_yywrap(n) 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; typedef int yy_state_type; #define yytext_ptr yytext_r static yy_state_type yy_get_previous_state (yyscan_t yyscanner ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner); static int yy_get_next_buffer (yyscan_t yyscanner ); static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ yyg->yytext_ptr = yy_bp; \ yyleng = (size_t) (yy_cp - yy_bp); \ yyg->yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; #define YY_NUM_RULES 74 #define YY_END_OF_BUFFER 75 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; }; static yyconst flex_int16_t yy_accept[281] = { 0, 0, 0, 12, 12, 0, 0, 0, 0, 11, 11, 0, 0, 0, 0, 0, 0, 0, 0, 55, 55, 0, 0, 28, 28, 0, 0, 75, 73, 1, 1, 64, 49, 73, 63, 19, 63, 63, 63, 63, 66, 63, 72, 72, 72, 72, 72, 72, 12, 9, 5, 5, 6, 6, 58, 51, 11, 16, 32, 32, 22, 42, 31, 22, 46, 46, 48, 52, 54, 53, 53, 54, 54, 24, 27, 26, 26, 27, 27, 35, 36, 35, 1, 64, 43, 65, 44, 1, 61, 67, 2, 67, 66, 70, 60, 62, 72, 8, 20, 18, 59, 15, 12, 9, 9, 10, 5, 7, 4, 3, 58, 57, 11, 16, 16, 17, 32, 22, 22, 30, 23, 38, 39, 37, 37, 38, 31, 46, 45, 47, 53, 53, 55, 24, 24, 25, 26, 26, 28, 37, 37, 44, 1, 1, 2, 68, 67, 71, 69, 50, 21, 9, 14, 10, 9, 3, 16, 13, 17, 16, 22, 41, 23, 22, 39, 37, 37, 40, 47, 53, 55, 24, 25, 24, 26, 28, 37, 37, 9, 9, 9, 9, 16, 16, 16, 16, 22, 22, 22, 22, 39, 37, 37, 40, 55, 24, 24, 24, 24, 28, 37, 37, 9, 9, 9, 9, 9, 16, 16, 16, 16, 16, 22, 22, 22, 22, 22, 37, 37, 55, 24, 24, 24, 24, 24, 28, 37, 37, 9, 16, 22, 37, 33, 55, 24, 28, 37, 34, 37, 55, 28, 37, 37, 55, 55, 55, 28, 28, 28, 37, 37, 55, 55, 28, 28, 37, 56, 55, 55, 55, 55, 29, 28, 28, 28, 28, 55, 55, 55, 55, 55, 28, 28, 28, 28, 28, 55, 55, 28, 28, 0 } ; static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 2, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 5, 6, 5, 7, 8, 9, 10, 11, 11, 12, 13, 11, 14, 15, 16, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 19, 11, 8, 20, 8, 5, 5, 21, 22, 23, 24, 25, 24, 26, 26, 26, 26, 26, 26, 26, 27, 26, 28, 26, 26, 29, 26, 30, 26, 26, 31, 26, 26, 11, 32, 11, 8, 26, 5, 21, 22, 23, 24, 25, 24, 26, 26, 26, 26, 26, 26, 26, 27, 26, 28, 26, 26, 29, 26, 33, 26, 26, 34, 26, 26, 1, 5, 1, 5, 1, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26 } ; static yyconst flex_int32_t yy_meta[35] = { 0, 1, 1, 2, 2, 3, 4, 5, 3, 3, 6, 1, 7, 3, 3, 1, 7, 8, 8, 1, 3, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 11, 10, 10 } ; static yyconst flex_int16_t yy_base[348] = { 0, 0, 0, 526, 525, 30, 46, 524, 517, 512, 511, 37, 38, 506, 499, 42, 49, 502, 501, 69, 101, 492, 485, 133, 165, 33, 50, 494, 1142, 72, 75, 0, 1142, 50, 0, 1142, 1142, 479, 46, 476, 69, 61, 0, 471, 470, 469, 465, 454, 0, 86, 0, 0, 79, 430, 0, 414, 0, 94, 0, 0, 107, 89, 0, 110, 0, 0, 391, 370, 1142, 123, 126, 349, 325, 136, 1142, 139, 149, 323, 299, 1142, 1142, 115, 152, 0, 1142, 75, 304, 194, 1142, 140, 0, 155, 159, 168, 1142, 1142, 0, 1142, 1142, 1142, 154, 1142, 0, 186, 209, 257, 0, 159, 1142, 0, 0, 1142, 0, 190, 214, 248, 0, 218, 223, 1142, 244, 1142, 237, 0, 0, 0, 0, 0, 1142, 246, 227, 0, 219, 232, 237, 231, 240, 0, 209, 0, 0, 208, 0, 247, 0, 1142, 232, 115, 144, 1142, 1142, 262, 1142, 195, 266, 0, 271, 1142, 191, 275, 280, 1142, 187, 284, 180, 0, 0, 0, 189, 0, 168, 289, 173, 293, 0, 160, 0, 0, 298, 302, 306, 311, 315, 319, 324, 328, 332, 337, 341, 345, 1142, 0, 0, 1142, 157, 350, 354, 358, 363, 138, 0, 0, 367, 371, 376, 380, 385, 389, 393, 398, 402, 407, 411, 415, 420, 424, 429, 0, 0, 121, 433, 437, 442, 446, 451, 116, 0, 0, 455, 459, 464, 0, 1142, 93, 468, 91, 0, 1142, 0, 473, 482, 0, 0, 487, 0, 93, 496, 0, 87, 0, 0, 75, 501, 27, 510, 0, 1142, 515, 524, 529, 538, 1142, 543, 552, 557, 566, 571, 580, 585, 594, 599, 608, 613, 622, 627, 636, 641, 0, 650, 0, 1142, 664, 675, 686, 697, 708, 719, 730, 741, 752, 763, 772, 775, 781, 791, 802, 813, 824, 835, 845, 856, 867, 874, 880, 890, 899, 904, 904, 906, 908, 913, 923, 934, 938, 940, 949, 960, 971, 975, 977, 979, 988, 992, 994, 1003, 1014, 1025, 1029, 1031, 1040, 1044, 1046, 1048, 1050, 1052, 1054, 1056, 1058, 1060, 1062, 1064, 1073, 1084, 1088, 1097, 1108, 1119, 1130 } ; static yyconst flex_int16_t yy_def[348] = { 0, 280, 1, 281, 281, 282, 282, 283, 283, 284, 284, 285, 285, 286, 286, 287, 287, 283, 283, 288, 288, 286, 286, 289, 289, 290, 290, 280, 280, 280, 280, 291, 280, 292, 291, 280, 280, 291, 280, 291, 280, 280, 293, 293, 293, 293, 293, 293, 294, 280, 295, 295, 280, 280, 296, 280, 297, 280, 298, 298, 280, 299, 300, 280, 301, 301, 302, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 291, 280, 280, 303, 304, 280, 280, 305, 280, 280, 280, 280, 280, 293, 280, 280, 280, 280, 280, 294, 280, 280, 280, 295, 280, 280, 306, 296, 280, 297, 280, 280, 280, 298, 280, 280, 280, 280, 280, 280, 307, 308, 309, 300, 301, 280, 310, 280, 311, 280, 280, 280, 280, 280, 312, 280, 313, 314, 303, 304, 304, 305, 280, 280, 280, 280, 280, 280, 280, 280, 280, 315, 306, 280, 280, 280, 316, 280, 280, 280, 317, 280, 318, 319, 320, 310, 311, 280, 280, 280, 321, 312, 280, 322, 323, 324, 315, 315, 315, 325, 316, 316, 316, 326, 317, 317, 317, 280, 327, 328, 280, 280, 329, 321, 321, 321, 280, 330, 331, 324, 324, 280, 324, 315, 325, 325, 280, 325, 316, 326, 326, 280, 326, 317, 332, 333, 280, 329, 329, 280, 329, 321, 280, 334, 335, 324, 325, 326, 336, 280, 280, 329, 280, 337, 280, 338, 280, 280, 339, 340, 280, 341, 280, 280, 342, 280, 343, 333, 280, 344, 280, 345, 335, 280, 344, 344, 346, 344, 280, 345, 345, 347, 345, 344, 344, 280, 344, 344, 345, 345, 280, 345, 345, 346, 341, 347, 342, 0, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280 } ; static yyconst flex_int16_t yy_nxt[1177] = { 0, 28, 29, 30, 29, 31, 32, 33, 34, 31, 35, 36, 34, 34, 37, 38, 39, 40, 40, 41, 34, 42, 43, 42, 42, 44, 42, 45, 42, 42, 46, 47, 28, 46, 47, 51, 80, 261, 51, 51, 59, 59, 52, 51, 51, 65, 53, 60, 60, 66, 51, 51, 65, 80, 51, 51, 66, 84, 52, 51, 51, 88, 53, 89, 89, 81, 51, 85, 85, 61, 61, 69, 70, 69, 82, 82, 82, 82, 82, 82, 94, 95, 81, 71, 91, 256, 92, 92, 103, 104, 104, 107, 85, 85, 93, 108, 113, 114, 114, 72, 105, 254, 72, 69, 70, 69, 122, 252, 115, 117, 118, 118, 117, 118, 118, 71, 240, 119, 239, 123, 119, 120, 124, 125, 120, 130, 130, 130, 130, 130, 130, 72, 148, 148, 72, 75, 76, 75, 133, 134, 134, 136, 136, 136, 235, 139, 119, 77, 140, 233, 135, 136, 136, 136, 82, 82, 82, 89, 89, 225, 149, 148, 148, 78, 150, 93, 78, 75, 76, 75, 145, 107, 146, 146, 91, 108, 92, 92, 219, 77, 93, 147, 147, 199, 93, 148, 148, 195, 103, 104, 104, 194, 113, 114, 114, 78, 128, 190, 78, 143, 105, 186, 143, 143, 115, 182, 143, 143, 143, 178, 143, 151, 151, 151, 143, 84, 156, 156, 156, 152, 117, 118, 118, 153, 157, 160, 160, 160, 158, 130, 130, 130, 120, 161, 133, 134, 134, 162, 175, 171, 171, 171, 136, 136, 136, 173, 135, 161, 170, 146, 146, 172, 143, 128, 164, 143, 143, 93, 163, 143, 143, 143, 159, 143, 151, 151, 151, 143, 180, 104, 104, 154, 152, 156, 156, 156, 153, 184, 114, 114, 181, 157, 160, 160, 160, 158, 188, 118, 118, 185, 161, 171, 171, 171, 162, 197, 134, 134, 189, 161, 203, 204, 204, 172, 180, 104, 104, 198, 180, 104, 104, 84, 205, 180, 104, 104, 181, 208, 209, 209, 181, 184, 114, 114, 138, 206, 184, 114, 114, 210, 184, 114, 114, 185, 213, 214, 214, 137, 185, 188, 118, 118, 211, 188, 118, 118, 215, 188, 118, 118, 132, 189, 221, 222, 222, 189, 197, 134, 134, 216, 197, 134, 134, 131, 223, 197, 134, 134, 198, 203, 204, 204, 198, 203, 204, 204, 111, 224, 151, 151, 151, 205, 203, 204, 204, 205, 152, 180, 104, 104, 153, 208, 209, 209, 228, 208, 209, 209, 128, 206, 156, 156, 156, 210, 208, 209, 209, 210, 157, 184, 114, 114, 158, 213, 214, 214, 229, 213, 214, 214, 111, 211, 160, 160, 160, 215, 213, 214, 214, 215, 161, 188, 118, 118, 162, 221, 222, 222, 230, 221, 222, 222, 109, 216, 171, 171, 171, 223, 221, 222, 222, 223, 161, 197, 134, 134, 172, 203, 204, 204, 234, 208, 209, 209, 101, 224, 213, 214, 214, 228, 221, 222, 222, 229, 100, 243, 243, 243, 230, 99, 98, 97, 234, 244, 246, 246, 246, 245, 90, 243, 243, 243, 247, 87, 280, 73, 248, 244, 246, 246, 246, 245, 73, 258, 243, 243, 247, 67, 67, 63, 248, 259, 263, 246, 246, 260, 63, 258, 243, 243, 264, 57, 57, 55, 265, 259, 258, 243, 243, 260, 55, 267, 268, 268, 259, 49, 49, 280, 260, 259, 258, 243, 243, 269, 280, 263, 246, 246, 259, 280, 280, 280, 270, 264, 263, 246, 246, 265, 280, 272, 273, 273, 264, 280, 280, 280, 265, 264, 263, 246, 246, 274, 280, 258, 243, 243, 264, 280, 280, 280, 275, 276, 258, 243, 243, 260, 280, 243, 243, 243, 276, 280, 280, 280, 260, 277, 258, 243, 243, 245, 280, 258, 243, 243, 276, 280, 280, 280, 270, 259, 263, 246, 246, 270, 280, 263, 246, 246, 278, 280, 280, 280, 265, 278, 246, 246, 246, 265, 280, 263, 246, 246, 279, 280, 280, 280, 248, 278, 263, 246, 246, 275, 280, 267, 268, 268, 264, 280, 280, 280, 275, 259, 272, 273, 273, 269, 280, 280, 280, 280, 264, 280, 280, 280, 274, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 83, 280, 280, 280, 83, 86, 280, 280, 86, 86, 86, 96, 280, 280, 96, 96, 96, 102, 102, 102, 102, 102, 280, 102, 102, 102, 102, 102, 106, 106, 106, 106, 106, 106, 280, 106, 106, 106, 106, 110, 110, 110, 280, 110, 110, 110, 110, 110, 110, 110, 112, 112, 112, 112, 112, 280, 112, 112, 112, 112, 112, 116, 116, 116, 116, 116, 280, 116, 116, 116, 116, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 126, 126, 126, 126, 126, 280, 126, 126, 126, 126, 126, 127, 127, 127, 127, 280, 127, 127, 127, 127, 127, 127, 129, 280, 280, 280, 129, 129, 141, 280, 280, 141, 141, 141, 142, 280, 142, 142, 142, 142, 142, 142, 142, 142, 142, 144, 280, 280, 280, 144, 155, 280, 280, 280, 155, 165, 165, 166, 166, 167, 167, 168, 280, 280, 168, 168, 168, 169, 280, 169, 169, 169, 169, 169, 169, 169, 169, 169, 174, 280, 174, 174, 174, 174, 174, 174, 174, 174, 174, 176, 176, 177, 177, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 191, 191, 192, 192, 193, 193, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 200, 200, 201, 201, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 217, 217, 218, 218, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 226, 226, 227, 227, 231, 231, 232, 232, 236, 236, 237, 237, 238, 238, 241, 241, 242, 242, 249, 249, 250, 250, 251, 251, 251, 251, 251, 280, 251, 251, 251, 251, 251, 253, 253, 253, 253, 253, 280, 253, 253, 253, 253, 253, 255, 255, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 271, 271, 271, 271, 271, 271, 271, 271, 271, 271, 271, 27, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280 } ; static yyconst flex_int16_t yy_chk[1177] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 25, 253, 5, 5, 11, 12, 5, 5, 5, 15, 5, 11, 12, 15, 5, 6, 16, 26, 6, 6, 16, 33, 6, 6, 6, 38, 6, 38, 38, 25, 6, 33, 33, 11, 12, 19, 19, 19, 29, 29, 29, 30, 30, 30, 41, 41, 26, 19, 40, 251, 40, 40, 49, 49, 49, 52, 85, 85, 40, 52, 57, 57, 57, 19, 49, 248, 19, 20, 20, 20, 61, 245, 57, 60, 60, 60, 63, 63, 63, 20, 235, 60, 233, 61, 63, 60, 61, 61, 63, 69, 69, 69, 70, 70, 70, 20, 147, 147, 20, 23, 23, 23, 73, 73, 73, 75, 75, 75, 225, 81, 73, 23, 81, 219, 73, 76, 76, 76, 82, 82, 82, 89, 89, 199, 100, 148, 148, 23, 100, 89, 23, 24, 24, 24, 91, 107, 91, 91, 92, 107, 92, 92, 194, 24, 91, 93, 93, 175, 92, 93, 93, 172, 103, 103, 103, 170, 113, 113, 113, 24, 168, 164, 24, 87, 103, 162, 87, 87, 113, 158, 87, 87, 87, 153, 87, 104, 104, 104, 87, 141, 114, 114, 114, 104, 117, 117, 117, 104, 114, 118, 118, 118, 114, 130, 130, 130, 117, 118, 133, 133, 133, 118, 138, 134, 134, 134, 136, 136, 136, 135, 133, 134, 132, 146, 146, 134, 143, 129, 122, 143, 143, 146, 120, 143, 143, 143, 115, 143, 151, 151, 151, 143, 154, 154, 154, 105, 151, 156, 156, 156, 151, 159, 159, 159, 154, 156, 160, 160, 160, 156, 163, 163, 163, 159, 160, 171, 171, 171, 160, 173, 173, 173, 163, 171, 178, 178, 178, 171, 179, 179, 179, 173, 180, 180, 180, 86, 178, 181, 181, 181, 179, 182, 182, 182, 180, 183, 183, 183, 78, 181, 184, 184, 184, 182, 185, 185, 185, 183, 186, 186, 186, 77, 184, 187, 187, 187, 185, 188, 188, 188, 186, 189, 189, 189, 72, 187, 195, 195, 195, 188, 196, 196, 196, 189, 197, 197, 197, 71, 195, 198, 198, 198, 196, 202, 202, 202, 197, 203, 203, 203, 67, 198, 204, 204, 204, 202, 205, 205, 205, 203, 204, 206, 206, 206, 204, 207, 207, 207, 205, 208, 208, 208, 66, 206, 209, 209, 209, 207, 210, 210, 210, 208, 209, 211, 211, 211, 209, 212, 212, 212, 210, 213, 213, 213, 55, 211, 214, 214, 214, 212, 215, 215, 215, 213, 214, 216, 216, 216, 214, 220, 220, 220, 215, 221, 221, 221, 53, 216, 222, 222, 222, 220, 223, 223, 223, 221, 222, 224, 224, 224, 222, 228, 228, 228, 223, 229, 229, 229, 47, 224, 230, 230, 230, 228, 234, 234, 234, 229, 46, 239, 239, 239, 230, 45, 44, 43, 234, 239, 240, 240, 240, 239, 39, 243, 243, 243, 240, 37, 27, 22, 240, 243, 246, 246, 246, 243, 21, 252, 252, 252, 246, 18, 17, 14, 246, 252, 254, 254, 254, 252, 13, 257, 257, 257, 254, 10, 9, 8, 254, 257, 258, 258, 258, 257, 7, 259, 259, 259, 258, 4, 3, 0, 258, 259, 260, 260, 260, 259, 0, 262, 262, 262, 260, 0, 0, 0, 260, 262, 263, 263, 263, 262, 0, 264, 264, 264, 263, 0, 0, 0, 263, 264, 265, 265, 265, 264, 0, 266, 266, 266, 265, 0, 0, 0, 265, 266, 267, 267, 267, 266, 0, 268, 268, 268, 267, 0, 0, 0, 267, 268, 269, 269, 269, 268, 0, 270, 270, 270, 269, 0, 0, 0, 269, 270, 271, 271, 271, 270, 0, 272, 272, 272, 271, 0, 0, 0, 271, 272, 273, 273, 273, 272, 0, 274, 274, 274, 273, 0, 0, 0, 273, 274, 275, 275, 275, 274, 0, 276, 276, 276, 275, 0, 0, 0, 275, 276, 278, 278, 278, 276, 0, 0, 0, 0, 278, 0, 0, 0, 278, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 287, 287, 287, 287, 287, 287, 287, 287, 287, 287, 287, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, 290, 290, 290, 290, 290, 290, 290, 290, 290, 290, 290, 291, 0, 0, 0, 291, 292, 0, 0, 292, 292, 292, 293, 0, 0, 293, 293, 293, 294, 294, 294, 294, 294, 0, 294, 294, 294, 294, 294, 295, 295, 295, 295, 295, 295, 0, 295, 295, 295, 295, 296, 296, 296, 0, 296, 296, 296, 296, 296, 296, 296, 297, 297, 297, 297, 297, 0, 297, 297, 297, 297, 297, 298, 298, 298, 298, 298, 0, 298, 298, 298, 298, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 300, 300, 300, 300, 300, 0, 300, 300, 300, 300, 300, 301, 301, 301, 301, 0, 301, 301, 301, 301, 301, 301, 302, 0, 0, 0, 302, 302, 303, 0, 0, 303, 303, 303, 304, 0, 304, 304, 304, 304, 304, 304, 304, 304, 304, 305, 0, 0, 0, 305, 306, 0, 0, 0, 306, 307, 307, 308, 308, 309, 309, 310, 0, 0, 310, 310, 310, 311, 0, 311, 311, 311, 311, 311, 311, 311, 311, 311, 312, 0, 312, 312, 312, 312, 312, 312, 312, 312, 312, 313, 313, 314, 314, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 318, 318, 319, 319, 320, 320, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 322, 322, 323, 323, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 327, 327, 328, 328, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 330, 330, 331, 331, 332, 332, 333, 333, 334, 334, 335, 335, 336, 336, 337, 337, 338, 338, 339, 339, 340, 340, 341, 341, 341, 341, 341, 0, 341, 341, 341, 341, 341, 342, 342, 342, 342, 342, 0, 342, 342, 342, 342, 342, 343, 343, 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280 } ; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET #line 1 "scan.l" #line 2 "scan.l" /*------------------------------------------------------------------------- * * scan.l * lexical scanner for PostgreSQL * * NOTE NOTE NOTE: * * The rules in this file must be kept in sync with psql's lexer!!! * * The rules are designed so that the scanner never has to backtrack, * in the sense that there is always a rule that can match the input * consumed so far (the rule action may internally throw back some input * with yyless(), however). As explained in the flex manual, this makes * for a useful speed increase --- about a third faster than a plain -CF * lexer, in simple testing. The extra complexity is mostly in the rules * for handling float numbers and continued string literals. If you change * the lexical rules, verify that you haven't broken the no-backtrack * property by running flex with the "-b" option and checking that the * resulting "lex.backup" file says that no backing up is needed. (As of * Postgres 9.2, this check is made automatically by the Makefile.) * * * Portions Copyright (c) 2003-2014, PgPool Global Development Group * Portions Copyright (c) 1996-2014, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION * src/backend/parser/scan.l * *------------------------------------------------------------------------- */ #include "pool_parser.h" #include #include #include "parser.h" /* only needed for GUC variables */ #include "scanner.h" #include "scansup.h" #include "pg_wchar.h" #include "gram.h" #include "utils/palloc.h" /* Avoid exit() on fatal scanner errors (a bit ugly -- see yy_fatal_error) */ #undef fprintf #define fprintf(file, fmt, msg) fprintf_to_ereport(fmt, msg) static void fprintf_to_ereport(const char *fmt, const char *msg) { ereport(ERROR, (errmsg_internal("%s", msg))); } /* * GUC variables. This is a DIRECT violation of the warning given at the * head of gram.y, ie flex/bison code must not depend on any GUC variables; * as such, changing their values can induce very unintuitive behavior. * But we shall have to live with it as a short-term thing until the switch * to SQL-standard string syntax is complete. */ int backslash_quote = BACKSLASH_QUOTE_SAFE_ENCODING; bool escape_string_warning = true; bool standard_conforming_strings = true; /* * Set the type of YYSTYPE. */ #define YYSTYPE core_YYSTYPE /* * Set the type of yyextra. All state variables used by the scanner should * be in yyextra, *not* statically allocated. */ #define YY_EXTRA_TYPE core_yy_extra_type * /* * Each call to core_yylex must set yylloc to the location of the found token * (expressed as a byte offset from the start of the input text). * When we parse a token that requires multiple lexer rules to process, * this should be done in the first such rule, else yylloc will point * into the middle of the token. */ #define SET_YYLLOC() (*(yylloc) = yytext - yyextra->scanbuf) /* * Advance yylloc by the given number of bytes. */ #define ADVANCE_YYLLOC(delta) ( *(yylloc) += (delta) ) #define startlit() ( yyextra->literallen = 0 ) static void addlit(char *ytext, int yleng, core_yyscan_t yyscanner); static void addlitchar(unsigned char ychar, core_yyscan_t yyscanner); static char *litbufdup(core_yyscan_t yyscanner); static char *litbuf_udeescape(unsigned char escape, core_yyscan_t yyscanner); static unsigned char unescape_single_char(unsigned char c, core_yyscan_t yyscanner); static int process_integer_literal(const char *token, YYSTYPE *lval); static bool is_utf16_surrogate_first(pg_wchar c); static bool is_utf16_surrogate_second(pg_wchar c); static pg_wchar surrogate_pair_to_codepoint(pg_wchar first, pg_wchar second); static void addunicode(pg_wchar c, yyscan_t yyscanner); static bool check_uescapechar(unsigned char escape); #define yyerror(msg) scanner_yyerror(msg, yyscanner) #define lexer_errposition() scanner_errposition(*(yylloc), yyscanner) static void check_string_escape_warning(unsigned char ychar, core_yyscan_t yyscanner); static void check_escape_warning(core_yyscan_t yyscanner); /* * Work around a bug in flex 2.5.35: it emits a couple of functions that * it forgets to emit declarations for. Since we use -Wmissing-prototypes, * this would cause warnings. Providing our own declarations should be * harmless even when the bug gets fixed. */ extern int core_yyget_column(yyscan_t yyscanner); extern void core_yyset_column(int column_no, yyscan_t yyscanner); #define YY_NO_INPUT 1 /* * OK, here is a short description of lex/flex rules behavior. * The longest pattern which matches an input string is always chosen. * For equal-length patterns, the first occurring in the rules list is chosen. * INITIAL is the starting state, to which all non-conditional rules apply. * Exclusive states change parsing rules while the state is active. When in * an exclusive state, only those rules defined for that state apply. * * We use exclusive states for quoted strings, extended comments, * and to eliminate parsing troubles for numeric strings. * Exclusive states: * bit string literal * extended C-style comments * delimited identifiers (double-quoted identifiers) * hexadecimal numeric string * standard quoted strings * extended quoted strings (support backslash escape sequences) * $foo$ quoted strings * quoted identifier with Unicode escapes * end of a quoted identifier with Unicode escapes, UESCAPE can follow * quoted string with Unicode escapes * end of a quoted string with Unicode escapes, UESCAPE can follow * Unicode surrogate pair in extended quoted string * * Remember to add an <> case whenever you add a new exclusive state! * The default one is probably not the right thing. */ /* * In order to make the world safe for Windows and Mac clients as well as * Unix ones, we accept either \n or \r as a newline. A DOS-style \r\n * sequence will be seen as two successive newlines, but that doesn't cause * any problems. Comments that start with -- and extend to the next * newline are treated as equivalent to a single whitespace character. * * NOTE a fine point: if there is no newline following --, we will absorb * everything to the end of the input as a comment. This is correct. Older * versions of Postgres failed to recognize -- as a comment if the input * did not end with a newline. * * XXX perhaps \f (formfeed) should be treated as a newline as well? * * XXX if you change the set of whitespace characters, fix scanner_isspace() * to agree, and see also the plpgsql lexer. */ /* * SQL requires at least one newline in the whitespace separating * string literals that are to be concatenated. Silly, but who are we * to argue? Note that {whitespace_with_newline} should not have * after * it, whereas {whitespace} should generally have a * after it... */ /* * To ensure that {quotecontinue} can be scanned without having to back up * if the full pattern isn't matched, we include trailing whitespace in * {quotestop}. This matches all cases where {quotecontinue} fails to match, * except for {quote} followed by whitespace and just one "-" (not two, * which would start a {comment}). To cover that we have {quotefail}. * The actions for {quotestop} and {quotefail} must throw back characters * beyond the quote proper. */ /* Bit string * It is tempting to scan the string for only those characters * which are allowed. However, this leads to silently swallowed * characters if illegal characters are included in the string. * For example, if xbinside is [01] then B'ABCD' is interpreted * as a zero-length string, and the ABCD' is lost! * Better to pass the string forward and let the input routines * validate the contents. */ /* Hexadecimal number */ /* National character */ /* Quoted string that allows backslash escapes */ /* Extended quote * xqdouble implements embedded quote, '''' */ /* $foo$ style quotes ("dollar quoting") * The quoted string starts with $foo$ where "foo" is an optional string * in the form of an identifier, except that it may not contain "$", * and extends to the first occurrence of an identical string. * There is *no* processing of the quoted text. * * {dolqfailed} is an error rule to avoid scanner backup when {dolqdelim} * fails to match its trailing "$". */ /* Double quote * Allows embedded spaces and other special characters into identifiers. */ /* Unicode escapes */ /* error rule to avoid backup */ /* Quoted identifier with Unicode escapes */ /* Quoted string with Unicode escapes */ /* Optional UESCAPE after a quoted string or identifier with Unicode escapes. */ /* error rule to avoid backup */ /* C-style comments * * The "extended comment" syntax closely resembles allowable operator syntax. * The tricky part here is to get lex to recognize a string starting with * slash-star as a comment, when interpreting it as an operator would produce * a longer match --- remember lex will prefer a longer match! Also, if we * have something like plus-slash-star, lex will think this is a 3-character * operator whereas we want to see it as a + operator and a comment start. * The solution is two-fold: * 1. append {op_chars}* to xcstart so that it matches as much text as * {operator} would. Then the tie-breaker (first matching rule of same * length) ensures xcstart wins. We put back the extra stuff with yyless() * in case it contains a star-slash that should terminate the comment. * 2. In the operator rule, check for slash-star within the operator, and * if found throw it back with yyless(). This handles the plus-slash-star * problem. * Dash-dash comments have similar interactions with the operator rule. */ /* * "self" is the set of chars that should be returned as single-character * tokens. "op_chars" is the set of chars that can make up "Op" tokens, * which can be one or more characters long (but if a single-char token * appears in the "self" set, it is not to be returned as an Op). Note * that the sets overlap, but each has some chars that are not in the other. * * If you change either set, adjust the character lists appearing in the * rule for "operator"! */ /* we no longer allow unary minus in numbers. * instead we pass it separately to parser. there it gets * coerced via doNegate() -- Leon aug 20 1999 * * {decimalfail} is used because we would like "1..10" to lex as 1, dot_dot, 10. * * {realfail1} and {realfail2} are added to prevent the need for scanner * backup when the {real} rule fails to match completely. */ /* * Dollar quoted strings are totally opaque, and no escaping is done on them. * Other quoted strings must allow some special characters such as single-quote * and newline. * Embedded single-quotes are implemented both in the SQL standard * style of two adjacent single quotes "''" and in the Postgres/Java style * of escaped-quote "\'". * Other embedded escaped characters are matched explicitly and the leading * backslash is dropped from the string. * Note that xcstart must appear before operator, as explained above! * Also whitespace (comment) must appear before operator. */ #line 1068 "scan.c" #define INITIAL 0 #define xb 1 #define xc 2 #define xd 3 #define xh 4 #define xe 5 #define xq 6 #define xdolq 7 #define xui 8 #define xuiend 9 #define xus 10 #define xusend 11 #define xeu 12 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ #include #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif /* Holds the entire state of the reentrant scanner. */ struct yyguts_t { /* User-defined. Not touched by flex. */ YY_EXTRA_TYPE yyextra_r; /* The rest are the same as the globals declared in the non-reentrant scanner. */ FILE *yyin_r, *yyout_r; size_t yy_buffer_stack_top; /**< index of top of stack. */ size_t yy_buffer_stack_max; /**< capacity of stack. */ YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ char yy_hold_char; int yy_n_chars; int yyleng_r; char *yy_c_buf_p; int yy_init; int yy_start; int yy_did_buffer_switch_on_eof; int yy_start_stack_ptr; int yy_start_stack_depth; int *yy_start_stack; yy_state_type yy_last_accepting_state; char* yy_last_accepting_cpos; int yylineno_r; int yy_flex_debug_r; char *yytext_r; int yy_more_flag; int yy_more_len; YYSTYPE * yylval_r; YYLTYPE * yylloc_r; }; /* end struct yyguts_t */ static int yy_init_globals (yyscan_t yyscanner ); /* This must go here because YYSTYPE and YYLTYPE are included * from bison output in section 1.*/ # define yylval yyg->yylval_r # define yylloc yyg->yylloc_r int core_yylex_init (yyscan_t* scanner); int core_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ int core_yylex_destroy (yyscan_t yyscanner ); int core_yyget_debug (yyscan_t yyscanner ); void core_yyset_debug (int debug_flag ,yyscan_t yyscanner ); YY_EXTRA_TYPE core_yyget_extra (yyscan_t yyscanner ); void core_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); FILE *core_yyget_in (yyscan_t yyscanner ); void core_yyset_in (FILE * in_str ,yyscan_t yyscanner ); FILE *core_yyget_out (yyscan_t yyscanner ); void core_yyset_out (FILE * out_str ,yyscan_t yyscanner ); int core_yyget_leng (yyscan_t yyscanner ); char *core_yyget_text (yyscan_t yyscanner ); int core_yyget_lineno (yyscan_t yyscanner ); void core_yyset_lineno (int line_number ,yyscan_t yyscanner ); YYSTYPE * core_yyget_lval (yyscan_t yyscanner ); void core_yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); YYLTYPE *core_yyget_lloc (yyscan_t yyscanner ); void core_yyset_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner ); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int core_yywrap (yyscan_t yyscanner ); #else extern int core_yywrap (yyscan_t yyscanner ); #endif #endif #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (yyscan_t yyscanner ); #else static int input (yyscan_t yyscanner ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ unsigned n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \ } \ errno=0; \ clearerr(yyin); \ } \ }\ \ #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) #endif /* end tables serialization structures and prototypes */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 extern int core_yylex \ (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner); #define YY_DECL int core_yylex \ (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif #define YY_RULE_SETUP \ YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; #line 389 "scan.l" #line 1322 "scan.c" yylval = yylval_param; yylloc = yylloc_param; if ( !yyg->yy_init ) { yyg->yy_init = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! yyg->yy_start ) yyg->yy_start = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { core_yyensure_buffer_stack (yyscanner); YY_CURRENT_BUFFER_LVALUE = core_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); } core_yy_load_buffer_state(yyscanner ); } while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = yyg->yy_c_buf_p; /* Support of yytext. */ *yy_cp = yyg->yy_hold_char; /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = yyg->yy_start; yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; yyg->yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 281 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } while ( yy_current_state != 280 ); yy_cp = yyg->yy_last_accepting_cpos; yy_current_state = yyg->yy_last_accepting_state; yy_find_action: yy_act = yy_accept[yy_current_state]; YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = yyg->yy_hold_char; yy_cp = yyg->yy_last_accepting_cpos; yy_current_state = yyg->yy_last_accepting_state; goto yy_find_action; case 1: /* rule 1 can match eol */ YY_RULE_SETUP #line 391 "scan.l" { /* ignore */ } YY_BREAK case 2: YY_RULE_SETUP #line 395 "scan.l" { /* Set location in case of syntax error in comment */ SET_YYLLOC(); yyextra->xcdepth = 0; BEGIN(xc); /* Put back any characters past slash-star; see above */ yyless(2); } YY_BREAK case 3: YY_RULE_SETUP #line 404 "scan.l" { (yyextra->xcdepth)++; /* Put back any characters past slash-star; see above */ yyless(2); } YY_BREAK case 4: YY_RULE_SETUP #line 410 "scan.l" { if (yyextra->xcdepth <= 0) BEGIN(INITIAL); else (yyextra->xcdepth)--; } YY_BREAK case 5: /* rule 5 can match eol */ YY_RULE_SETUP #line 417 "scan.l" { /* ignore */ } YY_BREAK case 6: YY_RULE_SETUP #line 421 "scan.l" { /* ignore */ } YY_BREAK case 7: YY_RULE_SETUP #line 425 "scan.l" { /* ignore */ } YY_BREAK case YY_STATE_EOF(xc): #line 429 "scan.l" { yyerror("unterminated /* comment"); } YY_BREAK case 8: YY_RULE_SETUP #line 431 "scan.l" { /* Binary bit type. * At some point we should simply pass the string * forward to the parser and label it there. * In the meantime, place a leading "b" on the string * to mark it for the input routine as a binary string. */ SET_YYLLOC(); BEGIN(xb); startlit(); addlitchar('b', yyscanner); } YY_BREAK case 9: /* rule 9 can match eol */ #line 444 "scan.l" case 10: /* rule 10 can match eol */ YY_RULE_SETUP #line 444 "scan.l" { yyless(1); BEGIN(INITIAL); yylval->str = litbufdup(yyscanner); return BCONST; } YY_BREAK case 11: /* rule 11 can match eol */ #line 451 "scan.l" case 12: /* rule 12 can match eol */ YY_RULE_SETUP #line 451 "scan.l" { addlit(yytext, yyleng, yyscanner); } YY_BREAK case 13: /* rule 13 can match eol */ #line 455 "scan.l" case 14: /* rule 14 can match eol */ YY_RULE_SETUP #line 455 "scan.l" { /* ignore */ } YY_BREAK case YY_STATE_EOF(xb): #line 458 "scan.l" { yyerror("unterminated bit string literal"); } YY_BREAK case 15: YY_RULE_SETUP #line 460 "scan.l" { /* Hexadecimal bit type. * At some point we should simply pass the string * forward to the parser and label it there. * In the meantime, place a leading "x" on the string * to mark it for the input routine as a hex string. */ SET_YYLLOC(); BEGIN(xh); startlit(); addlitchar('x', yyscanner); } YY_BREAK case 16: /* rule 16 can match eol */ #line 473 "scan.l" case 17: /* rule 17 can match eol */ YY_RULE_SETUP #line 473 "scan.l" { yyless(1); BEGIN(INITIAL); yylval->str = litbufdup(yyscanner); return XCONST; } YY_BREAK case YY_STATE_EOF(xh): #line 479 "scan.l" { yyerror("unterminated hexadecimal string literal"); } YY_BREAK case 18: YY_RULE_SETUP #line 481 "scan.l" { /* National character. * We will pass this along as a normal character string, * but preceded with an internally-generated "NCHAR". */ const ScanKeyword *keyword; SET_YYLLOC(); yyless(1); /* eat only 'n' this time */ keyword = ScanKeywordLookup("nchar", yyextra->keywords, yyextra->num_keywords); if (keyword != NULL) { yylval->keyword = keyword->name; return keyword->value; } else { /* If NCHAR isn't a keyword, just return "n" */ yylval->str = pstrdup("n"); return IDENT; } } YY_BREAK case 19: YY_RULE_SETUP #line 507 "scan.l" { yyextra->warn_on_first_escape = true; yyextra->saw_non_ascii = false; SET_YYLLOC(); if (standard_conforming_strings) BEGIN(xq); else BEGIN(xe); startlit(); } YY_BREAK case 20: YY_RULE_SETUP #line 517 "scan.l" { yyextra->warn_on_first_escape = false; yyextra->saw_non_ascii = false; SET_YYLLOC(); BEGIN(xe); startlit(); } YY_BREAK case 21: YY_RULE_SETUP #line 524 "scan.l" { SET_YYLLOC(); if (!standard_conforming_strings) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("unsafe use of string constant with Unicode escapes"), errdetail("String constants with Unicode escapes cannot be used when standard_conforming_strings is off."), lexer_errposition())); BEGIN(xus); startlit(); } YY_BREAK case 22: /* rule 22 can match eol */ #line 536 "scan.l" case 23: /* rule 23 can match eol */ YY_RULE_SETUP #line 536 "scan.l" { yyless(1); BEGIN(INITIAL); /* * check that the data remains valid if it might have been * made invalid by unescaping any chars. */ if (yyextra->saw_non_ascii) pg_verifymbstr(yyextra->literalbuf, yyextra->literallen, false); yylval->str = litbufdup(yyscanner); return SCONST; } YY_BREAK case 24: /* rule 24 can match eol */ #line 551 "scan.l" case 25: /* rule 25 can match eol */ YY_RULE_SETUP #line 551 "scan.l" { /* throw back all but the quote */ yyless(1); /* xusend state looks for possible UESCAPE */ BEGIN(xusend); } YY_BREAK case 26: /* rule 26 can match eol */ YY_RULE_SETUP #line 557 "scan.l" { /* stay in xusend state over whitespace */ } YY_BREAK case 27: #line 559 "scan.l" case 28: /* rule 28 can match eol */ #line 560 "scan.l" case YY_STATE_EOF(xusend): #line 560 "scan.l" { /* no UESCAPE after the quote, throw back everything */ yyless(0); BEGIN(INITIAL); yylval->str = litbuf_udeescape('\\', yyscanner); return SCONST; } YY_BREAK case 29: /* rule 29 can match eol */ YY_RULE_SETUP #line 567 "scan.l" { /* found UESCAPE after the end quote */ BEGIN(INITIAL); if (!check_uescapechar(yytext[yyleng-2])) { SET_YYLLOC(); ADVANCE_YYLLOC(yyleng-2); yyerror("invalid Unicode escape character"); } yylval->str = litbuf_udeescape(yytext[yyleng-2], yyscanner); return SCONST; } YY_BREAK case 30: YY_RULE_SETUP #line 579 "scan.l" { addlitchar('\'', yyscanner); } YY_BREAK case 31: /* rule 31 can match eol */ YY_RULE_SETUP #line 582 "scan.l" { addlit(yytext, yyleng, yyscanner); } YY_BREAK case 32: /* rule 32 can match eol */ YY_RULE_SETUP #line 585 "scan.l" { addlit(yytext, yyleng, yyscanner); } YY_BREAK case 33: YY_RULE_SETUP #line 588 "scan.l" { pg_wchar c = strtoul(yytext+2, NULL, 16); check_escape_warning(yyscanner); if (is_utf16_surrogate_first(c)) { yyextra->utf16_first_part = c; BEGIN(xeu); } else if (is_utf16_surrogate_second(c)) yyerror("invalid Unicode surrogate pair"); else addunicode(c, yyscanner); } YY_BREAK case 34: YY_RULE_SETUP #line 603 "scan.l" { pg_wchar c = strtoul(yytext+2, NULL, 16); if (!is_utf16_surrogate_second(c)) yyerror("invalid Unicode surrogate pair"); c = surrogate_pair_to_codepoint(yyextra->utf16_first_part, c); addunicode(c, yyscanner); BEGIN(xe); } YY_BREAK case 35: YY_RULE_SETUP #line 615 "scan.l" { yyerror("invalid Unicode surrogate pair"); } YY_BREAK case 36: /* rule 36 can match eol */ YY_RULE_SETUP #line 616 "scan.l" { yyerror("invalid Unicode surrogate pair"); } YY_BREAK case YY_STATE_EOF(xeu): #line 617 "scan.l" { yyerror("invalid Unicode surrogate pair"); } YY_BREAK case 37: YY_RULE_SETUP #line 618 "scan.l" { ereport(ERROR, (errcode(ERRCODE_INVALID_ESCAPE_SEQUENCE), errmsg("invalid Unicode escape"), errhint("Unicode escapes must be \\uXXXX or \\UXXXXXXXX."), lexer_errposition())); } YY_BREAK case 38: /* rule 38 can match eol */ YY_RULE_SETUP #line 625 "scan.l" { #ifdef PGPOOL_NOT_USED if (yytext[1] == '\'') { if (backslash_quote == BACKSLASH_QUOTE_OFF || (backslash_quote == BACKSLASH_QUOTE_SAFE_ENCODING && PG_ENCODING_IS_CLIENT_ONLY(pg_get_client_encoding()))) ereport(ERROR, (errcode(ERRCODE_NONSTANDARD_USE_OF_ESCAPE_CHARACTER), errmsg("unsafe use of \\' in a string literal"), errhint("Use '' to write quotes in strings. \\' is insecure in client-only encodings."), lexer_errposition())); } #endif check_string_escape_warning(yytext[1], yyscanner); addlitchar(unescape_single_char(yytext[1], yyscanner), yyscanner); } YY_BREAK case 39: YY_RULE_SETUP #line 643 "scan.l" { unsigned char c = strtoul(yytext+1, NULL, 8); check_escape_warning(yyscanner); addlitchar(c, yyscanner); if (c == '\0' || IS_HIGHBIT_SET(c)) yyextra->saw_non_ascii = true; } YY_BREAK case 40: YY_RULE_SETUP #line 651 "scan.l" { unsigned char c = strtoul(yytext+2, NULL, 16); check_escape_warning(yyscanner); addlitchar(c, yyscanner); if (c == '\0' || IS_HIGHBIT_SET(c)) yyextra->saw_non_ascii = true; } YY_BREAK case 41: /* rule 41 can match eol */ YY_RULE_SETUP #line 659 "scan.l" { /* ignore */ } YY_BREAK case 42: YY_RULE_SETUP #line 662 "scan.l" { /* This is only needed for \ just before EOF */ addlitchar(yytext[0], yyscanner); } YY_BREAK case YY_STATE_EOF(xq): case YY_STATE_EOF(xe): case YY_STATE_EOF(xus): #line 666 "scan.l" { yyerror("unterminated quoted string"); } YY_BREAK case 43: YY_RULE_SETUP #line 668 "scan.l" { SET_YYLLOC(); yyextra->dolqstart = pstrdup(yytext); BEGIN(xdolq); startlit(); } YY_BREAK case 44: YY_RULE_SETUP #line 674 "scan.l" { SET_YYLLOC(); /* throw back all but the initial "$" */ yyless(1); /* and treat it as {other} */ return yytext[0]; } YY_BREAK case 45: YY_RULE_SETUP #line 681 "scan.l" { if (strcmp(yytext, yyextra->dolqstart) == 0) { pfree(yyextra->dolqstart); yyextra->dolqstart = NULL; BEGIN(INITIAL); yylval->str = litbufdup(yyscanner); return SCONST; } else { /* * When we fail to match $...$ to dolqstart, transfer * the $... part to the output, but put back the final * $ for rescanning. Consider $delim$...$junk$delim$ */ addlit(yytext, yyleng-1, yyscanner); yyless(yyleng-1); } } YY_BREAK case 46: /* rule 46 can match eol */ YY_RULE_SETUP #line 701 "scan.l" { addlit(yytext, yyleng, yyscanner); } YY_BREAK case 47: YY_RULE_SETUP #line 704 "scan.l" { addlit(yytext, yyleng, yyscanner); } YY_BREAK case 48: YY_RULE_SETUP #line 707 "scan.l" { /* This is only needed for $ inside the quoted text */ addlitchar(yytext[0], yyscanner); } YY_BREAK case YY_STATE_EOF(xdolq): #line 711 "scan.l" { yyerror("unterminated dollar-quoted string"); } YY_BREAK case 49: YY_RULE_SETUP #line 713 "scan.l" { SET_YYLLOC(); BEGIN(xd); startlit(); } YY_BREAK case 50: YY_RULE_SETUP #line 718 "scan.l" { SET_YYLLOC(); BEGIN(xui); startlit(); } YY_BREAK case 51: YY_RULE_SETUP #line 723 "scan.l" { char *ident; BEGIN(INITIAL); if (yyextra->literallen == 0) yyerror("zero-length delimited identifier"); ident = litbufdup(yyscanner); if (yyextra->literallen >= NAMEDATALEN) truncate_identifier(ident, yyextra->literallen, true); yylval->str = ident; return IDENT; } YY_BREAK case 52: YY_RULE_SETUP #line 735 "scan.l" { yyless(1); /* xuiend state looks for possible UESCAPE */ BEGIN(xuiend); } YY_BREAK case 53: /* rule 53 can match eol */ YY_RULE_SETUP #line 740 "scan.l" { /* stay in xuiend state over whitespace */ } YY_BREAK case 54: #line 742 "scan.l" case 55: /* rule 55 can match eol */ #line 743 "scan.l" case YY_STATE_EOF(xuiend): #line 743 "scan.l" { /* no UESCAPE after the quote, throw back everything */ char *ident; int identlen; yyless(0); BEGIN(INITIAL); if (yyextra->literallen == 0) yyerror("zero-length delimited identifier"); ident = litbuf_udeescape('\\', yyscanner); identlen = strlen(ident); if (identlen >= NAMEDATALEN) truncate_identifier(ident, identlen, true); yylval->str = ident; return IDENT; } YY_BREAK case 56: /* rule 56 can match eol */ YY_RULE_SETUP #line 760 "scan.l" { /* found UESCAPE after the end quote */ char *ident; int identlen; BEGIN(INITIAL); if (yyextra->literallen == 0) yyerror("zero-length delimited identifier"); if (!check_uescapechar(yytext[yyleng-2])) { SET_YYLLOC(); ADVANCE_YYLLOC(yyleng-2); yyerror("invalid Unicode escape character"); } ident = litbuf_udeescape(yytext[yyleng - 2], yyscanner); identlen = strlen(ident); if (identlen >= NAMEDATALEN) truncate_identifier(ident, identlen, true); yylval->str = ident; return IDENT; } YY_BREAK case 57: YY_RULE_SETUP #line 781 "scan.l" { addlitchar('"', yyscanner); } YY_BREAK case 58: /* rule 58 can match eol */ YY_RULE_SETUP #line 784 "scan.l" { addlit(yytext, yyleng, yyscanner); } YY_BREAK case YY_STATE_EOF(xd): case YY_STATE_EOF(xui): #line 787 "scan.l" { yyerror("unterminated quoted identifier"); } YY_BREAK case 59: YY_RULE_SETUP #line 789 "scan.l" { char *ident; SET_YYLLOC(); /* throw back all but the initial u/U */ yyless(1); /* and treat it as {identifier} */ ident = downcase_truncate_identifier(yytext, yyleng, true); yylval->str = ident; return IDENT; } YY_BREAK case 60: YY_RULE_SETUP #line 801 "scan.l" { SET_YYLLOC(); return TYPECAST; } YY_BREAK case 61: YY_RULE_SETUP #line 806 "scan.l" { SET_YYLLOC(); return DOT_DOT; } YY_BREAK case 62: YY_RULE_SETUP #line 811 "scan.l" { SET_YYLLOC(); return COLON_EQUALS; } YY_BREAK case 63: YY_RULE_SETUP #line 816 "scan.l" { SET_YYLLOC(); return yytext[0]; } YY_BREAK case 64: YY_RULE_SETUP #line 821 "scan.l" { /* * Check for embedded slash-star or dash-dash; those * are comment starts, so operator must stop there. * Note that slash-star or dash-dash at the first * character will match a prior rule, not this one. */ int nchars = yyleng; char *slashstar = strstr(yytext, "/*"); char *dashdash = strstr(yytext, "--"); if (slashstar && dashdash) { /* if both appear, take the first one */ if (slashstar > dashdash) slashstar = dashdash; } else if (!slashstar) slashstar = dashdash; if (slashstar) nchars = slashstar - yytext; /* * For SQL compatibility, '+' and '-' cannot be the * last char of a multi-char operator unless the operator * contains chars that are not in SQL operators. * The idea is to lex '=-' as two operators, but not * to forbid operator names like '?-' that could not be * sequences of SQL operators. */ while (nchars > 1 && (yytext[nchars-1] == '+' || yytext[nchars-1] == '-')) { int ic; for (ic = nchars-2; ic >= 0; ic--) { if (strchr("~!@#^&|`?%", yytext[ic])) break; } if (ic >= 0) break; /* found a char that makes it OK */ nchars--; /* else remove the +/-, and check again */ } SET_YYLLOC(); if (nchars < yyleng) { /* Strip the unwanted chars from the token */ yyless(nchars); /* * If what we have left is only one char, and it's * one of the characters matching "self", then * return it as a character token the same way * that the "self" rule would have. */ if (nchars == 1 && strchr(",()[].;:+-*/%^<>=", yytext[0])) return yytext[0]; } /* * Complain if operator is too long. Unlike the case * for identifiers, we make this an error not a notice- * and-truncate, because the odds are we are looking at * a syntactic mistake anyway. */ if (nchars >= NAMEDATALEN) yyerror("operator too long"); /* Convert "!=" operator to "<>" for compatibility */ if (strcmp(yytext, "!=") == 0) yylval->str = pstrdup("<>"); else yylval->str = pstrdup(yytext); return Op; } YY_BREAK case 65: YY_RULE_SETUP #line 901 "scan.l" { SET_YYLLOC(); yylval->ival = atol(yytext + 1); return PARAM; } YY_BREAK case 66: YY_RULE_SETUP #line 907 "scan.l" { SET_YYLLOC(); return process_integer_literal(yytext, yylval); } YY_BREAK case 67: YY_RULE_SETUP #line 911 "scan.l" { SET_YYLLOC(); yylval->str = pstrdup(yytext); return FCONST; } YY_BREAK case 68: YY_RULE_SETUP #line 916 "scan.l" { /* throw back the .., and treat as integer */ yyless(yyleng-2); SET_YYLLOC(); return process_integer_literal(yytext, yylval); } YY_BREAK case 69: YY_RULE_SETUP #line 922 "scan.l" { SET_YYLLOC(); yylval->str = pstrdup(yytext); return FCONST; } YY_BREAK case 70: YY_RULE_SETUP #line 927 "scan.l" { /* * throw back the [Ee], and treat as {decimal}. Note * that it is possible the input is actually {integer}, * but since this case will almost certainly lead to a * syntax error anyway, we don't bother to distinguish. */ yyless(yyleng-1); SET_YYLLOC(); yylval->str = pstrdup(yytext); return FCONST; } YY_BREAK case 71: YY_RULE_SETUP #line 939 "scan.l" { /* throw back the [Ee][+-], and proceed as above */ yyless(yyleng-2); SET_YYLLOC(); yylval->str = pstrdup(yytext); return FCONST; } YY_BREAK case 72: YY_RULE_SETUP #line 948 "scan.l" { const ScanKeyword *keyword; char *ident; SET_YYLLOC(); /* Is it a keyword? */ keyword = ScanKeywordLookup(yytext, yyextra->keywords, yyextra->num_keywords); if (keyword != NULL) { yylval->keyword = keyword->name; return keyword->value; } /* * No. Convert the identifier to lower case, and truncate * if necessary. */ ident = downcase_truncate_identifier(yytext, yyleng, true); yylval->str = ident; return IDENT; } YY_BREAK case 73: YY_RULE_SETUP #line 973 "scan.l" { SET_YYLLOC(); return yytext[0]; } YY_BREAK case YY_STATE_EOF(INITIAL): #line 978 "scan.l" { SET_YYLLOC(); yyterminate(); } YY_BREAK case 74: YY_RULE_SETUP #line 983 "scan.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK #line 2298 "scan.c" case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = yyg->yy_hold_char; YY_RESTORE_YY_MORE_OFFSET if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * core_yylex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) { /* This was really a NUL. */ yy_state_type yy_next_state; yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( yyscanner ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++yyg->yy_c_buf_p; yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = yyg->yy_last_accepting_cpos; yy_current_state = yyg->yy_last_accepting_state; goto yy_find_action; } } else switch ( yy_get_next_buffer( yyscanner ) ) { case EOB_ACT_END_OF_FILE: { yyg->yy_did_buffer_switch_on_eof = 0; if ( core_yywrap(yyscanner ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! yyg->yy_did_buffer_switch_on_eof ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( yyscanner ); yy_cp = yyg->yy_c_buf_p; yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: yyg->yy_c_buf_p = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; yy_current_state = yy_get_previous_state( yyscanner ); yy_cp = yyg->yy_c_buf_p; yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of core_yylex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; register char *source = yyg->yytext_ptr; register int number_to_move, i; int ret_val; if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; else { int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = YY_CURRENT_BUFFER; int yy_c_buf_p_offset = (int) (yyg->yy_c_buf_p - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ core_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), yyg->yy_n_chars, (size_t) num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; } if ( yyg->yy_n_chars == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; core_yyrestart(yyin ,yyscanner); } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) core_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); } yyg->yy_n_chars += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state (yyscan_t yyscanner) { register yy_state_type yy_current_state; register char *yy_cp; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yy_current_state = yyg->yy_start; for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; yyg->yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 281 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) { register int yy_is_jam; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ register char *yy_cp = yyg->yy_c_buf_p; register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; yyg->yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 281 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 280); return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (yyscan_t yyscanner) #else static int input (yyscan_t yyscanner) #endif { int c; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; *yyg->yy_c_buf_p = yyg->yy_hold_char; if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) /* This was really a NUL. */ *yyg->yy_c_buf_p = '\0'; else { /* need more input */ int offset = yyg->yy_c_buf_p - yyg->yytext_ptr; ++yyg->yy_c_buf_p; switch ( yy_get_next_buffer( yyscanner ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ core_yyrestart(yyin ,yyscanner); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( core_yywrap(yyscanner ) ) return EOF; if ( ! yyg->yy_did_buffer_switch_on_eof ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(yyscanner); #else return input(yyscanner); #endif } case EOB_ACT_CONTINUE_SCAN: yyg->yy_c_buf_p = yyg->yytext_ptr + offset; break; } } } c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ yyg->yy_hold_char = *++yyg->yy_c_buf_p; return c; } #endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * @param yyscanner The scanner object. * @note This function does not reset the start condition to @c INITIAL . */ void core_yyrestart (FILE * input_file , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( ! YY_CURRENT_BUFFER ){ core_yyensure_buffer_stack (yyscanner); YY_CURRENT_BUFFER_LVALUE = core_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); } core_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner); core_yy_load_buffer_state(yyscanner ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * @param yyscanner The scanner object. */ void core_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* TODO. We should be able to replace this entire function body * with * core_yypop_buffer_state(); * core_yypush_buffer_state(new_buffer); */ core_yyensure_buffer_stack (yyscanner); if ( YY_CURRENT_BUFFER == new_buffer ) return; if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *yyg->yy_c_buf_p = yyg->yy_hold_char; YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; } YY_CURRENT_BUFFER_LVALUE = new_buffer; core_yy_load_buffer_state(yyscanner ); /* We don't actually know whether we did this switch during * EOF (core_yywrap()) processing, but the only time this flag * is looked at is after core_yywrap() is called, so it's safe * to go ahead and always set it. */ yyg->yy_did_buffer_switch_on_eof = 1; } static void core_yy_load_buffer_state (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; yyg->yy_hold_char = *yyg->yy_c_buf_p; } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * @param yyscanner The scanner object. * @return the allocated buffer state. */ YY_BUFFER_STATE core_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) core_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in core_yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) core_yyalloc(b->yy_buf_size + 2 ,yyscanner ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in core_yy_create_buffer()" ); b->yy_is_our_buffer = 1; core_yy_init_buffer(b,file ,yyscanner); return b; } /** Destroy the buffer. * @param b a buffer created with core_yy_create_buffer() * @param yyscanner The scanner object. */ void core_yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) core_yyfree((void *) b->yy_ch_buf ,yyscanner ); core_yyfree((void *) b ,yyscanner ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a core_yyrestart() or at EOF. */ static void core_yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) { int oerrno = errno; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; core_yy_flush_buffer(b ,yyscanner); b->yy_input_file = file; b->yy_fill_buffer = 1; /* If b is the current buffer, then core_yy_init_buffer was _probably_ * called from core_yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } b->yy_is_interactive = 0; errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * @param yyscanner The scanner object. */ void core_yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) core_yy_load_buffer_state(yyscanner ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * @param yyscanner The scanner object. */ void core_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (new_buffer == NULL) return; core_yyensure_buffer_stack(yyscanner); /* This block is copied from core_yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *yyg->yy_c_buf_p = yyg->yy_hold_char; YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) yyg->yy_buffer_stack_top++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from core_yy_switch_to_buffer. */ core_yy_load_buffer_state(yyscanner ); yyg->yy_did_buffer_switch_on_eof = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * @param yyscanner The scanner object. */ void core_yypop_buffer_state (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (!YY_CURRENT_BUFFER) return; core_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner); YY_CURRENT_BUFFER_LVALUE = NULL; if (yyg->yy_buffer_stack_top > 0) --yyg->yy_buffer_stack_top; if (YY_CURRENT_BUFFER) { core_yy_load_buffer_state(yyscanner ); yyg->yy_did_buffer_switch_on_eof = 1; } } /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ static void core_yyensure_buffer_stack (yyscan_t yyscanner) { int num_to_alloc; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (!yyg->yy_buffer_stack) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; yyg->yy_buffer_stack = (struct yy_buffer_state**)core_yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) , yyscanner); if ( ! yyg->yy_buffer_stack ) YY_FATAL_ERROR( "out of dynamic memory in core_yyensure_buffer_stack()" ); memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); yyg->yy_buffer_stack_max = num_to_alloc; yyg->yy_buffer_stack_top = 0; return; } if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ /* Increase the buffer to prepare for a possible push. */ int grow_size = 8 /* arbitrary grow size */; num_to_alloc = yyg->yy_buffer_stack_max + grow_size; yyg->yy_buffer_stack = (struct yy_buffer_state**)core_yyrealloc (yyg->yy_buffer_stack, num_to_alloc * sizeof(struct yy_buffer_state*) , yyscanner); if ( ! yyg->yy_buffer_stack ) YY_FATAL_ERROR( "out of dynamic memory in core_yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); yyg->yy_buffer_stack_max = num_to_alloc; } } /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ YY_BUFFER_STATE core_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) core_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in core_yy_scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; core_yy_switch_to_buffer(b ,yyscanner ); return b; } /** Setup the input buffer state to scan a string. The next call to core_yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * @param yyscanner The scanner object. * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * core_yy_scan_bytes() instead. */ YY_BUFFER_STATE core_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner) { return core_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner); } /** Setup the input buffer state to scan the given bytes. The next call to core_yylex() will * scan from a @e copy of @a bytes. * @param bytes the byte buffer to scan * @param len the number of bytes in the buffer pointed to by @a bytes. * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ YY_BUFFER_STATE core_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner) { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) core_yyalloc(n ,yyscanner ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in core_yy_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; b = core_yy_scan_buffer(buf,n ,yyscanner); if ( ! b ) YY_FATAL_ERROR( "bad buffer in core_yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner) { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = yyg->yy_hold_char; \ yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ yyg->yy_hold_char = *yyg->yy_c_buf_p; \ *yyg->yy_c_buf_p = '\0'; \ yyleng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the user-defined data for this scanner. * @param yyscanner The scanner object. */ YY_EXTRA_TYPE core_yyget_extra (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyextra; } /** Get the current line number. * @param yyscanner The scanner object. */ int core_yyget_lineno (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (! YY_CURRENT_BUFFER) return 0; return yylineno; } /** Get the current column number. * @param yyscanner The scanner object. */ int core_yyget_column (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (! YY_CURRENT_BUFFER) return 0; return yycolumn; } /** Get the input stream. * @param yyscanner The scanner object. */ FILE *core_yyget_in (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyin; } /** Get the output stream. * @param yyscanner The scanner object. */ FILE *core_yyget_out (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyout; } /** Get the length of the current token. * @param yyscanner The scanner object. */ int core_yyget_leng (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyleng; } /** Get the current token. * @param yyscanner The scanner object. */ char *core_yyget_text (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yytext; } /** Set the user-defined data. This data is never touched by the scanner. * @param user_defined The data to be associated with this scanner. * @param yyscanner The scanner object. */ void core_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yyextra = user_defined ; } /** Set the current line number. * @param line_number * @param yyscanner The scanner object. */ void core_yyset_lineno (int line_number , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* lineno is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) yy_fatal_error( "core_yyset_lineno called with no buffer" , yyscanner); yylineno = line_number; } /** Set the current column. * @param line_number * @param yyscanner The scanner object. */ void core_yyset_column (int column_no , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* column is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) yy_fatal_error( "core_yyset_column called with no buffer" , yyscanner); yycolumn = column_no; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. * @param yyscanner The scanner object. * @see core_yy_switch_to_buffer */ void core_yyset_in (FILE * in_str , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yyin = in_str ; } void core_yyset_out (FILE * out_str , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yyout = out_str ; } int core_yyget_debug (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yy_flex_debug; } void core_yyset_debug (int bdebug , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yy_flex_debug = bdebug ; } /* Accessor methods for yylval and yylloc */ YYSTYPE * core_yyget_lval (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yylval; } void core_yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yylval = yylval_param; } YYLTYPE *core_yyget_lloc (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yylloc; } void core_yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yylloc = yylloc_param; } /* User-visible API */ /* core_yylex_init is special because it creates the scanner itself, so it is * the ONLY reentrant function that doesn't take the scanner as the last argument. * That's why we explicitly handle the declaration, instead of using our macros. */ int core_yylex_init(yyscan_t* ptr_yy_globals) { if (ptr_yy_globals == NULL){ errno = EINVAL; return 1; } *ptr_yy_globals = (yyscan_t) core_yyalloc ( sizeof( struct yyguts_t ), NULL ); if (*ptr_yy_globals == NULL){ errno = ENOMEM; return 1; } /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); return yy_init_globals ( *ptr_yy_globals ); } /* core_yylex_init_extra has the same functionality as core_yylex_init, but follows the * convention of taking the scanner as the last argument. Note however, that * this is a *pointer* to a scanner, as it will be allocated by this call (and * is the reason, too, why this function also must handle its own declaration). * The user defined value in the first argument will be available to core_yyalloc in * the yyextra field. */ int core_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) { struct yyguts_t dummy_yyguts; core_yyset_extra (yy_user_defined, &dummy_yyguts); if (ptr_yy_globals == NULL){ errno = EINVAL; return 1; } *ptr_yy_globals = (yyscan_t) core_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); if (*ptr_yy_globals == NULL){ errno = ENOMEM; return 1; } /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); core_yyset_extra (yy_user_defined, *ptr_yy_globals); return yy_init_globals ( *ptr_yy_globals ); } static int yy_init_globals (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* Initialization is the same as for the non-reentrant scanner. * This function is called from core_yylex_destroy(), so don't allocate here. */ yyg->yy_buffer_stack = 0; yyg->yy_buffer_stack_top = 0; yyg->yy_buffer_stack_max = 0; yyg->yy_c_buf_p = (char *) 0; yyg->yy_init = 0; yyg->yy_start = 0; yyg->yy_start_stack_ptr = 0; yyg->yy_start_stack_depth = 0; yyg->yy_start_stack = NULL; /* Defined in main.c */ #ifdef YY_STDINIT yyin = stdin; yyout = stdout; #else yyin = (FILE *) 0; yyout = (FILE *) 0; #endif /* For future reference: Set errno on error, since we are called by * core_yylex_init() */ return 0; } /* core_yylex_destroy is for both reentrant and non-reentrant scanners. */ int core_yylex_destroy (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ core_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); YY_CURRENT_BUFFER_LVALUE = NULL; core_yypop_buffer_state(yyscanner); } /* Destroy the stack itself. */ core_yyfree(yyg->yy_buffer_stack ,yyscanner); yyg->yy_buffer_stack = NULL; /* Destroy the start condition stack. */ core_yyfree(yyg->yy_start_stack ,yyscanner ); yyg->yy_start_stack = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * core_yylex() is called, initialization will occur. */ yy_init_globals( yyscanner); /* Destroy the main struct (reentrant only). */ core_yyfree ( yyscanner , yyscanner ); yyscanner = NULL; return 0; } /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner) { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif #define YYTABLES_NAME "yytables" #line 983 "scan.l" /* * Arrange access to yyextra for subroutines of the main core_yylex() function. * We expect each subroutine to have a yyscanner parameter. Rather than * use the yyget_xxx functions, which might or might not get inlined by the * compiler, we cheat just a bit and cast yyscanner to the right type. */ #undef yyextra #define yyextra (((struct yyguts_t *) yyscanner)->yyextra_r) /* Likewise for a couple of other things we need. */ #undef yylloc #define yylloc (((struct yyguts_t *) yyscanner)->yylloc_r) #undef yyleng #define yyleng (((struct yyguts_t *) yyscanner)->yyleng_r) /* * scanner_errposition * Report a lexer or grammar error cursor position, if possible. * * This is expected to be used within an ereport() call. The return value * is a dummy (always 0, in fact). * * Note that this can only be used for messages emitted during raw parsing * (essentially, scan.l and gram.y), since it requires the yyscanner struct * to still be available. */ int scanner_errposition(int location, core_yyscan_t yyscanner) { #ifdef PGPOOL_NOT_USED int pos; if (location < 0) return 0; /* no-op if location is unknown */ /* Convert byte offset to character number */ pos = pg_mbstrlen_with_len(yyextra->scanbuf, location) + 1; /* And pass it to the ereport mechanism */ return errposition(pos); #endif return 0; } /* * scanner_yyerror * Report a lexer or grammar error. * * The message's cursor position is whatever YYLLOC was last set to, * ie, the start of the current token if called within core_yylex(), or the * most recently lexed token if called from the grammar. * This is OK for syntax error messages from the Bison parser, because Bison * parsers report error as soon as the first unparsable token is reached. * Beware of using yyerror for other purposes, as the cursor position might * be misleading! */ void scanner_yyerror(const char *message, core_yyscan_t yyscanner) { const char *loc = yyextra->scanbuf + *yylloc; if (*loc == YY_END_OF_BUFFER_CHAR) { ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), /* translator: %s is typically the translation of "syntax error" */ errmsg("%s at end of input", _(message)), lexer_errposition())); } else { ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), /* translator: first %s is typically the translation of "syntax error" */ errmsg("%s at or near \"%s\"", _(message), loc), lexer_errposition())); } } /* * Called before any actual parsing is done */ core_yyscan_t scanner_init(const char *str, core_yy_extra_type *yyext, const ScanKeyword *keywords, int num_keywords) { Size slen = strlen(str); yyscan_t scanner; if (core_yylex_init(&scanner) != 0) elog(ERROR, "core_yylex_init() failed: %m"); core_yyset_extra(yyext, scanner); yyext->keywords = keywords; yyext->num_keywords = num_keywords; /* * Make a scan buffer with special termination needed by flex. */ yyext->scanbuf = (char *) palloc(slen + 2); yyext->scanbuflen = slen; memcpy(yyext->scanbuf, str, slen); yyext->scanbuf[slen] = yyext->scanbuf[slen + 1] = YY_END_OF_BUFFER_CHAR; core_yy_scan_buffer(yyext->scanbuf,slen + 2,scanner); /* initialize literal buffer to a reasonable but expansible size */ yyext->literalalloc = 1024; yyext->literalbuf = (char *) palloc(yyext->literalalloc); yyext->literallen = 0; return scanner; } /* * Called after parsing is done to clean up after scanner_init() */ void scanner_finish(core_yyscan_t yyscanner) { /* * We don't bother to call core_yylex_destroy(), because all it would do * is pfree a small amount of control storage. It's cheaper to leak * the storage until the parsing context is destroyed. The amount of * space involved is usually negligible compared to the output parse * tree anyway. * * We do bother to pfree the scanbuf and literal buffer, but only if they * represent a nontrivial amount of space. The 8K cutoff is arbitrary. */ if (yyextra->scanbuflen >= 8192) pfree(yyextra->scanbuf); if (yyextra->literalalloc >= 8192) pfree(yyextra->literalbuf); } static void addlit(char *ytext, int yleng, core_yyscan_t yyscanner) { /* enlarge buffer if needed */ if ((yyextra->literallen + yleng) >= yyextra->literalalloc) { do { yyextra->literalalloc *= 2; } while ((yyextra->literallen + yleng) >= yyextra->literalalloc); yyextra->literalbuf = (char *) repalloc(yyextra->literalbuf, yyextra->literalalloc); } /* append new data */ memcpy(yyextra->literalbuf + yyextra->literallen, ytext, yleng); yyextra->literallen += yleng; } static void addlitchar(unsigned char ychar, core_yyscan_t yyscanner) { /* enlarge buffer if needed */ if ((yyextra->literallen + 1) >= yyextra->literalalloc) { yyextra->literalalloc *= 2; yyextra->literalbuf = (char *) repalloc(yyextra->literalbuf, yyextra->literalalloc); } /* append new data */ yyextra->literalbuf[yyextra->literallen] = ychar; yyextra->literallen += 1; } /* * Create a palloc'd copy of literalbuf, adding a trailing null. */ static char * litbufdup(core_yyscan_t yyscanner) { int llen = yyextra->literallen; char *new; new = palloc(llen + 1); memcpy(new, yyextra->literalbuf, llen); new[llen] = '\0'; return new; } static int process_integer_literal(const char *token, YYSTYPE *lval) { long val; char *endptr; errno = 0; val = strtol(token, &endptr, 10); if (*endptr != '\0' || errno == ERANGE #ifdef HAVE_LONG_INT_64 /* if long > 32 bits, check for overflow of int4 */ || val != (long) ((int32) val) #endif ) { /* integer too large, treat it as a float */ lval->str = pstrdup(token); return FCONST; } lval->ival = val; return ICONST; } static unsigned int hexval(unsigned char c) { if (c >= '0' && c <= '9') return c - '0'; if (c >= 'a' && c <= 'f') return c - 'a' + 0xA; if (c >= 'A' && c <= 'F') return c - 'A' + 0xA; elog(ERROR, "invalid hexadecimal digit"); return 0; /* not reached */ } static void check_unicode_value(pg_wchar c, char *loc, core_yyscan_t yyscanner) { if (GetDatabaseEncoding() == PG_UTF8) return; if (c > 0x7F) { ADVANCE_YYLLOC(loc - yyextra->literalbuf + 3); /* 3 for U&" */ yyerror("Unicode escape values cannot be used for code point values above 007F when the server encoding is not UTF8"); } } static bool is_utf16_surrogate_first(pg_wchar c) { return (c >= 0xD800 && c <= 0xDBFF); } static bool is_utf16_surrogate_second(pg_wchar c) { return (c >= 0xDC00 && c <= 0xDFFF); } static pg_wchar surrogate_pair_to_codepoint(pg_wchar first, pg_wchar second) { return ((first & 0x3FF) << 10) + 0x10000 + (second & 0x3FF); } static void addunicode(pg_wchar c, core_yyscan_t yyscanner) { char buf[8]; if (c == 0 || c > 0x10FFFF) yyerror("invalid Unicode escape value"); if (c > 0x7F) { if (GetDatabaseEncoding() != PG_UTF8) yyerror("Unicode escape values cannot be used for code point values above 007F when the server encoding is not UTF8"); yyextra->saw_non_ascii = true; } unicode_to_utf8(c, (unsigned char *) buf); addlit(buf, pg_mblen(buf), yyscanner); } /* is 'escape' acceptable as Unicode escape character (UESCAPE syntax) ? */ static bool check_uescapechar(unsigned char escape) { if (isxdigit(escape) || escape == '+' || escape == '\'' || escape == '"' || scanner_isspace(escape)) { return false; } else return true; } /* like litbufdup, but handle unicode escapes */ static char * litbuf_udeescape(unsigned char escape, core_yyscan_t yyscanner) { char *new; char *litbuf, *in, *out; pg_wchar pair_first = 0; /* Make literalbuf null-terminated to simplify the scanning loop */ litbuf = yyextra->literalbuf; litbuf[yyextra->literallen] = '\0'; /* * This relies on the subtle assumption that a UTF-8 expansion * cannot be longer than its escaped representation. */ new = palloc(yyextra->literallen + 1); in = litbuf; out = new; while (*in) { if (in[0] == escape) { if (in[1] == escape) { if (pair_first) { ADVANCE_YYLLOC(in - litbuf + 3); /* 3 for U&" */ yyerror("invalid Unicode surrogate pair"); } *out++ = escape; in += 2; } else if (isxdigit((unsigned char) in[1]) && isxdigit((unsigned char) in[2]) && isxdigit((unsigned char) in[3]) && isxdigit((unsigned char) in[4])) { pg_wchar unicode; unicode = (hexval(in[1]) << 12) + (hexval(in[2]) << 8) + (hexval(in[3]) << 4) + hexval(in[4]); check_unicode_value(unicode, in, yyscanner); if (pair_first) { if (is_utf16_surrogate_second(unicode)) { unicode = surrogate_pair_to_codepoint(pair_first, unicode); pair_first = 0; } else { ADVANCE_YYLLOC(in - litbuf + 3); /* 3 for U&" */ yyerror("invalid Unicode surrogate pair"); } } else if (is_utf16_surrogate_second(unicode)) yyerror("invalid Unicode surrogate pair"); if (is_utf16_surrogate_first(unicode)) pair_first = unicode; else { unicode_to_utf8(unicode, (unsigned char *) out); out += pg_mblen(out); } in += 5; } else if (in[1] == '+' && isxdigit((unsigned char) in[2]) && isxdigit((unsigned char) in[3]) && isxdigit((unsigned char) in[4]) && isxdigit((unsigned char) in[5]) && isxdigit((unsigned char) in[6]) && isxdigit((unsigned char) in[7])) { pg_wchar unicode; unicode = (hexval(in[2]) << 20) + (hexval(in[3]) << 16) + (hexval(in[4]) << 12) + (hexval(in[5]) << 8) + (hexval(in[6]) << 4) + hexval(in[7]); check_unicode_value(unicode, in, yyscanner); if (pair_first) { if (is_utf16_surrogate_second(unicode)) { unicode = surrogate_pair_to_codepoint(pair_first, unicode); pair_first = 0; } else { ADVANCE_YYLLOC(in - litbuf + 3); /* 3 for U&" */ yyerror("invalid Unicode surrogate pair"); } } else if (is_utf16_surrogate_second(unicode)) yyerror("invalid Unicode surrogate pair"); if (is_utf16_surrogate_first(unicode)) pair_first = unicode; else { unicode_to_utf8(unicode, (unsigned char *) out); out += pg_mblen(out); } in += 8; } else { ADVANCE_YYLLOC(in - litbuf + 3); /* 3 for U&" */ yyerror("invalid Unicode escape value"); } } else { if (pair_first) { ADVANCE_YYLLOC(in - litbuf + 3); /* 3 for U&" */ yyerror("invalid Unicode surrogate pair"); } *out++ = *in++; } } *out = '\0'; /* * We could skip pg_verifymbstr if we didn't process any non-7-bit-ASCII * codes; but it's probably not worth the trouble, since this isn't * likely to be a performance-critical path. */ pg_verifymbstr(new, out - new, false); return new; } static unsigned char unescape_single_char(unsigned char c, core_yyscan_t yyscanner) { switch (c) { case 'b': return '\b'; case 'f': return '\f'; case 'n': return '\n'; case 'r': return '\r'; case 't': return '\t'; default: /* check for backslash followed by non-7-bit-ASCII */ if (c == '\0' || IS_HIGHBIT_SET(c)) yyextra->saw_non_ascii = true; return c; } } static void check_string_escape_warning(unsigned char ychar, core_yyscan_t yyscanner) { if (ychar == '\'') { if (yyextra->warn_on_first_escape && escape_string_warning) ereport(WARNING, (errcode(ERRCODE_NONSTANDARD_USE_OF_ESCAPE_CHARACTER), errmsg("nonstandard use of \\' in a string literal"), errhint("Use '' to write quotes in strings, or use the escape string syntax (E'...')."), lexer_errposition())); yyextra->warn_on_first_escape = false; /* warn only once per string */ } else if (ychar == '\\') { if (yyextra->warn_on_first_escape && escape_string_warning) ereport(WARNING, (errcode(ERRCODE_NONSTANDARD_USE_OF_ESCAPE_CHARACTER), errmsg("nonstandard use of \\\\ in a string literal"), errhint("Use the escape string syntax for backslashes, e.g., E'\\\\'."), lexer_errposition())); yyextra->warn_on_first_escape = false; /* warn only once per string */ } else check_escape_warning(yyscanner); } static void check_escape_warning(core_yyscan_t yyscanner) { if (yyextra->warn_on_first_escape && escape_string_warning) ereport(WARNING, (errcode(ERRCODE_NONSTANDARD_USE_OF_ESCAPE_CHARACTER), errmsg("nonstandard use of escape in a string literal"), errhint("Use the escape string syntax for escapes, e.g., E'\\r\\n'."), lexer_errposition())); yyextra->warn_on_first_escape = false; /* warn only once per string */ } /* * Interface functions to make flex use palloc() instead of malloc(). * It'd be better to make these static, but flex insists otherwise. */ void * core_yyalloc(yy_size_t bytes, core_yyscan_t yyscanner) { return palloc(bytes); } void * core_yyrealloc(void *ptr, yy_size_t bytes, core_yyscan_t yyscanner) { if (ptr) return repalloc(ptr, bytes); else return palloc(bytes); } void core_yyfree(void *ptr, core_yyscan_t yyscanner) { if (ptr) pfree(ptr); } pgpool-II-3.4.3/src/parser/Makefile.am0000664000076400007640000000113312554350605014375 00000000000000parser_incdir = $(top_srcdir)/src/include/parser AM_CPPFLAGS = -D_GNU_SOURCE -I $(parser_incdir) -I @PGSQL_INCLUDE_DIR@ noinst_LIBRARIES = libsql-parser.a libsql_parser_a_SOURCES = \ copyfuncs.c \ gram.y \ keywords.c \ kwlookup.c \ list.c \ makefuncs.c \ nodes.c \ outfuncs.c \ parser.c \ pool_string.c \ scansup.c \ snprintf.c \ stringinfo.c \ value.c \ $(top_srcdir)/src/utils/mmgr/mcxt.c \ $(top_srcdir)/src/utils/mmgr/aset.c \ $(top_srcdir)/src/utils/error/elog.c \ wchar.c EXTRA_DIST = scan.c scan.l AM_YFLAGS = -d gram.c: gram.y scan.c scan.c: scan.l $(LEX) -o'scan.c' $< pgpool-II-3.4.3/src/parser/kwlookup.c0000664000076400007640000000450212554350605014363 00000000000000/*------------------------------------------------------------------------- * * kwlookup.c * lexical token lookup for key words in PostgreSQL * * NB - this file is also used by ECPG and several frontend programs in * src/bin/ including pg_dump and psql * * Portions Copyright (c) 2003-2009, PgPool Global Development Group * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION * src/backend/parser/kwlookup.c * *------------------------------------------------------------------------- */ /* use c.h so this can be built as either frontend or backend */ #include #include "pool_parser.h" #include "keywords.h" /* * ScanKeywordLookup - see if a given word is a keyword * * Returns a pointer to the ScanKeyword table entry, or NULL if no match. * * The match is done case-insensitively. Note that we deliberately use a * dumbed-down case conversion that will only translate 'A'-'Z' into 'a'-'z', * even if we are in a locale where tolower() would produce more or different * translations. This is to conform to the SQL99 spec, which says that * keywords are to be matched in this way even though non-keyword identifiers * receive a different case-normalization mapping. */ const ScanKeyword * ScanKeywordLookup(const char *text, const ScanKeyword *keywords, int num_keywords) { int len, i; char word[NAMEDATALEN]; const ScanKeyword *low; const ScanKeyword *high; len = strlen(text); /* We assume all keywords are shorter than NAMEDATALEN. */ if (len >= NAMEDATALEN) return NULL; /* * Apply an ASCII-only downcasing. We must not use tolower() since it may * produce the wrong translation in some locales (eg, Turkish). */ for (i = 0; i < len; i++) { char ch = text[i]; if (ch >= 'A' && ch <= 'Z') ch += 'a' - 'A'; word[i] = ch; } word[len] = '\0'; /* * Now do a binary search using plain strcmp() comparison. */ low = keywords; high = keywords + (num_keywords - 1); while (low <= high) { const ScanKeyword *middle; int difference; middle = low + (high - low) / 2; difference = strcmp(middle->name, word); if (difference == 0) return middle; else if (difference < 0) low = middle + 1; else high = middle - 1; } return NULL; } pgpool-II-3.4.3/src/parser/gram.c0000664000076400007640000712250412554350605013450 00000000000000/* A Bison parser, made by GNU Bison 3.0.2. */ /* Bison implementation for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ #define YYBISON_VERSION "3.0.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 1 /* Push parsers. */ #define YYPUSH 0 /* Pull parsers. */ #define YYPULL 1 /* Substitute the variable and function names. */ #define yyparse base_yyparse #define yylex base_yylex #define yyerror base_yyerror #define yydebug base_yydebug #define yynerrs base_yynerrs /* Copy the first part of user declarations. */ #line 1 "gram.y" /* yacc.c:339 */ /*#define YYDEBUG 1*/ /*------------------------------------------------------------------------- * * gram.y * POSTGRESQL BISON rules/actions * * Portions Copyright (c) 2003-2014, PgPool Global Development Group * Portions Copyright (c) 1996-2014, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION * src/backend/parser/gram.y * * HISTORY * AUTHOR DATE MAJOR EVENT * Andrew Yu Sept, 1994 POSTQUEL to SQL conversion * Andrew Yu Oct, 1994 lispy code conversion * * NOTES * CAPITALS are used to represent terminal symbols. * non-capitals are used to represent non-terminals. * * In general, nothing in this file should initiate database accesses * nor depend on changeable state (such as SET variables). If you do * database accesses, your code will fail when we have aborted the * current transaction and are just parsing commands to find the next * ROLLBACK or COMMIT. If you make use of SET variables, then you * will do the wrong thing in multi-query strings like this: * SET SQL_inheritance TO off; SELECT * FROM foo; * because the entire string is parsed by gram.y before the SET gets * executed. Anything that depends on the database or changeable state * should be handled during parse analysis so that it happens at the * right time not the wrong time. The handling of SQL_inheritance is * a good example. * * WARNINGS * If you use a list, make sure the datum is a node so that the printing * routines work. * * Sometimes we assign constants to makeStrings. Make sure we don't free * those. * *------------------------------------------------------------------------- */ #include "pool_parser.h" #include "utils/elog.h" #include "utils/palloc.h" #include #include #include #include #include #include "nodes.h" #include "keywords.h" #include "gramparse.h" #include "makefuncs.h" #include "pool_string.h" #include "parser.h" #include "pg_class.h" #include "pg_trigger.h" /* * Definition taken from * postgreSQL source code file: src/include/commands/trigger.h */ #define TRIGGER_FIRES_ON_ORIGIN 'O' #define TRIGGER_FIRES_ALWAYS 'A' #define TRIGGER_FIRES_ON_REPLICA 'R' #define TRIGGER_DISABLED 'D' /* * Definition taken from * postgreSQL source code file: src/include/catalog/pg_class.h */ #define REPLICA_IDENTITY_DEFAULT 'd' #define REPLICA_IDENTITY_NOTHING 'n' #define REPLICA_IDENTITY_FULL 'f' #define REPLICA_IDENTITY_INDEX 'i' /* * Definition taken from * postgreSQL source code file: src/include/utils/xml.h */ typedef enum { XML_STANDALONE_YES, XML_STANDALONE_NO, XML_STANDALONE_NO_VALUE, XML_STANDALONE_OMITTED } XmlStandaloneType; static DefElem *defWithOids(bool value); /* * Location tracking support --- simpler than bison's default, since we only * want to track the start position not the end position of each nonterminal. */ #define YYLLOC_DEFAULT(Current, Rhs, N) \ do { \ if ((N) > 0) \ (Current) = (Rhs)[1]; \ else \ (Current) = (-1); \ } while (0) /* * The above macro assigns -1 (unknown) as the parse location of any * nonterminal that was reduced from an empty rule. This is problematic * for nonterminals defined like * OptFooList: / * EMPTY * / { ... } | OptFooList Foo { ... } ; * because we'll set -1 as the location during the first reduction and then * copy it during each subsequent reduction, leaving us with -1 for the * location even when the list is not empty. To fix that, do this in the * action for the nonempty rule(s): * if (@$ < 0) @$ = @2; * (Although we have many nonterminals that follow this pattern, we only * bother with fixing @$ like this when the nonterminal's parse location * is actually referenced in some rule.) */ /* * Bison doesn't allocate anything that needs to live across parser calls, * so we can easily have it use palloc instead of malloc. This prevents * memory leaks if we error out during parsing. Note this only works with * bison >= 2.0. However, in bison 1.875 the default is to use alloca() * if possible, so there's not really much problem anyhow, at least if * you're building with gcc. */ #define YYMALLOC palloc #define YYFREE pfree /* Private struct for the result of privilege_target production */ typedef struct PrivTarget { GrantTargetType targtype; GrantObjectType objtype; List *objs; } PrivTarget; /* ConstraintAttributeSpec yields an integer bitmask of these flags: */ #define CAS_NOT_DEFERRABLE 0x01 #define CAS_DEFERRABLE 0x02 #define CAS_INITIALLY_IMMEDIATE 0x04 #define CAS_INITIALLY_DEFERRED 0x08 #define CAS_NOT_VALID 0x10 #define CAS_NO_INHERIT 0x20 #define parser_yyerror(msg) scanner_yyerror(msg, yyscanner) #define parser_errposition(pos) scanner_errposition(pos, yyscanner) static void base_yyerror(YYLTYPE *yylloc, core_yyscan_t yyscanner, const char *msg); static Node *makeColumnRef(char *colname, List *indirection, int location, core_yyscan_t yyscanner); static Node *makeTypeCast(Node *arg, TypeName *typename, int location); static Node *makeStringConst(char *str, int location); static Node *makeStringConstCast(char *str, int location, TypeName *typename); static Node *makeIntConst(int val, int location); static Node *makeFloatConst(char *str, int location); static Node *makeBitStringConst(char *str, int location); static Node *makeNullAConst(int location); static Node *makeAConst(Value *v, int location); static Node *makeBoolAConst(bool state, int location); static void check_qualified_name(List *names, core_yyscan_t yyscanner); static List *check_func_name(List *names, core_yyscan_t yyscanner); static List *check_indirection(List *indirection, core_yyscan_t yyscanner); static List *extractArgTypes(List *parameters); static List *extractAggrArgTypes(List *aggrargs); static List *makeOrderedSetArgs(List *directargs, List *orderedargs, core_yyscan_t yyscanner); static void insertSelectOptions(SelectStmt *stmt, List *sortClause, List *lockingClause, Node *limitOffset, Node *limitCount, WithClause *withClause, core_yyscan_t yyscanner); static Node *makeSetOp(SetOperation op, bool all, Node *larg, Node *rarg); static Node *doNegate(Node *n, int location); static void doNegateFloat(Value *v); static Node *makeAArrayExpr(List *elements, int location); static Node *makeXmlExpr(XmlExprOp op, char *name, List *named_args, List *args, int location); static List *mergeTableFuncParameters(List *func_args, List *columns); static TypeName *TableFuncTypeName(List *columns); static RangeVar *makeRangeVarFromAnyName(List *names, int position, core_yyscan_t yyscanner); static void SplitColQualList(List *qualList, List **constraintList, CollateClause **collClause, core_yyscan_t yyscanner); static void processCASbits(int cas_bits, int location, const char *constrType, bool *deferrable, bool *initdeferred, bool *not_valid, bool *no_inherit, core_yyscan_t yyscanner); static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query); #line 273 "gram.c" /* yacc.c:339 */ # ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus # define YY_NULLPTR nullptr # else # define YY_NULLPTR 0 # endif # endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif /* In a future release of Bison, this section will be replaced by #include "y.tab.h". */ #ifndef YY_BASE_YY_Y_TAB_H_INCLUDED # define YY_BASE_YY_Y_TAB_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif #if YYDEBUG extern int base_yydebug; #endif /* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { IDENT = 258, FCONST = 259, SCONST = 260, BCONST = 261, XCONST = 262, Op = 263, ICONST = 264, PARAM = 265, TYPECAST = 266, DOT_DOT = 267, COLON_EQUALS = 268, ABORT_P = 269, ABSOLUTE_P = 270, ACCESS = 271, ACTION = 272, ADD_P = 273, ADMIN = 274, AFTER = 275, AGGREGATE = 276, ALL = 277, ALSO = 278, ALTER = 279, ALWAYS = 280, ANALYSE = 281, ANALYZE = 282, AND = 283, ANY = 284, ARRAY = 285, AS = 286, ASC = 287, ASSERTION = 288, ASSIGNMENT = 289, ASYMMETRIC = 290, AT = 291, ATTRIBUTE = 292, AUTHORIZATION = 293, BACKWARD = 294, BEFORE = 295, BEGIN_P = 296, BETWEEN = 297, BIGINT = 298, BINARY = 299, BIT = 300, BOOLEAN_P = 301, BOTH = 302, BY = 303, CACHE = 304, CALLED = 305, CASCADE = 306, CASCADED = 307, CASE = 308, CAST = 309, CATALOG_P = 310, CHAIN = 311, CHAR_P = 312, CHARACTER = 313, CHARACTERISTICS = 314, CHECK = 315, CHECKPOINT = 316, CLASS = 317, CLOSE = 318, CLUSTER = 319, COALESCE = 320, COLLATE = 321, COLLATION = 322, COLUMN = 323, COMMENT = 324, COMMENTS = 325, COMMIT = 326, COMMITTED = 327, CONCURRENTLY = 328, CONFIGURATION = 329, CONNECTION = 330, CONSTRAINT = 331, CONSTRAINTS = 332, CONTENT_P = 333, CONTINUE_P = 334, CONVERSION_P = 335, COPY = 336, COST = 337, CREATE = 338, CROSS = 339, CSV = 340, CURRENT_P = 341, CURRENT_CATALOG = 342, CURRENT_DATE = 343, CURRENT_ROLE = 344, CURRENT_SCHEMA = 345, CURRENT_TIME = 346, CURRENT_TIMESTAMP = 347, CURRENT_USER = 348, CURSOR = 349, CYCLE = 350, DATA_P = 351, DATABASE = 352, DAY_P = 353, DEALLOCATE = 354, DEC = 355, DECIMAL_P = 356, DECLARE = 357, DEFAULT = 358, DEFAULTS = 359, DEFERRABLE = 360, DEFERRED = 361, DEFINER = 362, DELETE_P = 363, DELIMITER = 364, DELIMITERS = 365, DESC = 366, DICTIONARY = 367, DISABLE_P = 368, DISCARD = 369, DISTINCT = 370, DO = 371, DOCUMENT_P = 372, DOMAIN_P = 373, DOUBLE_P = 374, DROP = 375, EACH = 376, ELSE = 377, ENABLE_P = 378, ENCODING = 379, ENCRYPTED = 380, END_P = 381, ENUM_P = 382, ESCAPE = 383, EVENT = 384, EXCEPT = 385, EXCLUDE = 386, EXCLUDING = 387, EXCLUSIVE = 388, EXECUTE = 389, EXISTS = 390, EXPLAIN = 391, EXTENSION = 392, EXTERNAL = 393, EXTRACT = 394, FALSE_P = 395, FAMILY = 396, FETCH = 397, FILTER = 398, FIRST_P = 399, FLOAT_P = 400, FOLLOWING = 401, FOR = 402, FORCE = 403, FOREIGN = 404, FORWARD = 405, FREEZE = 406, FROM = 407, FULL = 408, FUNCTION = 409, FUNCTIONS = 410, GLOBAL = 411, GRANT = 412, GRANTED = 413, GREATEST = 414, GROUP_P = 415, HANDLER = 416, HAVING = 417, HEADER_P = 418, HOLD = 419, HOUR_P = 420, IDENTITY_P = 421, IF_P = 422, ILIKE = 423, IMMEDIATE = 424, IMMUTABLE = 425, IMPLICIT_P = 426, IN_P = 427, INCLUDING = 428, INCREMENT = 429, INDEX = 430, INDEXES = 431, INHERIT = 432, INHERITS = 433, INITIALLY = 434, INLINE_P = 435, INNER_P = 436, INOUT = 437, INPUT_P = 438, INSENSITIVE = 439, INSERT = 440, INSTEAD = 441, INT_P = 442, INTEGER = 443, INTERSECT = 444, INTERVAL = 445, INTO = 446, INVOKER = 447, IS = 448, ISNULL = 449, ISOLATION = 450, JOIN = 451, KEY = 452, LABEL = 453, LANGUAGE = 454, LARGE_P = 455, LAST_P = 456, LATERAL_P = 457, LC_COLLATE_P = 458, LC_CTYPE_P = 459, LEADING = 460, LEAKPROOF = 461, LEAST = 462, LEFT = 463, LEVEL = 464, LIKE = 465, LIMIT = 466, LISTEN = 467, LOAD = 468, LOCAL = 469, LOCALTIME = 470, LOCALTIMESTAMP = 471, LOCATION = 472, LOCK_P = 473, MAPPING = 474, MATCH = 475, MATERIALIZED = 476, MAXVALUE = 477, MINUTE_P = 478, MINVALUE = 479, MODE = 480, MONTH_P = 481, MOVE = 482, NAME_P = 483, NAMES = 484, NATIONAL = 485, NATURAL = 486, NCHAR = 487, NEXT = 488, NO = 489, NONE = 490, NOT = 491, NOTHING = 492, NOTIFY = 493, NOTNULL = 494, NOWAIT = 495, NULL_P = 496, NULLIF = 497, NULLS_P = 498, NUMERIC = 499, OBJECT_P = 500, OF = 501, OFF = 502, OFFSET = 503, OIDS = 504, ON = 505, ONLY = 506, OPERATOR = 507, OPTION = 508, OPTIONS = 509, OR = 510, ORDER = 511, ORDINALITY = 512, OUT_P = 513, OUTER_P = 514, OVER = 515, OVERLAPS = 516, OVERLAY = 517, OWNED = 518, OWNER = 519, PARSER = 520, PARTIAL = 521, PARTITION = 522, PASSING = 523, PASSWORD = 524, PLACING = 525, PLANS = 526, POSITION = 527, PRECEDING = 528, PRECISION = 529, PRESERVE = 530, PREPARE = 531, PREPARED = 532, PRIMARY = 533, PRIOR = 534, PRIVILEGES = 535, PROCEDURAL = 536, PROCEDURE = 537, PROGRAM = 538, QUOTE = 539, RANGE = 540, READ = 541, REAL = 542, REASSIGN = 543, RECHECK = 544, RECURSIVE = 545, REF = 546, REFERENCES = 547, REFRESH = 548, REINDEX = 549, RELATIVE_P = 550, RELEASE = 551, RENAME = 552, REPEATABLE = 553, REPLACE = 554, REPLICA = 555, RESET = 556, RESTART = 557, RESTRICT = 558, RETURNING = 559, RETURNS = 560, REVOKE = 561, RIGHT = 562, ROLE = 563, ROLLBACK = 564, ROW = 565, ROWS = 566, RULE = 567, SAVEPOINT = 568, SCHEMA = 569, SCROLL = 570, SEARCH = 571, SECOND_P = 572, SECURITY = 573, SELECT = 574, SEQUENCE = 575, SEQUENCES = 576, SERIALIZABLE = 577, SERVER = 578, SESSION = 579, SESSION_USER = 580, SET = 581, SETOF = 582, SHARE = 583, SHOW = 584, SIMILAR = 585, SIMPLE = 586, SMALLINT = 587, SNAPSHOT = 588, SOME = 589, STABLE = 590, STANDALONE_P = 591, START = 592, STATEMENT = 593, STATISTICS = 594, STDIN = 595, STDOUT = 596, STORAGE = 597, STRICT_P = 598, STRIP_P = 599, SUBSTRING = 600, SYMMETRIC = 601, SYSID = 602, SYSTEM_P = 603, TABLE = 604, TABLES = 605, TABLESPACE = 606, TEMP = 607, TEMPLATE = 608, TEMPORARY = 609, TEXT_P = 610, THEN = 611, TIME = 612, TIMESTAMP = 613, TO = 614, TRAILING = 615, TRANSACTION = 616, TREAT = 617, TRIGGER = 618, TRIM = 619, TRUE_P = 620, TRUNCATE = 621, TRUSTED = 622, TYPE_P = 623, TYPES_P = 624, UNBOUNDED = 625, UNCOMMITTED = 626, UNENCRYPTED = 627, UNION = 628, UNIQUE = 629, UNKNOWN = 630, UNLISTEN = 631, UNLOGGED = 632, UNTIL = 633, UPDATE = 634, USER = 635, USING = 636, VACUUM = 637, VALID = 638, VALIDATE = 639, VALIDATOR = 640, VALUE_P = 641, VALUES = 642, VARCHAR = 643, VARIADIC = 644, VARYING = 645, VERBOSE = 646, VERSION_P = 647, VIEW = 648, VIEWS = 649, VOLATILE = 650, WHEN = 651, WHERE = 652, WHITESPACE_P = 653, WINDOW = 654, WITH = 655, WITHIN = 656, WITHOUT = 657, WORK = 658, WRAPPER = 659, WRITE = 660, XML_P = 661, XMLATTRIBUTES = 662, XMLCONCAT = 663, XMLELEMENT = 664, XMLEXISTS = 665, XMLFOREST = 666, XMLPARSE = 667, XMLPI = 668, XMLROOT = 669, XMLSERIALIZE = 670, YEAR_P = 671, YES_P = 672, ZONE = 673, NULLS_FIRST = 674, NULLS_LAST = 675, WITH_ORDINALITY = 676, WITH_TIME = 677, POSTFIXOP = 678, UMINUS = 679 }; #endif /* Tokens. */ #define IDENT 258 #define FCONST 259 #define SCONST 260 #define BCONST 261 #define XCONST 262 #define Op 263 #define ICONST 264 #define PARAM 265 #define TYPECAST 266 #define DOT_DOT 267 #define COLON_EQUALS 268 #define ABORT_P 269 #define ABSOLUTE_P 270 #define ACCESS 271 #define ACTION 272 #define ADD_P 273 #define ADMIN 274 #define AFTER 275 #define AGGREGATE 276 #define ALL 277 #define ALSO 278 #define ALTER 279 #define ALWAYS 280 #define ANALYSE 281 #define ANALYZE 282 #define AND 283 #define ANY 284 #define ARRAY 285 #define AS 286 #define ASC 287 #define ASSERTION 288 #define ASSIGNMENT 289 #define ASYMMETRIC 290 #define AT 291 #define ATTRIBUTE 292 #define AUTHORIZATION 293 #define BACKWARD 294 #define BEFORE 295 #define BEGIN_P 296 #define BETWEEN 297 #define BIGINT 298 #define BINARY 299 #define BIT 300 #define BOOLEAN_P 301 #define BOTH 302 #define BY 303 #define CACHE 304 #define CALLED 305 #define CASCADE 306 #define CASCADED 307 #define CASE 308 #define CAST 309 #define CATALOG_P 310 #define CHAIN 311 #define CHAR_P 312 #define CHARACTER 313 #define CHARACTERISTICS 314 #define CHECK 315 #define CHECKPOINT 316 #define CLASS 317 #define CLOSE 318 #define CLUSTER 319 #define COALESCE 320 #define COLLATE 321 #define COLLATION 322 #define COLUMN 323 #define COMMENT 324 #define COMMENTS 325 #define COMMIT 326 #define COMMITTED 327 #define CONCURRENTLY 328 #define CONFIGURATION 329 #define CONNECTION 330 #define CONSTRAINT 331 #define CONSTRAINTS 332 #define CONTENT_P 333 #define CONTINUE_P 334 #define CONVERSION_P 335 #define COPY 336 #define COST 337 #define CREATE 338 #define CROSS 339 #define CSV 340 #define CURRENT_P 341 #define CURRENT_CATALOG 342 #define CURRENT_DATE 343 #define CURRENT_ROLE 344 #define CURRENT_SCHEMA 345 #define CURRENT_TIME 346 #define CURRENT_TIMESTAMP 347 #define CURRENT_USER 348 #define CURSOR 349 #define CYCLE 350 #define DATA_P 351 #define DATABASE 352 #define DAY_P 353 #define DEALLOCATE 354 #define DEC 355 #define DECIMAL_P 356 #define DECLARE 357 #define DEFAULT 358 #define DEFAULTS 359 #define DEFERRABLE 360 #define DEFERRED 361 #define DEFINER 362 #define DELETE_P 363 #define DELIMITER 364 #define DELIMITERS 365 #define DESC 366 #define DICTIONARY 367 #define DISABLE_P 368 #define DISCARD 369 #define DISTINCT 370 #define DO 371 #define DOCUMENT_P 372 #define DOMAIN_P 373 #define DOUBLE_P 374 #define DROP 375 #define EACH 376 #define ELSE 377 #define ENABLE_P 378 #define ENCODING 379 #define ENCRYPTED 380 #define END_P 381 #define ENUM_P 382 #define ESCAPE 383 #define EVENT 384 #define EXCEPT 385 #define EXCLUDE 386 #define EXCLUDING 387 #define EXCLUSIVE 388 #define EXECUTE 389 #define EXISTS 390 #define EXPLAIN 391 #define EXTENSION 392 #define EXTERNAL 393 #define EXTRACT 394 #define FALSE_P 395 #define FAMILY 396 #define FETCH 397 #define FILTER 398 #define FIRST_P 399 #define FLOAT_P 400 #define FOLLOWING 401 #define FOR 402 #define FORCE 403 #define FOREIGN 404 #define FORWARD 405 #define FREEZE 406 #define FROM 407 #define FULL 408 #define FUNCTION 409 #define FUNCTIONS 410 #define GLOBAL 411 #define GRANT 412 #define GRANTED 413 #define GREATEST 414 #define GROUP_P 415 #define HANDLER 416 #define HAVING 417 #define HEADER_P 418 #define HOLD 419 #define HOUR_P 420 #define IDENTITY_P 421 #define IF_P 422 #define ILIKE 423 #define IMMEDIATE 424 #define IMMUTABLE 425 #define IMPLICIT_P 426 #define IN_P 427 #define INCLUDING 428 #define INCREMENT 429 #define INDEX 430 #define INDEXES 431 #define INHERIT 432 #define INHERITS 433 #define INITIALLY 434 #define INLINE_P 435 #define INNER_P 436 #define INOUT 437 #define INPUT_P 438 #define INSENSITIVE 439 #define INSERT 440 #define INSTEAD 441 #define INT_P 442 #define INTEGER 443 #define INTERSECT 444 #define INTERVAL 445 #define INTO 446 #define INVOKER 447 #define IS 448 #define ISNULL 449 #define ISOLATION 450 #define JOIN 451 #define KEY 452 #define LABEL 453 #define LANGUAGE 454 #define LARGE_P 455 #define LAST_P 456 #define LATERAL_P 457 #define LC_COLLATE_P 458 #define LC_CTYPE_P 459 #define LEADING 460 #define LEAKPROOF 461 #define LEAST 462 #define LEFT 463 #define LEVEL 464 #define LIKE 465 #define LIMIT 466 #define LISTEN 467 #define LOAD 468 #define LOCAL 469 #define LOCALTIME 470 #define LOCALTIMESTAMP 471 #define LOCATION 472 #define LOCK_P 473 #define MAPPING 474 #define MATCH 475 #define MATERIALIZED 476 #define MAXVALUE 477 #define MINUTE_P 478 #define MINVALUE 479 #define MODE 480 #define MONTH_P 481 #define MOVE 482 #define NAME_P 483 #define NAMES 484 #define NATIONAL 485 #define NATURAL 486 #define NCHAR 487 #define NEXT 488 #define NO 489 #define NONE 490 #define NOT 491 #define NOTHING 492 #define NOTIFY 493 #define NOTNULL 494 #define NOWAIT 495 #define NULL_P 496 #define NULLIF 497 #define NULLS_P 498 #define NUMERIC 499 #define OBJECT_P 500 #define OF 501 #define OFF 502 #define OFFSET 503 #define OIDS 504 #define ON 505 #define ONLY 506 #define OPERATOR 507 #define OPTION 508 #define OPTIONS 509 #define OR 510 #define ORDER 511 #define ORDINALITY 512 #define OUT_P 513 #define OUTER_P 514 #define OVER 515 #define OVERLAPS 516 #define OVERLAY 517 #define OWNED 518 #define OWNER 519 #define PARSER 520 #define PARTIAL 521 #define PARTITION 522 #define PASSING 523 #define PASSWORD 524 #define PLACING 525 #define PLANS 526 #define POSITION 527 #define PRECEDING 528 #define PRECISION 529 #define PRESERVE 530 #define PREPARE 531 #define PREPARED 532 #define PRIMARY 533 #define PRIOR 534 #define PRIVILEGES 535 #define PROCEDURAL 536 #define PROCEDURE 537 #define PROGRAM 538 #define QUOTE 539 #define RANGE 540 #define READ 541 #define REAL 542 #define REASSIGN 543 #define RECHECK 544 #define RECURSIVE 545 #define REF 546 #define REFERENCES 547 #define REFRESH 548 #define REINDEX 549 #define RELATIVE_P 550 #define RELEASE 551 #define RENAME 552 #define REPEATABLE 553 #define REPLACE 554 #define REPLICA 555 #define RESET 556 #define RESTART 557 #define RESTRICT 558 #define RETURNING 559 #define RETURNS 560 #define REVOKE 561 #define RIGHT 562 #define ROLE 563 #define ROLLBACK 564 #define ROW 565 #define ROWS 566 #define RULE 567 #define SAVEPOINT 568 #define SCHEMA 569 #define SCROLL 570 #define SEARCH 571 #define SECOND_P 572 #define SECURITY 573 #define SELECT 574 #define SEQUENCE 575 #define SEQUENCES 576 #define SERIALIZABLE 577 #define SERVER 578 #define SESSION 579 #define SESSION_USER 580 #define SET 581 #define SETOF 582 #define SHARE 583 #define SHOW 584 #define SIMILAR 585 #define SIMPLE 586 #define SMALLINT 587 #define SNAPSHOT 588 #define SOME 589 #define STABLE 590 #define STANDALONE_P 591 #define START 592 #define STATEMENT 593 #define STATISTICS 594 #define STDIN 595 #define STDOUT 596 #define STORAGE 597 #define STRICT_P 598 #define STRIP_P 599 #define SUBSTRING 600 #define SYMMETRIC 601 #define SYSID 602 #define SYSTEM_P 603 #define TABLE 604 #define TABLES 605 #define TABLESPACE 606 #define TEMP 607 #define TEMPLATE 608 #define TEMPORARY 609 #define TEXT_P 610 #define THEN 611 #define TIME 612 #define TIMESTAMP 613 #define TO 614 #define TRAILING 615 #define TRANSACTION 616 #define TREAT 617 #define TRIGGER 618 #define TRIM 619 #define TRUE_P 620 #define TRUNCATE 621 #define TRUSTED 622 #define TYPE_P 623 #define TYPES_P 624 #define UNBOUNDED 625 #define UNCOMMITTED 626 #define UNENCRYPTED 627 #define UNION 628 #define UNIQUE 629 #define UNKNOWN 630 #define UNLISTEN 631 #define UNLOGGED 632 #define UNTIL 633 #define UPDATE 634 #define USER 635 #define USING 636 #define VACUUM 637 #define VALID 638 #define VALIDATE 639 #define VALIDATOR 640 #define VALUE_P 641 #define VALUES 642 #define VARCHAR 643 #define VARIADIC 644 #define VARYING 645 #define VERBOSE 646 #define VERSION_P 647 #define VIEW 648 #define VIEWS 649 #define VOLATILE 650 #define WHEN 651 #define WHERE 652 #define WHITESPACE_P 653 #define WINDOW 654 #define WITH 655 #define WITHIN 656 #define WITHOUT 657 #define WORK 658 #define WRAPPER 659 #define WRITE 660 #define XML_P 661 #define XMLATTRIBUTES 662 #define XMLCONCAT 663 #define XMLELEMENT 664 #define XMLEXISTS 665 #define XMLFOREST 666 #define XMLPARSE 667 #define XMLPI 668 #define XMLROOT 669 #define XMLSERIALIZE 670 #define YEAR_P 671 #define YES_P 672 #define ZONE 673 #define NULLS_FIRST 674 #define NULLS_LAST 675 #define WITH_ORDINALITY 676 #define WITH_TIME 677 #define POSTFIXOP 678 #define UMINUS 679 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE YYSTYPE; union YYSTYPE { #line 211 "gram.y" /* yacc.c:355 */ core_YYSTYPE core_yystype; /* these fields must match core_YYSTYPE: */ int ival; char *str; const char *keyword; char chr; bool boolean; JoinType jtype; DropBehavior dbehavior; OnCommitAction oncommit; List *list; Node *node; Value *value; ObjectType objtype; TypeName *typnam; FunctionParameter *fun_param; FunctionParameterMode fun_param_mode; FuncWithArgs *funwithargs; DefElem *defelt; SortBy *sortby; WindowDef *windef; JoinExpr *jexpr; IndexElem *ielem; Alias *alias; RangeVar *range; IntoClause *into; WithClause *with; A_Indices *aind; ResTarget *target; struct PrivTarget *privtarget; AccessPriv *accesspriv; InsertStmt *istmt; VariableSetStmt *vsetstmt; #line 1198 "gram.c" /* yacc.c:355 */ }; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif /* Location type. */ #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED typedef struct YYLTYPE YYLTYPE; struct YYLTYPE { int first_line; int first_column; int last_line; int last_column; }; # define YYLTYPE_IS_DECLARED 1 # define YYLTYPE_IS_TRIVIAL 1 #endif int base_yyparse (core_yyscan_t yyscanner); #endif /* !YY_BASE_YY_Y_TAB_H_INCLUDED */ /* Copy the second part of user declarations. */ #line 1226 "gram.c" /* yacc.c:358 */ #ifdef short # undef short #endif #ifdef YYTYPE_UINT8 typedef YYTYPE_UINT8 yytype_uint8; #else typedef unsigned char yytype_uint8; #endif #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; #else typedef signed char yytype_int8; #endif #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else typedef unsigned short int yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else typedef short int yytype_int16; #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif ! defined YYSIZE_T # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned int # endif #endif #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(Msgid) dgettext ("bison-runtime", Msgid) # endif # endif # ifndef YY_ # define YY_(Msgid) Msgid # endif #endif #ifndef YY_ATTRIBUTE # if (defined __GNUC__ \ && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C # define YY_ATTRIBUTE(Spec) __attribute__(Spec) # else # define YY_ATTRIBUTE(Spec) /* empty */ # endif #endif #ifndef YY_ATTRIBUTE_PURE # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) #endif #ifndef YY_ATTRIBUTE_UNUSED # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) #endif #if !defined _Noreturn \ && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) # if defined _MSC_VER && 1200 <= _MSC_VER # define _Noreturn __declspec (noreturn) # else # define _Noreturn YY_ATTRIBUTE ((__noreturn__)) # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(E) ((void) (E)) #else # define YYUSE(E) /* empty */ #endif #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else # define YY_INITIAL_VALUE(Value) Value #endif #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_END #endif #ifndef YY_INITIAL_VALUE # define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's 'empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yytype_int16 yyss_alloc; YYSTYPE yyvs_alloc; YYLTYPE yyls_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + 2 * YYSTACK_GAP_MAXIMUM) # define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0) #endif #if defined YYCOPY_NEEDED && YYCOPY_NEEDED /* Copy COUNT objects from SRC to DST. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(Dst, Src, Count) \ __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) # else # define YYCOPY(Dst, Src, Count) \ do \ { \ YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ #define YYFINAL 725 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 79553 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 442 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 574 /* YYNRULES -- Number of rules. */ #define YYNRULES 2364 /* YYNSTATES -- Number of states. */ #define YYNSTATES 4567 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 679 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM as returned by yylex, without out-of-bounds checking. */ static const yytype_uint16 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 431, 2, 2, 436, 437, 429, 427, 440, 428, 438, 430, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 441, 439, 424, 423, 425, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 434, 2, 435, 432, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 426, 433 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 721, 721, 728, 735, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 862, 872, 883, 884, 893, 894, 898, 899, 903, 908, 912, 917, 922, 926, 930, 935, 939, 993, 995, 999, 1003, 1007, 1011, 1025, 1043, 1054, 1055, 1059, 1067, 1085, 1097, 1118, 1125, 1144, 1151, 1168, 1186, 1197, 1198, 1210, 1217, 1234, 1247, 1257, 1275, 1293, 1294, 1298, 1305, 1313, 1314, 1315, 1316, 1317, 1318, 1332, 1338, 1344, 1353, 1361, 1369, 1373, 1381, 1389, 1396, 1405, 1406, 1414, 1425, 1433, 1441, 1452, 1460, 1468, 1475, 1484, 1494, 1495, 1499, 1500, 1503, 1505, 1509, 1510, 1511, 1512, 1516, 1517, 1518, 1524, 1536, 1540, 1544, 1559, 1582, 1583, 1584, 1588, 1589, 1590, 1594, 1595, 1599, 1606, 1613, 1620, 1627, 1637, 1638, 1643, 1644, 1649, 1655, 1661, 1667, 1673, 1683, 1693, 1694, 1698, 1699, 1707, 1722, 1728, 1734, 1740, 1746, 1765, 1774, 1783, 1792, 1801, 1810, 1819, 1828, 1837, 1846, 1858, 1859, 1864, 1872, 1880, 1889, 1897, 1905, 1914, 1923, 1932, 1941, 1951, 1964, 1979, 1988, 1996, 2011, 2019, 2029, 2039, 2046, 2053, 2061, 2069, 2077, 2085, 2093, 2100, 2107, 2115, 2122, 2129, 2137, 2145, 2153, 2161, 2169, 2177, 2187, 2194, 2202, 2210, 2218, 2226, 2233, 2243, 2244, 2248, 2249, 2250, 2254, 2262, 2266, 2267, 2271, 2278, 2285, 2292, 2302, 2305, 2306, 2310, 2311, 2316, 2320, 2324, 2329, 2344, 2357, 2358, 2363, 2372, 2382, 2392, 2418, 2424, 2454, 2483, 2505, 2506, 2510, 2511, 2520, 2521, 2522, 2525, 2526, 2531, 2532, 2536, 2540, 2544, 2548, 2552, 2556, 2560, 2564, 2568, 2572, 2576, 2580, 2584, 2588, 2597, 2601, 2605, 2609, 2613, 2617, 2621, 2622, 2627, 2631, 2638, 2645, 2646, 2647, 2648, 2649, 2653, 2657, 2665, 2676, 2691, 2707, 2723, 2752, 2753, 2754, 2755, 2756, 2763, 2770, 2771, 2775, 2776, 2780, 2781, 2785, 2789, 2796, 2800, 2807, 2808, 2809, 2813, 2814, 2817, 2838, 2859, 2860, 2864, 2872, 2873, 2874, 2905, 2912, 2919, 2930, 2941, 2951, 2960, 2993, 3000, 3007, 3014, 3025, 3035, 3036, 3037, 3041, 3042, 3043, 3044, 3045, 3046, 3055, 3063, 3067, 3080, 3095, 3109, 3124, 3138, 3156, 3177, 3178, 3182, 3183, 3187, 3188, 3191, 3197, 3201, 3209, 3214, 3220, 3221, 3225, 3230, 3237, 3238, 3248, 3250, 3252, 3254, 3257, 3260, 3263, 3267, 3268, 3269, 3270, 3271, 3274, 3275, 3280, 3281, 3282, 3283, 3286, 3287, 3288, 3289, 3292, 3293, 3296, 3297, 3300, 3315, 3330, 3344, 3345, 3346, 3358, 3373, 3386, 3387, 3399, 3419, 3431, 3439, 3450, 3451, 3454, 3455, 3458, 3462, 3466, 3470, 3474, 3478, 3482, 3486, 3490, 3494, 3498, 3502, 3508, 3509, 3513, 3514, 3519, 3522, 3523, 3535, 3547, 3562, 3563, 3571, 3572, 3576, 3577, 3581, 3582, 3586, 3587, 3591, 3602, 3615, 3616, 3626, 3637, 3638, 3651, 3658, 3675, 3683, 3694, 3697, 3701, 3705, 3709, 3721, 3731, 3734, 3738, 3751, 3761, 3771, 3780, 3789, 3798, 3808, 3817, 3827, 3837, 3847, 3856, 3865, 3874, 3883, 3892, 3901, 3910, 3919, 3928, 3937, 3946, 3955, 3964, 3982, 3993, 3994, 3995, 3996, 4000, 4001, 4005, 4006, 4016, 4027, 4047, 4055, 4067, 4068, 4072, 4076, 4084, 4088, 4092, 4099, 4103, 4108, 4113, 4120, 4127, 4132, 4142, 4156, 4157, 4162, 4163, 4167, 4168, 4178, 4189, 4209, 4218, 4226, 4243, 4258, 4283, 4292, 4310, 4322, 4323, 4324, 4334, 4342, 4359, 4378, 4398, 4423, 4424, 4425, 4429, 4431, 4453, 4455, 4457, 4459, 4461, 4466, 4471, 4481, 4482, 4486, 4487, 4491, 4492, 4496, 4497, 4498, 4502, 4508, 4509, 4510, 4514, 4515, 4520, 4521, 4548, 4549, 4550, 4551, 4552, 4553, 4558, 4569, 4592, 4602, 4616, 4618, 4623, 4628, 4630, 4635, 4645, 4646, 4647, 4648, 4660, 4680, 4703, 4713, 4724, 4734, 4744, 4755, 4764, 4771, 4778, 4787, 4796, 4805, 4814, 4823, 4834, 4837, 4838, 4841, 4845, 4852, 4853, 4854, 4855, 4856, 4859, 4862, 4863, 4871, 4878, 4879, 4882, 4884, 4895, 4905, 4915, 4927, 4928, 4944, 4959, 4960, 4964, 4974, 4985, 4994, 5004, 5013, 5014, 5017, 5018, 5021, 5022, 5023, 5026, 5040, 5045, 5055, 5064, 5076, 5077, 5081, 5089, 5101, 5112, 5126, 5137, 5160, 5170, 5188, 5199, 5210, 5221, 5235, 5236, 5237, 5238, 5239, 5240, 5241, 5242, 5243, 5244, 5245, 5246, 5247, 5248, 5249, 5250, 5251, 5255, 5256, 5259, 5260, 5263, 5265, 5278, 5289, 5290, 5291, 5323, 5332, 5341, 5350, 5359, 5368, 5377, 5387, 5396, 5405, 5414, 5423, 5432, 5444, 5445, 5446, 5447, 5448, 5449, 5450, 5451, 5452, 5453, 5454, 5455, 5456, 5457, 5458, 5459, 5460, 5461, 5462, 5463, 5464, 5465, 5466, 5470, 5471, 5485, 5496, 5507, 5518, 5529, 5542, 5543, 5547, 5548, 5549, 5550, 5551, 5552, 5553, 5554, 5555, 5556, 5557, 5558, 5559, 5562, 5563, 5573, 5579, 5587, 5595, 5603, 5611, 5619, 5627, 5635, 5643, 5651, 5659, 5667, 5675, 5683, 5691, 5699, 5707, 5717, 5718, 5721, 5722, 5732, 5748, 5762, 5788, 5790, 5792, 5794, 5801, 5810, 5811, 5814, 5821, 5828, 5835, 5849, 5857, 5865, 5873, 5881, 5889, 5897, 5905, 5913, 5921, 5929, 5937, 5945, 5953, 5961, 5969, 5981, 5982, 5985, 5995, 6009, 6010, 6014, 6015, 6020, 6036, 6049, 6059, 6071, 6072, 6075, 6076, 6086, 6096, 6097, 6101, 6105, 6109, 6120, 6133, 6147, 6164, 6165, 6166, 6167, 6179, 6206, 6207, 6211, 6212, 6216, 6217, 6221, 6222, 6225, 6226, 6234, 6245, 6256, 6269, 6270, 6273, 6274, 6275, 6278, 6279, 6280, 6283, 6284, 6285, 6301, 6313, 6326, 6341, 6342, 6345, 6346, 6350, 6351, 6359, 6360, 6364, 6365, 6380, 6389, 6398, 6407, 6416, 6428, 6429, 6430, 6431, 6432, 6438, 6442, 6457, 6458, 6464, 6474, 6478, 6483, 6491, 6532, 6536, 6540, 6544, 6552, 6553, 6558, 6559, 6566, 6570, 6574, 6578, 6582, 6586, 6590, 6594, 6598, 6602, 6606, 6610, 6614, 6618, 6622, 6630, 6634, 6638, 6642, 6648, 6649, 6656, 6657, 6660, 6672, 6676, 6691, 6702, 6703, 6708, 6709, 6724, 6735, 6749, 6760, 6774, 6785, 6799, 6807, 6809, 6811, 6816, 6818, 6831, 6840, 6841, 6845, 6849, 6861, 6872, 6883, 6896, 6897, 6898, 6902, 6915, 6916, 6930, 6938, 6948, 6961, 6962, 6965, 6966, 6976, 6988, 7000, 7012, 7024, 7036, 7048, 7060, 7072, 7081, 7098, 7108, 7117, 7126, 7135, 7144, 7154, 7163, 7173, 7182, 7191, 7201, 7211, 7220, 7229, 7239, 7249, 7259, 7269, 7279, 7289, 7299, 7309, 7319, 7329, 7339, 7349, 7360, 7371, 7382, 7393, 7403, 7414, 7425, 7435, 7445, 7453, 7462, 7471, 7480, 7489, 7498, 7507, 7516, 7525, 7539, 7540, 7543, 7544, 7554, 7564, 7573, 7582, 7591, 7600, 7610, 7620, 7630, 7640, 7649, 7658, 7667, 7676, 7685, 7694, 7703, 7712, 7721, 7730, 7739, 7748, 7757, 7766, 7783, 7792, 7800, 7808, 7816, 7824, 7833, 7841, 7849, 7858, 7867, 7876, 7884, 7892, 7900, 7908, 7916, 7924, 7932, 7949, 7966, 7967, 7968, 7973, 7979, 7988, 7989, 7990, 7991, 7992, 7996, 7997, 8000, 8001, 8002, 8003, 8007, 8008, 8009, 8014, 8025, 8047, 8057, 8058, 8061, 8070, 8076, 8095, 8102, 8109, 8116, 8123, 8130, 8137, 8145, 8153, 8161, 8169, 8177, 8184, 8191, 8200, 8201, 8202, 8206, 8209, 8212, 8215, 8218, 8225, 8227, 8229, 8234, 8236, 8248, 8261, 8274, 8292, 8313, 8314, 8315, 8316, 8326, 8342, 8352, 8353, 8357, 8361, 8365, 8369, 8373, 8377, 8381, 8385, 8389, 8393, 8397, 8401, 8405, 8409, 8413, 8417, 8427, 8428, 8439, 8446, 8457, 8468, 8469, 8473, 8487, 8494, 8512, 8528, 8541, 8550, 8558, 8566, 8575, 8586, 8597, 8607, 8608, 8619, 8629, 8639, 8649, 8659, 8669, 8677, 8698, 8721, 8729, 8738, 8749, 8750, 8762, 8778, 8794, 8808, 8828, 8853, 8854, 8858, 8859, 8860, 8861, 8865, 8879, 8896, 8897, 8901, 8902, 8905, 8906, 8909, 8910, 8914, 8915, 8928, 8935, 8945, 8952, 8962, 8963, 8964, 8965, 8966, 8967, 8968, 8969, 8970, 8974, 8978, 8985, 8992, 8993, 8997, 8998, 8999, 9009, 9019, 9020, 9024, 9025, 9026, 9027, 9037, 9044, 9062, 9063, 9073, 9079, 9085, 9091, 9107, 9117, 9123, 9129, 9138, 9140, 9145, 9156, 9157, 9168, 9182, 9183, 9194, 9205, 9206, 9209, 9210, 9211, 9212, 9213, 9214, 9215, 9216, 9219, 9220, 9231, 9249, 9250, 9254, 9255, 9259, 9267, 9295, 9306, 9307, 9317, 9328, 9331, 9332, 9333, 9334, 9335, 9338, 9339, 9340, 9388, 9389, 9393, 9394, 9409, 9410, 9417, 9425, 9433, 9441, 9449, 9457, 9468, 9469, 9496, 9511, 9512, 9531, 9535, 9539, 9554, 9561, 9571, 9572, 9575, 9587, 9588, 9592, 9604, 9612, 9617, 9622, 9627, 9632, 9640, 9648, 9653, 9658, 9665, 9666, 9669, 9670, 9671, 9678, 9679, 9680, 9681, 9685, 9686, 9690, 9694, 9695, 9698, 9707, 9720, 9721, 9722, 9723, 9727, 9728, 9732, 9734, 9744, 9749, 9752, 9757, 9758, 9766, 9776, 9777, 9778, 9786, 9790, 9791, 9794, 9795, 9800, 9801, 9805, 9806, 9810, 9811, 9815, 9816, 9820, 9821, 9825, 9836, 9837, 9838, 9839, 9843, 9844, 9849, 9855, 9873, 9874, 9878, 9879, 9885, 9890, 9897, 9905, 9940, 9965, 9969, 9995, 9999, 10011, 10024, 10038, 10049, 10064, 10070, 10075, 10081, 10088, 10089, 10097, 10101, 10105, 10111, 10118, 10123, 10124, 10125, 10126, 10130, 10131, 10143, 10144, 10149, 10156, 10163, 10170, 10181, 10182, 10195, 10199, 10206, 10227, 10237, 10249, 10254, 10255, 10258, 10259, 10262, 10263, 10268, 10269, 10274, 10275, 10283, 10288, 10289, 10293, 10297, 10303, 10333, 10338, 10345, 10350, 10356, 10361, 10370, 10372, 10375, 10379, 10380, 10381, 10382, 10383, 10384, 10389, 10419, 10420, 10421, 10422, 10433, 10439, 10447, 10448, 10454, 10459, 10464, 10469, 10474, 10479, 10484, 10489, 10495, 10501, 10507, 10514, 10536, 10545, 10549, 10557, 10561, 10569, 10581, 10602, 10606, 10612, 10616, 10629, 10640, 10655, 10657, 10659, 10661, 10663, 10665, 10670, 10671, 10675, 10676, 10683, 10692, 10700, 10709, 10720, 10728, 10729, 10730, 10734, 10736, 10738, 10740, 10742, 10744, 10746, 10751, 10756, 10762, 10770, 10775, 10782, 10789, 10793, 10797, 10827, 10828, 10830, 10838, 10853, 10855, 10857, 10859, 10861, 10863, 10865, 10867, 10869, 10871, 10873, 10876, 10878, 10880, 10883, 10885, 10887, 10890, 10892, 10899, 10901, 10908, 10910, 10917, 10919, 10927, 10934, 10941, 10948, 10965, 10972, 10979, 10986, 10993, 11009, 11016, 11023, 11030, 11037, 11044, 11051, 11055, 11063, 11067, 11077, 11084, 11091, 11104, 11117, 11136, 11157, 11167, 11174, 11190, 11195, 11213, 11215, 11217, 11219, 11221, 11223, 11225, 11227, 11229, 11231, 11233, 11235, 11237, 11239, 11241, 11243, 11245, 11249, 11254, 11258, 11262, 11267, 11284, 11285, 11286, 11301, 11313, 11315, 11317, 11327, 11350, 11360, 11370, 11378, 11389, 11393, 11399, 11406, 11413, 11423, 11430, 11458, 11493, 11504, 11505, 11512, 11518, 11544, 11554, 11567, 11575, 11588, 11598, 11611, 11621, 11634, 11638, 11642, 11646, 11650, 11654, 11658, 11660, 11664, 11673, 11678, 11685, 11700, 11707, 11711, 11715, 11719, 11723, 11730, 11738, 11746, 11750, 11754, 11758, 11762, 11766, 11772, 11776, 11785, 11789, 11793, 11798, 11812, 11814, 11818, 11820, 11822, 11825, 11828, 11831, 11832, 11835, 11843, 11853, 11854, 11857, 11858, 11859, 11864, 11868, 11872, 11876, 11887, 11888, 11892, 11893, 11901, 11902, 11906, 11907, 11912, 11920, 11922, 11936, 11939, 11966, 11967, 11970, 11971, 11982, 12000, 12007, 12016, 12033, 12078, 12086, 12094, 12102, 12110, 12131, 12132, 12133, 12136, 12137, 12138, 12141, 12142, 12145, 12146, 12147, 12148, 12149, 12150, 12151, 12152, 12153, 12156, 12158, 12163, 12165, 12170, 12172, 12174, 12176, 12178, 12180, 12192, 12196, 12203, 12207, 12213, 12217, 12228, 12229, 12232, 12236, 12240, 12246, 12247, 12252, 12256, 12263, 12264, 12265, 12266, 12267, 12268, 12269, 12270, 12280, 12284, 12291, 12298, 12299, 12315, 12319, 12324, 12328, 12343, 12348, 12352, 12355, 12358, 12359, 12360, 12363, 12370, 12380, 12394, 12395, 12399, 12410, 12411, 12414, 12415, 12418, 12422, 12429, 12433, 12437, 12444, 12454, 12455, 12459, 12460, 12463, 12464, 12475, 12476, 12485, 12486, 12494, 12504, 12505, 12509, 12510, 12513, 12529, 12537, 12545, 12567, 12568, 12579, 12583, 12610, 12612, 12617, 12620, 12623, 12625, 12627, 12629, 12639, 12641, 12652, 12656, 12660, 12664, 12668, 12677, 12684, 12716, 12720, 12726, 12743, 12747, 12751, 12757, 12758, 12759, 12761, 12763, 12767, 12768, 12769, 12785, 12786, 12787, 12792, 12793, 12794, 12799, 12800, 12801, 12802, 12808, 12809, 12810, 12811, 12812, 12832, 12833, 12834, 12835, 12836, 12837, 12838, 12839, 12840, 12841, 12842, 12843, 12844, 12845, 12846, 12847, 12848, 12849, 12850, 12851, 12852, 12853, 12854, 12855, 12856, 12857, 12858, 12859, 12860, 12861, 12862, 12863, 12864, 12865, 12866, 12867, 12868, 12869, 12870, 12871, 12872, 12873, 12874, 12875, 12876, 12877, 12878, 12879, 12880, 12881, 12882, 12883, 12884, 12885, 12886, 12887, 12888, 12889, 12890, 12891, 12892, 12893, 12894, 12895, 12896, 12897, 12898, 12899, 12900, 12901, 12902, 12903, 12904, 12905, 12906, 12907, 12908, 12909, 12910, 12911, 12912, 12913, 12914, 12915, 12916, 12917, 12918, 12919, 12920, 12921, 12922, 12923, 12924, 12925, 12926, 12927, 12928, 12929, 12930, 12931, 12932, 12933, 12934, 12935, 12936, 12937, 12938, 12939, 12940, 12941, 12942, 12943, 12944, 12945, 12946, 12947, 12948, 12949, 12950, 12951, 12952, 12953, 12954, 12955, 12956, 12957, 12958, 12959, 12960, 12961, 12962, 12963, 12964, 12965, 12966, 12967, 12968, 12969, 12970, 12971, 12972, 12973, 12974, 12975, 12976, 12977, 12978, 12979, 12980, 12981, 12982, 12983, 12984, 12985, 12986, 12987, 12988, 12989, 12990, 12991, 12992, 12993, 12994, 12995, 12996, 12997, 12998, 12999, 13000, 13001, 13002, 13003, 13004, 13005, 13006, 13007, 13008, 13009, 13010, 13011, 13012, 13013, 13014, 13015, 13016, 13017, 13018, 13019, 13020, 13021, 13022, 13023, 13024, 13025, 13026, 13027, 13028, 13029, 13030, 13031, 13032, 13033, 13034, 13035, 13036, 13037, 13038, 13039, 13040, 13041, 13042, 13043, 13044, 13045, 13046, 13047, 13048, 13049, 13050, 13051, 13052, 13053, 13054, 13055, 13056, 13057, 13058, 13059, 13060, 13061, 13062, 13063, 13064, 13065, 13066, 13067, 13068, 13069, 13070, 13071, 13072, 13073, 13074, 13075, 13076, 13077, 13078, 13079, 13080, 13081, 13082, 13083, 13084, 13085, 13086, 13087, 13088, 13089, 13090, 13104, 13105, 13106, 13107, 13108, 13109, 13110, 13111, 13112, 13113, 13114, 13115, 13116, 13117, 13118, 13119, 13120, 13121, 13122, 13123, 13124, 13125, 13126, 13127, 13128, 13129, 13130, 13131, 13132, 13133, 13134, 13135, 13136, 13137, 13138, 13139, 13140, 13141, 13142, 13143, 13144, 13145, 13146, 13147, 13148, 13149, 13150, 13164, 13165, 13166, 13167, 13168, 13169, 13170, 13171, 13172, 13173, 13174, 13175, 13176, 13177, 13178, 13179, 13180, 13181, 13182, 13183, 13184, 13185, 13195, 13196, 13197, 13198, 13199, 13200, 13201, 13202, 13203, 13204, 13205, 13206, 13207, 13208, 13209, 13210, 13211, 13212, 13213, 13214, 13215, 13216, 13217, 13218, 13219, 13220, 13221, 13222, 13223, 13224, 13225, 13226, 13227, 13228, 13229, 13230, 13231, 13232, 13233, 13234, 13235, 13236, 13237, 13238, 13239, 13240, 13241, 13242, 13243, 13244, 13245, 13246, 13247, 13248, 13249, 13250, 13251, 13252, 13253, 13254, 13255, 13256, 13257, 13258, 13259, 13260, 13261, 13262, 13263, 13264, 13265, 13266, 13267, 13268, 13269, 13270, 13271 }; #endif #if YYDEBUG || YYERROR_VERBOSE || 0 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "IDENT", "FCONST", "SCONST", "BCONST", "XCONST", "Op", "ICONST", "PARAM", "TYPECAST", "DOT_DOT", "COLON_EQUALS", "ABORT_P", "ABSOLUTE_P", "ACCESS", "ACTION", "ADD_P", "ADMIN", "AFTER", "AGGREGATE", "ALL", "ALSO", "ALTER", "ALWAYS", "ANALYSE", "ANALYZE", "AND", "ANY", "ARRAY", "AS", "ASC", "ASSERTION", "ASSIGNMENT", "ASYMMETRIC", "AT", "ATTRIBUTE", "AUTHORIZATION", "BACKWARD", "BEFORE", "BEGIN_P", "BETWEEN", "BIGINT", "BINARY", "BIT", "BOOLEAN_P", "BOTH", "BY", "CACHE", "CALLED", "CASCADE", "CASCADED", "CASE", "CAST", "CATALOG_P", "CHAIN", "CHAR_P", "CHARACTER", "CHARACTERISTICS", "CHECK", "CHECKPOINT", "CLASS", "CLOSE", "CLUSTER", "COALESCE", "COLLATE", "COLLATION", "COLUMN", "COMMENT", "COMMENTS", "COMMIT", "COMMITTED", "CONCURRENTLY", "CONFIGURATION", "CONNECTION", "CONSTRAINT", "CONSTRAINTS", "CONTENT_P", "CONTINUE_P", "CONVERSION_P", "COPY", "COST", "CREATE", "CROSS", "CSV", "CURRENT_P", "CURRENT_CATALOG", "CURRENT_DATE", "CURRENT_ROLE", "CURRENT_SCHEMA", "CURRENT_TIME", "CURRENT_TIMESTAMP", "CURRENT_USER", "CURSOR", "CYCLE", "DATA_P", "DATABASE", "DAY_P", "DEALLOCATE", "DEC", "DECIMAL_P", "DECLARE", "DEFAULT", "DEFAULTS", "DEFERRABLE", "DEFERRED", "DEFINER", "DELETE_P", "DELIMITER", "DELIMITERS", "DESC", "DICTIONARY", "DISABLE_P", "DISCARD", "DISTINCT", "DO", "DOCUMENT_P", "DOMAIN_P", "DOUBLE_P", "DROP", "EACH", "ELSE", "ENABLE_P", "ENCODING", "ENCRYPTED", "END_P", "ENUM_P", "ESCAPE", "EVENT", "EXCEPT", "EXCLUDE", "EXCLUDING", "EXCLUSIVE", "EXECUTE", "EXISTS", "EXPLAIN", "EXTENSION", "EXTERNAL", "EXTRACT", "FALSE_P", "FAMILY", "FETCH", "FILTER", "FIRST_P", "FLOAT_P", "FOLLOWING", "FOR", "FORCE", "FOREIGN", "FORWARD", "FREEZE", "FROM", "FULL", "FUNCTION", "FUNCTIONS", "GLOBAL", "GRANT", "GRANTED", "GREATEST", "GROUP_P", "HANDLER", "HAVING", "HEADER_P", "HOLD", "HOUR_P", "IDENTITY_P", "IF_P", "ILIKE", "IMMEDIATE", "IMMUTABLE", "IMPLICIT_P", "IN_P", "INCLUDING", "INCREMENT", "INDEX", "INDEXES", "INHERIT", "INHERITS", "INITIALLY", "INLINE_P", "INNER_P", "INOUT", "INPUT_P", "INSENSITIVE", "INSERT", "INSTEAD", "INT_P", "INTEGER", "INTERSECT", "INTERVAL", "INTO", "INVOKER", "IS", "ISNULL", "ISOLATION", "JOIN", "KEY", "LABEL", "LANGUAGE", "LARGE_P", "LAST_P", "LATERAL_P", "LC_COLLATE_P", "LC_CTYPE_P", "LEADING", "LEAKPROOF", "LEAST", "LEFT", "LEVEL", "LIKE", "LIMIT", "LISTEN", "LOAD", "LOCAL", "LOCALTIME", "LOCALTIMESTAMP", "LOCATION", "LOCK_P", "MAPPING", "MATCH", "MATERIALIZED", "MAXVALUE", "MINUTE_P", "MINVALUE", "MODE", "MONTH_P", "MOVE", "NAME_P", "NAMES", "NATIONAL", "NATURAL", "NCHAR", "NEXT", "NO", "NONE", "NOT", "NOTHING", "NOTIFY", "NOTNULL", "NOWAIT", "NULL_P", "NULLIF", "NULLS_P", "NUMERIC", "OBJECT_P", "OF", "OFF", "OFFSET", "OIDS", "ON", "ONLY", "OPERATOR", "OPTION", "OPTIONS", "OR", "ORDER", "ORDINALITY", "OUT_P", "OUTER_P", "OVER", "OVERLAPS", "OVERLAY", "OWNED", "OWNER", "PARSER", "PARTIAL", "PARTITION", "PASSING", "PASSWORD", "PLACING", "PLANS", "POSITION", "PRECEDING", "PRECISION", "PRESERVE", "PREPARE", "PREPARED", "PRIMARY", "PRIOR", "PRIVILEGES", "PROCEDURAL", "PROCEDURE", "PROGRAM", "QUOTE", "RANGE", "READ", "REAL", "REASSIGN", "RECHECK", "RECURSIVE", "REF", "REFERENCES", "REFRESH", "REINDEX", "RELATIVE_P", "RELEASE", "RENAME", "REPEATABLE", "REPLACE", "REPLICA", "RESET", "RESTART", "RESTRICT", "RETURNING", "RETURNS", "REVOKE", "RIGHT", "ROLE", "ROLLBACK", "ROW", "ROWS", "RULE", "SAVEPOINT", "SCHEMA", "SCROLL", "SEARCH", "SECOND_P", "SECURITY", "SELECT", "SEQUENCE", "SEQUENCES", "SERIALIZABLE", "SERVER", "SESSION", "SESSION_USER", "SET", "SETOF", "SHARE", "SHOW", "SIMILAR", "SIMPLE", "SMALLINT", "SNAPSHOT", "SOME", "STABLE", "STANDALONE_P", "START", "STATEMENT", "STATISTICS", "STDIN", "STDOUT", "STORAGE", "STRICT_P", "STRIP_P", "SUBSTRING", "SYMMETRIC", "SYSID", "SYSTEM_P", "TABLE", "TABLES", "TABLESPACE", "TEMP", "TEMPLATE", "TEMPORARY", "TEXT_P", "THEN", "TIME", "TIMESTAMP", "TO", "TRAILING", "TRANSACTION", "TREAT", "TRIGGER", "TRIM", "TRUE_P", "TRUNCATE", "TRUSTED", "TYPE_P", "TYPES_P", "UNBOUNDED", "UNCOMMITTED", "UNENCRYPTED", "UNION", "UNIQUE", "UNKNOWN", "UNLISTEN", "UNLOGGED", "UNTIL", "UPDATE", "USER", "USING", "VACUUM", "VALID", "VALIDATE", "VALIDATOR", "VALUE_P", "VALUES", "VARCHAR", "VARIADIC", "VARYING", "VERBOSE", "VERSION_P", "VIEW", "VIEWS", "VOLATILE", "WHEN", "WHERE", "WHITESPACE_P", "WINDOW", "WITH", "WITHIN", "WITHOUT", "WORK", "WRAPPER", "WRITE", "XML_P", "XMLATTRIBUTES", "XMLCONCAT", "XMLELEMENT", "XMLEXISTS", "XMLFOREST", "XMLPARSE", "XMLPI", "XMLROOT", "XMLSERIALIZE", "YEAR_P", "YES_P", "ZONE", "NULLS_FIRST", "NULLS_LAST", "WITH_ORDINALITY", "WITH_TIME", "'='", "'<'", "'>'", "POSTFIXOP", "'+'", "'-'", "'*'", "'/'", "'%'", "'^'", "UMINUS", "'['", "']'", "'('", "')'", "'.'", "';'", "','", "':'", "$accept", "stmtblock", "stmtmulti", "stmt", "CreateRoleStmt", "opt_with", "OptRoleList", "AlterOptRoleList", "AlterOptRoleElem", "CreateOptRoleElem", "CreateUserStmt", "AlterRoleStmt", "opt_in_database", "AlterRoleSetStmt", "AlterUserStmt", "AlterUserSetStmt", "DropRoleStmt", "DropUserStmt", "CreateGroupStmt", "AlterGroupStmt", "add_drop", "DropGroupStmt", "CreateSchemaStmt", "OptSchemaName", "OptSchemaEltList", "schema_stmt", "VariableSetStmt", "set_rest", "generic_set", "set_rest_more", "var_name", "var_list", "var_value", "iso_level", "opt_boolean_or_string", "zone_value", "opt_encoding", "NonReservedWord_or_Sconst", "VariableResetStmt", "SetResetClause", "FunctionSetResetClause", "VariableShowStmt", "ConstraintsSetStmt", "constraints_set_list", "constraints_set_mode", "CheckPointStmt", "DiscardStmt", "AlterTableStmt", "alter_table_cmds", "alter_table_cmd", "alter_column_default", "opt_drop_behavior", "opt_collate_clause", "alter_using", "replica_identity", "reloptions", "opt_reloptions", "reloption_list", "reloption_elem", "AlterCompositeTypeStmt", "alter_type_cmds", "alter_type_cmd", "ClosePortalStmt", "CopyStmt", "copy_from", "opt_program", "copy_file_name", "copy_options", "copy_opt_list", "copy_opt_item", "opt_binary", "opt_oids", "copy_delimiter", "opt_using", "copy_generic_opt_list", "copy_generic_opt_elem", "copy_generic_opt_arg", "copy_generic_opt_arg_list", "copy_generic_opt_arg_list_item", "CreateStmt", "OptTemp", "OptTableElementList", "OptTypedTableElementList", "TableElementList", "TypedTableElementList", "TableElement", "TypedTableElement", "columnDef", "columnOptions", "ColQualList", "ColConstraint", "ColConstraintElem", "ConstraintAttr", "TableLikeClause", "TableLikeOptionList", "TableLikeOption", "TableConstraint", "ConstraintElem", "opt_no_inherit", "opt_column_list", "columnList", "columnElem", "key_match", "ExclusionConstraintList", "ExclusionConstraintElem", "ExclusionWhereClause", "key_actions", "key_update", "key_delete", "key_action", "OptInherit", "OptWith", "OnCommitOption", "OptTableSpace", "OptConsTableSpace", "ExistingIndex", "CreateAsStmt", "create_as_target", "opt_with_data", "CreateMatViewStmt", "create_mv_target", "OptNoLog", "RefreshMatViewStmt", "CreateSeqStmt", "AlterSeqStmt", "OptSeqOptList", "SeqOptList", "SeqOptElem", "opt_by", "NumericOnly", "NumericOnly_list", "CreatePLangStmt", "opt_trusted", "handler_name", "opt_inline_handler", "validator_clause", "opt_validator", "DropPLangStmt", "opt_procedural", "CreateTableSpaceStmt", "OptTableSpaceOwner", "DropTableSpaceStmt", "CreateExtensionStmt", "create_extension_opt_list", "create_extension_opt_item", "AlterExtensionStmt", "alter_extension_opt_list", "alter_extension_opt_item", "AlterExtensionContentsStmt", "CreateFdwStmt", "fdw_option", "fdw_options", "opt_fdw_options", "DropFdwStmt", "AlterFdwStmt", "create_generic_options", "generic_option_list", "alter_generic_options", "alter_generic_option_list", "alter_generic_option_elem", "generic_option_elem", "generic_option_name", "generic_option_arg", "CreateForeignServerStmt", "opt_type", "foreign_server_version", "opt_foreign_server_version", "DropForeignServerStmt", "AlterForeignServerStmt", "CreateForeignTableStmt", "AlterForeignTableStmt", "CreateUserMappingStmt", "auth_ident", "DropUserMappingStmt", "AlterUserMappingStmt", "CreateTrigStmt", "TriggerActionTime", "TriggerEvents", "TriggerOneEvent", "TriggerForSpec", "TriggerForOptEach", "TriggerForType", "TriggerWhen", "TriggerFuncArgs", "TriggerFuncArg", "OptConstrFromTable", "ConstraintAttributeSpec", "ConstraintAttributeElem", "DropTrigStmt", "CreateEventTrigStmt", "event_trigger_when_list", "event_trigger_when_item", "event_trigger_value_list", "AlterEventTrigStmt", "enable_trigger", "CreateAssertStmt", "DropAssertStmt", "DefineStmt", "definition", "def_list", "def_elem", "def_arg", "old_aggr_definition", "old_aggr_list", "old_aggr_elem", "opt_enum_val_list", "enum_val_list", "AlterEnumStmt", "opt_if_not_exists", "CreateOpClassStmt", "opclass_item_list", "opclass_item", "opt_default", "opt_opfamily", "opclass_purpose", "opt_recheck", "CreateOpFamilyStmt", "AlterOpFamilyStmt", "opclass_drop_list", "opclass_drop", "DropOpClassStmt", "DropOpFamilyStmt", "DropOwnedStmt", "ReassignOwnedStmt", "DropStmt", "drop_type", "any_name_list", "any_name", "attrs", "TruncateStmt", "opt_restart_seqs", "CommentStmt", "comment_type", "comment_text", "SecLabelStmt", "opt_provider", "security_label_type", "security_label", "FetchStmt", "fetch_args", "from_in", "opt_from_in", "GrantStmt", "RevokeStmt", "privileges", "privilege_list", "privilege", "privilege_target", "grantee_list", "grantee", "opt_grant_grant_option", "function_with_argtypes_list", "function_with_argtypes", "GrantRoleStmt", "RevokeRoleStmt", "opt_grant_admin_option", "opt_granted_by", "AlterDefaultPrivilegesStmt", "DefACLOptionList", "DefACLOption", "DefACLAction", "defacl_privilege_target", "IndexStmt", "opt_unique", "opt_concurrently", "opt_index_name", "access_method_clause", "index_params", "index_elem", "opt_collate", "opt_class", "opt_asc_desc", "opt_nulls_order", "CreateFunctionStmt", "opt_or_replace", "func_args", "func_args_list", "func_args_with_defaults", "func_args_with_defaults_list", "func_arg", "arg_class", "param_name", "func_return", "func_type", "func_arg_with_default", "aggr_arg", "aggr_args", "aggr_args_list", "createfunc_opt_list", "common_func_opt_item", "createfunc_opt_item", "func_as", "opt_definition", "table_func_column", "table_func_column_list", "AlterFunctionStmt", "alterfunc_opt_list", "opt_restrict", "RemoveFuncStmt", "RemoveAggrStmt", "RemoveOperStmt", "oper_argtypes", "any_operator", "DoStmt", "dostmt_opt_list", "dostmt_opt_item", "CreateCastStmt", "cast_context", "DropCastStmt", "opt_if_exists", "ReindexStmt", "reindex_type", "opt_force", "AlterTblSpcStmt", "RenameStmt", "opt_column", "opt_set_data", "AlterObjectSchemaStmt", "AlterOwnerStmt", "RuleStmt", "RuleActionList", "RuleActionMulti", "RuleActionStmt", "RuleActionStmtOrEmpty", "event", "opt_instead", "DropRuleStmt", "NotifyStmt", "notify_payload", "ListenStmt", "UnlistenStmt", "TransactionStmt", "opt_transaction", "transaction_mode_item", "transaction_mode_list", "transaction_mode_list_or_empty", "ViewStmt", "opt_check_option", "LoadStmt", "CreatedbStmt", "createdb_opt_list", "createdb_opt_item", "opt_equal", "AlterDatabaseStmt", "AlterDatabaseSetStmt", "alterdb_opt_list", "alterdb_opt_item", "DropdbStmt", "AlterSystemStmt", "CreateDomainStmt", "AlterDomainStmt", "opt_as", "AlterTSDictionaryStmt", "AlterTSConfigurationStmt", "CreateConversionStmt", "ClusterStmt", "cluster_index_specification", "VacuumStmt", "vacuum_option_list", "vacuum_option_elem", "AnalyzeStmt", "analyze_keyword", "opt_verbose", "opt_full", "opt_freeze", "opt_name_list", "ExplainStmt", "ExplainableStmt", "explain_option_list", "explain_option_elem", "explain_option_name", "explain_option_arg", "PrepareStmt", "prep_type_clause", "PreparableStmt", "ExecuteStmt", "execute_param_clause", "DeallocateStmt", "InsertStmt", "insert_rest", "insert_column_list", "insert_column_item", "returning_clause", "DeleteStmt", "using_clause", "LockStmt", "opt_lock", "lock_type", "opt_nowait", "UpdateStmt", "set_clause_list", "set_clause", "single_set_clause", "multiple_set_clause", "set_target", "set_target_list", "DeclareCursorStmt", "cursor_name", "cursor_options", "opt_hold", "SelectStmt", "select_with_parens", "select_no_parens", "select_clause", "simple_select", "with_clause", "cte_list", "common_table_expr", "opt_with_clause", "into_clause", "OptTempTableName", "opt_table", "opt_all", "opt_distinct", "opt_sort_clause", "sort_clause", "sortby_list", "sortby", "select_limit", "opt_select_limit", "limit_clause", "offset_clause", "select_limit_value", "select_offset_value", "opt_select_fetch_first_value", "select_offset_value2", "row_or_rows", "first_or_next", "group_clause", "having_clause", "for_locking_clause", "opt_for_locking_clause", "for_locking_items", "for_locking_item", "for_locking_strength", "locked_rels_list", "values_clause", "from_clause", "from_list", "table_ref", "joined_table", "alias_clause", "opt_alias_clause", "func_alias_clause", "join_type", "join_outer", "join_qual", "relation_expr", "relation_expr_list", "relation_expr_opt_alias", "func_table", "rowsfrom_item", "rowsfrom_list", "opt_col_def_list", "opt_ordinality", "where_clause", "where_or_current_clause", "OptTableFuncElementList", "TableFuncElementList", "TableFuncElement", "Typename", "opt_array_bounds", "SimpleTypename", "ConstTypename", "GenericType", "opt_type_modifiers", "Numeric", "opt_float", "Bit", "ConstBit", "BitWithLength", "BitWithoutLength", "Character", "ConstCharacter", "CharacterWithLength", "CharacterWithoutLength", "character", "opt_varying", "opt_charset", "ConstDatetime", "ConstInterval", "opt_timezone", "opt_interval", "interval_second", "a_expr", "b_expr", "c_expr", "func_application", "func_expr", "func_expr_windowless", "func_expr_common_subexpr", "xml_root_version", "opt_xml_root_standalone", "xml_attributes", "xml_attribute_list", "xml_attribute_el", "document_or_content", "xml_whitespace_option", "xmlexists_argument", "within_group_clause", "filter_clause", "window_clause", "window_definition_list", "window_definition", "over_clause", "window_specification", "opt_existing_window_name", "opt_partition_clause", "opt_frame_clause", "frame_extent", "frame_bound", "row", "sub_type", "all_Op", "MathOp", "qual_Op", "qual_all_Op", "subquery_Op", "expr_list", "func_arg_list", "func_arg_expr", "type_list", "array_expr", "array_expr_list", "extract_list", "extract_arg", "overlay_list", "overlay_placing", "position_list", "substr_list", "substr_from", "substr_for", "trim_list", "in_expr", "case_expr", "when_clause_list", "when_clause", "case_default", "case_arg", "columnref", "indirection_el", "indirection", "opt_indirection", "opt_asymmetric", "ctext_expr", "ctext_expr_list", "ctext_row", "opt_target_list", "target_list", "target_el", "qualified_name_list", "qualified_name", "name_list", "name", "database_name", "access_method", "attr_name", "index_name", "file_name", "func_name", "AexprConst", "Iconst", "Sconst", "RoleId", "role_list", "SignedIconst", "ColId", "type_function_name", "NonReservedWord", "ColLabel", "unreserved_keyword", "col_name_keyword", "type_func_name_keyword", "reserved_keyword", YY_NULLPTR }; #endif # ifdef YYPRINT /* YYTOKNUM[NUM] -- (External) token number corresponding to the (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 61, 60, 62, 678, 43, 45, 42, 47, 37, 94, 679, 91, 93, 40, 41, 46, 59, 44, 58 }; # endif #define YYPACT_NINF -4013 #define yypact_value_is_default(Yystate) \ (!!((Yystate) == (-4013))) #define YYTABLE_NINF -2272 #define yytable_value_is_error(Yytable_value) \ (!!((Yytable_value) == (-2272))) /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const int yypact[] = { 5832, 1302, 10230, -4013, -4013, 1302, -4013, 54668, -15, 624, 1139, 174, 10863, 55084, 62156, 672, 280, 10957, 1302, 62156, 1880, 40940, 52172, 62156, 423, 589, 40940, 62156, 62572, 722, 863, 1073, 62988, 55500, 50924, 1277, 62156, 977, 301, 63404, 55916, 830, 56332, 589, 38046, 84, 769, 63820, 2153, 1235, 818, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -15, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, 191, -4013, 1146, 197, 641, 744, 862, -4013, -4013, -4013, 46348, 62156, 62156, 62156, 1087, 62156, 1022, 62156, 266, 46348, 46764, 64236, 1174, 1060, 34631, -4013, 44684, 62156, 62156, 64652, 62156, 1154, 56748, 62156, 1220, 62156, 62156, 47180, 65068, 1375, 983, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, 62156, 11263, 423, -4013, -4013, 62156, 1250, 46348, 62156, 1239, 62156, 1348, 62156, -4013, 62156, 1420, 65484, 411, 1504, 46764, 1602, 35061, 1493, 46764, 65900, 62156, 62156, -4013, -4013, 1529, 62156, 62156, -4013, 1649, 47596, 1308, 1658, 1930, 1714, 770, -4013, 57164, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, 45100, 280, -4013, -4013, 48012, 62156, 1748, -4013, -4013, 66316, -4013, 1641, -4013, 437, 48428, 48844, 1887, 1585, 35491, 1969, 49260, 66732, -4013, -4013, 67148, -4013, 67564, 1697, 67980, -4013, 49676, -4013, 1832, 68396, -4013, 1601, 1470, 1707, 31240, -4013, -4013, -4013, -15, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, 348, 1786, 295, 201, 325, -4013, -4013, 213, 238, 263, 348, 2079, 2079, -4013, 62156, -4013, -4013, 1786, 21, 1660, 1660, 1660, 1878, -31, -4013, 1660, -4013, -4013, -4013, -4013, 56332, -4013, 1684, 423, 1725, 2097, 1848, 62156, -4013, 62156, -4013, 62156, 62156, -4013, -4013, 2130, 1863, 2069, 1838, -4013, 2034, 2038, 2046, 296, 423, 1944, -4013, 2172, -4013, 2057, 21786, 423, 57580, 68812, 193, 45100, 423, 57996, 1914, 867, 2065, -4013, -4013, -4013, 662, -4013, 2289, 1932, 2147, 1838, 983, 32509, -4013, 1929, 1287, 56332, -4013, -4013, -4013, 205, 2221, 22220, -4013, 62156, 1943, -4013, 1957, 1960, 1961, 641, -4013, 5832, 62156, 328, 328, 2356, 328, 1495, 1624, -4013, 1402, -4013, 2260, 2234, 56332, 769, 206, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, 2020, 1287, -4013, 210, -4013, 1554, 2037, 1653, 1377, -4013, -4013, 748, 62156, 2162, 204, -21, 2064, 58412, 2461, 2044, -4013, 221, -4013, -4013, -4013, -4013, 2346, 4958, 279, 69228, -4013, 62156, 62156, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, 2087, -4013, -4013, 2076, 2362, 1151, 2297, 1242, 2423, 4658, 62, 62156, 2429, 5371, 1611, 787, 2322, 807, 2431, 1412, 2453, 5926, 62156, -4013, 2381, 2488, 51, -4013, 780, -4013, 2226, 2359, 716, 46348, 2180, -4013, -4013, 62156, -4013, -4013, -4013, 2259, -4013, 712, 46348, -4013, 2403, 2268, 35921, -4013, 62156, -4013, -4013, -4013, -4013, -4013, 2348, 62156, -4013, -4013, 2470, 62156, -4013, 1660, 2387, 2235, 2612, 77920, 83, 62156, 2273, 2643, 62156, 2440, 2273, 2274, 69644, -4013, -4013, 2273, -4013, -4013, 62156, 62156, 2243, 1381, 2273, 2444, 2644, 2648, 2323, 2426, 802, 274, 150, 2545, 2273, 2300, 62156, 70060, 62156, 2303, 62156, 2625, 46348, 62156, -4013, 2418, -4013, -4013, 1382, -4013, -4013, -4013, -4013, 2565, 2020, 814, 2566, 2269, 2569, -4013, -4013, 2302, -4013, 2572, 2044, 2573, -4013, 2270, 70476, -4013, 70892, 71308, 2574, 2087, 46764, 2576, 2270, 2577, 2463, 2579, 814, 2580, -4013, 1128, 2583, 2471, 2585, 1799, 2270, 45516, 2587, 182, -4013, 23956, -4013, 2374, -4013, 769, -4013, 1527, -4013, 40524, -4013, 1707, 1786, -4013, 62156, 1786, 62156, 1786, 62156, 1786, 62156, 1786, 62156, 62156, 62156, 1786, -4013, -4013, -4013, 62156, 2288, 62156, 62156, -4013, -4013, -4013, 52588, 46764, 53004, -4013, -4013, 69, 423, -4013, -4013, 77920, 2697, 46764, 2625, 2581, 2581, 2581, -4013, -4013, -4013, 2521, 62156, 2584, 2586, 52588, 46764, -4013, 71724, 45100, 2482, 2298, -4013, -4013, -4013, -4013, -4013, 1589, 2732, 306, 2734, 23956, 2305, 199, 199, 2306, 2596, -4013, -4013, -4013, 211, 2308, 2310, -4013, 246, 246, 2473, 2313, 2315, -4013, 247, 2316, 2749, 2750, 256, 2320, 2321, 2329, 1913, 199, 23956, -4013, 2332, 246, 2333, 2335, 2338, 2754, 2339, -4013, 2773, 2345, 202, 303, 2347, 2349, -4013, 2313, -4013, 235, 2350, 2353, 2357, 2361, 2363, 2364, 2365, 2369, 23956, 23956, -4013, 20918, 1287, 423, -4013, -4013, -4013, -4013, -4013, -4013, -4013, 144, -4013, 264, 4734, -4013, 2383, -4013, -4013, 2531, 23956, -4013, -4013, 2591, 2355, -4013, 272, -4013, -4013, -4013, 1287, -4013, -4013, 1065, 2367, -4013, 1514, -4013, -4013, -4013, -4013, -4013, -4013, 43436, 2777, -4013, 388, 423, 780, 283, 2724, 39692, 40108, -4013, -4013, 2602, -4013, 62156, -4013, -4013, 23956, 37630, -4013, 1287, 147, -4013, -4013, -4013, 1615, -4013, -4013, -4013, -15, -4013, 10184, -4013, 1652, 1943, 62156, 62156, 2782, -4013, -4013, -4013, 1957, -4013, -4013, 641, 641, 23956, 641, 186, 1656, 22654, 23956, 2672, 2575, 1195, 1273, 2674, -4013, 2578, 1495, 1624, 56332, 62156, 72140, 2494, -4013, 38462, 1683, 1287, 2469, 2472, 2515, 41772, 2394, 2474, 2475, 2523, 2476, 2481, 72556, -4013, -4013, -4013, -4013, 1386, 1049, 1062, 2483, 178, 168, 2765, -4013, 746, 2529, -4013, -4013, -4013, 2673, 62156, 2710, 5994, 2597, 279, 2530, -4013, -4013, 2645, 2490, 2493, 2613, 279, 1380, 72972, -4013, -4013, -4013, -4013, -4013, -4013, 2340, 19674, -4013, 2496, 2477, 62156, 50092, 313, 2608, 1208, 1824, 730, 62156, 2682, 2614, 62156, 2425, 2503, 2506, 2700, 2432, 1403, 2793, 2430, -4013, -4013, -4013, 1948, 2607, -4013, 2737, 6961, 2492, 2499, 77110, 1175, 36351, 2778, 546, 2526, -4013, 546, 62156, 2527, 2528, 62156, 279, -4013, 2841, 279, 279, 1378, 2842, 2532, 362, 1408, 2273, 2430, 1492, -4013, 2533, 2536, 848, -4013, 2642, -4013, 1216, 56332, 374, 1497, 2430, 277, 2541, 2542, 2432, 2432, 62156, 62156, 62156, 62156, 62156, 175, 2865, 2868, 2547, 180, 2593, 2479, -4013, 43852, 2550, 68812, -4013, -4013, 62156, 2553, 1503, 2430, 1405, 1646, -4013, -4013, -4013, 983, -4013, 62156, -4013, 62156, 2020, 77920, 2663, -4013, 2510, -4013, 2044, 279, -4013, 62156, 62156, 2087, 177, 1129, 2665, 62156, 2727, 2517, -4013, 481, 38869, -4013, 2243, 2485, -4013, -4013, 2538, -4013, 2538, 2538, 2486, 2486, 2487, -4013, -4013, -4013, 1913, 2538, 2486, -4013, 78730, -4013, 1507, 1622, -4013, 2898, 2900, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, 622, 1635, -4013, 62156, 41772, -4013, 2911, -4013, -4013, 77920, 2692, 2808, -4013, 62156, 2708, 2511, -4013, 2845, 2564, -4013, -4013, 59, -4013, 2814, 46764, 823, 423, 2558, 62156, 2735, 62156, 62156, 62156, 62156, -4013, -4013, 2705, 810, 139, -4013, 43852, -4013, 62156, 1492, 2717, 2924, 66, 1660, 62156, 2809, -4013, 62156, 2524, 2926, 2760, -4013, 1704, -4013, 2647, -4013, 46348, 814, -4013, -4013, -4013, -4013, 77920, 62156, 73388, 46348, 814, 46764, 46764, 2829, 182, 2830, 2588, 2831, 2589, 36351, 814, 255, 46764, 62156, 62156, 62156, -4013, 62156, -4013, -4013, -4013, -4013, 62156, 62156, 46764, 43852, 2832, 2836, 814, 62156, 62156, -4013, 10184, 1751, 62156, 1707, 44268, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, 62156, -4013, 62156, -4013, 62156, -4013, 62156, -4013, 62156, -4013, -4013, -4013, 62156, -4013, 62156, 1756, -4013, -4013, 1814, 142, 62156, 62156, 164, 46348, 62156, 2729, 62156, 62156, 62156, 62156, 62156, 2616, 2367, 1246, -4013, 218, 56332, 2739, -4013, -4013, 1825, 2153, 853, 62156, -4013, -4013, -4013, -4013, -4013, -4013, 53004, 52172, 2820, 364, 62156, -4013, -4013, 2495, 23956, 1287, 21352, -4013, -4013, -4013, 2546, 10184, 2592, 23956, -4013, -4013, 23956, 2548, 2079, 2079, 23956, -4013, -4013, -4013, -4013, 937, 2079, -4013, 23956, 23956, 2079, 2079, 2538, 2538, -4013, 5134, 23956, -4013, 36351, 23956, 26560, 18824, 23956, 2620, 2563, 2079, -4013, 2079, -4013, 23956, 20484, -4013, 23956, 2761, 27422, 23956, 283, 2762, 23956, 283, 2980, 2980, 1674, 4428, 2552, 1287, -4013, 2668, 2079, -4013, 2079, 751, -4013, 220, 77920, 23956, 41772, 2638, 252, 62156, 23956, 2561, 1647, -4013, 23956, 1027, -4013, 2562, 23956, 2640, 23956, 23956, 23956, 23956, 23956, 23956, 23956, 23956, 23956, -4013, 28268, 226, 2840, 2858, 30, 2055, 58828, 2854, 21786, 18389, -4013, 281, -4013, -4013, -4013, 62156, 2777, -4013, -4013, 2649, -4013, -4013, -4013, -4013, -4013, 273, -4013, -4013, -4013, -4013, -4013, -4013, -4013, 2568, -4013, -4013, -4013, -4013, 2568, -4013, 2582, 3797, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, 2843, 2847, 814, 62156, 205, 53420, -4013, 22220, -4013, 1835, -4013, 2590, -4013, 2822, -4013, 2595, -4013, 8208, 2822, -4013, -4013, 318, 2686, 2818, 2766, -4013, -4013, -4013, 2598, 10184, -4013, 1771, 10184, 1920, -4013, -4013, -4013, -4013, -4013, -4013, 895, -4013, 62156, 2739, 2672, 1273, 2635, 721, 62156, -4013, 32932, 2763, -4013, 2972, -4013, 78730, -4013, 2600, -4013, 78325, 75884, -4013, -4013, 34, -4013, 1187, 2670, 2671, 2718, 46764, 62156, 62156, -4013, 41772, 46764, 62156, 62156, 46764, 62156, 62156, -4013, 2949, 25, 52172, 2719, 51340, -4013, -4013, 2603, 62156, 2659, 2846, 2848, -42, -4013, -4013, 73804, -4013, 2801, 46764, 62156, 62156, 23956, 2803, 62156, 62156, -4013, 243, 2688, 2694, -4013, 62156, 2696, 46348, 2621, 62156, 62156, 62156, 2693, 715, 46348, 2667, 36781, 62156, 62156, 62156, 62156, 2742, 62156, 62156, 2862, 1057, 56332, 223, 1597, 2430, 2821, -4013, 1396, -4013, 46764, 62156, 2813, -4013, -4013, -4013, 59244, 3027, 2736, -4013, -4013, 74220, -4013, -4013, -4013, 1845, -4013, 46764, 46764, 7267, 62156, 1241, -4013, -4013, 77920, -4013, 62156, 62156, 62156, 62156, 53836, 74636, 75052, 1416, 1515, 62156, 54252, -4013, 62156, -4013, -4013, 42188, 46764, 62156, 861, 41772, -4013, 62156, 2825, 811, -4013, 62156, 5747, -4013, 2711, 62156, 390, 1833, 2430, 62156, 62156, 2631, 1846, 2720, 2764, -4013, 62156, -4013, 46764, 430, -4013, 2779, 46764, 62156, 9017, -4013, -4013, 279, -4013, -4013, -4013, -4013, -4013, 62156, 62156, 279, 62156, 279, 1029, -4013, 46764, 62156, -4013, -4013, -4013, 7801, 62156, 62156, 62156, 62156, 668, 953, 2683, 1181, 46764, 62156, -4013, -4013, 808, 1149, 1078, 1516, 2783, 62156, 2914, 62156, 75468, 46764, 62156, 62156, 62156, 897, -4013, -4013, 2767, -4013, 46764, 430, 9381, 62156, 62156, 2726, 2728, 155, 2797, -4013, -4013, -4013, -4013, -4013, -4013, 2893, 3060, 62156, -4013, 2899, 2901, 2714, 2716, 2906, 915, 62156, -4013, -4013, -4013, -4013, 62156, 2908, 915, 2853, 714, -4013, -4013, 2273, -4013, 2680, 1852, -4013, -4013, 23956, 3074, 77920, 2675, 2676, 2747, 2748, 2752, -4013, 2679, 2753, 2079, -4013, -4013, 1713, -4013, -4013, 1858, -4013, 2685, 810, 2056, -4013, 41772, 62156, 880, 821, 2981, 50508, 1593, 2970, 62156, 2725, 62156, 1593, 62156, -4013, 1680, 52172, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, 2973, -4013, 423, 2243, 2243, 2243, 2243, -4013, -4013, -4013, -4013, 2873, 117, -4013, 2687, 2243, 62156, 2798, 1593, 2689, -4013, 1492, 2989, 112, 62156, 50508, 1805, 2730, 3095, 1660, 423, 2877, -4013, 20079, 2224, 2881, 45100, 2968, 2969, 2987, -4013, 2020, -4013, 3104, -4013, 3002, 814, 2044, -4013, 2270, -4013, 62156, -4013, 62156, 62156, 62156, 62156, 2087, -4013, -4013, 2270, 2888, 814, 814, -4013, 2889, 814, 2270, 2817, 2994, 45100, -4013, 182, -4013, -4013, 23956, 1660, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, 1860, -4013, 62156, -4013, 2971, 2974, 2975, 2702, 2704, 2741, 62156, 2709, -4013, 2702, 279, 2702, 2367, 2367, 2702, 2704, 45932, 3129, 2992, 156, -4013, 165, 1213, 2927, -4013, -4013, -4013, -4013, 77920, -4013, -4013, -4013, -4013, -4013, 62156, 2751, 351, 2903, 2715, 45932, 3106, 814, -4013, 46348, -4013, -4013, -4013, 2794, 2807, 46348, 2913, 2768, -4013, -4013, -4013, -4013, -4013, -4013, -4013, 2960, 62156, 1868, -4013, -4013, 1655, -4013, 1690, 23956, 23956, 367, -4013, 8669, 1874, 23956, 2723, 2731, 1900, -4013, -4013, -4013, -4013, -4013, -4013, -4013, 2733, 3010, -4013, 2738, 1909, 1911, 2740, 2743, -4013, -4013, 3638, 2744, 9219, 2745, 26560, 26560, 369, -4013, -4013, 26560, 2746, -4013, 1924, 8289, 2755, 2756, 2758, -4013, 2757, 2769, 8773, 23088, 23956, 23088, 23088, 9358, 2755, 2770, 1933, 41772, 2895, 9662, 1934, -4013, 23956, 41772, 4151, 23956, -4013, 23956, 62156, 2771, 2772, -4013, -4013, 5134, -4013, 2780, -4013, 26560, 26560, -4013, 4356, 20918, -4013, -4013, 3012, -4013, -4013, 2173, -4013, 2774, -4013, -4013, 6128, 391, 23956, 2561, 23956, 2810, 36351, 2509, 23956, 3340, 3685, 3685, 352, 352, 271, 271, 271, 1762, 2055, -4013, -4013, -4013, 2775, 2776, 2781, 2907, 2339, 23956, -4013, 1898, 1904, 62156, 2816, 3380, 3896, -4013, -4013, 29548, 2789, -4013, 23956, 23956, 23956, 2784, -4013, 3158, 10184, 732, -4013, 3159, -4013, 983, 2079, 751, 40524, -4013, -4013, 23956, -4013, -4013, -4013, 1957, -4013, -4013, -4013, -4013, -4013, 62156, 2153, 23956, -4013, -4013, 480, 1759, 23956, 1771, -4013, -4013, 2795, -4013, 23956, -4013, -4013, -4013, 2367, -4013, -4013, -4013, 29548, 2790, 2786, 32086, 2874, -4013, -4013, 62156, 363, -4013, -4013, -4013, 2799, -4013, -4013, 75884, 1635, -4013, 78325, -4013, 78325, -4013, 1635, 3131, -4013, 75884, 1722, 46764, 62156, 62156, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, 2977, -4013, 46764, 46764, 2940, 62156, 2938, 2947, 23956, 908, 62156, 2787, 2788, 1450, 3024, 62156, -4013, 3065, 814, -4013, -4013, 2844, -4013, 10184, -4013, -4013, -4013, -4013, -4013, 46764, 62156, -4013, 45100, -4013, 2020, 77920, -4013, -4013, -4013, 62156, 2824, 62156, -4013, 62156, 62156, 62156, 2087, -4013, -4013, -4013, -4013, 1133, -4013, -4013, 62156, 62156, 674, 2859, 2861, 62156, -4013, 1171, 2642, 9739, 62156, 62156, 62156, 3019, -4013, -4013, -4013, -4013, 2964, -4013, -4013, 75884, -4013, 2270, 2866, 2430, -4013, 2976, -4013, 724, -4013, -4013, -4013, -4013, -4013, 3091, 814, 3094, 814, 62156, 62156, 62156, 62156, -4013, -4013, -4013, -4013, -4013, 41772, 41772, 41772, 1940, -4013, -4013, 423, -4013, -4013, -4013, -4013, -4013, -4013, 3057, -4013, 1941, -4013, 1362, -4013, -4013, -4013, -4013, -4013, -4013, 46764, 10178, 62156, 62156, 62156, 1787, -4013, 815, 77920, -4013, 77515, 46764, 62156, -4013, -4013, -4013, 3022, 2967, -4013, 951, 2978, 46764, 2860, -4013, 2880, -4013, -4013, 2885, 1985, 2430, 1492, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, 412, 2077, 2430, 2886, -4013, 2887, -4013, 3203, 62156, 3209, 62156, 1230, 3210, 62156, -4013, -4013, 3040, 3042, 3044, 2905, 2916, 2952, 2917, 2919, 2953, -4013, 2920, 2958, 2922, 2979, 2923, 814, 77920, 3047, 423, 2959, 3149, 814, -4013, 2928, -4013, -4013, 3249, -4013, 62156, -4013, 2929, 2155, 2430, -4013, -4013, 46764, 62156, -4013, -4013, -4013, 915, 77920, 3097, 915, 915, 62156, 62156, 915, -4013, -4013, -4013, 3099, 3101, 915, -4013, -4013, -4013, -4013, 2387, 2867, 34201, -4013, 3294, 5224, 2870, 2676, 2872, 2079, 253, 871, 1155, 2988, 2079, 3081, 2875, -4013, -4013, 41772, 34201, 1809, 3100, 2891, 2891, 2891, 2891, 2891, 2891, 2891, -4013, 2043, 110, 2273, 45100, 62156, 45100, -4013, 821, 2976, 62156, 62156, 2878, 2876, -4013, -4013, -4013, -4013, 46764, 143, 46764, 2079, -4013, -4013, 2942, -4013, 62156, 1660, 3279, 2648, 823, 3020, 1437, 3222, 2730, -4013, -4013, -4013, -4013, 62156, 62156, 810, 423, -4013, 2883, 2882, -4013, 62156, 62156, 62156, 62156, 2751, 2890, 2884, 77920, 601, 3075, 3077, 2432, 3297, 2153, 2730, 2985, 62156, -4013, 1942, 122, -4013, 423, 45100, 76289, -4013, 1775, -4013, -4013, 151, 3169, -4013, -4013, 2153, 814, 77920, 62156, -4013, 814, 182, 2950, 814, 2951, 814, 814, 62156, -4013, -4013, 62156, -4013, 62156, 43852, 814, -4013, 10184, -4013, -4013, 3023, 3025, 3026, 62156, 2702, 46348, -4013, 2909, 46764, 1310, -4013, -4013, 3085, -4013, -4013, -4013, -4013, -4013, 3212, 3213, -4013, -4013, -4013, 225, -4013, 46764, 52588, 278, 46764, -4013, 2020, -4013, -4013, 2044, 279, -4013, 62156, 3154, -4013, -4013, -4013, 2921, 1955, 9714, 23956, -4013, 3224, 77920, -4013, 5257, -4013, -4013, -4013, -4013, 23956, -4013, -4013, -4013, -4013, -4013, 23956, -4013, 23956, 3201, -4013, 3343, 3343, 77920, 26560, 1488, 2333, 26560, 26560, 26560, 26560, 26560, 26560, 26560, 26560, 26560, 28702, 856, -4013, -4013, 23956, 23956, 3211, 3201, -4013, -4013, 1547, 1547, 77920, 2925, 2755, 2931, 2935, 23956, -4013, -4013, 1965, 27845, 2936, 41772, -4013, 23956, 8316, 1971, 2965, 9979, 1287, 6053, -4013, 3298, 423, 23956, 801, 959, 23956, 1976, 23956, 3208, -4013, -4013, -4013, 2941, -4013, -4013, 77920, 23956, 26560, 26560, 7966, -4013, 8420, 23956, 2937, 8717, 20918, -4013, 3105, 2966, 33355, -4013, 589, 589, 589, 589, -4013, 62156, 62156, 62156, 29971, 3214, 29125, 59660, 2939, 1946, -4013, 59660, 60076, -4013, 2943, -4013, 2945, 1287, 23956, 3205, 743, 743, 3105, -4013, 23956, 23522, 2946, -4013, 780, 2948, -4013, -4013, 5592, -4013, -4013, 2954, -4013, 2956, -4013, 1759, -4013, -4013, -4013, 6093, 3127, -4013, -4013, 2939, 24390, 2874, -4013, 1989, -4013, -4013, 21786, -4013, -4013, 1994, 32932, 2790, 22220, 1287, 2004, 1754, -4013, -4013, 75884, -4013, 3016, -4013, -4013, -4013, 2891, 2270, 2270, 1214, 2702, 3240, 1214, 6612, -4013, -4013, 30394, 62156, 62156, -4013, 62156, 2024, 1184, 62156, -4013, 62156, -4013, -4013, -4013, -4013, 3357, -4013, 62156, -4013, -4013, 3008, 3009, -4013, 62156, 62156, 62156, 62156, -4013, -4013, 2037, -4013, -4013, 46764, 62156, -4013, -4013, -4013, 413, 2185, 2430, -4013, 3035, -4013, -4013, 3216, -4013, 62156, 2983, -4013, 1184, 228, 2432, 133, -4013, -4013, 3028, 62156, -4013, 62156, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, 42188, -4013, -4013, 62156, -4013, 41772, 34201, 41772, -4013, 436, 2210, 2430, -4013, 3036, -4013, 3041, 3043, 3087, 680, 717, 3046, 3048, 3089, 2984, 2986, 2990, -4013, -4013, 348, 423, -4013, -4013, 423, 2270, 423, 62156, 62156, 62156, 62156, 62156, 62156, 62156, 62156, 46764, 2739, 46764, 2739, 3360, 62156, 46764, 2739, 3262, 1080, 1808, 46764, 62156, 62156, 46764, 62156, 62156, 62156, 62156, 62156, 62156, 62156, -4013, 3344, 3278, 1981, 3318, 3049, 62156, -4013, 62156, 2642, 62156, 62156, -4013, -4013, -4013, 2991, 915, -4013, -4013, 3227, 3232, -4013, 915, 915, -4013, 481, 41772, -4013, 2311, 2956, 2079, 1948, -4013, -4013, -4013, -4013, -4013, -4013, 2680, -4013, -4013, 2079, 1931, 2995, -4013, 2997, -4013, -4013, -4013, -4013, -4013, -4013, 2998, -4013, 751, -4013, -4013, 62156, 2891, -4013, 337, 1258, 1334, 1357, 60492, 60908, 61324, 2993, 62156, 62156, 26560, -4013, 1491, 1199, -4013, 3218, 62156, 3037, -4013, -4013, -4013, 3160, 62156, -4013, -4013, -4013, -4013, -4013, 3000, -4013, 3117, 50508, 2270, 46764, 46764, 2270, -4013, 77920, 3011, 2730, 46764, 823, 1093, 70060, 3050, -4013, 3004, 3304, -4013, 3029, 3005, -4013, -4013, 62156, 2976, 2026, 74, 1601, -4013, 51756, 1805, 3275, -4013, -4013, -4013, 3386, 3108, -4013, 2153, 2751, 3108, 423, 2659, -4013, 75884, 23956, 23956, -4013, 3021, -4013, 3031, 2930, -4013, 2243, -4013, -4013, -4013, -4013, -4013, -4013, 3103, 62156, -4013, -4013, 3032, 814, -4013, -4013, 62156, -4013, 62156, -4013, -4013, 814, 814, -4013, 3142, -4013, 62156, 62156, 62156, 2702, -4013, 279, -4013, 3311, 45932, -4013, -4013, -4013, -4013, -4013, 3374, 364, 3319, -4013, -4013, 3280, 3281, 3282, 3283, 956, -4013, -4013, 23956, 10184, -4013, 3045, -4013, 10184, 6627, 10184, 3211, -4013, 1709, 3320, -4013, 1347, 3051, 1709, 1067, 1067, 426, 426, 194, 194, 194, 3343, 856, 10184, 10184, -4013, -4013, -4013, -4013, 3053, -4013, -4013, -4013, 2755, -4013, 24824, 3186, 3430, -4013, -4013, -4013, 3082, 3083, 3054, -4013, 23956, 25258, 3052, 78730, -4013, -4013, 751, 333, 26560, 26560, 1202, -4013, 410, 23956, 77920, 2030, 1202, 1496, 1815, 23956, 23956, 8787, 236, 23956, 6668, 3056, 23956, 76694, -4013, -4013, 62156, 62156, 62156, 62156, -4013, -4013, -4013, 59660, 60076, 3058, 19250, 1946, 3059, 62156, -4013, -4013, 3061, 29548, 3287, 3226, -4013, 29548, 3226, 1500, 3226, 3290, -4013, 33778, -4013, -4013, 3062, -4013, -4013, 18389, 1627, 10184, 3440, 3333, 23956, 3063, 3064, 3066, 10184, 23956, -4013, 423, 423, -4013, -4013, 36351, -4013, -4013, -4013, 3253, 10184, -4013, 2153, 62156, 1287, 2355, 3079, 62156, -4013, 2874, -4013, -4013, 3136, 2058, -4013, 348, -4013, -4013, -4013, -4013, 3146, 52172, 3354, -4013, 23956, 2060, -4013, 3111, 3447, 134, 2078, 2082, 1184, -4013, 3037, -4013, 1573, 3337, 138, -4013, 814, -4013, 77920, -4013, 62156, 62156, -4013, -4013, -4013, -4013, 2394, -4013, -4013, 62156, 62156, 62156, 62156, -4013, -4013, 41772, 2043, 3274, -4013, -4013, 3276, 348, 62156, -4013, 77920, 814, 814, -4013, -4013, -4013, -4013, 3093, 62156, 62156, 62156, 62156, 46764, 62156, 62156, 2079, 2079, 77920, 3078, -4013, 2079, 2079, 3080, -4013, 46764, 62156, 62156, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, 3164, -4013, -4013, -4013, 1091, -4013, 1211, -4013, 46764, 2739, 1259, -4013, 62156, 62156, 62156, 62156, 3384, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, 62156, -4013, -4013, 423, 423, 77920, 814, 814, -4013, -4013, -4013, 3331, -4013, 915, 915, -4013, -4013, 209, 2091, -4013, 30817, -4013, -4013, 2643, 423, 2643, 1548, -4013, -4013, 2643, -4013, 2643, -4013, 1184, 3090, 1614, 3372, -4013, -4013, -4013, -4013, 3376, 348, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, 23956, -4013, 1023, 1709, -4013, -4013, -4013, -4013, 3037, 1660, 3148, 46348, 310, -4013, 3358, 880, 50508, 1219, 62156, -4013, 2270, 2270, 3150, 62156, 3504, -4013, 522, 62156, 3415, 3143, -4013, 423, -4013, -4013, 2730, 62156, 50508, 2751, 2093, -4013, -4013, -4013, 3138, 3077, 3107, 1805, 826, 62156, -4013, 3141, -4013, -4013, 3392, 3109, -4013, 10184, 10184, 423, 79135, 1775, -4013, 62156, 3366, 814, -4013, 814, 814, -4013, -4013, 62156, 2702, 2702, 2702, -4013, 3295, -4013, -4013, 814, 45932, 956, 956, 956, 956, -4013, -4013, -4013, 10184, -4013, -4013, -4013, 26560, 3395, -4013, 3113, 77920, -4013, 3115, 2104, 2125, 27422, 3261, -4013, -4013, -4013, 6954, 3167, 10184, 3219, 3119, 3120, -4013, 521, 521, 410, 2129, -4013, 26560, 26560, 1202, 1202, 23956, 1202, -4013, -4013, 6981, 3291, -4013, -4013, -4013, -4013, -4013, -4013, -4013, 42604, 59660, 3118, 62156, 1946, 29548, -4013, -4013, 1921, -4013, 29548, 3363, -4013, 29548, 62156, 3124, 62156, 732, 23956, 23956, 3162, -4013, -4013, -4013, 3105, -4013, 751, 3125, 62156, -4013, -4013, 769, -4013, -4013, -4013, -4013, -4013, 45932, 3313, 45932, 1184, 7229, 3037, 30394, 37211, 62156, 61740, 61740, 3273, 3037, 3148, -4013, -4013, -4013, -4013, -4013, -4013, 3130, -4013, -4013, -4013, 3207, -4013, -4013, 2133, -4013, -4013, -4013, -4013, -4013, 3344, -4013, -4013, 34201, -4013, 3215, -4013, -4013, -4013, -4013, -4013, 31663, 36351, -4013, 680, 3132, 3134, 717, -4013, -4013, -4013, 62156, 62156, 62156, 1306, -4013, 62156, 1397, 878, 3172, 2702, 3426, -4013, -4013, -4013, 3344, -4013, -4013, 915, -4013, -4013, -4013, 2273, 3467, -4013, 41772, -4013, 43020, -4013, -4013, -4013, 423, -4013, 423, 3339, 62156, 39276, 423, 423, -4013, 46348, 3547, 3547, 62156, -4013, -4013, 7469, 3341, -4013, 3148, 3361, 3408, -4013, 3152, 62156, 3302, 3157, 3168, 986, 986, 2976, 62156, 2137, 2153, 823, 50508, 2976, -4013, 45, 3163, 3451, -4013, 3555, 2890, 3170, -4013, -4013, 51756, 3347, 3108, 62156, 3077, 3301, -4013, 3305, -4013, 1162, -4013, 62156, 30394, -4013, 78325, -4013, 2142, -4013, -4013, 2789, 62156, 88, -4013, -4013, -4013, -4013, -4013, -4013, 278, -4013, -4013, -4013, -4013, 914, 26560, 77920, 2143, 23956, -4013, 23956, -4013, 3546, -4013, -4013, -4013, 79, -4013, -4013, -4013, 521, 521, 1202, -4013, 3560, 3105, -4013, 2144, 3582, -4013, 62156, 2160, -4013, 23956, 3179, -4013, -4013, 29548, 1921, 2161, 62156, 2165, 77920, 3181, 2755, 10184, 62156, -4013, 3182, -4013, -4013, -4013, -4013, 1310, 1214, 278, 3447, 3148, -4013, 3188, -4013, -4013, 62156, -4013, 300, 300, 62156, 3148, -4013, -4013, 62156, -4013, 41772, 3241, -4013, 62156, 77920, 2044, 81, -4013, 77920, 77920, -4013, -4013, 2739, 2739, 62156, 2739, 62156, 62156, 62156, 62156, 62156, 814, -4013, 2867, 423, -4013, -4013, 2171, -4013, -4013, -4013, 62156, 3004, -4013, 3004, -4013, -4013, 3547, 1125, -4013, -4013, -4013, 1383, 3391, -4013, 1034, 3377, 3284, 3189, -4013, 46348, 3624, 3307, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, 3490, 2730, 3141, -4013, -4013, -4013, -4013, 23956, 3350, 2153, 1805, 3275, -4013, -4013, -4013, 2177, 3108, -4013, -4013, 3573, 3381, 3578, -4013, 2178, -4013, -4013, 2930, 79135, 3523, -4013, 3255, 62156, -4013, -4013, -4013, 914, 2188, -4013, 2189, 2190, 3352, 3258, -4013, 23956, 1482, 2943, 42604, 3217, -4013, 2195, -4013, 10184, 62156, -4013, -4013, -4013, 2196, -4013, -4013, 3220, -4013, 3610, -4013, -4013, 3493, -4013, 61740, 3250, 36351, -4013, 1759, 1759, 1660, -4013, 1184, -4013, -4013, 23956, -4013, -4013, 2200, -4013, 87, 3359, 3503, 2202, 2215, -4013, -4013, 2739, -4013, 2704, 3252, 2704, -4013, 2702, -4013, -4013, -4013, -4013, 43020, 3004, -4013, -4013, -4013, 3533, 3478, -4013, -4013, -4013, -4013, 227, -4013, 3406, 3407, 62156, -4013, 3223, -4013, 2216, 62156, 62156, 3630, 3632, -4013, 7718, 46348, 3141, 3077, 1805, 2043, -4013, -4013, 3411, -4013, 3412, 2730, 30394, 1775, -4013, 890, -4013, -4013, -4013, -4013, -4013, -4013, -4013, 2755, 25692, 25692, 3230, -4013, -4013, 62156, -4013, 2217, -4013, 62156, 3233, 45932, 300, 3235, -4013, 3231, -4013, -4013, 3361, 1184, 10184, 46348, 3625, -4013, -4013, -4013, 3359, -4013, -4013, -4013, 62156, -4013, 3362, -4013, 813, 813, 3567, -4013, 3299, -4013, -4013, 3239, -4013, 3672, 2976, -4013, 680, 2153, -4013, 3243, -4013, 3108, 3077, -4013, -4013, 3108, -4013, -4013, -4013, -4013, 2040, 26994, 3371, 773, 8343, -4013, -4013, -4013, -4013, 2222, -4013, -4013, -4013, 278, 1759, 23956, 1184, -4013, 3377, 2044, 62156, -4013, -4013, 3143, -4013, 3665, -4013, 1058, -4013, -4013, -4013, -4013, -4013, 3078, 3141, 41356, -4013, 3108, 2789, -4013, 1917, -4013, -4013, -4013, -4013, -4013, -4013, -4013, 3655, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, 7765, -4013, -4013, -4013, 3551, -4013, -4013, -4013, -4013, -4013, 2223, -4013, -4013, -4013, -4013, -4013, -4013, 1831, -4013, -4013, 1949, 1961, 26126, -4013, 1184, 3404, -4013, 41356, -4013, 1917, -4013, 46348, -4013, -4013, 3254, 41356, 2228, -4013 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. Performed when YYTABLE does not specify something else to do. Zero means the default is an error. */ static const yytype_uint16 yydefact[] = { 1400, 1197, 539, 1284, 1283, 1197, 242, 0, 1286, 0, 1197, 363, 951, 0, 0, 0, 0, 539, 1197, 0, 1400, 0, 0, 0, 0, 1413, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1197, 0, 0, 1420, 0, 0, 0, 0, 1413, 0, 1288, 0, 0, 0, 0, 2, 4, 61, 62, 26, 25, 31, 30, 84, 85, 49, 17, 75, 55, 118, 117, 119, 37, 33, 69, 22, 24, 34, 38, 57, 39, 50, 96, 56, 20, 54, 79, 58, 82, 44, 11, 12, 45, 73, 13, 46, 74, 14, 47, 15, 63, 86, 29, 59, 83, 60, 5, 40, 71, 67, 10, 51, 52, 53, 76, 77, 78, 101, 81, 113, 36, 110, 90, 91, 107, 92, 108, 8, 93, 48, 16, 104, 103, 105, 70, 41, 72, 102, 23, 106, 18, 19, 109, 80, 99, 95, 114, 112, 120, 97, 64, 6, 7, 87, 21, 43, 9, 28, 27, 42, 35, 116, 32, 1286, 89, 100, 88, 65, 94, 68, 98, 115, 66, 111, 1387, 1374, 1422, 1386, 1399, 0, 1389, 1196, 1195, 1181, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 538, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1207, 1945, 1960, 1961, 1962, 1963, 1964, 1965, 1966, 1967, 334, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 2219, 2220, 2221, 2222, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 2223, 2224, 1985, 1986, 1987, 1988, 1989, 2225, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2226, 2227, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026, 2027, 2028, 2029, 2030, 2031, 2032, 2033, 2034, 2228, 2035, 2036, 2037, 2229, 2038, 2039, 2040, 2230, 2041, 2042, 2043, 2044, 2045, 2046, 2047, 2231, 2048, 2049, 2050, 2051, 2052, 2053, 2054, 2055, 2056, 2057, 2058, 2059, 2060, 2061, 2062, 2063, 2232, 2064, 2065, 2066, 2067, 2233, 2234, 2235, 2068, 2069, 2070, 2071, 2072, 2073, 2074, 2075, 2076, 2077, 2236, 2078, 2079, 2080, 2081, 2082, 2083, 2084, 2085, 2086, 2087, 2088, 2089, 2090, 2091, 2092, 2093, 2094, 2237, 2238, 2095, 2096, 2239, 2097, 2098, 2099, 2240, 2100, 2241, 2101, 2102, 2103, 2104, 2105, 2106, 2107, 2108, 2242, 2109, 2243, 2110, 2111, 2112, 2113, 2114, 2115, 2116, 2117, 2244, 2118, 2245, 2121, 2119, 2120, 2122, 2123, 2124, 2125, 2126, 2127, 2128, 2129, 2246, 2130, 2131, 2132, 2133, 2134, 2135, 2136, 2137, 2138, 2139, 2140, 2141, 2142, 2143, 2144, 2145, 2146, 2147, 2148, 2247, 2149, 2150, 2151, 2152, 2153, 2154, 2155, 2156, 2157, 2158, 2159, 2160, 2161, 2162, 2248, 2163, 2164, 2165, 2249, 2166, 2167, 2168, 2169, 2170, 2171, 2172, 2173, 2174, 2175, 2176, 2250, 2177, 2178, 2179, 2180, 2181, 2182, 2183, 2184, 2251, 2252, 2185, 2253, 2186, 2254, 2187, 2188, 2189, 2190, 2191, 2192, 2193, 2194, 2195, 2196, 2197, 2198, 2199, 2200, 2201, 2202, 2203, 2255, 2256, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214, 2215, 2257, 2258, 2259, 2260, 2261, 2262, 2263, 2264, 2265, 2216, 2217, 2218, 333, 1365, 1916, 1946, 1947, 1285, 1266, 539, 0, 1184, 362, 0, 0, 0, 0, 0, 0, 0, 0, 728, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 167, 0, 0, 386, 385, 0, 0, 0, 923, 391, 0, 0, 0, 0, 0, 527, 1327, 2119, 1325, 1366, 243, 246, 247, 244, 245, 1938, 0, 1030, 1031, 1033, 0, 0, 1043, 763, 764, 0, 762, 0, 766, 0, 0, 0, 758, 0, 0, 0, 0, 0, 765, 755, 0, 754, 0, 0, 0, 761, 0, 756, 0, 0, 1185, 1324, 392, 1400, 0, 1302, 1303, 1304, 1286, 1293, 1305, 1298, 1300, 1299, 1301, 1297, 1937, 1961, 862, 862, 862, 862, 859, 860, 862, 862, 862, 2136, 0, 0, 841, 0, 843, 1942, 862, 867, 447, 447, 447, 0, 866, 871, 447, 1178, 1216, 1921, 1412, 0, 842, 1177, 2185, 1316, 0, 0, 0, 1047, 0, 1048, 0, 2151, 1189, 227, 2161, 2251, 2185, 223, 197, 1965, 0, 0, 866, 0, 1186, 1187, 825, 1419, 1417, 1903, 1983, 1996, 2081, 220, 2147, 2152, 2161, 2251, 2185, 2215, 176, 186, 181, 0, 236, 2161, 2251, 2185, 232, 1207, 0, 1390, 1505, 1912, 0, 1180, 1179, 1287, 0, 1290, 0, 1467, 2132, 1394, 1396, 1292, 1387, 0, 0, 1, 1400, 1281, 1416, 1416, 0, 1416, 0, 1379, 1387, 1382, 1386, 0, 0, 0, 0, 1945, 2266, 2267, 2268, 2269, 2270, 2271, 2272, 2273, 2274, 2275, 2276, 2277, 2278, 2279, 2280, 2281, 2282, 2283, 2284, 2285, 2286, 2287, 0, 0, 1922, 1946, 1950, 0, 773, 0, 124, 1917, 911, 0, 0, 0, 0, 1916, 0, 0, 0, 0, 1951, 0, 1939, 1952, 1953, 1954, 2053, 0, 0, 0, 1815, 1987, 2038, 1825, 1823, 1824, 1817, 1818, 1819, 1820, 1821, 1822, 0, 1028, 1816, 0, 146, 124, 0, 0, 2053, 0, 0, 0, 2053, 0, 0, 0, 0, 0, 2084, 124, 2053, 0, 0, 1201, 0, 0, 0, 1203, 1206, 1182, 1269, 0, 1912, 0, 0, 804, 794, 0, 805, 795, 800, 0, 807, 0, 0, 797, 0, 0, 0, 808, 0, 796, 798, 810, 799, 806, 0, 0, 801, 802, 0, 0, 1193, 447, 340, 0, 0, 0, 0, 0, 124, 1256, 0, 2053, 124, 0, 0, 390, 389, 124, 388, 387, 1987, 2038, 0, 950, 124, 2053, 0, 169, 609, 542, 0, 0, 687, 2084, 124, 0, 0, 0, 0, 0, 0, 926, 0, 0, 526, 539, 1328, 1326, 0, 1034, 222, 221, 1032, 2053, 0, 308, 0, 0, 2053, 1244, 760, 0, 759, 2053, 0, 2053, 1940, 160, 0, 757, 1987, 2038, 2053, 0, 0, 2053, 152, 2053, 0, 2053, 308, 2053, 543, 0, 2053, 0, 2053, 2084, 154, 0, 2053, 308, 771, 0, 1321, 0, 1295, 2255, 1310, 0, 1306, 1313, 1309, 1400, 862, 861, 0, 862, 0, 862, 0, 862, 0, 862, 0, 0, 0, 862, 1943, 1944, 844, 0, 868, 0, 0, 875, 874, 873, 0, 0, 0, 876, 1509, 1343, 0, 1175, 1192, 0, 0, 0, 926, 1050, 1050, 1050, 1188, 226, 224, 0, 0, 0, 0, 0, 0, 1194, 0, 0, 0, 0, 1925, 1927, 1928, 1826, 1893, 0, 2220, 2221, 2222, 1884, 0, 2223, 2224, 2225, 2268, 1734, 1721, 1730, 1735, 1722, 1724, 1731, 2226, 2227, 2022, 2228, 2229, 1935, 2230, 2231, 2233, 2234, 2235, 2236, 1726, 1728, 2237, 2238, 0, 1936, 2240, 2241, 2105, 2243, 2244, 2246, 2247, 1732, 2249, 2250, 2251, 2252, 2253, 2254, 1934, 0, 1733, 2256, 2258, 2259, 2260, 2261, 2262, 2263, 2264, 2265, 0, 0, 1909, 0, 1703, 0, 1549, 1550, 1572, 1573, 1551, 1578, 1579, 1591, 1552, 0, 1908, 1616, 1783, 1702, 1717, 1708, 0, 1701, 1697, 1402, 1902, 1904, 0, 1698, 1924, 1926, 1885, 189, 238, 0, 239, 1910, 2161, 177, 219, 191, 218, 192, 190, 0, 1985, 178, 0, 0, 179, 0, 0, 0, 0, 235, 233, 0, 1183, 0, 1507, 1506, 0, 0, 1891, 1913, 780, 1279, 1280, 1278, 0, 1275, 1277, 1289, 1286, 1898, 1897, 1899, 0, 1395, 0, 0, 0, 1377, 1376, 3, 1292, 1414, 1415, 0, 0, 0, 0, 0, 0, 0, 0, 1457, 1430, 1431, 1433, 1454, 1458, 1466, 0, 1383, 0, 0, 1511, 0, 1468, 0, 0, 1923, 0, 0, 0, 0, 774, 0, 0, 0, 0, 0, 0, 123, 1242, 229, 1240, 0, 0, 0, 0, 0, 0, 0, 1248, 0, 0, 158, 159, 554, 539, 0, 2053, 0, 0, 0, 0, 990, 997, 0, 0, 0, 0, 0, 0, 0, 991, 989, 992, 231, 1001, 1014, 1017, 0, 901, 0, 0, 0, 0, 1107, 0, 0, 1107, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 258, 303, 519, 0, 0, 521, 2053, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0, 506, 518, 0, 0, 0, 0, 0, 515, 0, 124, 252, 499, 503, 0, 0, 0, 618, 617, 1246, 0, 0, 1107, 0, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 326, 327, 0, 0, 0, 128, 151, 0, 0, 0, 254, 0, 0, 1202, 1199, 1200, 0, 1205, 0, 1265, 0, 0, 0, 0, 812, 0, 809, 0, 0, 803, 1987, 2038, 0, 0, 0, 0, 0, 0, 365, 339, 0, 0, 684, 0, 0, 1948, 1560, 1589, 1567, 1589, 1589, 1556, 1556, 1569, 1557, 1558, 1596, 0, 1589, 1556, 1561, 0, 1559, 1599, 1599, 1584, 0, 1541, 1542, 1543, 1544, 1570, 1571, 1545, 1576, 1577, 1546, 1613, 1556, 1949, 0, 0, 695, 0, 1219, 1255, 0, 0, 0, 548, 0, 2053, 0, 126, 729, 0, 685, 391, 0, 126, 0, 0, 163, 0, 613, 0, 0, 0, 0, 0, 0, 633, 632, 0, 0, 0, 686, 0, 126, 0, 502, 2053, 0, 447, 447, 0, 0, 925, 928, 0, 0, 0, 1369, 1371, 1370, 0, 1368, 0, 308, 306, 307, 682, 1042, 0, 0, 0, 0, 308, 0, 0, 2053, 308, 2053, 0, 2053, 0, 0, 308, 308, 0, 0, 0, 0, 614, 0, 770, 768, 767, 769, 0, 0, 0, 0, 0, 2053, 308, 0, 0, 751, 1836, 0, 0, 1400, 0, 208, 209, 207, 1311, 210, 1312, 1308, 1294, 0, 852, 0, 856, 0, 847, 0, 853, 0, 848, 845, 846, 0, 851, 0, 0, 448, 450, 0, 0, 2007, 2021, 0, 2044, 2072, 2073, 2152, 2157, 0, 2180, 2189, 0, 877, 906, 872, 0, 0, 1353, 1176, 1842, 0, 1400, 0, 0, 1049, 1046, 1045, 1044, 225, 198, 0, 0, 0, 908, 2151, 1191, 824, 539, 0, 1699, 0, 1706, 1707, 1588, 1575, 1883, 0, 0, 1583, 1582, 0, 0, 0, 0, 0, 1565, 1564, 1563, 1705, 1850, 0, 1562, 0, 0, 0, 0, 1589, 1589, 1587, 1636, 0, 1566, 0, 0, 1863, 0, 1869, 0, 0, 0, 1595, 0, 1593, 0, 0, 1672, 0, 0, 0, 0, 0, 0, 0, 0, 1620, 1621, 1703, 1836, 0, 1704, 1931, 0, 0, 1581, 0, 1613, 1907, 1826, 0, 0, 0, 0, 1896, 0, 1834, 0, 0, 1650, 1832, 0, 1652, 0, 0, 0, 1825, 1823, 1824, 1817, 1818, 1819, 1820, 1821, 1822, 1830, 1633, 0, 0, 1785, 0, 1632, 0, 1470, 0, 0, 1929, 1886, 240, 241, 237, 0, 0, 194, 193, 0, 212, 216, 217, 188, 215, 0, 211, 196, 1774, 1773, 195, 187, 184, 182, 199, 201, 202, 185, 183, 234, 0, 0, 1955, 2288, 2289, 2290, 2291, 2292, 2293, 2294, 2295, 2296, 2297, 2298, 2299, 2300, 2301, 2302, 2303, 2304, 2305, 2306, 2307, 2308, 2309, 2310, 2311, 2312, 2313, 2314, 2315, 2316, 2317, 2318, 2319, 2320, 2321, 2322, 2323, 2324, 2325, 2326, 2327, 2328, 2329, 2330, 2331, 2332, 2333, 2334, 2335, 2336, 2337, 2338, 2339, 2340, 2341, 2342, 2343, 2344, 2345, 2346, 2347, 2348, 2349, 2350, 2351, 2352, 2353, 2354, 2355, 2356, 2357, 2358, 2359, 2360, 2361, 2362, 2363, 2364, 1888, 1887, 1919, 1956, 1957, 1958, 1959, 1892, 0, 0, 308, 1273, 0, 1270, 1901, 0, 1397, 0, 1914, 0, 1282, 1393, 1392, 1423, 1424, 943, 1391, 1448, 1449, 1444, 0, 0, 0, 1463, 1461, 1440, 1434, 1439, 1437, 0, 1441, 1616, 1456, 1381, 1428, 1429, 1432, 1380, 0, 1459, 0, 1353, 1457, 1433, 1340, 0, 0, 1512, 0, 965, 967, 0, 966, 0, 969, 0, 978, 0, 0, 964, 983, 0, 972, 970, 0, 0, 0, 0, 0, 0, 775, 0, 0, 0, 0, 0, 0, 2180, 228, 1238, 0, 0, 0, 0, 910, 909, 0, 0, 930, 0, 0, 0, 1251, 436, 0, 305, 0, 0, 0, 0, 0, 0, 0, 0, 680, 677, 0, 0, 676, 0, 552, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 588, 0, 1107, 0, 621, 0, 999, 0, 998, 0, 0, 0, 1000, 995, 996, 2152, 2161, 2185, 230, 1016, 0, 1015, 1013, 953, 0, 954, 0, 0, 0, 0, 2031, 260, 273, 0, 1106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 294, 0, 297, 296, 0, 0, 0, 0, 0, 301, 0, 0, 0, 300, 0, 0, 520, 0, 0, 1107, 0, 256, 0, 0, 0, 0, 0, 0, 1029, 0, 149, 0, 145, 148, 0, 0, 0, 0, 505, 517, 0, 509, 510, 507, 511, 512, 0, 0, 0, 0, 0, 0, 504, 0, 0, 611, 610, 616, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1060, 1059, 0, 0, 0, 0, 0, 0, 719, 0, 0, 0, 0, 0, 0, 0, 624, 625, 0, 626, 0, 150, 0, 0, 0, 0, 0, 0, 0, 206, 1198, 1204, 1268, 1920, 1267, 0, 0, 0, 811, 0, 0, 0, 0, 0, 0, 0, 813, 814, 815, 816, 0, 0, 0, 0, 0, 342, 343, 124, 341, 1948, 0, 708, 683, 0, 1541, 0, 1537, 1533, 1602, 1603, 1604, 1601, 1614, 1600, 0, 1547, 1605, 1556, 1553, 696, 0, 698, 701, 0, 1217, 409, 0, 0, 545, 588, 0, 394, 156, 0, 0, 0, 0, 122, 167, 169, 392, 0, 168, 170, 172, 173, 174, 171, 175, 608, 612, 0, 541, 0, 0, 0, 0, 0, 634, 638, 637, 641, 639, 0, 635, 0, 0, 1529, 0, 144, 0, 498, 501, 0, 0, 0, 394, 478, 319, 0, 447, 0, 0, 927, 0, 0, 0, 0, 0, 0, 0, 1367, 0, 1020, 0, 1245, 2053, 308, 0, 1018, 161, 1941, 0, 752, 0, 0, 0, 0, 0, 1022, 748, 153, 0, 308, 308, 544, 0, 308, 155, 0, 0, 0, 536, 308, 772, 1323, 0, 447, 1296, 1307, 849, 858, 857, 855, 854, 850, 0, 869, 0, 446, 0, 0, 0, 883, 884, 0, 0, 882, 899, 885, 0, 887, 879, 878, 888, 889, 0, 0, 908, 0, 1350, 0, 1348, 0, 1510, 1352, 1341, 1315, 0, 1314, 1318, 1320, 1319, 1317, 0, 492, 0, 0, 866, 0, 0, 308, 1190, 0, 826, 827, 833, 0, 0, 0, 0, 0, 834, 830, 831, 832, 835, 836, 837, 0, 0, 0, 1894, 1846, 0, 1847, 0, 0, 0, 1882, 1878, 0, 0, 0, 0, 0, 0, 1851, 1854, 1855, 1856, 1853, 1857, 1852, 0, 0, 1858, 0, 0, 0, 0, 0, 1586, 1585, 0, 0, 0, 0, 0, 0, 0, 1675, 1708, 0, 0, 1810, 0, 1836, 1868, 0, 0, 1597, 0, 0, 0, 0, 0, 0, 0, 1836, 1874, 0, 0, 0, 0, 1772, 0, 1769, 0, 0, 0, 0, 1893, 0, 0, 0, 0, 1932, 1617, 1634, 1906, 0, 1895, 0, 0, 1618, 1641, 0, 1875, 1668, 0, 1673, 1656, 0, 1649, 0, 1654, 1658, 1637, 1896, 1835, 0, 1833, 0, 0, 1635, 0, 1630, 1628, 1629, 1622, 1623, 1624, 1625, 1626, 1627, 1631, 1814, 1812, 1813, 0, 0, 0, 1793, 0, 0, 1653, 2046, 2081, 0, 1413, 1413, 1413, 1401, 1411, 0, 1524, 1905, 0, 0, 0, 0, 1709, 0, 1840, 1422, 1838, 1922, 1911, 0, 0, 1613, 0, 1508, 1889, 0, 778, 779, 777, 1292, 1276, 1272, 1271, 1900, 1291, 0, 1400, 0, 941, 942, 0, 946, 0, 0, 1442, 1464, 0, 1455, 0, 1446, 1447, 1438, 1465, 1460, 1385, 1384, 0, 1527, 0, 0, 1337, 1330, 1513, 0, 1470, 1355, 1357, 1358, 0, 1893, 968, 0, 1556, 979, 0, 963, 0, 962, 1556, 0, 980, 0, 1556, 0, 0, 0, 1135, 1062, 1111, 776, 1136, 1063, 1112, 1137, 1064, 1239, 0, 1241, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 659, 2053, 308, 1249, 1138, 0, 1065, 304, 1250, 1113, 1254, 679, 678, 0, 0, 1114, 0, 553, 0, 0, 558, 559, 560, 0, 0, 0, 561, 0, 1987, 2038, 0, 566, 573, 578, 568, 0, 579, 574, 0, 0, 0, 0, 0, 0, 585, 592, 0, 0, 0, 0, 0, 0, 993, 994, 1139, 1068, 0, 1115, 952, 0, 1069, 157, 0, 251, 261, 594, 659, 1109, 280, 293, 288, 289, 287, 2053, 308, 2053, 308, 0, 0, 0, 0, 290, 285, 286, 282, 295, 1964, 2023, 2162, 0, 598, 600, 0, 605, 298, 1083, 315, 314, 313, 0, 302, 0, 320, 323, 299, 278, 281, 279, 275, 259, 0, 0, 0, 0, 0, 0, 1918, 0, 0, 1024, 0, 0, 0, 147, 1097, 137, 0, 0, 133, 0, 0, 0, 0, 127, 0, 1145, 1073, 0, 0, 253, 500, 508, 513, 1077, 516, 1125, 514, 1151, 1074, 1107, 0, 249, 0, 1075, 0, 1119, 0, 0, 0, 0, 0, 0, 0, 1147, 1099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1257, 0, 0, 0, 0, 0, 308, 0, 0, 0, 1109, 2053, 308, 1146, 0, 1104, 1133, 0, 328, 0, 1098, 0, 0, 255, 1079, 1127, 0, 0, 204, 203, 205, 0, 0, 0, 0, 0, 0, 0, 0, 818, 787, 817, 0, 0, 0, 781, 364, 337, 338, 340, 347, 0, 707, 0, 0, 1538, 1534, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1554, 697, 0, 0, 0, 0, 1237, 1237, 1237, 1237, 1237, 1237, 1237, 1218, 1247, 0, 124, 0, 0, 0, 547, 587, 594, 0, 0, 0, 393, 397, 401, 402, 403, 0, 0, 0, 0, 138, 125, 0, 737, 0, 447, 0, 169, 162, 0, 0, 0, 319, 694, 692, 691, 693, 0, 0, 0, 712, 690, 0, 1528, 1530, 0, 0, 0, 0, 492, 396, 0, 450, 0, 0, 482, 0, 0, 0, 319, 0, 0, 957, 0, 975, 958, 0, 0, 0, 1004, 1009, 1005, 985, 0, 524, 1372, 1373, 0, 308, 0, 0, 589, 308, 308, 0, 308, 0, 308, 308, 0, 1173, 615, 0, 667, 0, 0, 308, 750, 1837, 870, 449, 0, 0, 0, 0, 881, 0, 522, 886, 0, 898, 893, 895, 0, 902, 1351, 1344, 1346, 1345, 0, 0, 1342, 1843, 749, 0, 497, 0, 0, 308, 0, 903, 0, 828, 829, 0, 0, 838, 0, 0, 1418, 1844, 1845, 0, 0, 0, 0, 1879, 0, 0, 1747, 0, 1723, 1725, 1555, 1737, 0, 1568, 1748, 1749, 1727, 1729, 0, 1827, 0, 0, 1738, 1677, 1678, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1690, 1689, 1739, 1809, 0, 0, 1866, 1867, 1740, 1598, 1599, 1599, 0, 0, 1873, 0, 0, 0, 1745, 1750, 0, 0, 0, 0, 1756, 0, 1777, 0, 0, 0, 1700, 1837, 1590, 1591, 0, 0, 0, 0, 0, 0, 0, 0, 1674, 1657, 1651, 0, 1655, 1659, 0, 0, 0, 0, 1643, 1669, 1639, 0, 0, 1645, 0, 1670, 0, 0, 0, 1716, 1413, 1413, 1413, 1413, 1410, 0, 0, 0, 0, 2149, 0, 1491, 1469, 1471, 1478, 1491, 1496, 1718, 1522, 1719, 0, 1912, 0, 1451, 1422, 1422, 1422, 1715, 0, 0, 0, 1421, 180, 0, 213, 200, 0, 1274, 1915, 0, 1425, 0, 1828, 946, 944, 945, 1427, 0, 0, 1462, 1435, 1339, 0, 1337, 1332, 0, 1333, 1893, 0, 1329, 1362, 0, 0, 1527, 0, 1361, 0, 1556, 960, 961, 0, 984, 0, 1134, 1061, 1110, 1237, 913, 914, 0, 912, 0, 0, 0, 435, 929, 0, 0, 0, 659, 0, 0, 439, 0, 1252, 0, 1152, 1096, 555, 556, 0, 567, 0, 576, 575, 0, 0, 563, 0, 0, 0, 0, 562, 581, 528, 582, 584, 0, 0, 583, 586, 591, 1107, 0, 622, 1085, 0, 1131, 987, 0, 955, 0, 0, 409, 274, 0, 0, 0, 262, 272, 0, 0, 277, 0, 270, 291, 283, 292, 284, 602, 603, 601, 597, 0, 604, 606, 0, 317, 0, 0, 0, 1141, 1107, 0, 257, 1081, 0, 1129, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1142, 1116, 0, 0, 130, 129, 0, 136, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1353, 0, 1353, 0, 0, 0, 1353, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 329, 310, 0, 715, 0, 0, 0, 331, 0, 0, 0, 0, 1140, 1070, 782, 0, 0, 783, 791, 0, 0, 784, 0, 0, 793, 0, 0, 336, 344, 2105, 1817, 1818, 705, 710, 702, 704, 706, 703, 0, 709, 659, 0, 0, 0, 1539, 0, 1607, 1608, 1609, 1610, 1611, 1612, 0, 1606, 1613, 699, 700, 0, 1237, 1236, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 421, 0, 0, 415, 0, 0, 1009, 408, 411, 412, 0, 0, 548, 551, 549, 550, 580, 0, 428, 0, 0, 140, 0, 0, 141, 139, 0, 0, 319, 0, 165, 392, 0, 0, 540, 640, 643, 636, 0, 711, 713, 688, 0, 594, 0, 0, 1324, 488, 0, 478, 474, 476, 475, 477, 0, 484, 318, 0, 492, 484, 0, 930, 956, 0, 0, 0, 1002, 1006, 1003, 0, 0, 971, 0, 986, 949, 1168, 1169, 1166, 1167, 0, 0, 1364, 1021, 0, 308, 1019, 753, 0, 744, 0, 746, 1023, 308, 308, 627, 0, 537, 0, 0, 0, 880, 900, 0, 896, 0, 0, 863, 905, 1349, 1347, 490, 0, 908, 0, 864, 907, 0, 0, 0, 0, 0, 1848, 1574, 0, 1881, 1877, 0, 1720, 1849, 0, 1861, 1860, 1676, 1862, 0, 1695, 0, 0, 1687, 1685, 1686, 1679, 1680, 1681, 1682, 1683, 1684, 1688, 1871, 1870, 1864, 1865, 1594, 1592, 0, 1742, 1743, 1744, 1872, 1751, 0, 1978, 1778, 1755, 1771, 1770, 0, 0, 0, 1758, 0, 0, 1767, 0, 1811, 1580, 1613, 1619, 0, 0, 1642, 1876, 1660, 0, 0, 0, 1638, 0, 0, 0, 0, 1647, 1827, 0, 0, 0, 0, 1796, 1791, 1792, 0, 0, 0, 0, 1404, 1403, 1409, 1491, 1496, 0, 1387, 0, 1478, 0, 1490, 1476, 1489, 0, 0, 1502, 1500, 0, 1502, 0, 1502, 0, 1473, 0, 1492, 1474, 1489, 1521, 1514, 0, 1913, 1523, 0, 1453, 0, 0, 0, 0, 1841, 0, 1839, 1710, 0, 1890, 1398, 0, 1426, 1443, 1436, 2003, 1525, 1338, 0, 0, 1335, 1336, 0, 0, 1356, 1337, 1359, 981, 0, 0, 973, 0, 919, 920, 918, 921, 0, 0, 0, 659, 0, 0, 455, 0, 937, 937, 0, 0, 441, 487, 1009, 662, 0, 0, 0, 660, 308, 1066, 0, 577, 0, 0, 572, 570, 569, 571, 529, 1150, 1067, 0, 0, 0, 0, 988, 1084, 0, 406, 0, 267, 1108, 0, 0, 0, 266, 0, 308, 308, 599, 316, 321, 322, 325, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 738, 721, 0, 0, 739, 740, 0, 0, 0, 1026, 1027, 1025, 134, 131, 132, 135, 1094, 1078, 1126, 1076, 0, 1120, 1091, 1087, 0, 1051, 0, 1053, 0, 1353, 0, 1052, 0, 0, 0, 0, 0, 1149, 1103, 1124, 1148, 1101, 1122, 1100, 1121, 1102, 1123, 1095, 0, 1532, 718, 0, 0, 0, 308, 308, 629, 1080, 1128, 0, 785, 0, 0, 786, 788, 367, 0, 370, 377, 348, 353, 1256, 0, 1256, 0, 350, 354, 1256, 349, 1256, 346, 681, 0, 0, 0, 1535, 1540, 1615, 1548, 658, 0, 1228, 1227, 1226, 1230, 1229, 1232, 1231, 1223, 1222, 1235, 1234, 1221, 1220, 1225, 1224, 0, 413, 0, 419, 423, 424, 422, 414, 1009, 447, 486, 0, 0, 671, 0, 546, 394, 425, 0, 398, 143, 142, 0, 0, 0, 169, 0, 0, 645, 649, 689, 0, 1531, 623, 319, 0, 394, 492, 0, 399, 404, 405, 0, 482, 0, 478, 0, 0, 489, 1215, 493, 494, 0, 0, 959, 976, 977, 0, 0, 1009, 1008, 0, 531, 308, 590, 308, 308, 1174, 668, 0, 892, 891, 890, 523, 0, 894, 491, 308, 0, 0, 0, 0, 0, 840, 819, 839, 1880, 1736, 1746, 1859, 0, 0, 1696, 0, 0, 1741, 2257, 0, 0, 0, 0, 1775, 1776, 1757, 0, 2096, 1762, 0, 0, 0, 1933, 1666, 1664, 1661, 0, 1662, 0, 0, 1644, 1640, 0, 1646, 1671, 1782, 0, 1798, 1795, 1408, 1407, 1406, 1405, 1477, 1475, 0, 1480, 1487, 0, 1472, 0, 1501, 1497, 0, 1498, 0, 0, 1499, 0, 0, 1487, 0, 1422, 0, 0, 1787, 1713, 1714, 1711, 1422, 1930, 1613, 0, 0, 1331, 1334, 0, 1363, 1354, 974, 982, 1243, 0, 0, 0, 437, 0, 1009, 0, 0, 0, 940, 940, 0, 1009, 486, 664, 663, 666, 661, 665, 1253, 0, 564, 565, 1086, 0, 1132, 1092, 0, 595, 263, 264, 265, 268, 310, 276, 269, 0, 1082, 0, 1130, 1089, 1143, 1071, 1117, 0, 0, 727, 0, 0, 0, 0, 1144, 1072, 1118, 0, 0, 0, 0, 1054, 0, 0, 0, 0, 1262, 0, 309, 717, 716, 310, 330, 1105, 0, 789, 790, 368, 124, 0, 345, 0, 375, 0, 373, 372, 374, 0, 361, 0, 0, 0, 0, 0, 0, 1536, 0, 1040, 1040, 0, 659, 1233, 0, 0, 410, 486, 454, 0, 416, 0, 0, 0, 0, 0, 0, 0, 594, 0, 0, 0, 164, 394, 594, 644, 0, 0, 0, 714, 0, 396, 0, 1322, 395, 0, 0, 484, 0, 482, 0, 479, 0, 483, 0, 1208, 0, 0, 1007, 0, 1011, 0, 970, 947, 1524, 0, 535, 1041, 745, 747, 628, 897, 904, 308, 820, 821, 822, 823, 1691, 0, 0, 0, 0, 1752, 0, 1753, 1780, 1779, 1759, 1763, 0, 1760, 1761, 1663, 1667, 1665, 1648, 1784, 0, 1422, 1517, 0, 1520, 1479, 0, 0, 1481, 0, 0, 1483, 1485, 0, 0, 0, 0, 0, 1916, 0, 1450, 1452, 0, 1388, 0, 214, 1829, 1526, 1360, 898, 0, 308, 937, 486, 456, 2105, 457, 936, 0, 938, 943, 943, 0, 486, 659, 557, 0, 593, 0, 312, 324, 0, 0, 0, 734, 722, 0, 0, 741, 1088, 1353, 1353, 0, 1353, 0, 0, 0, 0, 0, 308, 792, 347, 0, 371, 380, 0, 378, 351, 356, 0, 360, 358, 357, 352, 355, 1040, 0, 1037, 1036, 657, 0, 445, 417, 0, 465, 0, 0, 672, 0, 0, 0, 434, 433, 430, 429, 431, 432, 427, 426, 619, 731, 319, 1215, 607, 646, 647, 642, 0, 0, 0, 478, 474, 400, 409, 383, 0, 484, 480, 481, 0, 0, 0, 1264, 0, 931, 1010, 0, 0, 0, 530, 0, 0, 534, 525, 865, 1692, 0, 1693, 0, 0, 0, 1765, 1764, 0, 1801, 1522, 0, 0, 1516, 0, 1488, 1504, 0, 1484, 1482, 1493, 0, 1495, 1710, 1786, 1788, 0, 1712, 915, 0, 916, 940, 460, 0, 939, 946, 946, 447, 659, 438, 1093, 596, 0, 271, 1090, 0, 725, 0, 736, 734, 0, 0, 1055, 1057, 1353, 1056, 1258, 0, 1259, 1260, 1263, 332, 335, 366, 376, 0, 359, 1035, 1039, 1038, 0, 0, 418, 451, 452, 453, 0, 420, 461, 462, 0, 669, 0, 674, 0, 0, 0, 0, 0, 1209, 0, 0, 1215, 482, 478, 407, 473, 381, 0, 1212, 0, 319, 0, 1009, 1012, 1172, 533, 532, 1694, 1768, 1754, 1781, 1766, 1797, 0, 0, 0, 1515, 1518, 0, 1486, 0, 1494, 0, 0, 0, 943, 0, 659, 0, 934, 933, 454, 440, 311, 0, 0, 732, 735, 723, 736, 743, 742, 1058, 0, 379, 0, 444, 0, 0, 0, 463, 0, 464, 485, 0, 673, 0, 594, 730, 0, 0, 648, 0, 1210, 484, 482, 1213, 1214, 484, 932, 948, 1171, 1170, 1400, 2219, 2003, 2191, 0, 1799, 1802, 1800, 1794, 0, 1503, 1789, 1790, 308, 946, 0, 442, 458, 465, 0, 0, 724, 1261, 649, 470, 0, 469, 0, 467, 466, 670, 675, 620, 720, 1215, 652, 384, 484, 1524, 1154, 1400, 1153, 1155, 1163, 1160, 1162, 1161, 1159, 0, 1806, 1805, 1804, 1808, 1807, 1519, 917, 935, 0, 659, 726, 733, 0, 468, 472, 471, 1211, 654, 0, 650, 653, 655, 656, 382, 922, 0, 1164, 1158, 1387, 1374, 0, 459, 443, 0, 630, 0, 1156, 1400, 1803, 0, 651, 1157, 0, 652, 0, 631 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -4013, -4013, -4013, 2962, -4013, -768, 258, 2341, -704, -4013, -4013, -4013, 2892, -4013, -4013, -4013, -4013, -4013, -4013, -4013, 2910, -4013, -4013, 1530, -2078, -4013, -4013, 135, 2894, -1098, 116, 2551, 1217, -4013, -945, -4013, -4013, -512, 120, -635, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -714, 1685, 1066, -564, -3651, -4013, -4013, -1183, -2738, -4013, 477, -4013, -4013, 1628, -4013, -4013, -4013, 919, 394, -516, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -339, -4013, -4013, -653, 137, 46, -2075, -384, -4013, -4013, 339, -386, -1097, -4013, -3075, -4013, -87, -4013, -4013, -4013, -366, -1184, 1159, -4013, -613, -970, 1457, -707, -4013, -250, -4013, -762, -647, -645, -715, -541, -3250, -3679, -3259, -2762, 1172, 157, -4013, -2726, 158, -4013, -4013, 160, 161, -4013, -4013, -1296, -1216, -4013, -739, -4013, -4013, -4013, -2534, -4013, -4013, -4013, -4013, 63, -4013, -4013, -4013, -4013, 371, -4013, -4013, -4013, -4013, -4013, -4013, -2343, 1586, 1587, -4013, -4013, -2725, -4013, -771, -4013, 523, -2561, 1088, -4013, -4013, -4013, 2295, -4013, -4013, -4013, -4013, -4013, -4013, -1365, -4013, -4013, 162, -4013, 1598, 884, -4013, -4013, -4013, -748, -816, -806, -4013, -2545, -4013, -4013, -4013, -4013, -328, -4013, -4013, -4013, -4013, -4013, -4013, -830, -4013, 947, -2697, -4013, -4013, 963, -4013, -4013, -4013, -4013, -4013, -701, -259, 2324, -4013, -587, -676, -4013, -4013, -4013, -254, -4013, -4013, -4013, -4013, -4013, -4013, -911, 95, -1346, -4013, -4013, -4013, -4013, -2026, -4013, -4013, -4013, -1669, -4013, 3747, 2141, 486, 163, -4013, -26, 60, 2785, -951, -2219, 315, -407, -4013, -1514, -4013, -4013, -4013, -2172, -4013, -4013, -4013, -4013, -3019, 169, -4013, 2791, -4013, 361, -4013, -3865, -3469, -3735, -3884, -3008, -4013, -4013, -915, -4013, -4013, -4013, -1192, 1901, -1656, -4013, -1789, 365, 1247, -807, -2358, -3282, -590, -2794, -4013, -3208, -505, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -907, -536, -4013, -4013, 3221, -4013, -3773, -4013, -4013, -4013, -4013, 1204, -4013, -4013, -1185, 1037, -4013, -4013, -4013, -4013, -4013, -685, -770, -4013, -4013, -4013, 170, -4013, -4013, -4013, -4013, 2154, -782, -623, 3096, 171, -4012, -4013, -4013, -4013, -4013, -2628, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -1651, -4013, -4013, -4013, -4013, -4013, -4013, -4013, 1979, 1982, 56, -23, -4013, -4013, -1075, -4013, -481, -4013, 2277, -4013, -4013, -4013, -4013, 1320, 172, 415, -4013, 3, -4013, -4013, 200, -2924, 4, -4013, -4013, -4013, -4013, -1813, 5, -4013, 686, -4013, -4013, -2400, -4013, 176, 22, -4013, -4013, 1, 0, -41, -37, -33, 2, 3098, 2650, -4013, -4013, -4013, -17, 1726, -4013, -723, -143, -4013, 1330, -529, 1962, 2637, 2636, -4013, 1328, -4013, -4013, 1338, -4013, -4013, -4013, -526, 1974, -4013, 2651, -4013, -4013, -4013, 1313, 1329, -2957, 765, -2943, -2901, 284, 265, -1022, -326, 49, 3133, 2652, 776, -458, -4013, -4013, -456, -3905, 726, -4013, -3739, -1963, -812, 1728, -1341, -4013, -4013, -982, 11054, -4013, -4013, -4013, 12840, 13664, -4013, -4013, 13837, 13971, -4013, -842, 822, 14211, 2502, -1005, -1614, -580, 11181, -547, -1006, -2332, -4013, -3032, -2194, -4013, -4013, -4013, -279, 833, 154, -4013, -4013, -4013, -4013, -4013, -4013, -560, -4013, -562, -4013, -4013, -4013, -551, -3181, -1484, -4013, -170, -4013, 12253, 1371, -4013, -920, -2329, -2336, -2939, -1496, -4013, -4013, -4013, -4013, -4013, -4013, -4013, -2610, -2827, -154, 1442, -4013, -4013, 1536, -4013, -4013, -4013, -1080, -710, -2249, 1451, -1718, -4013, -721, -4013, 752, 2179, -669, 7976, -1123, 11169, -439, -1958, -1054, -1288, -4013, -149, -4013, 28, -10, -179, -473, 14, 3416, 12012, -561, -1140, 6582, 8872, 9731, -2686 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 49, 50, 51, 52, 1218, 2155, 2026, 2840, 2841, 53, 54, 1294, 55, 56, 57, 58, 59, 60, 61, 1234, 62, 63, 894, 1445, 2165, 64, 1897, 697, 698, 699, 1722, 1723, 2093, 1724, 1712, 1133, 1531, 1253, 1220, 1254, 66, 67, 1127, 1703, 68, 69, 70, 1279, 1280, 1228, 1484, 3743, 4341, 2665, 2007, 2877, 2666, 2667, 71, 1343, 1344, 72, 73, 2788, 1383, 2120, 3310, 3311, 3774, 529, 2117, 4045, 4046, 3760, 3761, 4052, 4228, 4229, 2166, 1441, 2871, 3403, 2831, 3838, 2832, 3839, 2833, 3840, 2819, 3361, 3362, 3363, 2834, 3817, 4260, 2835, 1912, 4370, 2200, 1553, 1551, 4247, 3633, 3634, 4426, 4375, 4376, 4377, 4500, 3845, 2875, 3409, 3848, 4075, 2565, 613, 1465, 2945, 614, 2202, 560, 615, 2167, 79, 2194, 1314, 1315, 2034, 3315, 2928, 80, 913, 3178, 4121, 4295, 4296, 81, 208, 82, 1449, 83, 84, 2151, 2825, 85, 1929, 2582, 86, 87, 2609, 2610, 2611, 88, 89, 3198, 3997, 1281, 2654, 2655, 2656, 2657, 3219, 90, 1447, 1320, 2174, 91, 92, 93, 94, 95, 2081, 96, 97, 2168, 1457, 2186, 2187, 3829, 4091, 4269, 4093, 4539, 4540, 4067, 3157, 3647, 99, 100, 3812, 3813, 4382, 101, 1927, 102, 103, 104, 1425, 2143, 2144, 3316, 1385, 2123, 2124, 3392, 3393, 105, 2748, 106, 3694, 3695, 561, 4385, 4346, 4437, 107, 108, 3698, 3699, 109, 110, 111, 112, 113, 607, 959, 960, 1210, 114, 1819, 115, 867, 2779, 116, 1024, 2323, 3884, 117, 638, 973, 974, 2169, 119, 647, 2301, 649, 1566, 2930, 2931, 3460, 2270, 782, 120, 121, 2281, 2304, 122, 1221, 1903, 1904, 3628, 2170, 562, 1471, 2205, 2560, 4286, 3635, 3979, 4193, 2494, 3111, 124, 563, 1258, 1972, 2208, 2883, 1875, 1876, 1877, 3424, 1878, 2885, 1879, 1204, 1880, 2890, 2891, 2892, 3420, 3428, 4115, 4116, 125, 1256, 1970, 126, 127, 128, 1291, 806, 129, 575, 576, 130, 4240, 131, 925, 132, 666, 1580, 133, 134, 1984, 3205, 135, 136, 137, 4513, 4546, 4547, 4548, 3433, 4472, 138, 4515, 1003, 140, 141, 142, 178, 833, 834, 835, 2171, 4110, 144, 145, 2147, 2818, 3343, 146, 147, 1898, 2550, 148, 149, 150, 151, 1429, 152, 153, 154, 155, 1362, 156, 1162, 1163, 157, 158, 524, 715, 1166, 1174, 159, 617, 967, 968, 969, 1533, 160, 1006, 2292, 618, 962, 162, 619, 2513, 3120, 3121, 3124, 620, 2510, 165, 1572, 2286, 2289, 621, 2517, 2518, 2519, 2520, 2521, 3126, 622, 640, 916, 2213, 623, 1096, 170, 171, 172, 724, 719, 720, 174, 1696, 2456, 655, 1181, 685, 732, 3096, 1832, 1833, 1855, 1856, 1190, 1191, 1845, 1847, 2496, 1848, 2504, 1838, 3591, 3953, 1851, 1852, 1193, 1194, 1195, 1860, 175, 2459, 3077, 3078, 3079, 3568, 3569, 3583, 3579, 3940, 4164, 3080, 1001, 1201, 3081, 4155, 4156, 4311, 3586, 3088, 3118, 2862, 2863, 2864, 1881, 2130, 1410, 1097, 1411, 2141, 1098, 1616, 1413, 1099, 1100, 1101, 1416, 1102, 1103, 1104, 1105, 1599, 1658, 1106, 1107, 1635, 2138, 2139, 1522, 2363, 1109, 1110, 1111, 3083, 1112, 3526, 3908, 3897, 2389, 2390, 1719, 3522, 3023, 1692, 2446, 4176, 4322, 4323, 3064, 3552, 3925, 4154, 4414, 4477, 4478, 1113, 2443, 1688, 808, 1114, 3318, 1690, 2383, 2468, 2469, 1575, 1597, 2329, 2347, 2348, 2360, 2984, 2367, 2372, 3007, 3008, 2384, 2412, 1115, 2332, 2333, 2967, 1601, 1116, 1156, 1157, 1594, 2407, 1169, 1170, 717, 1117, 1118, 1119, 1567, 708, 4160, 519, 772, 2680, 1810, 837, 652, 1120, 1121, 1122, 1123, 934, 935, 1285, 520, 766, 786, 2658, 521, 522, 768, 1815 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule whose number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { 169, 168, 173, 163, 164, 166, 577, 723, 677, 890, 785, 530, 1196, 919, 653, 1811, 811, 1490, 1128, 1202, 169, 1550, 173, 807, 1530, 1494, 710, 825, 733, 518, 764, 993, 994, 995, 1500, 642, 567, 999, 1911, 783, 642, 1523, 2466, 1296, 2271, 1319, 2400, 2506, 722, 641, 1826, 970, 1360, 1284, 641, 1205, 941, 1348, 559, 2682, 1439, 1409, 917, 2127, 1386, 1973, 1610, 1611, 1587, 1811, 1459, 1142, 1637, 2095, 3184, 2140, 616, 1816, 1980, 2830, 606, 1989, 648, 2948, 2848, 1626, 3199, 2528, 2530, 2784, 3214, 707, 3216, 2003, 678, 2191, 3427, 876, 2046, 2328, 3604, 1313, 3370, 1829, 3320, 1326, 2486, 2745, 1427, 2934, 3539, 3339, 1432, 1353, 3388, 1481, 3125, 1436, 3565, 3636, 65, 944, 3320, 3668, 1442, 1816, 3082, 3091, 3630, 919, 964, 956, 3089, 3090, 1461, 727, 735, 74, 3582, 2055, 736, 3413, 3859, 3401, 927, 2365, 3031, 2063, 2064, 673, 2242, 1966, 3810, 3843, 3851, 1889, 704, 75, 76, 2365, 77, 78, 98, 118, 4102, 1979, 3131, 2195, 3980, 123, 139, 143, 161, 734, 696, 1653, 167, 3082, 1135, 3580, 3504, 1458, 1850, 2206, 3344, 3345, 3346, 3347, 3348, 3349, 1349, -1375, 1255, 1574, 3609, 1603, 1604, -1378, 573, 2843, 3978, -2040, 1656, 1189, -1589, 2988, 1192, -1599, 4168, 2449, 4170, -1948, 2070, -2074, 4291, -1949, -2271, 2075, 528, -1948, 2527, 1623, 1231, -1949, -2271, 3418, 1817, 2767, 4345, 3671, 1532, 3, 4, 1482, 2282, 1423, 1919, 713, -2095, 1231, -1584, 1570, -1815, 3987, 3364, 4194, 2868, 4287, 2440, -1815, 819, -1556, -1569, 4387, 1917, 2441, 1381, -1589, -1831, 3429, 2268, -1596, 624, -2122, 3084, -1831, 2188, 3185, 2576, 573, 2905, 1919, 2907, 3130, -1375, 769, 771, 573, 573, 775, -1378, 777, 1663, 1282, 2145, 573, -1923, 2405, 624, 2935, 2532, 1982, 4241, -1584, 1454, -1975, 1132, 2263, 2937, 2057, 823, 990, 1357, 3376, 624, -773, 1482, 1666, -1599, 4333, 4334, -1589, 2198, 4304, 1455, 3084, 1272, 975, 1375, -369, 3835, 3464, 4293, 683, 1232, -2043, 1316, 624, 997, 1482, 1836, 1914, 2491, 2551, 624, 4446, 3430, 1668, 4077, 2563, 2447, 1232, 573, 4434, 1663, -2094, 624, 979, -1375, 2158, 1179, 2283, 4202, 630, -1378, 4267, 1159, 624, 1160, 1317, 1360, 1717, 780, 1663, 885, 630, -124, 2858, 892, 3672, 2107, -124, 2859, 631, 3485, 807, 523, 1029, 4462, 902, 2988, 1982, 871, 4268, 1506, 631, 1654, 4222, 1666, 1983, 630, 1709, 1282, 573, 2564, 1521, 919, 624, 3505, 1668, 1718, 1713, 1637, 4435, 1920, 2552, 1725, 1725, 919, 998, 631, 2492, 1610, 1611, 1700, 630, 684, 1209, 1668, 1837, 1626, 1663, 807, 2591, 2189, 4279, 2405, 2108, 573, 922, 4319, 38, 2266, 2690, 3983, 631, 2272, 2988, 2274, 932, 3785, 2277, 1982, 1180, 4078, 1518, 1666, 630, 1020, 1818, 2053, 3377, 2159, 2058, 1318, 2102, 1358, 991, 1982, 3465, 1456, 42, 919, 2264, 3669, 4365, 2448, 631, 2106, 1501, 3431, 2533, 3673, 4294, 2534, 3674, 1668, 630, 2019, 574, 1982, 1982, 1921, 3185, 2936, 1483, 573, 2269, 794, 2965, 1534, 1710, 2265, 2938, 4537, -1375, 4305, 631, 2059, 46, 1954, -1378, 2199, 2946, 1982, 2691, 3365, 881, 1960, 1571, 3836, 1591, 47, 3623, 2325, 2458, 868, 1290, 1259, 1424, 714, 3988, 2303, 1952, 1568, 2403, 2768, 3682, 2284, 1029, 3432, 2127, 2988, 929, 1577, 4468, 2535, 1918, 3320, 2076, 4486, 2989, 2042, 2577, 2044, 3419, 2285, 1588, 48, 2051, 1603, 1604, -2094, 2099, -1815, 2692, 2125, 2098, 1483, 1623, 2442, 2071, 2990, 2032, 918, 577, 2035, 2036, 1154, 2002, -1831, 723, 1155, 2015, 1816, 2190, 919, 2094, 1399, 2259, 1657, 1483, 2613, 1233, 919, 919, 1424, 1571, 866, 1598, 4044, -1375, 1197, 971, 4424, 4104, 1161, -1378, 2406, 3914, 4072, 3150, 1711, -2272, 1632, 4545, 4447, 2693, 2246, 3640, 48, 169, 722, 173, 3937, 781, -2094, 2148, 3941, 3582, 1816, 2991, 1520, 2364, 1633, 1707, 3000, 2060, -1375, 874, -1375, -2094, 2103, 877, -1378, -1589, -1378, 2387, 1634, 972, -2040, 977, -1948, 981, 3824, 2267, -1949, -2271, 1004, 985, 900, 4118, -2074, 641, 2278, 641, 963, 641, 3889, 2024, 3931, 988, 2027, 641, 986, 987, 1969, 1861, 966, 1021, 1862, -1584, 3833, 2324, 2217, 2327, 1125, -2095, 4481, 1134, 918, 1136, 1609, 1615, 807, 2335, 3850, 735, 3327, 2339, 1364, 736, -1596, 3966, 568, 1492, 1598, 2351, 2352, 2694, 1659, 1370, -2122, 1687, 1000, 1632, 636, 1283, 1698, 2473, 2369, 2371, 4463, 3784, 2990, 1154, 4329, -1923, 3459, 1155, 2131, 2385, 636, 637, 734, 1633, 169, 168, 173, 163, 164, 166, 3106, 2054, -1975, 2705, 998, 3051, 3133, 1636, 3134, 3082, -1589, 3082, 3297, 636, 637, 3300, 3301, 2677, 1811, 3304, 636, 637, 2495, 1990, 2022, 3307, 3598, 1000, 882, 1472, 1217, 2331, -2043, 2614, 1222, 4186, 2198, 3384, 1164, 3256, 3661, 2991, 4196, 636, 637, 3621, 3775, 2355, 2356, 1684, 1685, 1686, 1687, 4509, 930, 2132, 1200, -124, -124, 998, 2992, 2993, 2994, 3684, 2995, 2996, 2997, 2998, 2999, 3000, 2695, 3127, 1492, 2466, 2466, 2466, 1368, 1029, 2696, 2589, 2988, 2697, 1144, 636, 1283, 3302, 3303, 3082, 641, 2118, 2119, 1131, 2511, 1337, 2730, 1139, 2678, 3532, 1237, 1338, 2731, 3236, 3691, 3180, 2542, 1682, 1683, 1684, 1685, 1686, 1687, 4277, 3200, 2133, 65, 33, 2134, 2131, 3405, 2401, 737, 573, 2201, 2997, 2998, 2999, 3000, 1923, 3099, 1332, 2668, 74, 4496, 1482, 2786, 2988, 1223, 1924, 1966, 3696, 1347, 3612, 525, 2671, 1450, 2365, 2365, 3084, 2629, 3084, 2365, 75, 76, 829, 77, 78, 98, 118, 1288, 1289, 1219, 2275, 2276, 123, 139, 143, 161, 1333, 3862, 4157, 167, 797, 798, 799, 2163, 800, 801, 802, 803, 804, 805, 4470, 1451, 2756, 2132, 2216, 2182, 4522, 573, 1338, 2365, 2365, 910, 2988, 2222, 1339, 2732, 738, 2226, 2721, 3692, 1322, 4105, 3237, 2232, 2233, 654, 2135, 2340, 1654, 573, 569, 3636, 1219, 4106, 918, 2995, 2996, 2997, 2998, 2999, 3000, 2245, 4136, 573, 3084, 4088, 918, 38, 573, 1380, 2231, 2661, 970, -1920, 1029, 1905, 3697, 2988, 169, 829, 173, 2133, 830, 1474, 2134, 1272, 2046, 2164, 4161, 2604, 1437, 1438, 660, 4165, 3533, 730, 4167, 42, 4158, 1573, 570, 2990, 2183, 1536, 641, 1538, 730, 1540, 3317, 1542, 1469, 1544, 1545, 1546, 4401, 4254, 2820, 1925, 1548, 1224, 918, 2662, 2884, 831, 1339, 2223, 3317, 4395, 1145, 3693, 4391, 571, 3201, 572, 2722, 46, 2234, 1991, 1596, 2822, 1496, 1498, 2341, 3329, 2002, 2136, 1907, 38, 2241, 1992, 1926, 2251, 1225, 4523, 4497, 2218, 2990, 3202, 1613, 1334, 2991, 723, 2605, 4255, 1908, 2137, 3181, 2672, 1369, 830, 4256, 2590, 3427, 832, 1452, 2135, 2422, 42, 1340, 2733, 2787, 1226, 1029, 4471, 48, 2988, 3238, 3636, 1640, 911, 3350, 661, 1146, 3973, 1655, 829, 2049, 4257, 2358, 1839, 1993, 3330, 1651, 4095, 1660, 2663, 3425, 1016, 4107, 2342, 831, 1341, 2734, 3998, -2272, 46, 1905, 1699, 4098, 3239, 976, 978, 980, 4498, 1483, 982, 983, 984, 47, 807, 739, 2037, 1906, 3353, 918, 989, 1840, 1715, 1716, 1227, 1342, 2735, 918, 918, 912, 1913, 4499, 1335, 3240, 4464, 1822, 1830, 1831, 2925, 1835, 736, 736, 1154, 736, 2990, 832, 1155, 1453, 2778, 2512, 2805, 4366, 2343, 4535, 4258, 2344, 4327, 1914, 2082, 2136, 641, 2630, 662, 1701, 3094, 641, 641, 682, 2184, 4218, 830, 3132, 1907, 734, 734, 3592, 734, 2535, 1909, 4371, 2135, 2185, 2505, 705, 3248, 4469, 2823, 2423, 4299, 3883, 1908, 2424, 1141, 4393, 1508, 2109, 4508, 716, 2608, 3173, 4510, 4316, 1662, 2991, 2297, 1663, 4282, 3965, 2723, -1556, 2604, 831, 1359, 4197, 4283, 1842, 2992, 2993, 2994, 3727, 2995, 2996, 2997, 2998, 2999, 3000, 1702, 725, 2739, 2425, 1666, 3082, 1509, 2110, 2664, 3082, 1667, 3174, 3021, 1200, 663, 542, 4544, 2038, 3028, 2039, 2345, 2481, 3598, 726, 3950, 4070, 2990, 3957, 2628, 573, 3357, 2162, 4343, 641, 1668, 832, 4348, 4349, 2824, 3754, 1843, 641, 728, 4157, 4219, 3757, 3758, 2082, 1910, 2995, 2996, 2997, 2998, 2999, 3000, 3643, -1556, 2605, 4520, 1492, 3877, 2706, 4367, 1947, 1915, 4536, 4372, 3358, 740, 2709, 3806, 2711, 2902, 544, 2050, 4203, 4245, 987, 2724, 2224, 2903, 3359, 2796, 2704, 2488, 2991, 3320, 2606, 2698, 1293, 2908, 4428, 4429, 1909, 4259, 807, 641, 2215, 2604, 641, 641, 729, 2082, 1185, 2716, 573, 2221, 2995, 2996, 2997, 2998, 2999, 3000, 2853, 2854, 2855, 2856, 4081, 2789, 2346, 2607, 2364, 2364, 2426, 4262, 2861, 2364, 3788, 573, 3644, 4266, 4373, 1997, 774, 3636, 3624, 4559, 2762, 2052, 2121, 1670, 2740, 4284, 3084, 3332, 3728, 2698, 3084, 2992, 2993, 2994, 776, 2995, 2996, 2997, 2998, 2999, 3000, 4082, 1510, 2111, 1671, 1672, 3360, 3175, 641, 2364, 2364, 730, 2595, 2741, 2605, 1187, 3102, 2898, 783, 2963, 3618, 3455, 2736, 1219, 1185, 526, 1219, 3645, 792, 3646, 664, 665, 1910, 4330, -587, 1475, 2065, 2066, 2067, 2068, 3145, 3195, 3832, 4336, 3317, 2172, 3790, 2466, 2020, 3807, 1675, 2608, -1556, 2726, 551, 2737, 552, 1295, 3719, 4025, 3721, -146, 793, 1676, 3725, 2547, 807, 1535, 3015, 3792, 1537, 3891, 1539, 3892, 1541, 3475, 1543, 2104, 2105, 1440, 1547, 2135, 2037, 2114, 2738, 1476, -146, 4528, 2942, 817, 1511, 2112, 3865, 1187, 3866, 3176, 1961, 3643, 2046, 3040, -2272, -2272, 3265, 2995, 2996, 2997, 2998, 2999, 3000, 176, 2021, 2626, 2617, 1029, 2365, 1299, 2988, 2365, 2365, 2365, 2365, 2365, 2365, 2365, 2365, 2365, 2365, 2142, 731, 1986, 1188, 4243, 2939, 3916, 169, 4386, 173, 1653, 3257, 4368, 1492, 728, 1899, 2927, 3625, 821, 542, 2365, 1300, 2727, 1302, 177, 1900, -1422, 2177, 2178, 2179, 2180, -1422, 3449, 1217, 1137, 2805, 679, 1995, 2608, 2253, 1901, 2254, 2300, 2255, 3644, 2256, 3626, 2257, 1477, 2365, 2365, 2258, 4026, 1987, 1962, 1705, 828, 1145, 169, 2296, 173, 2293, 2294, 2295, 966, 3627, 2688, 1424, 4292, 1303, 2618, 3266, 2879, 729, 2940, 3893, 3156, 544, 2690, 3804, 903, 2236, 2038, 3082, 2039, 3488, 2349, 3489, 3082, 3427, 2240, 870, -1556, 3082, 2836, -1422, 3082, 2247, 1478, 3645, 4029, 3646, 2287, -1556, 2559, 1609, -1556, 1209, 542, -1556, 904, 1682, 1683, 1684, 1685, 1686, 1687, 2337, 2338, 1185, 176, 1146, 4339, 1214, 1186, 2350, 3082, 2299, 2280, 2353, 2354, 919, -1422, 1492, 4337, 3573, 1016, 2322, 2901, 905, 730, 4128, 3805, 4467, 2375, 176, 2376, 4215, 1304, 2145, 2691, 2088, 2411, -392, 2910, 2911, 1215, 873, 2913, -930, 33, 3984, 177, 3574, 2917, 919, 544, 2398, 1492, 2399, 3172, 2990, 3406, -496, 1902, 3410, 3991, 3992, 3943, 1479, 2894, 1492, 2160, 906, 2089, 1216, 2474, 177, 1187, 2539, 3576, 1346, 3458, 875, 2543, 33, 1305, 2546, 1306, 1029, 2692, 2192, 2988, 1154, 2043, 3782, 3490, 1155, 2045, 903, 2642, 4042, 4043, 4504, 2916, 551, 3491, 552, 1725, 2569, 1347, 3084, 2950, 4080, 3985, 1188, 3084, 3095, 1492, 4087, 2991, 3084, 3459, 4182, 3084, 4184, 2004, 1308, 535, 904, 1440, 2004, 4405, 4097, 2413, 2408, 2414, 2837, -1421, 4412, 4063, 807, 2693, -1421, 3165, 1663, -392, 731, 3164, 1217, 2619, 2643, 3082, 2583, 3084, 878, 4057, 3224, 3386, 2415, 783, 4058, 610, 4431, 891, 4413, 1310, 2625, 4064, 4217, 1666, 2391, 3225, 3454, 2394, 2005, -1387, 2006, 2886, 3578, 2005, 14, 2006, 2056, 1217, 2742, 2986, 2987, -1387, 2087, 1206, 3002, 2659, -1387, 551, 1029, 552, 1238, 2988, 2644, 1668, 1312, 906, 2563, 4059, 3658, 3082, -1421, 542, 2488, 1327, 2002, 3186, 19, 2743, 3917, 2002, 898, 2689, 557, 2004, 3097, 2700, 1207, 2497, 1839, 2004, -924, 883, 1239, 884, 3037, 3038, 3204, 2694, -1387, 169, 2514, 641, 3641, 2712, 2365, -495, 3241, -1421, 3243, 2553, 1328, 2556, 1164, 2645, 907, 1208, 4488, 2728, 2416, 3518, -1387, 3153, 3389, 2417, 909, 1840, 3057, 1982, 2418, 544, 2752, 3398, 2005, 3189, 2006, 1988, 2838, 2990, 2005, 2759, 2006, 3, 4, 1329, 1632, 4028, 2615, 1330, 1240, 919, 924, 3910, 1211, 3084, 2992, 2993, 2994, -1387, 2995, 2996, 2997, 2998, 2999, 3000, 1633, -1387, 2466, 2090, 2002, 3284, 2849, 2466, 1331, 630, 2002, 2839, 2466, 1841, 1634, 2091, 1241, 1515, 1883, 2004, 1632, 1212, 2325, 2010, 1136, 886, 3729, 887, 624, 631, 3298, 936, 2991, 3229, 610, 1525, 2695, 1516, 1526, 2092, 1633, 1621, 1622, 3084, 2696, 2887, 3730, 2697, 3082, 937, 1213, 1884, 1242, 14, 2364, 1842, 4553, 2364, 2364, 2364, 2364, 2364, 2364, 2364, 2364, 2364, 2364, 3467, 2005, 2612, 2006, 30, 3745, 3662, 3159, 928, 3572, 3506, 3507, 2990, 1885, 908, 1243, 2419, 951, 19, 4223, 3516, 942, 3670, 3675, 919, 3746, 2420, 1595, 1632, 48, 38, 2585, 2586, 2587, 3572, 957, 551, 2002, 552, 1843, 2597, 961, 2599, 3471, 2601, 2602, 3685, 554, 1633, 2364, 2364, -1387, 2365, 2365, 2325, 3233, 1820, 3366, 556, 1821, 42, 1440, 1636, 3340, 2630, 1154, 641, -1923, 2859, 1155, 1663, 2991, 3082, 3163, 641, 1609, 641, 1209, 3573, 3207, 33, 3209, 3142, 3143, 1246, 2502, 2503, 2668, 3234, 3683, 1247, 3437, 624, 1823, 2960, 1666, 1824, 1248, 46, 2249, 992, 2780, 3512, 3573, 2932, 1968, 3574, 3350, 2211, 2780, 2212, 47, 1154, 3351, 1250, 1175, 1155, 3235, 4054, 3084, 4056, 3575, 1251, 3352, 4060, 1668, 4061, 2932, 1002, 2961, 4263, 3574, 996, 3576, 2962, 2810, 2992, 2993, 2994, 2707, 2995, 2996, 2997, 2998, 2999, 3000, 3575, 48, 3470, 1007, 3353, 2679, 3354, 1609, 2805, 1890, 3577, 3137, 3576, 27, 3480, 2951, 1609, 209, 1890, 1005, 639, 2954, 527, 2804, 2852, 639, 1013, 3762, 1252, 4162, 608, 30, 2889, 3426, 3486, 3577, 3109, 3110, 2811, 3283, 3638, 3639, 2004, 3620, 3909, 3290, 2248, 680, 1609, 2249, 1890, 2260, 2880, 2772, 2261, 169, 2869, 38, 918, 3508, 4114, 2781, 4485, 2873, 3084, 2874, 2782, 2850, 4129, 4130, 4131, 4132, 1581, 1582, 3472, 3317, 3841, 3331, 3333, 3334, 3355, 3251, 3014, 2884, 3016, 3017, 3578, 42, -1445, -1445, 3382, 2005, 918, 2006, 38, 1574, 2992, 2993, 2994, 1008, 2995, 2996, 2997, 2998, 2999, 3000, 1671, 1672, 3065, 2262, 3066, 3578, 2261, 2886, 3067, 807, 3068, 2812, 2813, 919, 2290, 919, 1015, 2291, 42, 46, 4557, 2002, 4558, 611, 2487, 2814, 1238, 2488, 1016, 4511, 27, 3356, 47, 1014, 2623, 2684, 3357, 2624, 2685, 1017, 3042, 2791, 3043, 1018, 2792, 2870, 1675, 2806, 1019, 2919, 2807, 3255, 2261, 641, 4163, 1022, 46, 2959, 1239, 1025, 2249, 3085, 3367, 2969, 3369, 3044, 2249, 1360, 612, 47, 1143, 1023, 2815, 3358, 2904, 3107, 2906, 4288, 919, 1147, 3870, 3871, 3872, 3777, 1140, 3778, 3436, 3359, 2004, 2973, 3439, 3440, 2249, 3442, 1149, 3444, 3445, 4178, 2977, 2364, 2978, 2249, 1148, 2249, 3450, 48, -1165, 3763, -1165, 3138, 1153, 38, 3085, 3004, 1240, 3375, 2249, 3378, 3593, 3594, 3595, 723, 3020, 3025, 1165, 2249, 3026, 3422, 3588, 3217, 3222, 3416, 3218, 3223, 3417, 1172, 3468, 2005, 1175, 2006, -1375, 42, 1238, 3258, 3476, 1173, 1241, 2249, 3764, 1175, 1176, 3161, 4350, 4351, 3513, 4353, 1183, 3514, 2365, 2816, 3523, 2817, 1651, 3524, 1198, 3535, 3045, 2365, 2249, 3360, 2958, 3046, 3765, 2002, 1239, 2887, 2411, 1199, 3610, 46, 2004, 3611, 1242, 3614, 2365, 2365, 3615, 3766, 3070, 3071, 3072, 3767, 47, 3619, 3487, 3060, 2534, 3492, 3493, 3494, 3495, 3496, 3497, 3498, 3499, 3500, 3501, 1182, 1203, 1184, 3076, 3768, 1243, 3642, 3769, 3834, 2261, 918, 2261, 3915, 1235, 3294, 2291, 723, 38, 3466, 3770, 1209, 4512, 2005, 1240, 2006, 1257, 1261, 1682, 1683, 1684, 1685, 1686, 1687, 1230, 169, 2296, 173, 2293, 2294, 2295, 3968, 3226, 3975, 2534, 3663, 3976, 3098, 42, 641, 3541, 3542, 2004, 3244, 1816, 3076, 1241, 1238, 722, 2002, 1292, 3981, 2306, 1662, 2261, 3982, 1663, 3750, 2261, 1290, 3686, 33, 2364, 2364, 4047, 2888, 4099, 4048, 2325, 4100, 1293, 1247, 2004, 1664, 3047, 4441, 46, 4138, 1248, 1239, 4139, 1666, 1242, 1298, 3048, 4238, 1968, 1667, 3771, 47, 3942, 2005, 3945, 2006, 1301, 1250, 3772, 2004, 4140, 2307, 1323, 2249, 4148, 1251, 3822, 2291, 4200, 918, 1336, 4201, 4264, 1668, 1243, 2261, 1345, 4289, 4300, 4308, 4290, 2291, 4309, 2005, 3295, 2006, 1350, 48, 1355, 2002, 2308, 1356, 3898, 3773, 3860, 4313, 4318, 1240, 2488, 3396, 4320, 4030, 4031, 3396, 4033, 1361, 4362, 1363, 2005, 4363, 2006, 2309, 4394, 4399, 1365, 1704, 4400, 1252, 3107, 2002, 1367, 2889, 2310, 4406, 4407, 4408, 2291, 3026, 2249, 1241, 4418, 4420, 4114, 2488, 3396, 4433, 3107, 4439, 2291, 33, 2291, 1967, 2311, 1246, 2002, 3220, 1371, 2312, 2365, 1247, 4440, 4454, 4482, 2291, 4455, 2488, 1248, 4526, 4555, 1372, 3396, 4556, 1377, 4566, 1968, 1242, 4556, 1379, 1382, 1384, 1387, 1217, 1428, 1250, 1431, 1669, 1433, 1424, 1443, 1670, 1444, 1251, 3249, 3168, -166, 3169, 3170, 3171, 1448, 1446, 1460, 1462, 1930, 2313, 1468, 1243, 1470, 194, 1480, 1485, 1671, 1672, 1487, 1486, 1488, 1489, 1491, 1499, 1492, 1502, 1503, 1504, 1505, 1507, 2314, 3873, 1512, 1673, 1514, 1513, 1519, 1524, 1549, 1244, 1574, 1931, 1576, 1579, 1583, 1585, 1592, 1586, 1593, 1252, 2082, -1560, 3286, -1567, 1932, 1602, 1605, 1606, 1607, 1674, 1608, 1612, 1675, 48, 3457, 1614, 1617, 1933, -1557, -1558, 1618, 1619, 1245, -1561, 2780, 1676, 33, 2780, 2780, 1620, 1246, 2780, 1625, 1627, 3469, 1628, 1247, 2780, 1629, 1630, 194, 783, -1559, 1248, 3319, 1631, 1695, 1638, 1691, 1639, 1641, 1249, 3718, 1642, 3720, 1934, 1693, 1643, 3724, 1697, 1250, 1644, 3319, 1645, 1646, 1647, 1935, 2315, 1251, 1648, 3803, 1704, 1708, 2316, 1720, 1728, 918, 1828, 918, 2317, -2181, 4051, 641, 1186, 1867, 1857, 1936, 1188, 1859, 3326, 3328, 1937, 1886, 1888, 3335, 1887, 1890, 1891, 1892, 1894, 641, 1893, 3990, 1678, 1895, 1922, 1916, 1928, 2318, 1949, 2319, 1953, 1955, 1957, 3394, 1956, 1958, 4085, 1959, 1974, 1252, 1975, 1985, 1995, 1996, 1998, 1999, 2320, 4003, 2000, 2001, 3379, 2002, 2008, 2009, 2011, 2012, 2016, 3864, 2023, 3421, 918, 169, 3412, 2017, 4016, 3867, 3868, 2364, 2025, 2029, 2030, 2321, 2033, 2040, 2041, 2047, 4141, 1938, 2048, 1272, 169, 3435, -2181, 2061, 2062, 2072, 3820, 3821, 2073, 2074, 2077, 3762, 2083, 2364, 2364, 2086, 2100, 2101, 2113, 3841, 2116, 3549, 2078, 2115, 2126, 1609, 1615, 3085, 1939, 3085, 1205, 1598, 2128, 2129, 2146, 1679, 1680, 1681, 4038, 1682, 1683, 1684, 1685, 1686, 1687, 2149, 2150, 2153, 2157, -2181, 2154, 537, 2161, 1318, 2181, 2176, 2196, 194, 2197, 2204, 2209, -2181, 2210, 2207, 2886, 2214, -2181, 2225, 2227, 2229, 2243, -2181, 2228, 2230, 2244, 2302, -2181, 2273, 2279, -2181, 2373, -2181, 2288, 1238, 2374, 2330, 641, 2336, 3911, 3912, 1940, 2331, 2386, 2392, 1663, 2396, 1941, 2397, 2404, 1942, 2410, 2427, 2429, 2444, 2445, 3085, 3659, 3446, -2181, 2458, 3447, 2475, 2479, 2472, 729, 1239, 2480, 2498, 2499, 2509, 2500, 723, 2476, 2524, 2523, 1943, 4053, 2549, 3530, 2489, -2181, 1944, 2536, 2537, 4173, 2538, 2554, 723, 2490, 4312, 2526, 2501, 2557, 2559, 1945, 2568, 2561, 2573, 2562, 4312, 2578, 3554, 3555, 3556, 3557, 3473, 2579, 3107, 2581, 2588, 2584, 2600, 1651, 2592, 2603, 2616, 2621, -2181, 1137, 1946, 3960, 1240, 1141, 2675, 2683, -2181, 3561, 2670, 3564, 2699, 2725, 2687, 2686, 2744, 2747, 1574, 2769, 3989, 2765, 2770, 2766, 4233, 4235, 2758, 2771, 2773, 3731, 2774, 2775, 3734, 2776, 4358, 2777, 1241, 2783, 2785, 2790, 2794, 4227, 2799, 2800, 2808, 2797, 2798, 2801, 2803, 4004, 4005, 2802, 2828, 2842, 2844, 2857, -2181, 2865, 2851, 2860, 2867, 2866, 2878, 2881, 2364, 2887, 2876, 2893, 2895, 2896, 2897, 2899, 1242, 2900, 2909, 2912, 2914, 2915, 2488, 2921, 1520, 2924, 2922, 2923, 2933, 2926, 2303, 2944, 2941, 2947, 2949, 998, 2953, 2952, 2955, 2957, 2971, 2956, 2975, 3022, 3041, 654, 1243, 3063, 2972, 3056, 2974, 3093, -970, 3119, 3114, 2976, 3010, 2979, 3123, 3135, 2980, 2982, 2985, 3003, 4039, 4040, 3087, 3117, 3141, -2181, 3144, 3146, 4419, 3009, 3011, 2249, 4073, 3147, 3036, 3155, 3158, 919, 3193, 3160, 3825, 3194, 3012, 3019, 3034, 3035, 3049, 3059, 3061, -2181, 3319, -2181, -2181, 3062, 3182, 4302, 3183, 3092, 3129, 3151, 3152, 3196, 3206, 4172, 3167, 3208, 3197, 33, 3221, 3246, 4177, 1246, 3247, 3707, 3252, 3253, 3708, 1247, 3709, 4181, 3254, 3259, 3260, 3250, 1248, 4027, -2181, 3261, 641, -2181, -2181, -2181, 1968, 3263, 3267, 3269, 3706, 3270, 4364, 3271, 3272, 1250, 3274, 3277, 3654, 3655, 3656, 3657, 3279, 1251, 641, 3273, 3275, 4224, 3276, 3278, 2932, 3280, 3282, 3285, 3289, 3287, 2070, 3291, 3293, 2780, 3299, 4344, 3305, 3281, 3306, 2780, 2780, 3321, 2121, 4122, 4347, 4123, 4124, 3309, 3324, 2135, 4354, 3336, 4356, 3325, 3380, 3341, 3337, 4127, 3342, 3373, 3374, 3383, 3387, 3385, 3395, 3404, 3396, 1574, 3407, 1252, 3402, 3408, 3411, 2889, 3434, 3441, 3443, 3787, 3789, 3791, 3793, 3451, 3461, 3452, 3453, 986, 987, 4133, 3414, 3462, 3463, 3474, 1662, 3456, 3479, 1663, 3776, 3006, 2988, 1595, 1656, 3525, 3005, 3284, 3537, 730, 3509, 3550, 3585, 3590, 3563, 4543, 3510, 4149, 4150, 3786, 3511, 3517, 3546, 1420, 1666, 3538, 3606, 3571, -2183, 3587, 1667, 3599, 3622, 3600, 4411, 3629, 3650, 3652, 3653, 3602, 3603, 1574, 3664, 3687, 3676, 1574, 1574, 3665, 3688, 3690, 3689, 3702, 3852, 3700, 1668, 3701, 3722, 3726, 3742, 169, 3849, 3744, 3671, 3808, 4543, 3747, 4227, 3667, 3755, 3703, 3085, 3704, 4543, 3756, 3085, 3705, 3753, 3800, 3779, 4307, 3780, 807, 4278, 3781, 3816, 3426, 650, 651, 3818, 4189, 3811, 657, 2261, 3831, 3801, 3823, 668, 674, 650, 3828, 681, 3844, 3827, 674, 674, 3846, 709, 3847, 712, 3857, 3861, -2183, 3885, 3869, 3830, 3858, 3874, 3863, 3876, 3878, 3890, 3879, 3880, 3881, 3882, 3899, 3900, 4207, 3901, 3902, 3887, 3938, 641, 3939, 3946, 3894, 3951, 919, 3895, 3903, 3907, 3923, 3933, 3952, 3934, 3936, 3949, 3961, 3954, 3955, 3964, 3956, 3967, 3970, 3972, 1420, 1669, 4011, -2183, 3977, 1670, 3978, 3986, 3999, 4006, 4000, 4017, 4034, 4020, 4021, -2183, 4024, 4041, 4062, 4065, -2183, 4066, 4074, 4079, 4084, -2183, 1671, 1672, 4086, 4090, -2183, 4101, 4092, -2183, 4109, -2183, 4103, 4111, 4112, 4120, 4134, 4126, 4135, 1673, 4137, 4142, 4144, 4159, 4145, 4146, 4147, 4153, 4166, 4169, 4175, 4179, 4183, 4297, 4195, 4199, 4198, 4209, -2183, 4210, 3076, 4220, 4221, 4204, 3076, 4531, 4225, 4239, 1675, 4232, 4246, 3807, 4248, 4251, 4271, 4272, 4298, 4249, 3958, 3959, -2183, 1676, 4252, 4303, 765, 770, 770, 773, 4270, 770, 4276, 779, 3971, 765, 4253, 709, 4274, 4306, 809, 169, 3962, 4280, 4310, 709, 4315, 4281, 709, 4321, 4325, 4328, 770, 4340, 709, 4331, 4369, 4379, 4374, -2183, 4381, 4383, 4384, 4389, 4396, 4397, 4378, -2183, 3969, 4398, 4403, 4404, 4422, 1714, 4409, 4410, 4423, 1662, 4425, 4436, 1663, 4345, 641, 4442, 4417, 4444, 4445, 4448, 4450, 4359, 4453, 4421, 4458, 4076, 4459, 4465, 4466, 1664, 4480, 4489, 3551, 1678, 4487, 4495, 4492, 1666, 4446, 4502, 4503, 4447, 4507, 1667, 4521, 4534, 4551, -2183, 4554, 4560, 4001, 1177, 2084, 4564, 2846, 3100, 1662, 2674, 1260, 1663, 1727, 3203, 2932, 3681, 641, 3759, 1297, 1668, 1420, 2757, 3308, 4360, 4226, 4443, 1321, 4273, 3819, 4275, 4071, 4261, 3149, 2920, 4014, 4015, 1666, 4430, 4490, 4018, 4019, 4187, 1667, 4530, 654, 4451, 4449, 4501, 4392, 3154, 4036, 4037, 3815, 2826, 2827, 3215, 3679, 2173, 3391, 2809, 2780, 2780, 4533, 4565, 4250, 4561, 1668, 918, -2183, 3338, 3322, 4055, 4505, 4208, 1420, 4438, 2156, 4493, 1679, 1680, 1681, 4211, 1682, 1683, 1684, 1685, 1686, 1687, 656, 3875, 4326, 3853, -2183, 2529, -2183, -2183, 3136, 3854, 1569, 3085, 4402, 3288, 4514, 4562, 3085, 641, 2932, 1420, 2932, 3085, 4427, 920, 3085, 4068, 1578, 2483, 1150, 919, 2252, 2484, 1662, 1669, 807, 1663, 3104, 1670, 3963, 641, 3616, -2183, 3837, 1171, -2183, -2183, -2183, 3105, 4094, 1825, 4032, 2508, 1664, 1853, 3085, 1854, 3115, 3128, 1671, 1672, 1666, 3113, 2507, 3107, 4035, 3116, 1667, 3566, 4317, 3944, 1158, 1858, 807, 3932, 4113, 1673, 3562, 1863, 4416, 4415, 1669, 3617, 2795, 3529, 1670, 4301, 3519, 4484, 4483, 4479, 1668, 3108, 4206, 3054, 1420, 2966, 3885, 3885, 3885, 3885, 3052, 1674, 3613, 2460, 1675, 1671, 1672, 0, 0, 0, 0, 0, 0, 1420, 0, 0, 0, 1676, 0, 0, 1677, 0, 1673, -2196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1420, 0, 0, 0, 0, 0, 0, 0, 783, 0, 0, 0, 0, 0, 0, 4527, 0, 0, 1675, 0, 0, 0, 0, 0, 4096, 1420, 0, 0, 0, 0, 0, 1676, 3076, 0, 838, 0, 0, 3076, 0, 709, 3076, 765, 0, 0, 770, 0, 773, 0, 770, 0, 0, 0, 0, 0, 0, 809, 0, 3085, 895, 1669, 0, 0, 1678, 1670, 0, 770, 0, 0, 0, 0, 0, 0, 0, -2196, 0, 0, 0, 4180, 0, 0, 0, 0, 1420, 0, 1671, 1672, 0, 0, 765, 0, 3319, 0, 0, 773, 0, 0, 0, 0, 765, 0, 0, 1673, 809, 0, 0, 0, 0, 0, 0, 1678, 0, 3085, 0, 0, 0, 0, 0, 770, 0, 0, -2196, 0, 0, 0, 0, 2780, 0, 1674, 641, 0, 1675, 0, -2196, 0, 918, 0, 0, -2196, 4230, 0, 4231, 0, -2196, 1676, 4236, 4237, 1677, -2196, 0, 0, -2196, 0, -2196, 0, 0, 1679, 1680, 1681, 0, 1682, 1683, 1684, 1685, 1686, 1687, 709, 0, 4190, 4192, 4192, 0, 0, 2981, 0, 0, 0, 709, 1012, 0, -2196, 169, 4265, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1124, 4380, 709, 674, 0, 0, -2196, 674, -2272, -2272, 0, 1682, 1683, 1684, 1685, 1686, 1687, 0, 0, 0, 0, 709, 0, 0, 0, 709, 1678, 0, 0, 0, 0, 1124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 709, -2196, 0, 0, 0, 0, 0, 0, 0, -2196, 0, 0, 709, 0, 0, 0, 1662, 3085, 807, 1663, 0, 0, 1420, 3076, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1664, 0, 0, 0, 0, 0, 0, 0, 1666, 0, 0, 0, 0, 0, 1667, 0, 0, 0, 709, 0, 0, -2196, 0, 0, 0, 0, 0, 4285, 0, 0, 709, 0, 770, 770, 0, 0, 4361, 0, 1668, 0, 0, 1679, 1680, 1681, 0, 1682, 1683, 1684, 1685, 1686, 1687, 0, 0, 2477, 674, 0, 0, 0, 0, 2478, 0, 4461, 0, 0, 0, 2932, 654, 0, 0, 0, 0, 0, 3085, 0, 0, 0, 765, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 765, 0, 0, -2196, 809, 0, 169, 4390, 0, 0, 0, 0, 0, 0, 0, 0, 0, 770, 4491, 0, 4332, 0, 0, 0, 0, 0, 0, -2196, 0, -2196, -2196, 0, 709, 0, 0, 0, 0, 0, 770, 770, 0, 0, 0, 0, 0, 0, 0, 4355, 0, 4357, 0, 0, 0, 1669, 709, 709, 709, 1670, 770, 0, 765, 0, 0, 0, -2196, 0, 0, -2196, -2196, -2196, 0, 0, 0, 0, 0, 0, 0, 0, 1671, 1672, 0, 0, 0, 0, 0, 0, 770, 918, 770, 770, 0, 0, 0, 0, 0, 1673, 0, 0, 1662, 0, 0, 1663, 0, 0, 0, 0, 0, 0, 1420, 0, 0, 1124, 1420, 1420, 0, 0, 0, 0, 0, 0, 0, 1674, 0, 0, 1675, 0, 1666, 0, 0, 0, 0, 0, 1667, 0, 0, 0, 0, 1676, 0, 0, 1677, 1552, 1552, 0, 0, 4563, 709, 0, 650, 0, 0, 0, 0, 0, 0, 0, 1668, 0, 4192, 0, 0, 0, 0, 0, 0, 0, 1584, 0, 0, 709, 1662, 0, 1590, 1663, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1124, 0, 0, 0, 0, 1664, 0, 0, 169, 4506, 0, 0, 0, 1666, 0, 0, 0, 0, 0, 1667, 4550, 169, 4519, 173, 4516, 4517, 4518, 0, 4457, 1124, 1678, 0, 1420, 3039, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1668, 0, 0, 4542, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1124, 1124, 0, 1124, 4549, 4519, 173, 4516, 4517, 4518, 0, 0, 0, 0, 0, 0, -2272, 0, 0, 0, 1670, 0, 1124, 0, 0, 0, 0, 4541, 0, 4494, 0, 0, 0, 0, 0, 0, 0, 0, 4542, 0, 0, 1671, 1672, 0, 0, 0, 4542, 0, 0, 0, 169, 4519, 173, 4516, 4517, 4518, 0, 0, -2272, 709, 0, 0, 1124, 0, 0, 0, 1679, 1680, 1681, 0, 1682, 1683, 1684, 1685, 1686, 1687, 4541, 0, 0, 4532, 0, 0, 0, 3029, 4541, 0, 0, 1675, 1669, 0, 0, 1124, 1670, 0, 0, 1124, 1124, 0, 0, 0, 1676, 0, 0, 0, 0, 0, 709, 709, 1866, 0, 0, 0, 0, 1671, 1672, 0, 0, 0, 0, 0, 0, 0, 1420, 0, 674, 0, 0, 0, 0, 0, 1673, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1674, 674, 0, 1675, 0, 0, 0, 0, 0, 0, 0, 0, 1262, 709, 1981, 0, 1676, 0, 1263, 1677, 709, 0, -2272, 770, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1302, 809, 1420, 0, 0, 0, 0, 709, 0, 0, 709, 0, 0, 0, 0, 1264, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1661, 0, 709, 0, 0, 1662, 0, 0, 1663, 0, 0, 770, 770, 770, 770, 709, 1303, 0, 0, 0, 0, 1678, 0, 0, 0, 1664, 674, 0, 1665, 709, 0, 0, 0, 1666, 1265, 0, 0, 0, 0, 1667, 2096, 1266, 709, 0, 1267, 0, 1682, 1683, 1684, 1685, 1686, 1687, 770, 770, 0, 0, 1420, 0, 770, 0, 0, 0, 0, 1668, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1304, 0, 0, 1268, 0, 0, 0, 770, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1679, 1680, 1681, 0, 1682, 1683, 1684, 1685, 1686, 1687, 0, 0, 0, 0, 2395, 770, 770, 770, 770, 0, 0, 0, 0, 0, 0, 0, 0, 709, 0, 1305, 0, 1306, 0, 709, 0, 0, 2096, 0, 0, 0, 0, 1307, 0, 1270, 0, 765, 0, 0, 0, 0, 0, 1669, 773, 1271, 765, 1670, 0, 0, 0, 0, 0, 1272, 0, 0, 809, 0, 0, 0, 0, 770, 1308, 1273, 0, 0, 0, 0, 1671, 1672, 770, 0, 0, 0, 0, 0, 770, 770, 0, 0, 0, 709, 0, 0, 0, 1673, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1309, 0, 0, 1275, 1276, 1310, 0, 0, 0, 0, 1552, 0, 0, 0, 0, 1674, 0, 770, 1675, 765, 0, 1262, 0, 709, 709, 0, 770, 1263, 0, 1311, 0, 1676, 709, 0, 1677, 0, 0, 0, 0, 709, 1312, 0, 0, 0, 0, 0, 650, 650, 0, 0, 2305, 0, 0, 0, 1124, 0, 1124, 0, 0, 0, 0, 0, 0, 1124, 0, 0, 1124, 1264, 0, 0, 1124, 1420, 0, 0, 1420, 0, 1420, 0, 1124, 1124, 0, 1420, 0, 0, 0, 0, 1124, 1278, 809, 1124, 1124, 1124, 1124, 0, 0, 0, 0, 0, 0, 1124, 1124, 0, 1124, 0, 1124, 1124, 0, 0, 1124, 1678, 0, 0, 0, 0, 0, 0, 1265, 0, 0, 0, 0, 0, 0, 1266, 0, 1124, 1267, 0, 0, 770, 1124, 1420, 0, 0, 1124, 0, 0, 0, 1124, 0, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 0, 1124, 0, 0, 0, 0, 0, 709, 0, 1124, 1124, 0, 0, 0, 0, 0, 709, 0, 0, 0, 0, 0, 1420, 0, 0, 0, 0, 0, 0, 0, 0, 1268, 0, 0, 0, 0, 0, 0, 1662, 0, 0, 1663, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1679, 1680, 1681, 0, 1682, 1683, 1684, 1685, 1686, 1687, 0, 0, 0, 1666, 0, 0, 0, 0, 0, 1667, 0, 0, 0, 0, 0, 0, 0, 0, 1420, 0, 1420, 0, 0, 0, 0, 1269, 0, 1270, 0, 0, 0, 0, 0, 1668, 0, 0, 0, 1271, 0, 0, 0, 0, 0, 0, 0, 1272, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1273, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1662, 0, 0, 1663, 709, 0, 709, 0, 1124, 0, 0, 0, 0, 0, 0, 0, 1420, 0, 0, 0, 1664, 0, 0, 1274, 0, 0, 1275, 1276, 1666, 0, 0, 0, 0, 1662, 1667, 0, 1663, 0, 0, 0, 0, 1420, 0, 709, 0, 0, 0, 0, 0, 2515, 0, 2522, 1277, 1664, 0, 0, 0, 0, 1668, 0, 1420, 1666, 0, 0, 0, 0, 0, 1667, 0, 0, 1669, 0, 0, 0, 1670, 0, 0, 0, 1420, 773, 0, 0, 0, 0, 650, 0, 650, 0, 0, 0, 0, 1668, 0, 0, 0, 1671, 1672, 0, 0, 0, 0, 0, 0, 1124, 0, 0, 0, 0, 0, 0, 1278, 0, 1673, 0, 765, 0, 770, 770, 770, 0, 0, 765, 0, 809, 0, 770, 0, 770, 0, 770, 770, 0, 0, 709, 0, 0, 0, 0, 1674, 0, 0, 1675, 1420, 0, 0, 0, 0, 0, 0, 0, 0, 0, 674, 0, 1676, 0, 0, 1262, 1420, 0, 1669, 1981, 0, 1263, 1670, 0, 0, 0, 2632, 1420, 0, 0, 0, 2641, 0, 0, 0, 0, 0, 709, 0, 0, 0, 0, 0, 1671, 1672, 0, 0, 0, 0, 0, 0, 1669, 0, 0, 709, 1670, 0, 0, 2681, 2681, 1673, 1264, 0, 0, 0, 773, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1671, 1672, 0, 0, 0, 0, 770, 0, 0, 0, 1674, 0, 0, 1675, 1678, 0, 0, 1673, 0, 0, 1420, 0, 0, 0, 0, 0, 1676, 0, 0, 1677, 0, 0, 0, 0, 1265, 0, 2746, 0, 2749, 2751, 1420, 1266, 0, 1674, 1267, 0, 1675, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1676, 0, 0, 1677, 0, 0, 1420, 770, 0, 0, 0, 0, 0, 0, 0, 770, 0, 0, 0, 0, 770, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1124, 0, 0, 0, 0, 0, 1268, 0, 0, 1420, 0, 0, 1678, 0, 0, 1679, 1680, 1681, 0, 1682, 1683, 1684, 1685, 1686, 1687, 0, 0, 0, 1981, 0, 0, 2681, 0, 709, 0, 2847, 0, 0, 650, 0, 0, 0, 0, 0, 0, 1678, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1662, 0, 0, 1663, 0, 1269, 2746, 1270, 0, 0, 0, 0, 0, 0, 770, 2872, 0, 1271, 0, 0, 1664, 0, 0, 0, 0, 1272, 0, 0, 1666, 0, 0, 0, 0, 0, 1667, 1273, 0, 1420, 0, 0, 0, 770, 0, 770, 2681, 770, 2681, 1679, 1680, 1681, 0, 1682, 1683, 1684, 1685, 1686, 1687, 0, 1668, 0, 0, 3323, 0, 0, 0, 1124, 0, 0, 1324, 0, 0, 1275, 1276, 0, 0, 0, 0, 1552, 0, 0, 1679, 1680, 1681, 0, 1682, 1683, 1684, 1685, 1686, 1687, 0, 0, 0, 0, 3481, 0, 0, 1325, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 765, 0, 0, 0, 1420, 0, 765, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 770, 0, 0, 0, 0, 0, 0, 1124, 1124, 0, 0, 0, 0, 1124, 0, 0, 1278, 0, 0, 0, 0, 1669, 0, 0, 0, 1670, 1262, 0, 0, 0, 0, 0, 1263, 0, 0, 0, 0, 0, 1124, 1124, 0, 0, 0, 1124, 0, 0, 1671, 1672, 0, 0, 0, 0, 0, 0, 0, 1124, 1124, 1124, 1124, 0, 0, 0, 0, 1673, 0, 0, 0, 0, 1124, 0, 0, 1124, 1264, 1124, 3033, 0, 0, 0, 0, 0, 0, 0, 0, 1124, 1124, 0, 0, 1124, 0, 1674, 0, 0, 1675, -121, 0, 0, 0, 0, 0, 0, 1124, 0, 1124, 0, 809, 1676, 1124, 1, 1677, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 3, 4, 1265, 0, 0, 0, 1124, 0, 0, 1266, 709, 0, 1267, 0, 0, 5, 3086, 0, 0, 1124, 1124, 1124, 0, 0, 1420, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 1124, 7, 8, 0, 0, 0, 0, 9, 0, 10, 0, 0, 1124, 0, 0, 0, 0, 1124, 0, 11, 0, 12, 0, 1124, 0, 1420, 0, 0, 1678, 0, 1268, 3086, 0, 0, 3122, 0, 0, 13, 2522, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1262, 0, 15, 0, 16, 0, 1263, 0, 17, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 19, 0, 20, 0, 0, 0, 0, 1124, 21, 2681, 0, 0, 0, 0, 1552, 1269, 0, 1270, 0, 0, 0, 0, 0, 22, 1264, 0, 0, 1271, 0, 0, 0, 0, 0, 0, 0, 1272, 0, 0, 0, 0, 770, 0, 770, 770, 770, 1273, 1262, 0, 0, 1679, 1680, 1681, 1263, 1682, 1683, 1684, 1685, 1686, 1687, 0, 0, 3601, 0, 1420, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1265, 1420, 0, 0, 0, 23, 24, 1266, 1275, 1276, 1267, 25, 0, 0, 0, 0, 0, 0, 0, 1264, 26, 0, 1662, 0, 0, 1663, 0, 0, 0, 0, 0, 27, 0, 0, 1277, 0, 0, 0, 0, 0, 0, 0, 1664, 0, 0, 0, 0, 0, 0, 0, 1666, 0, 0, 0, 0, 0, 1667, 0, 0, 0, 0, 0, 1662, 0, 1268, 1663, 0, 0, 1265, 28, 0, 0, 0, 0, 0, 1266, 0, 0, 1267, 0, 1668, 29, 1664, 0, 0, 0, 30, 31, 0, 32, 1666, 0, 1278, 0, 33, 0, 1667, 1662, 0, 34, 1663, 0, 35, 0, 0, 0, 36, 0, 0, 0, 0, 37, 38, 1420, 0, 0, 0, 0, 0, 39, 1668, 1269, 40, 1270, 0, 1666, 0, 0, 0, 0, 41, 1667, 1268, 1271, 0, 0, 0, 0, 0, 1420, 0, 1272, 42, 0, 0, 0, 0, 0, 0, 0, 0, 1273, 2681, 2681, 0, 1668, 1420, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 0, 0, 0, 0, 0, 45, 0, 0, 0, 0, 46, 0, 1669, 0, 1351, 0, 1670, 1275, 1276, 1269, 0, 1270, 0, 47, 0, 0, 0, 0, 0, 0, 0, 1271, 0, 0, 0, 709, 709, 1671, 1672, 1272, 1420, 0, 0, 1352, 0, 0, 0, 3050, 0, 1273, 0, 709, 1669, 0, 1673, 0, 1670, 0, 0, 48, 0, 0, -121, 0, 1552, 709, 0, 0, 0, 0, 0, 0, 0, 1552, 709, 0, 0, 1671, 1672, 0, 1674, 0, 1950, 1675, 0, 1275, 1276, -2272, 709, 0, 0, 1670, 0, 0, 1673, 0, 1676, 0, 0, 1677, 0, 1278, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1951, 1671, 1672, 0, 0, 770, 0, 0, 770, 1674, 0, 0, 1675, 0, 0, 0, 0, 0, -2272, 0, 0, 0, 765, 0, 0, 1676, 0, 0, 1677, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 709, 0, 0, 0, 1675, 0, 0, 0, 0, 0, 770, 0, 0, 0, 0, 1278, 0, 1676, 1124, 0, 1678, 0, 0, 0, 0, 0, 0, 0, 1124, 0, 0, 0, 0, 1420, 1124, 0, 1124, 0, 0, 0, 0, 0, 1124, 0, 0, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 0, 0, 0, 1124, 1124, 1678, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1124, 0, 0, 0, 1124, 0, 0, 0, 1124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1124, 0, 0, 1124, 0, 1124, -2272, 0, 0, 0, 0, 0, 0, 0, 1124, 1124, 1124, 0, 0, 0, 1124, 0, 0, 1124, 1679, 1680, 1681, 3553, 1682, 1683, 1684, 1685, 1686, 1687, 709, 709, 709, 765, 3528, 3086, 3570, 0, 0, 0, 3570, 3584, 0, 0, 0, 0, 0, 1124, 0, 0, 0, 0, 1420, 1124, 1124, 0, 0, 0, 0, 0, 1679, 1680, 1681, 0, 1682, 1683, 1684, 1685, 1686, 1687, 0, 0, 0, 0, 3605, 0, 0, 1124, 0, 0, 0, 0, 0, 1124, 0, 0, 0, 2522, 0, 1124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1682, 1683, 1684, 1685, 1686, 1687, 0, 0, 0, 0, 0, 0, 3637, 1552, 1552, 0, 2096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 770, 770, 770, 770, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1420, 0, 0, 0, 1662, 0, 0, 1663, 3678, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1662, 0, 1420, 1663, 0, 1664, 0, 0, 0, 0, 0, 0, 0, 1666, 0, 0, 0, 0, 0, 1667, 1664, 0, 0, 0, 0, 0, 0, 0, 1666, 0, 0, 0, 0, 0, 1667, 0, 0, 0, 1420, 0, 0, 1662, 0, 1668, 1663, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1668, 0, 0, 1664, 0, 0, 0, 0, 0, 0, 0, 1666, 3748, 0, 1420, 0, 0, 1667, 1420, 1420, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1668, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 709, 0, 0, 0, 0, 767, 0, 0, 0, 0, 0, 770, 0, 1124, 767, 787, 0, 0, 0, 709, 0, 787, 0, 0, 1669, 3814, 0, 0, 1670, 0, 0, 0, 787, 0, 1981, 0, 0, 0, 0, 1669, 0, 0, 0, 1670, 0, 0, 709, 0, 0, 1671, 1672, 0, 0, 0, 0, 0, 2746, 0, 0, 0, 0, 0, 3842, 0, 1671, 1672, 1673, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1124, 1124, 1669, 1673, 0, 0, 1670, 0, 0, 0, 0, 0, 0, 0, 1674, 0, 0, 1675, 0, 0, 0, 0, 0, 2681, 0, 2681, 0, 1671, 1672, 1674, 1676, 0, 1675, 1677, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1673, 1676, 0, 0, 1677, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1674, 0, 0, 1675, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1676, 0, 0, 1677, 0, 0, 0, 0, 0, 0, 1124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1124, 1124, 1678, 0, 0, 0, 0, 0, 1124, 1124, 0, 0, 0, 1124, 0, 0, 0, 1678, 0, 1124, 1124, 0, 1662, 1124, 0, 1663, 1124, 3926, 0, 0, 709, 709, 709, 709, 0, 0, 0, 3570, 3584, 1262, 3570, 0, 1664, 3935, 0, 1263, 0, 3086, 0, 1662, 1666, 3086, 1663, 0, 0, 0, 1667, 3948, 1678, 0, 0, 0, 0, 1124, 0, 0, 0, 0, 1124, 1664, 0, 0, 0, 1124, 0, 0, 0, 1666, 0, 809, 1668, 0, 0, 1667, 0, 1264, 0, 3122, 0, 0, 0, 2522, 0, 0, 0, 1679, 1680, 1681, 0, 1682, 1683, 1684, 1685, 1686, 1687, 650, 0, 1668, 1124, 3631, 1679, 1680, 1681, 0, 1682, 1683, 1684, 1685, 1686, 1687, 0, 0, 0, 0, 3888, 0, 0, 0, 2681, 2681, 0, 0, 0, 0, 1265, 0, 0, 0, 0, 0, 0, 1266, 0, 0, 1267, 0, 0, 0, 0, 0, 4002, 1679, 1680, 1681, 0, 1682, 1683, 1684, 1685, 1686, 1687, 0, 0, 0, 0, 3922, 0, 0, 0, 0, 0, 0, 0, 767, 0, 0, 0, 0, 0, 0, 0, 0, 1669, 0, 0, 787, 1670, 0, 0, 787, 0, 0, 0, 0, 0, 0, 0, 0, 1268, 0, 787, 0, 0, 0, 770, 0, 0, 1671, 1672, 1669, 0, 0, 0, 1670, 0, 0, 787, 0, 770, 0, 767, 0, 0, 0, 1673, 0, 0, 0, 0, 0, 767, 787, 0, 0, 1671, 1672, 787, 0, 0, 0, 0, 0, 0, 0, 0, 0, 787, 0, 0, 0, 1674, 1673, 0, 1675, 787, 1269, 0, 1270, 0, 0, 0, 0, 0, 0, 0, 0, 1676, 1271, 0, 1677, 0, 0, 0, 0, 0, 1272, 1124, 1674, 0, 0, 1675, 0, 0, 0, 0, 1273, 0, 765, 0, 0, 0, 0, 1981, 1676, 0, 0, 1677, 1662, 0, 1552, 1663, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 770, 1981, 0, 0, 0, 0, 1664, 2013, 0, 0, 1275, 1276, 0, 0, 1666, 0, 767, 0, 0, 0, 1667, 787, 0, 0, 0, 0, 709, 0, 0, 0, 0, 0, 0, 1678, 1262, 0, 2014, 0, 0, 0, 1263, 0, 0, 0, 1668, 0, 0, 767, 0, 0, 0, 0, 0, 0, 0, 1124, 0, 0, 0, 0, 1678, 0, 0, 0, 1124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1264, 1124, 1124, 0, 0, 1124, 0, 0, 0, 0, 0, 0, 0, 0, 1278, 0, 0, 0, 765, 3570, 0, 0, 0, 3086, 0, 0, 0, 0, 3086, 0, 0, 3086, 2746, 0, 4171, 0, 1124, 1124, 0, 0, 0, 0, 0, 0, 0, 0, 1679, 1680, 1681, 1265, 1682, 1683, 1684, 1685, 1686, 1687, 1266, 0, 0, 1267, 4143, 3637, 809, 770, 770, 770, 1669, 0, 0, 0, 1670, 0, 0, 1679, 1680, 1681, 0, 1682, 1683, 1684, 1685, 1686, 1687, 0, 0, 0, 0, 4152, 0, 0, 767, 1671, 1672, 0, 0, 0, 0, 0, 0, 765, 809, 767, 0, 0, 0, 0, 0, 0, 1673, 0, 0, 0, 0, 1268, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1422, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1674, 0, 0, 1675, 0, 0, 0, 0, 0, 1552, 1552, 0, 1662, 0, 765, 1663, 1676, 709, 0, 1677, 0, 0, 0, 0, 0, 0, 0, 767, 3814, 0, 0, 0, 1664, 0, 0, 2681, 1269, 0, 1270, 1981, 1666, 0, 0, 0, 0, 0, 1667, 0, 1271, 0, 0, 3842, 0, 0, 709, 0, 1272, 0, 0, 787, 0, 0, 770, 3637, 0, 0, 1273, 0, 0, 0, 1668, 0, 0, 0, 787, 0, 0, 0, 767, 0, 0, 0, 0, 0, 0, 1124, 787, 0, 1124, 0, 1124, 0, 0, 0, 1678, 0, 0, 0, 0, 2627, 0, 0, 1275, 1276, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1124, 787, 0, 0, 3086, 0, 0, 4171, 0, 1422, 0, 787, 0, 4324, 0, 1277, 0, 0, 0, 0, 0, 0, 0, 0, 787, 0, 0, 787, 0, 770, 0, 0, 0, 709, 0, 0, 0, 0, 0, 767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 770, 770, 770, 770, 1669, 0, 0, 0, 1670, 0, 0, 0, 0, 767, 0, 1552, 0, 0, 1278, 1679, 1680, 1681, 0, 1682, 1683, 1684, 1685, 1686, 1687, 1671, 1672, 0, 0, 4185, 765, 0, 0, 0, 0, 0, 0, 767, 767, 0, 767, 0, 1673, 0, 0, 0, 0, 0, 0, 1124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 767, 0, 0, 0, 0, 0, 0, 0, 0, 1674, 0, 0, 1675, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 787, 0, 1676, 1124, 0, 1677, 765, 1662, 787, 787, 1663, 0, 0, 0, 0, 0, 0, 767, 1812, 0, 0, 0, 0, 0, 0, 0, 770, 1664, 809, 0, 0, 0, 0, 0, 0, 1666, 0, 1124, 0, 0, 0, 1667, 0, 0, 0, 0, 767, 0, 0, 0, 767, 767, 0, 0, 1662, 0, 0, 1663, 0, 0, 0, 0, 0, 0, 0, 1668, 1422, 0, 0, 0, 0, 0, 1812, 0, 1664, 0, 0, 0, 0, 0, 1678, 770, 1666, 0, 0, 0, 765, 0, 1667, 0, 0, 0, 0, 0, 0, 0, 0, 3637, 0, 0, 1262, 0, 0, 0, 0, 0, 1263, 0, 0, 1124, 1124, 0, 1668, 0, 2746, 0, 0, 0, 4324, 0, 1422, 0, 0, 0, 0, 0, 0, 0, 0, 0, 765, 0, 0, 0, 0, 0, 0, 0, 0, 770, 0, 0, 0, 0, 0, 0, 1264, 0, 0, 0, 0, 0, 0, 1422, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1669, 0, 0, 1124, 1670, 0, 1679, 1680, 1681, 0, 1682, 1683, 1684, 1685, 1686, 1687, 0, 1124, 0, 0, 4244, 0, 770, 0, 0, 1671, 1672, 0, 1265, 0, 0, 0, 0, 0, 0, 1266, 0, 0, 1267, 0, 0, 787, 1673, 0, 0, 0, 0, 1669, 0, 0, 0, 1670, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1422, 0, 0, 0, 0, 0, 0, 1674, 0, 0, 1675, 1671, 1672, 0, 0, 0, 0, 0, 0, 1422, 1124, 0, 0, 1676, 0, 0, 1677, 1662, 1673, 765, 1663, 1268, 0, 0, 0, 0, 0, 0, 0, 1422, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1674, 1666, 0, 1675, 0, 1812, 0, 1667, 0, 0, 1422, 0, 0, 0, 0, 0, 1676, 0, 0, 1677, 0, 0, 0, 0, 0, 787, 0, 0, 0, 0, 0, 1668, 0, 0, 1269, 0, 1270, 0, 0, 0, 0, 787, 0, 0, 0, 0, 1271, 1678, 0, 0, 0, 0, 0, 0, 1272, 0, 0, 0, 0, 0, 0, 767, 0, 0, 1273, 0, 0, 1422, 0, 0, 767, 0, 787, 787, 0, 0, 0, 0, 0, 0, 0, 0, 0, 787, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3543, 1678, 787, 787, 2714, 0, 0, 1275, 1276, 0, 0, 0, 0, 0, 787, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2715, 0, 0, 0, 0, 0, 0, -2272, 0, 0, 0, 1670, 0, 767, 1679, 1680, 1681, 0, 1682, 1683, 1684, 1685, 1686, 1687, 0, 0, 0, 0, 4460, 0, 0, 0, 1671, 1672, 0, 0, 0, 0, 0, 791, 0, 0, 0, 0, 0, 0, 0, 815, 767, -2272, 767, 0, 0, 0, 0, 0, 827, 767, 1278, 0, 767, 1679, 1680, 1681, 767, 1682, 1683, 1684, 1685, 1686, 1687, 0, 767, 767, 0, 4552, 0, 0, 1675, 0, 767, 0, 0, 767, 767, 767, 767, 0, 0, 1662, 0, 1676, 1663, 767, 767, 0, 767, 0, 767, 767, 0, 0, 767, 0, 0, 0, 0, 0, 0, 1664, 0, 0, 0, 2491, 0, 0, 0, 1666, 1422, 767, 1812, 0, 0, 1667, 767, 0, 0, 0, 767, 0, 0, 0, 767, 0, 767, 767, 767, 767, 767, 767, 767, 767, 767, 0, 767, 0, 0, 1668, 0, 0, 0, 0, 767, 767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2272, 1662, 0, 0, 1663, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1664, 0, 2492, 0, 0, 0, 0, 1662, 1666, 0, 1663, 0, 0, 0, 1667, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1664, 0, 0, 0, 0, 0, 0, 1662, 1666, 0, 1663, 1668, 0, 0, 1667, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1664, 0, 0, 0, 0, 1669, 0, 0, 1666, 1670, 0, 1668, 0, 0, 1667, 0, 0, 0, 0, 0, 0, 0, 1682, 1683, 1684, 1685, 1686, 1687, 0, 0, 1671, 1672, 0, 0, 0, 767, 0, 0, 1668, 0, 0, 0, 0, 0, 0, 0, 0, 1673, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1662, 0, 0, 1663, 0, 0, 0, 0, 3005, 0, 0, 0, 0, 3006, 0, 0, 1674, 0, 0, 1675, 0, 0, 0, 0, 0, 0, 1422, 0, 1666, 1669, 1422, 1422, 1676, 1670, 1667, 1677, 0, 0, 0, 0, 787, 0, 0, 0, 1812, 787, 0, 0, 787, 0, 0, 0, 0, 0, 1671, 1672, 1669, 0, 1668, 0, 1670, 4524, 0, 0, 0, 0, 0, 0, 0, 0, 787, 1673, 836, 767, 0, 0, 0, 869, 0, 0, 0, 1671, 1672, 1669, 767, 0, 0, 1670, 0, 0, 0, 767, 0, 0, 0, 0, 0, 1674, 1673, 0, 1675, 0, 0, 0, 0, 0, 0, 0, 1671, 1672, 1678, 787, 0, 1676, 0, 0, 1677, 0, 0, 0, 3544, 0, 0, 0, 1674, 1673, 0, 1675, 787, 787, 0, 0, 0, 0, 0, 1422, 0, 0, 0, 0, 1676, 0, 0, 1677, 0, 0, 0, 0, 0, 0, 0, 1674, 1812, 787, 1675, 0, 1812, 0, 0, 0, -2272, 2493, 0, 3520, 1670, 0, 0, 1676, 0, 0, 1677, 0, 0, 0, 0, 0, 0, 0, 0, 787, 0, 0, 0, 787, 0, 1671, 1672, 0, 4525, 0, 0, 1678, 0, 0, 0, 0, 0, 0, 0, 0, 0, 787, -2272, 1679, 1680, 1681, 0, 1682, 1683, 1684, 1685, 1686, 1687, 0, 1011, 787, 0, 0, 1678, 0, 0, 0, 0, 0, 0, 0, 0, 0, 787, 0, 0, 1675, 3521, 0, 0, 1129, 0, 787, 0, 0, 0, 0, 0, 0, 1676, 1678, 0, 0, 0, 1662, 0, 0, 1663, 0, 1152, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1664, 0, 0, 2968, 0, 0, 1178, 0, 1666, 0, 0, 767, 0, 1422, 1667, 1679, 1680, 1681, 0, 1682, 1683, 1684, 1685, 1686, 1687, 0, 0, 0, 1662, 0, 0, 1663, 0, 0, 1812, 0, 0, 0, 1668, 0, 0, 0, 1679, 1680, 1681, 0, 1682, 1683, 1684, 1685, 1686, 1687, 0, -2272, 0, 0, 1666, 0, 0, 0, 0, 0, 1667, 0, 0, 0, 0, 0, 0, 1679, 1680, 1681, 1287, 1682, 1683, 1684, 1685, 1686, 1687, 0, 0, 0, 0, 0, 1662, 0, 1668, 1663, 0, 0, 0, 0, 1422, 0, 0, 787, 0, 0, 1662, 0, 0, 1663, 0, 0, 1664, 0, 0, 3013, 0, 0, 0, 0, 1666, 0, 0, 0, 0, 0, 1667, 0, 0, 0, 0, 0, 0, 0, 1666, 0, 0, 787, 0, 0, 1667, 0, 767, 0, 0, 0, 0, 0, 1669, 0, 1668, 0, 1670, 0, 0, 0, 3547, 0, 1682, 1683, 1684, 1685, 1686, 1687, 1668, 0, 0, 0, 0, 1435, 0, 0, 787, 1671, 1672, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1422, 0, 0, 0, 0, 0, 1673, 1463, 1466, 1467, 0, 787, -2272, 0, 0, 767, 1670, 0, 0, 0, 0, 767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1674, 0, 0, 1675, 0, 1671, 1672, 767, 767, 0, 3920, 0, 0, 767, 0, 0, 1676, 0, 0, 1677, 0, 0, -2272, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1669, 0, 767, 767, 1670, 0, 0, 767, 0, 0, 0, 0, 0, 0, -2272, 1675, 0, 0, 1670, 767, 767, 767, 767, 0, 0, 1671, 1672, 1812, 1676, 0, 0, 1129, 767, 1812, 0, 767, 0, 767, 0, 1671, 1672, 0, 1673, 0, 0, 0, 0, 767, 767, 0, 0, 767, 0, 0, 1129, 0, -2272, 0, 1678, 0, 0, 0, 0, 0, 767, 0, 767, 0, 1674, 0, 767, 1675, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1676, 1675, 0, 1677, 0, 767, 0, 0, 0, 0, 1262, 0, 0, 0, 1676, 767, 1263, 0, 767, 767, 767, 0, -2272, 0, 0, 0, 0, 0, 0, 0, 0, 0, 787, 0, 0, 767, 788, 0, 0, 0, 0, 1302, 788, 0, 0, 0, 0, 767, 0, 0, 0, 0, 767, 788, 0, 0, 1264, 0, 767, 0, 0, 0, 0, 0, 0, 0, 767, 1679, 1680, 1681, 0, 1682, 1683, 1684, 1685, 1686, 1687, 0, 1678, 0, 0, 1422, 0, 0, 1422, 0, 1422, 1303, 0, 0, 0, 1422, -2272, 787, 0, 0, 0, 0, 0, 0, 0, 0, 1729, 0, 0, 1265, 0, 0, 787, 787, 0, 0, 1266, 0, 767, 1267, 0, 0, 0, 1682, 1683, 1684, 1685, 1686, 1687, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 787, 0, 0, 787, 0, 0, 1422, 0, 0, 0, 0, 0, 0, 0, 0, 1864, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1304, 0, 0, 1268, 0, 1679, 1680, 1681, 0, 1682, 1683, 1684, 1685, 1686, 1687, 1422, 0, 0, 0, 0, 0, 0, 0, 1682, 1683, 1684, 1685, 1686, 1687, 0, 0, 0, 0, 0, 0, 0, 1662, 0, 0, 1663, 0, 0, 1812, 1812, 1812, 0, 1976, 0, 1305, 0, 1306, 0, 0, 1994, 0, 0, 1664, 0, 0, 0, 1307, 0, 1270, 0, 1666, 0, 787, 0, 0, 0, 1667, 0, 1271, 0, 1422, 0, 1422, 787, 0, 0, 1272, 0, 0, 2028, 0, 0, 2031, 787, 0, 1308, 1273, 0, 0, 0, 1668, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2069, 0, 2702, 0, 0, 1275, 1276, 1310, 0, 0, 0, 0, 0, 0, 2085, 0, 1422, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2097, 0, 0, 0, 2703, 0, 0, 0, 787, 0, 0, 0, 0, 0, 1422, 1312, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1662, 0, 0, 1663, 0, 0, 1422, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1664, 1669, 0, 1812, 1422, 1670, 0, 0, 1666, 0, 0, 0, 0, 1262, 1667, 1278, 0, 0, 787, 1263, 787, 0, 0, 0, 0, 0, 1671, 1672, 0, 788, 0, 0, 787, 788, 787, 0, 0, 0, 1668, 0, 0, 0, 0, 1673, 788, 0, 0, 0, 0, 0, 0, 0, 2193, 0, 0, 0, 0, 0, 2203, 1264, 788, 0, 0, 0, 0, 0, 0, 0, 1422, 1674, 0, 0, 1675, 0, 0, 788, 0, 0, 0, 0, 788, 0, 0, 787, 1422, 1676, 0, 0, 1677, 0, 788, 0, 0, 0, 0, 1422, 0, 0, 788, 0, 0, 0, 0, 2983, 0, 0, 0, 0, 1265, 0, 0, 787, 0, 0, 2250, 1266, 0, 0, 1267, 0, 0, 0, 767, 0, 3018, 787, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1669, 0, 787, 0, 1670, 787, 0, 0, 0, 0, 0, 0, 1129, 1129, 0, 0, 0, 0, 0, 0, 0, 767, 0, 1678, 1422, 1671, 1672, 0, 2298, 0, 0, 767, 1268, 0, 0, 0, 788, 767, 0, 767, 0, 0, 1673, 0, 1422, 767, 0, 0, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 0, 0, 0, 767, 767, 0, 0, 0, 0, 0, 1674, 1422, 0, 1675, 0, 0, 767, 0, 0, 0, 767, 0, 1812, 0, 767, 0, 1676, 0, 0, 1677, 0, 1269, 0, 1270, 767, 0, 0, 767, 0, 767, 0, 0, 0, 1271, 0, 0, 0, 1422, 767, 767, 767, 1272, 0, 0, 767, 0, 0, 767, 1679, 1680, 1681, 1273, 1682, 1683, 1684, 1685, 1686, 1687, 0, 0, 0, 767, 0, 767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 767, 1662, 2457, 0, 1663, 0, 767, 767, 0, 2760, 0, 2471, 1275, 1276, 0, 0, 0, 0, 0, 1678, 0, 1664, 0, 0, 3024, 0, 0, 0, 0, 1666, 767, 0, 0, 0, 0, 1667, 767, 0, 2761, 0, 0, 0, 767, 0, 0, 0, 0, 0, 1422, 0, 0, 0, 0, 1662, 0, 0, 1663, 0, 0, 1668, 0, 0, 0, 0, 767, 0, 0, 0, 0, 0, 0, 0, 0, 1664, 0, 0, 0, 0, 0, 0, 0, 1666, 0, 0, 0, 0, 0, 1667, 1262, 0, 0, 0, 0, 0, 1263, 787, 1278, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1668, 1679, 1680, 1681, 0, 1682, 1683, 1684, 1685, 1686, 1687, 0, 0, 0, 0, 0, 2482, 0, 2485, 0, 1812, 0, 0, 1264, 0, 1812, 1422, 1812, 0, 0, 0, 0, 0, 0, 788, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 788, 1669, 0, 0, 0, 1670, 1129, 0, 0, 0, 0, 0, 788, 0, 787, 0, 787, 0, 0, 0, 787, 0, 0, 1265, 0, 787, 1671, 1672, 787, 0, 1266, 0, 0, 1267, 0, 0, 0, 0, 0, 0, 788, 0, 0, 1673, 0, 0, 0, 0, 0, 0, 788, 0, 0, 1669, 0, 0, 0, 1670, 0, 0, 0, 0, 1812, 788, 0, 0, 788, 0, 0, 1674, 0, 0, 1675, 0, 0, 0, 0, 0, 1671, 1672, 0, 0, 0, 0, 0, 1676, 0, 1268, 1677, 0, 0, 789, 0, 0, 0, 1673, 0, 789, 0, 0, 0, 0, 0, 0, 0, 0, 767, 0, 789, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1674, 0, 0, 1675, 0, 0, 0, 0, 787, 787, 0, 0, 1422, 0, 0, 787, 1676, 0, 0, 1677, 0, 2650, 0, 1269, 0, 1270, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1271, 0, 1662, 2676, 0, 1663, 0, 1678, 1272, 0, 0, 0, 0, 0, 1422, 767, 767, 0, 1273, 0, 0, 0, 1664, 0, 788, 3527, 0, 0, 0, 0, 1666, 0, 788, 788, 0, 0, 1667, 0, 0, 0, 0, 0, 1813, 0, 0, 0, 0, 0, 0, 0, 0, 3187, 0, 0, 1275, 1276, 787, 0, 0, 1678, 1668, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 767, 0, 0, 0, 0, 0, 3188, 0, 0, 0, 0, 3477, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1813, 0, 0, 0, 1679, 1680, 1681, 0, 1682, 1683, 1684, 1685, 1686, 1687, 0, 767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 767, 767, 0, 1422, 0, 0, 0, 0, 767, 767, 0, 0, 0, 767, 1422, 0, 0, 1278, 0, 767, 767, 0, 0, 767, 0, 0, 767, 0, 0, 2845, 0, 1679, 1680, 1681, 0, 1682, 1683, 1684, 1685, 1686, 1687, 1669, 0, 0, 0, 1670, 0, 767, 0, 0, 0, 767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 767, 0, 0, 1671, 1672, 767, 0, 0, 0, 0, 767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1673, 0, 0, 1662, 0, 0, 1663, 1262, 0, 0, 0, 0, 0, 1263, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1664, 0, 767, 1674, 0, 788, 1675, 0, 1666, 0, 0, 0, 0, 0, 1667, 0, 0, 0, 0, 1676, 1422, 0, 1677, 0, 0, 0, 0, 0, 0, 0, 1264, 0, 0, 0, 0, 0, 0, 1812, 1668, 179, 0, 0, 0, 0, 0, 0, 1422, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 787, 0, 0, 0, 789, 1422, 0, 0, 789, 0, 0, 0, 787, 0, 0, 0, 0, 0, 0, 789, 0, 1265, 0, 0, 0, 0, 1813, 180, 1266, 0, 0, 1267, 0, 0, 787, 789, 0, 0, 0, 1678, 181, 0, 0, 0, 0, 0, 788, 0, 0, 0, 789, 0, 0, 0, 0, 789, 0, 182, 0, 1422, 0, 0, 788, 183, 0, 789, 0, 0, 0, 0, 0, 0, 0, 789, 787, 0, 0, 0, 184, 0, 0, 0, 1669, 0, 0, 1268, 1670, 0, 0, 185, 0, 0, 0, 788, 788, 0, 0, 186, 0, 0, 0, 0, 0, 0, 788, 0, 0, 1671, 1672, 187, 0, 0, 767, 0, 188, 0, 788, 788, 0, 0, 189, 0, 0, 767, 1673, 0, 0, 0, 788, 0, 0, 0, 1679, 1680, 1681, 190, 1682, 1683, 1684, 1685, 1686, 1687, 1269, 0, 1270, 0, 0, 0, 0, 0, 1674, 789, 0, 1675, 1271, 0, 0, 0, 3069, 0, 191, 0, 1272, 0, 0, 0, 1676, 0, 0, 1677, 1422, 0, 1273, 0, 0, 0, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 0, 0, 787, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 767, 0, 0, 3227, 1422, 0, 1275, 1276, 0, 767, 193, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 767, 767, 0, 0, 767, 0, 3228, 0, 0, 0, 0, 0, 0, 194, 0, 0, 1678, 767, 0, 0, 0, 0, 767, 0, 0, 0, 0, 767, 0, 0, 767, 0, 0, 0, 0, 767, 767, 0, 0, 1813, 195, 0, 0, 0, 196, 0, 197, 0, 0, 0, 0, 0, 198, 0, 787, 199, 787, 0, 0, 0, 767, 0, 0, 0, 1278, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 200, 201, 0, 202, 0, 0, 0, 203, 0, 0, 1422, 0, 0, 0, 0, 204, 0, 0, 767, 0, 205, 0, 0, 0, 0, 0, 0, 0, 0, 1679, 1680, 1681, 206, 1682, 1683, 1684, 1685, 1686, 1687, 0, 0, 0, 0, 0, 0, 207, 0, 0, 0, 0, 0, 0, 1812, 0, 787, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 789, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 789, 0, 0, 0, 0, 0, 767, 0, 1422, 0, 0, 0, 789, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 767, 1422, 0, 767, 0, 767, 0, 0, 0, 0, 0, 0, 789, 0, 0, 0, 0, 0, 0, 0, 0, 0, 789, 0, 0, 0, 0, 0, 767, 0, 0, 0, 767, 0, 0, 789, 0, 1422, 789, 0, 0, 0, 788, 0, 0, 0, 1813, 788, 0, 0, 788, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1812, 0, 0, 0, 1422, 788, 0, 0, 1422, 1422, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3371, 3372, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3381, 0, 0, 0, 0, 0, 0, 0, 0, 788, 0, 0, 0, 767, 3390, 0, 0, 0, 0, 0, 0, 0, 0, 3399, 0, 0, 788, 788, 0, 0, 0, 0, 767, 0, 0, 0, 0, 3415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 789, 0, 1813, 788, 1422, 0, 1813, 0, 789, 789, 0, 0, 0, 0, 0, 0, 531, 0, 1814, 0, 767, 0, 0, 767, 0, 0, 0, 0, 532, 788, 0, 0, 0, 788, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533, 0, 788, 0, 0, 767, 1129, 0, 0, 0, 0, 0, 0, 534, 0, 0, 788, 0, 0, 0, 0, 0, 535, 1814, 0, 0, -729, 0, 787, 788, 0, 0, 0, 0, 0, 0, 0, 0, 788, 0, 0, 0, 0, 536, 0, 0, 0, 0, 0, 537, 0, 0, 0, 0, 767, 0, 0, 0, 0, 0, 0, 578, 0, 0, 538, 767, 0, 0, 0, 0, 0, 0, 0, 579, 0, 539, 0, 767, 767, 0, 0, 0, 0, 540, 0, 0, 0, 0, 787, 0, 0, 0, 0, 0, 580, 541, 0, 0, 767, 0, 0, 0, 542, 0, 1813, 0, 543, 581, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 582, -924, 0, 0, 0, 0, 0, 0, 0, 3558, 3559, 3560, 0, 0, 0, 0, 0, 583, 767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 767, 0, 0, 0, 0, 0, 584, 789, 544, 0, 0, 0, 0, 788, 0, -496, 0, 585, 0, 0, 1812, 0, 0, 0, 0, 586, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 587, 0, 0, 0, 0, 588, 0, 0, 0, 545, 788, 589, 546, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590, 767, 0, 0, 0, 0, 1812, 0, 0, 0, 767, 0, 0, 0, 1812, 0, 0, 0, 0, 788, 0, -392, 0, 1814, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 547, 0, 0, 788, 789, 0, 548, 591, 0, 0, 0, 566, -392, 0, 0, 549, 0, 609, 0, 0, 789, 0, 0, 0, 0, 0, 659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 592, 0, 0, -392, 0, 550, 551, 721, 552, 553, 0, 593, 0, 789, 789, 0, 0, 554, 0, 0, 0, 0, 555, 0, 789, 0, 0, 0, 556, 194, 0, 557, 0, 0, 558, 0, 789, 789, 0, 0, 0, 0, 0, 0, 0, 0, 0, -392, 789, 1813, 0, 0, 0, 0, 0, 1813, 594, 0, 0, 0, 595, 0, 596, 0, 0, 0, 0, 0, 597, 0, 0, 598, 0, 0, 0, 839, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 599, 0, 600, 0, 0, 0, 601, 0, 0, 0, 3783, 840, 0, 0, 602, 0, 0, 0, 0, 603, 0, 0, 0, 0, 841, 842, 0, 0, 0, 3809, 0, 604, 0, 843, 0, 0, 0, 844, 0, 0, 0, 788, 0, 0, 605, 0, 0, 0, 0, 778, 0, 0, 0, 0, 845, 0, 3826, 0, 0, 812, 813, 0, 816, 0, 0, 820, 0, 822, 0, 0, 0, 0, 0, 0, 0, 846, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 847, 0, 0, 0, 1814, 0, 0, 0, 848, 0, 0, 0, 0, 0, 0, 0, 788, 0, 0, 0, 849, 0, 0, 0, 0, 850, 0, 0, 0, 0, 0, 788, 788, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 851, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 788, 0, 0, 788, 0, 0, 0, 0, 0, 0, 0, 0, 0, 852, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 853, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 854, 0, 0, 0, 0, 0, 0, 0, 1813, 1813, 1813, 0, 0, 0, 0, 3927, 3928, 3929, 3930, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 194, 0, 0, 788, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 788, 0, 0, 0, 0, 0, 0, 0, 0, 0, 788, 0, 0, 855, 0, 0, 0, 856, 0, 857, 0, 0, 0, 0, 0, 858, 0, 0, 859, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 860, 0, 861, 0, 0, 789, 862, 0, 0, 1814, 789, 0, 0, 789, 863, 0, 0, 0, 0, 864, 0, 0, 0, 0, 0, 788, 0, 0, 0, 0, 0, 0, 0, 0, 0, 789, 0, 0, 0, 0, 0, 0, 0, 0, 865, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1813, 0, 0, 0, 0, 0, 0, 0, 0, 789, 0, 0, 0, 0, 0, 788, 0, 788, 0, 0, 0, 0, 872, 0, 0, 0, 789, 789, 0, 788, 880, 788, 0, 0, 0, 0, 0, 0, 0, 896, 897, 0, 0, 0, 899, 0, 0, 0, 0, 0, 1814, 789, 0, 0, 1814, 915, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 923, 0, 0, 0, 0, 0, 0, 0, 789, 0, 0, 788, 789, 0, 0, 0, 946, 0, 0, 948, 0, 950, 0, 953, 0, 0, 0, 0, 0, 0, 789, 0, 0, 0, 0, 0, 0, 0, 0, 788, 0, 0, 0, 0, 789, 0, 0, 0, 0, 0, 0, 0, 0, 788, 0, 0, 0, 789, 0, 0, 0, 0, 0, 0, 0, 0, 789, 0, 0, 0, 788, 0, 0, 788, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1009, 0, 1010, 0, 0, 0, 4119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1814, 0, 0, 0, 0, 0, 0, 721, 0, 0, 0, 0, 0, 0, 0, 0, 1813, 1168, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1412, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 789, 0, 0, 0, 1229, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 789, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1354, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 789, 0, 1366, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1376, 0, 0, 0, 0, 0, 0, 1378, 789, 0, 0, 0, 0, 0, 0, 0, 0, 4242, 0, 1426, 0, 0, 1430, 0, 0, 0, 0, 0, 0, 788, 0, 0, 0, 0, 1412, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1129, 1473, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1813, 0, 0, 0, 0, 1813, 0, 1813, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1814, 0, 0, 0, 0, 0, 1814, 0, 0, 0, 0, 0, 0, 0, 0, 0, 788, 0, 788, 0, 0, 0, 788, 0, 0, 0, 0, 788, 0, 0, 788, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4335, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1813, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 789, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1624, 0, 0, 788, 788, 0, 0, 0, 0, 0, 788, 0, 1412, 0, 0, 0, 0, 0, 0, 0, 0, 0, 789, 0, 0, 0, 0, 0, 1649, 1650, 0, 1652, 0, 0, 0, 0, 0, 789, 789, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1694, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 789, 0, 1412, 789, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 788, 0, 0, 0, 1730, 0, 0, 0, 0, 0, 721, 1827, 0, 1412, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1834, 0, 0, 0, 1846, 1849, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1814, 1814, 1814, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1948, 0, 789, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 789, 0, 1412, 0, 0, 0, 0, 0, 0, 0, 789, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1412, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1412, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1412, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 789, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1814, 1813, 1412, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 789, 0, 789, 0, 0, 0, 0, 788, 0, 0, 0, 0, 0, 0, 789, 0, 789, 0, 0, 788, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 788, 0, 0, 0, 0, 0, 0, 0, 2152, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2175, 789, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 788, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 789, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2220, 0, 0, 789, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2235, 0, 2237, 0, 2238, 789, 0, 0, 789, 2239, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1412, 0, 0, 0, 0, 0, 0, 1827, 0, 0, 0, 1827, 0, 1827, 0, 0, 1827, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 788, 0, 0, 0, 0, 1814, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2334, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2357, 0, 0, 2359, 0, 0, 2370, 0, 0, 0, 0, 0, 0, 2377, 2382, 0, 0, 0, 0, 2388, 0, 0, 2393, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 788, 0, 788, 2402, 0, 0, 0, 0, 2409, 0, 0, 0, 2421, 0, 0, 0, 2428, 0, 2430, 2431, 2432, 2433, 2434, 2435, 2436, 2437, 2438, 0, 2439, 0, 0, 0, 0, 0, 0, 0, 1108, 2467, 0, 0, 0, 0, 0, 1421, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 789, 0, 0, 0, 0, 0, 0, 1813, 0, 788, 0, 0, 0, 1412, 0, 0, 0, 1412, 1412, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1814, 0, 0, 0, 0, 1814, 0, 1814, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 789, 0, 789, 0, 0, 0, 789, 0, 0, 0, 0, 789, 0, 1168, 789, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1421, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1412, 0, 0, 0, 0, 1814, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2540, 2541, 0, 0, 0, 2544, 2545, 0, 0, 2548, 0, 0, 0, 0, 0, 0, 0, 1813, 0, 2558, 0, 0, 0, 0, 0, 0, 2567, 0, 0, 0, 2570, 2571, 0, 0, 2574, 2575, 0, 0, 0, 0, 0, 2580, 0, 0, 2572, 0, 0, 0, 0, 0, 0, 789, 789, 2596, 0, 2598, 0, 0, 789, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2620, 0, 0, 0, 0, 2622, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2631, 0, 2633, 2634, 2637, 2639, 0, 0, 0, 2646, 2649, 0, 0, 0, 0, 0, 0, 2660, 0, 0, 0, 2669, 0, 0, 0, 2673, 0, 0, 0, 0, 1412, 0, 0, 0, 0, 0, 0, 0, 789, 0, 0, 0, 0, 0, 0, 0, 0, 2701, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2708, 0, 2710, 0, 0, 1882, 0, 2713, 0, 0, 0, 0, 2717, 2718, 2719, 2720, 0, 0, 0, 0, 0, 2729, 0, 0, 0, 788, 0, 0, 0, 0, 0, 0, 0, 0, 2753, 2754, 2755, 0, 0, 0, 0, 0, 0, 0, 0, 2763, 2764, 0, 0, 0, 0, 1412, 0, 0, 0, 0, 0, 0, 0, 1882, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 788, 0, 0, 0, 0, 0, 0, 1421, 0, 0, 0, 0, 2793, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2821, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1412, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1689, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1421, 0, 1813, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1882, 0, 1814, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1421, 0, 0, 789, 0, 1689, 0, 0, 0, 0, 0, 0, 1813, 0, 2918, 789, 0, 0, 0, 0, 1813, 0, 1827, 0, 0, 1421, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 789, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2943, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 789, 0, 0, 0, 0, 1421, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2964, 0, 0, 0, 0, 2970, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2382, 0, 2382, 2382, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3027, 0, 0, 3030, 0, 3032, 1412, 0, 0, 1412, 0, 1412, 0, 0, 0, 0, 1412, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3053, 0, 3055, 0, 0, 789, 3058, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1412, 0, 0, 0, 2467, 2467, 2467, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3103, 0, 3101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1834, 0, 0, 0, 1421, 3112, 0, 1412, 0, 0, 0, 1849, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 789, 0, 789, 0, 0, 3139, 3140, 0, 0, 2470, 0, 0, 1414, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1827, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1412, 3148, 1412, 0, 0, 0, 0, 0, 0, 0, 0, 3162, 0, 0, 0, 0, 0, 0, 0, 0, 3166, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3177, 3179, 0, 1689, 0, 3179, 0, 1814, 0, 789, 3190, 3191, 3192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1412, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3210, 3211, 3212, 3213, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1412, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1412, 1414, 3230, 3231, 3232, 0, 0, 0, 0, 1689, 0, 0, 3245, 0, 0, 0, 0, 0, 1412, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1689, 0, 0, 0, 0, 2366, 0, 2525, 0, 0, 0, 1882, 2531, 0, 3262, 0, 3264, 0, 0, 3268, 0, 0, 0, 0, 0, 1689, 1689, 0, 1689, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1412, 3292, 0, 0, 0, 0, 1814, 0, 0, 3296, 0, 0, 0, 0, 0, 0, 1412, 0, 0, 0, 0, 1689, 0, 0, 0, 0, 0, 1412, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1689, 0, 0, 0, 0, 0, 0, 0, 0, 3368, 1421, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1412, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3397, 0, 0, 3400, 0, 0, 0, 0, 1412, 1414, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1412, 0, 3438, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3448, 0, 0, 0, 1689, 0, 0, 0, 0, 0, 1827, 789, 0, 0, 1414, 0, 1689, 0, 0, 1689, 1412, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1414, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1421, 0, 0, 0, 0, 0, 3478, 0, 0, 0, 0, 0, 0, 0, 789, 0, 3482, 0, 0, 0, 0, 0, 3483, 0, 3484, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3502, 3503, 0, 1412, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1414, 0, 2388, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3531, 0, 1882, 3534, 0, 3536, 0, 1414, 0, 0, 0, 0, 0, 0, 3540, 0, 0, 0, 0, 0, 3545, 1814, 0, 3548, 0, 0, 0, 1414, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3589, 1414, 0, 0, 0, 0, 3596, 2467, 0, 0, 1412, 0, 0, 0, 0, 0, 0, 0, 0, 1814, 0, 0, 0, 0, 0, 0, 0, 1814, 0, 0, 3608, 0, 0, 0, 0, 1421, 1108, 0, 0, 0, 0, 0, 1168, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1414, 3648, 0, 3649, 0, 0, 0, 0, 0, 0, 3651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3660, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3666, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3677, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3680, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3710, 3711, 3712, 3713, 3714, 3715, 3716, 3717, 0, 0, 0, 0, 1412, 3723, 0, 0, 0, 0, 0, 0, 3732, 3733, 0, 3735, 3736, 3737, 3738, 3739, 3740, 3741, 0, 0, 0, 0, 0, 0, 0, 0, 3749, 0, 3751, 3752, 0, 0, 0, 0, 0, 0, 0, 1412, 0, 2470, 2470, 2470, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1414, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3795, 3797, 3799, 0, 0, 3802, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1882, 1415, 0, 2531, 0, 2531, 0, 0, 0, 0, 1882, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1412, 0, 0, 0, 0, 0, 1689, 0, 0, 0, 0, 1412, 0, 0, 0, 1421, 0, 0, 3855, 3856, 0, 0, 3179, 0, 0, 0, 0, 0, 0, 1689, 0, 1689, 0, 2366, 2366, 3001, 0, 0, 2366, 1827, 1827, 1827, 1689, 0, 0, 0, 0, 0, 0, 1689, 0, 0, 0, 0, 1689, 1882, 0, 0, 0, 0, 1689, 0, 0, 0, 0, 1689, 0, 0, 0, 0, 0, 0, 0, 0, 1689, 0, 0, 3886, 2366, 2366, 0, 1689, 0, 0, 0, 0, 0, 0, 1415, 0, 0, 0, 0, 1689, 0, 0, 0, 0, 0, 0, 1689, 0, 1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689, 0, 0, 1421, 0, 1421, 0, 0, 0, 0, 0, 0, 1412, 3904, 3906, 0, 0, 0, 1417, 0, 1414, 0, 0, 0, 1414, 1414, 3913, 0, 1689, 0, 0, 0, 3918, 3919, 0, 0, 3921, 0, 1412, 3924, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1412, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1421, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2467, 0, 0, 0, 0, 2467, 0, 0, 0, 0, 2467, 0, 0, 0, 0, 1421, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1412, 2531, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3974, 0, 0, 0, 0, 0, 0, 2531, 1414, 0, 0, 0, 1689, 0, 0, 0, 0, 3993, 3994, 3995, 3996, 0, 0, 0, 0, 0, 0, 0, 0, 1417, 0, 1418, 0, 0, 0, 0, 0, 0, 0, 0, 4007, 4008, 4009, 4010, 0, 4012, 4013, 0, 0, 0, 0, 0, 0, 0, 1415, 0, 0, 4022, 4023, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1421, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1827, 1827, 0, 1827, 0, 2531, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1421, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1412, 0, 0, 0, 0, 0, 1415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1414, 0, 0, 0, 0, 0, 0, 0, 1418, 0, 0, 0, 1421, 4069, 0, 0, 0, 0, 0, 4083, 0, 0, 0, 0, 0, 0, 0, 0, 4089, 0, 0, 0, 1421, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4108, 0, 0, 0, 0, 0, 0, 0, 0, 1421, 0, 0, 0, 1415, 0, 0, 0, 0, 0, 0, 0, 0, 4125, 0, 1417, 0, 0, 0, 0, 0, 1689, 1414, 1415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1412, 1421, 0, 0, 0, 0, 0, 0, 1415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1419, 0, 0, 0, 0, 0, 0, 0, 0, 1415, 1417, 0, 0, 0, 0, 0, 0, 4151, 0, 0, 0, 1827, 2470, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1827, 0, 0, 0, 0, 0, 0, 0, 0, 1417, 0, 0, 0, 1414, 0, 4174, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1882, 0, 0, 1415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1412, 0, 0, 1689, 0, 0, 1418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1412, 0, 0, 0, 4212, 4213, 4214, 0, 0, 4216, 0, 0, 0, 1417, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1419, 1689, 0, 0, 0, 1417, 0, 1689, 0, 1412, 0, 0, 1418, 0, 0, 0, 0, 0, 0, 0, 2531, 0, 0, 3001, 3001, 1417, 2366, 0, 0, 2366, 2366, 2366, 2366, 2366, 2366, 2366, 2366, 2366, 2366, 3001, 0, 0, 0, 1412, 0, 1418, 0, 1412, 1412, 0, 1417, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1689, 0, 0, 1689, 0, 1689, 0, 0, 0, 3179, 3001, 3001, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2366, 2366, 1689, 0, 1689, 0, 0, 1689, 0, 0, 0, 0, 0, 0, 2388, 0, 0, 0, 0, 1417, 0, 0, 0, 1415, 1827, 0, 0, 0, 0, 0, 0, 0, 1418, 0, 1827, 0, 0, 0, 0, 4314, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1689, 1418, 0, 0, 0, 0, 0, 0, 0, 0, 1414, 1689, 0, 1414, 4338, 1414, 0, 0, 0, 4342, 1414, 1418, 0, 0, 0, 0, 0, 0, 0, 0, 4352, 0, 0, 0, 0, 0, 1827, 0, 1421, 0, 0, 0, 0, 0, 0, 0, 1418, 1689, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1414, 0, 0, 0, 0, 1882, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4388, 0, 0, 0, 0, 0, 1418, 0, 0, 0, 0, 0, 3179, 1414, 0, 0, 0, 1419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1827, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1417, 1419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4432, 0, 1414, 0, 1414, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1415, 0, 0, 1421, 1415, 1415, 0, 0, 0, 0, 0, 4452, 0, 0, 1421, 0, 4456, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1414, 0, 0, 0, 0, 0, 0, 4476, 4476, 1419, 0, 0, 0, 2470, 0, 0, 0, 0, 2470, 0, 2366, 0, 0, 2470, 0, 1414, 0, 0, 0, 1419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1414, 0, 0, 0, 1418, 0, 0, 0, 0, 0, 1419, 0, 0, 0, 0, 1415, 0, 0, 1414, 0, 0, 0, 0, 0, 4476, 0, 0, 0, 0, 0, 0, 0, 1421, 0, 0, 0, 0, 0, 4529, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1421, 0, 0, 0, 0, 0, 0, 0, 0, 1419, 0, 0, 0, 0, 0, 0, 0, 1421, 0, 0, 0, 1417, 0, 0, 1414, 1417, 1417, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1414, 0, 0, 1689, 4476, 0, 0, 1689, 1689, 1689, 0, 1414, 3001, 0, 0, 0, 0, 3001, 3001, 3001, 3001, 3001, 3001, 3001, 3001, 3001, 3001, 1689, 1689, 0, 0, 1421, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1689, 2366, 2366, 1689, 0, 1689, 0, 0, 1415, 1689, 3001, 3001, 0, 0, 1689, 0, 0, 1689, 0, 0, 0, 0, 0, 0, 1414, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1417, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1414, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1689, 1418, 0, 0, 0, 1418, 1418, 1689, 0, 0, 0, 1414, 0, 0, 0, 0, 0, 0, 0, 1689, 0, 0, 0, 0, 0, 0, 0, 0, 4117, 1415, 0, 0, 1419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1414, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1421, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1418, 0, 0, 1415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1417, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1414, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2531, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1417, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3001, 0, 0, 0, 0, 0, 0, 0, 1414, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1419, 0, 0, 0, 1419, 1419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1418, 0, 0, 0, 0, 0, 0, 0, 0, 1689, 1689, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2531, 0, 1417, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1689, 0, 0, 0, 2366, 0, 0, 0, 1421, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1689, 0, 1689, 0, 0, 0, 0, 3001, 3001, 1689, 0, 0, 2366, 2366, 1689, 1689, 0, 1689, 0, 0, 1689, 1418, 0, 0, 0, 0, 1421, 0, 0, 0, 0, 1415, 0, 0, 1415, 1419, 1415, 0, 0, 0, 0, 1415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1421, 0, 0, 1414, 1421, 1421, 0, 0, 0, 0, 1689, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1415, 0, 0, 0, 0, 0, 0, 0, 0, 1414, 0, 0, 0, 0, 1418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1689, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1419, 0, 0, 0, 0, 0, 0, 0, 1415, 0, 1415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1417, 0, 0, 1417, 0, 1417, 1414, 0, 0, 0, 1417, 0, 0, 0, 0, 0, 0, 1414, 0, 0, 0, 0, 0, 0, 0, 3001, 2366, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3001, 3001, 1689, 0, 0, 0, 0, 0, 1415, 0, 0, 0, 0, 0, 0, 0, 1419, 0, 0, 1417, 0, 0, 0, 0, 0, 1689, 0, 0, 0, 0, 0, 0, 0, 1415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1415, 0, 0, 0, 0, 0, 0, 1417, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1414, 0, 0, 0, 0, 1418, 0, 0, 1418, 0, 1418, 0, 1419, 0, 0, 1418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1414, 0, 0, 0, 1417, 0, 1417, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1414, 0, 0, 1415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3001, 1415, 0, 0, 1418, 0, 0, 0, 0, 0, 0, 0, 1415, 0, 0, 0, 1689, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1417, 0, 0, 0, 1414, 0, 0, 0, 0, 0, 0, 0, 1418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1417, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1417, 0, 0, 0, 0, 1415, 0, 0, 0, 0, 0, 0, 0, 0, 1689, 0, 0, 0, 1417, 0, 0, 0, 0, 0, 0, 1415, 0, 1418, 0, 1418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1415, 0, 0, 0, 0, 0, 0, 0, 1689, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1417, 0, 0, 0, 1415, 0, 0, 0, 1418, 0, 0, 0, 0, 0, 0, 0, 1417, 0, 0, 0, 1689, 0, 0, 0, 0, 1414, 1419, 1417, 0, 1419, 0, 1419, 0, 1418, 0, 0, 1419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1418, 0, 0, 1689, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1419, 0, 0, 0, 1415, 0, 0, 0, 0, 0, 1417, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1417, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1419, 0, 0, 0, 0, 0, 0, 0, 1418, 0, 0, 1414, 0, 0, 0, 1417, 0, 0, 0, 0, 0, 0, 0, 0, 1418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1417, 0, 1415, 0, 0, 0, 0, 0, 1419, 0, 1419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1414, 0, 0, 1419, 0, 1418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1417, 0, 0, 1414, 0, 0, 0, 0, 0, 0, 1419, 0, 1418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1414, 0, 0, 0, 0, 0, 0, 0, 1419, 1418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1415, 1414, 0, 0, 0, 1414, 1414, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1417, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1415, 0, 1419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1419, 0, 0, 0, 0, 0, 0, 1418, 0, 0, 0, 1419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1415, 0, 0, 0, 1418, 0, 0, 0, 1419, 0, 0, 1415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1417, 0, 0, 0, 0, 0, 0, 1419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1417, 0, 0, 0, 0, 0, 1419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1415, 0, 0, 0, 0, 0, 1419, 0, 0, 0, 0, 1418, 0, 0, 0, 0, 0, 1415, 0, 0, 0, 0, 0, 0, 1417, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1417, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1417, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1418, 0, 0, 0, 1417, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1417, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1417, 0, 0, 0, 0, 0, 0, 1419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1418, 0, 0, 0, 0, 0, 0, 1419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1418, 0, 0, 0, 0, 0, 1415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1417, 0, 0, 0, 0, 0, 0, 1419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1415, 0, 0, 0, 0, 0, 0, 0, 1417, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1419, 0, 0, 0, 1418, 0, 0, 0, 1415, 0, 0, 0, 1415, 1415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1417, 0, 0, 0, 0, 0, 0, 1419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1417, 0, 0, 0, 0, 1418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1417, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1417, 0, 0, 0, 1417, 1417, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1419, 1418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1418, 0, 0, 0, 1418, 1418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 741, 1026, 573, 1027, 1028, 1029, 624, 1030, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 2461, 220, 221, 222, 0, 1419, 0, 0, 1031, 1419, 1419, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 1032, 743, 1033, 1034, 0, 234, 235, 236, 237, 238, 1035, 1036, 239, 240, 1037, 1038, 243, 0, 244, 245, 246, 247, 1039, 0, 1040, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 263, 264, 265, 266, 267, 268, 1048, 1049, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 2462, 0, 281, 282, 1050, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 1051, 297, 298, 299, 1052, 1053, 301, 0, 302, 303, 1054, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 1055, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 1056, 1057, 0, 1058, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 1059, 755, 348, 756, 0, 349, 350, 351, 1060, 1061, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1062, 757, 1063, 367, 368, 369, 1064, 370, 371, 758, 372, 1065, 1066, 374, 1067, 376, 377, 378, 0, 379, 0, 0, 1068, 381, 382, 0, 0, 383, 384, 759, 385, 760, 1069, 387, 388, 389, 390, 391, 392, 393, 0, 394, 1070, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 1071, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 1072, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 1073, 443, 444, 445, 446, 762, 447, 1074, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 1075, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 1076, 1077, 0, 0, 471, 1078, 473, 1079, 1080, 475, 476, 477, 478, 479, 480, 481, 0, 1081, 482, 483, 484, 485, 486, 1082, 0, 487, 488, 489, 490, 491, 492, 1083, 2463, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 1093, 2464, 0, 0, 0, 0, 0, 0, 1095, 2465, 741, 1026, 573, 1027, 1028, 1029, 624, 1030, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 1031, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 1032, 743, 1033, 1034, 0, 234, 235, 236, 237, 238, 1035, 1036, 239, 240, 1037, 1038, 243, 0, 244, 245, 246, 247, 1039, 0, 1040, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 263, 264, 265, 266, 267, 268, 1048, 1049, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 1050, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 1051, 297, 298, 299, 1052, 1053, 301, 0, 302, 303, 1054, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 1055, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 1056, 1057, 0, 1058, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 1059, 755, 348, 756, 0, 349, 350, 351, 1060, 1061, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1062, 757, 1063, 367, 368, 369, 1064, 370, 371, 758, 372, 1065, 1066, 374, 1067, 376, 377, 378, 0, 379, 0, 0, 1068, 381, 382, 0, 0, 383, 384, 759, 385, 760, 1069, 387, 388, 389, 390, 391, 392, 393, 0, 394, 1070, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 1071, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 1072, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 1073, 443, 444, 445, 446, 762, 447, 1074, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 1075, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 1076, 1077, 0, 0, 471, 1078, 473, 1079, 1080, 475, 476, 477, 478, 479, 480, 481, 0, 1081, 482, 483, 484, 485, 486, 1082, 0, 487, 488, 489, 490, 491, 492, 1083, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 1093, 210, 0, 0, 0, 0, 0, 0, 1095, 2368, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 3567, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, -1491, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, -1491, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, -1491, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, -1491, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, -1491, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, -1491, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, -1491, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 0, 1388, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1175, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 0, 1389, 743, 1390, 1391, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 1392, 1393, 243, 0, 244, 245, 246, 247, 0, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 0, 263, 264, 265, 266, 267, 268, 1394, 1395, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 1050, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 0, 297, 298, 299, 0, 0, 301, 0, 302, 303, 1396, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 0, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 1868, 322, 323, 324, 325, 326, 327, 0, 328, 751, 1869, 330, 331, 332, 333, 1397, 1398, 0, 1399, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 0, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1400, 757, 1401, 367, 368, 0, 0, 370, 371, 758, 372, 0, 0, 374, 1402, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 1871, 759, 385, 760, 0, 387, 388, 389, 390, 391, 392, 393, 0, 394, 0, 396, 0, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 1403, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 0, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 1872, 445, 446, 762, 447, 1405, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 1406, 1407, 0, 0, 471, 0, 473, 0, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 0, 1408, 1873, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 0, 1388, 0, 0, 0, 0, 0, 0, 0, 515, 516, 517, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 1971, 223, 224, 0, 225, 226, 742, 227, 228, 229, 0, 1389, 743, 1390, 1391, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 1392, 1393, 243, 0, 244, 245, 246, 247, 0, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 0, 263, 264, 265, 266, 267, 268, 1394, 1395, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 1050, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 0, 297, 298, 299, 0, 0, 301, 0, 302, 303, 1396, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 0, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 1868, 322, 323, 324, 325, 326, 327, 0, 328, 751, 1869, 330, 331, 332, 333, 1397, 1398, 0, 1399, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 0, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1400, 757, 1401, 367, 368, 0, 0, 370, 371, 758, 372, 0, 0, 374, 1402, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 1871, 759, 385, 760, 0, 387, 388, 389, 390, 391, 392, 393, 0, 394, 0, 396, 0, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 1403, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 0, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 1872, 445, 446, 762, 447, 1405, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 1406, 1407, 0, 0, 471, 0, 473, 0, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 0, 1408, 1873, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 0, 741, 1026, 573, 1027, 1028, 1029, 624, 1030, 515, 516, 517, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 1031, 0, 2882, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 1032, 743, 1033, 1034, 2378, 234, 235, 236, 237, 238, 1035, 1036, 239, 240, 1037, 1038, 243, 0, 244, 245, 246, 247, 1039, 0, 1040, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 263, 264, 265, 266, 267, 268, 1048, 1049, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 1050, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 1051, 297, 298, 299, 1052, 1053, 301, 0, 302, 303, 1054, 305, 0, 306, 0, 307, 748, 2379, 749, 308, 309, 310, 0, 311, 1055, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 1056, 1057, 0, 1058, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 2380, 346, 1059, 755, 348, 756, 0, 349, 350, 351, 1060, 1061, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1062, 757, 1063, 367, 368, 369, 1064, 370, 371, 758, 372, 1065, 1066, 374, 1067, 376, 377, 378, 0, 379, 0, 0, 1068, 381, 382, 0, 0, 383, 384, 759, 385, 760, 1069, 387, 388, 389, 390, 391, 392, 393, 0, 394, 1070, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 1071, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 1072, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 1073, 443, 444, 445, 446, 762, 447, 1074, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 1075, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 1076, 1077, 0, 2381, 471, 1078, 473, 1079, 1080, 475, 476, 477, 478, 479, 480, 481, 0, 1081, 482, 483, 484, 485, 486, 1082, 0, 487, 488, 489, 490, 491, 492, 1083, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 1093, 0, 0, 0, 0, 0, 0, 0, 1095, 741, 1026, 573, 1027, 1028, 1029, 624, 1030, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 1031, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 1032, 743, 1033, 1034, 0, 234, 235, 236, 237, 238, 1035, 1036, 239, 240, 1037, 1038, 243, 0, 244, 245, 246, 247, 1039, 0, 1040, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 263, 264, 265, 266, 267, 268, 1048, 1049, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 1050, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 1051, 297, 298, 299, 1052, 1053, 301, 0, 302, 303, 1054, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 1055, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 1056, 1057, 0, 1058, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 1059, 755, 348, 756, 0, 349, 350, 351, 1060, 1061, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1062, 757, 1063, 367, 368, 369, 1064, 370, 371, 758, 372, 1065, 1066, 374, 1067, 376, 377, 378, 0, 379, 0, 0, 1068, 381, 382, 0, 0, 383, 384, 759, 385, 760, 1069, 387, 388, 389, 390, 391, 392, 393, 0, 394, 1070, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 1071, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 1072, 430, 431, 432, 433, 434, 435, 436, 437, 38, 438, 439, 440, 441, 442, 1073, 443, 444, 445, 446, 762, 447, 1074, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 1075, 0, 461, 462, 42, 463, 464, 465, 466, 467, 468, 0, 1076, 1077, 0, 0, 471, 1078, 473, 1079, 1080, 475, 476, 477, 478, 479, 480, 481, 0, 1081, 482, 483, 484, 485, 486, 1082, 0, 487, 488, 489, 490, 491, 965, 1083, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 47, 500, 501, 502, 503, 504, 505, 506, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 1093, 0, 0, 0, 0, 0, 0, 0, 1095, 741, 1026, 573, 1027, 1028, 1029, 624, 1030, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 1031, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 1032, 743, 1033, 1034, 0, 234, 235, 236, 237, 238, 1035, 1036, 239, 240, 1037, 1038, 243, 0, 244, 245, 246, 247, 1039, 0, 1040, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 263, 264, 265, 266, 267, 268, 1048, 1049, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 1050, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 1051, 297, 298, 299, 1052, 1053, 301, 0, 302, 303, 1054, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 1055, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 1056, 1057, 0, 1058, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 1059, 755, 348, 756, 0, 349, 350, 351, 1060, 1061, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1062, 757, 1063, 367, 368, 369, 1064, 370, 371, 758, 372, 1065, 1066, 374, 1067, 376, 377, 378, 0, 379, 0, 0, 1068, 381, 382, 0, 0, 383, 384, 759, 385, 760, 1069, 387, 388, 389, 390, 391, 392, 393, 0, 394, 1070, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 1071, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 1072, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 1073, 443, 444, 445, 446, 762, 447, 1074, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 1075, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 1076, 1077, 0, 0, 471, 1078, 473, 1079, 1080, 475, 476, 477, 478, 479, 480, 481, 0, 1081, 482, 483, 484, 485, 486, 1082, 0, 487, 488, 489, 490, 491, 492, 1083, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 1093, 0, 0, 0, 0, 0, 1595, 2326, 1095, 741, 1026, 573, 1027, 1028, 1029, 624, 1030, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 1031, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 1032, 743, 1033, 1034, 0, 234, 235, 236, 237, 238, 1035, 1036, 239, 240, 1037, 1038, 243, 0, 244, 245, 246, 247, 1039, 0, 1040, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 263, 264, 265, 266, 267, 268, 1048, 1049, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 1050, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 1051, 297, 298, 299, 1052, 1053, 301, 0, 302, 303, 1054, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 1055, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 1056, 1057, 0, 1058, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 1059, 755, 348, 756, 0, 349, 350, 351, 1060, 1061, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1062, 757, 1063, 367, 368, 369, 1064, 370, 371, 758, 372, 1065, 1066, 374, 1067, 376, 377, 378, 0, 379, 0, 0, 1068, 381, 382, 0, 0, 383, 384, 759, 385, 760, 1069, 387, 388, 389, 390, 391, 392, 393, 0, 394, 1070, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 1071, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 1072, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 1073, 443, 444, 445, 446, 762, 447, 1074, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 1075, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 1076, 1077, 0, 0, 471, 1078, 473, 1079, 1080, 475, 476, 477, 478, 479, 480, 481, 0, 1081, 482, 483, 484, 485, 486, 1082, 0, 487, 488, 489, 490, 491, 492, 1083, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 1093, 1094, 0, 0, 0, 0, 0, 0, 1095, 741, 1026, 573, 1027, 1028, 1029, 624, 1030, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 1031, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 1032, 743, 1033, 1034, 0, 234, 235, 236, 237, 238, 1035, 1036, 239, 240, 1037, 1038, 243, 0, 244, 245, 246, 247, 1039, 0, 1040, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 263, 264, 265, 266, 267, 268, 1048, 1049, 271, 1167, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 1050, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 1051, 297, 298, 299, 1052, 1053, 301, 0, 302, 303, 1054, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 1055, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 1056, 1057, 0, 1058, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 1059, 755, 348, 756, 0, 349, 350, 351, 1060, 1061, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1062, 757, 1063, 367, 368, 369, 1064, 370, 371, 758, 372, 1065, 1066, 374, 1067, 376, 377, 378, 0, 379, 0, 0, 1068, 381, 382, 0, 0, 383, 384, 759, 385, 760, 1069, 387, 388, 389, 390, 391, 392, 393, 0, 394, 1070, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 1071, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 1072, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 1073, 443, 444, 445, 446, 762, 447, 1074, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 1075, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 1076, 1077, 0, 0, 471, 1078, 473, 1079, 1080, 475, 476, 477, 478, 479, 480, 481, 0, 1081, 482, 483, 484, 485, 486, 1082, 0, 487, 488, 489, 490, 491, 492, 1083, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 1093, 0, 0, 0, 0, 0, 0, 0, 1095, 741, 1026, 573, 1027, 1028, 1029, 624, 1030, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 1844, 220, 221, 222, 0, 0, 0, 0, 1031, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 1032, 743, 1033, 1034, 0, 234, 235, 236, 237, 238, 1035, 1036, 239, 240, 1037, 1038, 243, 0, 244, 245, 246, 247, 1039, 0, 1040, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 263, 264, 265, 266, 267, 268, 1048, 1049, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 1050, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 1051, 297, 298, 299, 1052, 1053, 301, 0, 302, 303, 1054, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 1055, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 1056, 1057, 0, 1058, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 1059, 755, 348, 756, 0, 349, 350, 351, 1060, 1061, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1062, 757, 1063, 367, 368, 369, 1064, 370, 371, 758, 372, 1065, 1066, 374, 1067, 376, 377, 378, 0, 379, 0, 0, 1068, 381, 382, 0, 0, 383, 384, 759, 385, 760, 1069, 387, 388, 389, 390, 391, 392, 393, 0, 394, 1070, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 1071, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 1072, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 1073, 443, 444, 445, 446, 762, 447, 1074, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 1075, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 1076, 1077, 0, 0, 471, 1078, 473, 1079, 1080, 475, 476, 477, 478, 479, 480, 481, 0, 1081, 482, 483, 484, 485, 486, 1082, 0, 487, 488, 489, 490, 491, 492, 1083, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 1093, 0, 0, 0, 0, 0, 0, 0, 1095, 741, 1026, 573, 1027, 1028, 1029, 624, 1030, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 1031, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 1032, 743, 1033, 1034, 0, 234, 235, 236, 237, 238, 1035, 1036, 239, 240, 1037, 1038, 243, 0, 244, 245, 246, 247, 1039, 0, 1040, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 263, 264, 265, 266, 267, 268, 1048, 1049, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 1050, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 1051, 297, 298, 299, 1052, 1053, 301, 0, 302, 303, 1054, 305, 0, 306, 0, 307, 748, 2379, 749, 308, 309, 310, 0, 311, 1055, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 1056, 1057, 0, 1058, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 1059, 755, 348, 756, 0, 349, 350, 351, 1060, 1061, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1062, 757, 1063, 367, 368, 369, 1064, 370, 371, 758, 372, 1065, 1066, 374, 1067, 376, 377, 378, 0, 379, 0, 0, 1068, 381, 382, 0, 0, 383, 384, 759, 385, 760, 1069, 387, 388, 389, 390, 391, 392, 393, 0, 394, 1070, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 1071, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 1072, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 1073, 443, 444, 445, 446, 762, 447, 1074, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 1075, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 1076, 1077, 0, 0, 471, 1078, 473, 1079, 1080, 475, 476, 477, 478, 479, 480, 481, 0, 1081, 482, 483, 484, 485, 486, 1082, 0, 487, 488, 489, 490, 491, 492, 1083, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 1093, 0, 0, 0, 0, 0, 0, 0, 1095, 741, 1026, 573, 1027, 1028, 1029, 624, 1030, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 1031, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 1032, 743, 1033, 1034, 0, 234, 235, 236, 237, 238, 1035, 1036, 239, 240, 1037, 1038, 243, 0, 244, 245, 246, 247, 1039, 0, 1040, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 263, 264, 265, 266, 267, 268, 1048, 1049, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 1050, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 1051, 297, 298, 299, 1052, 1053, 301, 0, 302, 303, 1054, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 1055, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 1056, 1057, 0, 1058, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 1059, 755, 348, 756, 0, 349, 350, 351, 1060, 1061, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1062, 757, 1063, 367, 368, 369, 1064, 370, 371, 758, 372, 1065, 1066, 374, 1067, 376, 377, 378, 0, 379, 0, 0, 1068, 381, 382, 0, 0, 383, 384, 759, 385, 760, 1069, 387, 388, 389, 390, 391, 392, 393, 0, 394, 1070, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 1071, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 1072, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 1073, 443, 444, 445, 446, 762, 447, 1074, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 1075, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 1076, 1077, 0, 0, 471, 1078, 473, 1079, 1080, 475, 476, 477, 478, 479, 480, 481, 0, 1081, 482, 483, 484, 485, 486, 1082, 0, 487, 488, 489, 490, 491, 492, 1083, 3597, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 1093, 0, 0, 0, 0, 0, 0, 0, 1095, 741, 1026, 573, 1027, 1028, 1029, 624, 1030, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 1031, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 1032, 743, 1033, 1034, 0, 234, 235, 236, 237, 238, 1035, 1036, 239, 240, 1037, 1038, 243, 0, 244, 245, 246, 247, 1039, 0, 1040, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 263, 264, 265, 266, 267, 268, 1048, 1049, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 1050, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 1051, 297, 298, 299, 1052, 1053, 301, 0, 302, 303, 1054, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 1055, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 1056, 1057, 0, 1058, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 1059, 755, 348, 756, 0, 349, 350, 351, 1060, 1061, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1062, 757, 1063, 367, 368, 369, 1064, 370, 371, 758, 372, 1065, 1066, 374, 1067, 376, 377, 378, 0, 379, 0, 0, 1068, 381, 382, 0, 0, 383, 384, 759, 385, 760, 1069, 387, 388, 389, 390, 391, 392, 393, 0, 394, 1070, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 1071, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 1072, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 1073, 443, 444, 445, 446, 762, 447, 1074, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 1075, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 1076, 1077, 0, 0, 471, 1078, 473, 1079, 1080, 475, 476, 477, 478, 479, 480, 481, 0, 1081, 482, 483, 484, 485, 486, 1082, 0, 487, 488, 489, 490, 491, 492, 1083, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 1093, 0, 0, 0, 0, 0, 0, 0, 1095, 741, 1026, 573, 1027, 1028, 1029, 624, 1030, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 1031, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 1032, 743, 1033, 1034, 0, 234, 235, 236, 237, 238, 1035, 1036, 239, 240, 1037, 1038, 243, 0, 244, 245, 246, 247, 1039, 0, 1040, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 3607, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 263, 264, 265, 266, 267, 268, 1048, 1049, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 1050, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 1051, 297, 298, 299, 1052, 1053, 301, 0, 302, 303, 1054, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 1055, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 1056, 1057, 0, 1058, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 1059, 755, 348, 756, 0, 349, 350, 351, 1060, 1061, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1062, 757, 1063, 367, 368, 369, 1064, 370, 371, 758, 372, 1065, 1066, 374, 1067, 376, 377, 378, 0, 379, 0, 0, 1068, 381, 382, 0, 0, 383, 384, 759, 385, 760, 1069, 387, 388, 389, 390, 391, 392, 393, 0, 394, 1070, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 1071, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 1072, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 1073, 443, 444, 445, 446, 762, 447, 1074, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 1075, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 1076, 1077, 0, 0, 471, 1078, 473, 1079, 1080, 475, 476, 477, 478, 479, 480, 481, 0, 1081, 482, 483, 484, 485, 486, 1082, 0, 487, 488, 489, 490, 491, 492, 1083, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 1093, 0, 0, 0, 0, 0, 0, 0, 1095, 741, 1026, 573, 1027, 1028, 1029, 624, 1030, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 1031, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 1032, 743, 1033, 1034, 0, 234, 235, 236, 237, 238, 1035, 1036, 239, 240, 1037, 1038, 243, 0, 244, 245, 246, 247, 1039, 0, 1040, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 263, 264, 265, 266, 267, 268, 1048, 1049, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 1050, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 1051, 297, 298, 299, 1052, 1053, 301, 0, 302, 303, 1054, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 1055, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 1056, 1057, 0, 1058, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 1059, 755, 348, 756, 0, 349, 350, 351, 1060, 1061, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1062, 757, 1063, 367, 368, 369, 1064, 370, 371, 758, 372, 1065, 1066, 374, 1067, 376, 377, 378, 0, 379, 0, 0, 1068, 381, 382, 0, 0, 383, 384, 759, 385, 760, 1069, 387, 388, 389, 390, 391, 392, 393, 0, 394, 1070, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 1071, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 1072, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 1073, 443, 444, 445, 446, 762, 447, 1074, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 1075, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 1076, 1077, 0, 0, 471, 1078, 473, 1079, 1080, 475, 476, 477, 478, 479, 480, 481, 0, 1081, 482, 483, 484, 485, 486, 1082, 0, 487, 488, 489, 490, 491, 492, 1083, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 3896, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 1093, 0, 0, 0, 0, 0, 0, 0, 1095, 741, 1026, 573, 1027, 1028, 1029, 624, 1030, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 1031, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 1032, 743, 1033, 1034, 0, 234, 235, 236, 237, 238, 1035, 1036, 239, 240, 1037, 1038, 243, 0, 244, 245, 246, 247, 1039, 0, 1040, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 263, 264, 265, 266, 267, 268, 1048, 1049, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 1050, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 1051, 297, 298, 299, 1052, 1053, 301, 0, 302, 303, 1054, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 1055, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 1056, 1057, 0, 1058, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 1059, 755, 348, 756, 0, 349, 350, 351, 1060, 1061, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1062, 757, 1063, 367, 3905, 369, 1064, 370, 371, 758, 372, 1065, 1066, 374, 1067, 376, 377, 378, 0, 379, 0, 0, 1068, 381, 382, 0, 0, 383, 384, 759, 385, 760, 1069, 387, 388, 389, 390, 391, 392, 393, 0, 394, 1070, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 1071, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 1072, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 1073, 443, 444, 445, 446, 762, 447, 1074, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 1075, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 1076, 1077, 0, 0, 471, 1078, 473, 1079, 1080, 475, 476, 477, 478, 479, 480, 481, 0, 1081, 482, 483, 484, 485, 486, 1082, 0, 487, 488, 489, 490, 491, 492, 1083, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 1093, 0, 0, 0, 0, 0, 0, 0, 1095, 741, 1026, 573, 1027, 1028, 1029, 624, 1030, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 1031, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 4473, 1032, 743, 1033, 1034, 0, 234, 235, 236, 237, 238, 1035, 1036, 239, 240, 1037, 1038, 243, 0, 244, 245, 246, 247, 1039, 0, 1040, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 4474, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 263, 264, 265, 266, 267, 268, 1048, 1049, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 1050, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 1051, 297, 298, 299, 1052, 1053, 301, 0, 302, 303, 1054, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 1055, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 1056, 1057, 0, 1058, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 1059, 755, 348, 756, 0, 349, 350, 351, 1060, 1061, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1062, 757, 1063, 367, 368, 369, 1064, 370, 371, 758, 372, 1065, 1066, 374, 1067, 376, 377, 378, 0, 379, 0, 0, 1068, 381, 382, 0, 0, 383, 384, 759, 385, 760, 1069, 387, 388, 389, 390, 391, 392, 393, 0, 394, 1070, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 1071, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 1072, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 1073, 443, 444, 445, 446, 762, 447, 1074, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 1075, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 1076, 1077, 0, 0, 471, 1078, 473, 1079, 1080, 475, 476, 477, 478, 4475, 480, 481, 0, 1081, 482, 483, 484, 485, 486, 1082, 0, 487, 488, 489, 490, 491, 492, 1083, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 1093, 0, 0, 0, 0, 0, 0, 0, 1095, 741, 1026, 573, 1027, 1028, 1029, 624, 1030, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 1031, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 1032, 743, 1033, 1034, 0, 234, 235, 236, 237, 238, 1035, 1036, 239, 240, 1037, 1038, 243, 0, 244, 245, 246, 247, 1039, 0, 1040, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 4474, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 263, 264, 265, 266, 267, 268, 1048, 1049, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 1050, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 1051, 297, 298, 299, 1052, 1053, 301, 0, 302, 303, 1054, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 1055, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 1056, 1057, 0, 1058, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 1059, 755, 348, 756, 0, 349, 350, 351, 1060, 1061, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1062, 757, 1063, 367, 368, 369, 1064, 370, 371, 758, 372, 1065, 1066, 374, 1067, 376, 377, 378, 0, 379, 0, 0, 1068, 381, 382, 0, 0, 383, 384, 759, 385, 760, 1069, 387, 388, 389, 390, 391, 392, 393, 0, 394, 1070, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 1071, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 1072, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 1073, 443, 444, 445, 446, 762, 447, 1074, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 1075, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 1076, 1077, 0, 0, 471, 1078, 473, 1079, 1080, 475, 476, 477, 478, 4475, 480, 481, 0, 1081, 482, 483, 484, 485, 486, 1082, 0, 487, 488, 489, 490, 491, 492, 1083, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 1093, 0, 0, 0, 0, 0, 0, 0, 1095, 741, 1026, 573, 1027, 1028, 1029, 624, 1030, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 1031, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 1032, 743, 1033, 1034, 0, 234, 235, 236, 237, 238, 1035, 1036, 239, 240, 1037, 1038, 243, 0, 244, 245, 246, 247, 1039, 0, 1040, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 263, 264, 265, 266, 267, 268, 1048, 1049, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 1050, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 1051, 297, 298, 299, 1052, 1053, 301, 0, 302, 303, 1054, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 1055, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 1056, 1057, 0, 1058, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 1059, 755, 348, 756, 0, 349, 350, 351, 1060, 1061, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1062, 757, 1063, 367, 368, 369, 0, 370, 371, 758, 372, 1065, 1066, 374, 1067, 376, 377, 378, 0, 379, 0, 0, 1068, 381, 382, 0, 0, 383, 384, 759, 385, 760, 1069, 387, 388, 389, 390, 391, 392, 393, 0, 394, 1070, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 1071, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 1072, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 1073, 443, 444, 445, 446, 762, 447, 1074, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 1075, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 1076, 1077, 0, 0, 471, 1078, 473, 1079, 1080, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 1082, 0, 487, 488, 489, 490, 491, 492, 1083, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 0, 2361, 2362, 0, 0, 0, 0, 0, 0, 0, 1095, 741, 1026, 573, 1027, 1028, 1029, 624, 1030, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 1031, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, -2272, 1032, 743, 1033, 1034, 0, 234, 235, 236, 237, 238, 1035, 1036, 239, 240, 1037, 1038, 243, 0, 244, 245, 246, 247, 1039, 0, 1040, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 4474, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 263, 264, 265, 266, 267, 268, 1048, 1049, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 1050, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 1051, 297, 298, 299, 1052, 1053, 301, 0, 302, 303, 1054, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 1055, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 1056, 1057, 0, 1058, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 1059, 755, 348, 0, 0, 349, 350, 351, 1060, 1061, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1062, 757, 1063, 367, 368, 369, 0, 370, 371, 758, 372, 1065, 1066, 374, 1067, 376, 377, 378, 0, 379, 0, 0, 1068, 381, 382, 0, 0, 383, 384, 759, 385, 760, 1069, 387, 388, 389, 390, 391, 392, 393, 0, 394, 1070, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 1071, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 1072, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 1073, 443, 444, 445, 446, 0, 447, 1074, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 1075, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 1076, 1077, 0, 0, 471, 1078, 473, 1079, 1080, 475, 476, 477, 478, 4475, 480, 481, 0, 1081, 482, 483, 484, 485, 486, 1082, 0, 487, 488, 489, 490, 491, 492, 1083, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 1093, 0, 0, 741, 1026, 573, 1027, 1028, 1095, 624, 1030, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 1031, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 1032, 743, 1033, 1034, 0, 234, 235, 236, 237, 238, 1035, 1036, 239, 240, 1037, 1038, 243, 0, 244, 245, 246, 247, 1039, 0, 1040, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 263, 264, 265, 266, 267, 268, 1048, 1049, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 1050, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 1051, 297, 298, 299, 1052, 1053, 301, 0, 302, 303, 1054, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 1055, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 1056, 1057, 0, 1058, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 1059, 755, 348, 756, 0, 349, 350, 351, 1060, 1061, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1062, 757, 1063, 367, 368, 369, 0, 370, 371, 758, 372, 1065, 1066, 374, 1067, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 759, 385, 760, 1069, 387, 388, 389, 390, 391, 392, 393, 0, 394, 1070, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 1071, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 1072, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 1073, 443, 444, 445, 446, 762, 447, 1074, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 1075, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 1076, 1077, 0, 0, 471, 1078, 473, 1079, 1080, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 1082, 0, 487, 488, 489, 490, 491, 492, 1083, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 741, 1026, 573, 1027, 1028, 0, 624, 1030, 0, 0, 1095, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 1031, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 1032, 743, 1033, 1034, 0, 3515, 235, 236, 237, 238, 1035, 1036, 239, 240, 1037, 1038, 243, 0, 244, 245, 246, 247, 1039, 0, 1040, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 263, 264, 265, 266, 267, 268, 1048, 1049, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 1050, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 1051, 297, 298, 299, 1052, 1053, 301, 0, 302, 303, 1054, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 1055, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 1056, 1057, 0, 1058, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 1059, 755, 348, 756, 0, 349, 350, 351, 1060, 1061, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1062, 757, 1063, 367, 368, 369, 0, 370, 371, 758, 372, 1065, 1066, 374, 1067, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 759, 385, 760, 1069, 387, 388, 389, 390, 391, 392, 393, 0, 394, 1070, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 1071, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 1072, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 1073, 443, 444, 445, 446, 762, 447, 1074, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 1075, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 1076, 1077, 0, 0, 471, 1078, 473, 1079, 1080, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 1082, 0, 487, 488, 489, 490, 491, 492, 1083, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 741, 1026, 573, 1027, 1028, 1029, 624, 1030, 0, 0, 1095, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 1031, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 0, 1032, 743, 1033, 1034, 0, 234, 235, 236, 237, 238, 1035, 1036, 239, 240, 1037, 1038, 243, 0, 244, 245, 246, 247, 1039, 0, 1040, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 263, 264, 265, 266, 267, 268, 1048, 1049, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 1050, 284, 285, 0, 286, 287, 288, 0, 289, 0, 291, 0, 292, 293, 294, 295, 1051, 297, 298, 299, 1052, 1053, 301, 0, 302, 303, 1054, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 1055, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 1056, 1057, 0, 1058, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 1059, 755, 348, 0, 0, 349, 350, 351, 1060, 1061, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1062, 757, 1063, 367, 368, 369, 0, 370, 371, 758, 372, 1065, 1066, 374, 1067, 376, 377, 378, 0, 379, 0, 0, 1068, 381, 382, 0, 0, 383, 384, 759, 385, 760, 1069, 387, 388, 389, 390, 391, 392, 393, 0, 394, 1070, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 1071, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 1072, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 1073, 443, 444, 445, 446, 0, 447, 1074, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 1075, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 1076, 1077, 0, 0, 471, 1078, 473, 1079, 1080, 475, 476, 477, 478, 479, 480, 481, 0, 1081, 482, 483, 484, 485, 486, 1082, 0, 487, 488, 489, 490, 491, 492, 1083, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 1093, 0, 0, 0, 0, 0, 0, 0, 1095, 741, 1026, 573, 1027, 1028, 1029, 624, 1030, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 1031, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 0, 1032, 743, 1033, 1034, 0, 234, 235, 236, 237, 238, 1035, 1036, 239, 240, 1037, 1038, 243, 0, 244, 245, 246, 247, 1039, 0, 1040, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 263, 264, 265, 266, 267, 268, 1048, 1049, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 1050, 284, 285, 0, 286, 287, 288, 0, 289, 0, 291, 0, 292, 293, 294, 295, 1051, 297, 298, 299, 1052, 1053, 301, 0, 302, 303, 1054, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 1055, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 1056, 1057, 0, 1058, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 1059, 755, 348, 0, 0, 349, 350, 351, 1060, 1061, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1062, 757, 1063, 367, 368, 369, 0, 370, 371, 758, 372, 1065, 1066, 374, 1067, 376, 377, 378, 0, 379, 0, 0, 1068, 381, 382, 0, 0, 383, 384, 759, 385, 760, 1069, 387, 388, 389, 390, 391, 392, 393, 0, 394, 1070, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 1071, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 1072, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 1073, 443, 444, 445, 446, 0, 447, 1074, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 1075, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 1076, 1077, 0, 0, 471, 1078, 473, 1079, 1080, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 1082, 0, 487, 488, 489, 490, 491, 492, 1083, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 741, 2361, 2362, 0, 0, 0, 0, 0, 0, 0, 1095, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 231, 743, 232, 233, 0, 234, 235, 236, 237, 238, 0, 1036, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 1039, 0, 1040, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 1052, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 1055, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 3073, 344, 345, 0, 346, 1059, 755, 348, 756, 0, 349, 350, 351, 1060, 1061, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 757, 366, 367, 368, 369, 0, 370, 371, 758, 372, 0, 1066, 374, 375, 376, 377, 378, 0, 379, 0, 706, 380, 381, 382, 0, 0, 383, 384, 759, 385, 760, 1069, 387, 388, 389, 390, 391, 392, 393, 0, 394, 1070, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 429, 3074, 431, 432, 433, 434, 435, 436, 437, 38, 438, 439, 440, 441, 442, 1073, 443, 444, 445, 446, 762, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 1075, 0, 461, 462, 42, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 1078, 473, 1079, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 1082, 0, 487, 488, 489, 490, 491, 965, 493, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 47, 500, 501, 502, 503, 504, 505, 506, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 741, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3075, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 231, 743, 232, 233, 0, 234, 235, 236, 237, 238, 0, 1036, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 1039, 0, 1040, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 1052, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 1055, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 3073, 344, 345, 0, 346, 1059, 755, 348, 756, 0, 349, 350, 351, 1060, 1061, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 757, 366, 367, 368, 369, 0, 370, 371, 758, 372, 0, 1066, 374, 375, 376, 377, 378, 0, 379, 0, 706, 380, 381, 382, 0, 0, 383, 384, 759, 385, 760, 1069, 387, 388, 389, 390, 391, 392, 393, 0, 394, 1070, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 429, 3074, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 1073, 443, 444, 445, 446, 762, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 1075, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 1078, 473, 1079, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 1082, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 741, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3075, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 231, 743, 232, 233, 0, 234, 235, 236, 237, 238, 0, 1036, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 1039, 0, 1040, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 1052, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 1055, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 1059, 755, 348, 756, 0, 349, 350, 351, 1060, 1061, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 757, 366, 367, 368, 369, 0, 370, 371, 758, 372, 0, 1066, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 759, 385, 760, 1069, 387, 388, 389, 390, 391, 392, 393, 0, 394, 1070, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 429, 3074, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 1073, 443, 444, 445, 446, 762, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 1075, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 1078, 473, 1079, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 1082, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 741, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 231, 743, 232, 233, 0, 234, 235, 236, 237, 238, 0, 1036, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 1039, 0, 1040, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 1052, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 1055, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 1059, 755, 348, 756, 0, 349, 350, 351, 1060, 1061, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 757, 366, 367, 368, 369, 0, 370, 371, 758, 372, 0, 1066, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 759, 385, 760, 1069, 387, 388, 389, 390, 391, 392, 393, 0, 394, 1070, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 1073, 443, 444, 445, 446, 762, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 1075, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 1078, 473, 1079, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 1082, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 784, 1282, 573, 0, 0, 0, 624, 0, 0, 0, 3632, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 231, 743, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 1527, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 757, 366, 367, 368, 369, 0, 370, 371, 758, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 1528, 0, 380, 381, 382, 0, 0, 383, 384, 759, 385, 760, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 762, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 1529, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 784, 636, 1283, 4049, 0, 0, 0, 0, 0, 0, 4050, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 3, 4, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 231, 743, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 757, 366, 367, 368, 369, 0, 370, 371, 758, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 759, 385, 760, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 38, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 762, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 42, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 965, 493, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 47, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 741, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 231, 743, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 757, 366, 367, 368, 369, 0, 370, 371, 758, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 759, 385, 760, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 762, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4205, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 38, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 42, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 965, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 47, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1151, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2516, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3551, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 0, 0, 0, 0, 0, 0, 0, 1388, 1282, 573, 0, 0, 794, 624, 0, 0, 0, 3947, 211, 212, 213, 214, 215, 216, 217, 218, 1732, 220, 221, 222, 1733, 1734, 1735, 1736, 1737, 1738, 1739, 223, 224, 1740, 225, 226, 742, 227, 228, 229, 0, 1389, 743, 1390, 1391, 1741, 234, 235, 236, 237, 238, 1742, 1743, 239, 240, 1392, 1393, 243, 1744, 244, 245, 246, 247, 0, 1745, 744, 1746, 249, 250, 251, 252, 745, 253, 254, 1747, 255, 256, 257, 258, 259, 260, 1748, 746, 261, 262, 1749, 1750, 1751, 747, 1752, 1753, 1754, 263, 264, 265, 266, 267, 268, 1394, 1395, 271, 1755, 272, 1756, 273, 274, 275, 276, 277, 1757, 278, 279, 280, 1758, 1759, 281, 282, 1050, 284, 285, 1760, 286, 287, 288, 1761, 289, 290, 291, 1762, 292, 293, 294, 295, 0, 297, 298, 299, 0, 1763, 301, 1764, 302, 303, 1396, 305, 1765, 306, 1766, 307, 748, 1767, 749, 308, 309, 310, 1768, 311, 0, 1769, 313, 1770, 314, 315, 316, 317, 318, 750, 319, 320, 321, 1771, 322, 323, 324, 325, 326, 327, 1772, 328, 751, 0, 330, 331, 332, 333, 1397, 1398, 1773, 1399, 1774, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 1775, 344, 345, 1776, 346, 0, 755, 348, 756, 1777, 349, 350, 351, 1778, 1779, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1400, 757, 1401, 367, 368, 0, 1780, 370, 371, 758, 372, 1781, 0, 374, 1402, 376, 377, 378, 1782, 379, 1783, 1784, 3312, 381, 382, 1785, 1786, 383, 0, 759, 385, 760, 0, 387, 388, 389, 390, 391, 392, 393, 1787, 394, 0, 396, 0, 398, 399, 400, 1788, 401, 402, 403, 404, 405, 406, 407, 408, 1403, 410, 411, 412, 413, 1789, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 1790, 425, 426, 761, 427, 428, 0, 430, 431, 432, 433, 434, 435, 436, 437, 1791, 438, 439, 440, 441, 442, 1792, 443, 1872, 445, 446, 762, 447, 1405, 449, 1793, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 1794, 461, 462, 1795, 463, 464, 465, 466, 467, 468, 1796, 1406, 1407, 1797, 1798, 471, 0, 473, 0, 1799, 475, 476, 477, 478, 479, 480, 481, 1800, 1801, 482, 483, 484, 485, 486, 1802, 1803, 487, 488, 489, 490, 491, 0, 1408, 1804, 494, 763, 495, 496, 497, 498, 1805, 1806, 499, 1807, 1808, 500, 501, 502, 503, 504, 505, 0, 0, 0, 0, 0, 0, 0, 0, 0, 515, 516, 517, 0, 0, 0, 0, 797, 798, 799, 0, 3313, 3314, 802, 803, 804, 805, 210, 0, 0, 0, 0, 794, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 795, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 796, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 0, 0, 0, 0, 797, 798, 799, 0, 800, 801, 802, 803, 804, 805, 210, 0, 0, 0, 0, 794, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 888, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 889, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 0, 0, 0, 0, 797, 798, 799, 0, 800, 801, 802, 803, 804, 805, 210, 0, 0, 0, 0, 794, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 938, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 939, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 940, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 0, 0, 0, 0, 797, 798, 799, 0, 800, 801, 802, 803, 804, 805, 210, 0, 0, 0, 0, 794, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 1373, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 1374, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 0, 0, 0, 0, 797, 798, 799, 0, 800, 801, 802, 803, 804, 805, 210, 0, 0, 0, 0, 794, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 0, 0, 0, 0, 797, 798, 799, 0, 800, 801, 802, 803, 804, 805, 210, 0, 0, 0, 0, 794, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 2593, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 2594, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 0, 0, 0, 0, 797, 798, 799, 0, 800, 801, 802, 803, 804, 805, 210, 0, 0, 0, 0, 794, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 4188, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 0, 0, 0, 1731, 797, 798, 799, 0, 800, 801, 802, 803, 804, 805, 211, 212, 213, 214, 215, 216, 217, 218, 1732, 220, 221, 222, 1733, 1734, 1735, 1736, 1737, 1738, 1739, 223, 224, 1740, 225, 226, 742, 227, 228, 229, 230, 231, 743, 232, 233, 1741, 234, 235, 236, 237, 238, 1742, 1743, 239, 240, 241, 242, 243, 1744, 244, 245, 246, 247, 248, 1745, 744, 1746, 249, 250, 251, 252, 745, 253, 254, 1747, 255, 256, 257, 258, 259, 260, 1748, 746, 261, 262, 1749, 1750, 1751, 747, 1752, 1753, 1754, 263, 264, 265, 266, 267, 268, 269, 270, 271, 1755, 272, 1756, 273, 274, 275, 276, 277, 1757, 278, 279, 280, 1758, 1759, 281, 282, 283, 284, 285, 1760, 286, 287, 288, 1761, 289, 290, 291, 1762, 292, 293, 294, 295, 296, 297, 298, 299, 300, 1763, 301, 1764, 302, 303, 304, 305, 1765, 306, 1766, 307, 748, 1767, 749, 308, 309, 310, 1768, 311, 312, 1769, 313, 1770, 314, 315, 316, 317, 318, 750, 319, 320, 321, 1771, 322, 323, 324, 325, 326, 327, 1772, 328, 751, 329, 330, 331, 332, 333, 334, 335, 1773, 336, 1774, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 1775, 344, 345, 1776, 346, 347, 755, 348, 756, 1777, 349, 350, 351, 1778, 1779, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 757, 366, 367, 368, 369, 1780, 370, 371, 758, 372, 1781, 373, 374, 375, 376, 377, 378, 1782, 379, 1783, 1784, 380, 381, 382, 1785, 1786, 383, 384, 759, 385, 760, 386, 387, 388, 389, 390, 391, 392, 393, 1787, 394, 395, 396, 397, 398, 399, 400, 1788, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 1789, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 1790, 425, 426, 761, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1791, 438, 439, 440, 441, 442, 1792, 443, 444, 445, 446, 762, 447, 448, 449, 1793, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 1794, 461, 462, 1795, 463, 464, 465, 466, 467, 468, 1796, 469, 470, 1797, 1798, 471, 472, 473, 474, 1799, 475, 476, 477, 478, 479, 480, 481, 1800, 1801, 482, 483, 484, 485, 486, 1802, 1803, 487, 488, 489, 490, 491, 492, 493, 1804, 494, 763, 495, 496, 497, 498, 1805, 1806, 499, 1807, 1808, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1809, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 1388, 0, 0, 0, 0, 0, 0, 0, 0, 0, 711, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 0, 1389, 743, 1390, 1391, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 1392, 1393, 243, 0, 244, 245, 246, 247, 0, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 0, 263, 264, 265, 266, 267, 268, 1394, 1395, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 1050, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 0, 297, 298, 299, 0, 0, 301, 0, 302, 303, 1396, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 0, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 1868, 322, 323, 324, 325, 326, 327, 0, 328, 751, 1869, 330, 331, 332, 333, 1397, 1398, 0, 1399, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 0, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1400, 757, 1401, 367, 368, 0, 0, 370, 371, 758, 372, 0, 0, 374, 1402, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 1870, 383, 1871, 759, 385, 760, 0, 387, 388, 389, 390, 391, 392, 393, 0, 394, 0, 396, 0, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 1403, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 0, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 1872, 445, 446, 762, 447, 1405, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 1406, 1407, 0, 0, 471, 0, 473, 0, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 0, 1408, 1873, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 0, 0, 0, 2122, 0, 0, 0, 0, 0, 515, 516, 517, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 1874, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 0, 1389, 743, 1390, 1391, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 1392, 1393, 243, 0, 244, 245, 246, 247, 0, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 0, 263, 264, 265, 266, 267, 268, 1394, 1395, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 1050, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 0, 297, 298, 299, 0, 0, 301, 0, 302, 303, 1396, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 0, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 1868, 322, 323, 324, 325, 326, 327, 0, 328, 751, 1869, 330, 331, 332, 333, 1397, 1398, 0, 1399, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 0, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1400, 757, 1401, 367, 368, 0, 0, 370, 371, 758, 372, 0, 0, 374, 1402, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 1870, 383, 1871, 759, 385, 760, 0, 387, 388, 389, 390, 391, 392, 393, 0, 394, 0, 396, 0, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 1403, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 0, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 1872, 445, 446, 762, 447, 1405, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 1406, 1407, 0, 0, 471, 0, 473, 0, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 0, 1408, 1873, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 0, 0, 0, 210, 0, 0, 0, 0, 0, 515, 516, 517, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 1874, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 784, 1282, 573, 0, 0, 0, 624, 0, 0, 0, 4234, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 231, 743, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 1721, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 1527, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 757, 366, 367, 368, 369, 0, 370, 371, 758, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 1528, 0, 380, 381, 382, 0, 0, 383, 384, 759, 385, 760, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 762, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 1529, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 784, 1282, 573, 0, 0, 0, 624, 0, 636, 1283, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 231, 743, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 1726, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 1527, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 757, 366, 367, 368, 369, 0, 370, 371, 758, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 1528, 0, 380, 381, 382, 0, 0, 383, 384, 759, 385, 760, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 762, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 1529, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 784, 1282, 573, 0, 0, 0, 624, 0, 636, 1283, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 231, 743, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 1527, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 757, 366, 367, 368, 369, 0, 370, 371, 758, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 1528, 0, 380, 381, 382, 0, 0, 383, 384, 759, 385, 760, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 762, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 1529, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 624, 0, 636, 1283, 0, 211, 625, 213, 214, 215, 216, 217, 218, 626, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 627, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 628, 304, 305, 0, 306, 0, 629, 0, 630, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 631, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 632, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 633, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 634, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 635, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 1731, 4538, 573, 0, 0, 0, 624, 0, 636, 637, 0, 211, 212, 213, 214, 215, 216, 217, 218, 1732, 220, 221, 222, 1733, 1734, 1735, 1736, 1737, 1738, 1739, 223, 224, 1740, 225, 226, 742, 227, 228, 229, 230, 231, 743, 232, 233, 1741, 234, 235, 236, 237, 238, 1742, 1743, 239, 240, 241, 242, 243, 1744, 244, 245, 246, 247, 248, 1745, 744, 1746, 249, 250, 251, 252, 745, 253, 254, 1747, 255, 256, 257, 258, 259, 260, 1748, 746, 261, 262, 1749, 1750, 1751, 747, 1752, 1753, 1754, 263, 264, 265, 266, 267, 268, 269, 270, 271, 1755, 272, 1756, 273, 274, 275, 276, 277, 1757, 278, 279, 280, 1758, 1759, 281, 282, 283, 284, 285, 1760, 286, 287, 288, 1761, 289, 290, 291, 1762, 292, 293, 294, 295, 296, 297, 298, 299, 300, 1763, 301, 1764, 302, 303, 304, 305, 1765, 306, 1766, 307, 748, 1767, 749, 308, 309, 310, 1768, 311, 312, 1769, 313, 1770, 314, 315, 316, 317, 318, 750, 319, 320, 321, 1771, 322, 323, 324, 325, 326, 327, 1772, 328, 751, 329, 330, 331, 332, 333, 334, 335, 1773, 336, 1774, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 1775, 344, 345, 1776, 346, 347, 755, 348, 756, 1777, 349, 350, 351, 1778, 1779, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 757, 366, 367, 368, 369, 1780, 370, 371, 758, 372, 1781, 373, 374, 375, 376, 377, 378, 1782, 379, 1783, 1784, 380, 381, 382, 1785, 1786, 383, 384, 759, 385, 760, 386, 387, 388, 389, 390, 391, 392, 393, 1787, 394, 395, 396, 397, 398, 399, 400, 1788, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 1789, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 1790, 425, 426, 761, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1791, 438, 439, 440, 441, 442, 1792, 443, 444, 445, 446, 762, 447, 448, 449, 1793, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 1794, 461, 462, 1795, 463, 464, 465, 466, 467, 468, 1796, 469, 470, 1797, 1798, 471, 472, 473, 474, 1799, 475, 476, 477, 478, 479, 480, 481, 1800, 1801, 482, 483, 484, 485, 486, 1802, 1803, 487, 488, 489, 490, 491, 492, 493, 1804, 494, 763, 495, 496, 497, 498, 1805, 1806, 499, 1807, 1808, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 1731, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 1732, 220, 221, 222, 1733, 1734, 1735, 1736, 1737, 1738, 1739, 223, 224, 1740, 225, 226, 742, 227, 228, 229, 230, 231, 743, 232, 233, 1741, 234, 235, 236, 237, 238, 1742, 1743, 239, 240, 241, 242, 243, 1744, 244, 245, 246, 247, 248, 1745, 744, 1746, 249, 250, 251, 252, 745, 253, 254, 1747, 255, 256, 257, 258, 259, 260, 1748, 746, 261, 262, 1749, 1750, 1751, 747, 1752, 1753, 1754, 263, 264, 265, 266, 267, 268, 269, 270, 271, 1755, 272, 1756, 273, 274, 275, 276, 277, 1757, 278, 279, 280, 1758, 1759, 281, 282, 283, 284, 285, 1760, 286, 287, 288, 1761, 289, 290, 291, 1762, 292, 293, 294, 295, 296, 297, 298, 299, 300, 1763, 301, 1764, 302, 303, 304, 305, 1765, 306, 1766, 307, 748, 1767, 749, 308, 309, 310, 1768, 311, 312, 1769, 313, 1770, 314, 315, 316, 317, 318, 750, 319, 320, 321, 1771, 322, 323, 324, 325, 326, 327, 1772, 328, 751, 329, 330, 331, 332, 333, 334, 335, 1773, 336, 1774, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 1775, 344, 345, 1776, 346, 347, 755, 348, 756, 1777, 349, 350, 351, 1778, 1779, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 757, 366, 367, 368, 369, 1780, 370, 371, 758, 372, 1781, 373, 374, 375, 376, 377, 378, 1782, 379, 1783, 1784, 380, 381, 382, 1785, 1786, 383, 384, 759, 385, 760, 386, 387, 388, 389, 390, 391, 392, 393, 1787, 394, 395, 396, 397, 398, 399, 400, 1788, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 1789, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 1790, 425, 426, 761, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1791, 438, 439, 440, 441, 442, 1792, 443, 444, 445, 446, 762, 447, 448, 449, 1793, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 1794, 461, 462, 1795, 463, 464, 465, 466, 467, 468, 1796, 469, 470, 1797, 1798, 471, 472, 473, 474, 1799, 475, 476, 477, 478, 479, 480, 481, 1800, 1801, 482, 483, 484, 485, 486, 1802, 1803, 487, 488, 489, 490, 491, 492, 493, 1804, 494, 763, 495, 496, 497, 498, 1805, 1806, 499, 1807, 1808, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 1731, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 2651, 216, 217, 218, 1732, 220, 221, 222, 1733, 1734, 1735, 1736, 1737, 1738, 1739, 223, 224, 1740, 225, 226, 742, 227, 228, 229, 230, 231, 743, 232, 233, 1741, 234, 235, 236, 237, 238, 1742, 1743, 239, 240, 241, 242, 243, 1744, 244, 245, 246, 247, 248, 1745, 744, 1746, 249, 250, 251, 252, 745, 253, 254, 1747, 255, 256, 257, 258, 259, 260, 1748, 746, 261, 262, 1749, 1750, 1751, 747, 1752, 1753, 1754, 263, 264, 265, 266, 267, 268, 269, 270, 271, 1755, 272, 1756, 273, 274, 275, 276, 277, 1757, 278, 279, 280, 1758, 1759, 281, 282, 283, 2652, 285, 1760, 286, 287, 288, 1761, 289, 290, 291, 1762, 292, 293, 294, 295, 296, 297, 298, 299, 300, 1763, 301, 1764, 302, 303, 304, 305, 1765, 306, 1766, 307, 748, 1767, 749, 308, 309, 310, 1768, 311, 312, 1769, 313, 1770, 314, 315, 316, 317, 318, 750, 319, 320, 321, 1771, 322, 323, 324, 325, 326, 327, 1772, 328, 751, 329, 330, 331, 332, 333, 334, 335, 1773, 336, 1774, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 1775, 344, 345, 1776, 346, 347, 755, 348, 756, 1777, 349, 350, 351, 1778, 1779, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 757, 366, 367, 368, 369, 1780, 370, 371, 758, 372, 1781, 373, 374, 375, 376, 377, 378, 1782, 379, 1783, 1784, 380, 381, 382, 1785, 1786, 383, 384, 759, 385, 760, 386, 387, 388, 389, 390, 391, 392, 393, 1787, 394, 395, 396, 397, 398, 399, 400, 1788, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 1789, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 1790, 425, 426, 761, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 1791, 438, 439, 440, 441, 442, 1792, 2653, 444, 445, 446, 762, 447, 448, 449, 1793, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 1794, 461, 462, 1795, 463, 464, 465, 466, 467, 468, 1796, 469, 470, 1797, 1798, 471, 472, 473, 474, 1799, 475, 476, 477, 478, 479, 480, 481, 1800, 1801, 482, 483, 484, 485, 486, 1802, 1803, 487, 488, 489, 490, 491, 492, 493, 1804, 494, 763, 495, 496, 497, 498, 1805, 1806, 499, 1807, 1808, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 741, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 231, 743, 232, 233, 0, 234, 235, 236, 237, 238, 0, 1036, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 1039, 0, 1040, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 1052, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 1055, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 1059, 755, 348, 756, 0, 349, 350, 351, 1060, 1061, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 757, 366, 367, 368, 369, 0, 370, 371, 758, 372, 0, 1066, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 759, 385, 760, 1069, 387, 388, 389, 390, 391, 392, 393, 0, 394, 1070, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 1073, 443, 444, 445, 446, 762, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 1075, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 1078, 473, 1079, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 1082, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 515, 516, 517, 784, 0, 573, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 231, 743, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 1527, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 757, 366, 367, 368, 369, 0, 370, 371, 758, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 1528, 0, 380, 381, 382, 0, 0, 383, 384, 759, 385, 760, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 762, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 1529, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 784, 0, 573, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 231, 743, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 1706, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 757, 366, 367, 368, 369, 0, 370, 371, 758, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 759, 385, 760, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 762, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 784, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 231, 743, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 2079, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 757, 366, 367, 368, 369, 0, 370, 371, 758, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 759, 385, 760, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 762, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 2080, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 784, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 3, 4, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 231, 743, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 757, 366, 367, 368, 369, 0, 370, 371, 758, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 759, 385, 760, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 762, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 784, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 810, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 231, 743, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 757, 366, 367, 368, 369, 0, 370, 371, 758, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 759, 385, 760, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 762, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 784, 0, 573, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 231, 743, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 757, 366, 367, 368, 369, 0, 370, 371, 758, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 759, 385, 760, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 762, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 784, 0, 573, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 231, 743, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 1517, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 757, 366, 367, 368, 369, 0, 370, 371, 758, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 759, 385, 760, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 762, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 784, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 231, 743, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 312, 2929, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 757, 366, 367, 368, 369, 0, 370, 371, 758, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 759, 385, 760, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 762, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 741, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 231, 743, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 757, 366, 367, 368, 369, 0, 370, 371, 758, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 759, 385, 760, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 762, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 784, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 231, 743, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 757, 366, 367, 368, 369, 0, 370, 371, 758, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 759, 385, 760, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 762, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 784, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 231, 743, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 824, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 757, 366, 367, 368, 369, 0, 370, 371, 758, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 759, 385, 760, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 762, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 784, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 231, 743, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 901, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 757, 366, 367, 368, 369, 0, 370, 371, 758, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 759, 385, 760, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 762, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 741, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 231, 743, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 921, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 757, 366, 367, 368, 369, 0, 370, 371, 758, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 759, 385, 760, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 762, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 741, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 231, 743, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 931, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 757, 366, 367, 368, 369, 0, 370, 371, 758, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 759, 385, 760, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 762, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 784, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 231, 743, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 933, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 757, 366, 367, 368, 369, 0, 370, 371, 758, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 759, 385, 760, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 762, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 784, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 231, 743, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 943, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 757, 366, 367, 368, 369, 0, 370, 371, 758, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 759, 385, 760, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 762, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 784, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 230, 231, 743, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 954, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 955, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 757, 366, 367, 368, 369, 0, 370, 371, 758, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 759, 385, 760, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 762, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 1905, 244, 245, 246, 247, 248, 0, 0, 1977, 249, 250, 251, 252, 0, 253, 254, 1906, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 1978, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 1908, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 1909, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 1910, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 1905, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 1906, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 1978, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 1908, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 2829, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 1909, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 1910, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 675, 217, 218, 643, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 644, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 676, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 645, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 646, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 643, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 644, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 2555, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 645, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 646, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 1905, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 1906, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 1978, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 1908, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 1909, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 1910, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 643, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 644, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 645, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 646, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 1554, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 1555, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 1556, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 1557, 307, 0, 0, 0, 1558, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 1559, 1560, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 1561, 434, 435, 436, 437, 0, 1562, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 1563, 463, 1564, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 1565, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 644, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 645, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 646, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 3, 4, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 2635, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 2636, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 2647, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 2648, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 564, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 565, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 669, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 670, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 671, 470, 0, 0, 672, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 700, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 701, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 702, 470, 0, 0, 703, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 706, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 818, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 706, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 914, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 1126, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 1137, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 686, 240, 241, 242, 1138, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 689, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 690, 428, 429, 430, 431, 432, 691, 434, 435, 436, 437, 0, 438, 439, 440, 441, 1130, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 693, 470, 0, 0, 694, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 695, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 1236, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 706, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 2450, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 2451, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 2452, 463, 464, 2453, 466, 2454, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 2455, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 573, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 3567, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 3581, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 3794, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 3796, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 3798, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 4191, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 658, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 667, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 686, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 687, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 688, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 689, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 690, 428, 429, 430, 431, 432, 691, 434, 435, 436, 437, 0, 438, 439, 440, 441, 692, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 693, 470, 0, 0, 694, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 695, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 718, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 790, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 814, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 826, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 879, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 893, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 926, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 945, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 947, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 949, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 952, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 958, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 686, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 689, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 690, 428, 429, 430, 431, 432, 691, 434, 435, 436, 437, 0, 438, 439, 440, 441, 1130, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 693, 470, 0, 0, 694, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 695, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 1286, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 1434, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 1464, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 1493, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 1495, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 1497, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 1589, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 1865, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 0, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 686, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 689, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 690, 428, 429, 430, 431, 432, 691, 434, 435, 436, 437, 0, 438, 439, 440, 441, 1130, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 1896, 465, 466, 467, 468, 0, 693, 470, 0, 0, 694, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 695, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 686, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 689, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 690, 428, 429, 430, 431, 432, 1963, 434, 435, 436, 437, 0, 438, 439, 440, 441, 1964, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 693, 470, 0, 0, 1965, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 695, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 2219, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 2566, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 686, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 689, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 690, 428, 429, 430, 431, 432, 691, 434, 435, 436, 437, 0, 438, 439, 440, 441, 1964, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 693, 470, 0, 0, 1965, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 695, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 2638, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 2640, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 2750, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 1388, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 0, 1389, 743, 1390, 1391, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 1392, 1393, 243, 0, 244, 245, 246, 247, 0, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 0, 263, 264, 265, 266, 267, 268, 1394, 1395, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 1050, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 0, 297, 298, 299, 0, 0, 301, 0, 302, 303, 1396, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 0, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 1868, 322, 323, 324, 325, 326, 327, 0, 328, 751, 1869, 330, 331, 332, 333, 1397, 1398, 0, 1399, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 0, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1400, 757, 1401, 367, 368, 0, 0, 370, 371, 758, 372, 0, 0, 374, 1402, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 1871, 759, 385, 760, 0, 387, 388, 389, 390, 391, 392, 393, 0, 394, 0, 396, 0, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 1403, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 0, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 1872, 445, 446, 762, 447, 1405, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 1406, 1407, 0, 0, 471, 0, 473, 0, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 0, 1408, 1873, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 0, 1388, 0, 0, 0, 0, 0, 0, 0, 515, 516, 517, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 0, 1389, 743, 1390, 1391, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 1392, 1393, 243, 0, 244, 245, 246, 247, 0, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 0, 263, 264, 265, 266, 267, 268, 1394, 1395, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 1050, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 0, 297, 298, 299, 0, 0, 301, 0, 302, 303, 1396, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 0, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 0, 330, 331, 332, 333, 1397, 1398, 0, 1399, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 0, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1400, 757, 1401, 367, 368, 0, 0, 370, 371, 758, 372, 1959, 0, 374, 1402, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 0, 759, 385, 760, 0, 387, 388, 389, 390, 391, 392, 393, 0, 394, 0, 396, 0, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 1403, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 0, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 1872, 445, 446, 762, 447, 1405, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 0, 461, 462, 3423, 463, 464, 465, 466, 467, 468, 0, 1406, 1407, 0, 0, 471, 0, 473, 0, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 0, 1408, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 0, 210, 0, 0, 0, 0, 0, 0, 0, 515, 516, 517, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 0, 227, 228, 229, 230, 231, 0, 232, 233, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 241, 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, 0, 249, 250, 251, 252, 0, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 296, 297, 298, 299, 300, 0, 301, 0, 302, 303, 304, 305, 0, 306, 0, 307, 0, 0, 0, 308, 309, 310, 0, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 0, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 0, 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, 337, 0, 0, 338, 0, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 347, 0, 348, 0, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 0, 366, 367, 368, 369, 0, 370, 371, 0, 372, 0, 373, 374, 375, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 384, 0, 385, 0, 386, 387, 388, 389, 390, 0, 392, 393, 0, 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 0, 408, 409, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 0, 427, 428, 429, 0, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 444, 445, 446, 0, 447, 448, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 469, 470, 0, 0, 471, 472, 473, 474, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 492, 493, 0, 494, 0, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 1388, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 0, 1389, 743, 1390, 1391, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 1392, 1393, 243, 0, 244, 245, 246, 247, 0, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 0, 263, 264, 265, 266, 267, 268, 1394, 1395, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 1050, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 0, 297, 298, 299, 0, 0, 301, 0, 302, 303, 1396, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 0, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 0, 330, 331, 332, 333, 1397, 1398, 0, 1399, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 0, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1400, 757, 1401, 367, 368, 2018, 0, 370, 371, 758, 372, 0, 0, 374, 1402, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 0, 759, 385, 760, 0, 387, 388, 389, 390, 391, 392, 393, 0, 394, 0, 396, 0, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 1403, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 0, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 1404, 445, 446, 762, 447, 1405, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 1406, 1407, 0, 0, 471, 0, 473, 0, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 0, 1408, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 0, 1388, 0, 0, 0, 0, 0, 0, 0, 515, 516, 517, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 0, 1389, 743, 1390, 1391, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 1392, 1393, 243, 0, 244, 245, 246, 247, 0, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 0, 263, 264, 265, 266, 267, 268, 1394, 1395, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 1050, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 0, 297, 298, 299, 0, 0, 301, 0, 302, 303, 1396, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 0, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 0, 330, 331, 332, 333, 1397, 1398, 0, 1399, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 0, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1400, 757, 1401, 367, 368, 3242, 0, 370, 371, 758, 372, 0, 0, 374, 1402, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 0, 759, 385, 760, 0, 387, 388, 389, 390, 391, 392, 393, 0, 394, 0, 396, 0, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 1403, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 0, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 1404, 445, 446, 762, 447, 1405, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 1406, 1407, 0, 0, 471, 0, 473, 0, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 0, 1408, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 0, 1388, 0, 0, 0, 0, 0, 0, 0, 515, 516, 517, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 0, 1389, 743, 1390, 1391, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 1392, 1393, 243, 0, 244, 245, 246, 247, 0, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 0, 263, 264, 265, 266, 267, 268, 1394, 1395, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 1050, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 0, 297, 298, 299, 0, 0, 301, 0, 302, 303, 1396, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 0, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 0, 330, 331, 332, 333, 1397, 1398, 0, 1399, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 0, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1400, 757, 1401, 367, 368, 0, 0, 370, 371, 758, 372, 0, 0, 374, 1402, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 0, 759, 385, 760, 0, 387, 388, 389, 390, 391, 392, 393, 0, 394, 0, 396, 0, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 1403, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 0, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 1404, 445, 446, 762, 447, 1405, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 1406, 1407, 0, 0, 471, 0, 473, 0, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 0, 1408, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 0, 1388, 0, 0, 0, 0, 0, 0, 0, 515, 516, 517, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 0, 1389, 743, 1390, 1391, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 1392, 1393, 243, 0, 244, 245, 246, 247, 0, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 0, 263, 264, 265, 266, 267, 268, 1394, 1395, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 1050, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 0, 297, 298, 299, 0, 0, 301, 0, 302, 303, 1396, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 0, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 0, 330, 331, 332, 333, 1397, 1398, 0, 1399, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 0, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1400, 757, 1401, 367, 368, 0, 0, 370, 371, 758, 372, 0, 0, 374, 1402, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 0, 759, 385, 760, 0, 387, 388, 389, 390, 391, 392, 393, 0, 394, 0, 396, 0, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 1403, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 0, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 1872, 445, 446, 762, 447, 1405, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 1406, 1407, 0, 0, 471, 0, 473, 0, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 0, 1408, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 0, 1388, 0, 0, 0, 0, 0, 0, 0, 515, 516, 517, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 0, 1389, 743, 1390, 1391, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 1392, 1393, 243, 0, 244, 245, 246, 247, 0, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 0, 263, 264, 265, 266, 267, 268, 1394, 1395, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 1050, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 0, 297, 298, 299, 0, 0, 301, 0, 302, 303, 1396, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 0, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 0, 330, 331, 332, 333, 1397, 1398, 0, 1399, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 0, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1400, 757, 1401, 367, 368, 0, 0, 370, 371, 758, 372, 0, 0, 374, 1402, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 0, 759, 385, 760, 0, 387, 388, 389, 390, 391, 392, 393, 0, 394, 0, 396, 0, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 1403, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 0, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 0, 445, 446, 762, 447, 1405, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 1406, 1407, 0, 0, 471, 0, 473, 0, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 0, 1408, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 0, 1388, 0, 0, 0, 0, 0, 0, 0, 515, 516, 517, 211, 212, 213, 214, 215, 216, 217, 218, 0, 220, 221, 222, 0, 0, 0, 0, 0, 0, 0, 223, 224, 0, 225, 226, 742, 227, 228, 229, 0, 0, 743, 0, 0, 0, 234, 235, 236, 237, 238, 0, 0, 239, 240, 0, 0, 243, 0, 244, 245, 246, 247, 0, 0, 744, 0, 249, 250, 251, 252, 745, 253, 254, 0, 255, 256, 257, 258, 259, 260, 0, 746, 261, 262, 0, 0, 0, 747, 0, 0, 0, 263, 264, 265, 266, 267, 268, 0, 0, 271, 0, 272, 0, 273, 274, 275, 276, 277, 0, 278, 279, 280, 0, 0, 281, 282, 283, 284, 285, 0, 286, 287, 288, 0, 289, 290, 291, 0, 292, 293, 294, 295, 0, 297, 298, 299, 0, 0, 301, 0, 302, 303, 0, 305, 0, 306, 0, 307, 748, 0, 749, 308, 309, 310, 0, 311, 0, 0, 313, 0, 314, 315, 316, 317, 318, 750, 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, 0, 328, 751, 0, 330, 331, 332, 333, 0, 0, 0, 0, 0, 337, 752, 753, 338, 754, 339, 340, 341, 342, 343, 0, 344, 345, 0, 346, 0, 755, 348, 756, 0, 349, 350, 351, 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 0, 757, 0, 367, 368, 0, 0, 370, 371, 758, 372, 0, 0, 374, 0, 376, 377, 378, 0, 379, 0, 0, 380, 381, 382, 0, 0, 383, 0, 759, 385, 760, 0, 387, 388, 389, 390, 391, 392, 393, 0, 394, 0, 396, 0, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 0, 410, 411, 412, 413, 0, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 425, 426, 761, 427, 428, 0, 430, 431, 432, 433, 434, 435, 436, 437, 0, 438, 439, 440, 441, 442, 0, 443, 0, 445, 446, 762, 447, 0, 449, 0, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 0, 461, 462, 0, 463, 464, 465, 466, 467, 468, 0, 0, 0, 0, 0, 471, 0, 473, 0, 0, 475, 476, 477, 478, 479, 480, 481, 0, 0, 482, 483, 484, 485, 486, 0, 0, 487, 488, 489, 490, 491, 0, 0, 0, 494, 763, 495, 496, 497, 498, 0, 0, 499, 0, 0, 500, 501, 502, 503, 504, 505, 0, 0, 0, 0, 0, 0, 0, 0, 0, 515, 516, 517 }; static const yytype_int16 yycheck[] = { 0, 0, 0, 0, 0, 0, 16, 48, 34, 545, 189, 11, 735, 574, 24, 1155, 195, 932, 687, 740, 20, 991, 20, 193, 969, 936, 43, 206, 171, 7, 179, 644, 645, 646, 941, 21, 14, 650, 1222, 188, 26, 961, 1698, 811, 1558, 816, 1660, 1860, 48, 21, 1173, 612, 834, 792, 26, 765, 592, 825, 12, 2017, 890, 873, 574, 1404, 871, 1257, 1048, 1049, 1019, 1209, 900, 694, 1077, 1361, 2608, 1421, 20, 1157, 1262, 2154, 17, 1266, 22, 2302, 2162, 1067, 2631, 1876, 1877, 2115, 2651, 42, 2653, 1276, 34, 1460, 2890, 536, 1314, 1595, 3108, 815, 2827, 1178, 2790, 819, 1824, 2070, 876, 2281, 3049, 2808, 880, 827, 2852, 922, 2516, 885, 3075, 3151, 0, 594, 2808, 3198, 892, 1205, 2458, 2463, 3147, 690, 611, 604, 2461, 2462, 902, 158, 173, 0, 3081, 1324, 173, 2879, 3424, 2869, 583, 1629, 2395, 1330, 1331, 33, 1515, 1249, 3360, 3403, 3413, 1209, 40, 0, 0, 1643, 0, 0, 0, 0, 3843, 1262, 2524, 1463, 3637, 0, 0, 0, 0, 173, 39, 1095, 0, 2509, 690, 3080, 3007, 31, 1188, 1471, 2812, 2813, 2814, 2815, 2816, 2817, 825, 0, 782, 1005, 3118, 1037, 1038, 0, 5, 2157, 66, 0, 58, 732, 5, 11, 732, 5, 3947, 1693, 3949, 5, 37, 0, 4119, 5, 5, 37, 44, 13, 1876, 1063, 18, 13, 13, 103, 79, 72, 147, 96, 969, 26, 27, 51, 16, 152, 103, 153, 0, 18, 5, 172, 22, 105, 134, 3980, 134, 4112, 22, 29, 201, 5, 5, 4265, 76, 29, 869, 58, 22, 108, 96, 5, 9, 0, 2458, 29, 127, 2610, 25, 5, 2228, 103, 2230, 2522, 83, 180, 181, 5, 5, 184, 83, 186, 11, 4, 1424, 5, 5, 35, 9, 133, 256, 68, 4065, 58, 20, 0, 103, 155, 133, 22, 205, 280, 251, 160, 9, 326, 51, 36, 5, 4193, 4194, 5, 246, 234, 40, 2509, 254, 22, 854, 110, 246, 96, 234, 22, 120, 0, 264, 9, 359, 51, 144, 103, 32, 308, 9, 108, 185, 66, 28, 381, 310, 120, 5, 256, 11, 152, 9, 22, 157, 290, 22, 133, 4003, 152, 157, 310, 151, 9, 153, 297, 1142, 78, 96, 11, 543, 152, 4, 250, 547, 236, 193, 9, 255, 172, 2984, 545, 391, 8, 4390, 558, 11, 68, 531, 338, 948, 172, 1096, 4038, 36, 76, 152, 3, 4, 5, 436, 959, 957, 9, 3008, 66, 117, 1140, 1407, 316, 236, 380, 1145, 1146, 969, 440, 172, 111, 1394, 1395, 1124, 152, 115, 438, 66, 233, 1402, 11, 592, 1937, 285, 4104, 35, 250, 5, 578, 4169, 319, 1555, 3, 3642, 172, 1559, 11, 1561, 588, 103, 1564, 68, 115, 134, 957, 36, 152, 152, 302, 76, 308, 393, 176, 392, 1370, 405, 436, 68, 234, 186, 349, 1023, 321, 236, 4238, 436, 172, 1375, 942, 319, 437, 339, 385, 440, 342, 66, 152, 1290, 199, 68, 68, 314, 2826, 328, 303, 5, 323, 8, 122, 971, 103, 350, 328, 4506, 304, 417, 172, 221, 387, 1239, 304, 436, 152, 68, 75, 396, 96, 1247, 440, 436, 1023, 400, 3141, 1594, 152, 526, 436, 297, 436, 436, 383, 158, 1237, 997, 1665, 371, 3224, 310, 8, 379, 1872, 11, 96, 1007, 4400, 1882, 359, 3224, 359, 4424, 172, 1310, 300, 1312, 423, 328, 1020, 436, 1320, 1392, 1393, 359, 1365, 334, 125, 1386, 1364, 303, 1401, 334, 386, 193, 1302, 574, 575, 1305, 1306, 434, 436, 334, 612, 438, 1287, 1654, 436, 1137, 1359, 190, 1549, 436, 303, 359, 379, 1145, 1146, 436, 440, 525, 390, 381, 400, 735, 616, 4329, 3845, 391, 400, 346, 3538, 3808, 2559, 214, 193, 402, 4510, 379, 177, 1519, 3154, 436, 611, 612, 611, 3571, 349, 423, 1429, 3575, 3562, 1700, 252, 440, 1629, 422, 1137, 432, 350, 437, 534, 439, 438, 1371, 538, 437, 436, 439, 1643, 436, 625, 439, 627, 436, 629, 3382, 1556, 436, 436, 658, 635, 555, 3859, 439, 625, 1565, 627, 610, 629, 3485, 1294, 3561, 639, 1297, 635, 636, 637, 1256, 1196, 612, 679, 1196, 436, 3397, 1593, 1486, 1595, 686, 439, 4417, 689, 690, 691, 436, 436, 854, 1605, 3412, 724, 435, 1609, 839, 724, 436, 3617, 22, 440, 390, 1617, 1618, 269, 436, 850, 439, 432, 655, 402, 427, 428, 436, 436, 1630, 1631, 4391, 3341, 193, 434, 4185, 436, 440, 438, 98, 1641, 427, 428, 724, 422, 726, 726, 726, 726, 726, 726, 252, 359, 439, 2031, 440, 346, 2527, 436, 2529, 3073, 436, 3075, 2770, 427, 428, 2773, 2774, 359, 1890, 2777, 427, 428, 436, 25, 1292, 2783, 3094, 710, 349, 910, 400, 396, 439, 1950, 18, 3975, 246, 2847, 714, 359, 359, 252, 3982, 427, 428, 3135, 3323, 1621, 1622, 429, 430, 431, 432, 4464, 349, 165, 739, 427, 428, 440, 423, 424, 425, 359, 427, 428, 429, 430, 431, 432, 372, 440, 440, 2461, 2462, 2463, 96, 8, 380, 96, 11, 383, 152, 427, 428, 2775, 2776, 3151, 792, 340, 341, 688, 103, 18, 18, 692, 2013, 28, 781, 24, 24, 18, 154, 161, 1890, 427, 428, 429, 430, 431, 432, 4102, 120, 223, 726, 301, 226, 98, 249, 1663, 108, 5, 1467, 429, 430, 431, 432, 113, 2474, 74, 2002, 726, 51, 51, 152, 11, 120, 123, 1968, 154, 326, 3122, 250, 64, 74, 2361, 2362, 3073, 1977, 3075, 2366, 726, 726, 105, 726, 726, 726, 726, 795, 796, 772, 1562, 1563, 726, 726, 726, 726, 112, 3434, 3933, 726, 423, 424, 425, 83, 427, 428, 429, 430, 431, 432, 23, 112, 18, 165, 1481, 108, 146, 5, 24, 2406, 2407, 154, 11, 1490, 120, 120, 185, 1494, 263, 252, 817, 108, 120, 1500, 1501, 349, 317, 3, 1651, 5, 271, 3976, 825, 120, 957, 427, 428, 429, 430, 431, 432, 1518, 3894, 5, 3151, 436, 969, 319, 5, 867, 1499, 103, 1526, 250, 8, 60, 252, 11, 971, 105, 971, 223, 195, 913, 226, 254, 2195, 157, 3938, 161, 888, 889, 263, 3943, 28, 256, 3946, 349, 3934, 1002, 321, 193, 185, 974, 969, 976, 256, 978, 2790, 980, 908, 982, 983, 984, 4289, 22, 2149, 264, 989, 264, 1023, 153, 2207, 236, 120, 1491, 2808, 4279, 359, 342, 4273, 352, 301, 354, 359, 387, 1502, 300, 1031, 152, 938, 939, 98, 165, 436, 416, 131, 319, 1514, 312, 297, 1525, 297, 273, 234, 1487, 193, 326, 1051, 265, 252, 1095, 234, 70, 149, 436, 385, 249, 349, 195, 77, 349, 3859, 286, 265, 317, 42, 349, 264, 264, 359, 326, 8, 186, 436, 11, 264, 4112, 1081, 312, 60, 221, 423, 3631, 1097, 105, 241, 104, 1627, 197, 363, 223, 1095, 3834, 1107, 237, 2888, 438, 275, 165, 236, 297, 297, 3667, 193, 387, 60, 1120, 3837, 297, 627, 628, 629, 303, 303, 632, 633, 634, 400, 1292, 379, 95, 76, 103, 1137, 642, 234, 1140, 1141, 384, 326, 326, 1145, 1146, 367, 76, 326, 353, 326, 4392, 1166, 1181, 1182, 2269, 1184, 1181, 1182, 434, 1184, 193, 286, 438, 353, 241, 436, 2140, 34, 223, 103, 176, 226, 4183, 103, 1345, 416, 1140, 1981, 97, 106, 440, 1145, 1146, 198, 366, 299, 195, 2525, 131, 1181, 1182, 440, 1184, 2531, 278, 153, 317, 379, 1859, 361, 241, 4401, 314, 168, 4135, 241, 149, 172, 333, 4276, 74, 74, 4463, 436, 385, 74, 4467, 4166, 8, 252, 359, 11, 52, 3615, 263, 30, 161, 236, 440, 3983, 60, 328, 423, 424, 425, 147, 427, 428, 429, 430, 431, 432, 169, 0, 2066, 210, 36, 3571, 112, 112, 381, 3575, 42, 112, 2386, 1198, 175, 156, 4509, 222, 2392, 224, 317, 1819, 3592, 439, 3587, 236, 193, 3597, 1976, 5, 241, 1444, 4205, 1239, 66, 286, 4209, 4210, 392, 3299, 379, 1247, 130, 4309, 400, 3305, 3306, 1460, 374, 427, 428, 429, 430, 431, 432, 105, 103, 234, 4473, 440, 3466, 2034, 171, 1234, 236, 241, 266, 278, 440, 2042, 105, 2044, 2221, 214, 1318, 4006, 4072, 1283, 359, 1492, 2225, 292, 2128, 2031, 440, 252, 4006, 264, 2026, 172, 2231, 4333, 4334, 278, 342, 1499, 1302, 1480, 161, 1305, 1306, 189, 1515, 142, 2052, 5, 1489, 427, 428, 429, 430, 431, 432, 2177, 2178, 2179, 2180, 132, 2120, 416, 297, 2361, 2362, 330, 4083, 2189, 2366, 103, 5, 179, 4089, 331, 1271, 280, 4400, 155, 4551, 2085, 1323, 1383, 172, 297, 214, 3571, 223, 299, 2084, 3575, 423, 424, 425, 363, 427, 428, 429, 430, 431, 432, 173, 265, 265, 193, 194, 374, 265, 1371, 2406, 2407, 256, 1939, 326, 234, 211, 2482, 2215, 1558, 2330, 3129, 2926, 264, 1294, 142, 277, 1297, 234, 245, 236, 348, 349, 374, 4186, 254, 44, 1332, 1333, 1334, 1335, 2554, 2624, 3396, 4196, 3224, 1446, 103, 3094, 264, 241, 239, 385, 256, 263, 352, 297, 354, 297, 3262, 359, 3264, 301, 393, 252, 3268, 1895, 1627, 972, 2379, 103, 975, 115, 977, 117, 979, 2962, 981, 1373, 1374, 377, 985, 317, 95, 1379, 326, 94, 326, 4486, 2291, 326, 353, 353, 3441, 211, 3443, 353, 107, 105, 2705, 2410, 424, 425, 263, 427, 428, 429, 430, 431, 432, 361, 326, 1975, 107, 8, 2989, 264, 11, 2992, 2993, 2994, 2995, 2996, 2997, 2998, 2999, 3000, 3001, 1423, 373, 312, 248, 4067, 310, 28, 1525, 4264, 1525, 2448, 2714, 147, 440, 130, 147, 2273, 321, 316, 156, 3022, 297, 359, 49, 403, 157, 142, 1450, 1451, 1452, 1453, 147, 2915, 400, 38, 2535, 277, 177, 385, 1535, 172, 1537, 1586, 1539, 179, 1541, 350, 1543, 184, 3051, 3052, 1547, 359, 363, 192, 59, 199, 359, 1576, 1576, 1576, 1576, 1576, 1576, 1526, 369, 2023, 436, 4120, 95, 192, 359, 2203, 189, 379, 246, 2564, 214, 3, 106, 290, 1504, 222, 3933, 224, 115, 1614, 117, 3938, 4401, 1513, 359, 423, 3943, 19, 211, 3946, 1520, 234, 234, 359, 236, 1571, 434, 381, 436, 437, 438, 156, 440, 320, 427, 428, 429, 430, 431, 432, 1607, 1608, 142, 361, 423, 4201, 264, 147, 1615, 3976, 1585, 400, 1619, 1620, 2210, 248, 440, 4197, 153, 438, 1592, 2220, 349, 256, 3878, 169, 4399, 1634, 361, 1636, 359, 174, 2807, 75, 264, 1670, 290, 2236, 2237, 297, 436, 2240, 436, 301, 106, 403, 181, 2246, 2244, 214, 1657, 440, 1659, 2595, 193, 2873, 221, 306, 2876, 3652, 3653, 196, 315, 2210, 440, 1442, 393, 297, 326, 1714, 403, 211, 1886, 208, 297, 400, 363, 1891, 301, 222, 1894, 224, 8, 125, 1461, 11, 434, 314, 3337, 236, 438, 234, 290, 312, 3755, 3756, 4456, 2244, 352, 246, 354, 2475, 1916, 326, 3933, 2304, 3816, 169, 248, 3938, 2468, 440, 3825, 252, 3943, 440, 3970, 3946, 3972, 351, 263, 76, 320, 377, 351, 4294, 3836, 115, 1668, 117, 172, 142, 285, 154, 1939, 177, 147, 2584, 11, 393, 373, 2583, 400, 1957, 363, 4112, 1930, 3976, 363, 236, 423, 349, 140, 1937, 241, 83, 4336, 299, 311, 302, 1974, 182, 400, 36, 1645, 438, 2924, 1648, 400, 130, 402, 31, 307, 400, 102, 402, 314, 400, 297, 2361, 2362, 142, 314, 264, 2366, 1999, 147, 352, 8, 354, 50, 11, 312, 66, 337, 393, 381, 284, 3179, 4166, 211, 156, 440, 227, 436, 2611, 134, 326, 28, 436, 316, 2025, 377, 351, 2472, 2029, 297, 1838, 197, 351, 175, 352, 82, 354, 2406, 2407, 2632, 269, 189, 1864, 1864, 1838, 3155, 2047, 3353, 221, 2683, 248, 2685, 1900, 264, 1902, 1821, 363, 221, 326, 4426, 2061, 236, 3024, 211, 436, 2857, 241, 175, 234, 2427, 68, 246, 214, 2074, 2866, 400, 2612, 402, 76, 308, 193, 400, 2083, 402, 26, 27, 297, 402, 3723, 314, 301, 138, 2475, 167, 3530, 264, 4112, 423, 424, 425, 248, 427, 428, 429, 430, 431, 432, 422, 256, 3587, 286, 436, 2746, 255, 3592, 326, 152, 436, 347, 3597, 286, 436, 298, 170, 147, 264, 351, 402, 297, 3031, 4, 1963, 352, 147, 354, 9, 172, 2771, 73, 252, 2676, 83, 437, 372, 167, 440, 322, 422, 57, 58, 4166, 380, 199, 167, 383, 4309, 393, 326, 297, 206, 102, 2989, 328, 4530, 2992, 2993, 2994, 2995, 2996, 2997, 2998, 2999, 3000, 3001, 2947, 400, 1949, 402, 293, 20, 3187, 2567, 363, 84, 3011, 3012, 193, 326, 80, 236, 365, 316, 134, 4041, 3022, 48, 3201, 3202, 2581, 40, 375, 434, 402, 436, 319, 1932, 1933, 1934, 84, 199, 352, 436, 354, 379, 1941, 436, 1943, 2954, 1945, 1946, 3227, 363, 422, 3051, 3052, 373, 3532, 3533, 3130, 264, 437, 2821, 374, 440, 349, 377, 436, 250, 2872, 434, 2034, 436, 255, 438, 11, 252, 4400, 2581, 2042, 436, 2044, 438, 153, 2639, 301, 2641, 2551, 2552, 305, 310, 311, 3223, 297, 3225, 311, 2899, 9, 437, 435, 36, 440, 318, 387, 440, 436, 2107, 3018, 153, 2279, 326, 181, 60, 400, 2115, 402, 400, 434, 66, 335, 437, 438, 326, 3765, 4309, 3767, 196, 343, 76, 3771, 66, 3773, 2302, 440, 435, 4084, 181, 250, 208, 440, 75, 423, 424, 425, 2040, 427, 428, 429, 430, 431, 432, 196, 436, 2951, 48, 103, 314, 105, 436, 3132, 438, 231, 431, 208, 238, 2968, 2306, 436, 5, 438, 436, 21, 2312, 10, 2137, 2176, 26, 38, 3309, 395, 250, 18, 293, 399, 400, 2988, 231, 419, 420, 124, 2745, 3152, 3153, 351, 431, 3527, 2751, 437, 35, 436, 440, 438, 437, 2204, 2100, 440, 2197, 2197, 319, 2210, 3013, 3858, 2108, 4423, 400, 4400, 402, 2113, 2163, 3879, 3880, 3881, 3882, 1010, 1011, 2955, 4006, 3402, 2799, 2800, 2801, 179, 2696, 2378, 3417, 2380, 2381, 307, 349, 310, 311, 2845, 400, 2244, 402, 319, 3049, 423, 424, 425, 393, 427, 428, 429, 430, 431, 432, 193, 194, 352, 437, 354, 307, 440, 31, 352, 2427, 354, 203, 204, 2822, 437, 2824, 195, 440, 349, 387, 437, 436, 439, 391, 437, 217, 50, 440, 438, 237, 238, 236, 400, 418, 437, 437, 241, 440, 440, 253, 115, 437, 117, 253, 440, 2198, 239, 437, 250, 437, 440, 314, 440, 2273, 381, 359, 387, 437, 82, 250, 440, 2458, 2822, 437, 2824, 140, 440, 3097, 436, 400, 253, 147, 264, 278, 2227, 2493, 2229, 4114, 2887, 38, 3451, 3452, 3453, 400, 418, 402, 2898, 292, 351, 437, 2902, 2903, 440, 2905, 195, 2907, 2908, 3959, 437, 3353, 437, 440, 418, 440, 2916, 436, 437, 44, 439, 2536, 429, 319, 2509, 437, 138, 2836, 440, 2838, 3089, 3090, 3091, 2410, 437, 437, 151, 440, 440, 2887, 3086, 437, 437, 437, 440, 440, 440, 440, 2948, 400, 437, 402, 439, 349, 50, 314, 437, 436, 170, 440, 85, 437, 437, 2578, 4213, 4214, 437, 4216, 48, 440, 3890, 351, 437, 353, 2410, 440, 152, 437, 241, 3899, 440, 374, 2323, 246, 109, 436, 82, 199, 2424, 191, 437, 387, 351, 440, 206, 437, 3916, 3917, 440, 124, 2453, 2454, 2455, 128, 400, 437, 2989, 2443, 440, 2992, 2993, 2994, 2995, 2996, 2997, 2998, 2999, 3000, 3001, 729, 436, 731, 2458, 148, 236, 437, 151, 437, 440, 2475, 440, 437, 404, 314, 440, 2512, 319, 2946, 163, 438, 436, 400, 138, 402, 436, 135, 427, 428, 429, 430, 431, 432, 326, 2489, 2489, 2489, 2489, 2489, 2489, 437, 2675, 437, 440, 314, 440, 2473, 349, 2475, 3051, 3052, 351, 2686, 3588, 2509, 170, 50, 2512, 436, 438, 437, 21, 8, 440, 437, 11, 3292, 440, 436, 314, 301, 3532, 3533, 437, 305, 437, 440, 3612, 440, 172, 311, 351, 28, 365, 4352, 387, 437, 318, 82, 440, 36, 206, 250, 375, 4063, 326, 42, 241, 400, 3576, 400, 3578, 402, 135, 335, 249, 351, 437, 68, 135, 440, 437, 343, 3380, 440, 437, 2581, 250, 440, 437, 66, 236, 440, 147, 437, 437, 437, 440, 440, 440, 400, 2765, 402, 135, 436, 209, 436, 97, 105, 3514, 284, 3426, 437, 437, 138, 440, 440, 437, 3726, 3727, 440, 3729, 381, 437, 250, 400, 440, 402, 118, 437, 437, 436, 440, 440, 395, 2790, 436, 363, 399, 129, 437, 437, 437, 440, 440, 440, 170, 437, 437, 4290, 440, 440, 437, 2808, 437, 440, 301, 440, 303, 149, 305, 436, 2657, 245, 154, 4134, 311, 437, 437, 437, 440, 440, 440, 318, 437, 437, 393, 440, 440, 316, 437, 326, 206, 440, 199, 283, 436, 60, 400, 31, 335, 236, 168, 404, 436, 236, 172, 38, 343, 2694, 2590, 38, 2592, 2593, 2594, 264, 368, 147, 393, 21, 200, 393, 236, 73, 281, 135, 135, 193, 194, 135, 436, 404, 135, 135, 135, 440, 135, 135, 250, 135, 135, 221, 3456, 135, 210, 135, 250, 135, 349, 436, 264, 3538, 54, 31, 148, 209, 147, 250, 147, 436, 395, 2915, 5, 2748, 5, 67, 436, 436, 147, 436, 236, 436, 274, 239, 436, 2929, 436, 436, 80, 5, 5, 436, 436, 297, 5, 2770, 252, 301, 2773, 2774, 436, 305, 2777, 436, 436, 2949, 436, 311, 2783, 436, 436, 281, 2926, 5, 318, 2790, 436, 191, 436, 401, 436, 436, 326, 3261, 436, 3263, 118, 261, 436, 3267, 440, 335, 436, 2808, 436, 436, 436, 129, 308, 343, 436, 3353, 440, 31, 314, 86, 209, 2822, 31, 2824, 320, 0, 3762, 2790, 147, 326, 147, 149, 248, 246, 2797, 2798, 154, 359, 314, 2802, 359, 438, 359, 359, 359, 2808, 314, 3650, 330, 359, 76, 359, 314, 349, 135, 351, 250, 318, 359, 2860, 206, 359, 3823, 241, 359, 395, 380, 250, 177, 246, 436, 359, 368, 3676, 359, 166, 2839, 436, 76, 440, 264, 135, 381, 3438, 97, 2886, 2887, 2878, 2878, 381, 3693, 3446, 3447, 3890, 359, 359, 359, 393, 48, 48, 359, 359, 3899, 221, 359, 254, 2897, 2897, 83, 359, 359, 37, 3376, 3377, 37, 359, 314, 4048, 359, 3916, 3917, 359, 250, 404, 250, 4100, 400, 3061, 440, 193, 436, 436, 436, 3073, 252, 3075, 3637, 390, 31, 30, 20, 423, 424, 425, 3747, 427, 428, 429, 430, 431, 432, 250, 135, 236, 381, 130, 436, 103, 135, 392, 246, 217, 236, 281, 31, 147, 31, 142, 199, 436, 31, 315, 147, 135, 135, 135, 135, 152, 381, 381, 135, 152, 157, 245, 359, 160, 357, 162, 240, 50, 418, 436, 2955, 436, 3532, 3533, 314, 396, 228, 228, 11, 440, 320, 326, 357, 323, 436, 436, 359, 160, 143, 3151, 3182, 2909, 189, 152, 2912, 440, 166, 361, 189, 82, 166, 328, 197, 381, 251, 3059, 437, 48, 258, 349, 3762, 75, 3035, 436, 211, 355, 359, 359, 3951, 314, 314, 3075, 440, 4159, 437, 440, 436, 381, 368, 241, 197, 241, 197, 4169, 359, 3065, 3066, 3067, 3068, 2957, 359, 3224, 359, 363, 436, 316, 3059, 393, 199, 241, 250, 248, 38, 393, 3603, 138, 333, 359, 440, 256, 3073, 249, 3075, 297, 394, 314, 359, 297, 167, 3894, 286, 3648, 359, 193, 359, 4058, 4059, 323, 31, 193, 3272, 193, 381, 3275, 381, 4221, 193, 170, 193, 249, 423, 30, 4050, 359, 359, 423, 434, 434, 359, 359, 3677, 3678, 436, 135, 147, 393, 246, 304, 323, 149, 436, 135, 436, 31, 250, 4134, 199, 400, 250, 164, 164, 147, 31, 206, 135, 250, 250, 323, 147, 440, 172, 440, 404, 172, 172, 19, 440, 158, 400, 225, 250, 48, 440, 349, 363, 245, 199, 437, 393, 152, 268, 152, 349, 236, 260, 437, 359, 437, 13, 13, 387, 379, 437, 418, 437, 304, 48, 437, 437, 437, 437, 3748, 3749, 397, 397, 211, 373, 250, 253, 4315, 437, 437, 440, 3809, 250, 418, 175, 135, 3762, 183, 359, 3383, 241, 437, 437, 437, 437, 436, 436, 436, 397, 3224, 399, 400, 436, 359, 4139, 359, 437, 423, 436, 436, 359, 135, 3950, 404, 135, 254, 301, 175, 211, 3957, 305, 269, 3247, 378, 359, 3250, 311, 3252, 3964, 359, 359, 359, 269, 318, 3722, 434, 48, 3224, 437, 438, 439, 326, 48, 48, 219, 3246, 219, 4232, 219, 359, 335, 314, 314, 3173, 3174, 3175, 3176, 314, 343, 3246, 359, 359, 4045, 359, 359, 3459, 359, 359, 236, 135, 326, 37, 359, 359, 3299, 193, 4206, 193, 314, 193, 3305, 3306, 3, 3308, 3863, 4207, 3865, 3866, 436, 434, 317, 4217, 226, 4219, 437, 368, 211, 437, 3877, 423, 437, 440, 38, 96, 299, 437, 437, 440, 4135, 249, 395, 436, 250, 31, 399, 161, 381, 381, 3343, 3344, 3345, 3346, 314, 253, 314, 314, 3313, 3314, 3890, 359, 133, 133, 193, 8, 440, 126, 11, 3324, 152, 11, 434, 58, 392, 147, 4171, 152, 256, 437, 397, 421, 160, 152, 4507, 437, 3916, 3917, 3343, 437, 437, 437, 873, 36, 436, 251, 440, 0, 436, 42, 437, 368, 437, 4306, 147, 31, 381, 381, 437, 436, 4205, 359, 359, 368, 4209, 4210, 183, 359, 314, 359, 314, 3414, 359, 66, 359, 48, 147, 66, 3411, 3411, 135, 96, 197, 4556, 368, 4363, 436, 193, 437, 3571, 437, 4564, 193, 3575, 437, 437, 436, 435, 4154, 435, 3603, 4103, 437, 436, 400, 22, 23, 323, 3977, 282, 27, 440, 440, 3351, 436, 32, 33, 34, 147, 36, 178, 404, 39, 40, 71, 42, 351, 44, 440, 359, 83, 3474, 323, 437, 436, 157, 437, 96, 152, 152, 193, 193, 193, 193, 291, 48, 4015, 398, 398, 437, 196, 3456, 259, 196, 436, 48, 4050, 437, 437, 440, 437, 436, 162, 437, 436, 436, 246, 437, 437, 423, 437, 368, 359, 152, 1005, 168, 3688, 130, 400, 172, 66, 177, 241, 423, 241, 440, 135, 440, 3700, 142, 359, 193, 435, 154, 147, 152, 381, 172, 381, 152, 193, 194, 31, 121, 157, 400, 396, 160, 400, 162, 436, 152, 436, 180, 152, 253, 436, 210, 436, 291, 386, 436, 336, 437, 437, 267, 196, 436, 399, 437, 250, 4128, 292, 359, 437, 436, 189, 436, 3571, 400, 147, 359, 3575, 4491, 110, 31, 239, 241, 220, 241, 175, 282, 134, 31, 4134, 436, 3599, 3600, 211, 252, 436, 48, 179, 180, 181, 182, 436, 184, 254, 186, 3629, 188, 437, 190, 437, 48, 193, 3610, 3610, 311, 31, 198, 436, 311, 201, 437, 437, 4184, 205, 381, 207, 436, 234, 437, 250, 248, 5, 323, 141, 282, 60, 253, 351, 256, 3623, 60, 116, 385, 31, 1140, 291, 386, 152, 8, 397, 289, 11, 147, 3623, 400, 436, 121, 177, 250, 250, 4222, 436, 440, 31, 3811, 31, 253, 253, 28, 437, 437, 436, 330, 436, 310, 48, 36, 108, 437, 5, 379, 436, 42, 310, 17, 28, 304, 134, 282, 3673, 726, 1348, 436, 2161, 2475, 8, 2009, 785, 11, 1146, 2632, 3878, 3223, 3673, 3308, 811, 66, 1203, 2078, 2788, 4224, 4048, 4363, 817, 4096, 3374, 4100, 3802, 4082, 2558, 2261, 3691, 3692, 36, 4335, 4430, 3696, 3697, 3976, 42, 4490, 349, 4377, 4376, 4447, 4274, 2562, 3745, 3746, 3366, 2152, 2152, 2652, 3218, 1447, 2859, 2146, 3755, 3756, 4495, 4564, 4077, 4556, 66, 3762, 373, 2807, 2792, 3766, 4458, 4017, 1257, 4347, 1437, 4438, 423, 424, 425, 4020, 427, 428, 429, 430, 431, 432, 26, 3459, 4182, 3415, 397, 1877, 399, 400, 2534, 3417, 998, 3933, 4290, 2749, 4472, 4558, 3938, 3762, 3970, 1290, 3972, 3943, 4331, 575, 3946, 3784, 1008, 1821, 705, 4363, 1526, 1822, 8, 168, 3977, 11, 2489, 172, 3611, 3784, 3127, 434, 3400, 718, 437, 438, 439, 2490, 3831, 1172, 3728, 1862, 28, 1190, 3976, 1191, 2501, 2517, 193, 194, 36, 2496, 1861, 4006, 3742, 2509, 42, 3075, 4167, 3577, 710, 1193, 4015, 3562, 3857, 210, 3073, 1198, 4309, 4308, 168, 3128, 2127, 3034, 172, 4137, 3026, 4422, 4421, 4413, 66, 2493, 4014, 2424, 1365, 2332, 3879, 3880, 3881, 3882, 2422, 236, 3123, 1697, 239, 193, 194, -1, -1, -1, -1, -1, -1, 1384, -1, -1, -1, 252, -1, -1, 255, -1, 210, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1404, -1, -1, -1, -1, -1, -1, -1, 4063, -1, -1, -1, -1, -1, -1, 4485, -1, -1, 239, -1, -1, -1, -1, -1, 3835, 1429, -1, -1, -1, -1, -1, 252, 3938, -1, 524, -1, -1, 3943, -1, 529, 3946, 531, -1, -1, 534, -1, 536, -1, 538, -1, -1, -1, -1, -1, -1, 545, -1, 4112, 548, 168, -1, -1, 330, 172, -1, 555, -1, -1, -1, -1, -1, -1, -1, 83, -1, -1, -1, 3961, -1, -1, -1, -1, 1486, -1, 193, 194, -1, -1, 578, -1, 4006, -1, -1, 583, -1, -1, -1, -1, 588, -1, -1, 210, 592, -1, -1, -1, -1, -1, -1, 330, -1, 4166, -1, -1, -1, -1, -1, 607, -1, -1, 130, -1, -1, -1, -1, 4041, -1, 236, 4006, -1, 239, -1, 142, -1, 4050, -1, -1, 147, 4054, -1, 4056, -1, 152, 252, 4060, 4061, 255, 157, -1, -1, 160, -1, 162, -1, -1, 423, 424, 425, -1, 427, 428, 429, 430, 431, 432, 655, -1, 3978, 3979, 3980, -1, -1, 440, -1, -1, -1, 666, 667, -1, 189, 4086, 4086, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 685, 4251, 687, 688, -1, -1, 211, 692, 424, 425, -1, 427, 428, 429, 430, 431, 432, -1, -1, -1, -1, 706, -1, -1, -1, 710, 330, -1, -1, -1, -1, 716, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 727, 248, -1, -1, -1, -1, -1, -1, -1, 256, -1, -1, 739, -1, -1, -1, 8, 4309, 4331, 11, -1, -1, 1663, 4166, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 28, -1, -1, -1, -1, -1, -1, -1, 36, -1, -1, -1, -1, -1, 42, -1, -1, -1, 781, -1, -1, 304, -1, -1, -1, -1, -1, 4111, -1, -1, 793, -1, 795, 796, -1, -1, 4225, -1, 66, -1, -1, 423, 424, 425, -1, 427, 428, 429, 430, 431, 432, -1, -1, 435, 817, -1, -1, -1, -1, 441, -1, 4389, -1, -1, -1, 4423, 349, -1, -1, -1, -1, -1, 4400, -1, -1, -1, 839, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 850, -1, -1, 373, 854, -1, 4272, 4272, -1, -1, -1, -1, -1, -1, -1, -1, -1, 867, 4433, -1, 4191, -1, -1, -1, -1, -1, -1, 397, -1, 399, 400, -1, 882, -1, -1, -1, -1, -1, 888, 889, -1, -1, -1, -1, -1, -1, -1, 4218, -1, 4220, -1, -1, -1, 168, 904, 905, 906, 172, 908, -1, 910, -1, -1, -1, 434, -1, -1, 437, 438, 439, -1, -1, -1, -1, -1, -1, -1, -1, 193, 194, -1, -1, -1, -1, -1, -1, 936, 4363, 938, 939, -1, -1, -1, -1, -1, 210, -1, -1, 8, -1, -1, 11, -1, -1, -1, -1, -1, -1, 1872, -1, -1, 961, 1876, 1877, -1, -1, -1, -1, -1, -1, -1, 236, -1, -1, 239, -1, 36, -1, -1, -1, -1, -1, 42, -1, -1, -1, -1, 252, -1, -1, 255, 991, 992, -1, -1, 4560, 996, -1, 998, -1, -1, -1, -1, -1, -1, -1, 66, -1, 4329, -1, -1, -1, -1, -1, -1, -1, 1016, -1, -1, 1019, 8, -1, 1022, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1035, -1, -1, -1, -1, 28, -1, -1, 4459, 4459, -1, -1, -1, 36, -1, -1, -1, -1, -1, 42, 4512, 4472, 4472, 4472, 4472, 4472, 4472, -1, 4384, 1064, 330, -1, 1981, 128, -1, -1, -1, -1, -1, -1, -1, -1, -1, 66, -1, -1, 4507, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1092, 1093, -1, 1095, 4512, 4512, 4512, 4512, 4512, 4512, -1, -1, -1, -1, -1, -1, 168, -1, -1, -1, 172, -1, 1114, -1, -1, -1, -1, 4507, -1, 4442, -1, -1, -1, -1, -1, -1, -1, -1, 4556, -1, -1, 193, 194, -1, -1, -1, 4564, -1, -1, -1, 4558, 4558, 4558, 4558, 4558, 4558, -1, -1, 210, 1151, -1, -1, 1154, -1, -1, -1, 423, 424, 425, -1, 427, 428, 429, 430, 431, 432, 4556, -1, -1, 4492, -1, -1, -1, 440, 4564, -1, -1, 239, 168, -1, -1, 1183, 172, -1, -1, 1187, 1188, -1, -1, -1, 252, -1, -1, -1, -1, -1, 1198, 1199, 1200, -1, -1, -1, -1, 193, 194, -1, -1, -1, -1, -1, -1, -1, 2128, -1, 1216, -1, -1, -1, -1, -1, 210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 236, 1249, -1, 239, -1, -1, -1, -1, -1, -1, -1, -1, 18, 1261, 1262, -1, 252, -1, 24, 255, 1268, -1, 330, 1271, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 1292, 2207, -1, -1, -1, -1, 1298, -1, -1, 1301, -1, -1, -1, -1, 64, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, -1, 1323, -1, -1, 8, -1, -1, 11, -1, -1, 1332, 1333, 1334, 1335, 1336, 95, -1, -1, -1, -1, 330, -1, -1, -1, 28, 1347, -1, 31, 1350, -1, -1, -1, 36, 113, -1, -1, -1, -1, 42, 1361, 120, 1363, -1, 123, -1, 427, 428, 429, 430, 431, 432, 1373, 1374, -1, -1, 2291, -1, 1379, -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 174, -1, -1, 177, -1, -1, -1, 1423, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 423, 424, 425, -1, 427, 428, 429, 430, 431, 432, -1, -1, -1, -1, 437, 1450, 1451, 1452, 1453, -1, -1, -1, -1, -1, -1, -1, -1, 1462, -1, 222, -1, 224, -1, 1468, -1, -1, 1471, -1, -1, -1, -1, 234, -1, 236, -1, 1480, -1, -1, -1, -1, -1, 168, 1487, 246, 1489, 172, -1, -1, -1, -1, -1, 254, -1, -1, 1499, -1, -1, -1, -1, 1504, 263, 264, -1, -1, -1, -1, 193, 194, 1513, -1, -1, -1, -1, -1, 1519, 1520, -1, -1, -1, 1524, -1, -1, -1, 210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 297, -1, -1, 300, 301, 302, -1, -1, -1, -1, 1549, -1, -1, -1, -1, 236, -1, 1556, 239, 1558, -1, 18, -1, 1562, 1563, -1, 1565, 24, -1, 326, -1, 252, 1571, -1, 255, -1, -1, -1, -1, 1578, 337, -1, -1, -1, -1, -1, 1585, 1586, -1, -1, 1589, -1, -1, -1, 1593, -1, 1595, -1, -1, -1, -1, -1, -1, 1602, -1, -1, 1605, 64, -1, -1, 1609, 2524, -1, -1, 2527, -1, 2529, -1, 1617, 1618, -1, 2534, -1, -1, -1, -1, 1625, 384, 1627, 1628, 1629, 1630, 1631, -1, -1, -1, -1, -1, -1, 1638, 1639, -1, 1641, -1, 1643, 1644, -1, -1, 1647, 330, -1, -1, -1, -1, -1, -1, 113, -1, -1, -1, -1, -1, -1, 120, -1, 1664, 123, -1, -1, 1668, 1669, 2584, -1, -1, 1673, -1, -1, -1, 1677, -1, 1679, 1680, 1681, 1682, 1683, 1684, 1685, 1686, 1687, -1, 1689, -1, -1, -1, -1, -1, 1695, -1, 1697, 1698, -1, -1, -1, -1, -1, 1704, -1, -1, -1, -1, -1, 2624, -1, -1, -1, -1, -1, -1, -1, -1, 177, -1, -1, -1, -1, -1, -1, 8, -1, -1, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 423, 424, 425, -1, 427, 428, 429, 430, 431, 432, -1, -1, -1, 36, -1, -1, -1, -1, -1, 42, -1, -1, -1, -1, -1, -1, -1, -1, 2683, -1, 2685, -1, -1, -1, -1, 234, -1, 236, -1, -1, -1, -1, -1, 66, -1, -1, -1, 246, -1, -1, -1, -1, -1, -1, -1, 254, -1, -1, -1, -1, -1, -1, -1, -1, -1, 264, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8, -1, -1, 11, 1820, -1, 1822, -1, 1824, -1, -1, -1, -1, -1, -1, -1, 2746, -1, -1, -1, 28, -1, -1, 297, -1, -1, 300, 301, 36, -1, -1, -1, -1, 8, 42, -1, 11, -1, -1, -1, -1, 2771, -1, 1859, -1, -1, -1, -1, -1, 1865, -1, 1867, 326, 28, -1, -1, -1, -1, 66, -1, 2790, 36, -1, -1, -1, -1, -1, 42, -1, -1, 168, -1, -1, -1, 172, -1, -1, -1, 2808, 1895, -1, -1, -1, -1, 1900, -1, 1902, -1, -1, -1, -1, 66, -1, -1, -1, 193, 194, -1, -1, -1, -1, -1, -1, 1919, -1, -1, -1, -1, -1, -1, 384, -1, 210, -1, 1930, -1, 1932, 1933, 1934, -1, -1, 1937, -1, 1939, -1, 1941, -1, 1943, -1, 1945, 1946, -1, -1, 1949, -1, -1, -1, -1, 236, -1, -1, 239, 2872, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1968, -1, 252, -1, -1, 18, 2888, -1, 168, 1977, -1, 24, 172, -1, -1, -1, 1984, 2899, -1, -1, -1, 1989, -1, -1, -1, -1, -1, 1995, -1, -1, -1, -1, -1, 193, 194, -1, -1, -1, -1, -1, -1, 168, -1, -1, 2012, 172, -1, -1, 2016, 2017, 210, 64, -1, -1, -1, 2023, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 193, 194, -1, -1, -1, -1, 2040, -1, -1, -1, 236, -1, -1, 239, 330, -1, -1, 210, -1, -1, 2968, -1, -1, -1, -1, -1, 252, -1, -1, 255, -1, -1, -1, -1, 113, -1, 2070, -1, 2072, 2073, 2988, 120, -1, 236, 123, -1, 239, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 252, -1, -1, 255, -1, -1, 3013, 2100, -1, -1, -1, -1, -1, -1, -1, 2108, -1, -1, -1, -1, 2113, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2126, -1, -1, -1, -1, -1, 177, -1, -1, 3049, -1, -1, 330, -1, -1, 423, 424, 425, -1, 427, 428, 429, 430, 431, 432, -1, -1, -1, 2154, -1, -1, 2157, -1, 2159, -1, 2161, -1, -1, 2164, -1, -1, -1, -1, -1, -1, 330, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8, -1, -1, 11, -1, 234, 2190, 236, -1, -1, -1, -1, -1, -1, 2198, 2199, -1, 246, -1, -1, 28, -1, -1, -1, -1, 254, -1, -1, 36, -1, -1, -1, -1, -1, 42, 264, -1, 3135, -1, -1, -1, 2225, -1, 2227, 2228, 2229, 2230, 423, 424, 425, -1, 427, 428, 429, 430, 431, 432, -1, 66, -1, -1, 437, -1, -1, -1, 2249, -1, -1, 297, -1, -1, 300, 301, -1, -1, -1, -1, 2261, -1, -1, 423, 424, 425, -1, 427, 428, 429, 430, 431, 432, -1, -1, -1, -1, 437, -1, -1, 326, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2306, -1, -1, -1, 3224, -1, 2312, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2323, -1, -1, -1, -1, -1, -1, 2330, 2331, -1, -1, -1, -1, 2336, -1, -1, 384, -1, -1, -1, -1, 168, -1, -1, -1, 172, 18, -1, -1, -1, -1, -1, 24, -1, -1, -1, -1, -1, 2361, 2362, -1, -1, -1, 2366, -1, -1, 193, 194, -1, -1, -1, -1, -1, -1, -1, 2378, 2379, 2380, 2381, -1, -1, -1, -1, 210, -1, -1, -1, -1, 2391, -1, -1, 2394, 64, 2396, 2397, -1, -1, -1, -1, -1, -1, -1, -1, 2406, 2407, -1, -1, 2410, -1, 236, -1, -1, 239, 0, -1, -1, -1, -1, -1, -1, 2423, -1, 2425, -1, 2427, 252, 2429, 14, 255, -1, -1, -1, -1, -1, -1, -1, -1, 24, -1, 26, 27, 113, -1, -1, -1, 2448, -1, -1, 120, 2452, -1, 123, -1, -1, 41, 2458, -1, -1, 2461, 2462, 2463, -1, -1, 3380, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 61, 2478, 63, 64, -1, -1, -1, -1, 69, -1, 71, -1, -1, 2490, -1, -1, -1, -1, 2495, -1, 81, -1, 83, -1, 2501, -1, 3417, -1, -1, 330, -1, 177, 2509, -1, -1, 2512, -1, -1, 99, 2516, -1, 102, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, -1, 114, -1, 116, -1, 24, -1, 120, -1, -1, -1, -1, -1, 126, -1, -1, -1, -1, -1, -1, -1, 134, -1, 136, -1, -1, -1, -1, 2557, 142, 2559, -1, -1, -1, -1, 2564, 234, -1, 236, -1, -1, -1, -1, -1, 157, 64, -1, -1, 246, -1, -1, -1, -1, -1, -1, -1, 254, -1, -1, -1, -1, 2590, -1, 2592, 2593, 2594, 264, 18, -1, -1, 423, 424, 425, 24, 427, 428, 429, 430, 431, 432, -1, -1, 435, -1, 3527, -1, -1, -1, -1, -1, -1, -1, -1, -1, 113, 3538, -1, -1, -1, 212, 213, 120, 300, 301, 123, 218, -1, -1, -1, -1, -1, -1, -1, 64, 227, -1, 8, -1, -1, 11, -1, -1, -1, -1, -1, 238, -1, -1, 326, -1, -1, -1, -1, -1, -1, -1, 28, -1, -1, -1, -1, -1, -1, -1, 36, -1, -1, -1, -1, -1, 42, -1, -1, -1, -1, -1, 8, -1, 177, 11, -1, -1, 113, 276, -1, -1, -1, -1, -1, 120, -1, -1, 123, -1, 66, 288, 28, -1, -1, -1, 293, 294, -1, 296, 36, -1, 384, -1, 301, -1, 42, 8, -1, 306, 11, -1, 309, -1, -1, -1, 313, -1, -1, -1, -1, 318, 319, 3650, -1, -1, -1, -1, -1, 326, 66, 234, 329, 236, -1, 36, -1, -1, -1, -1, 337, 42, 177, 246, -1, -1, -1, -1, -1, 3676, -1, 254, 349, -1, -1, -1, -1, -1, -1, -1, -1, 264, 2775, 2776, -1, 66, 3693, -1, -1, 366, -1, -1, -1, -1, -1, -1, -1, -1, -1, 376, -1, -1, -1, -1, -1, 382, -1, -1, -1, -1, 387, -1, 168, -1, 297, -1, 172, 300, 301, 234, -1, 236, -1, 400, -1, -1, -1, -1, -1, -1, -1, 246, -1, -1, -1, 2828, 2829, 193, 194, 254, 3747, -1, -1, 326, -1, -1, -1, 128, -1, 264, -1, 2844, 168, -1, 210, -1, 172, -1, -1, 436, -1, -1, 439, -1, 2857, 2858, -1, -1, -1, -1, -1, -1, -1, 2866, 2867, -1, -1, 193, 194, -1, 236, -1, 297, 239, -1, 300, 301, 168, 2881, -1, -1, 172, -1, -1, 210, -1, 252, -1, -1, 255, -1, 384, -1, -1, -1, -1, -1, -1, -1, -1, -1, 326, 193, 194, -1, -1, 2909, -1, -1, 2912, 236, -1, -1, 239, -1, -1, -1, -1, -1, 210, -1, -1, -1, 2926, -1, -1, 252, -1, -1, 255, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2947, -1, -1, -1, 239, -1, -1, -1, -1, -1, 2957, -1, -1, -1, -1, 384, -1, 252, 2965, -1, 330, -1, -1, -1, -1, -1, -1, -1, 2975, -1, -1, -1, -1, 3894, 2981, -1, 2983, -1, -1, -1, -1, -1, 2989, -1, -1, 2992, 2993, 2994, 2995, 2996, 2997, 2998, 2999, 3000, 3001, -1, -1, -1, 3005, 3006, 330, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3018, -1, -1, -1, 3022, -1, -1, -1, 3026, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3036, -1, -1, 3039, -1, 3041, 330, -1, -1, -1, -1, -1, -1, -1, 3050, 3051, 3052, -1, -1, -1, 3056, -1, -1, 3059, 423, 424, 425, 3063, 427, 428, 429, 430, 431, 432, 3070, 3071, 3072, 3073, 437, 3075, 3076, -1, -1, -1, 3080, 3081, -1, -1, -1, -1, -1, 3087, -1, -1, -1, -1, 4006, 3093, 3094, -1, -1, -1, -1, -1, 423, 424, 425, -1, 427, 428, 429, 430, 431, 432, -1, -1, -1, -1, 437, -1, -1, 3117, -1, -1, -1, -1, -1, 3123, -1, -1, -1, 3127, -1, 3129, -1, -1, -1, -1, -1, -1, -1, -1, -1, 427, 428, 429, 430, 431, 432, -1, -1, -1, -1, -1, -1, 3151, 3152, 3153, -1, 3155, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3173, 3174, 3175, 3176, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4114, -1, -1, -1, 8, -1, -1, 11, 3208, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8, -1, 4135, 11, -1, 28, -1, -1, -1, -1, -1, -1, -1, 36, -1, -1, -1, -1, -1, 42, 28, -1, -1, -1, -1, -1, -1, -1, 36, -1, -1, -1, -1, -1, 42, -1, -1, -1, 4171, -1, -1, 8, -1, 66, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 66, -1, -1, 28, -1, -1, -1, -1, -1, -1, -1, 36, 3289, -1, 4205, -1, -1, 42, 4209, 4210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3340, -1, -1, -1, -1, 179, -1, -1, -1, -1, -1, 3351, -1, 3353, 188, 189, -1, -1, -1, 3359, -1, 195, -1, -1, 168, 3365, -1, -1, 172, -1, -1, -1, 206, -1, 3374, -1, -1, -1, -1, 168, -1, -1, -1, 172, -1, -1, 3386, -1, -1, 193, 194, -1, -1, -1, -1, -1, 3396, -1, -1, -1, -1, -1, 3402, -1, 193, 194, 210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3418, 3419, 168, 210, -1, -1, 172, -1, -1, -1, -1, -1, -1, -1, 236, -1, -1, 239, -1, -1, -1, -1, -1, 3441, -1, 3443, -1, 193, 194, 236, 252, -1, 239, 255, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 210, 252, -1, -1, 255, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3477, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 236, -1, -1, 239, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 252, -1, -1, 255, -1, -1, -1, -1, -1, -1, 3514, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3524, 3525, 330, -1, -1, -1, -1, -1, 3532, 3533, -1, -1, -1, 3537, -1, -1, -1, 330, -1, 3543, 3544, -1, 8, 3547, -1, 11, 3550, 3551, -1, -1, 3554, 3555, 3556, 3557, -1, -1, -1, 3561, 3562, 18, 3564, -1, 28, 3567, -1, 24, -1, 3571, -1, 8, 36, 3575, 11, -1, -1, -1, 42, 3581, 330, -1, -1, -1, -1, 3587, -1, -1, -1, -1, 3592, 28, -1, -1, -1, 3597, -1, -1, -1, 36, -1, 3603, 66, -1, -1, 42, -1, 64, -1, 3611, -1, -1, -1, 3615, -1, -1, -1, 423, 424, 425, -1, 427, 428, 429, 430, 431, 432, 3629, -1, 66, 3632, 437, 423, 424, 425, -1, 427, 428, 429, 430, 431, 432, -1, -1, -1, -1, 437, -1, -1, -1, 3652, 3653, -1, -1, -1, -1, 113, -1, -1, -1, -1, -1, -1, 120, -1, -1, 123, -1, -1, -1, -1, -1, 3674, 423, 424, 425, -1, 427, 428, 429, 430, 431, 432, -1, -1, -1, -1, 437, -1, -1, -1, -1, -1, -1, -1, 531, -1, -1, -1, -1, -1, -1, -1, -1, 168, -1, -1, 543, 172, -1, -1, 547, -1, -1, -1, -1, -1, -1, -1, -1, 177, -1, 558, -1, -1, -1, 3728, -1, -1, 193, 194, 168, -1, -1, -1, 172, -1, -1, 574, -1, 3742, -1, 578, -1, -1, -1, 210, -1, -1, -1, -1, -1, 588, 589, -1, -1, 193, 194, 594, -1, -1, -1, -1, -1, -1, -1, -1, -1, 604, -1, -1, -1, 236, 210, -1, 239, 612, 234, -1, 236, -1, -1, -1, -1, -1, -1, -1, -1, 252, 246, -1, 255, -1, -1, -1, -1, -1, 254, 3800, 236, -1, -1, 239, -1, -1, -1, -1, 264, -1, 3811, -1, -1, -1, -1, 3816, 252, -1, -1, 255, 8, -1, 3823, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3835, 3836, -1, -1, -1, -1, 28, 297, -1, -1, 300, 301, -1, -1, 36, -1, 685, -1, -1, -1, 42, 690, -1, -1, -1, -1, 3861, -1, -1, -1, -1, -1, -1, 330, 18, -1, 326, -1, -1, -1, 24, -1, -1, -1, 66, -1, -1, 716, -1, -1, -1, -1, -1, -1, -1, 3890, -1, -1, -1, -1, 330, -1, -1, -1, 3899, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 64, 3916, 3917, -1, -1, 3920, -1, -1, -1, -1, -1, -1, -1, -1, 384, -1, -1, -1, 3933, 3934, -1, -1, -1, 3938, -1, -1, -1, -1, 3943, -1, -1, 3946, 3947, -1, 3949, -1, 3951, 3952, -1, -1, -1, -1, -1, -1, -1, -1, 423, 424, 425, 113, 427, 428, 429, 430, 431, 432, 120, -1, -1, 123, 437, 3976, 3977, 3978, 3979, 3980, 168, -1, -1, -1, 172, -1, -1, 423, 424, 425, -1, 427, 428, 429, 430, 431, 432, -1, -1, -1, -1, 437, -1, -1, 839, 193, 194, -1, -1, -1, -1, -1, -1, 4014, 4015, 850, -1, -1, -1, -1, -1, -1, 210, -1, -1, -1, -1, 177, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 873, -1, -1, -1, -1, -1, -1, -1, -1, -1, 236, -1, -1, 239, -1, -1, -1, -1, -1, 4058, 4059, -1, 8, -1, 4063, 11, 252, 4066, -1, 255, -1, -1, -1, -1, -1, -1, -1, 910, 4077, -1, -1, -1, 28, -1, -1, 4084, 234, -1, 236, 4088, 36, -1, -1, -1, -1, -1, 42, -1, 246, -1, -1, 4100, -1, -1, 4103, -1, 254, -1, -1, 942, -1, -1, 4111, 4112, -1, -1, 264, -1, -1, -1, 66, -1, -1, -1, 957, -1, -1, -1, 961, -1, -1, -1, -1, -1, -1, 4134, 969, -1, 4137, -1, 4139, -1, -1, -1, 330, -1, -1, -1, -1, 297, -1, -1, 300, 301, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4162, 997, -1, -1, 4166, -1, -1, 4169, -1, 1005, -1, 1007, -1, 4175, -1, 326, -1, -1, -1, -1, -1, -1, -1, -1, 1020, -1, -1, 1023, -1, 4191, -1, -1, -1, 4195, -1, -1, -1, -1, -1, 1035, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4217, 4218, 4219, 4220, 168, -1, -1, -1, 172, -1, -1, -1, -1, 1064, -1, 4232, -1, -1, 384, 423, 424, 425, -1, 427, 428, 429, 430, 431, 432, 193, 194, -1, -1, 437, 4251, -1, -1, -1, -1, -1, -1, 1092, 1093, -1, 1095, -1, 210, -1, -1, -1, -1, -1, -1, 4270, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1114, -1, -1, -1, -1, -1, -1, -1, -1, 236, -1, -1, 239, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1137, -1, 252, 4306, -1, 255, 4309, 8, 1145, 1146, 11, -1, -1, -1, -1, -1, -1, 1154, 1155, -1, -1, -1, -1, -1, -1, -1, 4329, 28, 4331, -1, -1, -1, -1, -1, -1, 36, -1, 4340, -1, -1, -1, 42, -1, -1, -1, -1, 1183, -1, -1, -1, 1187, 1188, -1, -1, 8, -1, -1, 11, -1, -1, -1, -1, -1, -1, -1, 66, 1203, -1, -1, -1, -1, -1, 1209, -1, 28, -1, -1, -1, -1, -1, 330, 4384, 36, -1, -1, -1, 4389, -1, 42, -1, -1, -1, -1, -1, -1, -1, -1, 4400, -1, -1, 18, -1, -1, -1, -1, -1, 24, -1, -1, 4412, 4413, -1, 66, -1, 4417, -1, -1, -1, 4421, -1, 1257, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4433, -1, -1, -1, -1, -1, -1, -1, -1, 4442, -1, -1, -1, -1, -1, -1, 64, -1, -1, -1, -1, -1, -1, 1290, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 168, -1, -1, 4473, 172, -1, 423, 424, 425, -1, 427, 428, 429, 430, 431, 432, -1, 4487, -1, -1, 437, -1, 4492, -1, -1, 193, 194, -1, 113, -1, -1, -1, -1, -1, -1, 120, -1, -1, 123, -1, -1, 1345, 210, -1, -1, -1, -1, 168, -1, -1, -1, 172, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1365, -1, -1, -1, -1, -1, -1, 236, -1, -1, 239, 193, 194, -1, -1, -1, -1, -1, -1, 1384, 4551, -1, -1, 252, -1, -1, 255, 8, 210, 4560, 11, 177, -1, -1, -1, -1, -1, -1, -1, 1404, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 236, 36, -1, 239, -1, 1424, -1, 42, -1, -1, 1429, -1, -1, -1, -1, -1, 252, -1, -1, 255, -1, -1, -1, -1, -1, 1444, -1, -1, -1, -1, -1, 66, -1, -1, 234, -1, 236, -1, -1, -1, -1, 1460, -1, -1, -1, -1, 246, 330, -1, -1, -1, -1, -1, -1, 254, -1, -1, -1, -1, -1, -1, 1480, -1, -1, 264, -1, -1, 1486, -1, -1, 1489, -1, 1491, 1492, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1502, -1, -1, -1, -1, -1, -1, -1, -1, -1, 128, 330, 1514, 1515, 297, -1, -1, 300, 301, -1, -1, -1, -1, -1, 1526, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 326, -1, -1, -1, -1, -1, -1, 168, -1, -1, -1, 172, -1, 1558, 423, 424, 425, -1, 427, 428, 429, 430, 431, 432, -1, -1, -1, -1, 437, -1, -1, -1, 193, 194, -1, -1, -1, -1, -1, 190, -1, -1, -1, -1, -1, -1, -1, 198, 1593, 210, 1595, -1, -1, -1, -1, -1, 207, 1602, 384, -1, 1605, 423, 424, 425, 1609, 427, 428, 429, 430, 431, 432, -1, 1617, 1618, -1, 437, -1, -1, 239, -1, 1625, -1, -1, 1628, 1629, 1630, 1631, -1, -1, 8, -1, 252, 11, 1638, 1639, -1, 1641, -1, 1643, 1644, -1, -1, 1647, -1, -1, -1, -1, -1, -1, 28, -1, -1, -1, 32, -1, -1, -1, 36, 1663, 1664, 1665, -1, -1, 42, 1669, -1, -1, -1, 1673, -1, -1, -1, 1677, -1, 1679, 1680, 1681, 1682, 1683, 1684, 1685, 1686, 1687, -1, 1689, -1, -1, 66, -1, -1, -1, -1, 1697, 1698, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 330, 8, -1, -1, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 28, -1, 111, -1, -1, -1, -1, 8, 36, -1, 11, -1, -1, -1, 42, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 28, -1, -1, -1, -1, -1, -1, 8, 36, -1, 11, 66, -1, -1, 42, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 28, -1, -1, -1, -1, 168, -1, -1, 36, 172, -1, 66, -1, -1, 42, -1, -1, -1, -1, -1, -1, -1, 427, 428, 429, 430, 431, 432, -1, -1, 193, 194, -1, -1, -1, 1824, -1, -1, 66, -1, -1, -1, -1, -1, -1, -1, -1, 210, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8, -1, -1, 11, -1, -1, -1, -1, 147, -1, -1, -1, -1, 152, -1, -1, 236, -1, -1, 239, -1, -1, -1, -1, -1, -1, 1872, -1, 36, 168, 1876, 1877, 252, 172, 42, 255, -1, -1, -1, -1, 1886, -1, -1, -1, 1890, 1891, -1, -1, 1894, -1, -1, -1, -1, -1, 193, 194, 168, -1, 66, -1, 172, 146, -1, -1, -1, -1, -1, -1, -1, -1, 1916, 210, 524, 1919, -1, -1, -1, 529, -1, -1, -1, 193, 194, 168, 1930, -1, -1, 172, -1, -1, -1, 1937, -1, -1, -1, -1, -1, 236, 210, -1, 239, -1, -1, -1, -1, -1, -1, -1, 193, 194, 330, 1957, -1, 252, -1, -1, 255, -1, -1, -1, 128, -1, -1, -1, 236, 210, -1, 239, 1974, 1975, -1, -1, -1, -1, -1, 1981, -1, -1, -1, -1, 252, -1, -1, 255, -1, -1, -1, -1, -1, -1, -1, 236, 1998, 1999, 239, -1, 2002, -1, -1, -1, 168, 381, -1, 275, 172, -1, -1, 252, -1, -1, 255, -1, -1, -1, -1, -1, -1, -1, -1, 2025, -1, -1, -1, 2029, -1, 193, 194, -1, 273, -1, -1, 330, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2047, 210, 423, 424, 425, -1, 427, 428, 429, 430, 431, 432, -1, 666, 2061, -1, -1, 330, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2074, -1, -1, 239, 344, -1, -1, 687, -1, 2083, -1, -1, -1, -1, -1, -1, 252, 330, -1, -1, -1, 8, -1, -1, 11, -1, 706, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 28, -1, -1, 31, -1, -1, 727, -1, 36, -1, -1, 2126, -1, 2128, 42, 423, 424, 425, -1, 427, 428, 429, 430, 431, 432, -1, -1, -1, 8, -1, -1, 11, -1, -1, 2149, -1, -1, -1, 66, -1, -1, -1, 423, 424, 425, -1, 427, 428, 429, 430, 431, 432, -1, 330, -1, -1, 36, -1, -1, -1, -1, -1, 42, -1, -1, -1, -1, -1, -1, 423, 424, 425, 793, 427, 428, 429, 430, 431, 432, -1, -1, -1, -1, -1, 8, -1, 66, 11, -1, -1, -1, -1, 2207, -1, -1, 2210, -1, -1, 8, -1, -1, 11, -1, -1, 28, -1, -1, 31, -1, -1, -1, -1, 36, -1, -1, -1, -1, -1, 42, -1, -1, -1, -1, -1, -1, -1, 36, -1, -1, 2244, -1, -1, 42, -1, 2249, -1, -1, -1, -1, -1, 168, -1, 66, -1, 172, -1, -1, -1, 128, -1, 427, 428, 429, 430, 431, 432, 66, -1, -1, -1, -1, 882, -1, -1, 2279, 193, 194, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2291, -1, -1, -1, -1, -1, 210, 904, 905, 906, -1, 2302, 168, -1, -1, 2306, 172, -1, -1, -1, -1, 2312, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 236, -1, -1, 239, -1, 193, 194, 2330, 2331, -1, 128, -1, -1, 2336, -1, -1, 252, -1, -1, 255, -1, -1, 210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 168, -1, 2361, 2362, 172, -1, -1, 2366, -1, -1, -1, -1, -1, -1, 168, 239, -1, -1, 172, 2378, 2379, 2380, 2381, -1, -1, 193, 194, 2386, 252, -1, -1, 996, 2391, 2392, -1, 2394, -1, 2396, -1, 193, 194, -1, 210, -1, -1, -1, -1, 2406, 2407, -1, -1, 2410, -1, -1, 1019, -1, 210, -1, 330, -1, -1, -1, -1, -1, 2423, -1, 2425, -1, 236, -1, 2429, 239, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 252, 239, -1, 255, -1, 2448, -1, -1, -1, -1, 18, -1, -1, -1, 252, 2458, 24, -1, 2461, 2462, 2463, -1, 330, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2475, -1, -1, 2478, 189, -1, -1, -1, -1, 49, 195, -1, -1, -1, -1, 2490, -1, -1, -1, -1, 2495, 206, -1, -1, 64, -1, 2501, -1, -1, -1, -1, -1, -1, -1, 2509, 423, 424, 425, -1, 427, 428, 429, 430, 431, 432, -1, 330, -1, -1, 2524, -1, -1, 2527, -1, 2529, 95, -1, -1, -1, 2534, 330, 2536, -1, -1, -1, -1, -1, -1, -1, -1, 1151, -1, -1, 113, -1, -1, 2551, 2552, -1, -1, 120, -1, 2557, 123, -1, -1, -1, 427, 428, 429, 430, 431, 432, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2578, -1, -1, 2581, -1, -1, 2584, -1, -1, -1, -1, -1, -1, -1, -1, 1199, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 174, -1, -1, 177, -1, 423, 424, 425, -1, 427, 428, 429, 430, 431, 432, 2624, -1, -1, -1, -1, -1, -1, -1, 427, 428, 429, 430, 431, 432, -1, -1, -1, -1, -1, -1, -1, 8, -1, -1, 11, -1, -1, 2651, 2652, 2653, -1, 1261, -1, 222, -1, 224, -1, -1, 1268, -1, -1, 28, -1, -1, -1, 234, -1, 236, -1, 36, -1, 2675, -1, -1, -1, 42, -1, 246, -1, 2683, -1, 2685, 2686, -1, -1, 254, -1, -1, 1298, -1, -1, 1301, 2696, -1, 263, 264, -1, -1, -1, 66, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1336, -1, 297, -1, -1, 300, 301, 302, -1, -1, -1, -1, -1, -1, 1350, -1, 2746, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1363, -1, -1, -1, 326, -1, -1, -1, 2765, -1, -1, -1, -1, -1, 2771, 337, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8, -1, -1, 11, -1, -1, 2790, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 28, 168, -1, 2807, 2808, 172, -1, -1, 36, -1, -1, -1, -1, 18, 42, 384, -1, -1, 2822, 24, 2824, -1, -1, -1, -1, -1, 193, 194, -1, 543, -1, -1, 2836, 547, 2838, -1, -1, -1, 66, -1, -1, -1, -1, 210, 558, -1, -1, -1, -1, -1, -1, -1, 1462, -1, -1, -1, -1, -1, 1468, 64, 574, -1, -1, -1, -1, -1, -1, -1, 2872, 236, -1, -1, 239, -1, -1, 589, -1, -1, -1, -1, 594, -1, -1, 2887, 2888, 252, -1, -1, 255, -1, 604, -1, -1, -1, -1, 2899, -1, -1, 612, -1, -1, -1, -1, 270, -1, -1, -1, -1, 113, -1, -1, 2915, -1, -1, 1524, 120, -1, -1, 123, -1, -1, -1, 2926, -1, 152, 2929, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 168, -1, 2946, -1, 172, 2949, -1, -1, -1, -1, -1, -1, 1562, 1563, -1, -1, -1, -1, -1, -1, -1, 2965, -1, 330, 2968, 193, 194, -1, 1578, -1, -1, 2975, 177, -1, -1, -1, 690, 2981, -1, 2983, -1, -1, 210, -1, 2988, 2989, -1, -1, 2992, 2993, 2994, 2995, 2996, 2997, 2998, 2999, 3000, 3001, -1, -1, -1, 3005, 3006, -1, -1, -1, -1, -1, 236, 3013, -1, 239, -1, -1, 3018, -1, -1, -1, 3022, -1, 3024, -1, 3026, -1, 252, -1, -1, 255, -1, 234, -1, 236, 3036, -1, -1, 3039, -1, 3041, -1, -1, -1, 246, -1, -1, -1, 3049, 3050, 3051, 3052, 254, -1, -1, 3056, -1, -1, 3059, 423, 424, 425, 264, 427, 428, 429, 430, 431, 432, -1, -1, -1, 3073, -1, 3075, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3087, 8, 1695, -1, 11, -1, 3093, 3094, -1, 297, -1, 1704, 300, 301, -1, -1, -1, -1, -1, 330, -1, 28, -1, -1, 31, -1, -1, -1, -1, 36, 3117, -1, -1, -1, -1, 42, 3123, -1, 326, -1, -1, -1, 3129, -1, -1, -1, -1, -1, 3135, -1, -1, -1, -1, 8, -1, -1, 11, -1, -1, 66, -1, -1, -1, -1, 3151, -1, -1, -1, -1, -1, -1, -1, -1, 28, -1, -1, -1, -1, -1, -1, -1, 36, -1, -1, -1, -1, -1, 42, 18, -1, -1, -1, -1, -1, 24, 3182, 384, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 66, 423, 424, 425, -1, 427, 428, 429, 430, 431, 432, -1, -1, -1, -1, -1, 1820, -1, 1822, -1, 3218, -1, -1, 64, -1, 3223, 3224, 3225, -1, -1, -1, -1, -1, -1, 942, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 957, 168, -1, -1, -1, 172, 1859, -1, -1, -1, -1, -1, 969, -1, 3261, -1, 3263, -1, -1, -1, 3267, -1, -1, 113, -1, 3272, 193, 194, 3275, -1, 120, -1, -1, 123, -1, -1, -1, -1, -1, -1, 997, -1, -1, 210, -1, -1, -1, -1, -1, -1, 1007, -1, -1, 168, -1, -1, -1, 172, -1, -1, -1, -1, 3309, 1020, -1, -1, 1023, -1, -1, 236, -1, -1, 239, -1, -1, -1, -1, -1, 193, 194, -1, -1, -1, -1, -1, 252, -1, 177, 255, -1, -1, 189, -1, -1, -1, 210, -1, 195, -1, -1, -1, -1, -1, -1, -1, -1, 3353, -1, 206, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 236, -1, -1, 239, -1, -1, -1, -1, 3376, 3377, -1, -1, 3380, -1, -1, 3383, 252, -1, -1, 255, -1, 1995, -1, 234, -1, 236, -1, -1, -1, -1, -1, -1, -1, -1, -1, 246, -1, 8, 2012, -1, 11, -1, 330, 254, -1, -1, -1, -1, -1, 3417, 3418, 3419, -1, 264, -1, -1, -1, 28, -1, 1137, 31, -1, -1, -1, -1, 36, -1, 1145, 1146, -1, -1, 42, -1, -1, -1, -1, -1, 1155, -1, -1, -1, -1, -1, -1, -1, -1, 297, -1, -1, 300, 301, 3459, -1, -1, 330, 66, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3477, -1, -1, -1, -1, -1, 326, -1, -1, -1, -1, 356, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1209, -1, -1, -1, 423, 424, 425, -1, 427, 428, 429, 430, 431, 432, -1, 3514, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3524, 3525, -1, 3527, -1, -1, -1, -1, 3532, 3533, -1, -1, -1, 3537, 3538, -1, -1, 384, -1, 3543, 3544, -1, -1, 3547, -1, -1, 3550, -1, -1, 2159, -1, 423, 424, 425, -1, 427, 428, 429, 430, 431, 432, 168, -1, -1, -1, 172, -1, 3571, -1, -1, -1, 3575, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3587, -1, -1, 193, 194, 3592, -1, -1, -1, -1, 3597, -1, -1, -1, -1, -1, -1, -1, -1, -1, 210, -1, -1, 8, -1, -1, 11, 18, -1, -1, -1, -1, -1, 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, 28, -1, 3632, 236, -1, 1345, 239, -1, 36, -1, -1, -1, -1, -1, 42, -1, -1, -1, -1, 252, 3650, -1, 255, -1, -1, -1, -1, -1, -1, -1, 64, -1, -1, -1, -1, -1, -1, 3667, 66, 21, -1, -1, -1, -1, -1, -1, 3676, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3688, -1, -1, -1, 543, 3693, -1, -1, 547, -1, -1, -1, 3700, -1, -1, -1, -1, -1, -1, 558, -1, 113, -1, -1, -1, -1, 1424, 67, 120, -1, -1, 123, -1, -1, 3722, 574, -1, -1, -1, 330, 80, -1, -1, -1, -1, -1, 1444, -1, -1, -1, 589, -1, -1, -1, -1, 594, -1, 97, -1, 3747, -1, -1, 1460, 103, -1, 604, -1, -1, -1, -1, -1, -1, -1, 612, 3762, -1, -1, -1, 118, -1, -1, -1, 168, -1, -1, 177, 172, -1, -1, 129, -1, -1, -1, 1491, 1492, -1, -1, 137, -1, -1, -1, -1, -1, -1, 1502, -1, -1, 193, 194, 149, -1, -1, 3800, -1, 154, -1, 1514, 1515, -1, -1, 160, -1, -1, 3811, 210, -1, -1, -1, 1526, -1, -1, -1, 423, 424, 425, 175, 427, 428, 429, 430, 431, 432, 234, -1, 236, -1, -1, -1, -1, -1, 236, 690, -1, 239, 246, -1, -1, -1, 2452, -1, 200, -1, 254, -1, -1, -1, 252, -1, -1, 255, 3858, -1, 264, -1, -1, -1, -1, -1, -1, -1, -1, 221, -1, -1, -1, -1, -1, -1, -1, -1, 3878, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3890, -1, -1, 297, 3894, -1, 300, 301, -1, 3899, 252, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3916, 3917, -1, -1, 3920, -1, 326, -1, -1, -1, -1, -1, -1, 281, -1, -1, 330, 3933, -1, -1, -1, -1, 3938, -1, -1, -1, -1, 3943, -1, -1, 3946, -1, -1, -1, -1, 3951, 3952, -1, -1, 1665, 308, -1, -1, -1, 312, -1, 314, -1, -1, -1, -1, -1, 320, -1, 3970, 323, 3972, -1, -1, -1, 3976, -1, -1, -1, 384, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 348, 349, -1, 351, -1, -1, -1, 355, -1, -1, 4006, -1, -1, -1, -1, 363, -1, -1, 4014, -1, 368, -1, -1, -1, -1, -1, -1, -1, -1, 423, 424, 425, 380, 427, 428, 429, 430, 431, 432, -1, -1, -1, -1, -1, -1, 393, -1, -1, -1, -1, -1, -1, 4048, -1, 4050, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4063, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 942, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 957, -1, -1, -1, -1, -1, 4112, -1, 4114, -1, -1, -1, 969, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4134, 4135, -1, 4137, -1, 4139, -1, -1, -1, -1, -1, -1, 997, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1007, -1, -1, -1, -1, -1, 4162, -1, -1, -1, 4166, -1, -1, 1020, -1, 4171, 1023, -1, -1, -1, 1886, -1, -1, -1, 1890, 1891, -1, -1, 1894, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4201, -1, -1, -1, 4205, 1916, -1, -1, 4209, 4210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2828, 2829, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2844, -1, -1, -1, -1, -1, -1, -1, -1, 1957, -1, -1, -1, 4251, 2858, -1, -1, -1, -1, -1, -1, -1, -1, 2867, -1, -1, 1974, 1975, -1, -1, -1, -1, 4270, -1, -1, -1, -1, 2881, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1137, -1, 1998, 1999, 4290, -1, 2002, -1, 1145, 1146, -1, -1, -1, -1, -1, -1, 21, -1, 1155, -1, 4306, -1, -1, 4309, -1, -1, -1, -1, 33, 2025, -1, -1, -1, 2029, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 54, -1, 2047, -1, -1, 4340, 2947, -1, -1, -1, -1, -1, -1, 67, -1, -1, 2061, -1, -1, -1, -1, -1, 76, 1209, -1, -1, 80, -1, 4363, 2074, -1, -1, -1, -1, -1, -1, -1, -1, 2083, -1, -1, -1, -1, 97, -1, -1, -1, -1, -1, 103, -1, -1, -1, -1, 4389, -1, -1, -1, -1, -1, -1, 21, -1, -1, 118, 4400, -1, -1, -1, -1, -1, -1, -1, 33, -1, 129, -1, 4412, 4413, -1, -1, -1, -1, 137, -1, -1, -1, -1, 4423, -1, -1, -1, -1, -1, 54, 149, -1, -1, 4433, -1, -1, -1, 156, -1, 2149, -1, 160, 67, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 80, 175, -1, -1, -1, -1, -1, -1, -1, 3070, 3071, 3072, -1, -1, -1, -1, -1, 97, 4473, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4487, -1, -1, -1, -1, -1, 118, 1345, 214, -1, -1, -1, -1, 2210, -1, 221, -1, 129, -1, -1, 4507, -1, -1, -1, -1, 137, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 149, -1, -1, -1, -1, 154, -1, -1, -1, 252, 2244, 160, 255, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 175, 4551, -1, -1, -1, -1, 4556, -1, -1, -1, 4560, -1, -1, -1, 4564, -1, -1, -1, -1, 2279, -1, 290, -1, 1424, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 308, -1, -1, 2302, 1444, -1, 314, 221, -1, -1, -1, 13, 320, -1, -1, 323, -1, 19, -1, -1, 1460, -1, -1, -1, -1, -1, 28, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 252, -1, -1, 349, -1, 351, 352, 47, 354, 355, -1, 263, -1, 1491, 1492, -1, -1, 363, -1, -1, -1, -1, 368, -1, 1502, -1, -1, -1, 374, 281, -1, 377, -1, -1, 380, -1, 1514, 1515, -1, -1, -1, -1, -1, -1, -1, -1, -1, 393, 1526, 2386, -1, -1, -1, -1, -1, 2392, 308, -1, -1, -1, 312, -1, 314, -1, -1, -1, -1, -1, 320, -1, -1, 323, -1, -1, -1, 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 349, -1, 351, -1, -1, -1, 355, -1, -1, -1, 3340, 54, -1, -1, 363, -1, -1, -1, -1, 368, -1, -1, -1, -1, 67, 68, -1, -1, -1, 3359, -1, 380, -1, 76, -1, -1, -1, 80, -1, -1, -1, 2475, -1, -1, 393, -1, -1, -1, -1, 186, -1, -1, -1, -1, 97, -1, 3386, -1, -1, 196, 197, -1, 199, -1, -1, 202, -1, 204, -1, -1, -1, -1, -1, -1, -1, 118, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 129, -1, -1, -1, 1665, -1, -1, -1, 137, -1, -1, -1, -1, -1, -1, -1, 2536, -1, -1, -1, 149, -1, -1, -1, -1, 154, -1, -1, -1, -1, -1, 2551, 2552, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 175, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2578, -1, -1, 2581, -1, -1, -1, -1, -1, -1, -1, -1, -1, 200, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 221, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 252, -1, -1, -1, -1, -1, -1, -1, 2651, 2652, 2653, -1, -1, -1, -1, 3554, 3555, 3556, 3557, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 281, -1, -1, 2675, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2686, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2696, -1, -1, 308, -1, -1, -1, 312, -1, 314, -1, -1, -1, -1, -1, 320, -1, -1, 323, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 349, -1, 351, -1, -1, 1886, 355, -1, -1, 1890, 1891, -1, -1, 1894, 363, -1, -1, -1, -1, 368, -1, -1, -1, -1, -1, 2765, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1916, -1, -1, -1, -1, -1, -1, -1, -1, 393, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2807, -1, -1, -1, -1, -1, -1, -1, -1, 1957, -1, -1, -1, -1, -1, 2822, -1, 2824, -1, -1, -1, -1, 532, -1, -1, -1, 1974, 1975, -1, 2836, 540, 2838, -1, -1, -1, -1, -1, -1, -1, 549, 550, -1, -1, -1, 554, -1, -1, -1, -1, -1, 1998, 1999, -1, -1, 2002, 565, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 579, -1, -1, -1, -1, -1, -1, -1, 2025, -1, -1, 2887, 2029, -1, -1, -1, 595, -1, -1, 598, -1, 600, -1, 602, -1, -1, -1, -1, -1, -1, 2047, -1, -1, -1, -1, -1, -1, -1, -1, 2915, -1, -1, -1, -1, 2061, -1, -1, -1, -1, -1, -1, -1, -1, 2929, -1, -1, -1, 2074, -1, -1, -1, -1, -1, -1, -1, -1, 2083, -1, -1, -1, 2946, -1, -1, 2949, -1, -1, -1, -1, -1, -1, -1, -1, -1, 662, -1, 664, -1, -1, -1, 3861, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 685, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2149, -1, -1, -1, -1, -1, -1, 718, -1, -1, -1, -1, -1, -1, -1, -1, 3024, 716, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 873, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2210, -1, -1, -1, 776, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2244, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 828, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2279, -1, 843, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 856, -1, -1, -1, -1, -1, -1, 863, 2302, -1, -1, -1, -1, -1, -1, -1, -1, 4066, -1, 875, -1, -1, 878, -1, -1, -1, -1, -1, -1, 3182, -1, -1, -1, -1, 1005, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4103, 911, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3218, -1, -1, -1, -1, 3223, -1, 3225, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2386, -1, -1, -1, -1, -1, 2392, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3261, -1, 3263, -1, -1, -1, 3267, -1, -1, -1, -1, 3272, -1, -1, 3275, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4195, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3309, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2475, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1035, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1064, -1, -1, 3376, 3377, -1, -1, -1, -1, -1, 3383, -1, 1203, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2536, -1, -1, -1, -1, -1, 1092, 1093, -1, 1095, -1, -1, -1, -1, -1, 2551, 2552, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1114, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2578, -1, 1257, 2581, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3459, -1, -1, -1, 1154, -1, -1, -1, -1, -1, 1172, 1173, -1, 1290, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1183, -1, -1, -1, 1187, 1188, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2651, 2652, 2653, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1235, -1, 2675, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2686, -1, 1365, -1, -1, -1, -1, -1, -1, -1, 2696, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1384, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1404, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1429, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2765, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2807, 3667, 1486, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2822, -1, 2824, -1, -1, -1, -1, 3688, -1, -1, -1, -1, -1, -1, 2836, -1, 2838, -1, -1, 3700, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3722, -1, -1, -1, -1, -1, -1, -1, 1433, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1448, 2887, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3762, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2915, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1488, -1, -1, 2929, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1503, -1, 1505, -1, 1507, 2946, -1, -1, 2949, 1512, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1663, -1, -1, -1, -1, -1, -1, 1555, -1, -1, -1, 1559, -1, 1561, -1, -1, 1564, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3878, -1, -1, -1, -1, 3024, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1602, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1625, -1, -1, 1628, -1, -1, 1631, -1, -1, -1, -1, -1, -1, 1638, 1639, -1, -1, -1, -1, 1644, -1, -1, 1647, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3970, -1, 3972, 1664, -1, -1, -1, -1, 1669, -1, -1, -1, 1673, -1, -1, -1, 1677, -1, 1679, 1680, 1681, 1682, 1683, 1684, 1685, 1686, 1687, -1, 1689, -1, -1, -1, -1, -1, -1, -1, 1697, 1698, -1, -1, -1, -1, -1, 873, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3182, -1, -1, -1, -1, -1, -1, 4048, -1, 4050, -1, -1, -1, 1872, -1, -1, -1, 1876, 1877, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3218, -1, -1, -1, -1, 3223, -1, 3225, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3261, -1, 3263, -1, -1, -1, 3267, -1, -1, -1, -1, 3272, -1, 1824, 3275, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1005, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1981, -1, -1, -1, -1, 3309, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1887, 1888, -1, -1, -1, 1892, 1893, -1, -1, 1896, -1, -1, -1, -1, -1, -1, -1, 4201, -1, 1906, -1, -1, -1, -1, -1, -1, 1913, -1, -1, -1, 1917, 1918, -1, -1, 1921, 1922, -1, -1, -1, -1, -1, 1928, -1, -1, 1919, -1, -1, -1, -1, -1, -1, 3376, 3377, 1940, -1, 1942, -1, -1, 3383, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1958, -1, -1, -1, -1, 1963, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1983, -1, 1985, 1986, 1987, 1988, -1, -1, -1, 1992, 1993, -1, -1, -1, -1, -1, -1, 2000, -1, -1, -1, 2004, -1, -1, -1, 2008, -1, -1, -1, -1, 2128, -1, -1, -1, -1, -1, -1, -1, 3459, -1, -1, -1, -1, -1, -1, -1, -1, 2030, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2041, -1, 2043, -1, -1, 1203, -1, 2048, -1, -1, -1, -1, 2053, 2054, 2055, 2056, -1, -1, -1, -1, -1, 2062, -1, -1, -1, 4363, -1, -1, -1, -1, -1, -1, -1, -1, 2075, 2076, 2077, -1, -1, -1, -1, -1, -1, -1, -1, 2086, 2087, -1, -1, -1, -1, 2207, -1, -1, -1, -1, -1, -1, -1, 1257, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4423, -1, -1, -1, -1, -1, -1, 1290, -1, -1, -1, -1, 2126, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2150, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2291, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1108, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1365, -1, 4507, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1384, -1, 3667, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1404, -1, -1, 3688, -1, 1168, -1, -1, -1, -1, -1, -1, 4556, -1, 2249, 3700, -1, -1, -1, -1, 4564, -1, 2269, -1, -1, 1429, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3722, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2297, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3762, -1, -1, -1, -1, 1486, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2331, -1, -1, -1, -1, 2336, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2378, -1, 2380, 2381, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2391, -1, -1, 2394, -1, 2396, 2524, -1, -1, 2527, -1, 2529, -1, -1, -1, -1, 2534, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2423, -1, 2425, -1, -1, 3878, 2429, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2584, -1, -1, -1, 2461, 2462, 2463, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2488, -1, 2478, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2490, -1, -1, -1, 1663, 2495, -1, 2624, -1, -1, -1, 2501, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3970, -1, 3972, -1, -1, 2537, 2538, -1, -1, 1698, -1, -1, 873, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2554, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2683, 2557, 2685, -1, -1, -1, -1, -1, -1, -1, -1, 2579, -1, -1, -1, -1, -1, -1, -1, -1, 2588, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2603, 2604, -1, 1522, -1, 2608, -1, 4048, -1, 4050, 2613, 2614, 2615, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2746, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2642, 2643, 2644, 2645, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2771, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2790, 1005, 2677, 2678, 2679, -1, -1, -1, -1, 1600, -1, -1, 2687, -1, -1, -1, -1, -1, 2808, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1624, -1, -1, -1, -1, 1629, -1, 1872, -1, -1, -1, 1876, 1877, -1, 2722, -1, 2724, -1, -1, 2727, -1, -1, -1, -1, -1, 1649, 1650, -1, 1652, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2872, 2758, -1, -1, -1, -1, 4201, -1, -1, 2766, -1, -1, -1, -1, -1, -1, 2888, -1, -1, -1, -1, 1694, -1, -1, -1, -1, -1, 2899, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1730, -1, -1, -1, -1, -1, -1, -1, -1, 2823, 1981, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2968, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2865, -1, -1, 2868, -1, -1, -1, -1, 2988, 1203, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3013, -1, 2900, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2914, -1, -1, -1, 1834, -1, -1, -1, -1, -1, 2924, 4363, -1, -1, 1257, -1, 1846, -1, -1, 1849, 3049, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1290, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2128, -1, -1, -1, -1, -1, 2965, -1, -1, -1, -1, -1, -1, -1, 4423, -1, 2975, -1, -1, -1, -1, -1, 2981, -1, 2983, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3005, 3006, -1, 3135, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1365, -1, 3026, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3036, -1, 2207, 3039, -1, 3041, -1, 1384, -1, -1, -1, -1, -1, -1, 3050, -1, -1, -1, -1, -1, 3056, 4507, -1, 3059, -1, -1, -1, 1404, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3087, 1429, -1, -1, -1, -1, 3093, 3094, -1, -1, 3224, -1, -1, -1, -1, -1, -1, -1, -1, 4556, -1, -1, -1, -1, -1, -1, -1, 4564, -1, -1, 3117, -1, -1, -1, -1, 2291, 3123, -1, -1, -1, -1, -1, 3129, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1486, 3158, -1, 3160, -1, -1, -1, -1, -1, -1, 3167, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3183, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3196, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3206, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3221, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3253, 3254, 3255, 3256, 3257, 3258, 3259, 3260, -1, -1, -1, -1, 3380, 3266, -1, -1, -1, -1, -1, -1, 3273, 3274, -1, 3276, 3277, 3278, 3279, 3280, 3281, 3282, -1, -1, -1, -1, -1, -1, -1, -1, 3291, -1, 3293, 3294, -1, -1, -1, -1, -1, -1, -1, 3417, -1, 2461, 2462, 2463, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1663, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3347, 3348, 3349, -1, -1, 3352, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2524, 873, -1, 2527, -1, 2529, -1, -1, -1, -1, 2534, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3527, -1, -1, -1, -1, -1, 2334, -1, -1, -1, -1, 3538, -1, -1, -1, 2584, -1, -1, 3418, 3419, -1, -1, 3434, -1, -1, -1, -1, -1, -1, 2357, -1, 2359, -1, 2361, 2362, 2363, -1, -1, 2366, 3451, 3452, 3453, 2370, -1, -1, -1, -1, -1, -1, 2377, -1, -1, -1, -1, 2382, 2624, -1, -1, -1, -1, 2388, -1, -1, -1, -1, 2393, -1, -1, -1, -1, -1, -1, -1, -1, 2402, -1, -1, 3477, 2406, 2407, -1, 2409, -1, -1, -1, -1, -1, -1, 1005, -1, -1, -1, -1, 2421, -1, -1, -1, -1, -1, -1, 2428, -1, 2430, 2431, 2432, 2433, 2434, 2435, 2436, 2437, 2438, 2439, -1, -1, 2683, -1, 2685, -1, -1, -1, -1, -1, -1, 3650, 3524, 3525, -1, -1, -1, 873, -1, 1872, -1, -1, -1, 1876, 1877, 3537, -1, 2467, -1, -1, -1, 3543, 3544, -1, -1, 3547, -1, 3676, 3550, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3693, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2746, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3587, -1, -1, -1, -1, 3592, -1, -1, -1, -1, 3597, -1, -1, -1, -1, 2771, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3747, 2790, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3632, -1, -1, -1, -1, -1, -1, 2808, 1981, -1, -1, -1, 2572, -1, -1, -1, -1, 3661, 3662, 3663, 3664, -1, -1, -1, -1, -1, -1, -1, -1, 1005, -1, 873, -1, -1, -1, -1, -1, -1, -1, -1, 3684, 3685, 3686, 3687, -1, 3689, 3690, -1, -1, -1, -1, -1, -1, -1, 1203, -1, -1, 3701, 3702, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2872, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3726, 3727, -1, 3729, -1, 2888, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2899, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1257, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3894, -1, -1, -1, -1, -1, 1290, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2128, -1, -1, -1, -1, -1, -1, -1, 1005, -1, -1, -1, 2968, 3800, -1, -1, -1, -1, -1, 3818, -1, -1, -1, -1, -1, -1, -1, -1, 3827, -1, -1, -1, 2988, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3847, -1, -1, -1, -1, -1, -1, -1, -1, 3013, -1, -1, -1, 1365, -1, -1, -1, -1, -1, -1, -1, -1, 3869, -1, 1203, -1, -1, -1, -1, -1, 2793, 2207, 1384, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4006, 3049, -1, -1, -1, -1, -1, -1, 1404, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 873, -1, -1, -1, -1, -1, -1, -1, -1, 1429, 1257, -1, -1, -1, -1, -1, -1, 3920, -1, -1, -1, 3936, 3094, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3949, -1, -1, -1, -1, -1, -1, -1, -1, 1290, -1, -1, -1, 2291, -1, 3952, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3135, -1, -1, 1486, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4114, -1, -1, 2918, -1, -1, 1203, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4135, -1, -1, -1, 4024, 4025, 4026, -1, -1, 4029, -1, -1, -1, 1365, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1005, 2964, -1, -1, -1, 1384, -1, 2970, -1, 4171, -1, -1, 1257, -1, -1, -1, -1, -1, -1, -1, 3224, -1, -1, 2986, 2987, 1404, 2989, -1, -1, 2992, 2993, 2994, 2995, 2996, 2997, 2998, 2999, 3000, 3001, 3002, -1, -1, -1, 4205, -1, 1290, -1, 4209, 4210, -1, 1429, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3027, -1, -1, 3030, -1, 3032, -1, -1, -1, 4120, 3037, 3038, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3051, 3052, 3053, -1, 3055, -1, -1, 3058, -1, -1, -1, -1, -1, -1, 4137, -1, -1, -1, -1, 1486, -1, -1, -1, 1663, 4159, -1, -1, -1, -1, -1, -1, -1, 1365, -1, 4169, -1, -1, -1, -1, 4162, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3101, 1384, -1, -1, -1, -1, -1, -1, -1, -1, 2524, 3112, -1, 2527, 4199, 2529, -1, -1, -1, 4204, 2534, 1404, -1, -1, -1, -1, -1, -1, -1, -1, 4215, -1, -1, -1, -1, -1, 4221, -1, 3380, -1, -1, -1, -1, -1, -1, -1, 1429, 3148, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1203, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2584, -1, -1, -1, -1, 3417, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4270, -1, -1, -1, -1, -1, 1486, -1, -1, -1, -1, -1, 4294, 2624, -1, -1, -1, 1257, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4315, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1663, 1290, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4340, -1, 2683, -1, 2685, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1872, -1, -1, 3527, 1876, 1877, -1, -1, -1, -1, -1, 4378, -1, -1, 3538, -1, 4383, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1365, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2746, -1, -1, -1, -1, -1, -1, 4412, 4413, 1384, -1, -1, -1, 3587, -1, -1, -1, -1, 3592, -1, 3353, -1, -1, 3597, -1, 2771, -1, -1, -1, 1404, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2790, -1, -1, -1, 1663, -1, -1, -1, -1, -1, 1429, -1, -1, -1, -1, 1981, -1, -1, 2808, -1, -1, -1, -1, -1, 4473, -1, -1, -1, -1, -1, -1, -1, 3650, -1, -1, -1, -1, -1, 4487, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3676, -1, -1, -1, -1, -1, -1, -1, -1, 1486, -1, -1, -1, -1, -1, -1, -1, 3693, -1, -1, -1, 1872, -1, -1, 2872, 1876, 1877, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2888, -1, -1, 3478, 4551, -1, -1, 3482, 3483, 3484, -1, 2899, 3487, -1, -1, -1, -1, 3492, 3493, 3494, 3495, 3496, 3497, 3498, 3499, 3500, 3501, 3502, 3503, -1, -1, 3747, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3531, 3532, 3533, 3534, -1, 3536, -1, -1, 2128, 3540, 3541, 3542, -1, -1, 3545, -1, -1, 3548, -1, -1, -1, -1, -1, -1, 2968, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1981, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2988, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3589, 1872, -1, -1, -1, 1876, 1877, 3596, -1, -1, -1, 3013, -1, -1, -1, -1, -1, -1, -1, 3608, -1, -1, -1, -1, -1, -1, -1, -1, 3858, 2207, -1, -1, 1663, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3049, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3894, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1981, -1, -1, 2291, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2128, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3135, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4006, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2207, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3803, -1, -1, -1, -1, -1, -1, -1, 3224, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1872, -1, -1, -1, 1876, 1877, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2128, -1, -1, -1, -1, -1, -1, -1, -1, 3855, 3856, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4114, -1, 2291, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3886, -1, -1, -1, 3890, -1, -1, -1, 4135, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3904, -1, 3906, -1, -1, -1, -1, 3911, 3912, 3913, -1, -1, 3916, 3917, 3918, 3919, -1, 3921, -1, -1, 3924, 2207, -1, -1, -1, -1, 4171, -1, -1, -1, -1, 2524, -1, -1, 2527, 1981, 2529, -1, -1, -1, -1, 2534, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4205, -1, -1, 3380, 4209, 4210, -1, -1, -1, -1, 3974, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2584, -1, -1, -1, -1, -1, -1, -1, -1, 3417, -1, -1, -1, -1, 2291, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2624, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4290, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4069, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2128, -1, -1, -1, -1, -1, -1, -1, 2683, -1, 2685, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2524, -1, -1, 2527, -1, 2529, 3527, -1, -1, -1, 2534, -1, -1, -1, -1, -1, -1, 3538, -1, -1, -1, -1, -1, -1, -1, 4133, 4134, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4149, 4150, 4151, -1, -1, -1, -1, -1, 2746, -1, -1, -1, -1, -1, -1, -1, 2207, -1, -1, 2584, -1, -1, -1, -1, -1, 4174, -1, -1, -1, -1, -1, -1, -1, 2771, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2790, -1, -1, -1, -1, -1, -1, 2624, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2808, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3650, -1, -1, -1, -1, 2524, -1, -1, 2527, -1, 2529, -1, 2291, -1, -1, 2534, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3676, -1, -1, -1, 2683, -1, 2685, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3693, -1, -1, 2872, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4298, 2888, -1, -1, 2584, -1, -1, -1, -1, -1, -1, -1, 2899, -1, -1, -1, 4314, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2746, -1, -1, -1, 3747, -1, -1, -1, -1, -1, -1, -1, 2624, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2771, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2790, -1, -1, -1, -1, 2968, -1, -1, -1, -1, -1, -1, -1, -1, 4388, -1, -1, -1, 2808, -1, -1, -1, -1, -1, -1, 2988, -1, 2683, -1, 2685, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3013, -1, -1, -1, -1, -1, -1, -1, 4432, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2872, -1, -1, -1, 3049, -1, -1, -1, 2746, -1, -1, -1, -1, -1, -1, -1, 2888, -1, -1, -1, 4476, -1, -1, -1, -1, 3894, 2524, 2899, -1, 2527, -1, 2529, -1, 2771, -1, -1, 2534, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2790, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2808, -1, -1, 4529, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2584, -1, -1, -1, 3135, -1, -1, -1, -1, -1, 2968, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2988, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2624, -1, -1, -1, -1, -1, -1, -1, 2872, -1, -1, 4006, -1, -1, -1, 3013, -1, -1, -1, -1, -1, -1, -1, -1, 2888, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2899, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3049, -1, 3224, -1, -1, -1, -1, -1, 2683, -1, 2685, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2968, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4114, -1, -1, 2746, -1, 2988, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3135, -1, -1, 4135, -1, -1, -1, -1, -1, -1, 2771, -1, 3013, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2790, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4171, -1, -1, -1, -1, -1, -1, -1, 2808, 3049, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3380, 4205, -1, -1, -1, 4209, 4210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3224, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3417, -1, 2872, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2888, -1, -1, -1, -1, -1, -1, 3135, -1, -1, -1, 2899, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2968, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3527, -1, -1, -1, 3224, -1, -1, -1, 2988, -1, -1, 3538, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3380, -1, -1, -1, -1, -1, -1, 3013, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3417, -1, -1, -1, -1, -1, 3049, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3650, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3676, -1, -1, -1, -1, -1, 3135, -1, -1, -1, -1, 3380, -1, -1, -1, -1, -1, 3693, -1, -1, -1, -1, -1, -1, 3527, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3538, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3417, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3747, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3224, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3650, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3527, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3538, -1, -1, -1, 3676, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3693, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3894, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3747, -1, -1, -1, -1, -1, -1, 3380, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3650, -1, -1, -1, -1, -1, -1, 3417, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3676, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3693, -1, -1, -1, -1, -1, 4006, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3747, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3894, -1, -1, -1, -1, -1, -1, 3527, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3538, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4114, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4135, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4171, -1, -1, -1, -1, -1, -1, -1, 4006, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3650, -1, -1, -1, 3894, -1, -1, -1, 4205, -1, -1, -1, 4209, 4210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3676, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3693, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4114, -1, -1, -1, -1, -1, -1, 3747, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4135, -1, -1, -1, -1, 4006, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4171, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4205, -1, -1, -1, 4209, 4210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4114, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3894, 4135, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4171, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4205, -1, -1, -1, 4209, 4210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4006, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4114, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4135, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4171, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, 4205, -1, -1, 30, 4209, 4210, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, 115, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, -1, 374, 375, 376, 377, 378, 379, 380, -1, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, -1, 427, 428, 429, -1, -1, -1, -1, -1, -1, 436, 437, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, 30, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, -1, 374, 375, 376, 377, 378, 379, 380, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, -1, 427, 428, 3, -1, -1, -1, -1, -1, -1, 436, 437, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, 31, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, 437, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, -1, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, -1, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, -1, 136, 137, 138, -1, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, -1, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, -1, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, -1, -1, 237, 238, 239, 240, -1, -1, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, -1, 263, 264, 265, 266, 267, 268, 269, -1, 271, -1, 273, -1, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, -1, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, -1, 363, -1, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, -1, 388, 389, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, -1, 3, -1, -1, -1, -1, -1, -1, -1, 416, 417, 418, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, 437, 33, 34, -1, 36, 37, 38, 39, 40, 41, -1, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, -1, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, -1, 136, 137, 138, -1, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, -1, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, -1, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, -1, -1, 237, 238, 239, 240, -1, -1, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, -1, 263, 264, 265, 266, 267, 268, 269, -1, 271, -1, 273, -1, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, -1, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, -1, 363, -1, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, -1, 388, 389, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, -1, 3, 4, 5, 6, 7, 8, 9, 10, 416, 417, 418, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, 30, -1, 437, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, 152, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, 205, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, -1, 374, 375, 376, 377, 378, 379, 380, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, -1, 427, 428, -1, -1, -1, -1, -1, -1, -1, 436, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, 30, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, 349, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, -1, 374, 375, 376, 377, 378, 379, 380, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, -1, 427, 428, -1, -1, -1, -1, -1, -1, -1, 436, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, 30, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, -1, 374, 375, 376, 377, 378, 379, 380, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, -1, 427, 428, -1, -1, -1, -1, -1, 434, 435, 436, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, 30, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, -1, 374, 375, 376, 377, 378, 379, 380, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, -1, 427, 428, 429, -1, -1, -1, -1, -1, -1, 436, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, 30, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, -1, 374, 375, 376, 377, 378, 379, 380, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, -1, 427, 428, -1, -1, -1, -1, -1, -1, -1, 436, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, 30, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, -1, 374, 375, 376, 377, 378, 379, 380, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, -1, 427, 428, -1, -1, -1, -1, -1, -1, -1, 436, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, 30, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, 152, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, -1, 374, 375, 376, 377, 378, 379, 380, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, -1, 427, 428, -1, -1, -1, -1, -1, -1, -1, 436, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, 30, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, -1, 374, 375, 376, 377, 378, 379, 380, -1, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, -1, 427, 428, -1, -1, -1, -1, -1, -1, -1, 436, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, 30, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, -1, 374, 375, 376, 377, 378, 379, 380, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, -1, 427, 428, -1, -1, -1, -1, -1, -1, -1, 436, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, 30, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, -1, 374, 375, 376, 377, 378, 379, 380, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, -1, 427, 428, -1, -1, -1, -1, -1, -1, -1, 436, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, 30, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, -1, 374, 375, 376, 377, 378, 379, 380, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, -1, 427, 428, -1, -1, -1, -1, -1, -1, -1, 436, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, 30, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, -1, 374, 375, 376, 377, 378, 379, 380, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, -1, 427, 428, -1, -1, -1, -1, -1, -1, -1, 436, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, 30, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, -1, 374, 375, 376, 377, 378, 379, 380, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, -1, 427, 428, -1, -1, -1, -1, -1, -1, -1, 436, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, 30, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, -1, 374, 375, 376, 377, 378, 379, 380, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, -1, 427, 428, -1, -1, -1, -1, -1, -1, -1, 436, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, 30, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, 380, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, -1, 427, 428, -1, -1, -1, -1, -1, -1, -1, 436, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, 30, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, -1, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, -1, 374, 375, 376, 377, 378, 379, 380, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, -1, 427, 428, -1, -1, 3, 4, 5, 6, 7, 436, 9, 10, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, 30, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, 380, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, 3, 4, 5, 6, 7, -1, 9, 10, -1, -1, 436, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, 30, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, 380, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, 436, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, 30, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, -1, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, -1, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, -1, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, -1, 374, 375, 376, 377, 378, 379, 380, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, -1, 427, 428, -1, -1, -1, -1, -1, -1, -1, 436, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, 30, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, -1, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, -1, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, -1, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, 380, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, 3, 427, 428, -1, -1, -1, -1, -1, -1, -1, 436, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, 54, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, 251, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, 349, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, 380, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, 436, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, 54, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, 251, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, 380, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, 436, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, 54, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, 380, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, 436, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, 54, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, 380, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, 3, 4, 5, -1, -1, -1, 9, -1, -1, -1, 436, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, 250, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, 3, 427, 428, 429, -1, -1, -1, -1, -1, -1, 436, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, 26, 27, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, 349, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, 436, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, 436, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, 349, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, 436, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, 436, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, 436, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, 436, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, -1, -1, -1, 3, 4, 5, -1, -1, 8, 9, -1, -1, -1, 436, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, -1, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, -1, 136, 137, 138, -1, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, -1, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, -1, 236, 237, 238, 239, 240, 241, -1, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, 268, 269, 270, 271, -1, 273, -1, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, -1, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, -1, 363, -1, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, -1, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, -1, -1, -1, -1, -1, -1, -1, -1, -1, 416, 417, 418, -1, -1, -1, -1, 423, 424, 425, -1, 427, 428, 429, 430, 431, 432, 3, -1, -1, -1, -1, 8, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, 423, 424, 425, -1, 427, 428, 429, 430, 431, 432, 3, -1, -1, -1, -1, 8, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, 423, 424, 425, -1, 427, 428, 429, 430, 431, 432, 3, -1, -1, -1, -1, 8, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, 423, 424, 425, -1, 427, 428, 429, 430, 431, 432, 3, -1, -1, -1, -1, 8, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, 423, 424, 425, -1, 427, 428, 429, 430, 431, 432, 3, -1, -1, -1, -1, 8, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, 423, 424, 425, -1, 427, 428, 429, 430, 431, 432, 3, -1, -1, -1, -1, 8, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, -1, 423, 424, 425, -1, 427, 428, 429, 430, 431, 432, 3, -1, -1, -1, -1, 8, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, -1, -1, -1, 3, 423, 424, 425, -1, 427, 428, 429, 430, 431, 432, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, 429, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, 429, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, -1, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, -1, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, -1, 136, 137, 138, -1, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, -1, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, -1, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, -1, -1, 237, 238, 239, 240, -1, -1, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, 256, 257, 258, 259, 260, 261, -1, 263, 264, 265, 266, 267, 268, 269, -1, 271, -1, 273, -1, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, -1, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, -1, 363, -1, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, -1, 388, 389, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, -1, -1, -1, 3, -1, -1, -1, -1, -1, 416, 417, 418, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 429, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, -1, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, -1, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, -1, 136, 137, 138, -1, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, -1, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, -1, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, -1, -1, 237, 238, 239, 240, -1, -1, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, 256, 257, 258, 259, 260, 261, -1, 263, 264, 265, 266, 267, 268, 269, -1, 271, -1, 273, -1, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, -1, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, -1, 363, -1, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, -1, 388, 389, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, -1, -1, -1, 3, -1, -1, -1, -1, -1, 416, 417, 418, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 429, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, 4, 5, -1, -1, -1, 9, -1, -1, -1, 429, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, 250, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, 4, 5, -1, -1, -1, 9, -1, 427, 428, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, 250, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, 4, 5, -1, -1, -1, 9, -1, 427, 428, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, 250, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, 9, -1, 427, 428, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, 152, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, 4, 5, -1, -1, -1, 9, -1, 427, 428, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, 54, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, 380, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, 250, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, 380, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, 26, 27, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, 160, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, -1, 68, 69, 70, 71, 72, -1, 74, 75, 76, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, 374, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, 76, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, 374, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, 157, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, 157, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, 76, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, 374, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, 349, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, 26, 27, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, 380, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, 380, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, 251, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, 251, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, 251, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, 349, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, 31, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, 31, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, 31, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, -1, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, 267, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, -1, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, -1, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, -1, 136, 137, 138, -1, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, -1, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, -1, 180, 181, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, -1, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, -1, -1, 237, 238, 239, 240, -1, -1, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, 259, 260, 261, -1, 263, 264, 265, 266, 267, 268, 269, -1, 271, -1, 273, -1, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, -1, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, -1, 363, -1, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, -1, 388, 389, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, -1, 3, -1, -1, -1, -1, -1, -1, -1, 416, 417, 418, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, -1, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, -1, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, -1, 136, 137, 138, -1, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, -1, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, -1, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, -1, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, -1, -1, 237, 238, 239, 240, 241, -1, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, 268, 269, -1, 271, -1, 273, -1, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, -1, -1, 347, 348, 349, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, -1, 363, -1, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, -1, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, -1, 3, -1, -1, -1, -1, -1, -1, -1, 416, 417, 418, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, -1, 39, 40, 41, 42, 43, -1, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, -1, -1, -1, 69, 70, 71, 72, -1, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, -1, -1, -1, 154, 155, 156, -1, 158, 159, -1, 161, -1, 163, 164, 165, 166, 167, -1, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, -1, -1, 195, -1, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, 207, -1, 209, -1, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, 235, -1, 237, 238, -1, 240, -1, 242, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, 258, -1, 260, -1, 262, 263, 264, 265, 266, -1, 268, 269, -1, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, -1, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, -1, 308, 309, 310, -1, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, -1, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, -1, 390, -1, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, -1, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, -1, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, -1, 136, 137, 138, -1, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, -1, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, -1, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, -1, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, -1, -1, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, 268, 269, -1, 271, -1, 273, -1, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, -1, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, -1, 363, -1, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, -1, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, -1, 3, -1, -1, -1, -1, -1, -1, -1, 416, 417, 418, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, -1, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, -1, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, -1, 136, 137, 138, -1, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, -1, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, -1, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, -1, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, -1, 237, 238, 239, 240, -1, -1, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, 268, 269, -1, 271, -1, 273, -1, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, -1, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, -1, 363, -1, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, -1, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, -1, 3, -1, -1, -1, -1, -1, -1, -1, 416, 417, 418, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, -1, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, -1, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, -1, 136, 137, 138, -1, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, -1, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, -1, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, -1, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, -1, -1, 237, 238, 239, 240, -1, -1, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, 268, 269, -1, 271, -1, 273, -1, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, -1, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, -1, 363, -1, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, -1, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, -1, 3, -1, -1, -1, -1, -1, -1, -1, 416, 417, 418, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, -1, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, -1, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, -1, 136, 137, 138, -1, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, -1, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, -1, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, -1, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, -1, -1, 237, 238, 239, 240, -1, -1, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, 268, 269, -1, 271, -1, 273, -1, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, 327, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, -1, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, -1, 363, -1, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, -1, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, -1, 3, -1, -1, -1, -1, -1, -1, -1, 416, 417, 418, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, -1, 43, 44, 45, 46, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, -1, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, -1, 94, 95, 96, 97, 98, 99, 100, 101, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, -1, 136, 137, 138, -1, -1, 141, -1, 143, 144, 145, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, -1, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, -1, 183, 184, 185, 186, 187, 188, -1, 190, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, -1, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, -1, -1, 237, 238, 239, 240, -1, -1, 243, 244, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, 268, 269, -1, 271, -1, 273, -1, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, -1, 328, 329, 330, 331, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, -1, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, 357, 358, -1, -1, 361, -1, 363, -1, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, -1, 388, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, -1, 3, -1, -1, -1, -1, -1, -1, -1, 416, 417, 418, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, -1, -1, 44, -1, -1, -1, 48, 49, 50, 51, 52, -1, -1, 55, 56, -1, -1, 59, -1, 61, 62, 63, 64, -1, -1, 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, -1, -1, -1, 90, -1, -1, -1, 94, 95, 96, 97, 98, 99, -1, -1, 102, -1, 104, -1, 106, 107, 108, 109, 110, -1, 112, 113, 114, -1, -1, 117, 118, 119, 120, 121, -1, 123, 124, 125, -1, 127, 128, 129, -1, 131, 132, 133, 134, -1, 136, 137, 138, -1, -1, 141, -1, 143, 144, -1, 146, -1, 148, -1, 150, 151, -1, 153, 154, 155, 156, -1, 158, -1, -1, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, 181, -1, 183, 184, 185, 186, -1, -1, -1, -1, -1, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, -1, 203, 204, -1, 206, -1, 208, 209, 210, -1, 212, 213, 214, -1, -1, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, -1, 231, -1, 233, 234, -1, -1, 237, 238, 239, 240, -1, -1, 243, -1, 245, 246, 247, -1, 249, -1, -1, 252, 253, 254, -1, -1, 257, -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, 268, 269, -1, 271, -1, 273, -1, 275, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, 286, -1, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, 315, 316, 317, 318, -1, 320, 321, 322, 323, 324, -1, 326, -1, 328, 329, 330, 331, -1, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, -1, -1, 347, 348, -1, 350, 351, 352, 353, 354, 355, -1, -1, -1, -1, -1, 361, -1, 363, -1, -1, 366, 367, 368, 369, 370, 371, 372, -1, -1, 375, 376, 377, 378, 379, -1, -1, 382, 383, 384, 385, 386, -1, -1, -1, 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, -1, 401, 402, 403, 404, 405, 406, -1, -1, -1, -1, -1, -1, -1, -1, -1, 416, 417, 418 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint16 yystos[] = { 0, 14, 24, 26, 27, 41, 61, 63, 64, 69, 71, 81, 83, 99, 102, 114, 116, 120, 126, 134, 136, 142, 157, 212, 213, 218, 227, 238, 276, 288, 293, 294, 296, 301, 306, 309, 313, 318, 319, 326, 329, 337, 349, 366, 376, 382, 387, 400, 436, 443, 444, 445, 446, 452, 453, 455, 456, 457, 458, 459, 460, 461, 463, 464, 468, 480, 483, 484, 487, 488, 489, 501, 504, 505, 521, 558, 561, 564, 565, 566, 573, 579, 581, 583, 584, 587, 590, 591, 595, 596, 605, 609, 610, 611, 612, 613, 615, 616, 617, 630, 631, 635, 637, 638, 639, 649, 651, 658, 659, 662, 663, 664, 665, 666, 671, 673, 676, 680, 684, 685, 695, 696, 699, 704, 715, 737, 740, 741, 742, 745, 748, 750, 752, 755, 756, 759, 760, 761, 768, 769, 771, 772, 773, 778, 780, 781, 785, 786, 789, 790, 791, 792, 794, 795, 796, 797, 799, 802, 803, 808, 814, 817, 819, 820, 825, 827, 831, 838, 842, 843, 844, 845, 846, 847, 850, 878, 361, 403, 774, 21, 67, 80, 97, 103, 118, 129, 137, 149, 154, 160, 175, 200, 221, 252, 281, 308, 312, 314, 320, 323, 348, 349, 351, 355, 363, 368, 380, 393, 580, 774, 3, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 33, 34, 36, 37, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 55, 56, 57, 58, 59, 61, 62, 63, 64, 65, 69, 70, 71, 72, 74, 75, 77, 78, 79, 80, 81, 82, 85, 86, 94, 95, 96, 97, 98, 99, 100, 101, 102, 104, 106, 107, 108, 109, 110, 112, 113, 114, 117, 118, 119, 120, 121, 123, 124, 125, 127, 128, 129, 131, 132, 133, 134, 135, 136, 137, 138, 139, 141, 143, 144, 145, 146, 148, 150, 154, 155, 156, 158, 159, 161, 163, 164, 165, 166, 167, 169, 170, 171, 173, 174, 175, 176, 177, 178, 180, 182, 183, 184, 185, 186, 187, 188, 190, 192, 195, 197, 198, 199, 200, 201, 203, 204, 206, 207, 209, 212, 213, 214, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 232, 233, 234, 235, 237, 238, 240, 242, 243, 244, 245, 246, 247, 249, 252, 253, 254, 257, 258, 260, 262, 263, 264, 265, 266, 267, 268, 269, 271, 272, 273, 274, 275, 276, 277, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 305, 306, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 320, 321, 322, 323, 324, 326, 327, 328, 329, 331, 332, 333, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 347, 348, 350, 351, 352, 353, 354, 355, 357, 358, 361, 362, 363, 364, 366, 367, 368, 369, 370, 371, 372, 375, 376, 377, 378, 379, 382, 383, 384, 385, 386, 387, 388, 390, 392, 393, 394, 395, 398, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 839, 995, 1008, 1012, 1013, 391, 804, 250, 277, 774, 44, 512, 843, 21, 33, 54, 67, 76, 97, 103, 118, 129, 137, 149, 156, 160, 214, 252, 255, 308, 314, 323, 351, 352, 354, 355, 363, 368, 374, 377, 380, 522, 563, 654, 705, 716, 22, 276, 995, 839, 22, 271, 321, 352, 354, 5, 199, 746, 747, 1004, 21, 33, 54, 67, 80, 97, 118, 129, 137, 149, 154, 160, 175, 221, 252, 263, 308, 312, 314, 320, 323, 349, 351, 355, 363, 368, 380, 393, 580, 667, 774, 995, 83, 391, 436, 558, 561, 564, 803, 809, 817, 820, 825, 831, 838, 842, 9, 15, 22, 39, 144, 150, 152, 172, 201, 233, 279, 295, 427, 428, 681, 682, 839, 1003, 1007, 22, 83, 292, 319, 686, 687, 688, 1008, 1008, 1000, 1004, 349, 853, 681, 1008, 361, 995, 263, 221, 97, 175, 348, 349, 753, 313, 1008, 22, 324, 357, 361, 472, 1008, 19, 157, 686, 687, 277, 774, 1008, 198, 22, 115, 855, 55, 77, 214, 229, 308, 314, 324, 357, 361, 406, 469, 470, 471, 472, 22, 324, 357, 361, 472, 361, 251, 889, 993, 1008, 853, 429, 1008, 153, 436, 805, 436, 988, 290, 848, 849, 995, 843, 844, 847, 0, 439, 804, 130, 189, 256, 373, 856, 857, 843, 845, 846, 108, 185, 379, 440, 3, 38, 44, 67, 73, 84, 90, 151, 153, 168, 181, 193, 194, 196, 208, 210, 231, 239, 259, 261, 307, 330, 391, 1001, 1008, 1009, 1012, 1014, 669, 1008, 669, 996, 1008, 280, 669, 363, 669, 995, 1008, 96, 349, 694, 1001, 3, 1005, 1010, 1012, 1013, 1014, 167, 993, 245, 393, 8, 62, 141, 423, 424, 425, 427, 428, 429, 430, 431, 432, 744, 955, 956, 1008, 22, 1005, 995, 995, 167, 993, 995, 326, 167, 889, 995, 316, 995, 669, 219, 1005, 167, 993, 199, 105, 195, 236, 286, 775, 776, 777, 993, 999, 1008, 21, 54, 67, 68, 76, 80, 97, 118, 129, 137, 149, 154, 175, 200, 221, 252, 308, 312, 314, 320, 323, 349, 351, 355, 363, 368, 393, 580, 674, 1004, 993, 359, 1001, 995, 436, 669, 363, 996, 669, 363, 167, 995, 96, 349, 352, 354, 1005, 352, 354, 62, 141, 744, 299, 1005, 167, 465, 1008, 995, 995, 316, 995, 669, 219, 1005, 290, 320, 349, 393, 221, 80, 175, 154, 312, 367, 574, 22, 995, 840, 479, 1004, 1010, 747, 167, 1001, 995, 167, 751, 167, 996, 363, 96, 349, 167, 1001, 167, 1005, 1006, 73, 393, 62, 141, 167, 744, 48, 167, 1006, 167, 995, 167, 995, 167, 995, 316, 167, 995, 167, 219, 1006, 199, 167, 668, 669, 436, 818, 522, 809, 387, 803, 810, 811, 812, 1010, 804, 1007, 682, 683, 22, 683, 1007, 683, 22, 683, 1007, 683, 683, 683, 1007, 1003, 1003, 839, 683, 280, 436, 436, 541, 541, 541, 250, 359, 440, 541, 889, 890, 440, 770, 1004, 436, 815, 48, 393, 995, 995, 993, 1008, 38, 418, 195, 438, 253, 253, 250, 152, 1004, 359, 147, 677, 250, 4, 6, 7, 8, 10, 30, 43, 45, 46, 53, 54, 57, 58, 65, 67, 87, 88, 89, 90, 91, 92, 93, 100, 101, 119, 135, 139, 140, 145, 159, 187, 188, 190, 207, 215, 216, 230, 232, 236, 241, 242, 244, 252, 262, 272, 287, 310, 325, 332, 345, 357, 358, 362, 364, 365, 374, 380, 388, 408, 409, 410, 411, 412, 413, 414, 415, 427, 428, 429, 436, 843, 905, 908, 911, 912, 913, 915, 916, 917, 918, 921, 922, 926, 928, 929, 930, 932, 953, 957, 976, 981, 989, 990, 991, 1001, 1002, 1003, 1004, 1008, 1004, 22, 485, 992, 993, 324, 469, 103, 478, 1004, 479, 1004, 38, 59, 469, 418, 333, 776, 253, 152, 359, 423, 38, 418, 195, 777, 436, 993, 429, 434, 438, 982, 983, 890, 151, 153, 391, 800, 801, 803, 151, 806, 103, 926, 986, 987, 848, 440, 436, 807, 437, 437, 445, 993, 22, 115, 854, 854, 48, 854, 142, 147, 211, 248, 860, 862, 863, 872, 874, 875, 876, 856, 857, 152, 191, 889, 891, 988, 436, 728, 983, 264, 297, 326, 438, 670, 264, 297, 326, 264, 297, 326, 400, 447, 480, 481, 700, 18, 120, 264, 297, 326, 384, 492, 995, 326, 18, 120, 379, 462, 404, 167, 889, 50, 82, 138, 170, 206, 236, 264, 297, 305, 311, 318, 326, 335, 343, 395, 480, 482, 731, 738, 436, 717, 297, 462, 135, 18, 24, 64, 113, 120, 123, 177, 234, 236, 246, 254, 264, 297, 300, 301, 326, 384, 490, 491, 599, 4, 428, 571, 1007, 167, 993, 669, 669, 436, 743, 438, 172, 454, 297, 447, 454, 250, 264, 297, 135, 49, 95, 174, 222, 224, 234, 263, 297, 302, 326, 337, 490, 568, 569, 264, 297, 392, 599, 607, 470, 472, 135, 297, 326, 490, 227, 264, 297, 301, 326, 74, 112, 265, 353, 250, 18, 24, 120, 264, 297, 326, 502, 503, 147, 297, 326, 447, 481, 135, 297, 326, 490, 995, 209, 105, 251, 405, 440, 775, 381, 798, 250, 1001, 436, 995, 363, 96, 349, 1001, 245, 393, 62, 141, 744, 995, 316, 995, 199, 669, 541, 283, 507, 436, 644, 728, 60, 3, 43, 45, 46, 57, 58, 100, 101, 145, 187, 188, 190, 230, 232, 244, 287, 327, 332, 357, 358, 388, 902, 904, 906, 908, 910, 912, 913, 914, 916, 917, 921, 922, 1009, 1012, 152, 436, 640, 995, 447, 31, 793, 995, 236, 447, 404, 167, 993, 447, 669, 669, 640, 377, 522, 447, 236, 38, 466, 368, 606, 264, 582, 74, 112, 265, 353, 20, 40, 186, 618, 31, 640, 147, 447, 393, 993, 167, 559, 993, 993, 393, 669, 73, 706, 1001, 995, 580, 44, 94, 184, 234, 315, 135, 728, 51, 303, 493, 135, 436, 135, 404, 135, 717, 135, 440, 167, 668, 167, 669, 167, 669, 135, 743, 1006, 135, 135, 250, 135, 493, 135, 74, 112, 265, 353, 135, 250, 135, 147, 167, 167, 479, 135, 440, 493, 926, 960, 349, 437, 440, 140, 250, 365, 476, 479, 571, 813, 809, 683, 839, 683, 839, 683, 839, 683, 839, 683, 839, 839, 839, 683, 839, 436, 542, 543, 1008, 542, 22, 97, 118, 149, 154, 199, 200, 314, 320, 349, 351, 368, 689, 992, 1006, 688, 172, 440, 828, 1004, 902, 963, 31, 1006, 706, 148, 754, 754, 754, 209, 1008, 147, 147, 689, 1006, 313, 1008, 479, 250, 436, 984, 434, 843, 964, 390, 919, 926, 980, 436, 919, 919, 436, 147, 436, 436, 436, 907, 907, 274, 843, 436, 436, 909, 436, 436, 436, 436, 57, 58, 919, 926, 436, 907, 436, 436, 436, 436, 436, 402, 422, 436, 923, 436, 923, 436, 436, 843, 436, 436, 436, 436, 436, 436, 436, 436, 926, 926, 843, 926, 960, 983, 1004, 58, 436, 920, 436, 1004, 3, 8, 11, 28, 31, 36, 42, 66, 168, 172, 193, 194, 210, 236, 239, 252, 255, 330, 423, 424, 425, 427, 428, 429, 430, 431, 432, 955, 957, 959, 401, 941, 261, 926, 191, 851, 440, 436, 1004, 983, 106, 169, 486, 440, 59, 103, 479, 31, 3, 103, 214, 477, 571, 922, 1004, 1004, 78, 117, 938, 86, 103, 473, 474, 476, 571, 103, 473, 209, 993, 926, 3, 22, 26, 27, 28, 29, 30, 31, 32, 35, 47, 53, 54, 60, 66, 68, 76, 83, 87, 88, 89, 91, 92, 93, 103, 105, 111, 115, 116, 122, 126, 130, 140, 142, 147, 149, 152, 157, 160, 162, 172, 179, 189, 191, 202, 205, 211, 215, 216, 236, 241, 248, 250, 251, 255, 256, 270, 278, 292, 304, 319, 325, 334, 346, 349, 356, 359, 360, 365, 373, 374, 380, 381, 389, 396, 397, 399, 400, 429, 998, 1011, 1012, 1013, 1014, 1015, 982, 79, 302, 672, 437, 440, 804, 437, 440, 849, 994, 995, 31, 807, 845, 845, 858, 859, 926, 845, 144, 233, 869, 197, 234, 286, 328, 379, 22, 864, 926, 865, 867, 926, 928, 872, 873, 863, 862, 860, 861, 147, 875, 246, 877, 860, 872, 891, 993, 31, 1008, 326, 172, 182, 256, 258, 327, 389, 429, 721, 722, 723, 725, 727, 729, 902, 1009, 264, 297, 326, 359, 359, 314, 998, 438, 359, 359, 314, 359, 359, 351, 469, 787, 147, 157, 172, 306, 701, 702, 60, 76, 131, 149, 278, 374, 538, 539, 76, 103, 236, 359, 76, 359, 103, 236, 314, 76, 113, 123, 264, 297, 636, 314, 588, 21, 54, 67, 80, 118, 129, 149, 154, 221, 252, 314, 320, 323, 349, 355, 368, 393, 580, 995, 135, 297, 326, 490, 250, 571, 318, 206, 359, 359, 241, 571, 107, 192, 314, 324, 361, 471, 303, 326, 731, 739, 437, 718, 721, 359, 380, 993, 68, 131, 529, 538, 1008, 68, 76, 757, 250, 312, 363, 76, 757, 25, 300, 312, 363, 993, 177, 246, 669, 436, 359, 359, 166, 436, 497, 351, 400, 402, 497, 76, 440, 4, 264, 135, 297, 326, 490, 381, 381, 235, 902, 264, 326, 744, 97, 481, 359, 449, 481, 993, 359, 359, 993, 571, 48, 570, 571, 571, 95, 222, 224, 48, 359, 447, 314, 447, 234, 569, 359, 359, 241, 1004, 599, 889, 76, 359, 757, 314, 22, 176, 221, 350, 359, 359, 497, 497, 669, 669, 669, 669, 993, 37, 386, 37, 37, 359, 37, 359, 314, 440, 93, 380, 614, 1005, 359, 449, 993, 359, 314, 264, 297, 286, 298, 322, 475, 775, 999, 1008, 993, 728, 902, 250, 404, 717, 571, 669, 669, 743, 193, 250, 74, 112, 265, 353, 250, 669, 193, 400, 513, 340, 341, 508, 1004, 3, 645, 646, 640, 436, 904, 31, 30, 903, 98, 165, 223, 226, 317, 416, 436, 924, 925, 670, 907, 669, 641, 642, 1011, 20, 782, 902, 250, 135, 585, 995, 236, 436, 448, 654, 381, 290, 393, 448, 135, 1005, 83, 157, 467, 521, 565, 617, 684, 704, 778, 1004, 607, 608, 995, 217, 669, 669, 669, 669, 246, 108, 185, 366, 379, 619, 620, 127, 285, 436, 614, 448, 993, 567, 568, 236, 31, 246, 436, 541, 541, 562, 993, 147, 707, 999, 436, 719, 31, 199, 400, 402, 841, 315, 1001, 493, 902, 996, 167, 995, 1001, 493, 1006, 1005, 135, 493, 135, 381, 135, 381, 744, 493, 493, 1006, 995, 669, 995, 995, 995, 669, 1006, 614, 135, 135, 493, 668, 669, 437, 440, 993, 809, 811, 839, 839, 839, 839, 839, 839, 542, 437, 440, 437, 155, 321, 350, 994, 668, 96, 323, 693, 694, 994, 245, 994, 992, 992, 994, 668, 359, 400, 697, 16, 133, 310, 328, 829, 889, 240, 830, 437, 440, 816, 820, 825, 831, 842, 359, 993, 687, 686, 687, 152, 158, 698, 1008, 21, 68, 97, 118, 129, 149, 154, 200, 221, 308, 314, 320, 349, 351, 368, 393, 580, 678, 960, 982, 435, 960, 964, 965, 436, 396, 977, 978, 926, 960, 436, 1003, 1003, 960, 3, 98, 165, 223, 226, 317, 416, 966, 967, 1004, 1003, 960, 960, 1003, 1003, 919, 919, 926, 744, 926, 968, 427, 428, 927, 928, 953, 957, 970, 437, 960, 926, 960, 971, 357, 418, 1003, 1003, 926, 47, 152, 205, 360, 926, 960, 974, 960, 228, 928, 926, 936, 937, 938, 228, 926, 938, 437, 440, 326, 1003, 1003, 924, 902, 926, 1011, 357, 35, 346, 985, 669, 926, 436, 843, 975, 115, 117, 140, 236, 241, 246, 365, 375, 926, 42, 168, 172, 210, 330, 436, 926, 359, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 22, 29, 334, 954, 160, 143, 942, 310, 436, 953, 156, 214, 349, 352, 354, 377, 852, 993, 152, 879, 991, 22, 115, 389, 429, 437, 723, 926, 961, 962, 1009, 993, 361, 436, 1004, 440, 437, 435, 441, 166, 166, 493, 993, 801, 802, 993, 986, 437, 440, 436, 440, 32, 111, 381, 713, 436, 866, 1007, 328, 197, 251, 440, 310, 311, 868, 992, 830, 873, 861, 381, 826, 103, 436, 821, 842, 1008, 436, 832, 833, 834, 835, 836, 1008, 258, 48, 1009, 437, 723, 725, 722, 725, 1009, 256, 437, 440, 670, 359, 359, 314, 1005, 995, 995, 998, 1005, 995, 995, 1005, 996, 995, 75, 788, 308, 380, 686, 314, 157, 686, 436, 995, 381, 708, 197, 197, 381, 436, 557, 167, 995, 241, 1005, 995, 995, 926, 241, 995, 995, 25, 300, 359, 359, 995, 359, 589, 1001, 436, 669, 669, 669, 363, 96, 349, 694, 393, 62, 141, 744, 995, 669, 995, 669, 316, 669, 669, 199, 161, 234, 264, 297, 385, 592, 593, 594, 889, 359, 757, 314, 241, 107, 192, 1005, 995, 250, 995, 437, 440, 1005, 1006, 297, 490, 529, 902, 995, 1008, 995, 995, 22, 380, 995, 167, 995, 167, 1008, 312, 363, 312, 363, 995, 22, 380, 995, 993, 18, 120, 326, 600, 601, 602, 603, 1011, 1005, 995, 103, 153, 237, 381, 496, 499, 500, 1011, 995, 249, 64, 249, 995, 491, 359, 993, 359, 757, 314, 997, 1008, 997, 440, 437, 440, 359, 314, 996, 1005, 3, 75, 125, 177, 269, 372, 380, 383, 450, 297, 1005, 995, 297, 326, 490, 568, 571, 669, 995, 571, 995, 571, 1005, 995, 297, 326, 490, 995, 995, 995, 995, 263, 359, 263, 359, 394, 263, 359, 1005, 995, 18, 24, 120, 264, 297, 326, 264, 297, 326, 640, 297, 326, 297, 326, 297, 901, 1008, 167, 650, 1008, 167, 1008, 1005, 995, 995, 995, 18, 503, 323, 1005, 297, 326, 490, 995, 995, 359, 359, 72, 371, 286, 193, 31, 669, 193, 193, 381, 381, 193, 241, 675, 1004, 669, 669, 193, 675, 249, 152, 359, 506, 447, 423, 437, 440, 926, 30, 903, 902, 434, 434, 359, 359, 359, 436, 359, 1003, 907, 437, 440, 423, 619, 75, 124, 203, 204, 217, 264, 351, 353, 783, 531, 1011, 995, 152, 314, 392, 586, 593, 594, 135, 210, 523, 525, 527, 529, 535, 538, 19, 172, 308, 347, 450, 451, 147, 997, 393, 993, 465, 1008, 466, 255, 522, 149, 1004, 640, 640, 640, 640, 246, 250, 255, 436, 640, 899, 900, 901, 323, 436, 135, 134, 842, 669, 523, 1008, 400, 402, 553, 400, 498, 31, 541, 1004, 250, 437, 720, 721, 726, 31, 199, 305, 399, 730, 731, 732, 250, 479, 164, 164, 147, 728, 31, 135, 493, 717, 668, 669, 997, 669, 997, 743, 250, 493, 493, 250, 493, 323, 147, 479, 493, 926, 437, 543, 172, 172, 172, 404, 994, 440, 571, 572, 160, 690, 691, 1005, 19, 698, 133, 328, 133, 328, 310, 379, 225, 902, 995, 400, 560, 152, 250, 690, 48, 493, 1001, 363, 349, 1001, 245, 393, 199, 669, 437, 435, 435, 440, 960, 926, 122, 978, 979, 31, 437, 926, 437, 437, 437, 437, 152, 437, 437, 437, 437, 437, 440, 437, 270, 969, 437, 927, 927, 11, 172, 193, 252, 423, 424, 425, 427, 428, 429, 430, 431, 432, 957, 927, 437, 437, 147, 152, 972, 973, 437, 418, 437, 437, 31, 974, 960, 974, 974, 152, 437, 437, 1011, 268, 940, 31, 437, 440, 926, 1011, 440, 926, 984, 926, 1008, 437, 437, 418, 927, 927, 128, 960, 152, 115, 117, 140, 241, 246, 365, 375, 436, 128, 346, 985, 926, 975, 926, 359, 744, 926, 436, 843, 436, 436, 260, 946, 352, 354, 352, 354, 993, 853, 853, 853, 202, 311, 436, 843, 880, 881, 882, 889, 892, 929, 931, 932, 1001, 1008, 397, 897, 961, 961, 962, 437, 13, 440, 856, 857, 776, 1003, 924, 474, 926, 807, 995, 816, 859, 252, 955, 958, 419, 420, 714, 926, 868, 379, 865, 880, 397, 898, 387, 822, 823, 1008, 304, 824, 836, 837, 440, 879, 423, 984, 729, 670, 725, 725, 48, 727, 431, 1005, 995, 995, 211, 1006, 1006, 250, 994, 253, 250, 926, 539, 997, 436, 436, 436, 557, 175, 542, 628, 135, 493, 359, 1005, 995, 479, 728, 902, 995, 404, 669, 669, 669, 669, 743, 74, 112, 265, 353, 995, 575, 995, 161, 385, 359, 359, 575, 592, 599, 297, 326, 490, 995, 995, 995, 183, 241, 721, 359, 254, 597, 628, 120, 301, 326, 492, 599, 758, 135, 493, 135, 493, 995, 995, 995, 995, 602, 603, 602, 437, 440, 604, 1004, 175, 437, 440, 423, 438, 1005, 297, 326, 490, 995, 995, 995, 264, 297, 326, 18, 120, 264, 297, 326, 902, 235, 902, 1005, 995, 211, 269, 241, 1004, 269, 1006, 378, 359, 359, 314, 359, 757, 314, 359, 359, 48, 995, 48, 995, 263, 359, 48, 995, 219, 219, 219, 359, 359, 314, 359, 359, 314, 359, 314, 359, 314, 359, 493, 902, 236, 1004, 326, 758, 135, 493, 359, 995, 359, 314, 1005, 995, 675, 902, 193, 675, 675, 997, 997, 675, 193, 193, 675, 507, 436, 509, 510, 252, 427, 428, 571, 643, 725, 958, 1004, 1015, 3, 646, 437, 434, 437, 1003, 435, 1003, 165, 223, 925, 223, 925, 925, 1003, 226, 437, 642, 643, 250, 211, 423, 784, 784, 784, 784, 784, 784, 784, 60, 66, 76, 103, 105, 179, 236, 241, 278, 292, 374, 532, 533, 534, 134, 396, 447, 479, 995, 479, 597, 993, 993, 437, 440, 1006, 160, 308, 1006, 1003, 368, 993, 541, 38, 466, 299, 349, 96, 498, 542, 993, 620, 647, 648, 1004, 437, 440, 995, 542, 993, 995, 560, 436, 524, 437, 249, 497, 249, 250, 554, 497, 31, 842, 498, 359, 993, 437, 440, 103, 423, 733, 1004, 479, 349, 724, 725, 400, 732, 734, 108, 185, 319, 379, 766, 161, 842, 493, 902, 995, 493, 493, 381, 493, 381, 493, 493, 669, 669, 995, 614, 493, 314, 314, 314, 994, 694, 440, 1005, 400, 440, 692, 253, 133, 133, 96, 234, 1006, 689, 493, 1005, 728, 717, 571, 669, 193, 964, 437, 356, 926, 126, 902, 437, 926, 926, 926, 972, 902, 927, 115, 117, 236, 246, 927, 927, 927, 927, 927, 927, 927, 927, 927, 927, 926, 926, 973, 972, 923, 923, 902, 437, 437, 437, 960, 437, 440, 48, 928, 437, 1011, 937, 275, 344, 939, 437, 440, 392, 933, 31, 437, 920, 1004, 926, 28, 28, 926, 437, 926, 152, 436, 963, 926, 927, 927, 128, 128, 926, 437, 128, 926, 857, 397, 436, 947, 1008, 853, 853, 853, 853, 993, 993, 993, 843, 892, 152, 843, 881, 882, 31, 883, 884, 1008, 440, 84, 153, 181, 196, 208, 231, 307, 886, 884, 31, 883, 885, 1008, 421, 896, 436, 983, 926, 160, 870, 440, 856, 856, 856, 926, 389, 962, 437, 437, 435, 437, 436, 714, 437, 251, 86, 926, 824, 437, 440, 984, 990, 437, 440, 833, 898, 986, 437, 431, 729, 368, 784, 155, 321, 350, 369, 703, 147, 703, 437, 436, 545, 546, 710, 931, 1008, 542, 542, 628, 999, 437, 105, 179, 234, 236, 629, 995, 995, 31, 995, 381, 381, 669, 669, 669, 669, 670, 1005, 995, 359, 757, 314, 359, 183, 995, 436, 531, 236, 497, 96, 236, 339, 342, 497, 368, 995, 1008, 601, 995, 500, 643, 1011, 359, 757, 314, 359, 359, 359, 314, 154, 252, 342, 652, 653, 154, 252, 660, 661, 359, 359, 314, 437, 437, 437, 1007, 1004, 1004, 1004, 995, 995, 995, 995, 995, 995, 995, 995, 1006, 830, 1006, 830, 48, 995, 1006, 830, 147, 147, 299, 147, 167, 1005, 995, 995, 1005, 995, 995, 995, 995, 995, 995, 995, 66, 494, 135, 20, 40, 368, 1008, 995, 599, 995, 995, 437, 675, 193, 193, 675, 675, 508, 516, 517, 1011, 44, 85, 109, 124, 128, 148, 151, 163, 241, 249, 284, 511, 628, 1003, 400, 402, 435, 435, 437, 924, 993, 784, 103, 1003, 1004, 103, 1004, 103, 1004, 103, 1004, 103, 995, 103, 995, 103, 995, 436, 669, 995, 927, 106, 169, 105, 241, 197, 993, 734, 282, 632, 633, 1008, 585, 436, 536, 323, 527, 1006, 1006, 902, 436, 498, 1005, 993, 404, 147, 621, 437, 440, 901, 597, 437, 246, 436, 818, 526, 528, 530, 538, 1008, 553, 178, 552, 71, 351, 555, 842, 560, 555, 1004, 708, 726, 926, 926, 440, 436, 730, 640, 359, 575, 437, 493, 997, 997, 493, 493, 323, 994, 994, 994, 571, 157, 691, 96, 698, 152, 193, 193, 193, 193, 241, 679, 1004, 926, 437, 437, 973, 152, 115, 117, 246, 436, 437, 407, 935, 960, 291, 48, 398, 398, 437, 926, 234, 926, 440, 934, 904, 924, 927, 927, 926, 963, 437, 28, 28, 926, 926, 128, 926, 437, 437, 926, 948, 1008, 993, 993, 993, 993, 884, 885, 436, 437, 1008, 436, 881, 196, 259, 887, 881, 887, 196, 886, 887, 196, 436, 1008, 436, 961, 48, 162, 871, 437, 437, 437, 962, 1004, 1004, 744, 246, 842, 823, 423, 836, 824, 368, 437, 1007, 359, 686, 152, 628, 926, 437, 440, 400, 66, 711, 711, 437, 437, 734, 106, 169, 177, 105, 383, 493, 902, 997, 997, 995, 995, 995, 995, 598, 602, 241, 241, 1007, 1008, 902, 493, 493, 423, 995, 995, 995, 995, 1005, 995, 995, 1003, 1003, 902, 440, 1003, 1003, 440, 1005, 995, 995, 359, 359, 359, 1006, 830, 359, 994, 994, 669, 994, 135, 669, 1004, 1004, 902, 493, 493, 193, 675, 675, 381, 514, 515, 437, 440, 429, 436, 476, 518, 571, 793, 1004, 793, 236, 241, 284, 793, 793, 435, 154, 182, 154, 152, 627, 1007, 926, 236, 533, 734, 541, 381, 556, 1001, 28, 134, 172, 523, 132, 173, 995, 381, 542, 31, 466, 436, 995, 121, 622, 396, 624, 1004, 498, 669, 523, 560, 437, 440, 400, 554, 436, 553, 108, 120, 275, 995, 400, 779, 152, 436, 1004, 723, 735, 736, 1009, 734, 993, 180, 576, 493, 493, 493, 995, 253, 493, 690, 679, 679, 679, 679, 927, 152, 436, 963, 436, 437, 440, 437, 928, 291, 437, 386, 336, 437, 437, 437, 927, 927, 926, 437, 267, 949, 893, 894, 931, 883, 436, 994, 881, 250, 381, 888, 881, 196, 881, 900, 436, 900, 1008, 856, 960, 926, 399, 943, 856, 924, 437, 839, 988, 690, 250, 690, 437, 734, 546, 252, 744, 669, 381, 669, 712, 712, 292, 734, 556, 437, 359, 437, 440, 494, 643, 359, 436, 1001, 744, 653, 436, 436, 661, 995, 995, 995, 359, 995, 400, 299, 400, 400, 147, 494, 675, 447, 110, 517, 476, 519, 520, 1004, 1004, 241, 542, 429, 542, 1004, 1004, 694, 31, 749, 749, 993, 628, 437, 556, 220, 544, 175, 436, 633, 282, 436, 437, 22, 70, 77, 104, 176, 342, 537, 537, 597, 997, 437, 842, 597, 310, 338, 623, 436, 134, 31, 524, 437, 528, 254, 555, 992, 554, 311, 311, 52, 60, 214, 669, 709, 710, 725, 437, 440, 897, 575, 234, 385, 577, 578, 493, 927, 963, 437, 936, 960, 48, 234, 417, 48, 856, 437, 440, 31, 895, 994, 437, 926, 436, 881, 888, 437, 900, 437, 437, 944, 945, 1008, 437, 692, 703, 493, 711, 556, 436, 669, 713, 713, 993, 556, 628, 995, 602, 381, 495, 995, 963, 717, 147, 656, 743, 963, 963, 830, 830, 995, 830, 668, 669, 668, 669, 994, 493, 509, 1004, 437, 440, 542, 749, 34, 171, 147, 234, 540, 153, 266, 331, 250, 548, 549, 550, 351, 437, 1001, 5, 634, 323, 141, 655, 498, 779, 926, 282, 842, 553, 552, 531, 437, 555, 60, 253, 60, 437, 440, 730, 735, 116, 385, 575, 437, 437, 437, 291, 386, 960, 285, 311, 950, 896, 893, 436, 437, 994, 437, 440, 31, 152, 712, 397, 547, 744, 714, 714, 541, 628, 926, 437, 256, 316, 289, 657, 656, 437, 437, 830, 400, 520, 121, 177, 108, 379, 250, 550, 250, 549, 995, 436, 437, 440, 995, 669, 31, 31, 437, 1001, 779, 554, 553, 253, 253, 498, 710, 734, 23, 186, 767, 42, 86, 370, 926, 951, 952, 951, 437, 900, 437, 945, 947, 690, 713, 436, 628, 437, 544, 1001, 48, 657, 669, 310, 51, 234, 303, 326, 551, 551, 437, 5, 597, 652, 842, 436, 555, 554, 555, 237, 436, 762, 764, 769, 820, 825, 831, 842, 952, 310, 146, 273, 146, 273, 437, 493, 714, 926, 548, 717, 669, 624, 17, 103, 241, 779, 4, 625, 626, 1003, 1004, 1011, 555, 897, 763, 764, 765, 843, 844, 28, 437, 628, 134, 437, 440, 437, 439, 952, 282, 626, 765, 1001, 436, 625, 437 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint16 yyr1[] = { 0, 442, 443, 444, 444, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 446, 447, 447, 448, 448, 449, 449, 450, 450, 450, 450, 450, 450, 450, 450, 450, 451, 451, 451, 451, 451, 451, 452, 453, 454, 454, 455, 455, 456, 457, 458, 458, 459, 459, 460, 461, 462, 462, 463, 463, 464, 464, 464, 464, 465, 465, 466, 466, 467, 467, 467, 467, 467, 467, 468, 468, 468, 469, 469, 469, 470, 470, 470, 470, 471, 471, 471, 471, 471, 471, 471, 471, 471, 471, 471, 472, 472, 473, 473, 474, 474, 475, 475, 475, 475, 476, 476, 476, 476, 477, 477, 477, 477, 477, 477, 477, 478, 478, 478, 479, 479, 480, 480, 480, 480, 480, 481, 481, 482, 482, 483, 483, 483, 483, 483, 484, 485, 485, 486, 486, 487, 488, 488, 488, 488, 488, 489, 489, 489, 489, 489, 489, 489, 489, 489, 489, 490, 490, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 492, 492, 493, 493, 493, 494, 494, 495, 495, 496, 496, 496, 496, 497, 498, 498, 499, 499, 500, 500, 500, 500, 501, 502, 502, 503, 503, 503, 503, 504, 504, 505, 505, 506, 506, 507, 507, 508, 508, 508, 509, 509, 510, 510, 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, 512, 512, 513, 513, 514, 514, 515, 515, 516, 516, 517, 518, 518, 518, 518, 518, 519, 519, 520, 521, 521, 521, 521, 522, 522, 522, 522, 522, 522, 522, 522, 523, 523, 524, 524, 525, 525, 526, 526, 527, 527, 527, 528, 528, 529, 530, 531, 531, 532, 532, 532, 532, 533, 533, 533, 533, 533, 533, 533, 534, 534, 534, 534, 535, 536, 536, 536, 537, 537, 537, 537, 537, 537, 538, 538, 539, 539, 539, 539, 539, 539, 539, 540, 540, 541, 541, 542, 542, 543, 544, 544, 544, 544, 545, 545, 546, 546, 547, 547, 548, 548, 548, 548, 548, 549, 550, 551, 551, 551, 551, 551, 552, 552, 553, 553, 553, 553, 554, 554, 554, 554, 555, 555, 556, 556, 557, 558, 559, 560, 560, 560, 561, 562, 563, 563, 564, 565, 566, 566, 567, 567, 568, 568, 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, 570, 570, 571, 571, 571, 572, 572, 573, 573, 574, 574, 575, 575, 576, 576, 577, 577, 578, 578, 579, 579, 580, 580, 581, 582, 582, 583, 583, 584, 584, 585, 585, 586, 586, 586, 587, 588, 588, 589, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 591, 592, 592, 592, 592, 593, 593, 594, 594, 595, 595, 596, 596, 597, 597, 598, 598, 599, 600, 600, 601, 601, 601, 601, 602, 603, 604, 605, 606, 606, 607, 607, 608, 608, 609, 609, 610, 610, 610, 611, 611, 612, 612, 613, 614, 614, 614, 615, 615, 616, 617, 617, 618, 618, 618, 619, 619, 620, 620, 620, 620, 620, 621, 621, 622, 622, 623, 623, 624, 624, 625, 625, 625, 626, 626, 626, 626, 627, 627, 628, 628, 629, 629, 629, 629, 629, 629, 630, 630, 631, 631, 632, 632, 633, 634, 634, 635, 636, 636, 636, 636, 637, 638, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 640, 641, 641, 642, 642, 643, 643, 643, 643, 643, 644, 645, 645, 646, 647, 647, 648, 648, 649, 649, 649, 650, 650, 651, 652, 652, 653, 653, 653, 653, 653, 654, 654, 655, 655, 656, 656, 656, 657, 657, 658, 659, 659, 660, 660, 661, 661, 662, 662, 663, 663, 664, 665, 666, 666, 666, 666, 667, 667, 667, 667, 667, 667, 667, 667, 667, 667, 667, 667, 667, 667, 667, 667, 667, 668, 668, 669, 669, 670, 670, 671, 672, 672, 672, 673, 673, 673, 673, 673, 673, 673, 673, 673, 673, 673, 673, 673, 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, 675, 675, 676, 676, 676, 676, 676, 677, 677, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 679, 679, 680, 680, 681, 681, 681, 681, 681, 681, 681, 681, 681, 681, 681, 681, 681, 681, 681, 681, 682, 682, 683, 683, 684, 685, 685, 686, 686, 686, 686, 686, 687, 687, 688, 688, 688, 688, 689, 689, 689, 689, 689, 689, 689, 689, 689, 689, 689, 689, 689, 689, 689, 689, 690, 690, 691, 691, 692, 692, 693, 693, 694, 695, 696, 696, 697, 697, 698, 698, 699, 700, 700, 701, 701, 701, 702, 702, 702, 703, 703, 703, 703, 704, 705, 705, 706, 706, 707, 707, 708, 708, 709, 709, 710, 710, 710, 711, 711, 712, 712, 712, 713, 713, 713, 714, 714, 714, 715, 715, 715, 716, 716, 717, 717, 718, 718, 719, 719, 720, 720, 721, 721, 721, 721, 721, 722, 722, 722, 722, 722, 723, 724, 725, 725, 725, 726, 726, 726, 727, 728, 728, 728, 728, 729, 729, 730, 730, 731, 731, 731, 731, 731, 731, 731, 731, 731, 731, 731, 731, 731, 731, 731, 732, 732, 732, 732, 733, 733, 734, 734, 735, 736, 736, 737, 738, 738, 739, 739, 740, 740, 741, 741, 742, 742, 743, 743, 743, 743, 744, 744, 745, 746, 746, 747, 747, 748, 748, 748, 749, 749, 749, 750, 751, 751, 752, 752, 752, 753, 753, 754, 754, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, 757, 757, 758, 758, 759, 759, 759, 759, 759, 759, 759, 759, 759, 759, 759, 759, 759, 759, 759, 759, 759, 759, 759, 759, 759, 759, 759, 759, 760, 760, 760, 760, 760, 760, 760, 760, 760, 760, 760, 760, 760, 760, 760, 760, 760, 760, 760, 761, 762, 762, 762, 763, 763, 764, 764, 764, 764, 764, 765, 765, 766, 766, 766, 766, 767, 767, 767, 768, 768, 769, 770, 770, 771, 772, 772, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 774, 774, 774, 775, 775, 775, 775, 775, 776, 776, 776, 777, 777, 778, 778, 778, 778, 779, 779, 779, 779, 780, 781, 782, 782, 783, 783, 783, 783, 783, 783, 783, 783, 783, 783, 783, 783, 783, 783, 783, 783, 784, 784, 785, 785, 786, 787, 787, 788, 789, 789, 790, 791, 792, 792, 792, 792, 792, 792, 792, 793, 793, 794, 795, 795, 795, 795, 795, 795, 796, 797, 797, 797, 798, 798, 799, 799, 799, 799, 799, 800, 800, 801, 801, 801, 801, 802, 802, 803, 803, 804, 804, 805, 805, 806, 806, 807, 807, 808, 808, 808, 808, 809, 809, 809, 809, 809, 809, 809, 809, 809, 810, 810, 811, 812, 812, 813, 813, 813, 814, 815, 815, 816, 816, 816, 816, 817, 817, 818, 818, 819, 819, 819, 819, 820, 821, 821, 821, 822, 822, 823, 824, 824, 825, 826, 826, 827, 828, 828, 829, 829, 829, 829, 829, 829, 829, 829, 830, 830, 831, 832, 832, 833, 833, 834, 835, 836, 837, 837, 838, 839, 840, 840, 840, 840, 840, 841, 841, 841, 842, 842, 843, 843, 844, 844, 844, 844, 844, 844, 844, 844, 845, 845, 846, 846, 846, 846, 846, 846, 847, 847, 848, 848, 849, 850, 850, 851, 851, 852, 852, 852, 852, 852, 852, 852, 852, 852, 853, 853, 854, 854, 854, 855, 855, 855, 855, 856, 856, 857, 858, 858, 859, 859, 860, 860, 860, 860, 861, 861, 862, 862, 862, 863, 863, 864, 864, 865, 866, 866, 866, 867, 868, 868, 869, 869, 870, 870, 871, 871, 872, 872, 873, 873, 874, 874, 875, 876, 876, 876, 876, 877, 877, 878, 878, 879, 879, 880, 880, 881, 881, 881, 881, 881, 881, 881, 882, 882, 882, 882, 882, 882, 883, 883, 883, 883, 884, 884, 885, 885, 885, 885, 885, 886, 886, 886, 886, 887, 887, 888, 888, 889, 889, 889, 889, 890, 890, 891, 891, 891, 892, 892, 893, 894, 894, 895, 895, 896, 896, 897, 897, 898, 898, 898, 899, 899, 900, 900, 901, 902, 902, 902, 902, 902, 902, 903, 903, 903, 904, 904, 904, 904, 904, 904, 904, 905, 905, 905, 905, 906, 906, 907, 907, 908, 908, 908, 908, 908, 908, 908, 908, 908, 908, 908, 909, 909, 910, 910, 911, 911, 912, 913, 914, 914, 915, 915, 916, 917, 918, 918, 918, 918, 918, 918, 919, 919, 920, 920, 921, 921, 921, 921, 922, 923, 923, 923, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, 925, 925, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 927, 927, 927, 927, 927, 927, 927, 927, 927, 927, 927, 927, 927, 927, 927, 927, 927, 927, 927, 927, 927, 927, 928, 928, 928, 928, 928, 928, 928, 928, 928, 928, 928, 928, 929, 929, 929, 929, 929, 929, 929, 930, 930, 931, 931, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 933, 933, 934, 934, 934, 934, 935, 936, 936, 937, 937, 938, 938, 939, 939, 939, 940, 940, 940, 940, 941, 941, 942, 942, 943, 943, 944, 944, 945, 946, 946, 946, 947, 948, 948, 949, 949, 950, 950, 950, 951, 951, 952, 952, 952, 952, 952, 953, 953, 953, 954, 954, 954, 955, 955, 956, 956, 956, 956, 956, 956, 956, 956, 956, 957, 957, 958, 958, 959, 959, 959, 959, 959, 959, 960, 960, 961, 961, 962, 962, 963, 963, 964, 964, 964, 965, 965, 966, 966, 967, 967, 967, 967, 967, 967, 967, 967, 968, 968, 969, 970, 970, 971, 971, 971, 971, 971, 971, 972, 973, 974, 974, 974, 975, 975, 976, 977, 977, 978, 979, 979, 980, 980, 981, 981, 982, 982, 982, 982, 983, 983, 984, 984, 985, 985, 986, 986, 987, 987, 988, 989, 989, 990, 990, 991, 991, 991, 991, 992, 992, 993, 993, 994, 994, 995, 996, 997, 998, 999, 1000, 1001, 1001, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1003, 1004, 1005, 1006, 1006, 1007, 1007, 1007, 1008, 1008, 1008, 1009, 1009, 1009, 1010, 1010, 1010, 1010, 1011, 1011, 1011, 1011, 1011, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 5, 1, 0, 2, 0, 2, 0, 2, 2, 3, 3, 1, 3, 3, 2, 1, 1, 2, 2, 2, 3, 3, 5, 5, 0, 3, 5, 5, 5, 4, 3, 5, 3, 5, 5, 6, 1, 1, 3, 5, 6, 4, 9, 7, 1, 0, 2, 0, 1, 1, 1, 1, 1, 1, 2, 3, 3, 2, 5, 1, 3, 3, 3, 3, 1, 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, 1, 3, 1, 3, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 3, 6, 1, 1, 1, 1, 1, 0, 1, 1, 2, 3, 4, 3, 2, 2, 1, 2, 1, 2, 3, 4, 3, 2, 4, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 4, 6, 4, 6, 4, 6, 4, 6, 5, 7, 1, 3, 2, 3, 4, 6, 6, 6, 5, 5, 6, 6, 4, 8, 4, 2, 4, 3, 6, 4, 3, 3, 3, 3, 3, 4, 4, 3, 3, 3, 3, 3, 3, 4, 4, 3, 2, 3, 2, 2, 3, 3, 2, 2, 3, 1, 3, 2, 1, 1, 0, 2, 0, 2, 0, 1, 1, 1, 3, 3, 2, 0, 1, 3, 3, 1, 5, 3, 4, 1, 3, 4, 6, 4, 8, 2, 2, 11, 7, 1, 1, 1, 0, 1, 1, 1, 1, 3, 2, 0, 1, 1, 1, 3, 3, 1, 1, 3, 3, 3, 3, 4, 3, 2, 1, 0, 2, 0, 3, 0, 1, 0, 1, 3, 2, 1, 1, 1, 3, 0, 1, 3, 1, 11, 14, 10, 13, 1, 1, 2, 2, 2, 2, 1, 0, 1, 0, 3, 0, 1, 3, 1, 3, 1, 1, 1, 1, 1, 4, 4, 2, 0, 3, 1, 1, 2, 2, 1, 3, 4, 5, 2, 5, 1, 2, 2, 2, 3, 3, 3, 0, 1, 1, 1, 1, 1, 1, 3, 1, 5, 7, 3, 8, 4, 9, 11, 2, 0, 3, 0, 1, 3, 1, 2, 2, 2, 0, 1, 3, 3, 6, 4, 0, 1, 1, 2, 2, 0, 3, 3, 2, 1, 1, 2, 2, 4, 0, 2, 2, 2, 0, 3, 4, 4, 0, 2, 0, 4, 0, 3, 7, 5, 2, 3, 0, 8, 4, 1, 0, 6, 5, 4, 6, 1, 0, 1, 2, 2, 1, 2, 3, 2, 2, 2, 2, 3, 3, 1, 3, 1, 0, 1, 2, 1, 1, 3, 6, 10, 1, 0, 1, 2, 2, 0, 2, 2, 1, 0, 5, 7, 1, 0, 7, 2, 0, 3, 5, 5, 8, 2, 0, 2, 2, 2, 5, 2, 0, 2, 7, 10, 6, 6, 6, 6, 7, 7, 9, 9, 6, 7, 6, 8, 8, 8, 8, 6, 6, 7, 7, 8, 6, 6, 7, 2, 2, 2, 2, 1, 2, 1, 0, 6, 8, 7, 6, 4, 0, 1, 3, 4, 1, 3, 1, 2, 2, 2, 2, 1, 1, 10, 2, 0, 2, 2, 1, 0, 4, 6, 5, 4, 4, 10, 13, 5, 7, 8, 1, 1, 1, 7, 9, 8, 15, 20, 1, 1, 2, 1, 3, 1, 1, 1, 3, 1, 3, 0, 1, 0, 1, 1, 4, 0, 1, 3, 0, 1, 1, 1, 1, 2, 0, 0, 2, 2, 1, 2, 2, 2, 2, 6, 8, 11, 13, 1, 3, 5, 1, 3, 5, 1, 2, 2, 1, 8, 4, 5, 4, 4, 4, 3, 7, 8, 6, 6, 6, 6, 6, 4, 5, 3, 1, 3, 3, 1, 1, 1, 1, 1, 1, 3, 1, 3, 3, 1, 0, 1, 3, 7, 9, 9, 3, 0, 13, 1, 3, 5, 6, 4, 7, 2, 1, 0, 2, 0, 2, 4, 0, 1, 0, 6, 8, 8, 1, 3, 5, 5, 7, 9, 7, 9, 5, 6, 6, 4, 5, 7, 1, 1, 1, 2, 1, 2, 2, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 1, 3, 1, 2, 2, 3, 5, 2, 2, 0, 6, 7, 7, 7, 8, 8, 6, 8, 9, 9, 7, 10, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 3, 2, 3, 3, 3, 3, 1, 1, 8, 9, 9, 9, 9, 2, 0, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 2, 3, 3, 3, 3, 4, 4, 3, 3, 3, 4, 4, 3, 4, 4, 1, 1, 1, 0, 7, 7, 10, 1, 1, 2, 4, 5, 1, 3, 2, 2, 2, 2, 1, 2, 2, 4, 3, 2, 2, 2, 2, 3, 2, 2, 2, 5, 5, 5, 1, 3, 1, 2, 3, 0, 1, 3, 2, 6, 6, 9, 3, 0, 3, 0, 5, 2, 0, 3, 3, 3, 7, 7, 10, 1, 1, 1, 1, 14, 1, 0, 1, 0, 1, 0, 2, 0, 1, 3, 5, 5, 7, 2, 0, 1, 2, 0, 1, 1, 0, 1, 1, 0, 9, 12, 7, 2, 0, 3, 2, 1, 3, 3, 2, 1, 3, 3, 3, 2, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 4, 5, 1, 3, 3, 1, 3, 3, 5, 6, 1, 3, 1, 2, 4, 5, 1, 1, 1, 1, 3, 3, 2, 2, 1, 2, 2, 2, 1, 2, 2, 1, 1, 1, 3, 2, 0, 2, 1, 3, 5, 1, 2, 1, 0, 5, 7, 5, 7, 5, 7, 3, 5, 5, 5, 1, 3, 2, 1, 2, 1, 2, 11, 10, 10, 2, 2, 0, 9, 2, 0, 4, 4, 4, 1, 1, 1, 0, 8, 8, 8, 9, 11, 11, 11, 12, 5, 5, 7, 6, 6, 6, 6, 8, 8, 6, 6, 7, 9, 9, 6, 6, 6, 8, 6, 8, 6, 8, 7, 9, 6, 8, 7, 9, 8, 10, 9, 11, 8, 9, 11, 8, 8, 7, 6, 6, 6, 8, 8, 8, 8, 6, 9, 1, 0, 2, 0, 7, 6, 6, 6, 6, 6, 7, 9, 9, 6, 8, 8, 8, 8, 8, 6, 8, 6, 8, 7, 9, 7, 9, 6, 7, 6, 6, 6, 6, 6, 7, 7, 7, 9, 9, 6, 6, 6, 8, 8, 8, 6, 7, 13, 1, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 6, 8, 3, 2, 0, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 3, 2, 5, 4, 3, 3, 3, 1, 1, 0, 3, 2, 2, 1, 2, 1, 3, 2, 1, 0, 9, 11, 12, 14, 3, 4, 4, 0, 2, 5, 2, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 1, 0, 5, 6, 4, 2, 0, 4, 3, 5, 4, 6, 4, 6, 6, 5, 7, 9, 6, 1, 0, 6, 11, 11, 11, 13, 9, 11, 10, 4, 2, 5, 2, 0, 4, 5, 5, 4, 6, 1, 3, 1, 1, 1, 1, 2, 4, 1, 1, 1, 0, 1, 0, 1, 0, 3, 0, 2, 4, 3, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, 1, 1, 1, 1, 0, 5, 3, 0, 1, 1, 1, 1, 3, 9, 3, 0, 2, 3, 2, 3, 6, 1, 4, 2, 1, 3, 2, 2, 0, 7, 2, 0, 5, 3, 0, 2, 2, 2, 3, 1, 3, 1, 2, 1, 0, 8, 1, 3, 1, 1, 3, 5, 2, 1, 3, 7, 1, 0, 3, 2, 2, 2, 0, 2, 2, 1, 1, 3, 3, 1, 2, 4, 4, 2, 3, 5, 5, 1, 1, 9, 1, 2, 4, 4, 4, 2, 3, 1, 3, 6, 1, 0, 2, 0, 3, 3, 4, 4, 4, 4, 3, 2, 1, 1, 0, 1, 1, 0, 1, 5, 1, 0, 1, 0, 3, 1, 3, 4, 3, 2, 2, 1, 1, 1, 0, 2, 4, 5, 2, 3, 1, 1, 1, 1, 3, 0, 1, 1, 1, 1, 1, 3, 0, 2, 0, 1, 3, 1, 0, 1, 2, 3, 2, 4, 2, 3, 2, 0, 2, 3, 2, 0, 1, 3, 2, 2, 3, 2, 3, 1, 4, 3, 4, 5, 4, 5, 4, 5, 2, 4, 1, 1, 0, 1, 4, 5, 4, 0, 2, 2, 2, 1, 1, 0, 4, 2, 1, 2, 2, 4, 1, 3, 1, 2, 3, 2, 6, 2, 1, 3, 4, 0, 1, 0, 2, 0, 2, 4, 0, 1, 0, 1, 3, 3, 2, 3, 5, 6, 2, 3, 3, 4, 0, 1, 1, 1, 1, 1, 2, 5, 1, 1, 1, 1, 2, 3, 3, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 3, 0, 1, 1, 1, 1, 5, 2, 1, 1, 1, 1, 5, 2, 2, 2, 1, 3, 3, 2, 1, 0, 3, 0, 5, 2, 5, 2, 1, 2, 3, 0, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 0, 1, 4, 1, 3, 3, 5, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 3, 3, 2, 3, 5, 4, 6, 3, 5, 4, 6, 4, 6, 5, 7, 3, 2, 4, 2, 3, 3, 4, 3, 4, 3, 4, 5, 6, 6, 7, 6, 7, 6, 7, 3, 4, 4, 6, 2, 3, 4, 1, 3, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 5, 6, 6, 7, 3, 4, 1, 1, 2, 4, 1, 1, 1, 2, 2, 2, 2, 1, 3, 5, 6, 8, 6, 6, 4, 4, 1, 1, 1, 5, 1, 1, 4, 1, 4, 1, 4, 1, 4, 1, 1, 1, 1, 1, 1, 6, 4, 4, 4, 4, 6, 5, 5, 5, 4, 6, 4, 4, 4, 4, 5, 7, 7, 9, 5, 4, 6, 5, 7, 7, 7, 2, 3, 3, 3, 4, 0, 4, 1, 3, 3, 1, 1, 1, 2, 2, 0, 2, 4, 4, 6, 5, 0, 5, 0, 2, 0, 1, 3, 3, 2, 2, 0, 6, 1, 0, 3, 0, 2, 2, 0, 1, 4, 2, 2, 2, 2, 2, 4, 3, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 4, 1, 4, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 2, 1, 3, 3, 0, 1, 1, 1, 1, 1, 1, 1, 1, 4, 3, 2, 3, 0, 3, 3, 2, 2, 1, 0, 2, 2, 3, 2, 1, 1, 3, 5, 1, 2, 4, 2, 0, 1, 0, 1, 2, 2, 2, 3, 5, 1, 2, 0, 2, 1, 0, 1, 1, 1, 3, 3, 1, 0, 1, 3, 3, 2, 1, 1, 1, 3, 1, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 6, 2, 3, 6, 1, 1, 1, 1, 1, 1, 1, 3, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY) \ { \ yychar = (Token); \ yylval = (Value); \ YYPOPSTACK (yylen); \ yystate = *yyssp; \ goto yybackup; \ } \ else \ { \ yyerror (&yylloc, yyscanner, YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (0) /* Error token number */ #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. If N is 0, then set CURRENT to the empty location which ends the previous symbol: RHS[0] (always defined). */ #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ if (N) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ } \ else \ { \ (Current).first_line = (Current).last_line = \ YYRHSLOC (Rhs, 0).last_line; \ (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ while (0) #endif #define YYRHSLOC(Rhs, K) ((Rhs)[K]) /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (0) /* YY_LOCATION_PRINT -- Print the location on the stream. This macro was not mandated originally: define only if we know we won't break user code: when these are the locations we know. */ #ifndef YY_LOCATION_PRINT # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. Private, do not rely on its existence. */ YY_ATTRIBUTE_UNUSED static unsigned yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp) { unsigned res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += YYFPRINTF (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += YYFPRINTF (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += YYFPRINTF (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += YYFPRINTF (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += YYFPRINTF (yyo, "-%d", end_col); } return res; } # define YY_LOCATION_PRINT(File, Loc) \ yy_location_print_ (File, &(Loc)) # else # define YY_LOCATION_PRINT(File, Loc) ((void) 0) # endif #endif # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Type, Value, Location, yyscanner); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) /*----------------------------------------. | Print this symbol's value on YYOUTPUT. | `----------------------------------------*/ static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, core_yyscan_t yyscanner) { FILE *yyo = yyoutput; YYUSE (yyo); YYUSE (yylocationp); YYUSE (yyscanner); if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # endif YYUSE (yytype); } /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, core_yyscan_t yyscanner) { YYFPRINTF (yyoutput, "%s %s (", yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); YY_LOCATION_PRINT (yyoutput, *yylocationp); YYFPRINTF (yyoutput, ": "); yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, yyscanner); YYFPRINTF (yyoutput, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) { int yybot = *yybottom; YYFPRINTF (stderr, " %d", yybot); } YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ static void yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, core_yyscan_t yyscanner) { unsigned long int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yystos[yyssp[yyi + 1 - yynrhs]], &(yyvsp[(yyi + 1) - (yynrhs)]) , &(yylsp[(yyi + 1) - (yynrhs)]) , yyscanner); YYFPRINTF (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyssp, yyvsp, yylsp, Rule, yyscanner); \ } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ static YYSIZE_T yystrlen (const char *yystr) { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) continue; return yylen; } # endif # endif # ifndef yystpcpy # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ static char * yystpcpy (char *yydest, const char *yysrc) { char *yyd = yydest; const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif # ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an apostrophe, a comma, or backslash (other than backslash-backslash). YYSTR is taken from yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ static YYSIZE_T yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { YYSIZE_T yyn = 0; char const *yyp = yystr; for (;;) switch (*++yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; /* Fall through. */ default: if (yyres) yyres[yyn] = *yyp; yyn++; break; case '"': if (yyres) yyres[yyn] = '\0'; return yyn; } do_not_strip_quotes: ; } if (! yyres) return yystrlen (yystr); return yystpcpy (yyres, yystr) - yyres; } # endif /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message about the unexpected token YYTOKEN for the state stack whose top is YYSSP. Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is not large enough to hold the message. In that case, also set *YYMSG_ALLOC to the required number of bytes. Return 2 if the required number of bytes is too large to store. */ static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); YYSIZE_T yysize = yysize0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ const char *yyformat = YY_NULLPTR; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per "expected"). */ int yycount = 0; /* There are many possibilities here to consider: - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected tokens because there are none. - The only way there can be no lookahead present (in yychar) is if this state is a consistent state with a default action. Thus, detecting the absence of a lookahead is sufficient to determine that there is no unexpected or expected token to report. In that case, just report a simple "syntax error". - Don't assume there isn't a lookahead just because this state is a consistent state with a default action. There might have been a previous inconsistent state, consistent state with a non-default action, or user semantic action that manipulated yychar. - Of course, the expected token list depends on states to have correct lookahead information, and it depends on the parser not to perform extra reductions after fetching a lookahead from the scanner and before detecting a syntax error. Thus, state merging (from LALR or IELR) and default reductions corrupt the expected token list. However, the list is correct for canonical LR with one exception: it will still contain any token that will not be accepted due to an error action in a later state. */ if (yytoken != YYEMPTY) { int yyn = yypact[*yyssp]; yyarg[yycount++] = yytname[yytoken]; if (!yypact_value_is_default (yyn)) { /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. In other words, skip the first -YYN actions for this state because they are default actions. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn + 1; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yyx; for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR && !yytable_value_is_error (yytable[yyx + yyn])) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { yycount = 1; yysize = yysize0; break; } yyarg[yycount++] = yytname[yyx]; { YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; yysize = yysize1; } } } } switch (yycount) { # define YYCASE_(N, S) \ case N: \ yyformat = S; \ break YYCASE_(0, YY_("syntax error")); YYCASE_(1, YY_("syntax error, unexpected %s")); YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); # undef YYCASE_ } { YYSIZE_T yysize1 = yysize + yystrlen (yyformat); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; yysize = yysize1; } if (*yymsg_alloc < yysize) { *yymsg_alloc = 2 * yysize; if (! (yysize <= *yymsg_alloc && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; return 1; } /* Avoid sprintf, as that infringes on the user's name space. Don't have undefined behavior even if the translation produced a string with the wrong number of "%s"s. */ { char *yyp = *yymsg; int yyi = 0; while ((*yyp = *yyformat) != '\0') if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) { yyp += yytnamerr (yyp, yyarg[yyi++]); yyformat += 2; } else { yyp++; yyformat++; } } return 0; } #endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, core_yyscan_t yyscanner) { YYUSE (yyvaluep); YYUSE (yylocationp); YYUSE (yyscanner); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YYUSE (yytype); YY_IGNORE_MAYBE_UNINITIALIZED_END } /*----------. | yyparse. | `----------*/ int yyparse (core_yyscan_t yyscanner) { /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ /* Default value used for initialization, for pacifying older GCCs or non-GCC compilers. */ YY_INITIAL_VALUE (static YYSTYPE yyval_default;) YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); /* Location data for the lookahead symbol. */ static YYLTYPE yyloc_default # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL = { 1, 1, 1, 1 } # endif ; YYLTYPE yylloc = yyloc_default; /* Number of syntax errors so far. */ int yynerrs; int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* The stacks and their tools: 'yyss': related to states. 'yyvs': related to semantic values. 'yyls': related to locations. Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ yytype_int16 yyssa[YYINITDEPTH]; yytype_int16 *yyss; yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs; YYSTYPE *yyvsp; /* The location stack. */ YYLTYPE yylsa[YYINITDEPTH]; YYLTYPE *yyls; YYLTYPE *yylsp; /* The locations where the error started and ended. */ YYLTYPE yyerror_range[3]; YYSIZE_T yystacksize; int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ int yytoken = 0; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; YYLTYPE yyloc; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; yyssp = yyss = yyssa; yyvsp = yyvs = yyvsa; yylsp = yyls = yylsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ yylsp[0] = yylloc; goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; YYLTYPE *yyls1 = yyls; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yyls1, yysize * sizeof (*yylsp), &yystacksize); yyls = yyls1; yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); YYSTACK_RELOCATE (yyls_alloc, yyls); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; yylsp = yyls + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); if (yystate == YYFINAL) YYACCEPT; goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = yylex (&yylval, &yylloc, yyscanner); } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yytable_value_is_error (yyn)) goto yyerrlab; yyn = -yyn; goto yyreduce; } /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the shifted token. */ yychar = YYEMPTY; yystate = yyn; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END *++yylsp = yylloc; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; /* Default location. */ YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); YY_REDUCE_PRINT (yyn); switch (yyn) { case 2: #line 722 "gram.y" /* yacc.c:1646 */ { pg_yyget_extra(yyscanner)->parsetree = (yyvsp[0].list); } #line 20811 "gram.c" /* yacc.c:1646 */ break; case 3: #line 729 "gram.y" /* yacc.c:1646 */ { if ((yyvsp[0].node) != NULL) (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); else (yyval.list) = (yyvsp[-2].list); } #line 20822 "gram.c" /* yacc.c:1646 */ break; case 4: #line 736 "gram.y" /* yacc.c:1646 */ { if ((yyvsp[0].node) != NULL) (yyval.list) = list_make1((yyvsp[0].node)); else (yyval.list) = NIL; } #line 20833 "gram.c" /* yacc.c:1646 */ break; case 121: #line 862 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 20839 "gram.c" /* yacc.c:1646 */ break; case 122: #line 873 "gram.y" /* yacc.c:1646 */ { CreateRoleStmt *n = makeNode(CreateRoleStmt); n->stmt_type = ROLESTMT_ROLE; n->role = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 20851 "gram.c" /* yacc.c:1646 */ break; case 123: #line 883 "gram.y" /* yacc.c:1646 */ {} #line 20857 "gram.c" /* yacc.c:1646 */ break; case 124: #line 884 "gram.y" /* yacc.c:1646 */ {} #line 20863 "gram.c" /* yacc.c:1646 */ break; case 125: #line 893 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 20869 "gram.c" /* yacc.c:1646 */ break; case 126: #line 894 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 20875 "gram.c" /* yacc.c:1646 */ break; case 127: #line 898 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 20881 "gram.c" /* yacc.c:1646 */ break; case 128: #line 899 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 20887 "gram.c" /* yacc.c:1646 */ break; case 129: #line 904 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("password", (Node *)makeString((yyvsp[0].str))); } #line 20896 "gram.c" /* yacc.c:1646 */ break; case 130: #line 909 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("password", NULL); } #line 20904 "gram.c" /* yacc.c:1646 */ break; case 131: #line 913 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("encryptedPassword", (Node *)makeString((yyvsp[0].str))); } #line 20913 "gram.c" /* yacc.c:1646 */ break; case 132: #line 918 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("unencryptedPassword", (Node *)makeString((yyvsp[0].str))); } #line 20922 "gram.c" /* yacc.c:1646 */ break; case 133: #line 923 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("inherit", (Node *)makeInteger(TRUE)); } #line 20930 "gram.c" /* yacc.c:1646 */ break; case 134: #line 927 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("connectionlimit", (Node *)makeInteger((yyvsp[0].ival))); } #line 20938 "gram.c" /* yacc.c:1646 */ break; case 135: #line 931 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("validUntil", (Node *)makeString((yyvsp[0].str))); } #line 20946 "gram.c" /* yacc.c:1646 */ break; case 136: #line 936 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("rolemembers", (Node *)(yyvsp[0].list)); } #line 20954 "gram.c" /* yacc.c:1646 */ break; case 137: #line 940 "gram.y" /* yacc.c:1646 */ { /* * We handle identifiers that aren't parser keywords with * the following special-case codes, to avoid bloating the * size of the main parser. */ if (strcmp((yyvsp[0].str), "superuser") == 0) (yyval.defelt) = makeDefElem("superuser", (Node *)makeInteger(TRUE)); else if (strcmp((yyvsp[0].str), "nosuperuser") == 0) (yyval.defelt) = makeDefElem("superuser", (Node *)makeInteger(FALSE)); else if (strcmp((yyvsp[0].str), "createuser") == 0) { /* For backwards compatibility, synonym for SUPERUSER */ (yyval.defelt) = makeDefElem("superuser", (Node *)makeInteger(TRUE)); } else if (strcmp((yyvsp[0].str), "nocreateuser") == 0) { /* For backwards compatibility, synonym for SUPERUSER */ (yyval.defelt) = makeDefElem("superuser", (Node *)makeInteger(FALSE)); } else if (strcmp((yyvsp[0].str), "createrole") == 0) (yyval.defelt) = makeDefElem("createrole", (Node *)makeInteger(TRUE)); else if (strcmp((yyvsp[0].str), "nocreaterole") == 0) (yyval.defelt) = makeDefElem("createrole", (Node *)makeInteger(FALSE)); else if (strcmp((yyvsp[0].str), "replication") == 0) (yyval.defelt) = makeDefElem("isreplication", (Node *)makeInteger(TRUE)); else if (strcmp((yyvsp[0].str), "noreplication") == 0) (yyval.defelt) = makeDefElem("isreplication", (Node *)makeInteger(FALSE)); else if (strcmp((yyvsp[0].str), "createdb") == 0) (yyval.defelt) = makeDefElem("createdb", (Node *)makeInteger(TRUE)); else if (strcmp((yyvsp[0].str), "nocreatedb") == 0) (yyval.defelt) = makeDefElem("createdb", (Node *)makeInteger(FALSE)); else if (strcmp((yyvsp[0].str), "login") == 0) (yyval.defelt) = makeDefElem("canlogin", (Node *)makeInteger(TRUE)); else if (strcmp((yyvsp[0].str), "nologin") == 0) (yyval.defelt) = makeDefElem("canlogin", (Node *)makeInteger(FALSE)); else if (strcmp((yyvsp[0].str), "noinherit") == 0) { /* * Note that INHERIT is a keyword, so it's handled by main parser, but * NOINHERIT is handled here. */ (yyval.defelt) = makeDefElem("inherit", (Node *)makeInteger(FALSE)); } else ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("unrecognized role option \"%s\"", (yyvsp[0].str)), parser_errposition((yylsp[0])))); } #line 21009 "gram.c" /* yacc.c:1646 */ break; case 138: #line 993 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = (yyvsp[0].defelt); } #line 21015 "gram.c" /* yacc.c:1646 */ break; case 139: #line 996 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("sysid", (Node *)makeInteger((yyvsp[0].ival))); } #line 21023 "gram.c" /* yacc.c:1646 */ break; case 140: #line 1000 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("adminmembers", (Node *)(yyvsp[0].list)); } #line 21031 "gram.c" /* yacc.c:1646 */ break; case 141: #line 1004 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("rolemembers", (Node *)(yyvsp[0].list)); } #line 21039 "gram.c" /* yacc.c:1646 */ break; case 142: #line 1008 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("addroleto", (Node *)(yyvsp[0].list)); } #line 21047 "gram.c" /* yacc.c:1646 */ break; case 143: #line 1012 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("addroleto", (Node *)(yyvsp[0].list)); } #line 21055 "gram.c" /* yacc.c:1646 */ break; case 144: #line 1026 "gram.y" /* yacc.c:1646 */ { CreateRoleStmt *n = makeNode(CreateRoleStmt); n->stmt_type = ROLESTMT_USER; n->role = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 21067 "gram.c" /* yacc.c:1646 */ break; case 145: #line 1044 "gram.y" /* yacc.c:1646 */ { AlterRoleStmt *n = makeNode(AlterRoleStmt); n->role = (yyvsp[-2].str); n->action = +1; /* add, if there are members */ n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 21079 "gram.c" /* yacc.c:1646 */ break; case 146: #line 1054 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 21085 "gram.c" /* yacc.c:1646 */ break; case 147: #line 1055 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 21091 "gram.c" /* yacc.c:1646 */ break; case 148: #line 1060 "gram.y" /* yacc.c:1646 */ { AlterRoleSetStmt *n = makeNode(AlterRoleSetStmt); n->role = (yyvsp[-2].str); n->database = (yyvsp[-1].str); n->setstmt = (yyvsp[0].vsetstmt); (yyval.node) = (Node *)n; } #line 21103 "gram.c" /* yacc.c:1646 */ break; case 149: #line 1068 "gram.y" /* yacc.c:1646 */ { AlterRoleSetStmt *n = makeNode(AlterRoleSetStmt); n->role = NULL; n->database = (yyvsp[-1].str); n->setstmt = (yyvsp[0].vsetstmt); (yyval.node) = (Node *)n; } #line 21115 "gram.c" /* yacc.c:1646 */ break; case 150: #line 1086 "gram.y" /* yacc.c:1646 */ { AlterRoleStmt *n = makeNode(AlterRoleStmt); n->role = (yyvsp[-2].str); n->action = +1; /* add, if there are members */ n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 21127 "gram.c" /* yacc.c:1646 */ break; case 151: #line 1098 "gram.y" /* yacc.c:1646 */ { AlterRoleSetStmt *n = makeNode(AlterRoleSetStmt); n->role = (yyvsp[-1].str); n->database = NULL; n->setstmt = (yyvsp[0].vsetstmt); (yyval.node) = (Node *)n; } #line 21139 "gram.c" /* yacc.c:1646 */ break; case 152: #line 1119 "gram.y" /* yacc.c:1646 */ { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = FALSE; n->roles = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 21150 "gram.c" /* yacc.c:1646 */ break; case 153: #line 1126 "gram.y" /* yacc.c:1646 */ { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = TRUE; n->roles = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 21161 "gram.c" /* yacc.c:1646 */ break; case 154: #line 1145 "gram.y" /* yacc.c:1646 */ { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = FALSE; n->roles = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 21172 "gram.c" /* yacc.c:1646 */ break; case 155: #line 1152 "gram.y" /* yacc.c:1646 */ { DropRoleStmt *n = makeNode(DropRoleStmt); n->roles = (yyvsp[0].list); n->missing_ok = TRUE; (yyval.node) = (Node *)n; } #line 21183 "gram.c" /* yacc.c:1646 */ break; case 156: #line 1169 "gram.y" /* yacc.c:1646 */ { CreateRoleStmt *n = makeNode(CreateRoleStmt); n->stmt_type = ROLESTMT_GROUP; n->role = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 21195 "gram.c" /* yacc.c:1646 */ break; case 157: #line 1187 "gram.y" /* yacc.c:1646 */ { AlterRoleStmt *n = makeNode(AlterRoleStmt); n->role = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->options = list_make1(makeDefElem("rolemembers", (Node *)(yyvsp[0].list))); (yyval.node) = (Node *)n; } #line 21208 "gram.c" /* yacc.c:1646 */ break; case 158: #line 1197 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = +1; } #line 21214 "gram.c" /* yacc.c:1646 */ break; case 159: #line 1198 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = -1; } #line 21220 "gram.c" /* yacc.c:1646 */ break; case 160: #line 1211 "gram.y" /* yacc.c:1646 */ { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = FALSE; n->roles = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 21231 "gram.c" /* yacc.c:1646 */ break; case 161: #line 1218 "gram.y" /* yacc.c:1646 */ { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = TRUE; n->roles = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 21242 "gram.c" /* yacc.c:1646 */ break; case 162: #line 1235 "gram.y" /* yacc.c:1646 */ { CreateSchemaStmt *n = makeNode(CreateSchemaStmt); /* One can omit the schema name or the authorization id. */ if ((yyvsp[-3].str) != NULL) n->schemaname = (yyvsp[-3].str); else n->schemaname = (yyvsp[-1].str); n->authid = (yyvsp[-1].str); n->schemaElts = (yyvsp[0].list); n->if_not_exists = false; (yyval.node) = (Node *)n; } #line 21259 "gram.c" /* yacc.c:1646 */ break; case 163: #line 1248 "gram.y" /* yacc.c:1646 */ { CreateSchemaStmt *n = makeNode(CreateSchemaStmt); /* ...but not both */ n->schemaname = (yyvsp[-1].str); n->authid = NULL; n->schemaElts = (yyvsp[0].list); n->if_not_exists = false; (yyval.node) = (Node *)n; } #line 21273 "gram.c" /* yacc.c:1646 */ break; case 164: #line 1258 "gram.y" /* yacc.c:1646 */ { CreateSchemaStmt *n = makeNode(CreateSchemaStmt); /* One can omit the schema name or the authorization id. */ if ((yyvsp[-3].str) != NULL) n->schemaname = (yyvsp[-3].str); else n->schemaname = (yyvsp[-1].str); n->authid = (yyvsp[-1].str); if ((yyvsp[0].list) != NIL) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("CREATE SCHEMA IF NOT EXISTS cannot include schema elements"), parser_errposition((yylsp[0])))); n->schemaElts = (yyvsp[0].list); n->if_not_exists = true; (yyval.node) = (Node *)n; } #line 21295 "gram.c" /* yacc.c:1646 */ break; case 165: #line 1276 "gram.y" /* yacc.c:1646 */ { CreateSchemaStmt *n = makeNode(CreateSchemaStmt); /* ...but not both */ n->schemaname = (yyvsp[-1].str); n->authid = NULL; if ((yyvsp[0].list) != NIL) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("CREATE SCHEMA IF NOT EXISTS cannot include schema elements"), parser_errposition((yylsp[0])))); n->schemaElts = (yyvsp[0].list); n->if_not_exists = true; (yyval.node) = (Node *)n; } #line 21314 "gram.c" /* yacc.c:1646 */ break; case 166: #line 1293 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 21320 "gram.c" /* yacc.c:1646 */ break; case 167: #line 1294 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 21326 "gram.c" /* yacc.c:1646 */ break; case 168: #line 1299 "gram.y" /* yacc.c:1646 */ { if ((yyloc) < 0) /* see comments for YYLLOC_DEFAULT */ (yyloc) = (yylsp[0]); (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 21336 "gram.c" /* yacc.c:1646 */ break; case 169: #line 1305 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 21342 "gram.c" /* yacc.c:1646 */ break; case 176: #line 1333 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->is_local = false; (yyval.node) = (Node *) n; } #line 21352 "gram.c" /* yacc.c:1646 */ break; case 177: #line 1339 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->is_local = true; (yyval.node) = (Node *) n; } #line 21362 "gram.c" /* yacc.c:1646 */ break; case 178: #line 1345 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->is_local = false; (yyval.node) = (Node *) n; } #line 21372 "gram.c" /* yacc.c:1646 */ break; case 179: #line 1354 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_MULTI; n->name = "TRANSACTION"; n->args = (yyvsp[0].list); (yyval.vsetstmt) = n; } #line 21384 "gram.c" /* yacc.c:1646 */ break; case 180: #line 1362 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_MULTI; n->name = "SESSION CHARACTERISTICS"; n->args = (yyvsp[0].list); (yyval.vsetstmt) = n; } #line 21396 "gram.c" /* yacc.c:1646 */ break; case 182: #line 1374 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_VALUE; n->name = (yyvsp[-2].str); n->args = (yyvsp[0].list); (yyval.vsetstmt) = n; } #line 21408 "gram.c" /* yacc.c:1646 */ break; case 183: #line 1382 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_VALUE; n->name = (yyvsp[-2].str); n->args = (yyvsp[0].list); (yyval.vsetstmt) = n; } #line 21420 "gram.c" /* yacc.c:1646 */ break; case 184: #line 1390 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_DEFAULT; n->name = (yyvsp[-2].str); (yyval.vsetstmt) = n; } #line 21431 "gram.c" /* yacc.c:1646 */ break; case 185: #line 1397 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_DEFAULT; n->name = (yyvsp[-2].str); (yyval.vsetstmt) = n; } #line 21442 "gram.c" /* yacc.c:1646 */ break; case 186: #line 1405 "gram.y" /* yacc.c:1646 */ {(yyval.vsetstmt) = (yyvsp[0].vsetstmt);} #line 21448 "gram.c" /* yacc.c:1646 */ break; case 187: #line 1407 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_CURRENT; n->name = (yyvsp[-2].str); (yyval.vsetstmt) = n; } #line 21459 "gram.c" /* yacc.c:1646 */ break; case 188: #line 1415 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_VALUE; n->name = "timezone"; if ((yyvsp[0].node) != NULL) n->args = list_make1((yyvsp[0].node)); else n->kind = VAR_SET_DEFAULT; (yyval.vsetstmt) = n; } #line 21474 "gram.c" /* yacc.c:1646 */ break; case 189: #line 1426 "gram.y" /* yacc.c:1646 */ { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("current database cannot be changed"), parser_errposition((yylsp[0])))); (yyval.vsetstmt) = NULL; /*not reached*/ } #line 21486 "gram.c" /* yacc.c:1646 */ break; case 190: #line 1434 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_VALUE; n->name = "search_path"; n->args = list_make1(makeStringConst((yyvsp[0].str), (yylsp[0]))); (yyval.vsetstmt) = n; } #line 21498 "gram.c" /* yacc.c:1646 */ break; case 191: #line 1442 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_VALUE; n->name = "client_encoding"; if ((yyvsp[0].str) != NULL) n->args = list_make1(makeStringConst((yyvsp[0].str), (yylsp[0]))); else n->kind = VAR_SET_DEFAULT; (yyval.vsetstmt) = n; } #line 21513 "gram.c" /* yacc.c:1646 */ break; case 192: #line 1453 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_VALUE; n->name = "role"; n->args = list_make1(makeStringConst((yyvsp[0].str), (yylsp[0]))); (yyval.vsetstmt) = n; } #line 21525 "gram.c" /* yacc.c:1646 */ break; case 193: #line 1461 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_VALUE; n->name = "session_authorization"; n->args = list_make1(makeStringConst((yyvsp[0].str), (yylsp[0]))); (yyval.vsetstmt) = n; } #line 21537 "gram.c" /* yacc.c:1646 */ break; case 194: #line 1469 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_DEFAULT; n->name = "session_authorization"; (yyval.vsetstmt) = n; } #line 21548 "gram.c" /* yacc.c:1646 */ break; case 195: #line 1476 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_VALUE; n->name = "xmloption"; n->args = list_make1(makeStringConst((yyvsp[0].ival) == XMLOPTION_DOCUMENT ? "DOCUMENT" : "CONTENT", (yylsp[0]))); (yyval.vsetstmt) = n; } #line 21560 "gram.c" /* yacc.c:1646 */ break; case 196: #line 1485 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_MULTI; n->name = "TRANSACTION SNAPSHOT"; n->args = list_make1(makeStringConst((yyvsp[0].str), (yylsp[0]))); (yyval.vsetstmt) = n; } #line 21572 "gram.c" /* yacc.c:1646 */ break; case 197: #line 1494 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 21578 "gram.c" /* yacc.c:1646 */ break; case 198: #line 1496 "gram.y" /* yacc.c:1646 */ { (yyval.str) = psprintf("%s.%s", (yyvsp[-2].str), (yyvsp[0].str)); } #line 21584 "gram.c" /* yacc.c:1646 */ break; case 199: #line 1499 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 21590 "gram.c" /* yacc.c:1646 */ break; case 200: #line 1500 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 21596 "gram.c" /* yacc.c:1646 */ break; case 201: #line 1504 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeStringConst((yyvsp[0].str), (yylsp[0])); } #line 21602 "gram.c" /* yacc.c:1646 */ break; case 202: #line 1506 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeAConst((yyvsp[0].value), (yylsp[0])); } #line 21608 "gram.c" /* yacc.c:1646 */ break; case 203: #line 1509 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "read uncommitted"; } #line 21614 "gram.c" /* yacc.c:1646 */ break; case 204: #line 1510 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "read committed"; } #line 21620 "gram.c" /* yacc.c:1646 */ break; case 205: #line 1511 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "repeatable read"; } #line 21626 "gram.c" /* yacc.c:1646 */ break; case 206: #line 1512 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "serializable"; } #line 21632 "gram.c" /* yacc.c:1646 */ break; case 207: #line 1516 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "true"; } #line 21638 "gram.c" /* yacc.c:1646 */ break; case 208: #line 1517 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "false"; } #line 21644 "gram.c" /* yacc.c:1646 */ break; case 209: #line 1518 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "on"; } #line 21650 "gram.c" /* yacc.c:1646 */ break; case 210: #line 1524 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 21656 "gram.c" /* yacc.c:1646 */ break; case 211: #line 1537 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeStringConst((yyvsp[0].str), (yylsp[0])); } #line 21664 "gram.c" /* yacc.c:1646 */ break; case 212: #line 1541 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeStringConst((yyvsp[0].str), (yylsp[0])); } #line 21672 "gram.c" /* yacc.c:1646 */ break; case 213: #line 1545 "gram.y" /* yacc.c:1646 */ { TypeName *t = (yyvsp[-2].typnam); if ((yyvsp[0].list) != NIL) { A_Const *n = (A_Const *) linitial((yyvsp[0].list)); if ((n->val.val.ival & ~(INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE))) != 0) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("time zone interval must be HOUR or HOUR TO MINUTE"), parser_errposition((yylsp[0])))); } t->typmods = (yyvsp[0].list); (yyval.node) = makeStringConstCast((yyvsp[-1].str), (yylsp[-1]), t); } #line 21691 "gram.c" /* yacc.c:1646 */ break; case 214: #line 1560 "gram.y" /* yacc.c:1646 */ { TypeName *t = (yyvsp[-5].typnam); if ((yyvsp[0].list) != NIL) { A_Const *n = (A_Const *) linitial((yyvsp[0].list)); if ((n->val.val.ival & ~(INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE))) != 0) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("time zone interval must be HOUR or HOUR TO MINUTE"), parser_errposition((yylsp[0])))); if (list_length((yyvsp[0].list)) != 1) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("interval precision specified twice"), parser_errposition((yylsp[-5])))); t->typmods = lappend((yyvsp[0].list), makeIntConst((yyvsp[-3].ival), (yylsp[-3]))); } else t->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1), makeIntConst((yyvsp[-3].ival), (yylsp[-3]))); (yyval.node) = makeStringConstCast((yyvsp[-1].str), (yylsp[-1]), t); } #line 21718 "gram.c" /* yacc.c:1646 */ break; case 215: #line 1582 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeAConst((yyvsp[0].value), (yylsp[0])); } #line 21724 "gram.c" /* yacc.c:1646 */ break; case 216: #line 1583 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 21730 "gram.c" /* yacc.c:1646 */ break; case 217: #line 1584 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 21736 "gram.c" /* yacc.c:1646 */ break; case 218: #line 1588 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 21742 "gram.c" /* yacc.c:1646 */ break; case 219: #line 1589 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 21748 "gram.c" /* yacc.c:1646 */ break; case 220: #line 1590 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 21754 "gram.c" /* yacc.c:1646 */ break; case 221: #line 1594 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 21760 "gram.c" /* yacc.c:1646 */ break; case 222: #line 1595 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 21766 "gram.c" /* yacc.c:1646 */ break; case 223: #line 1600 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 21777 "gram.c" /* yacc.c:1646 */ break; case 224: #line 1607 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = "timezone"; (yyval.node) = (Node *) n; } #line 21788 "gram.c" /* yacc.c:1646 */ break; case 225: #line 1614 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = "transaction_isolation"; (yyval.node) = (Node *) n; } #line 21799 "gram.c" /* yacc.c:1646 */ break; case 226: #line 1621 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = "session_authorization"; (yyval.node) = (Node *) n; } #line 21810 "gram.c" /* yacc.c:1646 */ break; case 227: #line 1628 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET_ALL; (yyval.node) = (Node *) n; } #line 21820 "gram.c" /* yacc.c:1646 */ break; case 228: #line 1637 "gram.y" /* yacc.c:1646 */ { (yyval.vsetstmt) = (yyvsp[0].vsetstmt); } #line 21826 "gram.c" /* yacc.c:1646 */ break; case 229: #line 1638 "gram.y" /* yacc.c:1646 */ { (yyval.vsetstmt) = (VariableSetStmt *) (yyvsp[0].node); } #line 21832 "gram.c" /* yacc.c:1646 */ break; case 230: #line 1643 "gram.y" /* yacc.c:1646 */ { (yyval.vsetstmt) = (yyvsp[0].vsetstmt); } #line 21838 "gram.c" /* yacc.c:1646 */ break; case 231: #line 1644 "gram.y" /* yacc.c:1646 */ { (yyval.vsetstmt) = (VariableSetStmt *) (yyvsp[0].node); } #line 21844 "gram.c" /* yacc.c:1646 */ break; case 232: #line 1650 "gram.y" /* yacc.c:1646 */ { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 21854 "gram.c" /* yacc.c:1646 */ break; case 233: #line 1656 "gram.y" /* yacc.c:1646 */ { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = "timezone"; (yyval.node) = (Node *) n; } #line 21864 "gram.c" /* yacc.c:1646 */ break; case 234: #line 1662 "gram.y" /* yacc.c:1646 */ { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = "transaction_isolation"; (yyval.node) = (Node *) n; } #line 21874 "gram.c" /* yacc.c:1646 */ break; case 235: #line 1668 "gram.y" /* yacc.c:1646 */ { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = "session_authorization"; (yyval.node) = (Node *) n; } #line 21884 "gram.c" /* yacc.c:1646 */ break; case 236: #line 1674 "gram.y" /* yacc.c:1646 */ { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = "all"; (yyval.node) = (Node *) n; } #line 21894 "gram.c" /* yacc.c:1646 */ break; case 237: #line 1684 "gram.y" /* yacc.c:1646 */ { ConstraintsSetStmt *n = makeNode(ConstraintsSetStmt); n->constraints = (yyvsp[-1].list); n->deferred = (yyvsp[0].boolean); (yyval.node) = (Node *) n; } #line 21905 "gram.c" /* yacc.c:1646 */ break; case 238: #line 1693 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 21911 "gram.c" /* yacc.c:1646 */ break; case 239: #line 1694 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 21917 "gram.c" /* yacc.c:1646 */ break; case 240: #line 1698 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = TRUE; } #line 21923 "gram.c" /* yacc.c:1646 */ break; case 241: #line 1699 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = FALSE; } #line 21929 "gram.c" /* yacc.c:1646 */ break; case 242: #line 1708 "gram.y" /* yacc.c:1646 */ { CheckPointStmt *n = makeNode(CheckPointStmt); (yyval.node) = (Node *)n; } #line 21938 "gram.c" /* yacc.c:1646 */ break; case 243: #line 1723 "gram.y" /* yacc.c:1646 */ { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_ALL; (yyval.node) = (Node *) n; } #line 21948 "gram.c" /* yacc.c:1646 */ break; case 244: #line 1729 "gram.y" /* yacc.c:1646 */ { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_TEMP; (yyval.node) = (Node *) n; } #line 21958 "gram.c" /* yacc.c:1646 */ break; case 245: #line 1735 "gram.y" /* yacc.c:1646 */ { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_TEMP; (yyval.node) = (Node *) n; } #line 21968 "gram.c" /* yacc.c:1646 */ break; case 246: #line 1741 "gram.y" /* yacc.c:1646 */ { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_PLANS; (yyval.node) = (Node *) n; } #line 21978 "gram.c" /* yacc.c:1646 */ break; case 247: #line 1747 "gram.y" /* yacc.c:1646 */ { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_SEQUENCES; (yyval.node) = (Node *) n; } #line 21988 "gram.c" /* yacc.c:1646 */ break; case 248: #line 1766 "gram.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->relkind = OBJECT_TABLE; n->missing_ok = false; (yyval.node) = (Node *)n; } #line 22001 "gram.c" /* yacc.c:1646 */ break; case 249: #line 1775 "gram.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->relkind = OBJECT_TABLE; n->missing_ok = true; (yyval.node) = (Node *)n; } #line 22014 "gram.c" /* yacc.c:1646 */ break; case 250: #line 1784 "gram.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->relkind = OBJECT_INDEX; n->missing_ok = false; (yyval.node) = (Node *)n; } #line 22027 "gram.c" /* yacc.c:1646 */ break; case 251: #line 1793 "gram.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->relkind = OBJECT_INDEX; n->missing_ok = true; (yyval.node) = (Node *)n; } #line 22040 "gram.c" /* yacc.c:1646 */ break; case 252: #line 1802 "gram.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->relkind = OBJECT_SEQUENCE; n->missing_ok = false; (yyval.node) = (Node *)n; } #line 22053 "gram.c" /* yacc.c:1646 */ break; case 253: #line 1811 "gram.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->relkind = OBJECT_SEQUENCE; n->missing_ok = true; (yyval.node) = (Node *)n; } #line 22066 "gram.c" /* yacc.c:1646 */ break; case 254: #line 1820 "gram.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->relkind = OBJECT_VIEW; n->missing_ok = false; (yyval.node) = (Node *)n; } #line 22079 "gram.c" /* yacc.c:1646 */ break; case 255: #line 1829 "gram.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->relkind = OBJECT_VIEW; n->missing_ok = true; (yyval.node) = (Node *)n; } #line 22092 "gram.c" /* yacc.c:1646 */ break; case 256: #line 1838 "gram.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->relkind = OBJECT_MATVIEW; n->missing_ok = false; (yyval.node) = (Node *)n; } #line 22105 "gram.c" /* yacc.c:1646 */ break; case 257: #line 1847 "gram.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->relkind = OBJECT_MATVIEW; n->missing_ok = true; (yyval.node) = (Node *)n; } #line 22118 "gram.c" /* yacc.c:1646 */ break; case 258: #line 1858 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 22124 "gram.c" /* yacc.c:1646 */ break; case 259: #line 1859 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 22130 "gram.c" /* yacc.c:1646 */ break; case 260: #line 1865 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddColumn; n->def = (yyvsp[0].node); (yyval.node) = (Node *)n; } #line 22141 "gram.c" /* yacc.c:1646 */ break; case 261: #line 1873 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddColumn; n->def = (yyvsp[0].node); (yyval.node) = (Node *)n; } #line 22152 "gram.c" /* yacc.c:1646 */ break; case 262: #line 1881 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ColumnDefault; n->name = (yyvsp[-1].str); n->def = (yyvsp[0].node); (yyval.node) = (Node *)n; } #line 22164 "gram.c" /* yacc.c:1646 */ break; case 263: #line 1890 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropNotNull; n->name = (yyvsp[-3].str); (yyval.node) = (Node *)n; } #line 22175 "gram.c" /* yacc.c:1646 */ break; case 264: #line 1898 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetNotNull; n->name = (yyvsp[-3].str); (yyval.node) = (Node *)n; } #line 22186 "gram.c" /* yacc.c:1646 */ break; case 265: #line 1906 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetStatistics; n->name = (yyvsp[-3].str); n->def = (Node *) makeInteger((yyvsp[0].ival)); (yyval.node) = (Node *)n; } #line 22198 "gram.c" /* yacc.c:1646 */ break; case 266: #line 1915 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetOptions; n->name = (yyvsp[-2].str); n->def = (Node *) (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 22210 "gram.c" /* yacc.c:1646 */ break; case 267: #line 1924 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ResetOptions; n->name = (yyvsp[-2].str); n->def = (Node *) (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 22222 "gram.c" /* yacc.c:1646 */ break; case 268: #line 1933 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetStorage; n->name = (yyvsp[-3].str); n->def = (Node *) makeString((yyvsp[0].str)); (yyval.node) = (Node *)n; } #line 22234 "gram.c" /* yacc.c:1646 */ break; case 269: #line 1942 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropColumn; n->name = (yyvsp[-1].str); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = TRUE; (yyval.node) = (Node *)n; } #line 22247 "gram.c" /* yacc.c:1646 */ break; case 270: #line 1952 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropColumn; n->name = (yyvsp[-1].str); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = FALSE; (yyval.node) = (Node *)n; } #line 22260 "gram.c" /* yacc.c:1646 */ break; case 271: #line 1965 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); ColumnDef *def = makeNode(ColumnDef); n->subtype = AT_AlterColumnType; n->name = (yyvsp[-5].str); n->def = (Node *) def; /* We only use these fields of the ColumnDef node */ def->typeName = (yyvsp[-2].typnam); def->collClause = (CollateClause *) (yyvsp[-1].node); def->raw_default = (yyvsp[0].node); def->location = (yylsp[-5]); (yyval.node) = (Node *)n; } #line 22278 "gram.c" /* yacc.c:1646 */ break; case 272: #line 1980 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AlterColumnGenericOptions; n->name = (yyvsp[-1].str); n->def = (Node *) (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 22290 "gram.c" /* yacc.c:1646 */ break; case 273: #line 1989 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddConstraint; n->def = (yyvsp[0].node); (yyval.node) = (Node *)n; } #line 22301 "gram.c" /* yacc.c:1646 */ break; case 274: #line 1997 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); Constraint *c = makeNode(Constraint); n->subtype = AT_AlterConstraint; n->def = (Node *) c; c->contype = CONSTR_FOREIGN; /* others not supported, yet */ c->conname = (yyvsp[-1].str); processCASbits((yyvsp[0].ival), (yylsp[0]), "ALTER CONSTRAINT statement", &c->deferrable, &c->initdeferred, NULL, NULL, yyscanner); (yyval.node) = (Node *)n; } #line 22319 "gram.c" /* yacc.c:1646 */ break; case 275: #line 2012 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ValidateConstraint; n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 22330 "gram.c" /* yacc.c:1646 */ break; case 276: #line 2020 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropConstraint; n->name = (yyvsp[-1].str); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = TRUE; (yyval.node) = (Node *)n; } #line 22343 "gram.c" /* yacc.c:1646 */ break; case 277: #line 2030 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropConstraint; n->name = (yyvsp[-1].str); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = FALSE; (yyval.node) = (Node *)n; } #line 22356 "gram.c" /* yacc.c:1646 */ break; case 278: #line 2040 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddOids; (yyval.node) = (Node *)n; } #line 22366 "gram.c" /* yacc.c:1646 */ break; case 279: #line 2047 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropOids; (yyval.node) = (Node *)n; } #line 22376 "gram.c" /* yacc.c:1646 */ break; case 280: #line 2054 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ClusterOn; n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 22387 "gram.c" /* yacc.c:1646 */ break; case 281: #line 2062 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropCluster; n->name = NULL; (yyval.node) = (Node *)n; } #line 22398 "gram.c" /* yacc.c:1646 */ break; case 282: #line 2070 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableTrig; n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 22409 "gram.c" /* yacc.c:1646 */ break; case 283: #line 2078 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableAlwaysTrig; n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 22420 "gram.c" /* yacc.c:1646 */ break; case 284: #line 2086 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableReplicaTrig; n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 22431 "gram.c" /* yacc.c:1646 */ break; case 285: #line 2094 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableTrigAll; (yyval.node) = (Node *)n; } #line 22441 "gram.c" /* yacc.c:1646 */ break; case 286: #line 2101 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableTrigUser; (yyval.node) = (Node *)n; } #line 22451 "gram.c" /* yacc.c:1646 */ break; case 287: #line 2108 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableTrig; n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 22462 "gram.c" /* yacc.c:1646 */ break; case 288: #line 2116 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableTrigAll; (yyval.node) = (Node *)n; } #line 22472 "gram.c" /* yacc.c:1646 */ break; case 289: #line 2123 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableTrigUser; (yyval.node) = (Node *)n; } #line 22482 "gram.c" /* yacc.c:1646 */ break; case 290: #line 2130 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableRule; n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 22493 "gram.c" /* yacc.c:1646 */ break; case 291: #line 2138 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableAlwaysRule; n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 22504 "gram.c" /* yacc.c:1646 */ break; case 292: #line 2146 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableReplicaRule; n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 22515 "gram.c" /* yacc.c:1646 */ break; case 293: #line 2154 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableRule; n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 22526 "gram.c" /* yacc.c:1646 */ break; case 294: #line 2162 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddInherit; n->def = (Node *) (yyvsp[0].range); (yyval.node) = (Node *)n; } #line 22537 "gram.c" /* yacc.c:1646 */ break; case 295: #line 2170 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropInherit; n->def = (Node *) (yyvsp[0].range); (yyval.node) = (Node *)n; } #line 22548 "gram.c" /* yacc.c:1646 */ break; case 296: #line 2178 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); TypeName *def = makeTypeNameFromNameList((yyvsp[0].list)); def->location = (yylsp[0]); n->subtype = AT_AddOf; n->def = (Node *) def; (yyval.node) = (Node *)n; } #line 22561 "gram.c" /* yacc.c:1646 */ break; case 297: #line 2188 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropOf; (yyval.node) = (Node *)n; } #line 22571 "gram.c" /* yacc.c:1646 */ break; case 298: #line 2195 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ChangeOwner; n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 22582 "gram.c" /* yacc.c:1646 */ break; case 299: #line 2203 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetTableSpace; n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 22593 "gram.c" /* yacc.c:1646 */ break; case 300: #line 2211 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetRelOptions; n->def = (Node *)(yyvsp[0].list); (yyval.node) = (Node *)n; } #line 22604 "gram.c" /* yacc.c:1646 */ break; case 301: #line 2219 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ResetRelOptions; n->def = (Node *)(yyvsp[0].list); (yyval.node) = (Node *)n; } #line 22615 "gram.c" /* yacc.c:1646 */ break; case 302: #line 2227 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ReplicaIdentity; n->def = (yyvsp[0].node); (yyval.node) = (Node *)n; } #line 22626 "gram.c" /* yacc.c:1646 */ break; case 303: #line 2234 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_GenericOptions; n->def = (Node *)(yyvsp[0].list); (yyval.node) = (Node *) n; } #line 22637 "gram.c" /* yacc.c:1646 */ break; case 304: #line 2243 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 22643 "gram.c" /* yacc.c:1646 */ break; case 305: #line 2244 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 22649 "gram.c" /* yacc.c:1646 */ break; case 306: #line 2248 "gram.y" /* yacc.c:1646 */ { (yyval.dbehavior) = DROP_CASCADE; } #line 22655 "gram.c" /* yacc.c:1646 */ break; case 307: #line 2249 "gram.y" /* yacc.c:1646 */ { (yyval.dbehavior) = DROP_RESTRICT; } #line 22661 "gram.c" /* yacc.c:1646 */ break; case 308: #line 2250 "gram.y" /* yacc.c:1646 */ { (yyval.dbehavior) = DROP_RESTRICT; /* default */ } #line 22667 "gram.c" /* yacc.c:1646 */ break; case 309: #line 2255 "gram.y" /* yacc.c:1646 */ { CollateClause *n = makeNode(CollateClause); n->arg = NULL; n->collname = (yyvsp[0].list); n->location = (yylsp[-1]); (yyval.node) = (Node *) n; } #line 22679 "gram.c" /* yacc.c:1646 */ break; case 310: #line 2262 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 22685 "gram.c" /* yacc.c:1646 */ break; case 311: #line 2266 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 22691 "gram.c" /* yacc.c:1646 */ break; case 312: #line 2267 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 22697 "gram.c" /* yacc.c:1646 */ break; case 313: #line 2272 "gram.y" /* yacc.c:1646 */ { ReplicaIdentityStmt *n = makeNode(ReplicaIdentityStmt); n->identity_type = REPLICA_IDENTITY_NOTHING; n->name = NULL; (yyval.node) = (Node *) n; } #line 22708 "gram.c" /* yacc.c:1646 */ break; case 314: #line 2279 "gram.y" /* yacc.c:1646 */ { ReplicaIdentityStmt *n = makeNode(ReplicaIdentityStmt); n->identity_type = REPLICA_IDENTITY_FULL; n->name = NULL; (yyval.node) = (Node *) n; } #line 22719 "gram.c" /* yacc.c:1646 */ break; case 315: #line 2286 "gram.y" /* yacc.c:1646 */ { ReplicaIdentityStmt *n = makeNode(ReplicaIdentityStmt); n->identity_type = REPLICA_IDENTITY_DEFAULT; n->name = NULL; (yyval.node) = (Node *) n; } #line 22730 "gram.c" /* yacc.c:1646 */ break; case 316: #line 2293 "gram.y" /* yacc.c:1646 */ { ReplicaIdentityStmt *n = makeNode(ReplicaIdentityStmt); n->identity_type = REPLICA_IDENTITY_INDEX; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 22741 "gram.c" /* yacc.c:1646 */ break; case 317: #line 2302 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 22747 "gram.c" /* yacc.c:1646 */ break; case 318: #line 2305 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 22753 "gram.c" /* yacc.c:1646 */ break; case 319: #line 2306 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 22759 "gram.c" /* yacc.c:1646 */ break; case 320: #line 2310 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 22765 "gram.c" /* yacc.c:1646 */ break; case 321: #line 2311 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 22771 "gram.c" /* yacc.c:1646 */ break; case 322: #line 2317 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *) (yyvsp[0].node)); } #line 22779 "gram.c" /* yacc.c:1646 */ break; case 323: #line 2321 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[0].str), NULL); } #line 22787 "gram.c" /* yacc.c:1646 */ break; case 324: #line 2325 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElemExtended((yyvsp[-4].str), (yyvsp[-2].str), (Node *) (yyvsp[0].node), DEFELEM_UNSPEC); } #line 22796 "gram.c" /* yacc.c:1646 */ break; case 325: #line 2330 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElemExtended((yyvsp[-2].str), (yyvsp[0].str), NULL, DEFELEM_UNSPEC); } #line 22804 "gram.c" /* yacc.c:1646 */ break; case 326: #line 2345 "gram.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); /* can't use qualified_name, sigh */ n->relation = makeRangeVarFromAnyName((yyvsp[-1].list), (yylsp[-1]), yyscanner); n->cmds = (yyvsp[0].list); n->relkind = OBJECT_TYPE; (yyval.node) = (Node *)n; } #line 22818 "gram.c" /* yacc.c:1646 */ break; case 327: #line 2357 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 22824 "gram.c" /* yacc.c:1646 */ break; case 328: #line 2358 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 22830 "gram.c" /* yacc.c:1646 */ break; case 329: #line 2364 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddColumn; n->def = (yyvsp[-1].node); n->behavior = (yyvsp[0].dbehavior); (yyval.node) = (Node *)n; } #line 22842 "gram.c" /* yacc.c:1646 */ break; case 330: #line 2373 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropColumn; n->name = (yyvsp[-1].str); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = TRUE; (yyval.node) = (Node *)n; } #line 22855 "gram.c" /* yacc.c:1646 */ break; case 331: #line 2383 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropColumn; n->name = (yyvsp[-1].str); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = FALSE; (yyval.node) = (Node *)n; } #line 22868 "gram.c" /* yacc.c:1646 */ break; case 332: #line 2393 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); ColumnDef *def = makeNode(ColumnDef); n->subtype = AT_AlterColumnType; n->name = (yyvsp[-5].str); n->def = (Node *) def; n->behavior = (yyvsp[0].dbehavior); /* We only use these fields of the ColumnDef node */ def->typeName = (yyvsp[-2].typnam); def->collClause = (CollateClause *) (yyvsp[-1].node); def->raw_default = NULL; def->location = (yylsp[-5]); (yyval.node) = (Node *)n; } #line 22887 "gram.c" /* yacc.c:1646 */ break; case 333: #line 2419 "gram.y" /* yacc.c:1646 */ { ClosePortalStmt *n = makeNode(ClosePortalStmt); n->portalname = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 22897 "gram.c" /* yacc.c:1646 */ break; case 334: #line 2425 "gram.y" /* yacc.c:1646 */ { ClosePortalStmt *n = makeNode(ClosePortalStmt); n->portalname = NULL; (yyval.node) = (Node *)n; } #line 22907 "gram.c" /* yacc.c:1646 */ break; case 335: #line 2456 "gram.y" /* yacc.c:1646 */ { CopyStmt *n = makeNode(CopyStmt); n->relation = (yyvsp[-8].range); n->query = NULL; n->attlist = (yyvsp[-7].list); n->is_from = (yyvsp[-5].boolean); n->is_program = (yyvsp[-4].boolean); n->filename = (yyvsp[-3].str); if (n->is_program && n->filename == NULL) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("STDIN/STDOUT not allowed with PROGRAM"), parser_errposition((yylsp[-3])))); n->options = NIL; /* Concatenate user-supplied flags */ if ((yyvsp[-9].defelt)) n->options = lappend(n->options, (yyvsp[-9].defelt)); if ((yyvsp[-6].defelt)) n->options = lappend(n->options, (yyvsp[-6].defelt)); if ((yyvsp[-2].defelt)) n->options = lappend(n->options, (yyvsp[-2].defelt)); if ((yyvsp[0].list)) n->options = list_concat(n->options, (yyvsp[0].list)); (yyval.node) = (Node *)n; } #line 22939 "gram.c" /* yacc.c:1646 */ break; case 336: #line 2484 "gram.y" /* yacc.c:1646 */ { CopyStmt *n = makeNode(CopyStmt); n->relation = NULL; n->query = (yyvsp[-5].node); n->attlist = NIL; n->is_from = false; n->is_program = (yyvsp[-3].boolean); n->filename = (yyvsp[-2].str); n->options = (yyvsp[0].list); if (n->is_program && n->filename == NULL) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("STDIN/STDOUT not allowed with PROGRAM"), parser_errposition((yylsp[-2])))); (yyval.node) = (Node *)n; } #line 22962 "gram.c" /* yacc.c:1646 */ break; case 337: #line 2505 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = TRUE; } #line 22968 "gram.c" /* yacc.c:1646 */ break; case 338: #line 2506 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = FALSE; } #line 22974 "gram.c" /* yacc.c:1646 */ break; case 339: #line 2510 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = TRUE; } #line 22980 "gram.c" /* yacc.c:1646 */ break; case 340: #line 2511 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = FALSE; } #line 22986 "gram.c" /* yacc.c:1646 */ break; case 341: #line 2520 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 22992 "gram.c" /* yacc.c:1646 */ break; case 342: #line 2521 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 22998 "gram.c" /* yacc.c:1646 */ break; case 343: #line 2522 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 23004 "gram.c" /* yacc.c:1646 */ break; case 344: #line 2525 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 23010 "gram.c" /* yacc.c:1646 */ break; case 345: #line 2526 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 23016 "gram.c" /* yacc.c:1646 */ break; case 346: #line 2531 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 23022 "gram.c" /* yacc.c:1646 */ break; case 347: #line 2532 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 23028 "gram.c" /* yacc.c:1646 */ break; case 348: #line 2537 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("format", (Node *)makeString("binary")); } #line 23036 "gram.c" /* yacc.c:1646 */ break; case 349: #line 2541 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("oids", (Node *)makeInteger(TRUE)); } #line 23044 "gram.c" /* yacc.c:1646 */ break; case 350: #line 2545 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("freeze", (Node *)makeInteger(TRUE)); } #line 23052 "gram.c" /* yacc.c:1646 */ break; case 351: #line 2549 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("delimiter", (Node *)makeString((yyvsp[0].str))); } #line 23060 "gram.c" /* yacc.c:1646 */ break; case 352: #line 2553 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("null", (Node *)makeString((yyvsp[0].str))); } #line 23068 "gram.c" /* yacc.c:1646 */ break; case 353: #line 2557 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("format", (Node *)makeString("csv")); } #line 23076 "gram.c" /* yacc.c:1646 */ break; case 354: #line 2561 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("header", (Node *)makeInteger(TRUE)); } #line 23084 "gram.c" /* yacc.c:1646 */ break; case 355: #line 2565 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("quote", (Node *)makeString((yyvsp[0].str))); } #line 23092 "gram.c" /* yacc.c:1646 */ break; case 356: #line 2569 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("escape", (Node *)makeString((yyvsp[0].str))); } #line 23100 "gram.c" /* yacc.c:1646 */ break; case 357: #line 2573 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("force_quote", (Node *)(yyvsp[0].list)); } #line 23108 "gram.c" /* yacc.c:1646 */ break; case 358: #line 2577 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("force_quote", (Node *)makeNode(A_Star)); } #line 23116 "gram.c" /* yacc.c:1646 */ break; case 359: #line 2581 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("force_not_null", (Node *)(yyvsp[0].list)); } #line 23124 "gram.c" /* yacc.c:1646 */ break; case 360: #line 2585 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("force_null", (Node *)(yyvsp[0].list)); } #line 23132 "gram.c" /* yacc.c:1646 */ break; case 361: #line 2589 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("encoding", (Node *)makeString((yyvsp[0].str))); } #line 23140 "gram.c" /* yacc.c:1646 */ break; case 362: #line 2598 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("format", (Node *)makeString("binary")); } #line 23148 "gram.c" /* yacc.c:1646 */ break; case 363: #line 2601 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = NULL; } #line 23154 "gram.c" /* yacc.c:1646 */ break; case 364: #line 2606 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("oids", (Node *)makeInteger(TRUE)); } #line 23162 "gram.c" /* yacc.c:1646 */ break; case 365: #line 2609 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = NULL; } #line 23168 "gram.c" /* yacc.c:1646 */ break; case 366: #line 2614 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("delimiter", (Node *)makeString((yyvsp[0].str))); } #line 23176 "gram.c" /* yacc.c:1646 */ break; case 367: #line 2617 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = NULL; } #line 23182 "gram.c" /* yacc.c:1646 */ break; case 368: #line 2621 "gram.y" /* yacc.c:1646 */ {} #line 23188 "gram.c" /* yacc.c:1646 */ break; case 369: #line 2622 "gram.y" /* yacc.c:1646 */ {} #line 23194 "gram.c" /* yacc.c:1646 */ break; case 370: #line 2628 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 23202 "gram.c" /* yacc.c:1646 */ break; case 371: #line 2632 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 23210 "gram.c" /* yacc.c:1646 */ break; case 372: #line 2639 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-1].str), (yyvsp[0].node)); } #line 23218 "gram.c" /* yacc.c:1646 */ break; case 373: #line 2645 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 23224 "gram.c" /* yacc.c:1646 */ break; case 374: #line 2646 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].value); } #line 23230 "gram.c" /* yacc.c:1646 */ break; case 375: #line 2647 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeNode(A_Star); } #line 23236 "gram.c" /* yacc.c:1646 */ break; case 376: #line 2648 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[-1].list); } #line 23242 "gram.c" /* yacc.c:1646 */ break; case 377: #line 2649 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 23248 "gram.c" /* yacc.c:1646 */ break; case 378: #line 2654 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 23256 "gram.c" /* yacc.c:1646 */ break; case 379: #line 2658 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 23264 "gram.c" /* yacc.c:1646 */ break; case 380: #line 2665 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 23270 "gram.c" /* yacc.c:1646 */ break; case 381: #line 2678 "gram.y" /* yacc.c:1646 */ { CreateStmt *n = makeNode(CreateStmt); (yyvsp[-7].range)->relpersistence = (yyvsp[-9].ival); n->relation = (yyvsp[-7].range); n->tableElts = (yyvsp[-5].list); n->inhRelations = (yyvsp[-3].list); n->constraints = NIL; n->options = (yyvsp[-2].list); n->oncommit = (yyvsp[-1].oncommit); n->tablespacename = (yyvsp[0].str); n->if_not_exists = false; (yyval.node) = (Node *)n; } #line 23288 "gram.c" /* yacc.c:1646 */ break; case 382: #line 2694 "gram.y" /* yacc.c:1646 */ { CreateStmt *n = makeNode(CreateStmt); (yyvsp[-7].range)->relpersistence = (yyvsp[-12].ival); n->relation = (yyvsp[-7].range); n->tableElts = (yyvsp[-5].list); n->inhRelations = (yyvsp[-3].list); n->constraints = NIL; n->options = (yyvsp[-2].list); n->oncommit = (yyvsp[-1].oncommit); n->tablespacename = (yyvsp[0].str); n->if_not_exists = true; (yyval.node) = (Node *)n; } #line 23306 "gram.c" /* yacc.c:1646 */ break; case 383: #line 2709 "gram.y" /* yacc.c:1646 */ { CreateStmt *n = makeNode(CreateStmt); (yyvsp[-6].range)->relpersistence = (yyvsp[-8].ival); n->relation = (yyvsp[-6].range); n->tableElts = (yyvsp[-3].list); n->ofTypename = makeTypeNameFromNameList((yyvsp[-4].list)); n->ofTypename->location = (yylsp[-4]); n->constraints = NIL; n->options = (yyvsp[-2].list); n->oncommit = (yyvsp[-1].oncommit); n->tablespacename = (yyvsp[0].str); n->if_not_exists = false; (yyval.node) = (Node *)n; } #line 23325 "gram.c" /* yacc.c:1646 */ break; case 384: #line 2725 "gram.y" /* yacc.c:1646 */ { CreateStmt *n = makeNode(CreateStmt); (yyvsp[-6].range)->relpersistence = (yyvsp[-11].ival); n->relation = (yyvsp[-6].range); n->tableElts = (yyvsp[-3].list); n->ofTypename = makeTypeNameFromNameList((yyvsp[-4].list)); n->ofTypename->location = (yylsp[-4]); n->constraints = NIL; n->options = (yyvsp[-2].list); n->oncommit = (yyvsp[-1].oncommit); n->tablespacename = (yyvsp[0].str); n->if_not_exists = true; (yyval.node) = (Node *)n; } #line 23344 "gram.c" /* yacc.c:1646 */ break; case 385: #line 2752 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_TEMP; } #line 23350 "gram.c" /* yacc.c:1646 */ break; case 386: #line 2753 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_TEMP; } #line 23356 "gram.c" /* yacc.c:1646 */ break; case 387: #line 2754 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_TEMP; } #line 23362 "gram.c" /* yacc.c:1646 */ break; case 388: #line 2755 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_TEMP; } #line 23368 "gram.c" /* yacc.c:1646 */ break; case 389: #line 2757 "gram.y" /* yacc.c:1646 */ { ereport(WARNING, (errmsg("GLOBAL is deprecated in temporary table creation"), parser_errposition((yylsp[-1])))); (yyval.ival) = RELPERSISTENCE_TEMP; } #line 23379 "gram.c" /* yacc.c:1646 */ break; case 390: #line 2764 "gram.y" /* yacc.c:1646 */ { ereport(WARNING, (errmsg("GLOBAL is deprecated in temporary table creation"), parser_errposition((yylsp[-1])))); (yyval.ival) = RELPERSISTENCE_TEMP; } #line 23390 "gram.c" /* yacc.c:1646 */ break; case 391: #line 2770 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_UNLOGGED; } #line 23396 "gram.c" /* yacc.c:1646 */ break; case 392: #line 2771 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_PERMANENT; } #line 23402 "gram.c" /* yacc.c:1646 */ break; case 393: #line 2775 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 23408 "gram.c" /* yacc.c:1646 */ break; case 394: #line 2776 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 23414 "gram.c" /* yacc.c:1646 */ break; case 395: #line 2780 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 23420 "gram.c" /* yacc.c:1646 */ break; case 396: #line 2781 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 23426 "gram.c" /* yacc.c:1646 */ break; case 397: #line 2786 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 23434 "gram.c" /* yacc.c:1646 */ break; case 398: #line 2790 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 23442 "gram.c" /* yacc.c:1646 */ break; case 399: #line 2797 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 23450 "gram.c" /* yacc.c:1646 */ break; case 400: #line 2801 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 23458 "gram.c" /* yacc.c:1646 */ break; case 401: #line 2807 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 23464 "gram.c" /* yacc.c:1646 */ break; case 402: #line 2808 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 23470 "gram.c" /* yacc.c:1646 */ break; case 403: #line 2809 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 23476 "gram.c" /* yacc.c:1646 */ break; case 404: #line 2813 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 23482 "gram.c" /* yacc.c:1646 */ break; case 405: #line 2814 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 23488 "gram.c" /* yacc.c:1646 */ break; case 406: #line 2818 "gram.y" /* yacc.c:1646 */ { ColumnDef *n = makeNode(ColumnDef); n->colname = (yyvsp[-3].str); n->typeName = (yyvsp[-2].typnam); n->inhcount = 0; n->is_local = true; n->is_not_null = false; n->is_from_type = false; n->storage = 0; n->raw_default = NULL; n->cooked_default = NULL; n->collOid = InvalidOid; n->fdwoptions = (yyvsp[-1].list); SplitColQualList((yyvsp[0].list), &n->constraints, &n->collClause, yyscanner); n->location = (yylsp[-3]); (yyval.node) = (Node *)n; } #line 23511 "gram.c" /* yacc.c:1646 */ break; case 407: #line 2839 "gram.y" /* yacc.c:1646 */ { ColumnDef *n = makeNode(ColumnDef); n->colname = (yyvsp[-3].str); n->typeName = NULL; n->inhcount = 0; n->is_local = true; n->is_not_null = false; n->is_from_type = false; n->storage = 0; n->raw_default = NULL; n->cooked_default = NULL; n->collOid = InvalidOid; SplitColQualList((yyvsp[0].list), &n->constraints, &n->collClause, yyscanner); n->location = (yylsp[-3]); (yyval.node) = (Node *)n; } #line 23533 "gram.c" /* yacc.c:1646 */ break; case 408: #line 2859 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 23539 "gram.c" /* yacc.c:1646 */ break; case 409: #line 2860 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 23545 "gram.c" /* yacc.c:1646 */ break; case 410: #line 2865 "gram.y" /* yacc.c:1646 */ { Constraint *n = (Constraint *) (yyvsp[0].node); Assert(IsA(n, Constraint)); n->conname = (yyvsp[-1].str); n->location = (yylsp[-2]); (yyval.node) = (Node *) n; } #line 23557 "gram.c" /* yacc.c:1646 */ break; case 411: #line 2872 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 23563 "gram.c" /* yacc.c:1646 */ break; case 412: #line 2873 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 23569 "gram.c" /* yacc.c:1646 */ break; case 413: #line 2875 "gram.y" /* yacc.c:1646 */ { /* * Note: the CollateClause is momentarily included in * the list built by ColQualList, but we split it out * again in SplitColQualList. */ CollateClause *n = makeNode(CollateClause); n->arg = NULL; n->collname = (yyvsp[0].list); n->location = (yylsp[-1]); (yyval.node) = (Node *) n; } #line 23586 "gram.c" /* yacc.c:1646 */ break; case 414: #line 2906 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_NOTNULL; n->location = (yylsp[-1]); (yyval.node) = (Node *)n; } #line 23597 "gram.c" /* yacc.c:1646 */ break; case 415: #line 2913 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_NULL; n->location = (yylsp[0]); (yyval.node) = (Node *)n; } #line 23608 "gram.c" /* yacc.c:1646 */ break; case 416: #line 2920 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_UNIQUE; n->location = (yylsp[-2]); n->keys = NULL; n->options = (yyvsp[-1].list); n->indexname = NULL; n->indexspace = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 23623 "gram.c" /* yacc.c:1646 */ break; case 417: #line 2931 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_PRIMARY; n->location = (yylsp[-3]); n->keys = NULL; n->options = (yyvsp[-1].list); n->indexname = NULL; n->indexspace = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 23638 "gram.c" /* yacc.c:1646 */ break; case 418: #line 2942 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_CHECK; n->location = (yylsp[-4]); n->is_no_inherit = (yyvsp[0].boolean); n->raw_expr = (yyvsp[-2].node); n->cooked_expr = NULL; (yyval.node) = (Node *)n; } #line 23652 "gram.c" /* yacc.c:1646 */ break; case 419: #line 2952 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_DEFAULT; n->location = (yylsp[-1]); n->raw_expr = (yyvsp[0].node); n->cooked_expr = NULL; (yyval.node) = (Node *)n; } #line 23665 "gram.c" /* yacc.c:1646 */ break; case 420: #line 2961 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_FOREIGN; n->location = (yylsp[-4]); n->pktable = (yyvsp[-3].range); n->fk_attrs = NIL; n->pk_attrs = (yyvsp[-2].list); n->fk_matchtype = (yyvsp[-1].ival); n->fk_upd_action = (char) ((yyvsp[0].ival) >> 8); n->fk_del_action = (char) ((yyvsp[0].ival) & 0xFF); n->skip_validation = false; n->initially_valid = true; (yyval.node) = (Node *)n; } #line 23684 "gram.c" /* yacc.c:1646 */ break; case 421: #line 2994 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_DEFERRABLE; n->location = (yylsp[0]); (yyval.node) = (Node *)n; } #line 23695 "gram.c" /* yacc.c:1646 */ break; case 422: #line 3001 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_NOT_DEFERRABLE; n->location = (yylsp[-1]); (yyval.node) = (Node *)n; } #line 23706 "gram.c" /* yacc.c:1646 */ break; case 423: #line 3008 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_DEFERRED; n->location = (yylsp[-1]); (yyval.node) = (Node *)n; } #line 23717 "gram.c" /* yacc.c:1646 */ break; case 424: #line 3015 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_IMMEDIATE; n->location = (yylsp[-1]); (yyval.node) = (Node *)n; } #line 23728 "gram.c" /* yacc.c:1646 */ break; case 425: #line 3026 "gram.y" /* yacc.c:1646 */ { TableLikeClause *n = makeNode(TableLikeClause); n->relation = (yyvsp[-1].range); n->options = (yyvsp[0].ival); (yyval.node) = (Node *)n; } #line 23739 "gram.c" /* yacc.c:1646 */ break; case 426: #line 3035 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-2].ival) | (yyvsp[0].ival); } #line 23745 "gram.c" /* yacc.c:1646 */ break; case 427: #line 3036 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-2].ival) & ~(yyvsp[0].ival); } #line 23751 "gram.c" /* yacc.c:1646 */ break; case 428: #line 3037 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 23757 "gram.c" /* yacc.c:1646 */ break; case 429: #line 3041 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_DEFAULTS; } #line 23763 "gram.c" /* yacc.c:1646 */ break; case 430: #line 3042 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_CONSTRAINTS; } #line 23769 "gram.c" /* yacc.c:1646 */ break; case 431: #line 3043 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_INDEXES; } #line 23775 "gram.c" /* yacc.c:1646 */ break; case 432: #line 3044 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_STORAGE; } #line 23781 "gram.c" /* yacc.c:1646 */ break; case 433: #line 3045 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_COMMENTS; } #line 23787 "gram.c" /* yacc.c:1646 */ break; case 434: #line 3046 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_ALL; } #line 23793 "gram.c" /* yacc.c:1646 */ break; case 435: #line 3056 "gram.y" /* yacc.c:1646 */ { Constraint *n = (Constraint *) (yyvsp[0].node); Assert(IsA(n, Constraint)); n->conname = (yyvsp[-1].str); n->location = (yylsp[-2]); (yyval.node) = (Node *) n; } #line 23805 "gram.c" /* yacc.c:1646 */ break; case 436: #line 3063 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 23811 "gram.c" /* yacc.c:1646 */ break; case 437: #line 3068 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_CHECK; n->location = (yylsp[-4]); n->raw_expr = (yyvsp[-2].node); n->cooked_expr = NULL; processCASbits((yyvsp[0].ival), (yylsp[0]), "CHECK", NULL, NULL, &n->skip_validation, &n->is_no_inherit, yyscanner); n->initially_valid = !n->skip_validation; (yyval.node) = (Node *)n; } #line 23828 "gram.c" /* yacc.c:1646 */ break; case 438: #line 3082 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_UNIQUE; n->location = (yylsp[-6]); n->keys = (yyvsp[-4].list); n->options = (yyvsp[-2].list); n->indexname = NULL; n->indexspace = (yyvsp[-1].str); processCASbits((yyvsp[0].ival), (yylsp[0]), "UNIQUE", &n->deferrable, &n->initdeferred, NULL, NULL, yyscanner); (yyval.node) = (Node *)n; } #line 23846 "gram.c" /* yacc.c:1646 */ break; case 439: #line 3096 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_UNIQUE; n->location = (yylsp[-2]); n->keys = NIL; n->options = NIL; n->indexname = (yyvsp[-1].str); n->indexspace = NULL; processCASbits((yyvsp[0].ival), (yylsp[0]), "UNIQUE", &n->deferrable, &n->initdeferred, NULL, NULL, yyscanner); (yyval.node) = (Node *)n; } #line 23864 "gram.c" /* yacc.c:1646 */ break; case 440: #line 3111 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_PRIMARY; n->location = (yylsp[-7]); n->keys = (yyvsp[-4].list); n->options = (yyvsp[-2].list); n->indexname = NULL; n->indexspace = (yyvsp[-1].str); processCASbits((yyvsp[0].ival), (yylsp[0]), "PRIMARY KEY", &n->deferrable, &n->initdeferred, NULL, NULL, yyscanner); (yyval.node) = (Node *)n; } #line 23882 "gram.c" /* yacc.c:1646 */ break; case 441: #line 3125 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_PRIMARY; n->location = (yylsp[-3]); n->keys = NIL; n->options = NIL; n->indexname = (yyvsp[-1].str); n->indexspace = NULL; processCASbits((yyvsp[0].ival), (yylsp[0]), "PRIMARY KEY", &n->deferrable, &n->initdeferred, NULL, NULL, yyscanner); (yyval.node) = (Node *)n; } #line 23900 "gram.c" /* yacc.c:1646 */ break; case 442: #line 3141 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_EXCLUSION; n->location = (yylsp[-8]); n->access_method = (yyvsp[-7].str); n->exclusions = (yyvsp[-5].list); n->options = (yyvsp[-3].list); n->indexname = NULL; n->indexspace = (yyvsp[-2].str); n->where_clause = (yyvsp[-1].node); processCASbits((yyvsp[0].ival), (yylsp[0]), "EXCLUDE", &n->deferrable, &n->initdeferred, NULL, NULL, yyscanner); (yyval.node) = (Node *)n; } #line 23920 "gram.c" /* yacc.c:1646 */ break; case 443: #line 3158 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_FOREIGN; n->location = (yylsp[-10]); n->pktable = (yyvsp[-4].range); n->fk_attrs = (yyvsp[-7].list); n->pk_attrs = (yyvsp[-3].list); n->fk_matchtype = (yyvsp[-2].ival); n->fk_upd_action = (char) ((yyvsp[-1].ival) >> 8); n->fk_del_action = (char) ((yyvsp[-1].ival) & 0xFF); processCASbits((yyvsp[0].ival), (yylsp[0]), "FOREIGN KEY", &n->deferrable, &n->initdeferred, &n->skip_validation, NULL, yyscanner); n->initially_valid = !n->skip_validation; (yyval.node) = (Node *)n; } #line 23942 "gram.c" /* yacc.c:1646 */ break; case 444: #line 3177 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = TRUE; } #line 23948 "gram.c" /* yacc.c:1646 */ break; case 445: #line 3178 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = FALSE; } #line 23954 "gram.c" /* yacc.c:1646 */ break; case 446: #line 3182 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 23960 "gram.c" /* yacc.c:1646 */ break; case 447: #line 3183 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 23966 "gram.c" /* yacc.c:1646 */ break; case 448: #line 3187 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 23972 "gram.c" /* yacc.c:1646 */ break; case 449: #line 3188 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 23978 "gram.c" /* yacc.c:1646 */ break; case 450: #line 3192 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 23986 "gram.c" /* yacc.c:1646 */ break; case 451: #line 3198 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = FKCONSTR_MATCH_FULL; } #line 23994 "gram.c" /* yacc.c:1646 */ break; case 452: #line 3202 "gram.y" /* yacc.c:1646 */ { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("MATCH PARTIAL not yet implemented"), parser_errposition((yylsp[-1])))); (yyval.ival) = FKCONSTR_MATCH_PARTIAL; } #line 24006 "gram.c" /* yacc.c:1646 */ break; case 453: #line 3210 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = FKCONSTR_MATCH_SIMPLE; } #line 24014 "gram.c" /* yacc.c:1646 */ break; case 454: #line 3214 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = FKCONSTR_MATCH_SIMPLE; } #line 24022 "gram.c" /* yacc.c:1646 */ break; case 455: #line 3220 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].list)); } #line 24028 "gram.c" /* yacc.c:1646 */ break; case 456: #line 3222 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].list)); } #line 24034 "gram.c" /* yacc.c:1646 */ break; case 457: #line 3226 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-2].ielem), (yyvsp[0].list)); } #line 24042 "gram.c" /* yacc.c:1646 */ break; case 458: #line 3231 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-5].ielem), (yyvsp[-1].list)); } #line 24050 "gram.c" /* yacc.c:1646 */ break; case 459: #line 3237 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 24056 "gram.c" /* yacc.c:1646 */ break; case 460: #line 3238 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 24062 "gram.c" /* yacc.c:1646 */ break; case 461: #line 3249 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ((yyvsp[0].ival) << 8) | (FKCONSTR_ACTION_NOACTION & 0xFF); } #line 24068 "gram.c" /* yacc.c:1646 */ break; case 462: #line 3251 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (FKCONSTR_ACTION_NOACTION << 8) | ((yyvsp[0].ival) & 0xFF); } #line 24074 "gram.c" /* yacc.c:1646 */ break; case 463: #line 3253 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ((yyvsp[-1].ival) << 8) | ((yyvsp[0].ival) & 0xFF); } #line 24080 "gram.c" /* yacc.c:1646 */ break; case 464: #line 3255 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ((yyvsp[0].ival) << 8) | ((yyvsp[-1].ival) & 0xFF); } #line 24086 "gram.c" /* yacc.c:1646 */ break; case 465: #line 3257 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (FKCONSTR_ACTION_NOACTION << 8) | (FKCONSTR_ACTION_NOACTION & 0xFF); } #line 24092 "gram.c" /* yacc.c:1646 */ break; case 466: #line 3260 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[0].ival); } #line 24098 "gram.c" /* yacc.c:1646 */ break; case 467: #line 3263 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[0].ival); } #line 24104 "gram.c" /* yacc.c:1646 */ break; case 468: #line 3267 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = FKCONSTR_ACTION_NOACTION; } #line 24110 "gram.c" /* yacc.c:1646 */ break; case 469: #line 3268 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = FKCONSTR_ACTION_RESTRICT; } #line 24116 "gram.c" /* yacc.c:1646 */ break; case 470: #line 3269 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = FKCONSTR_ACTION_CASCADE; } #line 24122 "gram.c" /* yacc.c:1646 */ break; case 471: #line 3270 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = FKCONSTR_ACTION_SETNULL; } #line 24128 "gram.c" /* yacc.c:1646 */ break; case 472: #line 3271 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = FKCONSTR_ACTION_SETDEFAULT; } #line 24134 "gram.c" /* yacc.c:1646 */ break; case 473: #line 3274 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 24140 "gram.c" /* yacc.c:1646 */ break; case 474: #line 3275 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 24146 "gram.c" /* yacc.c:1646 */ break; case 475: #line 3280 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 24152 "gram.c" /* yacc.c:1646 */ break; case 476: #line 3281 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(defWithOids(true)); } #line 24158 "gram.c" /* yacc.c:1646 */ break; case 477: #line 3282 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(defWithOids(false)); } #line 24164 "gram.c" /* yacc.c:1646 */ break; case 478: #line 3283 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 24170 "gram.c" /* yacc.c:1646 */ break; case 479: #line 3286 "gram.y" /* yacc.c:1646 */ { (yyval.oncommit) = ONCOMMIT_DROP; } #line 24176 "gram.c" /* yacc.c:1646 */ break; case 480: #line 3287 "gram.y" /* yacc.c:1646 */ { (yyval.oncommit) = ONCOMMIT_DELETE_ROWS; } #line 24182 "gram.c" /* yacc.c:1646 */ break; case 481: #line 3288 "gram.y" /* yacc.c:1646 */ { (yyval.oncommit) = ONCOMMIT_PRESERVE_ROWS; } #line 24188 "gram.c" /* yacc.c:1646 */ break; case 482: #line 3289 "gram.y" /* yacc.c:1646 */ { (yyval.oncommit) = ONCOMMIT_NOOP; } #line 24194 "gram.c" /* yacc.c:1646 */ break; case 483: #line 3292 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 24200 "gram.c" /* yacc.c:1646 */ break; case 484: #line 3293 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 24206 "gram.c" /* yacc.c:1646 */ break; case 485: #line 3296 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 24212 "gram.c" /* yacc.c:1646 */ break; case 486: #line 3297 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 24218 "gram.c" /* yacc.c:1646 */ break; case 487: #line 3300 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 24224 "gram.c" /* yacc.c:1646 */ break; case 488: #line 3316 "gram.y" /* yacc.c:1646 */ { CreateTableAsStmt *ctas = makeNode(CreateTableAsStmt); ctas->query = (yyvsp[-1].node); ctas->into = (yyvsp[-3].into); ctas->relkind = OBJECT_TABLE; ctas->is_select_into = false; /* cram additional flags into the IntoClause */ (yyvsp[-3].into)->rel->relpersistence = (yyvsp[-5].ival); (yyvsp[-3].into)->skipData = !((yyvsp[0].boolean)); (yyval.node) = (Node *) ctas; } #line 24240 "gram.c" /* yacc.c:1646 */ break; case 489: #line 3331 "gram.y" /* yacc.c:1646 */ { (yyval.into) = makeNode(IntoClause); (yyval.into)->rel = (yyvsp[-4].range); (yyval.into)->colNames = (yyvsp[-3].list); (yyval.into)->options = (yyvsp[-2].list); (yyval.into)->onCommit = (yyvsp[-1].oncommit); (yyval.into)->tableSpaceName = (yyvsp[0].str); (yyval.into)->viewQuery = NULL; (yyval.into)->skipData = false; /* might get changed later */ } #line 24255 "gram.c" /* yacc.c:1646 */ break; case 490: #line 3344 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = TRUE; } #line 24261 "gram.c" /* yacc.c:1646 */ break; case 491: #line 3345 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = FALSE; } #line 24267 "gram.c" /* yacc.c:1646 */ break; case 492: #line 3346 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = TRUE; } #line 24273 "gram.c" /* yacc.c:1646 */ break; case 493: #line 3359 "gram.y" /* yacc.c:1646 */ { CreateTableAsStmt *ctas = makeNode(CreateTableAsStmt); ctas->query = (yyvsp[-1].node); ctas->into = (yyvsp[-3].into); ctas->relkind = OBJECT_MATVIEW; ctas->is_select_into = false; /* cram additional flags into the IntoClause */ (yyvsp[-3].into)->rel->relpersistence = (yyvsp[-6].ival); (yyvsp[-3].into)->skipData = !((yyvsp[0].boolean)); (yyval.node) = (Node *) ctas; } #line 24289 "gram.c" /* yacc.c:1646 */ break; case 494: #line 3374 "gram.y" /* yacc.c:1646 */ { (yyval.into) = makeNode(IntoClause); (yyval.into)->rel = (yyvsp[-3].range); (yyval.into)->colNames = (yyvsp[-2].list); (yyval.into)->options = (yyvsp[-1].list); (yyval.into)->onCommit = ONCOMMIT_NOOP; (yyval.into)->tableSpaceName = (yyvsp[0].str); (yyval.into)->viewQuery = NULL; /* filled at analysis time */ (yyval.into)->skipData = false; /* might get changed later */ } #line 24304 "gram.c" /* yacc.c:1646 */ break; case 495: #line 3386 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_UNLOGGED; } #line 24310 "gram.c" /* yacc.c:1646 */ break; case 496: #line 3387 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_PERMANENT; } #line 24316 "gram.c" /* yacc.c:1646 */ break; case 497: #line 3400 "gram.y" /* yacc.c:1646 */ { RefreshMatViewStmt *n = makeNode(RefreshMatViewStmt); n->concurrent = (yyvsp[-2].boolean); n->relation = (yyvsp[-1].range); n->skipData = !((yyvsp[0].boolean)); (yyval.node) = (Node *) n; } #line 24328 "gram.c" /* yacc.c:1646 */ break; case 498: #line 3420 "gram.y" /* yacc.c:1646 */ { CreateSeqStmt *n = makeNode(CreateSeqStmt); (yyvsp[-1].range)->relpersistence = (yyvsp[-3].ival); n->sequence = (yyvsp[-1].range); n->options = (yyvsp[0].list); n->ownerId = InvalidOid; (yyval.node) = (Node *)n; } #line 24341 "gram.c" /* yacc.c:1646 */ break; case 499: #line 3432 "gram.y" /* yacc.c:1646 */ { AlterSeqStmt *n = makeNode(AlterSeqStmt); n->sequence = (yyvsp[-1].range); n->options = (yyvsp[0].list); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 24353 "gram.c" /* yacc.c:1646 */ break; case 500: #line 3440 "gram.y" /* yacc.c:1646 */ { AlterSeqStmt *n = makeNode(AlterSeqStmt); n->sequence = (yyvsp[-1].range); n->options = (yyvsp[0].list); n->missing_ok = true; (yyval.node) = (Node *)n; } #line 24365 "gram.c" /* yacc.c:1646 */ break; case 501: #line 3450 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 24371 "gram.c" /* yacc.c:1646 */ break; case 502: #line 3451 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 24377 "gram.c" /* yacc.c:1646 */ break; case 503: #line 3454 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 24383 "gram.c" /* yacc.c:1646 */ break; case 504: #line 3455 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 24389 "gram.c" /* yacc.c:1646 */ break; case 505: #line 3459 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("cache", (Node *)(yyvsp[0].value)); } #line 24397 "gram.c" /* yacc.c:1646 */ break; case 506: #line 3463 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("cycle", (Node *)makeInteger(TRUE)); } #line 24405 "gram.c" /* yacc.c:1646 */ break; case 507: #line 3467 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("cycle", (Node *)makeInteger(FALSE)); } #line 24413 "gram.c" /* yacc.c:1646 */ break; case 508: #line 3471 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("increment", (Node *)(yyvsp[0].value)); } #line 24421 "gram.c" /* yacc.c:1646 */ break; case 509: #line 3475 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("maxvalue", (Node *)(yyvsp[0].value)); } #line 24429 "gram.c" /* yacc.c:1646 */ break; case 510: #line 3479 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("minvalue", (Node *)(yyvsp[0].value)); } #line 24437 "gram.c" /* yacc.c:1646 */ break; case 511: #line 3483 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("maxvalue", NULL); } #line 24445 "gram.c" /* yacc.c:1646 */ break; case 512: #line 3487 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("minvalue", NULL); } #line 24453 "gram.c" /* yacc.c:1646 */ break; case 513: #line 3491 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("owned_by", (Node *)(yyvsp[0].list)); } #line 24461 "gram.c" /* yacc.c:1646 */ break; case 514: #line 3495 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("start", (Node *)(yyvsp[0].value)); } #line 24469 "gram.c" /* yacc.c:1646 */ break; case 515: #line 3499 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("restart", NULL); } #line 24477 "gram.c" /* yacc.c:1646 */ break; case 516: #line 3503 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("restart", (Node *)(yyvsp[0].value)); } #line 24485 "gram.c" /* yacc.c:1646 */ break; case 517: #line 3508 "gram.y" /* yacc.c:1646 */ {} #line 24491 "gram.c" /* yacc.c:1646 */ break; case 518: #line 3509 "gram.y" /* yacc.c:1646 */ {} #line 24497 "gram.c" /* yacc.c:1646 */ break; case 519: #line 3513 "gram.y" /* yacc.c:1646 */ { (yyval.value) = makeFloat((yyvsp[0].str)); } #line 24503 "gram.c" /* yacc.c:1646 */ break; case 520: #line 3515 "gram.y" /* yacc.c:1646 */ { (yyval.value) = makeFloat((yyvsp[0].str)); doNegateFloat((yyval.value)); } #line 24512 "gram.c" /* yacc.c:1646 */ break; case 521: #line 3519 "gram.y" /* yacc.c:1646 */ { (yyval.value) = makeInteger((yyvsp[0].ival)); } #line 24518 "gram.c" /* yacc.c:1646 */ break; case 522: #line 3522 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].value)); } #line 24524 "gram.c" /* yacc.c:1646 */ break; case 523: #line 3523 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].value)); } #line 24530 "gram.c" /* yacc.c:1646 */ break; case 524: #line 3536 "gram.y" /* yacc.c:1646 */ { CreatePLangStmt *n = makeNode(CreatePLangStmt); n->replace = (yyvsp[-4].boolean); n->plname = (yyvsp[0].str); /* parameters are all to be supplied by system */ n->plhandler = NIL; n->plinline = NIL; n->plvalidator = NIL; n->pltrusted = false; (yyval.node) = (Node *)n; } #line 24546 "gram.c" /* yacc.c:1646 */ break; case 525: #line 3549 "gram.y" /* yacc.c:1646 */ { CreatePLangStmt *n = makeNode(CreatePLangStmt); n->replace = (yyvsp[-8].boolean); n->plname = (yyvsp[-4].str); n->plhandler = (yyvsp[-2].list); n->plinline = (yyvsp[-1].list); n->plvalidator = (yyvsp[0].list); n->pltrusted = (yyvsp[-7].boolean); (yyval.node) = (Node *)n; } #line 24561 "gram.c" /* yacc.c:1646 */ break; case 526: #line 3562 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = TRUE; } #line 24567 "gram.c" /* yacc.c:1646 */ break; case 527: #line 3563 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = FALSE; } #line 24573 "gram.c" /* yacc.c:1646 */ break; case 528: #line 3571 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 24579 "gram.c" /* yacc.c:1646 */ break; case 529: #line 3572 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lcons(makeString((yyvsp[-1].str)), (yyvsp[0].list)); } #line 24585 "gram.c" /* yacc.c:1646 */ break; case 530: #line 3576 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 24591 "gram.c" /* yacc.c:1646 */ break; case 531: #line 3577 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 24597 "gram.c" /* yacc.c:1646 */ break; case 532: #line 3581 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 24603 "gram.c" /* yacc.c:1646 */ break; case 533: #line 3582 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 24609 "gram.c" /* yacc.c:1646 */ break; case 534: #line 3586 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 24615 "gram.c" /* yacc.c:1646 */ break; case 535: #line 3587 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 24621 "gram.c" /* yacc.c:1646 */ break; case 536: #line 3592 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_LANGUAGE; n->objects = list_make1(list_make1(makeString((yyvsp[-1].str)))); n->arguments = NIL; n->behavior = (yyvsp[0].dbehavior); n->missing_ok = false; n->concurrent = false; (yyval.node) = (Node *)n; } #line 24636 "gram.c" /* yacc.c:1646 */ break; case 537: #line 3603 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_LANGUAGE; n->objects = list_make1(list_make1(makeString((yyvsp[-1].str)))); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = true; n->concurrent = false; (yyval.node) = (Node *)n; } #line 24650 "gram.c" /* yacc.c:1646 */ break; case 538: #line 3615 "gram.y" /* yacc.c:1646 */ {} #line 24656 "gram.c" /* yacc.c:1646 */ break; case 539: #line 3616 "gram.y" /* yacc.c:1646 */ {} #line 24662 "gram.c" /* yacc.c:1646 */ break; case 540: #line 3627 "gram.y" /* yacc.c:1646 */ { CreateTableSpaceStmt *n = makeNode(CreateTableSpaceStmt); n->tablespacename = (yyvsp[-4].str); n->owner = (yyvsp[-3].str); n->location = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 24675 "gram.c" /* yacc.c:1646 */ break; case 541: #line 3637 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 24681 "gram.c" /* yacc.c:1646 */ break; case 542: #line 3638 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 24687 "gram.c" /* yacc.c:1646 */ break; case 543: #line 3652 "gram.y" /* yacc.c:1646 */ { DropTableSpaceStmt *n = makeNode(DropTableSpaceStmt); n->tablespacename = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *) n; } #line 24698 "gram.c" /* yacc.c:1646 */ break; case 544: #line 3659 "gram.y" /* yacc.c:1646 */ { DropTableSpaceStmt *n = makeNode(DropTableSpaceStmt); n->tablespacename = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (Node *) n; } #line 24709 "gram.c" /* yacc.c:1646 */ break; case 545: #line 3676 "gram.y" /* yacc.c:1646 */ { CreateExtensionStmt *n = makeNode(CreateExtensionStmt); n->extname = (yyvsp[-2].str); n->if_not_exists = false; n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 24721 "gram.c" /* yacc.c:1646 */ break; case 546: #line 3684 "gram.y" /* yacc.c:1646 */ { CreateExtensionStmt *n = makeNode(CreateExtensionStmt); n->extname = (yyvsp[-2].str); n->if_not_exists = true; n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 24733 "gram.c" /* yacc.c:1646 */ break; case 547: #line 3695 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 24739 "gram.c" /* yacc.c:1646 */ break; case 548: #line 3697 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 24745 "gram.c" /* yacc.c:1646 */ break; case 549: #line 3702 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("schema", (Node *)makeString((yyvsp[0].str))); } #line 24753 "gram.c" /* yacc.c:1646 */ break; case 550: #line 3706 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("new_version", (Node *)makeString((yyvsp[0].str))); } #line 24761 "gram.c" /* yacc.c:1646 */ break; case 551: #line 3710 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("old_version", (Node *)makeString((yyvsp[0].str))); } #line 24769 "gram.c" /* yacc.c:1646 */ break; case 552: #line 3722 "gram.y" /* yacc.c:1646 */ { AlterExtensionStmt *n = makeNode(AlterExtensionStmt); n->extname = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 24780 "gram.c" /* yacc.c:1646 */ break; case 553: #line 3732 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 24786 "gram.c" /* yacc.c:1646 */ break; case 554: #line 3734 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 24792 "gram.c" /* yacc.c:1646 */ break; case 555: #line 3739 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("new_version", (Node *)makeString((yyvsp[0].str))); } #line 24800 "gram.c" /* yacc.c:1646 */ break; case 556: #line 3752 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-4].str); n->action = (yyvsp[-3].ival); n->objtype = OBJECT_AGGREGATE; n->objname = (yyvsp[-1].list); n->objargs = extractAggrArgTypes((yyvsp[0].list)); (yyval.node) = (Node *)n; } #line 24814 "gram.c" /* yacc.c:1646 */ break; case 557: #line 3762 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-7].str); n->action = (yyvsp[-6].ival); n->objtype = OBJECT_CAST; n->objname = list_make1((yyvsp[-3].typnam)); n->objargs = list_make1((yyvsp[-1].typnam)); (yyval.node) = (Node *) n; } #line 24828 "gram.c" /* yacc.c:1646 */ break; case 558: #line 3772 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_COLLATION; n->objname = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 24841 "gram.c" /* yacc.c:1646 */ break; case 559: #line 3781 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_CONVERSION; n->objname = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 24854 "gram.c" /* yacc.c:1646 */ break; case 560: #line 3790 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_DOMAIN; n->objname = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 24867 "gram.c" /* yacc.c:1646 */ break; case 561: #line 3799 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_FUNCTION; n->objname = (yyvsp[0].funwithargs)->funcname; n->objargs = (yyvsp[0].funwithargs)->funcargs; (yyval.node) = (Node *)n; } #line 24881 "gram.c" /* yacc.c:1646 */ break; case 562: #line 3809 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-4].str); n->action = (yyvsp[-3].ival); n->objtype = OBJECT_LANGUAGE; n->objname = list_make1(makeString((yyvsp[0].str))); (yyval.node) = (Node *)n; } #line 24894 "gram.c" /* yacc.c:1646 */ break; case 563: #line 3818 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-4].str); n->action = (yyvsp[-3].ival); n->objtype = OBJECT_OPERATOR; n->objname = (yyvsp[-1].list); n->objargs = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 24908 "gram.c" /* yacc.c:1646 */ break; case 564: #line 3828 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-6].str); n->action = (yyvsp[-5].ival); n->objtype = OBJECT_OPCLASS; n->objname = (yyvsp[-2].list); n->objargs = list_make1(makeString((yyvsp[0].str))); (yyval.node) = (Node *)n; } #line 24922 "gram.c" /* yacc.c:1646 */ break; case 565: #line 3838 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-6].str); n->action = (yyvsp[-5].ival); n->objtype = OBJECT_OPFAMILY; n->objname = (yyvsp[-2].list); n->objargs = list_make1(makeString((yyvsp[0].str))); (yyval.node) = (Node *)n; } #line 24936 "gram.c" /* yacc.c:1646 */ break; case 566: #line 3848 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_SCHEMA; n->objname = list_make1(makeString((yyvsp[0].str))); (yyval.node) = (Node *)n; } #line 24949 "gram.c" /* yacc.c:1646 */ break; case 567: #line 3857 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-4].str); n->action = (yyvsp[-3].ival); n->objtype = OBJECT_EVENT_TRIGGER; n->objname = list_make1(makeString((yyvsp[0].str))); (yyval.node) = (Node *)n; } #line 24962 "gram.c" /* yacc.c:1646 */ break; case 568: #line 3866 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_TABLE; n->objname = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 24975 "gram.c" /* yacc.c:1646 */ break; case 569: #line 3875 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-5].str); n->action = (yyvsp[-4].ival); n->objtype = OBJECT_TSPARSER; n->objname = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 24988 "gram.c" /* yacc.c:1646 */ break; case 570: #line 3884 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-5].str); n->action = (yyvsp[-4].ival); n->objtype = OBJECT_TSDICTIONARY; n->objname = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 25001 "gram.c" /* yacc.c:1646 */ break; case 571: #line 3893 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-5].str); n->action = (yyvsp[-4].ival); n->objtype = OBJECT_TSTEMPLATE; n->objname = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 25014 "gram.c" /* yacc.c:1646 */ break; case 572: #line 3902 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-5].str); n->action = (yyvsp[-4].ival); n->objtype = OBJECT_TSCONFIGURATION; n->objname = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 25027 "gram.c" /* yacc.c:1646 */ break; case 573: #line 3911 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_SEQUENCE; n->objname = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 25040 "gram.c" /* yacc.c:1646 */ break; case 574: #line 3920 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_VIEW; n->objname = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 25053 "gram.c" /* yacc.c:1646 */ break; case 575: #line 3929 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-4].str); n->action = (yyvsp[-3].ival); n->objtype = OBJECT_MATVIEW; n->objname = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 25066 "gram.c" /* yacc.c:1646 */ break; case 576: #line 3938 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-4].str); n->action = (yyvsp[-3].ival); n->objtype = OBJECT_FOREIGN_TABLE; n->objname = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 25079 "gram.c" /* yacc.c:1646 */ break; case 577: #line 3947 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-5].str); n->action = (yyvsp[-4].ival); n->objtype = OBJECT_FDW; n->objname = list_make1(makeString((yyvsp[0].str))); (yyval.node) = (Node *)n; } #line 25092 "gram.c" /* yacc.c:1646 */ break; case 578: #line 3956 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_FOREIGN_SERVER; n->objname = list_make1(makeString((yyvsp[0].str))); (yyval.node) = (Node *)n; } #line 25105 "gram.c" /* yacc.c:1646 */ break; case 579: #line 3965 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_TYPE; n->objname = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 25118 "gram.c" /* yacc.c:1646 */ break; case 580: #line 3983 "gram.y" /* yacc.c:1646 */ { CreateFdwStmt *n = makeNode(CreateFdwStmt); n->fdwname = (yyvsp[-2].str); n->func_options = (yyvsp[-1].list); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 25130 "gram.c" /* yacc.c:1646 */ break; case 581: #line 3993 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("handler", (Node *)(yyvsp[0].list)); } #line 25136 "gram.c" /* yacc.c:1646 */ break; case 582: #line 3994 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("handler", NULL); } #line 25142 "gram.c" /* yacc.c:1646 */ break; case 583: #line 3995 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("validator", (Node *)(yyvsp[0].list)); } #line 25148 "gram.c" /* yacc.c:1646 */ break; case 584: #line 3996 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("validator", NULL); } #line 25154 "gram.c" /* yacc.c:1646 */ break; case 585: #line 4000 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 25160 "gram.c" /* yacc.c:1646 */ break; case 586: #line 4001 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 25166 "gram.c" /* yacc.c:1646 */ break; case 587: #line 4005 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 25172 "gram.c" /* yacc.c:1646 */ break; case 588: #line 4006 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 25178 "gram.c" /* yacc.c:1646 */ break; case 589: #line 4017 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_FDW; n->objects = list_make1(list_make1(makeString((yyvsp[-1].str)))); n->arguments = NIL; n->missing_ok = false; n->behavior = (yyvsp[0].dbehavior); n->concurrent = false; (yyval.node) = (Node *) n; } #line 25193 "gram.c" /* yacc.c:1646 */ break; case 590: #line 4028 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_FDW; n->objects = list_make1(list_make1(makeString((yyvsp[-1].str)))); n->arguments = NIL; n->missing_ok = true; n->behavior = (yyvsp[0].dbehavior); n->concurrent = false; (yyval.node) = (Node *) n; } #line 25208 "gram.c" /* yacc.c:1646 */ break; case 591: #line 4048 "gram.y" /* yacc.c:1646 */ { AlterFdwStmt *n = makeNode(AlterFdwStmt); n->fdwname = (yyvsp[-2].str); n->func_options = (yyvsp[-1].list); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 25220 "gram.c" /* yacc.c:1646 */ break; case 592: #line 4056 "gram.y" /* yacc.c:1646 */ { AlterFdwStmt *n = makeNode(AlterFdwStmt); n->fdwname = (yyvsp[-1].str); n->func_options = (yyvsp[0].list); n->options = NIL; (yyval.node) = (Node *) n; } #line 25232 "gram.c" /* yacc.c:1646 */ break; case 593: #line 4067 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 25238 "gram.c" /* yacc.c:1646 */ break; case 594: #line 4068 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 25244 "gram.c" /* yacc.c:1646 */ break; case 595: #line 4073 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 25252 "gram.c" /* yacc.c:1646 */ break; case 596: #line 4077 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 25260 "gram.c" /* yacc.c:1646 */ break; case 597: #line 4084 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 25266 "gram.c" /* yacc.c:1646 */ break; case 598: #line 4089 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 25274 "gram.c" /* yacc.c:1646 */ break; case 599: #line 4093 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 25282 "gram.c" /* yacc.c:1646 */ break; case 600: #line 4100 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = (yyvsp[0].defelt); } #line 25290 "gram.c" /* yacc.c:1646 */ break; case 601: #line 4104 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = (yyvsp[0].defelt); (yyval.defelt)->defaction = DEFELEM_SET; } #line 25299 "gram.c" /* yacc.c:1646 */ break; case 602: #line 4109 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = (yyvsp[0].defelt); (yyval.defelt)->defaction = DEFELEM_ADD; } #line 25308 "gram.c" /* yacc.c:1646 */ break; case 603: #line 4114 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElemExtended(NULL, (yyvsp[0].str), NULL, DEFELEM_DROP); } #line 25316 "gram.c" /* yacc.c:1646 */ break; case 604: #line 4121 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-1].str), (yyvsp[0].node)); } #line 25324 "gram.c" /* yacc.c:1646 */ break; case 605: #line 4127 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 25330 "gram.c" /* yacc.c:1646 */ break; case 606: #line 4132 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 25336 "gram.c" /* yacc.c:1646 */ break; case 607: #line 4144 "gram.y" /* yacc.c:1646 */ { CreateForeignServerStmt *n = makeNode(CreateForeignServerStmt); n->servername = (yyvsp[-7].str); n->servertype = (yyvsp[-6].str); n->version = (yyvsp[-5].str); n->fdwname = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 25350 "gram.c" /* yacc.c:1646 */ break; case 608: #line 4156 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 25356 "gram.c" /* yacc.c:1646 */ break; case 609: #line 4157 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 25362 "gram.c" /* yacc.c:1646 */ break; case 610: #line 4162 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 25368 "gram.c" /* yacc.c:1646 */ break; case 611: #line 4163 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 25374 "gram.c" /* yacc.c:1646 */ break; case 612: #line 4167 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 25380 "gram.c" /* yacc.c:1646 */ break; case 613: #line 4168 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 25386 "gram.c" /* yacc.c:1646 */ break; case 614: #line 4179 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_FOREIGN_SERVER; n->objects = list_make1(list_make1(makeString((yyvsp[-1].str)))); n->arguments = NIL; n->missing_ok = false; n->behavior = (yyvsp[0].dbehavior); n->concurrent = false; (yyval.node) = (Node *) n; } #line 25401 "gram.c" /* yacc.c:1646 */ break; case 615: #line 4190 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_FOREIGN_SERVER; n->objects = list_make1(list_make1(makeString((yyvsp[-1].str)))); n->arguments = NIL; n->missing_ok = true; n->behavior = (yyvsp[0].dbehavior); n->concurrent = false; (yyval.node) = (Node *) n; } #line 25416 "gram.c" /* yacc.c:1646 */ break; case 616: #line 4210 "gram.y" /* yacc.c:1646 */ { AlterForeignServerStmt *n = makeNode(AlterForeignServerStmt); n->servername = (yyvsp[-2].str); n->version = (yyvsp[-1].str); n->options = (yyvsp[0].list); n->has_version = true; (yyval.node) = (Node *) n; } #line 25429 "gram.c" /* yacc.c:1646 */ break; case 617: #line 4219 "gram.y" /* yacc.c:1646 */ { AlterForeignServerStmt *n = makeNode(AlterForeignServerStmt); n->servername = (yyvsp[-1].str); n->version = (yyvsp[0].str); n->has_version = true; (yyval.node) = (Node *) n; } #line 25441 "gram.c" /* yacc.c:1646 */ break; case 618: #line 4227 "gram.y" /* yacc.c:1646 */ { AlterForeignServerStmt *n = makeNode(AlterForeignServerStmt); n->servername = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 25452 "gram.c" /* yacc.c:1646 */ break; case 619: #line 4246 "gram.y" /* yacc.c:1646 */ { CreateForeignTableStmt *n = makeNode(CreateForeignTableStmt); (yyvsp[-6].range)->relpersistence = RELPERSISTENCE_PERMANENT; n->base.relation = (yyvsp[-6].range); n->base.tableElts = (yyvsp[-4].list); n->base.inhRelations = NIL; n->base.if_not_exists = false; /* FDW-specific data */ n->servername = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 25469 "gram.c" /* yacc.c:1646 */ break; case 620: #line 4261 "gram.y" /* yacc.c:1646 */ { CreateForeignTableStmt *n = makeNode(CreateForeignTableStmt); (yyvsp[-6].range)->relpersistence = RELPERSISTENCE_PERMANENT; n->base.relation = (yyvsp[-6].range); n->base.tableElts = (yyvsp[-4].list); n->base.inhRelations = NIL; n->base.if_not_exists = true; /* FDW-specific data */ n->servername = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 25486 "gram.c" /* yacc.c:1646 */ break; case 621: #line 4284 "gram.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->relkind = OBJECT_FOREIGN_TABLE; n->missing_ok = false; (yyval.node) = (Node *)n; } #line 25499 "gram.c" /* yacc.c:1646 */ break; case 622: #line 4293 "gram.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->relkind = OBJECT_FOREIGN_TABLE; n->missing_ok = true; (yyval.node) = (Node *)n; } #line 25512 "gram.c" /* yacc.c:1646 */ break; case 623: #line 4311 "gram.y" /* yacc.c:1646 */ { CreateUserMappingStmt *n = makeNode(CreateUserMappingStmt); n->username = (yyvsp[-3].str); n->servername = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 25524 "gram.c" /* yacc.c:1646 */ break; case 624: #line 4322 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "current_user"; } #line 25530 "gram.c" /* yacc.c:1646 */ break; case 625: #line 4323 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "current_user"; } #line 25536 "gram.c" /* yacc.c:1646 */ break; case 626: #line 4324 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (strcmp((yyvsp[0].str), "public") == 0) ? NULL : (yyvsp[0].str); } #line 25542 "gram.c" /* yacc.c:1646 */ break; case 627: #line 4335 "gram.y" /* yacc.c:1646 */ { DropUserMappingStmt *n = makeNode(DropUserMappingStmt); n->username = (yyvsp[-2].str); n->servername = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *) n; } #line 25554 "gram.c" /* yacc.c:1646 */ break; case 628: #line 4343 "gram.y" /* yacc.c:1646 */ { DropUserMappingStmt *n = makeNode(DropUserMappingStmt); n->username = (yyvsp[-2].str); n->servername = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (Node *) n; } #line 25566 "gram.c" /* yacc.c:1646 */ break; case 629: #line 4360 "gram.y" /* yacc.c:1646 */ { AlterUserMappingStmt *n = makeNode(AlterUserMappingStmt); n->username = (yyvsp[-3].str); n->servername = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 25578 "gram.c" /* yacc.c:1646 */ break; case 630: #line 4381 "gram.y" /* yacc.c:1646 */ { CreateTrigStmt *n = makeNode(CreateTrigStmt); n->trigname = (yyvsp[-12].str); n->relation = (yyvsp[-8].range); n->funcname = (yyvsp[-3].list); n->args = (yyvsp[-1].list); n->row = (yyvsp[-7].boolean); n->timing = (yyvsp[-11].ival); n->events = intVal(linitial((yyvsp[-10].list))); n->columns = (List *) lsecond((yyvsp[-10].list)); n->whenClause = (yyvsp[-6].node); n->isconstraint = FALSE; n->deferrable = FALSE; n->initdeferred = FALSE; n->constrrel = NULL; (yyval.node) = (Node *)n; } #line 25600 "gram.c" /* yacc.c:1646 */ break; case 631: #line 4402 "gram.y" /* yacc.c:1646 */ { CreateTrigStmt *n = makeNode(CreateTrigStmt); n->trigname = (yyvsp[-16].str); n->relation = (yyvsp[-12].range); n->funcname = (yyvsp[-3].list); n->args = (yyvsp[-1].list); n->row = TRUE; n->timing = TRIGGER_TYPE_AFTER; n->events = intVal(linitial((yyvsp[-14].list))); n->columns = (List *) lsecond((yyvsp[-14].list)); n->whenClause = (yyvsp[-6].node); n->isconstraint = TRUE; processCASbits((yyvsp[-10].ival), (yylsp[-10]), "TRIGGER", &n->deferrable, &n->initdeferred, NULL, NULL, yyscanner); n->constrrel = (yyvsp[-11].range); (yyval.node) = (Node *)n; } #line 25623 "gram.c" /* yacc.c:1646 */ break; case 632: #line 4423 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = TRIGGER_TYPE_BEFORE; } #line 25629 "gram.c" /* yacc.c:1646 */ break; case 633: #line 4424 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = TRIGGER_TYPE_AFTER; } #line 25635 "gram.c" /* yacc.c:1646 */ break; case 634: #line 4425 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = TRIGGER_TYPE_INSTEAD; } #line 25641 "gram.c" /* yacc.c:1646 */ break; case 635: #line 4430 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 25647 "gram.c" /* yacc.c:1646 */ break; case 636: #line 4432 "gram.y" /* yacc.c:1646 */ { int events1 = intVal(linitial((yyvsp[-2].list))); int events2 = intVal(linitial((yyvsp[0].list))); List *columns1 = (List *) lsecond((yyvsp[-2].list)); List *columns2 = (List *) lsecond((yyvsp[0].list)); if (events1 & events2) parser_yyerror("duplicate trigger events specified"); /* * concat'ing the columns lists loses information about * which columns went with which event, but so long as * only UPDATE carries columns and we disallow multiple * UPDATE items, it doesn't matter. Command execution * should just ignore the columns for non-UPDATE events. */ (yyval.list) = list_make2(makeInteger(events1 | events2), list_concat(columns1, columns2)); } #line 25670 "gram.c" /* yacc.c:1646 */ break; case 637: #line 4454 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_INSERT), NIL); } #line 25676 "gram.c" /* yacc.c:1646 */ break; case 638: #line 4456 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_DELETE), NIL); } #line 25682 "gram.c" /* yacc.c:1646 */ break; case 639: #line 4458 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), NIL); } #line 25688 "gram.c" /* yacc.c:1646 */ break; case 640: #line 4460 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), (yyvsp[0].list)); } #line 25694 "gram.c" /* yacc.c:1646 */ break; case 641: #line 4462 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_TRUNCATE), NIL); } #line 25700 "gram.c" /* yacc.c:1646 */ break; case 642: #line 4467 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = (yyvsp[0].boolean); } #line 25708 "gram.c" /* yacc.c:1646 */ break; case 643: #line 4471 "gram.y" /* yacc.c:1646 */ { /* * If ROW/STATEMENT not specified, default to * STATEMENT, per SQL */ (yyval.boolean) = FALSE; } #line 25720 "gram.c" /* yacc.c:1646 */ break; case 644: #line 4481 "gram.y" /* yacc.c:1646 */ {} #line 25726 "gram.c" /* yacc.c:1646 */ break; case 645: #line 4482 "gram.y" /* yacc.c:1646 */ {} #line 25732 "gram.c" /* yacc.c:1646 */ break; case 646: #line 4486 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = TRUE; } #line 25738 "gram.c" /* yacc.c:1646 */ break; case 647: #line 4487 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = FALSE; } #line 25744 "gram.c" /* yacc.c:1646 */ break; case 648: #line 4491 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 25750 "gram.c" /* yacc.c:1646 */ break; case 649: #line 4492 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 25756 "gram.c" /* yacc.c:1646 */ break; case 650: #line 4496 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].value)); } #line 25762 "gram.c" /* yacc.c:1646 */ break; case 651: #line 4497 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].value)); } #line 25768 "gram.c" /* yacc.c:1646 */ break; case 652: #line 4498 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 25774 "gram.c" /* yacc.c:1646 */ break; case 653: #line 4503 "gram.y" /* yacc.c:1646 */ { char buf[64]; snprintf(buf, sizeof(buf), "%d", (yyvsp[0].ival)); (yyval.value) = makeString(pstrdup(buf)); } #line 25784 "gram.c" /* yacc.c:1646 */ break; case 654: #line 4508 "gram.y" /* yacc.c:1646 */ { (yyval.value) = makeString((yyvsp[0].str)); } #line 25790 "gram.c" /* yacc.c:1646 */ break; case 655: #line 4509 "gram.y" /* yacc.c:1646 */ { (yyval.value) = makeString((yyvsp[0].str)); } #line 25796 "gram.c" /* yacc.c:1646 */ break; case 656: #line 4510 "gram.y" /* yacc.c:1646 */ { (yyval.value) = makeString((yyvsp[0].str)); } #line 25802 "gram.c" /* yacc.c:1646 */ break; case 657: #line 4514 "gram.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); } #line 25808 "gram.c" /* yacc.c:1646 */ break; case 658: #line 4515 "gram.y" /* yacc.c:1646 */ { (yyval.range) = NULL; } #line 25814 "gram.c" /* yacc.c:1646 */ break; case 659: #line 4520 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 25820 "gram.c" /* yacc.c:1646 */ break; case 660: #line 4522 "gram.y" /* yacc.c:1646 */ { /* * We must complain about conflicting options. * We could, but choose not to, complain about redundant * options (ie, where $2's bit is already set in $1). */ int newspec = (yyvsp[-1].ival) | (yyvsp[0].ival); /* special message for this case */ if ((newspec & (CAS_NOT_DEFERRABLE | CAS_INITIALLY_DEFERRED)) == (CAS_NOT_DEFERRABLE | CAS_INITIALLY_DEFERRED)) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("constraint declared INITIALLY DEFERRED must be DEFERRABLE"), parser_errposition((yylsp[0])))); /* generic message for other conflicts */ if ((newspec & (CAS_NOT_DEFERRABLE | CAS_DEFERRABLE)) == (CAS_NOT_DEFERRABLE | CAS_DEFERRABLE) || (newspec & (CAS_INITIALLY_IMMEDIATE | CAS_INITIALLY_DEFERRED)) == (CAS_INITIALLY_IMMEDIATE | CAS_INITIALLY_DEFERRED)) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("conflicting constraint properties"), parser_errposition((yylsp[0])))); (yyval.ival) = newspec; } #line 25848 "gram.c" /* yacc.c:1646 */ break; case 661: #line 4548 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CAS_NOT_DEFERRABLE; } #line 25854 "gram.c" /* yacc.c:1646 */ break; case 662: #line 4549 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CAS_DEFERRABLE; } #line 25860 "gram.c" /* yacc.c:1646 */ break; case 663: #line 4550 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CAS_INITIALLY_IMMEDIATE; } #line 25866 "gram.c" /* yacc.c:1646 */ break; case 664: #line 4551 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CAS_INITIALLY_DEFERRED; } #line 25872 "gram.c" /* yacc.c:1646 */ break; case 665: #line 4552 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CAS_NOT_VALID; } #line 25878 "gram.c" /* yacc.c:1646 */ break; case 666: #line 4553 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CAS_NO_INHERIT; } #line 25884 "gram.c" /* yacc.c:1646 */ break; case 667: #line 4559 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_TRIGGER; n->objects = list_make1(lappend((yyvsp[-1].list), makeString((yyvsp[-3].str)))); n->arguments = NIL; n->behavior = (yyvsp[0].dbehavior); n->missing_ok = false; n->concurrent = false; (yyval.node) = (Node *) n; } #line 25899 "gram.c" /* yacc.c:1646 */ break; case 668: #line 4570 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_TRIGGER; n->objects = list_make1(lappend((yyvsp[-1].list), makeString((yyvsp[-3].str)))); n->arguments = NIL; n->behavior = (yyvsp[0].dbehavior); n->missing_ok = true; n->concurrent = false; (yyval.node) = (Node *) n; } #line 25914 "gram.c" /* yacc.c:1646 */ break; case 669: #line 4594 "gram.y" /* yacc.c:1646 */ { CreateEventTrigStmt *n = makeNode(CreateEventTrigStmt); n->trigname = (yyvsp[-7].str); n->eventname = (yyvsp[-5].str); n->whenclause = NULL; n->funcname = (yyvsp[-2].list); (yyval.node) = (Node *)n; } #line 25927 "gram.c" /* yacc.c:1646 */ break; case 670: #line 4605 "gram.y" /* yacc.c:1646 */ { CreateEventTrigStmt *n = makeNode(CreateEventTrigStmt); n->trigname = (yyvsp[-9].str); n->eventname = (yyvsp[-7].str); n->whenclause = (yyvsp[-5].list); n->funcname = (yyvsp[-2].list); (yyval.node) = (Node *)n; } #line 25940 "gram.c" /* yacc.c:1646 */ break; case 671: #line 4617 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 25946 "gram.c" /* yacc.c:1646 */ break; case 672: #line 4619 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 25952 "gram.c" /* yacc.c:1646 */ break; case 673: #line 4624 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-4].str), (Node *) (yyvsp[-1].list)); } #line 25958 "gram.c" /* yacc.c:1646 */ break; case 674: #line 4629 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 25964 "gram.c" /* yacc.c:1646 */ break; case 675: #line 4631 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } #line 25970 "gram.c" /* yacc.c:1646 */ break; case 676: #line 4636 "gram.y" /* yacc.c:1646 */ { AlterEventTrigStmt *n = makeNode(AlterEventTrigStmt); n->trigname = (yyvsp[-1].str); n->tgenabled = (yyvsp[0].chr); (yyval.node) = (Node *) n; } #line 25981 "gram.c" /* yacc.c:1646 */ break; case 677: #line 4645 "gram.y" /* yacc.c:1646 */ { (yyval.chr) = TRIGGER_FIRES_ON_ORIGIN; } #line 25987 "gram.c" /* yacc.c:1646 */ break; case 678: #line 4646 "gram.y" /* yacc.c:1646 */ { (yyval.chr) = TRIGGER_FIRES_ON_REPLICA; } #line 25993 "gram.c" /* yacc.c:1646 */ break; case 679: #line 4647 "gram.y" /* yacc.c:1646 */ { (yyval.chr) = TRIGGER_FIRES_ALWAYS; } #line 25999 "gram.c" /* yacc.c:1646 */ break; case 680: #line 4648 "gram.y" /* yacc.c:1646 */ { (yyval.chr) = TRIGGER_DISABLED; } #line 26005 "gram.c" /* yacc.c:1646 */ break; case 681: #line 4662 "gram.y" /* yacc.c:1646 */ { CreateTrigStmt *n = makeNode(CreateTrigStmt); n->trigname = (yyvsp[-5].str); n->args = list_make1((yyvsp[-2].node)); n->isconstraint = TRUE; processCASbits((yyvsp[0].ival), (yylsp[0]), "ASSERTION", &n->deferrable, &n->initdeferred, NULL, NULL, yyscanner); ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("CREATE ASSERTION is not yet implemented"))); (yyval.node) = (Node *)n; } #line 26025 "gram.c" /* yacc.c:1646 */ break; case 682: #line 4681 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->objects = NIL; n->arguments = NIL; n->behavior = (yyvsp[0].dbehavior); n->removeType = OBJECT_TRIGGER; /* XXX */ ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("DROP ASSERTION is not yet implemented"))); (yyval.node) = (Node *) n; } #line 26041 "gram.c" /* yacc.c:1646 */ break; case 683: #line 4704 "gram.y" /* yacc.c:1646 */ { DefineStmt *n = makeNode(DefineStmt); n->kind = OBJECT_AGGREGATE; n->oldstyle = false; n->defnames = (yyvsp[-2].list); n->args = (yyvsp[-1].list); n->definition = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 26055 "gram.c" /* yacc.c:1646 */ break; case 684: #line 4714 "gram.y" /* yacc.c:1646 */ { /* old-style (pre-8.2) syntax for CREATE AGGREGATE */ DefineStmt *n = makeNode(DefineStmt); n->kind = OBJECT_AGGREGATE; n->oldstyle = true; n->defnames = (yyvsp[-1].list); n->args = NIL; n->definition = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 26070 "gram.c" /* yacc.c:1646 */ break; case 685: #line 4725 "gram.y" /* yacc.c:1646 */ { DefineStmt *n = makeNode(DefineStmt); n->kind = OBJECT_OPERATOR; n->oldstyle = false; n->defnames = (yyvsp[-1].list); n->args = NIL; n->definition = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 26084 "gram.c" /* yacc.c:1646 */ break; case 686: #line 4735 "gram.y" /* yacc.c:1646 */ { DefineStmt *n = makeNode(DefineStmt); n->kind = OBJECT_TYPE; n->oldstyle = false; n->defnames = (yyvsp[-1].list); n->args = NIL; n->definition = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 26098 "gram.c" /* yacc.c:1646 */ break; case 687: #line 4745 "gram.y" /* yacc.c:1646 */ { /* Shell type (identified by lack of definition) */ DefineStmt *n = makeNode(DefineStmt); n->kind = OBJECT_TYPE; n->oldstyle = false; n->defnames = (yyvsp[0].list); n->args = NIL; n->definition = NIL; (yyval.node) = (Node *)n; } #line 26113 "gram.c" /* yacc.c:1646 */ break; case 688: #line 4756 "gram.y" /* yacc.c:1646 */ { CompositeTypeStmt *n = makeNode(CompositeTypeStmt); /* can't use qualified_name, sigh */ n->typevar = makeRangeVarFromAnyName((yyvsp[-4].list), (yylsp[-4]), yyscanner); n->coldeflist = (yyvsp[-1].list); (yyval.node) = (Node *)n; } #line 26126 "gram.c" /* yacc.c:1646 */ break; case 689: #line 4765 "gram.y" /* yacc.c:1646 */ { CreateEnumStmt *n = makeNode(CreateEnumStmt); n->typeName = (yyvsp[-5].list); n->vals = (yyvsp[-1].list); (yyval.node) = (Node *)n; } #line 26137 "gram.c" /* yacc.c:1646 */ break; case 690: #line 4772 "gram.y" /* yacc.c:1646 */ { CreateRangeStmt *n = makeNode(CreateRangeStmt); n->typeName = (yyvsp[-3].list); n->params = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 26148 "gram.c" /* yacc.c:1646 */ break; case 691: #line 4779 "gram.y" /* yacc.c:1646 */ { DefineStmt *n = makeNode(DefineStmt); n->kind = OBJECT_TSPARSER; n->args = NIL; n->defnames = (yyvsp[-1].list); n->definition = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 26161 "gram.c" /* yacc.c:1646 */ break; case 692: #line 4788 "gram.y" /* yacc.c:1646 */ { DefineStmt *n = makeNode(DefineStmt); n->kind = OBJECT_TSDICTIONARY; n->args = NIL; n->defnames = (yyvsp[-1].list); n->definition = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 26174 "gram.c" /* yacc.c:1646 */ break; case 693: #line 4797 "gram.y" /* yacc.c:1646 */ { DefineStmt *n = makeNode(DefineStmt); n->kind = OBJECT_TSTEMPLATE; n->args = NIL; n->defnames = (yyvsp[-1].list); n->definition = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 26187 "gram.c" /* yacc.c:1646 */ break; case 694: #line 4806 "gram.y" /* yacc.c:1646 */ { DefineStmt *n = makeNode(DefineStmt); n->kind = OBJECT_TSCONFIGURATION; n->args = NIL; n->defnames = (yyvsp[-1].list); n->definition = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 26200 "gram.c" /* yacc.c:1646 */ break; case 695: #line 4815 "gram.y" /* yacc.c:1646 */ { DefineStmt *n = makeNode(DefineStmt); n->kind = OBJECT_COLLATION; n->args = NIL; n->defnames = (yyvsp[-1].list); n->definition = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 26213 "gram.c" /* yacc.c:1646 */ break; case 696: #line 4824 "gram.y" /* yacc.c:1646 */ { DefineStmt *n = makeNode(DefineStmt); n->kind = OBJECT_COLLATION; n->args = NIL; n->defnames = (yyvsp[-2].list); n->definition = list_make1(makeDefElem("from", (Node *) (yyvsp[0].list))); (yyval.node) = (Node *)n; } #line 26226 "gram.c" /* yacc.c:1646 */ break; case 697: #line 4834 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 26232 "gram.c" /* yacc.c:1646 */ break; case 698: #line 4837 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 26238 "gram.c" /* yacc.c:1646 */ break; case 699: #line 4838 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 26244 "gram.c" /* yacc.c:1646 */ break; case 700: #line 4842 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *) (yyvsp[0].node)); } #line 26252 "gram.c" /* yacc.c:1646 */ break; case 701: #line 4846 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[0].str), NULL); } #line 26260 "gram.c" /* yacc.c:1646 */ break; case 702: #line 4852 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *)(yyvsp[0].typnam); } #line 26266 "gram.c" /* yacc.c:1646 */ break; case 703: #line 4853 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *)makeString(pstrdup((yyvsp[0].keyword))); } #line 26272 "gram.c" /* yacc.c:1646 */ break; case 704: #line 4854 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *)(yyvsp[0].list); } #line 26278 "gram.c" /* yacc.c:1646 */ break; case 705: #line 4855 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *)(yyvsp[0].value); } #line 26284 "gram.c" /* yacc.c:1646 */ break; case 706: #line 4856 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *)makeString((yyvsp[0].str)); } #line 26290 "gram.c" /* yacc.c:1646 */ break; case 707: #line 4859 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 26296 "gram.c" /* yacc.c:1646 */ break; case 708: #line 4862 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 26302 "gram.c" /* yacc.c:1646 */ break; case 709: #line 4863 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 26308 "gram.c" /* yacc.c:1646 */ break; case 710: #line 4872 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *)(yyvsp[0].node)); } #line 26316 "gram.c" /* yacc.c:1646 */ break; case 711: #line 4878 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 26322 "gram.c" /* yacc.c:1646 */ break; case 712: #line 4879 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 26328 "gram.c" /* yacc.c:1646 */ break; case 713: #line 4883 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 26334 "gram.c" /* yacc.c:1646 */ break; case 714: #line 4885 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } #line 26340 "gram.c" /* yacc.c:1646 */ break; case 715: #line 4896 "gram.y" /* yacc.c:1646 */ { AlterEnumStmt *n = makeNode(AlterEnumStmt); n->typeName = (yyvsp[-4].list); n->newVal = (yyvsp[0].str); n->newValNeighbor = NULL; n->newValIsAfter = true; n->skipIfExists = (yyvsp[-1].boolean); (yyval.node) = (Node *) n; } #line 26354 "gram.c" /* yacc.c:1646 */ break; case 716: #line 4906 "gram.y" /* yacc.c:1646 */ { AlterEnumStmt *n = makeNode(AlterEnumStmt); n->typeName = (yyvsp[-6].list); n->newVal = (yyvsp[-2].str); n->newValNeighbor = (yyvsp[0].str); n->newValIsAfter = false; n->skipIfExists = (yyvsp[-3].boolean); (yyval.node) = (Node *) n; } #line 26368 "gram.c" /* yacc.c:1646 */ break; case 717: #line 4916 "gram.y" /* yacc.c:1646 */ { AlterEnumStmt *n = makeNode(AlterEnumStmt); n->typeName = (yyvsp[-6].list); n->newVal = (yyvsp[-2].str); n->newValNeighbor = (yyvsp[0].str); n->newValIsAfter = true; n->skipIfExists = (yyvsp[-3].boolean); (yyval.node) = (Node *) n; } #line 26382 "gram.c" /* yacc.c:1646 */ break; case 718: #line 4927 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 26388 "gram.c" /* yacc.c:1646 */ break; case 719: #line 4928 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 26394 "gram.c" /* yacc.c:1646 */ break; case 720: #line 4946 "gram.y" /* yacc.c:1646 */ { CreateOpClassStmt *n = makeNode(CreateOpClassStmt); n->opclassname = (yyvsp[-9].list); n->isDefault = (yyvsp[-8].boolean); n->datatype = (yyvsp[-5].typnam); n->amname = (yyvsp[-3].str); n->opfamilyname = (yyvsp[-2].list); n->items = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 26409 "gram.c" /* yacc.c:1646 */ break; case 721: #line 4959 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 26415 "gram.c" /* yacc.c:1646 */ break; case 722: #line 4960 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 26421 "gram.c" /* yacc.c:1646 */ break; case 723: #line 4965 "gram.y" /* yacc.c:1646 */ { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_OPERATOR; n->name = (yyvsp[-2].list); n->args = NIL; n->number = (yyvsp[-3].ival); n->order_family = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 26435 "gram.c" /* yacc.c:1646 */ break; case 724: #line 4976 "gram.y" /* yacc.c:1646 */ { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_OPERATOR; n->name = (yyvsp[-3].list); n->args = (yyvsp[-2].list); n->number = (yyvsp[-4].ival); n->order_family = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 26449 "gram.c" /* yacc.c:1646 */ break; case 725: #line 4986 "gram.y" /* yacc.c:1646 */ { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_FUNCTION; n->name = (yyvsp[-1].list); n->args = extractArgTypes((yyvsp[0].list)); n->number = (yyvsp[-2].ival); (yyval.node) = (Node *) n; } #line 26462 "gram.c" /* yacc.c:1646 */ break; case 726: #line 4995 "gram.y" /* yacc.c:1646 */ { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_FUNCTION; n->name = (yyvsp[-1].list); n->args = extractArgTypes((yyvsp[0].list)); n->number = (yyvsp[-5].ival); n->class_args = (yyvsp[-3].list); (yyval.node) = (Node *) n; } #line 26476 "gram.c" /* yacc.c:1646 */ break; case 727: #line 5005 "gram.y" /* yacc.c:1646 */ { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_STORAGETYPE; n->storedtype = (yyvsp[0].typnam); (yyval.node) = (Node *) n; } #line 26487 "gram.c" /* yacc.c:1646 */ break; case 728: #line 5013 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = TRUE; } #line 26493 "gram.c" /* yacc.c:1646 */ break; case 729: #line 5014 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = FALSE; } #line 26499 "gram.c" /* yacc.c:1646 */ break; case 730: #line 5017 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 26505 "gram.c" /* yacc.c:1646 */ break; case 731: #line 5018 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 26511 "gram.c" /* yacc.c:1646 */ break; case 732: #line 5021 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 26517 "gram.c" /* yacc.c:1646 */ break; case 733: #line 5022 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 26523 "gram.c" /* yacc.c:1646 */ break; case 734: #line 5023 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 26529 "gram.c" /* yacc.c:1646 */ break; case 735: #line 5027 "gram.y" /* yacc.c:1646 */ { /* * RECHECK no longer does anything in opclass definitions, * but we still accept it to ease porting of old database * dumps. */ ereport(NOTICE, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("RECHECK is no longer required"), errhint("Update your data type."), parser_errposition((yylsp[0])))); (yyval.boolean) = TRUE; } #line 26547 "gram.c" /* yacc.c:1646 */ break; case 736: #line 5040 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = FALSE; } #line 26553 "gram.c" /* yacc.c:1646 */ break; case 737: #line 5046 "gram.y" /* yacc.c:1646 */ { CreateOpFamilyStmt *n = makeNode(CreateOpFamilyStmt); n->opfamilyname = (yyvsp[-2].list); n->amname = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 26564 "gram.c" /* yacc.c:1646 */ break; case 738: #line 5056 "gram.y" /* yacc.c:1646 */ { AlterOpFamilyStmt *n = makeNode(AlterOpFamilyStmt); n->opfamilyname = (yyvsp[-4].list); n->amname = (yyvsp[-2].str); n->isDrop = false; n->items = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 26577 "gram.c" /* yacc.c:1646 */ break; case 739: #line 5065 "gram.y" /* yacc.c:1646 */ { AlterOpFamilyStmt *n = makeNode(AlterOpFamilyStmt); n->opfamilyname = (yyvsp[-4].list); n->amname = (yyvsp[-2].str); n->isDrop = true; n->items = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 26590 "gram.c" /* yacc.c:1646 */ break; case 740: #line 5076 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 26596 "gram.c" /* yacc.c:1646 */ break; case 741: #line 5077 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 26602 "gram.c" /* yacc.c:1646 */ break; case 742: #line 5082 "gram.y" /* yacc.c:1646 */ { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_OPERATOR; n->number = (yyvsp[-3].ival); n->args = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 26614 "gram.c" /* yacc.c:1646 */ break; case 743: #line 5090 "gram.y" /* yacc.c:1646 */ { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_FUNCTION; n->number = (yyvsp[-3].ival); n->args = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 26626 "gram.c" /* yacc.c:1646 */ break; case 744: #line 5102 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->objects = list_make1((yyvsp[-3].list)); n->arguments = list_make1(list_make1(makeString((yyvsp[-1].str)))); n->removeType = OBJECT_OPCLASS; n->behavior = (yyvsp[0].dbehavior); n->missing_ok = false; n->concurrent = false; (yyval.node) = (Node *) n; } #line 26641 "gram.c" /* yacc.c:1646 */ break; case 745: #line 5113 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->objects = list_make1((yyvsp[-3].list)); n->arguments = list_make1(list_make1(makeString((yyvsp[-1].str)))); n->removeType = OBJECT_OPCLASS; n->behavior = (yyvsp[0].dbehavior); n->missing_ok = true; n->concurrent = false; (yyval.node) = (Node *) n; } #line 26656 "gram.c" /* yacc.c:1646 */ break; case 746: #line 5127 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->objects = list_make1((yyvsp[-3].list)); n->arguments = list_make1(list_make1(makeString((yyvsp[-1].str)))); n->removeType = OBJECT_OPFAMILY; n->behavior = (yyvsp[0].dbehavior); n->missing_ok = false; n->concurrent = false; (yyval.node) = (Node *) n; } #line 26671 "gram.c" /* yacc.c:1646 */ break; case 747: #line 5138 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->objects = list_make1((yyvsp[-3].list)); n->arguments = list_make1(list_make1(makeString((yyvsp[-1].str)))); n->removeType = OBJECT_OPFAMILY; n->behavior = (yyvsp[0].dbehavior); n->missing_ok = true; n->concurrent = false; (yyval.node) = (Node *) n; } #line 26686 "gram.c" /* yacc.c:1646 */ break; case 748: #line 5161 "gram.y" /* yacc.c:1646 */ { DropOwnedStmt *n = makeNode(DropOwnedStmt); n->roles = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); (yyval.node) = (Node *)n; } #line 26697 "gram.c" /* yacc.c:1646 */ break; case 749: #line 5171 "gram.y" /* yacc.c:1646 */ { ReassignOwnedStmt *n = makeNode(ReassignOwnedStmt); n->roles = (yyvsp[-2].list); n->newrole = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 26708 "gram.c" /* yacc.c:1646 */ break; case 750: #line 5189 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = (yyvsp[-4].objtype); n->missing_ok = TRUE; n->objects = (yyvsp[-1].list); n->arguments = NIL; n->behavior = (yyvsp[0].dbehavior); n->concurrent = false; (yyval.node) = (Node *)n; } #line 26723 "gram.c" /* yacc.c:1646 */ break; case 751: #line 5200 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = (yyvsp[-2].objtype); n->missing_ok = FALSE; n->objects = (yyvsp[-1].list); n->arguments = NIL; n->behavior = (yyvsp[0].dbehavior); n->concurrent = false; (yyval.node) = (Node *)n; } #line 26738 "gram.c" /* yacc.c:1646 */ break; case 752: #line 5211 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_INDEX; n->missing_ok = FALSE; n->objects = (yyvsp[-1].list); n->arguments = NIL; n->behavior = (yyvsp[0].dbehavior); n->concurrent = true; (yyval.node) = (Node *)n; } #line 26753 "gram.c" /* yacc.c:1646 */ break; case 753: #line 5222 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_INDEX; n->missing_ok = TRUE; n->objects = (yyvsp[-1].list); n->arguments = NIL; n->behavior = (yyvsp[0].dbehavior); n->concurrent = true; (yyval.node) = (Node *)n; } #line 26768 "gram.c" /* yacc.c:1646 */ break; case 754: #line 5235 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TABLE; } #line 26774 "gram.c" /* yacc.c:1646 */ break; case 755: #line 5236 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_SEQUENCE; } #line 26780 "gram.c" /* yacc.c:1646 */ break; case 756: #line 5237 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_VIEW; } #line 26786 "gram.c" /* yacc.c:1646 */ break; case 757: #line 5238 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_MATVIEW; } #line 26792 "gram.c" /* yacc.c:1646 */ break; case 758: #line 5239 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_INDEX; } #line 26798 "gram.c" /* yacc.c:1646 */ break; case 759: #line 5240 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_FOREIGN_TABLE; } #line 26804 "gram.c" /* yacc.c:1646 */ break; case 760: #line 5241 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_EVENT_TRIGGER; } #line 26810 "gram.c" /* yacc.c:1646 */ break; case 761: #line 5242 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TYPE; } #line 26816 "gram.c" /* yacc.c:1646 */ break; case 762: #line 5243 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_DOMAIN; } #line 26822 "gram.c" /* yacc.c:1646 */ break; case 763: #line 5244 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_COLLATION; } #line 26828 "gram.c" /* yacc.c:1646 */ break; case 764: #line 5245 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_CONVERSION; } #line 26834 "gram.c" /* yacc.c:1646 */ break; case 765: #line 5246 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_SCHEMA; } #line 26840 "gram.c" /* yacc.c:1646 */ break; case 766: #line 5247 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_EXTENSION; } #line 26846 "gram.c" /* yacc.c:1646 */ break; case 767: #line 5248 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TSPARSER; } #line 26852 "gram.c" /* yacc.c:1646 */ break; case 768: #line 5249 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TSDICTIONARY; } #line 26858 "gram.c" /* yacc.c:1646 */ break; case 769: #line 5250 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TSTEMPLATE; } #line 26864 "gram.c" /* yacc.c:1646 */ break; case 770: #line 5251 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TSCONFIGURATION; } #line 26870 "gram.c" /* yacc.c:1646 */ break; case 771: #line 5255 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].list)); } #line 26876 "gram.c" /* yacc.c:1646 */ break; case 772: #line 5256 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].list)); } #line 26882 "gram.c" /* yacc.c:1646 */ break; case 773: #line 5259 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 26888 "gram.c" /* yacc.c:1646 */ break; case 774: #line 5260 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lcons(makeString((yyvsp[-1].str)), (yyvsp[0].list)); } #line 26894 "gram.c" /* yacc.c:1646 */ break; case 775: #line 5264 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 26900 "gram.c" /* yacc.c:1646 */ break; case 776: #line 5266 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } #line 26906 "gram.c" /* yacc.c:1646 */ break; case 777: #line 5279 "gram.y" /* yacc.c:1646 */ { TruncateStmt *n = makeNode(TruncateStmt); n->relations = (yyvsp[-2].list); n->restart_seqs = (yyvsp[-1].boolean); n->behavior = (yyvsp[0].dbehavior); (yyval.node) = (Node *)n; } #line 26918 "gram.c" /* yacc.c:1646 */ break; case 778: #line 5289 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 26924 "gram.c" /* yacc.c:1646 */ break; case 779: #line 5290 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 26930 "gram.c" /* yacc.c:1646 */ break; case 780: #line 5291 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 26936 "gram.c" /* yacc.c:1646 */ break; case 781: #line 5324 "gram.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = (yyvsp[-3].objtype); n->objname = (yyvsp[-2].list); n->objargs = NIL; n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 26949 "gram.c" /* yacc.c:1646 */ break; case 782: #line 5333 "gram.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_AGGREGATE; n->objname = (yyvsp[-3].list); n->objargs = extractAggrArgTypes((yyvsp[-2].list)); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 26962 "gram.c" /* yacc.c:1646 */ break; case 783: #line 5342 "gram.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_FUNCTION; n->objname = (yyvsp[-3].list); n->objargs = extractArgTypes((yyvsp[-2].list)); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 26975 "gram.c" /* yacc.c:1646 */ break; case 784: #line 5351 "gram.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_OPERATOR; n->objname = (yyvsp[-3].list); n->objargs = (yyvsp[-2].list); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 26988 "gram.c" /* yacc.c:1646 */ break; case 785: #line 5360 "gram.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_CONSTRAINT; n->objname = lappend((yyvsp[-2].list), makeString((yyvsp[-4].str))); n->objargs = NIL; n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 27001 "gram.c" /* yacc.c:1646 */ break; case 786: #line 5369 "gram.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_RULE; n->objname = lappend((yyvsp[-2].list), makeString((yyvsp[-4].str))); n->objargs = NIL; n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 27014 "gram.c" /* yacc.c:1646 */ break; case 787: #line 5378 "gram.y" /* yacc.c:1646 */ { /* Obsolete syntax supported for awhile for compatibility */ CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_RULE; n->objname = list_make1(makeString((yyvsp[-2].str))); n->objargs = NIL; n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 27028 "gram.c" /* yacc.c:1646 */ break; case 788: #line 5388 "gram.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_TRIGGER; n->objname = lappend((yyvsp[-2].list), makeString((yyvsp[-4].str))); n->objargs = NIL; n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 27041 "gram.c" /* yacc.c:1646 */ break; case 789: #line 5397 "gram.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_OPCLASS; n->objname = (yyvsp[-4].list); n->objargs = list_make1(makeString((yyvsp[-2].str))); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 27054 "gram.c" /* yacc.c:1646 */ break; case 790: #line 5406 "gram.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_OPFAMILY; n->objname = (yyvsp[-4].list); n->objargs = list_make1(makeString((yyvsp[-2].str))); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 27067 "gram.c" /* yacc.c:1646 */ break; case 791: #line 5415 "gram.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_LARGEOBJECT; n->objname = list_make1((yyvsp[-2].value)); n->objargs = NIL; n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 27080 "gram.c" /* yacc.c:1646 */ break; case 792: #line 5424 "gram.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_CAST; n->objname = list_make1((yyvsp[-5].typnam)); n->objargs = list_make1((yyvsp[-3].typnam)); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 27093 "gram.c" /* yacc.c:1646 */ break; case 793: #line 5433 "gram.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_LANGUAGE; n->objname = (yyvsp[-2].list); n->objargs = NIL; n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 27106 "gram.c" /* yacc.c:1646 */ break; case 794: #line 5444 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_COLUMN; } #line 27112 "gram.c" /* yacc.c:1646 */ break; case 795: #line 5445 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_DATABASE; } #line 27118 "gram.c" /* yacc.c:1646 */ break; case 796: #line 5446 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_SCHEMA; } #line 27124 "gram.c" /* yacc.c:1646 */ break; case 797: #line 5447 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_INDEX; } #line 27130 "gram.c" /* yacc.c:1646 */ break; case 798: #line 5448 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_SEQUENCE; } #line 27136 "gram.c" /* yacc.c:1646 */ break; case 799: #line 5449 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TABLE; } #line 27142 "gram.c" /* yacc.c:1646 */ break; case 800: #line 5450 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_DOMAIN; } #line 27148 "gram.c" /* yacc.c:1646 */ break; case 801: #line 5451 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TYPE; } #line 27154 "gram.c" /* yacc.c:1646 */ break; case 802: #line 5452 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_VIEW; } #line 27160 "gram.c" /* yacc.c:1646 */ break; case 803: #line 5453 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_MATVIEW; } #line 27166 "gram.c" /* yacc.c:1646 */ break; case 804: #line 5454 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_COLLATION; } #line 27172 "gram.c" /* yacc.c:1646 */ break; case 805: #line 5455 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_CONVERSION; } #line 27178 "gram.c" /* yacc.c:1646 */ break; case 806: #line 5456 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TABLESPACE; } #line 27184 "gram.c" /* yacc.c:1646 */ break; case 807: #line 5457 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_EXTENSION; } #line 27190 "gram.c" /* yacc.c:1646 */ break; case 808: #line 5458 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_ROLE; } #line 27196 "gram.c" /* yacc.c:1646 */ break; case 809: #line 5459 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_FOREIGN_TABLE; } #line 27202 "gram.c" /* yacc.c:1646 */ break; case 810: #line 5460 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_FOREIGN_SERVER; } #line 27208 "gram.c" /* yacc.c:1646 */ break; case 811: #line 5461 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_FDW; } #line 27214 "gram.c" /* yacc.c:1646 */ break; case 812: #line 5462 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_EVENT_TRIGGER; } #line 27220 "gram.c" /* yacc.c:1646 */ break; case 813: #line 5463 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TSCONFIGURATION; } #line 27226 "gram.c" /* yacc.c:1646 */ break; case 814: #line 5464 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TSDICTIONARY; } #line 27232 "gram.c" /* yacc.c:1646 */ break; case 815: #line 5465 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TSPARSER; } #line 27238 "gram.c" /* yacc.c:1646 */ break; case 816: #line 5466 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TSTEMPLATE; } #line 27244 "gram.c" /* yacc.c:1646 */ break; case 817: #line 5470 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 27250 "gram.c" /* yacc.c:1646 */ break; case 818: #line 5471 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 27256 "gram.c" /* yacc.c:1646 */ break; case 819: #line 5487 "gram.y" /* yacc.c:1646 */ { SecLabelStmt *n = makeNode(SecLabelStmt); n->provider = (yyvsp[-5].str); n->objtype = (yyvsp[-3].objtype); n->objname = (yyvsp[-2].list); n->objargs = NIL; n->label = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 27270 "gram.c" /* yacc.c:1646 */ break; case 820: #line 5498 "gram.y" /* yacc.c:1646 */ { SecLabelStmt *n = makeNode(SecLabelStmt); n->provider = (yyvsp[-6].str); n->objtype = OBJECT_AGGREGATE; n->objname = (yyvsp[-3].list); n->objargs = extractAggrArgTypes((yyvsp[-2].list)); n->label = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 27284 "gram.c" /* yacc.c:1646 */ break; case 821: #line 5509 "gram.y" /* yacc.c:1646 */ { SecLabelStmt *n = makeNode(SecLabelStmt); n->provider = (yyvsp[-6].str); n->objtype = OBJECT_FUNCTION; n->objname = (yyvsp[-3].list); n->objargs = extractArgTypes((yyvsp[-2].list)); n->label = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 27298 "gram.c" /* yacc.c:1646 */ break; case 822: #line 5520 "gram.y" /* yacc.c:1646 */ { SecLabelStmt *n = makeNode(SecLabelStmt); n->provider = (yyvsp[-6].str); n->objtype = OBJECT_LARGEOBJECT; n->objname = list_make1((yyvsp[-2].value)); n->objargs = NIL; n->label = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 27312 "gram.c" /* yacc.c:1646 */ break; case 823: #line 5531 "gram.y" /* yacc.c:1646 */ { SecLabelStmt *n = makeNode(SecLabelStmt); n->provider = (yyvsp[-6].str); n->objtype = OBJECT_LANGUAGE; n->objname = (yyvsp[-2].list); n->objargs = NIL; n->label = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 27326 "gram.c" /* yacc.c:1646 */ break; case 824: #line 5542 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 27332 "gram.c" /* yacc.c:1646 */ break; case 825: #line 5543 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 27338 "gram.c" /* yacc.c:1646 */ break; case 826: #line 5547 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_COLUMN; } #line 27344 "gram.c" /* yacc.c:1646 */ break; case 827: #line 5548 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_DATABASE; } #line 27350 "gram.c" /* yacc.c:1646 */ break; case 828: #line 5549 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_EVENT_TRIGGER; } #line 27356 "gram.c" /* yacc.c:1646 */ break; case 829: #line 5550 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_FOREIGN_TABLE; } #line 27362 "gram.c" /* yacc.c:1646 */ break; case 830: #line 5551 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_SCHEMA; } #line 27368 "gram.c" /* yacc.c:1646 */ break; case 831: #line 5552 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_SEQUENCE; } #line 27374 "gram.c" /* yacc.c:1646 */ break; case 832: #line 5553 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TABLE; } #line 27380 "gram.c" /* yacc.c:1646 */ break; case 833: #line 5554 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TYPE; } #line 27386 "gram.c" /* yacc.c:1646 */ break; case 834: #line 5555 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_ROLE; } #line 27392 "gram.c" /* yacc.c:1646 */ break; case 835: #line 5556 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TABLESPACE; } #line 27398 "gram.c" /* yacc.c:1646 */ break; case 836: #line 5557 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TYPE; } #line 27404 "gram.c" /* yacc.c:1646 */ break; case 837: #line 5558 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_VIEW; } #line 27410 "gram.c" /* yacc.c:1646 */ break; case 838: #line 5559 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_MATVIEW; } #line 27416 "gram.c" /* yacc.c:1646 */ break; case 839: #line 5562 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 27422 "gram.c" /* yacc.c:1646 */ break; case 840: #line 5563 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 27428 "gram.c" /* yacc.c:1646 */ break; case 841: #line 5574 "gram.y" /* yacc.c:1646 */ { FetchStmt *n = (FetchStmt *) (yyvsp[0].node); n->ismove = FALSE; (yyval.node) = (Node *)n; } #line 27438 "gram.c" /* yacc.c:1646 */ break; case 842: #line 5580 "gram.y" /* yacc.c:1646 */ { FetchStmt *n = (FetchStmt *) (yyvsp[0].node); n->ismove = TRUE; (yyval.node) = (Node *)n; } #line 27448 "gram.c" /* yacc.c:1646 */ break; case 843: #line 5588 "gram.y" /* yacc.c:1646 */ { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_FORWARD; n->howMany = 1; (yyval.node) = (Node *)n; } #line 27460 "gram.c" /* yacc.c:1646 */ break; case 844: #line 5596 "gram.y" /* yacc.c:1646 */ { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_FORWARD; n->howMany = 1; (yyval.node) = (Node *)n; } #line 27472 "gram.c" /* yacc.c:1646 */ break; case 845: #line 5604 "gram.y" /* yacc.c:1646 */ { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_FORWARD; n->howMany = 1; (yyval.node) = (Node *)n; } #line 27484 "gram.c" /* yacc.c:1646 */ break; case 846: #line 5612 "gram.y" /* yacc.c:1646 */ { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_BACKWARD; n->howMany = 1; (yyval.node) = (Node *)n; } #line 27496 "gram.c" /* yacc.c:1646 */ break; case 847: #line 5620 "gram.y" /* yacc.c:1646 */ { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_ABSOLUTE; n->howMany = 1; (yyval.node) = (Node *)n; } #line 27508 "gram.c" /* yacc.c:1646 */ break; case 848: #line 5628 "gram.y" /* yacc.c:1646 */ { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_ABSOLUTE; n->howMany = -1; (yyval.node) = (Node *)n; } #line 27520 "gram.c" /* yacc.c:1646 */ break; case 849: #line 5636 "gram.y" /* yacc.c:1646 */ { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_ABSOLUTE; n->howMany = (yyvsp[-2].ival); (yyval.node) = (Node *)n; } #line 27532 "gram.c" /* yacc.c:1646 */ break; case 850: #line 5644 "gram.y" /* yacc.c:1646 */ { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_RELATIVE; n->howMany = (yyvsp[-2].ival); (yyval.node) = (Node *)n; } #line 27544 "gram.c" /* yacc.c:1646 */ break; case 851: #line 5652 "gram.y" /* yacc.c:1646 */ { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_FORWARD; n->howMany = (yyvsp[-2].ival); (yyval.node) = (Node *)n; } #line 27556 "gram.c" /* yacc.c:1646 */ break; case 852: #line 5660 "gram.y" /* yacc.c:1646 */ { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_FORWARD; n->howMany = FETCH_ALL; (yyval.node) = (Node *)n; } #line 27568 "gram.c" /* yacc.c:1646 */ break; case 853: #line 5668 "gram.y" /* yacc.c:1646 */ { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_FORWARD; n->howMany = 1; (yyval.node) = (Node *)n; } #line 27580 "gram.c" /* yacc.c:1646 */ break; case 854: #line 5676 "gram.y" /* yacc.c:1646 */ { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_FORWARD; n->howMany = (yyvsp[-2].ival); (yyval.node) = (Node *)n; } #line 27592 "gram.c" /* yacc.c:1646 */ break; case 855: #line 5684 "gram.y" /* yacc.c:1646 */ { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_FORWARD; n->howMany = FETCH_ALL; (yyval.node) = (Node *)n; } #line 27604 "gram.c" /* yacc.c:1646 */ break; case 856: #line 5692 "gram.y" /* yacc.c:1646 */ { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_BACKWARD; n->howMany = 1; (yyval.node) = (Node *)n; } #line 27616 "gram.c" /* yacc.c:1646 */ break; case 857: #line 5700 "gram.y" /* yacc.c:1646 */ { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_BACKWARD; n->howMany = (yyvsp[-2].ival); (yyval.node) = (Node *)n; } #line 27628 "gram.c" /* yacc.c:1646 */ break; case 858: #line 5708 "gram.y" /* yacc.c:1646 */ { FetchStmt *n = makeNode(FetchStmt); n->portalname = (yyvsp[0].str); n->direction = FETCH_BACKWARD; n->howMany = FETCH_ALL; (yyval.node) = (Node *)n; } #line 27640 "gram.c" /* yacc.c:1646 */ break; case 859: #line 5717 "gram.y" /* yacc.c:1646 */ {} #line 27646 "gram.c" /* yacc.c:1646 */ break; case 860: #line 5718 "gram.y" /* yacc.c:1646 */ {} #line 27652 "gram.c" /* yacc.c:1646 */ break; case 861: #line 5721 "gram.y" /* yacc.c:1646 */ {} #line 27658 "gram.c" /* yacc.c:1646 */ break; case 862: #line 5722 "gram.y" /* yacc.c:1646 */ {} #line 27664 "gram.c" /* yacc.c:1646 */ break; case 863: #line 5734 "gram.y" /* yacc.c:1646 */ { GrantStmt *n = makeNode(GrantStmt); n->is_grant = true; n->privileges = (yyvsp[-5].list); n->targtype = ((yyvsp[-3].privtarget))->targtype; n->objtype = ((yyvsp[-3].privtarget))->objtype; n->objects = ((yyvsp[-3].privtarget))->objs; n->grantees = (yyvsp[-1].list); n->grant_option = (yyvsp[0].boolean); (yyval.node) = (Node*)n; } #line 27680 "gram.c" /* yacc.c:1646 */ break; case 864: #line 5750 "gram.y" /* yacc.c:1646 */ { GrantStmt *n = makeNode(GrantStmt); n->is_grant = false; n->grant_option = false; n->privileges = (yyvsp[-5].list); n->targtype = ((yyvsp[-3].privtarget))->targtype; n->objtype = ((yyvsp[-3].privtarget))->objtype; n->objects = ((yyvsp[-3].privtarget))->objs; n->grantees = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); (yyval.node) = (Node *)n; } #line 27697 "gram.c" /* yacc.c:1646 */ break; case 865: #line 5764 "gram.y" /* yacc.c:1646 */ { GrantStmt *n = makeNode(GrantStmt); n->is_grant = false; n->grant_option = true; n->privileges = (yyvsp[-5].list); n->targtype = ((yyvsp[-3].privtarget))->targtype; n->objtype = ((yyvsp[-3].privtarget))->objtype; n->objects = ((yyvsp[-3].privtarget))->objs; n->grantees = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); (yyval.node) = (Node *)n; } #line 27714 "gram.c" /* yacc.c:1646 */ break; case 866: #line 5789 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 27720 "gram.c" /* yacc.c:1646 */ break; case 867: #line 5791 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 27726 "gram.c" /* yacc.c:1646 */ break; case 868: #line 5793 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 27732 "gram.c" /* yacc.c:1646 */ break; case 869: #line 5795 "gram.y" /* yacc.c:1646 */ { AccessPriv *n = makeNode(AccessPriv); n->priv_name = NULL; n->cols = (yyvsp[-1].list); (yyval.list) = list_make1(n); } #line 27743 "gram.c" /* yacc.c:1646 */ break; case 870: #line 5802 "gram.y" /* yacc.c:1646 */ { AccessPriv *n = makeNode(AccessPriv); n->priv_name = NULL; n->cols = (yyvsp[-1].list); (yyval.list) = list_make1(n); } #line 27754 "gram.c" /* yacc.c:1646 */ break; case 871: #line 5810 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].accesspriv)); } #line 27760 "gram.c" /* yacc.c:1646 */ break; case 872: #line 5811 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].accesspriv)); } #line 27766 "gram.c" /* yacc.c:1646 */ break; case 873: #line 5815 "gram.y" /* yacc.c:1646 */ { AccessPriv *n = makeNode(AccessPriv); n->priv_name = pstrdup((yyvsp[-1].keyword)); n->cols = (yyvsp[0].list); (yyval.accesspriv) = n; } #line 27777 "gram.c" /* yacc.c:1646 */ break; case 874: #line 5822 "gram.y" /* yacc.c:1646 */ { AccessPriv *n = makeNode(AccessPriv); n->priv_name = pstrdup((yyvsp[-1].keyword)); n->cols = (yyvsp[0].list); (yyval.accesspriv) = n; } #line 27788 "gram.c" /* yacc.c:1646 */ break; case 875: #line 5829 "gram.y" /* yacc.c:1646 */ { AccessPriv *n = makeNode(AccessPriv); n->priv_name = pstrdup((yyvsp[-1].keyword)); n->cols = (yyvsp[0].list); (yyval.accesspriv) = n; } #line 27799 "gram.c" /* yacc.c:1646 */ break; case 876: #line 5836 "gram.y" /* yacc.c:1646 */ { AccessPriv *n = makeNode(AccessPriv); n->priv_name = (yyvsp[-1].str); n->cols = (yyvsp[0].list); (yyval.accesspriv) = n; } #line 27810 "gram.c" /* yacc.c:1646 */ break; case 877: #line 5850 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = ACL_OBJECT_RELATION; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 27822 "gram.c" /* yacc.c:1646 */ break; case 878: #line 5858 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = ACL_OBJECT_RELATION; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 27834 "gram.c" /* yacc.c:1646 */ break; case 879: #line 5866 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = ACL_OBJECT_SEQUENCE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 27846 "gram.c" /* yacc.c:1646 */ break; case 880: #line 5874 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = ACL_OBJECT_FDW; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 27858 "gram.c" /* yacc.c:1646 */ break; case 881: #line 5882 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = ACL_OBJECT_FOREIGN_SERVER; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 27870 "gram.c" /* yacc.c:1646 */ break; case 882: #line 5890 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = ACL_OBJECT_FUNCTION; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 27882 "gram.c" /* yacc.c:1646 */ break; case 883: #line 5898 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = ACL_OBJECT_DATABASE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 27894 "gram.c" /* yacc.c:1646 */ break; case 884: #line 5906 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = ACL_OBJECT_DOMAIN; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 27906 "gram.c" /* yacc.c:1646 */ break; case 885: #line 5914 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = ACL_OBJECT_LANGUAGE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 27918 "gram.c" /* yacc.c:1646 */ break; case 886: #line 5922 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = ACL_OBJECT_LARGEOBJECT; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 27930 "gram.c" /* yacc.c:1646 */ break; case 887: #line 5930 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = ACL_OBJECT_NAMESPACE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 27942 "gram.c" /* yacc.c:1646 */ break; case 888: #line 5938 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = ACL_OBJECT_TABLESPACE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 27954 "gram.c" /* yacc.c:1646 */ break; case 889: #line 5946 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = ACL_OBJECT_TYPE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 27966 "gram.c" /* yacc.c:1646 */ break; case 890: #line 5954 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_ALL_IN_SCHEMA; n->objtype = ACL_OBJECT_RELATION; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 27978 "gram.c" /* yacc.c:1646 */ break; case 891: #line 5962 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_ALL_IN_SCHEMA; n->objtype = ACL_OBJECT_SEQUENCE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 27990 "gram.c" /* yacc.c:1646 */ break; case 892: #line 5970 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_ALL_IN_SCHEMA; n->objtype = ACL_OBJECT_FUNCTION; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 28002 "gram.c" /* yacc.c:1646 */ break; case 893: #line 5981 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 28008 "gram.c" /* yacc.c:1646 */ break; case 894: #line 5982 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 28014 "gram.c" /* yacc.c:1646 */ break; case 895: #line 5986 "gram.y" /* yacc.c:1646 */ { PrivGrantee *n = makeNode(PrivGrantee); /* This hack lets us avoid reserving PUBLIC as a keyword*/ if (strcmp((yyvsp[0].str), "public") == 0) n->rolname = NULL; else n->rolname = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 28028 "gram.c" /* yacc.c:1646 */ break; case 896: #line 5996 "gram.y" /* yacc.c:1646 */ { PrivGrantee *n = makeNode(PrivGrantee); /* Treat GROUP PUBLIC as a synonym for PUBLIC */ if (strcmp((yyvsp[0].str), "public") == 0) n->rolname = NULL; else n->rolname = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 28042 "gram.c" /* yacc.c:1646 */ break; case 897: #line 6009 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = TRUE; } #line 28048 "gram.c" /* yacc.c:1646 */ break; case 898: #line 6010 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = FALSE; } #line 28054 "gram.c" /* yacc.c:1646 */ break; case 899: #line 6014 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].funwithargs)); } #line 28060 "gram.c" /* yacc.c:1646 */ break; case 900: #line 6016 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].funwithargs)); } #line 28066 "gram.c" /* yacc.c:1646 */ break; case 901: #line 6021 "gram.y" /* yacc.c:1646 */ { FuncWithArgs *n = makeNode(FuncWithArgs); n->funcname = (yyvsp[-1].list); n->funcargs = extractArgTypes((yyvsp[0].list)); (yyval.funwithargs) = n; } #line 28077 "gram.c" /* yacc.c:1646 */ break; case 902: #line 6037 "gram.y" /* yacc.c:1646 */ { GrantRoleStmt *n = makeNode(GrantRoleStmt); n->is_grant = true; n->granted_roles = (yyvsp[-4].list); n->grantee_roles = (yyvsp[-2].list); n->admin_opt = (yyvsp[-1].boolean); n->grantor = (yyvsp[0].str); (yyval.node) = (Node*)n; } #line 28091 "gram.c" /* yacc.c:1646 */ break; case 903: #line 6050 "gram.y" /* yacc.c:1646 */ { GrantRoleStmt *n = makeNode(GrantRoleStmt); n->is_grant = false; n->admin_opt = false; n->granted_roles = (yyvsp[-4].list); n->grantee_roles = (yyvsp[-2].list); n->behavior = (yyvsp[0].dbehavior); (yyval.node) = (Node*)n; } #line 28105 "gram.c" /* yacc.c:1646 */ break; case 904: #line 6060 "gram.y" /* yacc.c:1646 */ { GrantRoleStmt *n = makeNode(GrantRoleStmt); n->is_grant = false; n->admin_opt = true; n->granted_roles = (yyvsp[-4].list); n->grantee_roles = (yyvsp[-2].list); n->behavior = (yyvsp[0].dbehavior); (yyval.node) = (Node*)n; } #line 28119 "gram.c" /* yacc.c:1646 */ break; case 905: #line 6071 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = TRUE; } #line 28125 "gram.c" /* yacc.c:1646 */ break; case 906: #line 6072 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = FALSE; } #line 28131 "gram.c" /* yacc.c:1646 */ break; case 907: #line 6075 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 28137 "gram.c" /* yacc.c:1646 */ break; case 908: #line 6076 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 28143 "gram.c" /* yacc.c:1646 */ break; case 909: #line 6087 "gram.y" /* yacc.c:1646 */ { AlterDefaultPrivilegesStmt *n = makeNode(AlterDefaultPrivilegesStmt); n->options = (yyvsp[-1].list); n->action = (GrantStmt *) (yyvsp[0].node); (yyval.node) = (Node*)n; } #line 28154 "gram.c" /* yacc.c:1646 */ break; case 910: #line 6096 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 28160 "gram.c" /* yacc.c:1646 */ break; case 911: #line 6097 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 28166 "gram.c" /* yacc.c:1646 */ break; case 912: #line 6102 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("schemas", (Node *)(yyvsp[0].list)); } #line 28174 "gram.c" /* yacc.c:1646 */ break; case 913: #line 6106 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("roles", (Node *)(yyvsp[0].list)); } #line 28182 "gram.c" /* yacc.c:1646 */ break; case 914: #line 6110 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("roles", (Node *)(yyvsp[0].list)); } #line 28190 "gram.c" /* yacc.c:1646 */ break; case 915: #line 6122 "gram.y" /* yacc.c:1646 */ { GrantStmt *n = makeNode(GrantStmt); n->is_grant = true; n->privileges = (yyvsp[-5].list); n->targtype = ACL_TARGET_DEFAULTS; n->objtype = (yyvsp[-3].ival); n->objects = NIL; n->grantees = (yyvsp[-1].list); n->grant_option = (yyvsp[0].boolean); (yyval.node) = (Node*)n; } #line 28206 "gram.c" /* yacc.c:1646 */ break; case 916: #line 6135 "gram.y" /* yacc.c:1646 */ { GrantStmt *n = makeNode(GrantStmt); n->is_grant = false; n->grant_option = false; n->privileges = (yyvsp[-5].list); n->targtype = ACL_TARGET_DEFAULTS; n->objtype = (yyvsp[-3].ival); n->objects = NIL; n->grantees = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); (yyval.node) = (Node *)n; } #line 28223 "gram.c" /* yacc.c:1646 */ break; case 917: #line 6149 "gram.y" /* yacc.c:1646 */ { GrantStmt *n = makeNode(GrantStmt); n->is_grant = false; n->grant_option = true; n->privileges = (yyvsp[-5].list); n->targtype = ACL_TARGET_DEFAULTS; n->objtype = (yyvsp[-3].ival); n->objects = NIL; n->grantees = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); (yyval.node) = (Node *)n; } #line 28240 "gram.c" /* yacc.c:1646 */ break; case 918: #line 6164 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ACL_OBJECT_RELATION; } #line 28246 "gram.c" /* yacc.c:1646 */ break; case 919: #line 6165 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ACL_OBJECT_FUNCTION; } #line 28252 "gram.c" /* yacc.c:1646 */ break; case 920: #line 6166 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ACL_OBJECT_SEQUENCE; } #line 28258 "gram.c" /* yacc.c:1646 */ break; case 921: #line 6167 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ACL_OBJECT_TYPE; } #line 28264 "gram.c" /* yacc.c:1646 */ break; case 922: #line 6182 "gram.y" /* yacc.c:1646 */ { IndexStmt *n = makeNode(IndexStmt); n->unique = (yyvsp[-12].boolean); n->concurrent = (yyvsp[-10].boolean); n->idxname = (yyvsp[-9].str); n->relation = (yyvsp[-7].range); n->accessMethod = (yyvsp[-6].str); n->indexParams = (yyvsp[-4].list); n->options = (yyvsp[-2].list); n->tableSpace = (yyvsp[-1].str); n->whereClause = (yyvsp[0].node); n->excludeOpNames = NIL; n->idxcomment = NULL; n->indexOid = InvalidOid; n->oldNode = InvalidOid; n->primary = false; n->isconstraint = false; n->deferrable = false; n->initdeferred = false; (yyval.node) = (Node *)n; } #line 28290 "gram.c" /* yacc.c:1646 */ break; case 923: #line 6206 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = TRUE; } #line 28296 "gram.c" /* yacc.c:1646 */ break; case 924: #line 6207 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = FALSE; } #line 28302 "gram.c" /* yacc.c:1646 */ break; case 925: #line 6211 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = TRUE; } #line 28308 "gram.c" /* yacc.c:1646 */ break; case 926: #line 6212 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = FALSE; } #line 28314 "gram.c" /* yacc.c:1646 */ break; case 927: #line 6216 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 28320 "gram.c" /* yacc.c:1646 */ break; case 928: #line 6217 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 28326 "gram.c" /* yacc.c:1646 */ break; case 929: #line 6221 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 28332 "gram.c" /* yacc.c:1646 */ break; case 930: #line 6222 "gram.y" /* yacc.c:1646 */ { (yyval.str) = DEFAULT_INDEX_TYPE; } #line 28338 "gram.c" /* yacc.c:1646 */ break; case 931: #line 6225 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].ielem)); } #line 28344 "gram.c" /* yacc.c:1646 */ break; case 932: #line 6226 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].ielem)); } #line 28350 "gram.c" /* yacc.c:1646 */ break; case 933: #line 6235 "gram.y" /* yacc.c:1646 */ { (yyval.ielem) = makeNode(IndexElem); (yyval.ielem)->name = (yyvsp[-4].str); (yyval.ielem)->expr = NULL; (yyval.ielem)->indexcolname = NULL; (yyval.ielem)->collation = (yyvsp[-3].list); (yyval.ielem)->opclass = (yyvsp[-2].list); (yyval.ielem)->ordering = (yyvsp[-1].ival); (yyval.ielem)->nulls_ordering = (yyvsp[0].ival); } #line 28365 "gram.c" /* yacc.c:1646 */ break; case 934: #line 6246 "gram.y" /* yacc.c:1646 */ { (yyval.ielem) = makeNode(IndexElem); (yyval.ielem)->name = NULL; (yyval.ielem)->expr = (yyvsp[-4].node); (yyval.ielem)->indexcolname = NULL; (yyval.ielem)->collation = (yyvsp[-3].list); (yyval.ielem)->opclass = (yyvsp[-2].list); (yyval.ielem)->ordering = (yyvsp[-1].ival); (yyval.ielem)->nulls_ordering = (yyvsp[0].ival); } #line 28380 "gram.c" /* yacc.c:1646 */ break; case 935: #line 6257 "gram.y" /* yacc.c:1646 */ { (yyval.ielem) = makeNode(IndexElem); (yyval.ielem)->name = NULL; (yyval.ielem)->expr = (yyvsp[-5].node); (yyval.ielem)->indexcolname = NULL; (yyval.ielem)->collation = (yyvsp[-3].list); (yyval.ielem)->opclass = (yyvsp[-2].list); (yyval.ielem)->ordering = (yyvsp[-1].ival); (yyval.ielem)->nulls_ordering = (yyvsp[0].ival); } #line 28395 "gram.c" /* yacc.c:1646 */ break; case 936: #line 6269 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 28401 "gram.c" /* yacc.c:1646 */ break; case 937: #line 6270 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 28407 "gram.c" /* yacc.c:1646 */ break; case 938: #line 6273 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 28413 "gram.c" /* yacc.c:1646 */ break; case 939: #line 6274 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 28419 "gram.c" /* yacc.c:1646 */ break; case 940: #line 6275 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 28425 "gram.c" /* yacc.c:1646 */ break; case 941: #line 6278 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = SORTBY_ASC; } #line 28431 "gram.c" /* yacc.c:1646 */ break; case 942: #line 6279 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = SORTBY_DESC; } #line 28437 "gram.c" /* yacc.c:1646 */ break; case 943: #line 6280 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = SORTBY_DEFAULT; } #line 28443 "gram.c" /* yacc.c:1646 */ break; case 944: #line 6283 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = SORTBY_NULLS_FIRST; } #line 28449 "gram.c" /* yacc.c:1646 */ break; case 945: #line 6284 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = SORTBY_NULLS_LAST; } #line 28455 "gram.c" /* yacc.c:1646 */ break; case 946: #line 6285 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = SORTBY_NULLS_DEFAULT; } #line 28461 "gram.c" /* yacc.c:1646 */ break; case 947: #line 6303 "gram.y" /* yacc.c:1646 */ { CreateFunctionStmt *n = makeNode(CreateFunctionStmt); n->replace = (yyvsp[-7].boolean); n->funcname = (yyvsp[-5].list); n->parameters = (yyvsp[-4].list); n->returnType = (yyvsp[-2].typnam); n->options = (yyvsp[-1].list); n->withClause = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 28476 "gram.c" /* yacc.c:1646 */ break; case 948: #line 6315 "gram.y" /* yacc.c:1646 */ { CreateFunctionStmt *n = makeNode(CreateFunctionStmt); n->replace = (yyvsp[-10].boolean); n->funcname = (yyvsp[-8].list); n->parameters = mergeTableFuncParameters((yyvsp[-7].list), (yyvsp[-3].list)); n->returnType = TableFuncTypeName((yyvsp[-3].list)); n->returnType->location = (yylsp[-5]); n->options = (yyvsp[-1].list); n->withClause = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 28492 "gram.c" /* yacc.c:1646 */ break; case 949: #line 6328 "gram.y" /* yacc.c:1646 */ { CreateFunctionStmt *n = makeNode(CreateFunctionStmt); n->replace = (yyvsp[-5].boolean); n->funcname = (yyvsp[-3].list); n->parameters = (yyvsp[-2].list); n->returnType = NULL; n->options = (yyvsp[-1].list); n->withClause = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 28507 "gram.c" /* yacc.c:1646 */ break; case 950: #line 6341 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = TRUE; } #line 28513 "gram.c" /* yacc.c:1646 */ break; case 951: #line 6342 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = FALSE; } #line 28519 "gram.c" /* yacc.c:1646 */ break; case 952: #line 6345 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 28525 "gram.c" /* yacc.c:1646 */ break; case 953: #line 6346 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 28531 "gram.c" /* yacc.c:1646 */ break; case 954: #line 6350 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].fun_param)); } #line 28537 "gram.c" /* yacc.c:1646 */ break; case 955: #line 6351 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].fun_param)); } #line 28543 "gram.c" /* yacc.c:1646 */ break; case 956: #line 6359 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 28549 "gram.c" /* yacc.c:1646 */ break; case 957: #line 6360 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 28555 "gram.c" /* yacc.c:1646 */ break; case 958: #line 6364 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].fun_param)); } #line 28561 "gram.c" /* yacc.c:1646 */ break; case 959: #line 6366 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].fun_param)); } #line 28567 "gram.c" /* yacc.c:1646 */ break; case 960: #line 6381 "gram.y" /* yacc.c:1646 */ { FunctionParameter *n = makeNode(FunctionParameter); n->name = (yyvsp[-1].str); n->argType = (yyvsp[0].typnam); n->mode = (yyvsp[-2].fun_param_mode); n->defexpr = NULL; (yyval.fun_param) = n; } #line 28580 "gram.c" /* yacc.c:1646 */ break; case 961: #line 6390 "gram.y" /* yacc.c:1646 */ { FunctionParameter *n = makeNode(FunctionParameter); n->name = (yyvsp[-2].str); n->argType = (yyvsp[0].typnam); n->mode = (yyvsp[-1].fun_param_mode); n->defexpr = NULL; (yyval.fun_param) = n; } #line 28593 "gram.c" /* yacc.c:1646 */ break; case 962: #line 6399 "gram.y" /* yacc.c:1646 */ { FunctionParameter *n = makeNode(FunctionParameter); n->name = (yyvsp[-1].str); n->argType = (yyvsp[0].typnam); n->mode = FUNC_PARAM_IN; n->defexpr = NULL; (yyval.fun_param) = n; } #line 28606 "gram.c" /* yacc.c:1646 */ break; case 963: #line 6408 "gram.y" /* yacc.c:1646 */ { FunctionParameter *n = makeNode(FunctionParameter); n->name = NULL; n->argType = (yyvsp[0].typnam); n->mode = (yyvsp[-1].fun_param_mode); n->defexpr = NULL; (yyval.fun_param) = n; } #line 28619 "gram.c" /* yacc.c:1646 */ break; case 964: #line 6417 "gram.y" /* yacc.c:1646 */ { FunctionParameter *n = makeNode(FunctionParameter); n->name = NULL; n->argType = (yyvsp[0].typnam); n->mode = FUNC_PARAM_IN; n->defexpr = NULL; (yyval.fun_param) = n; } #line 28632 "gram.c" /* yacc.c:1646 */ break; case 965: #line 6428 "gram.y" /* yacc.c:1646 */ { (yyval.fun_param_mode) = FUNC_PARAM_IN; } #line 28638 "gram.c" /* yacc.c:1646 */ break; case 966: #line 6429 "gram.y" /* yacc.c:1646 */ { (yyval.fun_param_mode) = FUNC_PARAM_OUT; } #line 28644 "gram.c" /* yacc.c:1646 */ break; case 967: #line 6430 "gram.y" /* yacc.c:1646 */ { (yyval.fun_param_mode) = FUNC_PARAM_INOUT; } #line 28650 "gram.c" /* yacc.c:1646 */ break; case 968: #line 6431 "gram.y" /* yacc.c:1646 */ { (yyval.fun_param_mode) = FUNC_PARAM_INOUT; } #line 28656 "gram.c" /* yacc.c:1646 */ break; case 969: #line 6432 "gram.y" /* yacc.c:1646 */ { (yyval.fun_param_mode) = FUNC_PARAM_VARIADIC; } #line 28662 "gram.c" /* yacc.c:1646 */ break; case 971: #line 6443 "gram.y" /* yacc.c:1646 */ { /* We can catch over-specified results here if we want to, * but for now better to silently swallow typmod, etc. * - thomas 2000-03-22 */ (yyval.typnam) = (yyvsp[0].typnam); } #line 28674 "gram.c" /* yacc.c:1646 */ break; case 972: #line 6457 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 28680 "gram.c" /* yacc.c:1646 */ break; case 973: #line 6459 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = makeTypeNameFromNameList(lcons(makeString((yyvsp[-3].str)), (yyvsp[-2].list))); (yyval.typnam)->pct_type = true; (yyval.typnam)->location = (yylsp[-3]); } #line 28690 "gram.c" /* yacc.c:1646 */ break; case 974: #line 6465 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = makeTypeNameFromNameList(lcons(makeString((yyvsp[-3].str)), (yyvsp[-2].list))); (yyval.typnam)->pct_type = true; (yyval.typnam)->setof = TRUE; (yyval.typnam)->location = (yylsp[-3]); } #line 28701 "gram.c" /* yacc.c:1646 */ break; case 975: #line 6475 "gram.y" /* yacc.c:1646 */ { (yyval.fun_param) = (yyvsp[0].fun_param); } #line 28709 "gram.c" /* yacc.c:1646 */ break; case 976: #line 6479 "gram.y" /* yacc.c:1646 */ { (yyval.fun_param) = (yyvsp[-2].fun_param); (yyval.fun_param)->defexpr = (yyvsp[0].node); } #line 28718 "gram.c" /* yacc.c:1646 */ break; case 977: #line 6484 "gram.y" /* yacc.c:1646 */ { (yyval.fun_param) = (yyvsp[-2].fun_param); (yyval.fun_param)->defexpr = (yyvsp[0].node); } #line 28727 "gram.c" /* yacc.c:1646 */ break; case 978: #line 6492 "gram.y" /* yacc.c:1646 */ { if (!((yyvsp[0].fun_param)->mode == FUNC_PARAM_IN || (yyvsp[0].fun_param)->mode == FUNC_PARAM_VARIADIC)) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("aggregates cannot have output arguments"), parser_errposition((yylsp[0])))); (yyval.fun_param) = (yyvsp[0].fun_param); } #line 28741 "gram.c" /* yacc.c:1646 */ break; case 979: #line 6533 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(NIL, makeInteger(-1)); } #line 28749 "gram.c" /* yacc.c:1646 */ break; case 980: #line 6537 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-1].list), makeInteger(-1)); } #line 28757 "gram.c" /* yacc.c:1646 */ break; case 981: #line 6541 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-1].list), makeInteger(0)); } #line 28765 "gram.c" /* yacc.c:1646 */ break; case 982: #line 6545 "gram.y" /* yacc.c:1646 */ { /* this is the only case requiring consistency checking */ (yyval.list) = makeOrderedSetArgs((yyvsp[-4].list), (yyvsp[-1].list), yyscanner); } #line 28774 "gram.c" /* yacc.c:1646 */ break; case 983: #line 6552 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].fun_param)); } #line 28780 "gram.c" /* yacc.c:1646 */ break; case 984: #line 6553 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].fun_param)); } #line 28786 "gram.c" /* yacc.c:1646 */ break; case 985: #line 6558 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 28792 "gram.c" /* yacc.c:1646 */ break; case 986: #line 6559 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 28798 "gram.c" /* yacc.c:1646 */ break; case 987: #line 6567 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("strict", (Node *)makeInteger(FALSE)); } #line 28806 "gram.c" /* yacc.c:1646 */ break; case 988: #line 6571 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("strict", (Node *)makeInteger(TRUE)); } #line 28814 "gram.c" /* yacc.c:1646 */ break; case 989: #line 6575 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("strict", (Node *)makeInteger(TRUE)); } #line 28822 "gram.c" /* yacc.c:1646 */ break; case 990: #line 6579 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("volatility", (Node *)makeString("immutable")); } #line 28830 "gram.c" /* yacc.c:1646 */ break; case 991: #line 6583 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("volatility", (Node *)makeString("stable")); } #line 28838 "gram.c" /* yacc.c:1646 */ break; case 992: #line 6587 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("volatility", (Node *)makeString("volatile")); } #line 28846 "gram.c" /* yacc.c:1646 */ break; case 993: #line 6591 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("security", (Node *)makeInteger(TRUE)); } #line 28854 "gram.c" /* yacc.c:1646 */ break; case 994: #line 6595 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("security", (Node *)makeInteger(FALSE)); } #line 28862 "gram.c" /* yacc.c:1646 */ break; case 995: #line 6599 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("security", (Node *)makeInteger(TRUE)); } #line 28870 "gram.c" /* yacc.c:1646 */ break; case 996: #line 6603 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("security", (Node *)makeInteger(FALSE)); } #line 28878 "gram.c" /* yacc.c:1646 */ break; case 997: #line 6607 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("leakproof", (Node *)makeInteger(TRUE)); } #line 28886 "gram.c" /* yacc.c:1646 */ break; case 998: #line 6611 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("leakproof", (Node *)makeInteger(FALSE)); } #line 28894 "gram.c" /* yacc.c:1646 */ break; case 999: #line 6615 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("cost", (Node *)(yyvsp[0].value)); } #line 28902 "gram.c" /* yacc.c:1646 */ break; case 1000: #line 6619 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("rows", (Node *)(yyvsp[0].value)); } #line 28910 "gram.c" /* yacc.c:1646 */ break; case 1001: #line 6623 "gram.y" /* yacc.c:1646 */ { /* we abuse the normal content of a DefElem here */ (yyval.defelt) = makeDefElem("set", (Node *)(yyvsp[0].vsetstmt)); } #line 28919 "gram.c" /* yacc.c:1646 */ break; case 1002: #line 6631 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("as", (Node *)(yyvsp[0].list)); } #line 28927 "gram.c" /* yacc.c:1646 */ break; case 1003: #line 6635 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("language", (Node *)makeString((yyvsp[0].str))); } #line 28935 "gram.c" /* yacc.c:1646 */ break; case 1004: #line 6639 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("window", (Node *)makeInteger(TRUE)); } #line 28943 "gram.c" /* yacc.c:1646 */ break; case 1005: #line 6643 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = (yyvsp[0].defelt); } #line 28951 "gram.c" /* yacc.c:1646 */ break; case 1006: #line 6648 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 28957 "gram.c" /* yacc.c:1646 */ break; case 1007: #line 6650 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeString((yyvsp[-2].str)), makeString((yyvsp[0].str))); } #line 28965 "gram.c" /* yacc.c:1646 */ break; case 1008: #line 6656 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 28971 "gram.c" /* yacc.c:1646 */ break; case 1009: #line 6657 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 28977 "gram.c" /* yacc.c:1646 */ break; case 1010: #line 6661 "gram.y" /* yacc.c:1646 */ { FunctionParameter *n = makeNode(FunctionParameter); n->name = (yyvsp[-1].str); n->argType = (yyvsp[0].typnam); n->mode = FUNC_PARAM_TABLE; n->defexpr = NULL; (yyval.fun_param) = n; } #line 28990 "gram.c" /* yacc.c:1646 */ break; case 1011: #line 6673 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].fun_param)); } #line 28998 "gram.c" /* yacc.c:1646 */ break; case 1012: #line 6677 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].fun_param)); } #line 29006 "gram.c" /* yacc.c:1646 */ break; case 1013: #line 6692 "gram.y" /* yacc.c:1646 */ { AlterFunctionStmt *n = makeNode(AlterFunctionStmt); n->func = (yyvsp[-2].funwithargs); n->actions = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 29017 "gram.c" /* yacc.c:1646 */ break; case 1014: #line 6702 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 29023 "gram.c" /* yacc.c:1646 */ break; case 1015: #line 6703 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 29029 "gram.c" /* yacc.c:1646 */ break; case 1018: #line 6725 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_FUNCTION; n->objects = list_make1((yyvsp[-2].list)); n->arguments = list_make1(extractArgTypes((yyvsp[-1].list))); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = false; n->concurrent = false; (yyval.node) = (Node *)n; } #line 29044 "gram.c" /* yacc.c:1646 */ break; case 1019: #line 6736 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_FUNCTION; n->objects = list_make1((yyvsp[-2].list)); n->arguments = list_make1(extractArgTypes((yyvsp[-1].list))); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = true; n->concurrent = false; (yyval.node) = (Node *)n; } #line 29059 "gram.c" /* yacc.c:1646 */ break; case 1020: #line 6750 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_AGGREGATE; n->objects = list_make1((yyvsp[-2].list)); n->arguments = list_make1(extractAggrArgTypes((yyvsp[-1].list))); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = false; n->concurrent = false; (yyval.node) = (Node *)n; } #line 29074 "gram.c" /* yacc.c:1646 */ break; case 1021: #line 6761 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_AGGREGATE; n->objects = list_make1((yyvsp[-2].list)); n->arguments = list_make1(extractAggrArgTypes((yyvsp[-1].list))); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = true; n->concurrent = false; (yyval.node) = (Node *)n; } #line 29089 "gram.c" /* yacc.c:1646 */ break; case 1022: #line 6775 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_OPERATOR; n->objects = list_make1((yyvsp[-2].list)); n->arguments = list_make1((yyvsp[-1].list)); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = false; n->concurrent = false; (yyval.node) = (Node *)n; } #line 29104 "gram.c" /* yacc.c:1646 */ break; case 1023: #line 6786 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_OPERATOR; n->objects = list_make1((yyvsp[-2].list)); n->arguments = list_make1((yyvsp[-1].list)); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = true; n->concurrent = false; (yyval.node) = (Node *)n; } #line 29119 "gram.c" /* yacc.c:1646 */ break; case 1024: #line 6800 "gram.y" /* yacc.c:1646 */ { ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("missing argument"), errhint("Use NONE to denote the missing argument of a unary operator."), parser_errposition((yylsp[0])))); } #line 29131 "gram.c" /* yacc.c:1646 */ break; case 1025: #line 6808 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-3].typnam), (yyvsp[-1].typnam)); } #line 29137 "gram.c" /* yacc.c:1646 */ break; case 1026: #line 6810 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(NULL, (yyvsp[-1].typnam)); } #line 29143 "gram.c" /* yacc.c:1646 */ break; case 1027: #line 6812 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-3].typnam), NULL); } #line 29149 "gram.c" /* yacc.c:1646 */ break; case 1028: #line 6817 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 29155 "gram.c" /* yacc.c:1646 */ break; case 1029: #line 6819 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lcons(makeString((yyvsp[-2].str)), (yyvsp[0].list)); } #line 29161 "gram.c" /* yacc.c:1646 */ break; case 1030: #line 6832 "gram.y" /* yacc.c:1646 */ { DoStmt *n = makeNode(DoStmt); n->args = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 29171 "gram.c" /* yacc.c:1646 */ break; case 1031: #line 6840 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 29177 "gram.c" /* yacc.c:1646 */ break; case 1032: #line 6841 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 29183 "gram.c" /* yacc.c:1646 */ break; case 1033: #line 6846 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("as", (Node *)makeString((yyvsp[0].str))); } #line 29191 "gram.c" /* yacc.c:1646 */ break; case 1034: #line 6850 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("language", (Node *)makeString((yyvsp[0].str))); } #line 29199 "gram.c" /* yacc.c:1646 */ break; case 1035: #line 6863 "gram.y" /* yacc.c:1646 */ { CreateCastStmt *n = makeNode(CreateCastStmt); n->sourcetype = (yyvsp[-7].typnam); n->targettype = (yyvsp[-5].typnam); n->func = (yyvsp[-1].funwithargs); n->context = (CoercionContext) (yyvsp[0].ival); n->inout = false; (yyval.node) = (Node *)n; } #line 29213 "gram.c" /* yacc.c:1646 */ break; case 1036: #line 6874 "gram.y" /* yacc.c:1646 */ { CreateCastStmt *n = makeNode(CreateCastStmt); n->sourcetype = (yyvsp[-6].typnam); n->targettype = (yyvsp[-4].typnam); n->func = NULL; n->context = (CoercionContext) (yyvsp[0].ival); n->inout = false; (yyval.node) = (Node *)n; } #line 29227 "gram.c" /* yacc.c:1646 */ break; case 1037: #line 6885 "gram.y" /* yacc.c:1646 */ { CreateCastStmt *n = makeNode(CreateCastStmt); n->sourcetype = (yyvsp[-6].typnam); n->targettype = (yyvsp[-4].typnam); n->func = NULL; n->context = (CoercionContext) (yyvsp[0].ival); n->inout = true; (yyval.node) = (Node *)n; } #line 29241 "gram.c" /* yacc.c:1646 */ break; case 1038: #line 6896 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = COERCION_IMPLICIT; } #line 29247 "gram.c" /* yacc.c:1646 */ break; case 1039: #line 6897 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = COERCION_ASSIGNMENT; } #line 29253 "gram.c" /* yacc.c:1646 */ break; case 1040: #line 6898 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = COERCION_EXPLICIT; } #line 29259 "gram.c" /* yacc.c:1646 */ break; case 1041: #line 6903 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_CAST; n->objects = list_make1(list_make1((yyvsp[-4].typnam))); n->arguments = list_make1(list_make1((yyvsp[-2].typnam))); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = (yyvsp[-6].boolean); n->concurrent = false; (yyval.node) = (Node *)n; } #line 29274 "gram.c" /* yacc.c:1646 */ break; case 1042: #line 6915 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = TRUE; } #line 29280 "gram.c" /* yacc.c:1646 */ break; case 1043: #line 6916 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = FALSE; } #line 29286 "gram.c" /* yacc.c:1646 */ break; case 1044: #line 6931 "gram.y" /* yacc.c:1646 */ { ReindexStmt *n = makeNode(ReindexStmt); n->kind = (yyvsp[-2].objtype); n->relation = (yyvsp[-1].range); n->name = NULL; (yyval.node) = (Node *)n; } #line 29298 "gram.c" /* yacc.c:1646 */ break; case 1045: #line 6939 "gram.y" /* yacc.c:1646 */ { ReindexStmt *n = makeNode(ReindexStmt); n->kind = OBJECT_DATABASE; n->name = (yyvsp[-1].str); n->relation = NULL; n->do_system = true; n->do_user = false; (yyval.node) = (Node *)n; } #line 29312 "gram.c" /* yacc.c:1646 */ break; case 1046: #line 6949 "gram.y" /* yacc.c:1646 */ { ReindexStmt *n = makeNode(ReindexStmt); n->kind = OBJECT_DATABASE; n->name = (yyvsp[-1].str); n->relation = NULL; n->do_system = true; n->do_user = true; (yyval.node) = (Node *)n; } #line 29326 "gram.c" /* yacc.c:1646 */ break; case 1047: #line 6961 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_INDEX; } #line 29332 "gram.c" /* yacc.c:1646 */ break; case 1048: #line 6962 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TABLE; } #line 29338 "gram.c" /* yacc.c:1646 */ break; case 1049: #line 6965 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = TRUE; } #line 29344 "gram.c" /* yacc.c:1646 */ break; case 1050: #line 6966 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = FALSE; } #line 29350 "gram.c" /* yacc.c:1646 */ break; case 1051: #line 6977 "gram.y" /* yacc.c:1646 */ { AlterTableSpaceMoveStmt *n = makeNode(AlterTableSpaceMoveStmt); n->orig_tablespacename = (yyvsp[-5].str); n->objtype = -1; n->move_all = true; n->roles = NIL; n->new_tablespacename = (yyvsp[-1].str); n->nowait = (yyvsp[0].boolean); (yyval.node) = (Node *)n; } #line 29366 "gram.c" /* yacc.c:1646 */ break; case 1052: #line 6989 "gram.y" /* yacc.c:1646 */ { AlterTableSpaceMoveStmt *n = makeNode(AlterTableSpaceMoveStmt); n->orig_tablespacename = (yyvsp[-5].str); n->objtype = OBJECT_TABLE; n->move_all = false; n->roles = NIL; n->new_tablespacename = (yyvsp[-1].str); n->nowait = (yyvsp[0].boolean); (yyval.node) = (Node *)n; } #line 29382 "gram.c" /* yacc.c:1646 */ break; case 1053: #line 7001 "gram.y" /* yacc.c:1646 */ { AlterTableSpaceMoveStmt *n = makeNode(AlterTableSpaceMoveStmt); n->orig_tablespacename = (yyvsp[-5].str); n->objtype = OBJECT_INDEX; n->move_all = false; n->roles = NIL; n->new_tablespacename = (yyvsp[-1].str); n->nowait = (yyvsp[0].boolean); (yyval.node) = (Node *)n; } #line 29398 "gram.c" /* yacc.c:1646 */ break; case 1054: #line 7013 "gram.y" /* yacc.c:1646 */ { AlterTableSpaceMoveStmt *n = makeNode(AlterTableSpaceMoveStmt); n->orig_tablespacename = (yyvsp[-6].str); n->objtype = OBJECT_MATVIEW; n->move_all = false; n->roles = NIL; n->new_tablespacename = (yyvsp[-1].str); n->nowait = (yyvsp[0].boolean); (yyval.node) = (Node *)n; } #line 29414 "gram.c" /* yacc.c:1646 */ break; case 1055: #line 7025 "gram.y" /* yacc.c:1646 */ { AlterTableSpaceMoveStmt *n = makeNode(AlterTableSpaceMoveStmt); n->orig_tablespacename = (yyvsp[-8].str); n->objtype = -1; n->move_all = true; n->roles = (yyvsp[-3].list); n->new_tablespacename = (yyvsp[-1].str); n->nowait = (yyvsp[0].boolean); (yyval.node) = (Node *)n; } #line 29430 "gram.c" /* yacc.c:1646 */ break; case 1056: #line 7037 "gram.y" /* yacc.c:1646 */ { AlterTableSpaceMoveStmt *n = makeNode(AlterTableSpaceMoveStmt); n->orig_tablespacename = (yyvsp[-8].str); n->objtype = OBJECT_TABLE; n->move_all = false; n->roles = (yyvsp[-3].list); n->new_tablespacename = (yyvsp[-1].str); n->nowait = (yyvsp[0].boolean); (yyval.node) = (Node *)n; } #line 29446 "gram.c" /* yacc.c:1646 */ break; case 1057: #line 7049 "gram.y" /* yacc.c:1646 */ { AlterTableSpaceMoveStmt *n = makeNode(AlterTableSpaceMoveStmt); n->orig_tablespacename = (yyvsp[-8].str); n->objtype = OBJECT_INDEX; n->move_all = false; n->roles = (yyvsp[-3].list); n->new_tablespacename = (yyvsp[-1].str); n->nowait = (yyvsp[0].boolean); (yyval.node) = (Node *)n; } #line 29462 "gram.c" /* yacc.c:1646 */ break; case 1058: #line 7061 "gram.y" /* yacc.c:1646 */ { AlterTableSpaceMoveStmt *n = makeNode(AlterTableSpaceMoveStmt); n->orig_tablespacename = (yyvsp[-9].str); n->objtype = OBJECT_MATVIEW; n->move_all = false; n->roles = (yyvsp[-3].list); n->new_tablespacename = (yyvsp[-1].str); n->nowait = (yyvsp[0].boolean); (yyval.node) = (Node *)n; } #line 29478 "gram.c" /* yacc.c:1646 */ break; case 1059: #line 7073 "gram.y" /* yacc.c:1646 */ { AlterTableSpaceOptionsStmt *n = makeNode(AlterTableSpaceOptionsStmt); n->tablespacename = (yyvsp[-2].str); n->options = (yyvsp[0].list); n->isReset = FALSE; (yyval.node) = (Node *)n; } #line 29491 "gram.c" /* yacc.c:1646 */ break; case 1060: #line 7082 "gram.y" /* yacc.c:1646 */ { AlterTableSpaceOptionsStmt *n = makeNode(AlterTableSpaceOptionsStmt); n->tablespacename = (yyvsp[-2].str); n->options = (yyvsp[0].list); n->isReset = TRUE; (yyval.node) = (Node *)n; } #line 29504 "gram.c" /* yacc.c:1646 */ break; case 1061: #line 7099 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_AGGREGATE; n->object = (yyvsp[-4].list); n->objarg = extractAggrArgTypes((yyvsp[-3].list)); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 29518 "gram.c" /* yacc.c:1646 */ break; case 1062: #line 7109 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_COLLATION; n->object = (yyvsp[-3].list); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 29531 "gram.c" /* yacc.c:1646 */ break; case 1063: #line 7118 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_CONVERSION; n->object = (yyvsp[-3].list); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 29544 "gram.c" /* yacc.c:1646 */ break; case 1064: #line 7127 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_DATABASE; n->subname = (yyvsp[-3].str); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 29557 "gram.c" /* yacc.c:1646 */ break; case 1065: #line 7136 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_DOMAIN; n->object = (yyvsp[-3].list); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 29570 "gram.c" /* yacc.c:1646 */ break; case 1066: #line 7145 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_CONSTRAINT; n->relationType = OBJECT_DOMAIN; n->object = (yyvsp[-5].list); n->subname = (yyvsp[-2].str); n->newname = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 29584 "gram.c" /* yacc.c:1646 */ break; case 1067: #line 7155 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_FDW; n->object = list_make1(makeString((yyvsp[-3].str))); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 29597 "gram.c" /* yacc.c:1646 */ break; case 1068: #line 7164 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_FUNCTION; n->object = (yyvsp[-3].funwithargs)->funcname; n->objarg = (yyvsp[-3].funwithargs)->funcargs; n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 29611 "gram.c" /* yacc.c:1646 */ break; case 1069: #line 7174 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_ROLE; n->subname = (yyvsp[-3].str); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 29624 "gram.c" /* yacc.c:1646 */ break; case 1070: #line 7183 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_LANGUAGE; n->object = list_make1(makeString((yyvsp[-3].str))); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 29637 "gram.c" /* yacc.c:1646 */ break; case 1071: #line 7192 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_OPCLASS; n->object = (yyvsp[-5].list); n->objarg = list_make1(makeString((yyvsp[-3].str))); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 29651 "gram.c" /* yacc.c:1646 */ break; case 1072: #line 7202 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_OPFAMILY; n->object = (yyvsp[-5].list); n->objarg = list_make1(makeString((yyvsp[-3].str))); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 29665 "gram.c" /* yacc.c:1646 */ break; case 1073: #line 7212 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_SCHEMA; n->subname = (yyvsp[-3].str); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 29678 "gram.c" /* yacc.c:1646 */ break; case 1074: #line 7221 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_FOREIGN_SERVER; n->object = list_make1(makeString((yyvsp[-3].str))); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 29691 "gram.c" /* yacc.c:1646 */ break; case 1075: #line 7230 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_TABLE; n->relation = (yyvsp[-3].range); n->subname = NULL; n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 29705 "gram.c" /* yacc.c:1646 */ break; case 1076: #line 7240 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_TABLE; n->relation = (yyvsp[-3].range); n->subname = NULL; n->newname = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (Node *)n; } #line 29719 "gram.c" /* yacc.c:1646 */ break; case 1077: #line 7250 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_SEQUENCE; n->relation = (yyvsp[-3].range); n->subname = NULL; n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 29733 "gram.c" /* yacc.c:1646 */ break; case 1078: #line 7260 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_SEQUENCE; n->relation = (yyvsp[-3].range); n->subname = NULL; n->newname = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (Node *)n; } #line 29747 "gram.c" /* yacc.c:1646 */ break; case 1079: #line 7270 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_VIEW; n->relation = (yyvsp[-3].range); n->subname = NULL; n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 29761 "gram.c" /* yacc.c:1646 */ break; case 1080: #line 7280 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_VIEW; n->relation = (yyvsp[-3].range); n->subname = NULL; n->newname = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (Node *)n; } #line 29775 "gram.c" /* yacc.c:1646 */ break; case 1081: #line 7290 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_MATVIEW; n->relation = (yyvsp[-3].range); n->subname = NULL; n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 29789 "gram.c" /* yacc.c:1646 */ break; case 1082: #line 7300 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_MATVIEW; n->relation = (yyvsp[-3].range); n->subname = NULL; n->newname = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (Node *)n; } #line 29803 "gram.c" /* yacc.c:1646 */ break; case 1083: #line 7310 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_INDEX; n->relation = (yyvsp[-3].range); n->subname = NULL; n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 29817 "gram.c" /* yacc.c:1646 */ break; case 1084: #line 7320 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_INDEX; n->relation = (yyvsp[-3].range); n->subname = NULL; n->newname = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (Node *)n; } #line 29831 "gram.c" /* yacc.c:1646 */ break; case 1085: #line 7330 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_FOREIGN_TABLE; n->relation = (yyvsp[-3].range); n->subname = NULL; n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 29845 "gram.c" /* yacc.c:1646 */ break; case 1086: #line 7340 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_FOREIGN_TABLE; n->relation = (yyvsp[-3].range); n->subname = NULL; n->newname = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (Node *)n; } #line 29859 "gram.c" /* yacc.c:1646 */ break; case 1087: #line 7350 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_COLUMN; n->relationType = OBJECT_TABLE; n->relation = (yyvsp[-5].range); n->subname = (yyvsp[-2].str); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 29874 "gram.c" /* yacc.c:1646 */ break; case 1088: #line 7361 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_COLUMN; n->relationType = OBJECT_TABLE; n->relation = (yyvsp[-5].range); n->subname = (yyvsp[-2].str); n->newname = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (Node *)n; } #line 29889 "gram.c" /* yacc.c:1646 */ break; case 1089: #line 7372 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_COLUMN; n->relationType = OBJECT_MATVIEW; n->relation = (yyvsp[-5].range); n->subname = (yyvsp[-2].str); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 29904 "gram.c" /* yacc.c:1646 */ break; case 1090: #line 7383 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_COLUMN; n->relationType = OBJECT_MATVIEW; n->relation = (yyvsp[-5].range); n->subname = (yyvsp[-2].str); n->newname = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (Node *)n; } #line 29919 "gram.c" /* yacc.c:1646 */ break; case 1091: #line 7394 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_CONSTRAINT; n->relationType = OBJECT_TABLE; n->relation = (yyvsp[-5].range); n->subname = (yyvsp[-2].str); n->newname = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 29933 "gram.c" /* yacc.c:1646 */ break; case 1092: #line 7404 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_COLUMN; n->relationType = OBJECT_FOREIGN_TABLE; n->relation = (yyvsp[-5].range); n->subname = (yyvsp[-2].str); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 29948 "gram.c" /* yacc.c:1646 */ break; case 1093: #line 7415 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_COLUMN; n->relationType = OBJECT_FOREIGN_TABLE; n->relation = (yyvsp[-5].range); n->subname = (yyvsp[-2].str); n->newname = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (Node *)n; } #line 29963 "gram.c" /* yacc.c:1646 */ break; case 1094: #line 7426 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_RULE; n->relation = (yyvsp[-3].range); n->subname = (yyvsp[-5].str); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 29977 "gram.c" /* yacc.c:1646 */ break; case 1095: #line 7436 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_TRIGGER; n->relation = (yyvsp[-3].range); n->subname = (yyvsp[-5].str); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 29991 "gram.c" /* yacc.c:1646 */ break; case 1096: #line 7446 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_EVENT_TRIGGER; n->object = list_make1(makeString((yyvsp[-3].str))); n->newname = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 30003 "gram.c" /* yacc.c:1646 */ break; case 1097: #line 7454 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_ROLE; n->subname = (yyvsp[-3].str); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 30016 "gram.c" /* yacc.c:1646 */ break; case 1098: #line 7463 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_ROLE; n->subname = (yyvsp[-3].str); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 30029 "gram.c" /* yacc.c:1646 */ break; case 1099: #line 7472 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_TABLESPACE; n->subname = (yyvsp[-3].str); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 30042 "gram.c" /* yacc.c:1646 */ break; case 1100: #line 7481 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_TSPARSER; n->object = (yyvsp[-3].list); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 30055 "gram.c" /* yacc.c:1646 */ break; case 1101: #line 7490 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_TSDICTIONARY; n->object = (yyvsp[-3].list); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 30068 "gram.c" /* yacc.c:1646 */ break; case 1102: #line 7499 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_TSTEMPLATE; n->object = (yyvsp[-3].list); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 30081 "gram.c" /* yacc.c:1646 */ break; case 1103: #line 7508 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_TSCONFIGURATION; n->object = (yyvsp[-3].list); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 30094 "gram.c" /* yacc.c:1646 */ break; case 1104: #line 7517 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_TYPE; n->object = (yyvsp[-3].list); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 30107 "gram.c" /* yacc.c:1646 */ break; case 1105: #line 7526 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_ATTRIBUTE; n->relationType = OBJECT_TYPE; n->relation = makeRangeVarFromAnyName((yyvsp[-6].list), (yylsp[-6]), yyscanner); n->subname = (yyvsp[-3].str); n->newname = (yyvsp[-1].str); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 30123 "gram.c" /* yacc.c:1646 */ break; case 1106: #line 7539 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = COLUMN; } #line 30129 "gram.c" /* yacc.c:1646 */ break; case 1107: #line 7540 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 30135 "gram.c" /* yacc.c:1646 */ break; case 1108: #line 7543 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 1; } #line 30141 "gram.c" /* yacc.c:1646 */ break; case 1109: #line 7544 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 30147 "gram.c" /* yacc.c:1646 */ break; case 1110: #line 7555 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_AGGREGATE; n->object = (yyvsp[-4].list); n->objarg = extractAggrArgTypes((yyvsp[-3].list)); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 30161 "gram.c" /* yacc.c:1646 */ break; case 1111: #line 7565 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_COLLATION; n->object = (yyvsp[-3].list); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 30174 "gram.c" /* yacc.c:1646 */ break; case 1112: #line 7574 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_CONVERSION; n->object = (yyvsp[-3].list); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 30187 "gram.c" /* yacc.c:1646 */ break; case 1113: #line 7583 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_DOMAIN; n->object = (yyvsp[-3].list); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 30200 "gram.c" /* yacc.c:1646 */ break; case 1114: #line 7592 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_EXTENSION; n->object = (yyvsp[-3].list); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 30213 "gram.c" /* yacc.c:1646 */ break; case 1115: #line 7601 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_FUNCTION; n->object = (yyvsp[-3].funwithargs)->funcname; n->objarg = (yyvsp[-3].funwithargs)->funcargs; n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 30227 "gram.c" /* yacc.c:1646 */ break; case 1116: #line 7611 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_OPERATOR; n->object = (yyvsp[-4].list); n->objarg = (yyvsp[-3].list); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 30241 "gram.c" /* yacc.c:1646 */ break; case 1117: #line 7621 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_OPCLASS; n->object = (yyvsp[-5].list); n->objarg = list_make1(makeString((yyvsp[-3].str))); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 30255 "gram.c" /* yacc.c:1646 */ break; case 1118: #line 7631 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_OPFAMILY; n->object = (yyvsp[-5].list); n->objarg = list_make1(makeString((yyvsp[-3].str))); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 30269 "gram.c" /* yacc.c:1646 */ break; case 1119: #line 7641 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_TABLE; n->relation = (yyvsp[-3].range); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 30282 "gram.c" /* yacc.c:1646 */ break; case 1120: #line 7650 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_TABLE; n->relation = (yyvsp[-3].range); n->newschema = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (Node *)n; } #line 30295 "gram.c" /* yacc.c:1646 */ break; case 1121: #line 7659 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_TSPARSER; n->object = (yyvsp[-3].list); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 30308 "gram.c" /* yacc.c:1646 */ break; case 1122: #line 7668 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_TSDICTIONARY; n->object = (yyvsp[-3].list); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 30321 "gram.c" /* yacc.c:1646 */ break; case 1123: #line 7677 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_TSTEMPLATE; n->object = (yyvsp[-3].list); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 30334 "gram.c" /* yacc.c:1646 */ break; case 1124: #line 7686 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_TSCONFIGURATION; n->object = (yyvsp[-3].list); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 30347 "gram.c" /* yacc.c:1646 */ break; case 1125: #line 7695 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_SEQUENCE; n->relation = (yyvsp[-3].range); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 30360 "gram.c" /* yacc.c:1646 */ break; case 1126: #line 7704 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_SEQUENCE; n->relation = (yyvsp[-3].range); n->newschema = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (Node *)n; } #line 30373 "gram.c" /* yacc.c:1646 */ break; case 1127: #line 7713 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_VIEW; n->relation = (yyvsp[-3].range); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 30386 "gram.c" /* yacc.c:1646 */ break; case 1128: #line 7722 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_VIEW; n->relation = (yyvsp[-3].range); n->newschema = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (Node *)n; } #line 30399 "gram.c" /* yacc.c:1646 */ break; case 1129: #line 7731 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_MATVIEW; n->relation = (yyvsp[-3].range); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 30412 "gram.c" /* yacc.c:1646 */ break; case 1130: #line 7740 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_MATVIEW; n->relation = (yyvsp[-3].range); n->newschema = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (Node *)n; } #line 30425 "gram.c" /* yacc.c:1646 */ break; case 1131: #line 7749 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_FOREIGN_TABLE; n->relation = (yyvsp[-3].range); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 30438 "gram.c" /* yacc.c:1646 */ break; case 1132: #line 7758 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_FOREIGN_TABLE; n->relation = (yyvsp[-3].range); n->newschema = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (Node *)n; } #line 30451 "gram.c" /* yacc.c:1646 */ break; case 1133: #line 7767 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_TYPE; n->object = (yyvsp[-3].list); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 30464 "gram.c" /* yacc.c:1646 */ break; case 1134: #line 7784 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_AGGREGATE; n->object = (yyvsp[-4].list); n->objarg = extractAggrArgTypes((yyvsp[-3].list)); n->newowner = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 30477 "gram.c" /* yacc.c:1646 */ break; case 1135: #line 7793 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_COLLATION; n->object = (yyvsp[-3].list); n->newowner = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 30489 "gram.c" /* yacc.c:1646 */ break; case 1136: #line 7801 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_CONVERSION; n->object = (yyvsp[-3].list); n->newowner = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 30501 "gram.c" /* yacc.c:1646 */ break; case 1137: #line 7809 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_DATABASE; n->object = list_make1(makeString((yyvsp[-3].str))); n->newowner = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 30513 "gram.c" /* yacc.c:1646 */ break; case 1138: #line 7817 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_DOMAIN; n->object = (yyvsp[-3].list); n->newowner = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 30525 "gram.c" /* yacc.c:1646 */ break; case 1139: #line 7825 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_FUNCTION; n->object = (yyvsp[-3].funwithargs)->funcname; n->objarg = (yyvsp[-3].funwithargs)->funcargs; n->newowner = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 30538 "gram.c" /* yacc.c:1646 */ break; case 1140: #line 7834 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_LANGUAGE; n->object = list_make1(makeString((yyvsp[-3].str))); n->newowner = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 30550 "gram.c" /* yacc.c:1646 */ break; case 1141: #line 7842 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_LARGEOBJECT; n->object = list_make1((yyvsp[-3].value)); n->newowner = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 30562 "gram.c" /* yacc.c:1646 */ break; case 1142: #line 7850 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_OPERATOR; n->object = (yyvsp[-4].list); n->objarg = (yyvsp[-3].list); n->newowner = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 30575 "gram.c" /* yacc.c:1646 */ break; case 1143: #line 7859 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_OPCLASS; n->object = (yyvsp[-5].list); n->objarg = list_make1(makeString((yyvsp[-3].str))); n->newowner = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 30588 "gram.c" /* yacc.c:1646 */ break; case 1144: #line 7868 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_OPFAMILY; n->object = (yyvsp[-5].list); n->objarg = list_make1(makeString((yyvsp[-3].str))); n->newowner = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 30601 "gram.c" /* yacc.c:1646 */ break; case 1145: #line 7877 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_SCHEMA; n->object = list_make1(makeString((yyvsp[-3].str))); n->newowner = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 30613 "gram.c" /* yacc.c:1646 */ break; case 1146: #line 7885 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_TYPE; n->object = (yyvsp[-3].list); n->newowner = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 30625 "gram.c" /* yacc.c:1646 */ break; case 1147: #line 7893 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_TABLESPACE; n->object = list_make1(makeString((yyvsp[-3].str))); n->newowner = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 30637 "gram.c" /* yacc.c:1646 */ break; case 1148: #line 7901 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_TSDICTIONARY; n->object = (yyvsp[-3].list); n->newowner = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 30649 "gram.c" /* yacc.c:1646 */ break; case 1149: #line 7909 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_TSCONFIGURATION; n->object = (yyvsp[-3].list); n->newowner = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 30661 "gram.c" /* yacc.c:1646 */ break; case 1150: #line 7917 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_FDW; n->object = list_make1(makeString((yyvsp[-3].str))); n->newowner = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 30673 "gram.c" /* yacc.c:1646 */ break; case 1151: #line 7925 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_FOREIGN_SERVER; n->object = list_make1(makeString((yyvsp[-3].str))); n->newowner = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 30685 "gram.c" /* yacc.c:1646 */ break; case 1152: #line 7933 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_EVENT_TRIGGER; n->object = list_make1(makeString((yyvsp[-3].str))); n->newowner = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 30697 "gram.c" /* yacc.c:1646 */ break; case 1153: #line 7952 "gram.y" /* yacc.c:1646 */ { RuleStmt *n = makeNode(RuleStmt); n->replace = (yyvsp[-11].boolean); n->relation = (yyvsp[-4].range); n->rulename = (yyvsp[-9].str); n->whereClause = (yyvsp[-3].node); n->event = (yyvsp[-6].ival); n->instead = (yyvsp[-1].boolean); n->actions = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 30713 "gram.c" /* yacc.c:1646 */ break; case 1154: #line 7966 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 30719 "gram.c" /* yacc.c:1646 */ break; case 1155: #line 7967 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 30725 "gram.c" /* yacc.c:1646 */ break; case 1156: #line 7968 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 30731 "gram.c" /* yacc.c:1646 */ break; case 1157: #line 7974 "gram.y" /* yacc.c:1646 */ { if ((yyvsp[0].node) != NULL) (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); else (yyval.list) = (yyvsp[-2].list); } #line 30741 "gram.c" /* yacc.c:1646 */ break; case 1158: #line 7980 "gram.y" /* yacc.c:1646 */ { if ((yyvsp[0].node) != NULL) (yyval.list) = list_make1((yyvsp[0].node)); else (yyval.list) = NIL; } #line 30751 "gram.c" /* yacc.c:1646 */ break; case 1164: #line 7996 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 30757 "gram.c" /* yacc.c:1646 */ break; case 1165: #line 7997 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 30763 "gram.c" /* yacc.c:1646 */ break; case 1166: #line 8000 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CMD_SELECT; } #line 30769 "gram.c" /* yacc.c:1646 */ break; case 1167: #line 8001 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CMD_UPDATE; } #line 30775 "gram.c" /* yacc.c:1646 */ break; case 1168: #line 8002 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CMD_DELETE; } #line 30781 "gram.c" /* yacc.c:1646 */ break; case 1169: #line 8003 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CMD_INSERT; } #line 30787 "gram.c" /* yacc.c:1646 */ break; case 1170: #line 8007 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = TRUE; } #line 30793 "gram.c" /* yacc.c:1646 */ break; case 1171: #line 8008 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = FALSE; } #line 30799 "gram.c" /* yacc.c:1646 */ break; case 1172: #line 8009 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = FALSE; } #line 30805 "gram.c" /* yacc.c:1646 */ break; case 1173: #line 8015 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_RULE; n->objects = list_make1(lappend((yyvsp[-1].list), makeString((yyvsp[-3].str)))); n->arguments = NIL; n->behavior = (yyvsp[0].dbehavior); n->missing_ok = false; n->concurrent = false; (yyval.node) = (Node *) n; } #line 30820 "gram.c" /* yacc.c:1646 */ break; case 1174: #line 8026 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_RULE; n->objects = list_make1(lappend((yyvsp[-1].list), makeString((yyvsp[-3].str)))); n->arguments = NIL; n->behavior = (yyvsp[0].dbehavior); n->missing_ok = true; n->concurrent = false; (yyval.node) = (Node *) n; } #line 30835 "gram.c" /* yacc.c:1646 */ break; case 1175: #line 8048 "gram.y" /* yacc.c:1646 */ { NotifyStmt *n = makeNode(NotifyStmt); n->conditionname = (yyvsp[-1].str); n->payload = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 30846 "gram.c" /* yacc.c:1646 */ break; case 1176: #line 8057 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 30852 "gram.c" /* yacc.c:1646 */ break; case 1177: #line 8058 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 30858 "gram.c" /* yacc.c:1646 */ break; case 1178: #line 8062 "gram.y" /* yacc.c:1646 */ { ListenStmt *n = makeNode(ListenStmt); n->conditionname = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 30868 "gram.c" /* yacc.c:1646 */ break; case 1179: #line 8071 "gram.y" /* yacc.c:1646 */ { UnlistenStmt *n = makeNode(UnlistenStmt); n->conditionname = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 30878 "gram.c" /* yacc.c:1646 */ break; case 1180: #line 8077 "gram.y" /* yacc.c:1646 */ { UnlistenStmt *n = makeNode(UnlistenStmt); n->conditionname = NULL; (yyval.node) = (Node *)n; } #line 30888 "gram.c" /* yacc.c:1646 */ break; case 1181: #line 8096 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_ROLLBACK; n->options = NIL; (yyval.node) = (Node *)n; } #line 30899 "gram.c" /* yacc.c:1646 */ break; case 1182: #line 8103 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_BEGIN; n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 30910 "gram.c" /* yacc.c:1646 */ break; case 1183: #line 8110 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_START; n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 30921 "gram.c" /* yacc.c:1646 */ break; case 1184: #line 8117 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_COMMIT; n->options = NIL; (yyval.node) = (Node *)n; } #line 30932 "gram.c" /* yacc.c:1646 */ break; case 1185: #line 8124 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_COMMIT; n->options = NIL; (yyval.node) = (Node *)n; } #line 30943 "gram.c" /* yacc.c:1646 */ break; case 1186: #line 8131 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_ROLLBACK; n->options = NIL; (yyval.node) = (Node *)n; } #line 30954 "gram.c" /* yacc.c:1646 */ break; case 1187: #line 8138 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_SAVEPOINT; n->options = list_make1(makeDefElem("savepoint_name", (Node *)makeString((yyvsp[0].str)))); (yyval.node) = (Node *)n; } #line 30966 "gram.c" /* yacc.c:1646 */ break; case 1188: #line 8146 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_RELEASE; n->options = list_make1(makeDefElem("savepoint_name", (Node *)makeString((yyvsp[0].str)))); (yyval.node) = (Node *)n; } #line 30978 "gram.c" /* yacc.c:1646 */ break; case 1189: #line 8154 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_RELEASE; n->options = list_make1(makeDefElem("savepoint_name", (Node *)makeString((yyvsp[0].str)))); (yyval.node) = (Node *)n; } #line 30990 "gram.c" /* yacc.c:1646 */ break; case 1190: #line 8162 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_ROLLBACK_TO; n->options = list_make1(makeDefElem("savepoint_name", (Node *)makeString((yyvsp[0].str)))); (yyval.node) = (Node *)n; } #line 31002 "gram.c" /* yacc.c:1646 */ break; case 1191: #line 8170 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_ROLLBACK_TO; n->options = list_make1(makeDefElem("savepoint_name", (Node *)makeString((yyvsp[0].str)))); (yyval.node) = (Node *)n; } #line 31014 "gram.c" /* yacc.c:1646 */ break; case 1192: #line 8178 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_PREPARE; n->gid = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 31025 "gram.c" /* yacc.c:1646 */ break; case 1193: #line 8185 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_COMMIT_PREPARED; n->gid = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 31036 "gram.c" /* yacc.c:1646 */ break; case 1194: #line 8192 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_ROLLBACK_PREPARED; n->gid = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 31047 "gram.c" /* yacc.c:1646 */ break; case 1195: #line 8200 "gram.y" /* yacc.c:1646 */ {} #line 31053 "gram.c" /* yacc.c:1646 */ break; case 1196: #line 8201 "gram.y" /* yacc.c:1646 */ {} #line 31059 "gram.c" /* yacc.c:1646 */ break; case 1197: #line 8202 "gram.y" /* yacc.c:1646 */ {} #line 31065 "gram.c" /* yacc.c:1646 */ break; case 1198: #line 8207 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("transaction_isolation", makeStringConst((yyvsp[0].str), (yylsp[0]))); } #line 31072 "gram.c" /* yacc.c:1646 */ break; case 1199: #line 8210 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("transaction_read_only", makeIntConst(TRUE, (yylsp[-1]))); } #line 31079 "gram.c" /* yacc.c:1646 */ break; case 1200: #line 8213 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("transaction_read_only", makeIntConst(FALSE, (yylsp[-1]))); } #line 31086 "gram.c" /* yacc.c:1646 */ break; case 1201: #line 8216 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("transaction_deferrable", makeIntConst(TRUE, (yylsp[0]))); } #line 31093 "gram.c" /* yacc.c:1646 */ break; case 1202: #line 8219 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("transaction_deferrable", makeIntConst(FALSE, (yylsp[-1]))); } #line 31100 "gram.c" /* yacc.c:1646 */ break; case 1203: #line 8226 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 31106 "gram.c" /* yacc.c:1646 */ break; case 1204: #line 8228 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 31112 "gram.c" /* yacc.c:1646 */ break; case 1205: #line 8230 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 31118 "gram.c" /* yacc.c:1646 */ break; case 1207: #line 8236 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 31124 "gram.c" /* yacc.c:1646 */ break; case 1208: #line 8250 "gram.y" /* yacc.c:1646 */ { ViewStmt *n = makeNode(ViewStmt); n->view = (yyvsp[-5].range); n->view->relpersistence = (yyvsp[-7].ival); n->aliases = (yyvsp[-4].list); n->query = (yyvsp[-1].node); n->replace = false; n->options = (yyvsp[-3].list); n->withCheckOption = (yyvsp[0].ival); (yyval.node) = (Node *) n; } #line 31140 "gram.c" /* yacc.c:1646 */ break; case 1209: #line 8263 "gram.y" /* yacc.c:1646 */ { ViewStmt *n = makeNode(ViewStmt); n->view = (yyvsp[-5].range); n->view->relpersistence = (yyvsp[-7].ival); n->aliases = (yyvsp[-4].list); n->query = (yyvsp[-1].node); n->replace = true; n->options = (yyvsp[-3].list); n->withCheckOption = (yyvsp[0].ival); (yyval.node) = (Node *) n; } #line 31156 "gram.c" /* yacc.c:1646 */ break; case 1210: #line 8276 "gram.y" /* yacc.c:1646 */ { ViewStmt *n = makeNode(ViewStmt); n->view = (yyvsp[-7].range); n->view->relpersistence = (yyvsp[-10].ival); n->aliases = (yyvsp[-5].list); n->query = makeRecursiveViewSelect(n->view->relname, n->aliases, (yyvsp[-1].node)); n->replace = false; n->options = (yyvsp[-3].list); n->withCheckOption = (yyvsp[0].ival); if (n->withCheckOption != NO_CHECK_OPTION) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("WITH CHECK OPTION not supported on recursive views"), parser_errposition((yylsp[0])))); (yyval.node) = (Node *) n; } #line 31177 "gram.c" /* yacc.c:1646 */ break; case 1211: #line 8294 "gram.y" /* yacc.c:1646 */ { ViewStmt *n = makeNode(ViewStmt); n->view = (yyvsp[-7].range); n->view->relpersistence = (yyvsp[-10].ival); n->aliases = (yyvsp[-5].list); n->query = makeRecursiveViewSelect(n->view->relname, n->aliases, (yyvsp[-1].node)); n->replace = true; n->options = (yyvsp[-3].list); n->withCheckOption = (yyvsp[0].ival); if (n->withCheckOption != NO_CHECK_OPTION) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("WITH CHECK OPTION not supported on recursive views"), parser_errposition((yylsp[0])))); (yyval.node) = (Node *) n; } #line 31198 "gram.c" /* yacc.c:1646 */ break; case 1212: #line 8313 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CASCADED_CHECK_OPTION; } #line 31204 "gram.c" /* yacc.c:1646 */ break; case 1213: #line 8314 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CASCADED_CHECK_OPTION; } #line 31210 "gram.c" /* yacc.c:1646 */ break; case 1214: #line 8315 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = LOCAL_CHECK_OPTION; } #line 31216 "gram.c" /* yacc.c:1646 */ break; case 1215: #line 8316 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = NO_CHECK_OPTION; } #line 31222 "gram.c" /* yacc.c:1646 */ break; case 1216: #line 8327 "gram.y" /* yacc.c:1646 */ { LoadStmt *n = makeNode(LoadStmt); n->filename = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 31232 "gram.c" /* yacc.c:1646 */ break; case 1217: #line 8343 "gram.y" /* yacc.c:1646 */ { CreatedbStmt *n = makeNode(CreatedbStmt); n->dbname = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 31243 "gram.c" /* yacc.c:1646 */ break; case 1218: #line 8352 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 31249 "gram.c" /* yacc.c:1646 */ break; case 1219: #line 8353 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 31255 "gram.c" /* yacc.c:1646 */ break; case 1220: #line 8358 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("tablespace", (Node *)makeString((yyvsp[0].str))); } #line 31263 "gram.c" /* yacc.c:1646 */ break; case 1221: #line 8362 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("tablespace", NULL); } #line 31271 "gram.c" /* yacc.c:1646 */ break; case 1222: #line 8366 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("location", (Node *)makeString((yyvsp[0].str))); } #line 31279 "gram.c" /* yacc.c:1646 */ break; case 1223: #line 8370 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("location", NULL); } #line 31287 "gram.c" /* yacc.c:1646 */ break; case 1224: #line 8374 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("template", (Node *)makeString((yyvsp[0].str))); } #line 31295 "gram.c" /* yacc.c:1646 */ break; case 1225: #line 8378 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("template", NULL); } #line 31303 "gram.c" /* yacc.c:1646 */ break; case 1226: #line 8382 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("encoding", (Node *)makeString((yyvsp[0].str))); } #line 31311 "gram.c" /* yacc.c:1646 */ break; case 1227: #line 8386 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("encoding", (Node *)makeInteger((yyvsp[0].ival))); } #line 31319 "gram.c" /* yacc.c:1646 */ break; case 1228: #line 8390 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("encoding", NULL); } #line 31327 "gram.c" /* yacc.c:1646 */ break; case 1229: #line 8394 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("lc_collate", (Node *)makeString((yyvsp[0].str))); } #line 31335 "gram.c" /* yacc.c:1646 */ break; case 1230: #line 8398 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("lc_collate", NULL); } #line 31343 "gram.c" /* yacc.c:1646 */ break; case 1231: #line 8402 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("lc_ctype", (Node *)makeString((yyvsp[0].str))); } #line 31351 "gram.c" /* yacc.c:1646 */ break; case 1232: #line 8406 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("lc_ctype", NULL); } #line 31359 "gram.c" /* yacc.c:1646 */ break; case 1233: #line 8410 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("connectionlimit", (Node *)makeInteger((yyvsp[0].ival))); } #line 31367 "gram.c" /* yacc.c:1646 */ break; case 1234: #line 8414 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("owner", (Node *)makeString((yyvsp[0].str))); } #line 31375 "gram.c" /* yacc.c:1646 */ break; case 1235: #line 8418 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("owner", NULL); } #line 31383 "gram.c" /* yacc.c:1646 */ break; case 1236: #line 8427 "gram.y" /* yacc.c:1646 */ {} #line 31389 "gram.c" /* yacc.c:1646 */ break; case 1237: #line 8428 "gram.y" /* yacc.c:1646 */ {} #line 31395 "gram.c" /* yacc.c:1646 */ break; case 1238: #line 8440 "gram.y" /* yacc.c:1646 */ { AlterDatabaseStmt *n = makeNode(AlterDatabaseStmt); n->dbname = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 31406 "gram.c" /* yacc.c:1646 */ break; case 1239: #line 8447 "gram.y" /* yacc.c:1646 */ { AlterDatabaseStmt *n = makeNode(AlterDatabaseStmt); n->dbname = (yyvsp[-3].str); n->options = list_make1(makeDefElem("tablespace", (Node *)makeString((yyvsp[0].str)))); (yyval.node) = (Node *)n; } #line 31418 "gram.c" /* yacc.c:1646 */ break; case 1240: #line 8458 "gram.y" /* yacc.c:1646 */ { AlterDatabaseSetStmt *n = makeNode(AlterDatabaseSetStmt); n->dbname = (yyvsp[-1].str); n->setstmt = (yyvsp[0].vsetstmt); (yyval.node) = (Node *)n; } #line 31429 "gram.c" /* yacc.c:1646 */ break; case 1241: #line 8468 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 31435 "gram.c" /* yacc.c:1646 */ break; case 1242: #line 8469 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 31441 "gram.c" /* yacc.c:1646 */ break; case 1243: #line 8474 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("connectionlimit", (Node *)makeInteger((yyvsp[0].ival))); } #line 31449 "gram.c" /* yacc.c:1646 */ break; case 1244: #line 8488 "gram.y" /* yacc.c:1646 */ { DropdbStmt *n = makeNode(DropdbStmt); n->dbname = (yyvsp[0].str); n->missing_ok = FALSE; (yyval.node) = (Node *)n; } #line 31460 "gram.c" /* yacc.c:1646 */ break; case 1245: #line 8495 "gram.y" /* yacc.c:1646 */ { DropdbStmt *n = makeNode(DropdbStmt); n->dbname = (yyvsp[0].str); n->missing_ok = TRUE; (yyval.node) = (Node *)n; } #line 31471 "gram.c" /* yacc.c:1646 */ break; case 1246: #line 8513 "gram.y" /* yacc.c:1646 */ { AlterSystemStmt *n = makeNode(AlterSystemStmt); n->setstmt = (yyvsp[0].vsetstmt); (yyval.node) = (Node *)n; } #line 31481 "gram.c" /* yacc.c:1646 */ break; case 1247: #line 8529 "gram.y" /* yacc.c:1646 */ { CreateDomainStmt *n = makeNode(CreateDomainStmt); n->domainname = (yyvsp[-3].list); n->typeName = (yyvsp[-1].typnam); SplitColQualList((yyvsp[0].list), &n->constraints, &n->collClause, yyscanner); (yyval.node) = (Node *)n; } #line 31494 "gram.c" /* yacc.c:1646 */ break; case 1248: #line 8542 "gram.y" /* yacc.c:1646 */ { AlterDomainStmt *n = makeNode(AlterDomainStmt); n->subtype = 'T'; n->typeName = (yyvsp[-1].list); n->def = (yyvsp[0].node); (yyval.node) = (Node *)n; } #line 31506 "gram.c" /* yacc.c:1646 */ break; case 1249: #line 8551 "gram.y" /* yacc.c:1646 */ { AlterDomainStmt *n = makeNode(AlterDomainStmt); n->subtype = 'N'; n->typeName = (yyvsp[-3].list); (yyval.node) = (Node *)n; } #line 31517 "gram.c" /* yacc.c:1646 */ break; case 1250: #line 8559 "gram.y" /* yacc.c:1646 */ { AlterDomainStmt *n = makeNode(AlterDomainStmt); n->subtype = 'O'; n->typeName = (yyvsp[-3].list); (yyval.node) = (Node *)n; } #line 31528 "gram.c" /* yacc.c:1646 */ break; case 1251: #line 8567 "gram.y" /* yacc.c:1646 */ { AlterDomainStmt *n = makeNode(AlterDomainStmt); n->subtype = 'C'; n->typeName = (yyvsp[-2].list); n->def = (yyvsp[0].node); (yyval.node) = (Node *)n; } #line 31540 "gram.c" /* yacc.c:1646 */ break; case 1252: #line 8576 "gram.y" /* yacc.c:1646 */ { AlterDomainStmt *n = makeNode(AlterDomainStmt); n->subtype = 'X'; n->typeName = (yyvsp[-4].list); n->name = (yyvsp[-1].str); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 31554 "gram.c" /* yacc.c:1646 */ break; case 1253: #line 8587 "gram.y" /* yacc.c:1646 */ { AlterDomainStmt *n = makeNode(AlterDomainStmt); n->subtype = 'X'; n->typeName = (yyvsp[-6].list); n->name = (yyvsp[-1].str); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = true; (yyval.node) = (Node *)n; } #line 31568 "gram.c" /* yacc.c:1646 */ break; case 1254: #line 8598 "gram.y" /* yacc.c:1646 */ { AlterDomainStmt *n = makeNode(AlterDomainStmt); n->subtype = 'V'; n->typeName = (yyvsp[-3].list); n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 31580 "gram.c" /* yacc.c:1646 */ break; case 1255: #line 8607 "gram.y" /* yacc.c:1646 */ {} #line 31586 "gram.c" /* yacc.c:1646 */ break; case 1256: #line 8608 "gram.y" /* yacc.c:1646 */ {} #line 31592 "gram.c" /* yacc.c:1646 */ break; case 1257: #line 8620 "gram.y" /* yacc.c:1646 */ { AlterTSDictionaryStmt *n = makeNode(AlterTSDictionaryStmt); n->dictname = (yyvsp[-1].list); n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 31603 "gram.c" /* yacc.c:1646 */ break; case 1258: #line 8630 "gram.y" /* yacc.c:1646 */ { AlterTSConfigurationStmt *n = makeNode(AlterTSConfigurationStmt); n->cfgname = (yyvsp[-6].list); n->tokentype = (yyvsp[-2].list); n->dicts = (yyvsp[0].list); n->override = false; n->replace = false; (yyval.node) = (Node*)n; } #line 31617 "gram.c" /* yacc.c:1646 */ break; case 1259: #line 8640 "gram.y" /* yacc.c:1646 */ { AlterTSConfigurationStmt *n = makeNode(AlterTSConfigurationStmt); n->cfgname = (yyvsp[-6].list); n->tokentype = (yyvsp[-2].list); n->dicts = (yyvsp[0].list); n->override = true; n->replace = false; (yyval.node) = (Node*)n; } #line 31631 "gram.c" /* yacc.c:1646 */ break; case 1260: #line 8650 "gram.y" /* yacc.c:1646 */ { AlterTSConfigurationStmt *n = makeNode(AlterTSConfigurationStmt); n->cfgname = (yyvsp[-6].list); n->tokentype = NIL; n->dicts = list_make2((yyvsp[-2].list),(yyvsp[0].list)); n->override = false; n->replace = true; (yyval.node) = (Node*)n; } #line 31645 "gram.c" /* yacc.c:1646 */ break; case 1261: #line 8660 "gram.y" /* yacc.c:1646 */ { AlterTSConfigurationStmt *n = makeNode(AlterTSConfigurationStmt); n->cfgname = (yyvsp[-8].list); n->tokentype = (yyvsp[-4].list); n->dicts = list_make2((yyvsp[-2].list),(yyvsp[0].list)); n->override = false; n->replace = true; (yyval.node) = (Node*)n; } #line 31659 "gram.c" /* yacc.c:1646 */ break; case 1262: #line 8670 "gram.y" /* yacc.c:1646 */ { AlterTSConfigurationStmt *n = makeNode(AlterTSConfigurationStmt); n->cfgname = (yyvsp[-4].list); n->tokentype = (yyvsp[0].list); n->missing_ok = false; (yyval.node) = (Node*)n; } #line 31671 "gram.c" /* yacc.c:1646 */ break; case 1263: #line 8678 "gram.y" /* yacc.c:1646 */ { AlterTSConfigurationStmt *n = makeNode(AlterTSConfigurationStmt); n->cfgname = (yyvsp[-6].list); n->tokentype = (yyvsp[0].list); n->missing_ok = true; (yyval.node) = (Node*)n; } #line 31683 "gram.c" /* yacc.c:1646 */ break; case 1264: #line 8700 "gram.y" /* yacc.c:1646 */ { CreateConversionStmt *n = makeNode(CreateConversionStmt); n->conversion_name = (yyvsp[-6].list); n->for_encoding_name = (yyvsp[-4].str); n->to_encoding_name = (yyvsp[-2].str); n->func_name = (yyvsp[0].list); n->def = (yyvsp[-8].boolean); (yyval.node) = (Node *)n; } #line 31697 "gram.c" /* yacc.c:1646 */ break; case 1265: #line 8722 "gram.y" /* yacc.c:1646 */ { ClusterStmt *n = makeNode(ClusterStmt); n->relation = (yyvsp[-1].range); n->indexname = (yyvsp[0].str); n->verbose = (yyvsp[-2].boolean); (yyval.node) = (Node*)n; } #line 31709 "gram.c" /* yacc.c:1646 */ break; case 1266: #line 8730 "gram.y" /* yacc.c:1646 */ { ClusterStmt *n = makeNode(ClusterStmt); n->relation = NULL; n->indexname = NULL; n->verbose = (yyvsp[0].boolean); (yyval.node) = (Node*)n; } #line 31721 "gram.c" /* yacc.c:1646 */ break; case 1267: #line 8739 "gram.y" /* yacc.c:1646 */ { ClusterStmt *n = makeNode(ClusterStmt); n->relation = (yyvsp[0].range); n->indexname = (yyvsp[-2].str); n->verbose = (yyvsp[-3].boolean); (yyval.node) = (Node*)n; } #line 31733 "gram.c" /* yacc.c:1646 */ break; case 1268: #line 8749 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 31739 "gram.c" /* yacc.c:1646 */ break; case 1269: #line 8750 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 31745 "gram.c" /* yacc.c:1646 */ break; case 1270: #line 8763 "gram.y" /* yacc.c:1646 */ { VacuumStmt *n = makeNode(VacuumStmt); n->options = VACOPT_VACUUM; if ((yyvsp[-2].boolean)) n->options |= VACOPT_FULL; if ((yyvsp[0].boolean)) n->options |= VACOPT_VERBOSE; n->freeze_min_age = (yyvsp[-1].boolean) ? 0 : -1; n->freeze_table_age = (yyvsp[-1].boolean) ? 0 : -1; n->multixact_freeze_min_age = (yyvsp[-1].boolean) ? 0 : -1; n->multixact_freeze_table_age = (yyvsp[-1].boolean) ? 0 : -1; n->relation = NULL; n->va_cols = NIL; (yyval.node) = (Node *)n; } #line 31765 "gram.c" /* yacc.c:1646 */ break; case 1271: #line 8779 "gram.y" /* yacc.c:1646 */ { VacuumStmt *n = makeNode(VacuumStmt); n->options = VACOPT_VACUUM; if ((yyvsp[-3].boolean)) n->options |= VACOPT_FULL; if ((yyvsp[-1].boolean)) n->options |= VACOPT_VERBOSE; n->freeze_min_age = (yyvsp[-2].boolean) ? 0 : -1; n->freeze_table_age = (yyvsp[-2].boolean) ? 0 : -1; n->multixact_freeze_min_age = (yyvsp[-2].boolean) ? 0 : -1; n->multixact_freeze_table_age = (yyvsp[-2].boolean) ? 0 : -1; n->relation = (yyvsp[0].range); n->va_cols = NIL; (yyval.node) = (Node *)n; } #line 31785 "gram.c" /* yacc.c:1646 */ break; case 1272: #line 8795 "gram.y" /* yacc.c:1646 */ { VacuumStmt *n = (VacuumStmt *) (yyvsp[0].node); n->options |= VACOPT_VACUUM; if ((yyvsp[-3].boolean)) n->options |= VACOPT_FULL; if ((yyvsp[-1].boolean)) n->options |= VACOPT_VERBOSE; n->freeze_min_age = (yyvsp[-2].boolean) ? 0 : -1; n->freeze_table_age = (yyvsp[-2].boolean) ? 0 : -1; n->multixact_freeze_min_age = (yyvsp[-2].boolean) ? 0 : -1; n->multixact_freeze_table_age = (yyvsp[-2].boolean) ? 0 : -1; (yyval.node) = (Node *)n; } #line 31803 "gram.c" /* yacc.c:1646 */ break; case 1273: #line 8809 "gram.y" /* yacc.c:1646 */ { VacuumStmt *n = makeNode(VacuumStmt); n->options = VACOPT_VACUUM | (yyvsp[-1].ival); if (n->options & VACOPT_FREEZE) { n->freeze_min_age = n->freeze_table_age = 0; n->multixact_freeze_min_age = 0; n->multixact_freeze_table_age = 0; } else { n->freeze_min_age = n->freeze_table_age = -1; n->multixact_freeze_min_age = -1; n->multixact_freeze_table_age = -1; } n->relation = NULL; n->va_cols = NIL; (yyval.node) = (Node *) n; } #line 31827 "gram.c" /* yacc.c:1646 */ break; case 1274: #line 8829 "gram.y" /* yacc.c:1646 */ { VacuumStmt *n = makeNode(VacuumStmt); n->options = VACOPT_VACUUM | (yyvsp[-3].ival); if (n->options & VACOPT_FREEZE) { n->freeze_min_age = n->freeze_table_age = 0; n->multixact_freeze_min_age = 0; n->multixact_freeze_table_age = 0; } else { n->freeze_min_age = n->freeze_table_age = -1; n->multixact_freeze_min_age = -1; n->multixact_freeze_table_age = -1; } n->relation = (yyvsp[-1].range); n->va_cols = (yyvsp[0].list); if (n->va_cols != NIL) /* implies analyze */ n->options |= VACOPT_ANALYZE; (yyval.node) = (Node *) n; } #line 31853 "gram.c" /* yacc.c:1646 */ break; case 1275: #line 8853 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[0].ival); } #line 31859 "gram.c" /* yacc.c:1646 */ break; case 1276: #line 8854 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-2].ival) | (yyvsp[0].ival); } #line 31865 "gram.c" /* yacc.c:1646 */ break; case 1277: #line 8858 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = VACOPT_ANALYZE; } #line 31871 "gram.c" /* yacc.c:1646 */ break; case 1278: #line 8859 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = VACOPT_VERBOSE; } #line 31877 "gram.c" /* yacc.c:1646 */ break; case 1279: #line 8860 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = VACOPT_FREEZE; } #line 31883 "gram.c" /* yacc.c:1646 */ break; case 1280: #line 8861 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = VACOPT_FULL; } #line 31889 "gram.c" /* yacc.c:1646 */ break; case 1281: #line 8866 "gram.y" /* yacc.c:1646 */ { VacuumStmt *n = makeNode(VacuumStmt); n->options = VACOPT_ANALYZE; if ((yyvsp[0].boolean)) n->options |= VACOPT_VERBOSE; n->freeze_min_age = -1; n->freeze_table_age = -1; n->multixact_freeze_min_age = -1; n->multixact_freeze_table_age = -1; n->relation = NULL; n->va_cols = NIL; (yyval.node) = (Node *)n; } #line 31907 "gram.c" /* yacc.c:1646 */ break; case 1282: #line 8880 "gram.y" /* yacc.c:1646 */ { VacuumStmt *n = makeNode(VacuumStmt); n->options = VACOPT_ANALYZE; if ((yyvsp[-2].boolean)) n->options |= VACOPT_VERBOSE; n->freeze_min_age = -1; n->freeze_table_age = -1; n->multixact_freeze_min_age = -1; n->multixact_freeze_table_age = -1; n->relation = (yyvsp[-1].range); n->va_cols = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 31925 "gram.c" /* yacc.c:1646 */ break; case 1283: #line 8896 "gram.y" /* yacc.c:1646 */ {} #line 31931 "gram.c" /* yacc.c:1646 */ break; case 1284: #line 8897 "gram.y" /* yacc.c:1646 */ {} #line 31937 "gram.c" /* yacc.c:1646 */ break; case 1285: #line 8901 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = TRUE; } #line 31943 "gram.c" /* yacc.c:1646 */ break; case 1286: #line 8902 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = FALSE; } #line 31949 "gram.c" /* yacc.c:1646 */ break; case 1287: #line 8905 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = TRUE; } #line 31955 "gram.c" /* yacc.c:1646 */ break; case 1288: #line 8906 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = FALSE; } #line 31961 "gram.c" /* yacc.c:1646 */ break; case 1289: #line 8909 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = TRUE; } #line 31967 "gram.c" /* yacc.c:1646 */ break; case 1290: #line 8910 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = FALSE; } #line 31973 "gram.c" /* yacc.c:1646 */ break; case 1291: #line 8914 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 31979 "gram.c" /* yacc.c:1646 */ break; case 1292: #line 8915 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 31985 "gram.c" /* yacc.c:1646 */ break; case 1293: #line 8929 "gram.y" /* yacc.c:1646 */ { ExplainStmt *n = makeNode(ExplainStmt); n->query = (yyvsp[0].node); n->options = NIL; (yyval.node) = (Node *) n; } #line 31996 "gram.c" /* yacc.c:1646 */ break; case 1294: #line 8936 "gram.y" /* yacc.c:1646 */ { ExplainStmt *n = makeNode(ExplainStmt); n->query = (yyvsp[0].node); n->options = list_make1(makeDefElem("analyze", NULL)); if ((yyvsp[-1].boolean)) n->options = lappend(n->options, makeDefElem("verbose", NULL)); (yyval.node) = (Node *) n; } #line 32010 "gram.c" /* yacc.c:1646 */ break; case 1295: #line 8946 "gram.y" /* yacc.c:1646 */ { ExplainStmt *n = makeNode(ExplainStmt); n->query = (yyvsp[0].node); n->options = list_make1(makeDefElem("verbose", NULL)); (yyval.node) = (Node *) n; } #line 32021 "gram.c" /* yacc.c:1646 */ break; case 1296: #line 8953 "gram.y" /* yacc.c:1646 */ { ExplainStmt *n = makeNode(ExplainStmt); n->query = (yyvsp[0].node); n->options = (yyvsp[-2].list); (yyval.node) = (Node *) n; } #line 32032 "gram.c" /* yacc.c:1646 */ break; case 1306: #line 8975 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 32040 "gram.c" /* yacc.c:1646 */ break; case 1307: #line 8979 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 32048 "gram.c" /* yacc.c:1646 */ break; case 1308: #line 8986 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-1].str), (yyvsp[0].node)); } #line 32056 "gram.c" /* yacc.c:1646 */ break; case 1309: #line 8992 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 32062 "gram.c" /* yacc.c:1646 */ break; case 1310: #line 8993 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "analyze"; } #line 32068 "gram.c" /* yacc.c:1646 */ break; case 1311: #line 8997 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 32074 "gram.c" /* yacc.c:1646 */ break; case 1312: #line 8998 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].value); } #line 32080 "gram.c" /* yacc.c:1646 */ break; case 1313: #line 8999 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 32086 "gram.c" /* yacc.c:1646 */ break; case 1314: #line 9010 "gram.y" /* yacc.c:1646 */ { PrepareStmt *n = makeNode(PrepareStmt); n->name = (yyvsp[-3].str); n->argtypes = (yyvsp[-2].list); n->query = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 32098 "gram.c" /* yacc.c:1646 */ break; case 1315: #line 9019 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 32104 "gram.c" /* yacc.c:1646 */ break; case 1316: #line 9020 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 32110 "gram.c" /* yacc.c:1646 */ break; case 1321: #line 9038 "gram.y" /* yacc.c:1646 */ { ExecuteStmt *n = makeNode(ExecuteStmt); n->name = (yyvsp[-1].str); n->params = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 32121 "gram.c" /* yacc.c:1646 */ break; case 1322: #line 9046 "gram.y" /* yacc.c:1646 */ { CreateTableAsStmt *ctas = makeNode(CreateTableAsStmt); ExecuteStmt *n = makeNode(ExecuteStmt); n->name = (yyvsp[-2].str); n->params = (yyvsp[-1].list); ctas->query = (Node *) n; ctas->into = (yyvsp[-5].into); ctas->relkind = OBJECT_TABLE; ctas->is_select_into = false; /* cram additional flags into the IntoClause */ (yyvsp[-5].into)->rel->relpersistence = (yyvsp[-7].ival); (yyvsp[-5].into)->skipData = !((yyvsp[0].boolean)); (yyval.node) = (Node *) ctas; } #line 32140 "gram.c" /* yacc.c:1646 */ break; case 1323: #line 9062 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 32146 "gram.c" /* yacc.c:1646 */ break; case 1324: #line 9063 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 32152 "gram.c" /* yacc.c:1646 */ break; case 1325: #line 9074 "gram.y" /* yacc.c:1646 */ { DeallocateStmt *n = makeNode(DeallocateStmt); n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 32162 "gram.c" /* yacc.c:1646 */ break; case 1326: #line 9080 "gram.y" /* yacc.c:1646 */ { DeallocateStmt *n = makeNode(DeallocateStmt); n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 32172 "gram.c" /* yacc.c:1646 */ break; case 1327: #line 9086 "gram.y" /* yacc.c:1646 */ { DeallocateStmt *n = makeNode(DeallocateStmt); n->name = NULL; (yyval.node) = (Node *) n; } #line 32182 "gram.c" /* yacc.c:1646 */ break; case 1328: #line 9092 "gram.y" /* yacc.c:1646 */ { DeallocateStmt *n = makeNode(DeallocateStmt); n->name = NULL; (yyval.node) = (Node *) n; } #line 32192 "gram.c" /* yacc.c:1646 */ break; case 1329: #line 9108 "gram.y" /* yacc.c:1646 */ { (yyvsp[-1].istmt)->relation = (yyvsp[-2].range); (yyvsp[-1].istmt)->returningList = (yyvsp[0].list); (yyvsp[-1].istmt)->withClause = (yyvsp[-5].with); (yyval.node) = (Node *) (yyvsp[-1].istmt); } #line 32203 "gram.c" /* yacc.c:1646 */ break; case 1330: #line 9118 "gram.y" /* yacc.c:1646 */ { (yyval.istmt) = makeNode(InsertStmt); (yyval.istmt)->cols = NIL; (yyval.istmt)->selectStmt = (yyvsp[0].node); } #line 32213 "gram.c" /* yacc.c:1646 */ break; case 1331: #line 9124 "gram.y" /* yacc.c:1646 */ { (yyval.istmt) = makeNode(InsertStmt); (yyval.istmt)->cols = (yyvsp[-2].list); (yyval.istmt)->selectStmt = (yyvsp[0].node); } #line 32223 "gram.c" /* yacc.c:1646 */ break; case 1332: #line 9130 "gram.y" /* yacc.c:1646 */ { (yyval.istmt) = makeNode(InsertStmt); (yyval.istmt)->cols = NIL; (yyval.istmt)->selectStmt = NULL; } #line 32233 "gram.c" /* yacc.c:1646 */ break; case 1333: #line 9139 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].target)); } #line 32239 "gram.c" /* yacc.c:1646 */ break; case 1334: #line 9141 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].target)); } #line 32245 "gram.c" /* yacc.c:1646 */ break; case 1335: #line 9146 "gram.y" /* yacc.c:1646 */ { (yyval.target) = makeNode(ResTarget); (yyval.target)->name = (yyvsp[-1].str); (yyval.target)->indirection = check_indirection((yyvsp[0].list), yyscanner); (yyval.target)->val = NULL; (yyval.target)->location = (yylsp[-1]); } #line 32257 "gram.c" /* yacc.c:1646 */ break; case 1336: #line 9156 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 32263 "gram.c" /* yacc.c:1646 */ break; case 1337: #line 9157 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 32269 "gram.c" /* yacc.c:1646 */ break; case 1338: #line 9170 "gram.y" /* yacc.c:1646 */ { DeleteStmt *n = makeNode(DeleteStmt); n->relation = (yyvsp[-3].range); n->usingClause = (yyvsp[-2].list); n->whereClause = (yyvsp[-1].node); n->returningList = (yyvsp[0].list); n->withClause = (yyvsp[-6].with); (yyval.node) = (Node *)n; } #line 32283 "gram.c" /* yacc.c:1646 */ break; case 1339: #line 9182 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 32289 "gram.c" /* yacc.c:1646 */ break; case 1340: #line 9183 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 32295 "gram.c" /* yacc.c:1646 */ break; case 1341: #line 9195 "gram.y" /* yacc.c:1646 */ { LockStmt *n = makeNode(LockStmt); n->relations = (yyvsp[-2].list); n->mode = (yyvsp[-1].ival); n->nowait = (yyvsp[0].boolean); (yyval.node) = (Node *)n; } #line 32308 "gram.c" /* yacc.c:1646 */ break; case 1342: #line 9205 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-1].ival); } #line 32314 "gram.c" /* yacc.c:1646 */ break; case 1343: #line 9206 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = AccessExclusiveLock; } #line 32320 "gram.c" /* yacc.c:1646 */ break; case 1344: #line 9209 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = AccessShareLock; } #line 32326 "gram.c" /* yacc.c:1646 */ break; case 1345: #line 9210 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = RowShareLock; } #line 32332 "gram.c" /* yacc.c:1646 */ break; case 1346: #line 9211 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = RowExclusiveLock; } #line 32338 "gram.c" /* yacc.c:1646 */ break; case 1347: #line 9212 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ShareUpdateExclusiveLock; } #line 32344 "gram.c" /* yacc.c:1646 */ break; case 1348: #line 9213 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ShareLock; } #line 32350 "gram.c" /* yacc.c:1646 */ break; case 1349: #line 9214 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ShareRowExclusiveLock; } #line 32356 "gram.c" /* yacc.c:1646 */ break; case 1350: #line 9215 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ExclusiveLock; } #line 32362 "gram.c" /* yacc.c:1646 */ break; case 1351: #line 9216 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = AccessExclusiveLock; } #line 32368 "gram.c" /* yacc.c:1646 */ break; case 1352: #line 9219 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = TRUE; } #line 32374 "gram.c" /* yacc.c:1646 */ break; case 1353: #line 9220 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = FALSE; } #line 32380 "gram.c" /* yacc.c:1646 */ break; case 1354: #line 9236 "gram.y" /* yacc.c:1646 */ { UpdateStmt *n = makeNode(UpdateStmt); n->relation = (yyvsp[-5].range); n->targetList = (yyvsp[-3].list); n->fromClause = (yyvsp[-2].list); n->whereClause = (yyvsp[-1].node); n->returningList = (yyvsp[0].list); n->withClause = (yyvsp[-7].with); (yyval.node) = (Node *)n; } #line 32395 "gram.c" /* yacc.c:1646 */ break; case 1355: #line 9249 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 32401 "gram.c" /* yacc.c:1646 */ break; case 1356: #line 9250 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_concat((yyvsp[-2].list),(yyvsp[0].list)); } #line 32407 "gram.c" /* yacc.c:1646 */ break; case 1357: #line 9254 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].target)); } #line 32413 "gram.c" /* yacc.c:1646 */ break; case 1358: #line 9255 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 32419 "gram.c" /* yacc.c:1646 */ break; case 1359: #line 9260 "gram.y" /* yacc.c:1646 */ { (yyval.target) = (yyvsp[-2].target); (yyval.target)->val = (Node *) (yyvsp[0].node); } #line 32428 "gram.c" /* yacc.c:1646 */ break; case 1360: #line 9268 "gram.y" /* yacc.c:1646 */ { ListCell *col_cell; ListCell *val_cell; /* * Break the ctext_row apart, merge individual expressions * into the destination ResTargets. XXX this approach * cannot work for general row expressions as sources. */ if (list_length((yyvsp[-3].list)) != list_length((yyvsp[0].list))) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("number of columns does not match number of values"), parser_errposition((yylsp[-4])))); forboth(col_cell, (yyvsp[-3].list), val_cell, (yyvsp[0].list)) { ResTarget *res_col = (ResTarget *) lfirst(col_cell); Node *res_val = (Node *) lfirst(val_cell); res_col->val = res_val; } (yyval.list) = (yyvsp[-3].list); } #line 32457 "gram.c" /* yacc.c:1646 */ break; case 1361: #line 9296 "gram.y" /* yacc.c:1646 */ { (yyval.target) = makeNode(ResTarget); (yyval.target)->name = (yyvsp[-1].str); (yyval.target)->indirection = check_indirection((yyvsp[0].list), yyscanner); (yyval.target)->val = NULL; /* upper production sets this */ (yyval.target)->location = (yylsp[-1]); } #line 32469 "gram.c" /* yacc.c:1646 */ break; case 1362: #line 9306 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].target)); } #line 32475 "gram.c" /* yacc.c:1646 */ break; case 1363: #line 9307 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list),(yyvsp[0].target)); } #line 32481 "gram.c" /* yacc.c:1646 */ break; case 1364: #line 9318 "gram.y" /* yacc.c:1646 */ { DeclareCursorStmt *n = makeNode(DeclareCursorStmt); n->portalname = (yyvsp[-5].str); /* currently we always set FAST_PLAN option */ n->options = (yyvsp[-4].ival) | (yyvsp[-2].ival) | CURSOR_OPT_FAST_PLAN; n->query = (yyvsp[0].node); (yyval.node) = (Node *)n; } #line 32494 "gram.c" /* yacc.c:1646 */ break; case 1365: #line 9328 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 32500 "gram.c" /* yacc.c:1646 */ break; case 1366: #line 9331 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 32506 "gram.c" /* yacc.c:1646 */ break; case 1367: #line 9332 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-2].ival) | CURSOR_OPT_NO_SCROLL; } #line 32512 "gram.c" /* yacc.c:1646 */ break; case 1368: #line 9333 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-1].ival) | CURSOR_OPT_SCROLL; } #line 32518 "gram.c" /* yacc.c:1646 */ break; case 1369: #line 9334 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-1].ival) | CURSOR_OPT_BINARY; } #line 32524 "gram.c" /* yacc.c:1646 */ break; case 1370: #line 9335 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-1].ival) | CURSOR_OPT_INSENSITIVE; } #line 32530 "gram.c" /* yacc.c:1646 */ break; case 1371: #line 9338 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 32536 "gram.c" /* yacc.c:1646 */ break; case 1372: #line 9339 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CURSOR_OPT_HOLD; } #line 32542 "gram.c" /* yacc.c:1646 */ break; case 1373: #line 9340 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 32548 "gram.c" /* yacc.c:1646 */ break; case 1376: #line 9393 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 32554 "gram.c" /* yacc.c:1646 */ break; case 1377: #line 9394 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 32560 "gram.c" /* yacc.c:1646 */ break; case 1378: #line 9409 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 32566 "gram.c" /* yacc.c:1646 */ break; case 1379: #line 9411 "gram.y" /* yacc.c:1646 */ { insertSelectOptions((SelectStmt *) (yyvsp[-1].node), (yyvsp[0].list), NIL, NULL, NULL, NULL, yyscanner); (yyval.node) = (yyvsp[-1].node); } #line 32577 "gram.c" /* yacc.c:1646 */ break; case 1380: #line 9418 "gram.y" /* yacc.c:1646 */ { insertSelectOptions((SelectStmt *) (yyvsp[-3].node), (yyvsp[-2].list), (yyvsp[-1].list), list_nth((yyvsp[0].list), 0), list_nth((yyvsp[0].list), 1), NULL, yyscanner); (yyval.node) = (yyvsp[-3].node); } #line 32589 "gram.c" /* yacc.c:1646 */ break; case 1381: #line 9426 "gram.y" /* yacc.c:1646 */ { insertSelectOptions((SelectStmt *) (yyvsp[-3].node), (yyvsp[-2].list), (yyvsp[0].list), list_nth((yyvsp[-1].list), 0), list_nth((yyvsp[-1].list), 1), NULL, yyscanner); (yyval.node) = (yyvsp[-3].node); } #line 32601 "gram.c" /* yacc.c:1646 */ break; case 1382: #line 9434 "gram.y" /* yacc.c:1646 */ { insertSelectOptions((SelectStmt *) (yyvsp[0].node), NULL, NIL, NULL, NULL, (yyvsp[-1].with), yyscanner); (yyval.node) = (yyvsp[0].node); } #line 32613 "gram.c" /* yacc.c:1646 */ break; case 1383: #line 9442 "gram.y" /* yacc.c:1646 */ { insertSelectOptions((SelectStmt *) (yyvsp[-1].node), (yyvsp[0].list), NIL, NULL, NULL, (yyvsp[-2].with), yyscanner); (yyval.node) = (yyvsp[-1].node); } #line 32625 "gram.c" /* yacc.c:1646 */ break; case 1384: #line 9450 "gram.y" /* yacc.c:1646 */ { insertSelectOptions((SelectStmt *) (yyvsp[-3].node), (yyvsp[-2].list), (yyvsp[-1].list), list_nth((yyvsp[0].list), 0), list_nth((yyvsp[0].list), 1), (yyvsp[-4].with), yyscanner); (yyval.node) = (yyvsp[-3].node); } #line 32637 "gram.c" /* yacc.c:1646 */ break; case 1385: #line 9458 "gram.y" /* yacc.c:1646 */ { insertSelectOptions((SelectStmt *) (yyvsp[-3].node), (yyvsp[-2].list), (yyvsp[0].list), list_nth((yyvsp[-1].list), 0), list_nth((yyvsp[-1].list), 1), (yyvsp[-4].with), yyscanner); (yyval.node) = (yyvsp[-3].node); } #line 32649 "gram.c" /* yacc.c:1646 */ break; case 1386: #line 9468 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 32655 "gram.c" /* yacc.c:1646 */ break; case 1387: #line 9469 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 32661 "gram.c" /* yacc.c:1646 */ break; case 1388: #line 9499 "gram.y" /* yacc.c:1646 */ { SelectStmt *n = makeNode(SelectStmt); n->distinctClause = (yyvsp[-7].list); n->targetList = (yyvsp[-6].list); n->intoClause = (yyvsp[-5].into); n->fromClause = (yyvsp[-4].list); n->whereClause = (yyvsp[-3].node); n->groupClause = (yyvsp[-2].list); n->havingClause = (yyvsp[-1].node); n->windowClause = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 32678 "gram.c" /* yacc.c:1646 */ break; case 1389: #line 9511 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 32684 "gram.c" /* yacc.c:1646 */ break; case 1390: #line 9513 "gram.y" /* yacc.c:1646 */ { /* same as SELECT * FROM relation_expr */ ColumnRef *cr = makeNode(ColumnRef); ResTarget *rt = makeNode(ResTarget); SelectStmt *n = makeNode(SelectStmt); cr->fields = list_make1(makeNode(A_Star)); cr->location = -1; rt->name = NULL; rt->indirection = NIL; rt->val = (Node *)cr; rt->location = -1; n->targetList = list_make1(rt); n->fromClause = list_make1((yyvsp[0].range)); (yyval.node) = (Node *)n; } #line 32707 "gram.c" /* yacc.c:1646 */ break; case 1391: #line 9532 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSetOp(SETOP_UNION, (yyvsp[-1].boolean), (yyvsp[-3].node), (yyvsp[0].node)); } #line 32715 "gram.c" /* yacc.c:1646 */ break; case 1392: #line 9536 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSetOp(SETOP_INTERSECT, (yyvsp[-1].boolean), (yyvsp[-3].node), (yyvsp[0].node)); } #line 32723 "gram.c" /* yacc.c:1646 */ break; case 1393: #line 9540 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSetOp(SETOP_EXCEPT, (yyvsp[-1].boolean), (yyvsp[-3].node), (yyvsp[0].node)); } #line 32731 "gram.c" /* yacc.c:1646 */ break; case 1394: #line 9555 "gram.y" /* yacc.c:1646 */ { (yyval.with) = makeNode(WithClause); (yyval.with)->ctes = (yyvsp[0].list); (yyval.with)->recursive = false; (yyval.with)->location = (yylsp[-1]); } #line 32742 "gram.c" /* yacc.c:1646 */ break; case 1395: #line 9562 "gram.y" /* yacc.c:1646 */ { (yyval.with) = makeNode(WithClause); (yyval.with)->ctes = (yyvsp[0].list); (yyval.with)->recursive = true; (yyval.with)->location = (yylsp[-2]); } #line 32753 "gram.c" /* yacc.c:1646 */ break; case 1396: #line 9571 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 32759 "gram.c" /* yacc.c:1646 */ break; case 1397: #line 9572 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 32765 "gram.c" /* yacc.c:1646 */ break; case 1398: #line 9576 "gram.y" /* yacc.c:1646 */ { CommonTableExpr *n = makeNode(CommonTableExpr); n->ctename = (yyvsp[-5].str); n->aliascolnames = (yyvsp[-4].list); n->ctequery = (yyvsp[-1].node); n->location = (yylsp[-5]); (yyval.node) = (Node *) n; } #line 32778 "gram.c" /* yacc.c:1646 */ break; case 1399: #line 9587 "gram.y" /* yacc.c:1646 */ { (yyval.with) = (yyvsp[0].with); } #line 32784 "gram.c" /* yacc.c:1646 */ break; case 1400: #line 9588 "gram.y" /* yacc.c:1646 */ { (yyval.with) = NULL; } #line 32790 "gram.c" /* yacc.c:1646 */ break; case 1401: #line 9593 "gram.y" /* yacc.c:1646 */ { (yyval.into) = makeNode(IntoClause); (yyval.into)->rel = (yyvsp[0].range); (yyval.into)->colNames = NIL; (yyval.into)->options = NIL; (yyval.into)->onCommit = ONCOMMIT_NOOP; (yyval.into)->tableSpaceName = NULL; (yyval.into)->viewQuery = NULL; (yyval.into)->skipData = false; } #line 32805 "gram.c" /* yacc.c:1646 */ break; case 1402: #line 9604 "gram.y" /* yacc.c:1646 */ { (yyval.into) = NULL; } #line 32811 "gram.c" /* yacc.c:1646 */ break; case 1403: #line 9613 "gram.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_TEMP; } #line 32820 "gram.c" /* yacc.c:1646 */ break; case 1404: #line 9618 "gram.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_TEMP; } #line 32829 "gram.c" /* yacc.c:1646 */ break; case 1405: #line 9623 "gram.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_TEMP; } #line 32838 "gram.c" /* yacc.c:1646 */ break; case 1406: #line 9628 "gram.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_TEMP; } #line 32847 "gram.c" /* yacc.c:1646 */ break; case 1407: #line 9633 "gram.y" /* yacc.c:1646 */ { ereport(WARNING, (errmsg("GLOBAL is deprecated in temporary table creation"), parser_errposition((yylsp[-3])))); (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_TEMP; } #line 32859 "gram.c" /* yacc.c:1646 */ break; case 1408: #line 9641 "gram.y" /* yacc.c:1646 */ { ereport(WARNING, (errmsg("GLOBAL is deprecated in temporary table creation"), parser_errposition((yylsp[-3])))); (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_TEMP; } #line 32871 "gram.c" /* yacc.c:1646 */ break; case 1409: #line 9649 "gram.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_UNLOGGED; } #line 32880 "gram.c" /* yacc.c:1646 */ break; case 1410: #line 9654 "gram.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_PERMANENT; } #line 32889 "gram.c" /* yacc.c:1646 */ break; case 1411: #line 9659 "gram.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_PERMANENT; } #line 32898 "gram.c" /* yacc.c:1646 */ break; case 1412: #line 9665 "gram.y" /* yacc.c:1646 */ {} #line 32904 "gram.c" /* yacc.c:1646 */ break; case 1413: #line 9666 "gram.y" /* yacc.c:1646 */ {} #line 32910 "gram.c" /* yacc.c:1646 */ break; case 1414: #line 9669 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = TRUE; } #line 32916 "gram.c" /* yacc.c:1646 */ break; case 1415: #line 9670 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = FALSE; } #line 32922 "gram.c" /* yacc.c:1646 */ break; case 1416: #line 9671 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = FALSE; } #line 32928 "gram.c" /* yacc.c:1646 */ break; case 1417: #line 9678 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(NIL); } #line 32934 "gram.c" /* yacc.c:1646 */ break; case 1418: #line 9679 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 32940 "gram.c" /* yacc.c:1646 */ break; case 1419: #line 9680 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 32946 "gram.c" /* yacc.c:1646 */ break; case 1420: #line 9681 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 32952 "gram.c" /* yacc.c:1646 */ break; case 1421: #line 9685 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list);} #line 32958 "gram.c" /* yacc.c:1646 */ break; case 1422: #line 9686 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 32964 "gram.c" /* yacc.c:1646 */ break; case 1423: #line 9690 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 32970 "gram.c" /* yacc.c:1646 */ break; case 1424: #line 9694 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].sortby)); } #line 32976 "gram.c" /* yacc.c:1646 */ break; case 1425: #line 9695 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].sortby)); } #line 32982 "gram.c" /* yacc.c:1646 */ break; case 1426: #line 9699 "gram.y" /* yacc.c:1646 */ { (yyval.sortby) = makeNode(SortBy); (yyval.sortby)->node = (yyvsp[-3].node); (yyval.sortby)->sortby_dir = SORTBY_USING; (yyval.sortby)->sortby_nulls = (yyvsp[0].ival); (yyval.sortby)->useOp = (yyvsp[-1].list); (yyval.sortby)->location = (yylsp[-1]); } #line 32995 "gram.c" /* yacc.c:1646 */ break; case 1427: #line 9708 "gram.y" /* yacc.c:1646 */ { (yyval.sortby) = makeNode(SortBy); (yyval.sortby)->node = (yyvsp[-2].node); (yyval.sortby)->sortby_dir = (yyvsp[-1].ival); (yyval.sortby)->sortby_nulls = (yyvsp[0].ival); (yyval.sortby)->useOp = NIL; (yyval.sortby)->location = -1; /* no operator */ } #line 33008 "gram.c" /* yacc.c:1646 */ break; case 1428: #line 9720 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[0].node), (yyvsp[-1].node)); } #line 33014 "gram.c" /* yacc.c:1646 */ break; case 1429: #line 9721 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-1].node), (yyvsp[0].node)); } #line 33020 "gram.c" /* yacc.c:1646 */ break; case 1430: #line 9722 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(NULL, (yyvsp[0].node)); } #line 33026 "gram.c" /* yacc.c:1646 */ break; case 1431: #line 9723 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[0].node), NULL); } #line 33032 "gram.c" /* yacc.c:1646 */ break; case 1432: #line 9727 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 33038 "gram.c" /* yacc.c:1646 */ break; case 1433: #line 9728 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(NULL,NULL); } #line 33044 "gram.c" /* yacc.c:1646 */ break; case 1434: #line 9733 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 33050 "gram.c" /* yacc.c:1646 */ break; case 1435: #line 9735 "gram.y" /* yacc.c:1646 */ { /* Disabled because it was too confusing, bjm 2002-02-18 */ ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("LIMIT #,# syntax is not supported"), errhint("Use separate LIMIT and OFFSET clauses."), parser_errposition((yylsp[-3])))); } #line 33063 "gram.c" /* yacc.c:1646 */ break; case 1436: #line 9745 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-2].node); } #line 33069 "gram.c" /* yacc.c:1646 */ break; case 1437: #line 9750 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 33075 "gram.c" /* yacc.c:1646 */ break; case 1438: #line 9753 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 33081 "gram.c" /* yacc.c:1646 */ break; case 1439: #line 9757 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 33087 "gram.c" /* yacc.c:1646 */ break; case 1440: #line 9759 "gram.y" /* yacc.c:1646 */ { /* LIMIT ALL is represented as a NULL constant */ (yyval.node) = makeNullAConst((yylsp[0])); } #line 33096 "gram.c" /* yacc.c:1646 */ break; case 1441: #line 9766 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 33102 "gram.c" /* yacc.c:1646 */ break; case 1442: #line 9776 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeIntConst((yyvsp[0].ival), (yylsp[0])); } #line 33108 "gram.c" /* yacc.c:1646 */ break; case 1443: #line 9777 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 33114 "gram.c" /* yacc.c:1646 */ break; case 1444: #line 9778 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeIntConst(1, -1); } #line 33120 "gram.c" /* yacc.c:1646 */ break; case 1445: #line 9786 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 33126 "gram.c" /* yacc.c:1646 */ break; case 1446: #line 9790 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 33132 "gram.c" /* yacc.c:1646 */ break; case 1447: #line 9791 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 33138 "gram.c" /* yacc.c:1646 */ break; case 1448: #line 9794 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 33144 "gram.c" /* yacc.c:1646 */ break; case 1449: #line 9795 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 33150 "gram.c" /* yacc.c:1646 */ break; case 1450: #line 9800 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 33156 "gram.c" /* yacc.c:1646 */ break; case 1451: #line 9801 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 33162 "gram.c" /* yacc.c:1646 */ break; case 1452: #line 9805 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 33168 "gram.c" /* yacc.c:1646 */ break; case 1453: #line 9806 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 33174 "gram.c" /* yacc.c:1646 */ break; case 1454: #line 9810 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 33180 "gram.c" /* yacc.c:1646 */ break; case 1455: #line 9811 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 33186 "gram.c" /* yacc.c:1646 */ break; case 1456: #line 9815 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 33192 "gram.c" /* yacc.c:1646 */ break; case 1457: #line 9816 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 33198 "gram.c" /* yacc.c:1646 */ break; case 1458: #line 9820 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 33204 "gram.c" /* yacc.c:1646 */ break; case 1459: #line 9821 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 33210 "gram.c" /* yacc.c:1646 */ break; case 1460: #line 9826 "gram.y" /* yacc.c:1646 */ { LockingClause *n = makeNode(LockingClause); n->lockedRels = (yyvsp[-1].list); n->strength = (yyvsp[-2].ival); n->noWait = (yyvsp[0].boolean); (yyval.node) = (Node *) n; } #line 33222 "gram.c" /* yacc.c:1646 */ break; case 1461: #line 9836 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = LCS_FORUPDATE; } #line 33228 "gram.c" /* yacc.c:1646 */ break; case 1462: #line 9837 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = LCS_FORNOKEYUPDATE; } #line 33234 "gram.c" /* yacc.c:1646 */ break; case 1463: #line 9838 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = LCS_FORSHARE; } #line 33240 "gram.c" /* yacc.c:1646 */ break; case 1464: #line 9839 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = LCS_FORKEYSHARE; } #line 33246 "gram.c" /* yacc.c:1646 */ break; case 1465: #line 9843 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 33252 "gram.c" /* yacc.c:1646 */ break; case 1466: #line 9844 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 33258 "gram.c" /* yacc.c:1646 */ break; case 1467: #line 9850 "gram.y" /* yacc.c:1646 */ { SelectStmt *n = makeNode(SelectStmt); n->valuesLists = list_make1((yyvsp[0].list)); (yyval.node) = (Node *) n; } #line 33268 "gram.c" /* yacc.c:1646 */ break; case 1468: #line 9856 "gram.y" /* yacc.c:1646 */ { SelectStmt *n = (SelectStmt *) (yyvsp[-2].node); n->valuesLists = lappend(n->valuesLists, (yyvsp[0].list)); (yyval.node) = (Node *) n; } #line 33278 "gram.c" /* yacc.c:1646 */ break; case 1469: #line 9873 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 33284 "gram.c" /* yacc.c:1646 */ break; case 1470: #line 9874 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 33290 "gram.c" /* yacc.c:1646 */ break; case 1471: #line 9878 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 33296 "gram.c" /* yacc.c:1646 */ break; case 1472: #line 9879 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 33302 "gram.c" /* yacc.c:1646 */ break; case 1473: #line 9886 "gram.y" /* yacc.c:1646 */ { (yyvsp[-1].range)->alias = (yyvsp[0].alias); (yyval.node) = (Node *) (yyvsp[-1].range); } #line 33311 "gram.c" /* yacc.c:1646 */ break; case 1474: #line 9891 "gram.y" /* yacc.c:1646 */ { RangeFunction *n = (RangeFunction *) (yyvsp[-1].node); n->alias = linitial((yyvsp[0].list)); n->coldeflist = lsecond((yyvsp[0].list)); (yyval.node) = (Node *) n; } #line 33322 "gram.c" /* yacc.c:1646 */ break; case 1475: #line 9898 "gram.y" /* yacc.c:1646 */ { RangeFunction *n = (RangeFunction *) (yyvsp[-1].node); n->lateral = true; n->alias = linitial((yyvsp[0].list)); n->coldeflist = lsecond((yyvsp[0].list)); (yyval.node) = (Node *) n; } #line 33334 "gram.c" /* yacc.c:1646 */ break; case 1476: #line 9906 "gram.y" /* yacc.c:1646 */ { RangeSubselect *n = makeNode(RangeSubselect); n->lateral = false; n->subquery = (yyvsp[-1].node); n->alias = (yyvsp[0].alias); /* * The SQL spec does not permit a subselect * () without an alias clause, * so we don't either. This avoids the problem * of needing to invent a unique refname for it. * That could be surmounted if there's sufficient * popular demand, but for now let's just implement * the spec and see if anyone complains. * However, it does seem like a good idea to emit * an error message that's better than "syntax error". */ if ((yyvsp[0].alias) == NULL) { if (IsA((yyvsp[-1].node), SelectStmt) && ((SelectStmt *) (yyvsp[-1].node))->valuesLists) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("VALUES in FROM must have an alias"), errhint("For example, FROM (VALUES ...) [AS] foo."), parser_errposition((yylsp[-1])))); else ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("subquery in FROM must have an alias"), errhint("For example, FROM (SELECT ...) [AS] foo."), parser_errposition((yylsp[-1])))); } (yyval.node) = (Node *) n; } #line 33373 "gram.c" /* yacc.c:1646 */ break; case 1477: #line 9941 "gram.y" /* yacc.c:1646 */ { RangeSubselect *n = makeNode(RangeSubselect); n->lateral = true; n->subquery = (yyvsp[-1].node); n->alias = (yyvsp[0].alias); /* same coment as above */ if ((yyvsp[0].alias) == NULL) { if (IsA((yyvsp[-1].node), SelectStmt) && ((SelectStmt *) (yyvsp[-1].node))->valuesLists) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("VALUES in FROM must have an alias"), errhint("For example, FROM (VALUES ...) [AS] foo."), parser_errposition((yylsp[-1])))); else ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("subquery in FROM must have an alias"), errhint("For example, FROM (SELECT ...) [AS] foo."), parser_errposition((yylsp[-1])))); } (yyval.node) = (Node *) n; } #line 33402 "gram.c" /* yacc.c:1646 */ break; case 1478: #line 9966 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].jexpr); } #line 33410 "gram.c" /* yacc.c:1646 */ break; case 1479: #line 9970 "gram.y" /* yacc.c:1646 */ { (yyvsp[-2].jexpr)->alias = (yyvsp[0].alias); (yyval.node) = (Node *) (yyvsp[-2].jexpr); } #line 33419 "gram.c" /* yacc.c:1646 */ break; case 1480: #line 9996 "gram.y" /* yacc.c:1646 */ { (yyval.jexpr) = (yyvsp[-1].jexpr); } #line 33427 "gram.c" /* yacc.c:1646 */ break; case 1481: #line 10000 "gram.y" /* yacc.c:1646 */ { /* CROSS JOIN is same as unqualified inner join */ JoinExpr *n = makeNode(JoinExpr); n->jointype = JOIN_INNER; n->isNatural = FALSE; n->larg = (yyvsp[-3].node); n->rarg = (yyvsp[0].node); n->usingClause = NIL; n->quals = NULL; (yyval.jexpr) = n; } #line 33443 "gram.c" /* yacc.c:1646 */ break; case 1482: #line 10012 "gram.y" /* yacc.c:1646 */ { JoinExpr *n = makeNode(JoinExpr); n->jointype = (yyvsp[-3].jtype); n->isNatural = FALSE; n->larg = (yyvsp[-4].node); n->rarg = (yyvsp[-1].node); if ((yyvsp[0].node) != NULL && IsA((yyvsp[0].node), List)) n->usingClause = (List *) (yyvsp[0].node); /* USING clause */ else n->quals = (yyvsp[0].node); /* ON clause */ (yyval.jexpr) = n; } #line 33460 "gram.c" /* yacc.c:1646 */ break; case 1483: #line 10025 "gram.y" /* yacc.c:1646 */ { /* letting join_type reduce to empty doesn't work */ JoinExpr *n = makeNode(JoinExpr); n->jointype = JOIN_INNER; n->isNatural = FALSE; n->larg = (yyvsp[-3].node); n->rarg = (yyvsp[-1].node); if ((yyvsp[0].node) != NULL && IsA((yyvsp[0].node), List)) n->usingClause = (List *) (yyvsp[0].node); /* USING clause */ else n->quals = (yyvsp[0].node); /* ON clause */ (yyval.jexpr) = n; } #line 33478 "gram.c" /* yacc.c:1646 */ break; case 1484: #line 10039 "gram.y" /* yacc.c:1646 */ { JoinExpr *n = makeNode(JoinExpr); n->jointype = (yyvsp[-2].jtype); n->isNatural = TRUE; n->larg = (yyvsp[-4].node); n->rarg = (yyvsp[0].node); n->usingClause = NIL; /* figure out which columns later... */ n->quals = NULL; /* fill later */ (yyval.jexpr) = n; } #line 33493 "gram.c" /* yacc.c:1646 */ break; case 1485: #line 10050 "gram.y" /* yacc.c:1646 */ { /* letting join_type reduce to empty doesn't work */ JoinExpr *n = makeNode(JoinExpr); n->jointype = JOIN_INNER; n->isNatural = TRUE; n->larg = (yyvsp[-3].node); n->rarg = (yyvsp[0].node); n->usingClause = NIL; /* figure out which columns later... */ n->quals = NULL; /* fill later */ (yyval.jexpr) = n; } #line 33509 "gram.c" /* yacc.c:1646 */ break; case 1486: #line 10065 "gram.y" /* yacc.c:1646 */ { (yyval.alias) = makeNode(Alias); (yyval.alias)->aliasname = (yyvsp[-3].str); (yyval.alias)->colnames = (yyvsp[-1].list); } #line 33519 "gram.c" /* yacc.c:1646 */ break; case 1487: #line 10071 "gram.y" /* yacc.c:1646 */ { (yyval.alias) = makeNode(Alias); (yyval.alias)->aliasname = (yyvsp[0].str); } #line 33528 "gram.c" /* yacc.c:1646 */ break; case 1488: #line 10076 "gram.y" /* yacc.c:1646 */ { (yyval.alias) = makeNode(Alias); (yyval.alias)->aliasname = (yyvsp[-3].str); (yyval.alias)->colnames = (yyvsp[-1].list); } #line 33538 "gram.c" /* yacc.c:1646 */ break; case 1489: #line 10082 "gram.y" /* yacc.c:1646 */ { (yyval.alias) = makeNode(Alias); (yyval.alias)->aliasname = (yyvsp[0].str); } #line 33547 "gram.c" /* yacc.c:1646 */ break; case 1490: #line 10088 "gram.y" /* yacc.c:1646 */ { (yyval.alias) = (yyvsp[0].alias); } #line 33553 "gram.c" /* yacc.c:1646 */ break; case 1491: #line 10089 "gram.y" /* yacc.c:1646 */ { (yyval.alias) = NULL; } #line 33559 "gram.c" /* yacc.c:1646 */ break; case 1492: #line 10098 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[0].alias), NIL); } #line 33567 "gram.c" /* yacc.c:1646 */ break; case 1493: #line 10102 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(NULL, (yyvsp[-1].list)); } #line 33575 "gram.c" /* yacc.c:1646 */ break; case 1494: #line 10106 "gram.y" /* yacc.c:1646 */ { Alias *a = makeNode(Alias); a->aliasname = (yyvsp[-3].str); (yyval.list) = list_make2(a, (yyvsp[-1].list)); } #line 33585 "gram.c" /* yacc.c:1646 */ break; case 1495: #line 10112 "gram.y" /* yacc.c:1646 */ { Alias *a = makeNode(Alias); a->aliasname = (yyvsp[-3].str); (yyval.list) = list_make2(a, (yyvsp[-1].list)); } #line 33595 "gram.c" /* yacc.c:1646 */ break; case 1496: #line 10118 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(NULL, NIL); } #line 33603 "gram.c" /* yacc.c:1646 */ break; case 1497: #line 10123 "gram.y" /* yacc.c:1646 */ { (yyval.jtype) = JOIN_FULL; } #line 33609 "gram.c" /* yacc.c:1646 */ break; case 1498: #line 10124 "gram.y" /* yacc.c:1646 */ { (yyval.jtype) = JOIN_LEFT; } #line 33615 "gram.c" /* yacc.c:1646 */ break; case 1499: #line 10125 "gram.y" /* yacc.c:1646 */ { (yyval.jtype) = JOIN_RIGHT; } #line 33621 "gram.c" /* yacc.c:1646 */ break; case 1500: #line 10126 "gram.y" /* yacc.c:1646 */ { (yyval.jtype) = JOIN_INNER; } #line 33627 "gram.c" /* yacc.c:1646 */ break; case 1501: #line 10130 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 33633 "gram.c" /* yacc.c:1646 */ break; case 1502: #line 10131 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 33639 "gram.c" /* yacc.c:1646 */ break; case 1503: #line 10143 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[-1].list); } #line 33645 "gram.c" /* yacc.c:1646 */ break; case 1504: #line 10144 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 33651 "gram.c" /* yacc.c:1646 */ break; case 1505: #line 10150 "gram.y" /* yacc.c:1646 */ { /* default inheritance */ (yyval.range) = (yyvsp[0].range); (yyval.range)->inhOpt = INH_DEFAULT; (yyval.range)->alias = NULL; } #line 33662 "gram.c" /* yacc.c:1646 */ break; case 1506: #line 10157 "gram.y" /* yacc.c:1646 */ { /* inheritance query */ (yyval.range) = (yyvsp[-1].range); (yyval.range)->inhOpt = INH_YES; (yyval.range)->alias = NULL; } #line 33673 "gram.c" /* yacc.c:1646 */ break; case 1507: #line 10164 "gram.y" /* yacc.c:1646 */ { /* no inheritance */ (yyval.range) = (yyvsp[0].range); (yyval.range)->inhOpt = INH_NO; (yyval.range)->alias = NULL; } #line 33684 "gram.c" /* yacc.c:1646 */ break; case 1508: #line 10171 "gram.y" /* yacc.c:1646 */ { /* no inheritance, SQL99-style syntax */ (yyval.range) = (yyvsp[-1].range); (yyval.range)->inhOpt = INH_NO; (yyval.range)->alias = NULL; } #line 33695 "gram.c" /* yacc.c:1646 */ break; case 1509: #line 10181 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].range)); } #line 33701 "gram.c" /* yacc.c:1646 */ break; case 1510: #line 10182 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].range)); } #line 33707 "gram.c" /* yacc.c:1646 */ break; case 1511: #line 10196 "gram.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); } #line 33715 "gram.c" /* yacc.c:1646 */ break; case 1512: #line 10200 "gram.y" /* yacc.c:1646 */ { Alias *alias = makeNode(Alias); alias->aliasname = (yyvsp[0].str); (yyvsp[-1].range)->alias = alias; (yyval.range) = (yyvsp[-1].range); } #line 33726 "gram.c" /* yacc.c:1646 */ break; case 1513: #line 10207 "gram.y" /* yacc.c:1646 */ { Alias *alias = makeNode(Alias); alias->aliasname = (yyvsp[0].str); (yyvsp[-2].range)->alias = alias; (yyval.range) = (yyvsp[-2].range); } #line 33737 "gram.c" /* yacc.c:1646 */ break; case 1514: #line 10228 "gram.y" /* yacc.c:1646 */ { RangeFunction *n = makeNode(RangeFunction); n->lateral = false; n->ordinality = (yyvsp[0].boolean); n->is_rowsfrom = false; n->functions = list_make1(list_make2((yyvsp[-1].node), NIL)); /* alias and coldeflist are set by table_ref production */ (yyval.node) = (Node *) n; } #line 33751 "gram.c" /* yacc.c:1646 */ break; case 1515: #line 10238 "gram.y" /* yacc.c:1646 */ { RangeFunction *n = makeNode(RangeFunction); n->lateral = false; n->ordinality = (yyvsp[0].boolean); n->is_rowsfrom = true; n->functions = (yyvsp[-2].list); /* alias and coldeflist are set by table_ref production */ (yyval.node) = (Node *) n; } #line 33765 "gram.c" /* yacc.c:1646 */ break; case 1516: #line 10250 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-1].node), (yyvsp[0].list)); } #line 33771 "gram.c" /* yacc.c:1646 */ break; case 1517: #line 10254 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].list)); } #line 33777 "gram.c" /* yacc.c:1646 */ break; case 1518: #line 10255 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].list)); } #line 33783 "gram.c" /* yacc.c:1646 */ break; case 1519: #line 10258 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 33789 "gram.c" /* yacc.c:1646 */ break; case 1520: #line 10259 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 33795 "gram.c" /* yacc.c:1646 */ break; case 1521: #line 10262 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 33801 "gram.c" /* yacc.c:1646 */ break; case 1522: #line 10263 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 33807 "gram.c" /* yacc.c:1646 */ break; case 1523: #line 10268 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 33813 "gram.c" /* yacc.c:1646 */ break; case 1524: #line 10269 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 33819 "gram.c" /* yacc.c:1646 */ break; case 1525: #line 10274 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 33825 "gram.c" /* yacc.c:1646 */ break; case 1526: #line 10276 "gram.y" /* yacc.c:1646 */ { CurrentOfExpr *n = makeNode(CurrentOfExpr); /* cvarno is filled in by parse analysis */ n->cursor_name = (yyvsp[0].str); n->cursor_param = 0; (yyval.node) = (Node *) n; } #line 33837 "gram.c" /* yacc.c:1646 */ break; case 1527: #line 10283 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 33843 "gram.c" /* yacc.c:1646 */ break; case 1528: #line 10288 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 33849 "gram.c" /* yacc.c:1646 */ break; case 1529: #line 10289 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 33855 "gram.c" /* yacc.c:1646 */ break; case 1530: #line 10294 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 33863 "gram.c" /* yacc.c:1646 */ break; case 1531: #line 10298 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 33871 "gram.c" /* yacc.c:1646 */ break; case 1532: #line 10304 "gram.y" /* yacc.c:1646 */ { ColumnDef *n = makeNode(ColumnDef); n->colname = (yyvsp[-2].str); n->typeName = (yyvsp[-1].typnam); n->inhcount = 0; n->is_local = true; n->is_not_null = false; n->is_from_type = false; n->storage = 0; n->raw_default = NULL; n->cooked_default = NULL; n->collClause = (CollateClause *) (yyvsp[0].node); n->collOid = InvalidOid; n->constraints = NIL; n->location = (yylsp[-2]); (yyval.node) = (Node *)n; } #line 33893 "gram.c" /* yacc.c:1646 */ break; case 1533: #line 10334 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->arrayBounds = (yyvsp[0].list); } #line 33902 "gram.c" /* yacc.c:1646 */ break; case 1534: #line 10339 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->arrayBounds = (yyvsp[0].list); (yyval.typnam)->setof = TRUE; } #line 33912 "gram.c" /* yacc.c:1646 */ break; case 1535: #line 10346 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-4].typnam); (yyval.typnam)->arrayBounds = list_make1(makeInteger((yyvsp[-1].ival))); } #line 33921 "gram.c" /* yacc.c:1646 */ break; case 1536: #line 10351 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-4].typnam); (yyval.typnam)->arrayBounds = list_make1(makeInteger((yyvsp[-1].ival))); (yyval.typnam)->setof = TRUE; } #line 33931 "gram.c" /* yacc.c:1646 */ break; case 1537: #line 10357 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->arrayBounds = list_make1(makeInteger(-1)); } #line 33940 "gram.c" /* yacc.c:1646 */ break; case 1538: #line 10362 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->arrayBounds = list_make1(makeInteger(-1)); (yyval.typnam)->setof = TRUE; } #line 33950 "gram.c" /* yacc.c:1646 */ break; case 1539: #line 10371 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), makeInteger(-1)); } #line 33956 "gram.c" /* yacc.c:1646 */ break; case 1540: #line 10373 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-3].list), makeInteger((yyvsp[-1].ival))); } #line 33962 "gram.c" /* yacc.c:1646 */ break; case 1541: #line 10375 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 33968 "gram.c" /* yacc.c:1646 */ break; case 1542: #line 10379 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 33974 "gram.c" /* yacc.c:1646 */ break; case 1543: #line 10380 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 33980 "gram.c" /* yacc.c:1646 */ break; case 1544: #line 10381 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 33986 "gram.c" /* yacc.c:1646 */ break; case 1545: #line 10382 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 33992 "gram.c" /* yacc.c:1646 */ break; case 1546: #line 10383 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 33998 "gram.c" /* yacc.c:1646 */ break; case 1547: #line 10385 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->typmods = (yyvsp[0].list); } #line 34007 "gram.c" /* yacc.c:1646 */ break; case 1548: #line 10390 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-4].typnam); if ((yyvsp[0].list) != NIL) { if (list_length((yyvsp[0].list)) != 1) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("interval precision specified twice"), parser_errposition((yylsp[-4])))); (yyval.typnam)->typmods = lappend((yyvsp[0].list), makeIntConst((yyvsp[-2].ival), (yylsp[-2]))); } else (yyval.typnam)->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1), makeIntConst((yyvsp[-2].ival), (yylsp[-2]))); } #line 34027 "gram.c" /* yacc.c:1646 */ break; case 1549: #line 10419 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 34033 "gram.c" /* yacc.c:1646 */ break; case 1550: #line 10420 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 34039 "gram.c" /* yacc.c:1646 */ break; case 1551: #line 10421 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 34045 "gram.c" /* yacc.c:1646 */ break; case 1552: #line 10422 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 34051 "gram.c" /* yacc.c:1646 */ break; case 1553: #line 10434 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = makeTypeName((yyvsp[-1].str)); (yyval.typnam)->typmods = (yyvsp[0].list); (yyval.typnam)->location = (yylsp[-1]); } #line 34061 "gram.c" /* yacc.c:1646 */ break; case 1554: #line 10440 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = makeTypeNameFromNameList(lcons(makeString((yyvsp[-2].str)), (yyvsp[-1].list))); (yyval.typnam)->typmods = (yyvsp[0].list); (yyval.typnam)->location = (yylsp[-2]); } #line 34071 "gram.c" /* yacc.c:1646 */ break; case 1555: #line 10447 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 34077 "gram.c" /* yacc.c:1646 */ break; case 1556: #line 10448 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 34083 "gram.c" /* yacc.c:1646 */ break; case 1557: #line 10455 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("int4"); (yyval.typnam)->location = (yylsp[0]); } #line 34092 "gram.c" /* yacc.c:1646 */ break; case 1558: #line 10460 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("int4"); (yyval.typnam)->location = (yylsp[0]); } #line 34101 "gram.c" /* yacc.c:1646 */ break; case 1559: #line 10465 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("int2"); (yyval.typnam)->location = (yylsp[0]); } #line 34110 "gram.c" /* yacc.c:1646 */ break; case 1560: #line 10470 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("int8"); (yyval.typnam)->location = (yylsp[0]); } #line 34119 "gram.c" /* yacc.c:1646 */ break; case 1561: #line 10475 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("float4"); (yyval.typnam)->location = (yylsp[0]); } #line 34128 "gram.c" /* yacc.c:1646 */ break; case 1562: #line 10480 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); (yyval.typnam)->location = (yylsp[-1]); } #line 34137 "gram.c" /* yacc.c:1646 */ break; case 1563: #line 10485 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("float8"); (yyval.typnam)->location = (yylsp[-1]); } #line 34146 "gram.c" /* yacc.c:1646 */ break; case 1564: #line 10490 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("numeric"); (yyval.typnam)->typmods = (yyvsp[0].list); (yyval.typnam)->location = (yylsp[-1]); } #line 34156 "gram.c" /* yacc.c:1646 */ break; case 1565: #line 10496 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("numeric"); (yyval.typnam)->typmods = (yyvsp[0].list); (yyval.typnam)->location = (yylsp[-1]); } #line 34166 "gram.c" /* yacc.c:1646 */ break; case 1566: #line 10502 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("numeric"); (yyval.typnam)->typmods = (yyvsp[0].list); (yyval.typnam)->location = (yylsp[-1]); } #line 34176 "gram.c" /* yacc.c:1646 */ break; case 1567: #line 10508 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("bool"); (yyval.typnam)->location = (yylsp[0]); } #line 34185 "gram.c" /* yacc.c:1646 */ break; case 1568: #line 10515 "gram.y" /* yacc.c:1646 */ { /* * Check FLOAT() precision limits assuming IEEE floating * types - thomas 1997-09-18 */ if ((yyvsp[-1].ival) < 1) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("precision for type float must be at least 1 bit"), parser_errposition((yylsp[-1])))); else if ((yyvsp[-1].ival) <= 24) (yyval.typnam) = SystemTypeName("float4"); else if ((yyvsp[-1].ival) <= 53) (yyval.typnam) = SystemTypeName("float8"); else ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("precision for type float must be less than 54 bits"), parser_errposition((yylsp[-1])))); } #line 34210 "gram.c" /* yacc.c:1646 */ break; case 1569: #line 10536 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("float8"); } #line 34218 "gram.c" /* yacc.c:1646 */ break; case 1570: #line 10546 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 34226 "gram.c" /* yacc.c:1646 */ break; case 1571: #line 10550 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 34234 "gram.c" /* yacc.c:1646 */ break; case 1572: #line 10558 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 34242 "gram.c" /* yacc.c:1646 */ break; case 1573: #line 10562 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); (yyval.typnam)->typmods = NIL; } #line 34251 "gram.c" /* yacc.c:1646 */ break; case 1574: #line 10570 "gram.y" /* yacc.c:1646 */ { char *typname; typname = (yyvsp[-3].boolean) ? "varbit" : "bit"; (yyval.typnam) = SystemTypeName(typname); (yyval.typnam)->typmods = (yyvsp[-1].list); (yyval.typnam)->location = (yylsp[-4]); } #line 34264 "gram.c" /* yacc.c:1646 */ break; case 1575: #line 10582 "gram.y" /* yacc.c:1646 */ { /* bit defaults to bit(1), varbit to no limit */ if ((yyvsp[0].boolean)) { (yyval.typnam) = SystemTypeName("varbit"); } else { (yyval.typnam) = SystemTypeName("bit"); (yyval.typnam)->typmods = list_make1(makeIntConst(1, -1)); } (yyval.typnam)->location = (yylsp[-1]); } #line 34282 "gram.c" /* yacc.c:1646 */ break; case 1576: #line 10603 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 34290 "gram.c" /* yacc.c:1646 */ break; case 1577: #line 10607 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 34298 "gram.c" /* yacc.c:1646 */ break; case 1578: #line 10613 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 34306 "gram.c" /* yacc.c:1646 */ break; case 1579: #line 10617 "gram.y" /* yacc.c:1646 */ { /* Length was not specified so allow to be unrestricted. * This handles problems with fixed-length (bpchar) strings * which in column definitions must default to a length * of one, but should not be constrained if the length * was not specified. */ (yyval.typnam) = (yyvsp[0].typnam); (yyval.typnam)->typmods = NIL; } #line 34321 "gram.c" /* yacc.c:1646 */ break; case 1580: #line 10630 "gram.y" /* yacc.c:1646 */ { if (((yyvsp[0].str) != NULL) && (strcmp((yyvsp[0].str), "sql_text") != 0)) (yyvsp[-4].str) = psprintf("%s_%s", (yyvsp[-4].str), (yyvsp[0].str)); (yyval.typnam) = SystemTypeName((yyvsp[-4].str)); (yyval.typnam)->typmods = list_make1(makeIntConst((yyvsp[-2].ival), (yylsp[-2]))); (yyval.typnam)->location = (yylsp[-4]); } #line 34334 "gram.c" /* yacc.c:1646 */ break; case 1581: #line 10641 "gram.y" /* yacc.c:1646 */ { if (((yyvsp[0].str) != NULL) && (strcmp((yyvsp[0].str), "sql_text") != 0)) (yyvsp[-1].str) = psprintf("%s_%s", (yyvsp[-1].str), (yyvsp[0].str)); (yyval.typnam) = SystemTypeName((yyvsp[-1].str)); /* char defaults to char(1), varchar to no limit */ if (strcmp((yyvsp[-1].str), "bpchar") == 0) (yyval.typnam)->typmods = list_make1(makeIntConst(1, -1)); (yyval.typnam)->location = (yylsp[-1]); } #line 34351 "gram.c" /* yacc.c:1646 */ break; case 1582: #line 10656 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 34357 "gram.c" /* yacc.c:1646 */ break; case 1583: #line 10658 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 34363 "gram.c" /* yacc.c:1646 */ break; case 1584: #line 10660 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "varchar"; } #line 34369 "gram.c" /* yacc.c:1646 */ break; case 1585: #line 10662 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 34375 "gram.c" /* yacc.c:1646 */ break; case 1586: #line 10664 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 34381 "gram.c" /* yacc.c:1646 */ break; case 1587: #line 10666 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 34387 "gram.c" /* yacc.c:1646 */ break; case 1588: #line 10670 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = TRUE; } #line 34393 "gram.c" /* yacc.c:1646 */ break; case 1589: #line 10671 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = FALSE; } #line 34399 "gram.c" /* yacc.c:1646 */ break; case 1590: #line 10675 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 34405 "gram.c" /* yacc.c:1646 */ break; case 1591: #line 10676 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 34411 "gram.c" /* yacc.c:1646 */ break; case 1592: #line 10684 "gram.y" /* yacc.c:1646 */ { if ((yyvsp[0].boolean)) (yyval.typnam) = SystemTypeName("timestamptz"); else (yyval.typnam) = SystemTypeName("timestamp"); (yyval.typnam)->typmods = list_make1(makeIntConst((yyvsp[-2].ival), (yylsp[-2]))); (yyval.typnam)->location = (yylsp[-4]); } #line 34424 "gram.c" /* yacc.c:1646 */ break; case 1593: #line 10693 "gram.y" /* yacc.c:1646 */ { if ((yyvsp[0].boolean)) (yyval.typnam) = SystemTypeName("timestamptz"); else (yyval.typnam) = SystemTypeName("timestamp"); (yyval.typnam)->location = (yylsp[-1]); } #line 34436 "gram.c" /* yacc.c:1646 */ break; case 1594: #line 10701 "gram.y" /* yacc.c:1646 */ { if ((yyvsp[0].boolean)) (yyval.typnam) = SystemTypeName("timetz"); else (yyval.typnam) = SystemTypeName("time"); (yyval.typnam)->typmods = list_make1(makeIntConst((yyvsp[-2].ival), (yylsp[-2]))); (yyval.typnam)->location = (yylsp[-4]); } #line 34449 "gram.c" /* yacc.c:1646 */ break; case 1595: #line 10710 "gram.y" /* yacc.c:1646 */ { if ((yyvsp[0].boolean)) (yyval.typnam) = SystemTypeName("timetz"); else (yyval.typnam) = SystemTypeName("time"); (yyval.typnam)->location = (yylsp[-1]); } #line 34461 "gram.c" /* yacc.c:1646 */ break; case 1596: #line 10721 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("interval"); (yyval.typnam)->location = (yylsp[0]); } #line 34470 "gram.c" /* yacc.c:1646 */ break; case 1597: #line 10728 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = TRUE; } #line 34476 "gram.c" /* yacc.c:1646 */ break; case 1598: #line 10729 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = FALSE; } #line 34482 "gram.c" /* yacc.c:1646 */ break; case 1599: #line 10730 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = FALSE; } #line 34488 "gram.c" /* yacc.c:1646 */ break; case 1600: #line 10735 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(YEAR), (yylsp[0]))); } #line 34494 "gram.c" /* yacc.c:1646 */ break; case 1601: #line 10737 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(MONTH), (yylsp[0]))); } #line 34500 "gram.c" /* yacc.c:1646 */ break; case 1602: #line 10739 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(DAY), (yylsp[0]))); } #line 34506 "gram.c" /* yacc.c:1646 */ break; case 1603: #line 10741 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(HOUR), (yylsp[0]))); } #line 34512 "gram.c" /* yacc.c:1646 */ break; case 1604: #line 10743 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(MINUTE), (yylsp[0]))); } #line 34518 "gram.c" /* yacc.c:1646 */ break; case 1605: #line 10745 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 34524 "gram.c" /* yacc.c:1646 */ break; case 1606: #line 10747 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(YEAR) | INTERVAL_MASK(MONTH), (yylsp[-2]))); } #line 34533 "gram.c" /* yacc.c:1646 */ break; case 1607: #line 10752 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(DAY) | INTERVAL_MASK(HOUR), (yylsp[-2]))); } #line 34542 "gram.c" /* yacc.c:1646 */ break; case 1608: #line 10757 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(DAY) | INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE), (yylsp[-2]))); } #line 34552 "gram.c" /* yacc.c:1646 */ break; case 1609: #line 10763 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); linitial((yyval.list)) = makeIntConst(INTERVAL_MASK(DAY) | INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE) | INTERVAL_MASK(SECOND), (yylsp[-2])); } #line 34564 "gram.c" /* yacc.c:1646 */ break; case 1610: #line 10771 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE), (yylsp[-2]))); } #line 34573 "gram.c" /* yacc.c:1646 */ break; case 1611: #line 10776 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); linitial((yyval.list)) = makeIntConst(INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE) | INTERVAL_MASK(SECOND), (yylsp[-2])); } #line 34584 "gram.c" /* yacc.c:1646 */ break; case 1612: #line 10783 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); linitial((yyval.list)) = makeIntConst(INTERVAL_MASK(MINUTE) | INTERVAL_MASK(SECOND), (yylsp[-2])); } #line 34594 "gram.c" /* yacc.c:1646 */ break; case 1613: #line 10789 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 34600 "gram.c" /* yacc.c:1646 */ break; case 1614: #line 10794 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(SECOND), (yylsp[0]))); } #line 34608 "gram.c" /* yacc.c:1646 */ break; case 1615: #line 10798 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeIntConst(INTERVAL_MASK(SECOND), (yylsp[-3])), makeIntConst((yyvsp[-1].ival), (yylsp[-1]))); } #line 34617 "gram.c" /* yacc.c:1646 */ break; case 1616: #line 10827 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 34623 "gram.c" /* yacc.c:1646 */ break; case 1617: #line 10829 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeTypeCast((yyvsp[-2].node), (yyvsp[0].typnam), (yylsp[-1])); } #line 34629 "gram.c" /* yacc.c:1646 */ break; case 1618: #line 10831 "gram.y" /* yacc.c:1646 */ { CollateClause *n = makeNode(CollateClause); n->arg = (yyvsp[-2].node); n->collname = (yyvsp[0].list); n->location = (yylsp[-1]); (yyval.node) = (Node *) n; } #line 34641 "gram.c" /* yacc.c:1646 */ break; case 1619: #line 10839 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("timezone"), list_make2((yyvsp[0].node), (yyvsp[-4].node)), (yylsp[-3])); } #line 34651 "gram.c" /* yacc.c:1646 */ break; case 1620: #line 10854 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", NULL, (yyvsp[0].node), (yylsp[-1])); } #line 34657 "gram.c" /* yacc.c:1646 */ break; case 1621: #line 10856 "gram.y" /* yacc.c:1646 */ { (yyval.node) = doNegate((yyvsp[0].node), (yylsp[-1])); } #line 34663 "gram.c" /* yacc.c:1646 */ break; case 1622: #line 10858 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 34669 "gram.c" /* yacc.c:1646 */ break; case 1623: #line 10860 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "-", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 34675 "gram.c" /* yacc.c:1646 */ break; case 1624: #line 10862 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "*", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 34681 "gram.c" /* yacc.c:1646 */ break; case 1625: #line 10864 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "/", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 34687 "gram.c" /* yacc.c:1646 */ break; case 1626: #line 10866 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "%", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 34693 "gram.c" /* yacc.c:1646 */ break; case 1627: #line 10868 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "^", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 34699 "gram.c" /* yacc.c:1646 */ break; case 1628: #line 10870 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 34705 "gram.c" /* yacc.c:1646 */ break; case 1629: #line 10872 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, ">", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 34711 "gram.c" /* yacc.c:1646 */ break; case 1630: #line 10874 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 34717 "gram.c" /* yacc.c:1646 */ break; case 1631: #line 10877 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_OP, (yyvsp[-1].list), (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 34723 "gram.c" /* yacc.c:1646 */ break; case 1632: #line 10879 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_OP, (yyvsp[-1].list), NULL, (yyvsp[0].node), (yylsp[-1])); } #line 34729 "gram.c" /* yacc.c:1646 */ break; case 1633: #line 10881 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_OP, (yyvsp[0].list), (yyvsp[-1].node), NULL, (yylsp[0])); } #line 34735 "gram.c" /* yacc.c:1646 */ break; case 1634: #line 10884 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_AND, NIL, (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 34741 "gram.c" /* yacc.c:1646 */ break; case 1635: #line 10886 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_OR, NIL, (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 34747 "gram.c" /* yacc.c:1646 */ break; case 1636: #line 10888 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_NOT, NIL, NULL, (yyvsp[0].node), (yylsp[-1])); } #line 34753 "gram.c" /* yacc.c:1646 */ break; case 1637: #line 10891 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "~~", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 34759 "gram.c" /* yacc.c:1646 */ break; case 1638: #line 10893 "gram.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall(SystemFuncName("like_escape"), list_make2((yyvsp[-2].node), (yyvsp[0].node)), (yylsp[-3])); (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "~~", (yyvsp[-4].node), (Node *) n, (yylsp[-3])); } #line 34770 "gram.c" /* yacc.c:1646 */ break; case 1639: #line 10900 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "!~~", (yyvsp[-3].node), (yyvsp[0].node), (yylsp[-2])); } #line 34776 "gram.c" /* yacc.c:1646 */ break; case 1640: #line 10902 "gram.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall(SystemFuncName("like_escape"), list_make2((yyvsp[-2].node), (yyvsp[0].node)), (yylsp[-4])); (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "!~~", (yyvsp[-5].node), (Node *) n, (yylsp[-4])); } #line 34787 "gram.c" /* yacc.c:1646 */ break; case 1641: #line 10909 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "~~*", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 34793 "gram.c" /* yacc.c:1646 */ break; case 1642: #line 10911 "gram.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall(SystemFuncName("like_escape"), list_make2((yyvsp[-2].node), (yyvsp[0].node)), (yylsp[-3])); (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "~~*", (yyvsp[-4].node), (Node *) n, (yylsp[-3])); } #line 34804 "gram.c" /* yacc.c:1646 */ break; case 1643: #line 10918 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "!~~*", (yyvsp[-3].node), (yyvsp[0].node), (yylsp[-2])); } #line 34810 "gram.c" /* yacc.c:1646 */ break; case 1644: #line 10920 "gram.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall(SystemFuncName("like_escape"), list_make2((yyvsp[-2].node), (yyvsp[0].node)), (yylsp[-4])); (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "!~~*", (yyvsp[-5].node), (Node *) n, (yylsp[-4])); } #line 34821 "gram.c" /* yacc.c:1646 */ break; case 1645: #line 10928 "gram.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall(SystemFuncName("similar_escape"), list_make2((yyvsp[0].node), makeNullAConst(-1)), (yylsp[-2])); (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "~", (yyvsp[-3].node), (Node *) n, (yylsp[-2])); } #line 34832 "gram.c" /* yacc.c:1646 */ break; case 1646: #line 10935 "gram.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall(SystemFuncName("similar_escape"), list_make2((yyvsp[-2].node), (yyvsp[0].node)), (yylsp[-4])); (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "~", (yyvsp[-5].node), (Node *) n, (yylsp[-4])); } #line 34843 "gram.c" /* yacc.c:1646 */ break; case 1647: #line 10942 "gram.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall(SystemFuncName("similar_escape"), list_make2((yyvsp[0].node), makeNullAConst(-1)), (yylsp[-3])); (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "!~", (yyvsp[-4].node), (Node *) n, (yylsp[-3])); } #line 34854 "gram.c" /* yacc.c:1646 */ break; case 1648: #line 10949 "gram.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall(SystemFuncName("similar_escape"), list_make2((yyvsp[-2].node), (yyvsp[0].node)), (yylsp[-5])); (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "!~", (yyvsp[-6].node), (Node *) n, (yylsp[-5])); } #line 34865 "gram.c" /* yacc.c:1646 */ break; case 1649: #line 10966 "gram.y" /* yacc.c:1646 */ { NullTest *n = makeNode(NullTest); n->arg = (Expr *) (yyvsp[-2].node); n->nulltesttype = IS_NULL; (yyval.node) = (Node *)n; } #line 34876 "gram.c" /* yacc.c:1646 */ break; case 1650: #line 10973 "gram.y" /* yacc.c:1646 */ { NullTest *n = makeNode(NullTest); n->arg = (Expr *) (yyvsp[-1].node); n->nulltesttype = IS_NULL; (yyval.node) = (Node *)n; } #line 34887 "gram.c" /* yacc.c:1646 */ break; case 1651: #line 10980 "gram.y" /* yacc.c:1646 */ { NullTest *n = makeNode(NullTest); n->arg = (Expr *) (yyvsp[-3].node); n->nulltesttype = IS_NOT_NULL; (yyval.node) = (Node *)n; } #line 34898 "gram.c" /* yacc.c:1646 */ break; case 1652: #line 10987 "gram.y" /* yacc.c:1646 */ { NullTest *n = makeNode(NullTest); n->arg = (Expr *) (yyvsp[-1].node); n->nulltesttype = IS_NOT_NULL; (yyval.node) = (Node *)n; } #line 34909 "gram.c" /* yacc.c:1646 */ break; case 1653: #line 10994 "gram.y" /* yacc.c:1646 */ { if (list_length((yyvsp[-2].list)) != 2) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("wrong number of parameters on left side of OVERLAPS expression"), parser_errposition((yylsp[-2])))); if (list_length((yyvsp[0].list)) != 2) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("wrong number of parameters on right side of OVERLAPS expression"), parser_errposition((yylsp[0])))); (yyval.node) = (Node *) makeFuncCall(SystemFuncName("overlaps"), list_concat((yyvsp[-2].list), (yyvsp[0].list)), (yylsp[-1])); } #line 34929 "gram.c" /* yacc.c:1646 */ break; case 1654: #line 11010 "gram.y" /* yacc.c:1646 */ { BooleanTest *b = makeNode(BooleanTest); b->arg = (Expr *) (yyvsp[-2].node); b->booltesttype = IS_TRUE; (yyval.node) = (Node *)b; } #line 34940 "gram.c" /* yacc.c:1646 */ break; case 1655: #line 11017 "gram.y" /* yacc.c:1646 */ { BooleanTest *b = makeNode(BooleanTest); b->arg = (Expr *) (yyvsp[-3].node); b->booltesttype = IS_NOT_TRUE; (yyval.node) = (Node *)b; } #line 34951 "gram.c" /* yacc.c:1646 */ break; case 1656: #line 11024 "gram.y" /* yacc.c:1646 */ { BooleanTest *b = makeNode(BooleanTest); b->arg = (Expr *) (yyvsp[-2].node); b->booltesttype = IS_FALSE; (yyval.node) = (Node *)b; } #line 34962 "gram.c" /* yacc.c:1646 */ break; case 1657: #line 11031 "gram.y" /* yacc.c:1646 */ { BooleanTest *b = makeNode(BooleanTest); b->arg = (Expr *) (yyvsp[-3].node); b->booltesttype = IS_NOT_FALSE; (yyval.node) = (Node *)b; } #line 34973 "gram.c" /* yacc.c:1646 */ break; case 1658: #line 11038 "gram.y" /* yacc.c:1646 */ { BooleanTest *b = makeNode(BooleanTest); b->arg = (Expr *) (yyvsp[-2].node); b->booltesttype = IS_UNKNOWN; (yyval.node) = (Node *)b; } #line 34984 "gram.c" /* yacc.c:1646 */ break; case 1659: #line 11045 "gram.y" /* yacc.c:1646 */ { BooleanTest *b = makeNode(BooleanTest); b->arg = (Expr *) (yyvsp[-3].node); b->booltesttype = IS_NOT_UNKNOWN; (yyval.node) = (Node *)b; } #line 34995 "gram.c" /* yacc.c:1646 */ break; case 1660: #line 11052 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_DISTINCT, "=", (yyvsp[-4].node), (yyvsp[0].node), (yylsp[-3])); } #line 35003 "gram.c" /* yacc.c:1646 */ break; case 1661: #line 11056 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_NOT, NIL, NULL, (Node *) makeSimpleA_Expr(AEXPR_DISTINCT, "=", (yyvsp[-5].node), (yyvsp[0].node), (yylsp[-4])), (yylsp[-4])); } #line 35015 "gram.c" /* yacc.c:1646 */ break; case 1662: #line 11064 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OF, "=", (yyvsp[-5].node), (Node *) (yyvsp[-1].list), (yylsp[-4])); } #line 35023 "gram.c" /* yacc.c:1646 */ break; case 1663: #line 11068 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OF, "<>", (yyvsp[-6].node), (Node *) (yyvsp[-1].list), (yylsp[-5])); } #line 35031 "gram.c" /* yacc.c:1646 */ break; case 1664: #line 11078 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_AND, NIL, (Node *) makeSimpleA_Expr(AEXPR_OP, ">=", (yyvsp[-5].node), (yyvsp[-2].node), (yylsp[-4])), (Node *) makeSimpleA_Expr(AEXPR_OP, "<=", (yyvsp[-5].node), (yyvsp[0].node), (yylsp[-4])), (yylsp[-4])); } #line 35042 "gram.c" /* yacc.c:1646 */ break; case 1665: #line 11085 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_OR, NIL, (Node *) makeSimpleA_Expr(AEXPR_OP, "<", (yyvsp[-6].node), (yyvsp[-2].node), (yylsp[-5])), (Node *) makeSimpleA_Expr(AEXPR_OP, ">", (yyvsp[-6].node), (yyvsp[0].node), (yylsp[-5])), (yylsp[-5])); } #line 35053 "gram.c" /* yacc.c:1646 */ break; case 1666: #line 11092 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_OR, NIL, (Node *) makeA_Expr(AEXPR_AND, NIL, (Node *) makeSimpleA_Expr(AEXPR_OP, ">=", (yyvsp[-5].node), (yyvsp[-2].node), (yylsp[-4])), (Node *) makeSimpleA_Expr(AEXPR_OP, "<=", (yyvsp[-5].node), (yyvsp[0].node), (yylsp[-4])), (yylsp[-4])), (Node *) makeA_Expr(AEXPR_AND, NIL, (Node *) makeSimpleA_Expr(AEXPR_OP, ">=", (yyvsp[-5].node), (yyvsp[0].node), (yylsp[-4])), (Node *) makeSimpleA_Expr(AEXPR_OP, "<=", (yyvsp[-5].node), (yyvsp[-2].node), (yylsp[-4])), (yylsp[-4])), (yylsp[-4])); } #line 35070 "gram.c" /* yacc.c:1646 */ break; case 1667: #line 11105 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_AND, NIL, (Node *) makeA_Expr(AEXPR_OR, NIL, (Node *) makeSimpleA_Expr(AEXPR_OP, "<", (yyvsp[-6].node), (yyvsp[-2].node), (yylsp[-5])), (Node *) makeSimpleA_Expr(AEXPR_OP, ">", (yyvsp[-6].node), (yyvsp[0].node), (yylsp[-5])), (yylsp[-5])), (Node *) makeA_Expr(AEXPR_OR, NIL, (Node *) makeSimpleA_Expr(AEXPR_OP, "<", (yyvsp[-6].node), (yyvsp[0].node), (yylsp[-5])), (Node *) makeSimpleA_Expr(AEXPR_OP, ">", (yyvsp[-6].node), (yyvsp[-2].node), (yylsp[-5])), (yylsp[-5])), (yylsp[-5])); } #line 35087 "gram.c" /* yacc.c:1646 */ break; case 1668: #line 11118 "gram.y" /* yacc.c:1646 */ { /* in_expr returns a SubLink or a list of a_exprs */ if (IsA((yyvsp[0].node), SubLink)) { /* generate foo = ANY (subquery) */ SubLink *n = (SubLink *) (yyvsp[0].node); n->subLinkType = ANY_SUBLINK; n->testexpr = (yyvsp[-2].node); n->operName = list_make1(makeString("=")); n->location = (yylsp[-1]); (yyval.node) = (Node *)n; } else { /* generate scalar IN expression */ (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_IN, "=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } } #line 35110 "gram.c" /* yacc.c:1646 */ break; case 1669: #line 11137 "gram.y" /* yacc.c:1646 */ { /* in_expr returns a SubLink or a list of a_exprs */ if (IsA((yyvsp[0].node), SubLink)) { /* generate NOT (foo = ANY (subquery)) */ /* Make an = ANY node */ SubLink *n = (SubLink *) (yyvsp[0].node); n->subLinkType = ANY_SUBLINK; n->testexpr = (yyvsp[-3].node); n->operName = list_make1(makeString("=")); n->location = (yylsp[-1]); /* Stick a NOT on top */ (yyval.node) = (Node *) makeA_Expr(AEXPR_NOT, NIL, NULL, (Node *) n, (yylsp[-2])); } else { /* generate scalar NOT IN expression */ (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_IN, "<>", (yyvsp[-3].node), (yyvsp[0].node), (yylsp[-2])); } } #line 35135 "gram.c" /* yacc.c:1646 */ break; case 1670: #line 11158 "gram.y" /* yacc.c:1646 */ { SubLink *n = makeNode(SubLink); n->subLinkType = (yyvsp[-1].ival); n->testexpr = (yyvsp[-3].node); n->operName = (yyvsp[-2].list); n->subselect = (yyvsp[0].node); n->location = (yylsp[-2]); (yyval.node) = (Node *)n; } #line 35149 "gram.c" /* yacc.c:1646 */ break; case 1671: #line 11168 "gram.y" /* yacc.c:1646 */ { if ((yyvsp[-3].ival) == ANY_SUBLINK) (yyval.node) = (Node *) makeA_Expr(AEXPR_OP_ANY, (yyvsp[-4].list), (yyvsp[-5].node), (yyvsp[-1].node), (yylsp[-4])); else (yyval.node) = (Node *) makeA_Expr(AEXPR_OP_ALL, (yyvsp[-4].list), (yyvsp[-5].node), (yyvsp[-1].node), (yylsp[-4])); } #line 35160 "gram.c" /* yacc.c:1646 */ break; case 1672: #line 11175 "gram.y" /* yacc.c:1646 */ { /* Not sure how to get rid of the parentheses * but there are lots of shift/reduce errors without them. * * Should be able to implement this by plopping the entire * select into a node, then transforming the target expressions * from whatever they are into count(*), and testing the * entire result equal to one. * But, will probably implement a separate node in the executor. */ ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("UNIQUE predicate is not yet implemented"), parser_errposition((yylsp[-1])))); } #line 35180 "gram.c" /* yacc.c:1646 */ break; case 1673: #line 11191 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_DOCUMENT, NULL, NIL, list_make1((yyvsp[-2].node)), (yylsp[-1])); } #line 35189 "gram.c" /* yacc.c:1646 */ break; case 1674: #line 11196 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_NOT, NIL, NULL, makeXmlExpr(IS_DOCUMENT, NULL, NIL, list_make1((yyvsp[-3].node)), (yylsp[-2])), (yylsp[-2])); } #line 35200 "gram.c" /* yacc.c:1646 */ break; case 1675: #line 11214 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 35206 "gram.c" /* yacc.c:1646 */ break; case 1676: #line 11216 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeTypeCast((yyvsp[-2].node), (yyvsp[0].typnam), (yylsp[-1])); } #line 35212 "gram.c" /* yacc.c:1646 */ break; case 1677: #line 11218 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", NULL, (yyvsp[0].node), (yylsp[-1])); } #line 35218 "gram.c" /* yacc.c:1646 */ break; case 1678: #line 11220 "gram.y" /* yacc.c:1646 */ { (yyval.node) = doNegate((yyvsp[0].node), (yylsp[-1])); } #line 35224 "gram.c" /* yacc.c:1646 */ break; case 1679: #line 11222 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 35230 "gram.c" /* yacc.c:1646 */ break; case 1680: #line 11224 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "-", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 35236 "gram.c" /* yacc.c:1646 */ break; case 1681: #line 11226 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "*", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 35242 "gram.c" /* yacc.c:1646 */ break; case 1682: #line 11228 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "/", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 35248 "gram.c" /* yacc.c:1646 */ break; case 1683: #line 11230 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "%", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 35254 "gram.c" /* yacc.c:1646 */ break; case 1684: #line 11232 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "^", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 35260 "gram.c" /* yacc.c:1646 */ break; case 1685: #line 11234 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 35266 "gram.c" /* yacc.c:1646 */ break; case 1686: #line 11236 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, ">", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 35272 "gram.c" /* yacc.c:1646 */ break; case 1687: #line 11238 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 35278 "gram.c" /* yacc.c:1646 */ break; case 1688: #line 11240 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_OP, (yyvsp[-1].list), (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 35284 "gram.c" /* yacc.c:1646 */ break; case 1689: #line 11242 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_OP, (yyvsp[-1].list), NULL, (yyvsp[0].node), (yylsp[-1])); } #line 35290 "gram.c" /* yacc.c:1646 */ break; case 1690: #line 11244 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_OP, (yyvsp[0].list), (yyvsp[-1].node), NULL, (yylsp[0])); } #line 35296 "gram.c" /* yacc.c:1646 */ break; case 1691: #line 11246 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_DISTINCT, "=", (yyvsp[-4].node), (yyvsp[0].node), (yylsp[-3])); } #line 35304 "gram.c" /* yacc.c:1646 */ break; case 1692: #line 11250 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_NOT, NIL, NULL, (Node *) makeSimpleA_Expr(AEXPR_DISTINCT, "=", (yyvsp[-5].node), (yyvsp[0].node), (yylsp[-4])), (yylsp[-4])); } #line 35313 "gram.c" /* yacc.c:1646 */ break; case 1693: #line 11255 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OF, "=", (yyvsp[-5].node), (Node *) (yyvsp[-1].list), (yylsp[-4])); } #line 35321 "gram.c" /* yacc.c:1646 */ break; case 1694: #line 11259 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OF, "<>", (yyvsp[-6].node), (Node *) (yyvsp[-1].list), (yylsp[-5])); } #line 35329 "gram.c" /* yacc.c:1646 */ break; case 1695: #line 11263 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_DOCUMENT, NULL, NIL, list_make1((yyvsp[-2].node)), (yylsp[-1])); } #line 35338 "gram.c" /* yacc.c:1646 */ break; case 1696: #line 11268 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_NOT, NIL, NULL, makeXmlExpr(IS_DOCUMENT, NULL, NIL, list_make1((yyvsp[-3].node)), (yylsp[-2])), (yylsp[-2])); } #line 35349 "gram.c" /* yacc.c:1646 */ break; case 1697: #line 11284 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 35355 "gram.c" /* yacc.c:1646 */ break; case 1698: #line 11285 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 35361 "gram.c" /* yacc.c:1646 */ break; case 1699: #line 11287 "gram.y" /* yacc.c:1646 */ { ParamRef *p = makeNode(ParamRef); p->number = (yyvsp[-1].ival); p->location = (yylsp[-1]); if ((yyvsp[0].list)) { A_Indirection *n = makeNode(A_Indirection); n->arg = (Node *) p; n->indirection = check_indirection((yyvsp[0].list), yyscanner); (yyval.node) = (Node *) n; } else (yyval.node) = (Node *) p; } #line 35380 "gram.c" /* yacc.c:1646 */ break; case 1700: #line 11302 "gram.y" /* yacc.c:1646 */ { if ((yyvsp[0].list)) { A_Indirection *n = makeNode(A_Indirection); n->arg = (yyvsp[-2].node); n->indirection = check_indirection((yyvsp[0].list), yyscanner); (yyval.node) = (Node *)n; } else (yyval.node) = (yyvsp[-2].node); } #line 35396 "gram.c" /* yacc.c:1646 */ break; case 1701: #line 11314 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 35402 "gram.c" /* yacc.c:1646 */ break; case 1702: #line 11316 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 35408 "gram.c" /* yacc.c:1646 */ break; case 1703: #line 11318 "gram.y" /* yacc.c:1646 */ { SubLink *n = makeNode(SubLink); n->subLinkType = EXPR_SUBLINK; n->testexpr = NULL; n->operName = NIL; n->subselect = (yyvsp[0].node); n->location = (yylsp[0]); (yyval.node) = (Node *)n; } #line 35422 "gram.c" /* yacc.c:1646 */ break; case 1704: #line 11328 "gram.y" /* yacc.c:1646 */ { /* * Because the select_with_parens nonterminal is designed * to "eat" as many levels of parens as possible, the * '(' a_expr ')' opt_indirection production above will * fail to match a sub-SELECT with indirection decoration; * the sub-SELECT won't be regarded as an a_expr as long * as there are parens around it. To support applying * subscripting or field selection to a sub-SELECT result, * we need this redundant-looking production. */ SubLink *n = makeNode(SubLink); A_Indirection *a = makeNode(A_Indirection); n->subLinkType = EXPR_SUBLINK; n->testexpr = NULL; n->operName = NIL; n->subselect = (yyvsp[-1].node); n->location = (yylsp[-1]); a->arg = (Node *)n; a->indirection = check_indirection((yyvsp[0].list), yyscanner); (yyval.node) = (Node *)a; } #line 35449 "gram.c" /* yacc.c:1646 */ break; case 1705: #line 11351 "gram.y" /* yacc.c:1646 */ { SubLink *n = makeNode(SubLink); n->subLinkType = EXISTS_SUBLINK; n->testexpr = NULL; n->operName = NIL; n->subselect = (yyvsp[0].node); n->location = (yylsp[-1]); (yyval.node) = (Node *)n; } #line 35463 "gram.c" /* yacc.c:1646 */ break; case 1706: #line 11361 "gram.y" /* yacc.c:1646 */ { SubLink *n = makeNode(SubLink); n->subLinkType = ARRAY_SUBLINK; n->testexpr = NULL; n->operName = NIL; n->subselect = (yyvsp[0].node); n->location = (yylsp[-1]); (yyval.node) = (Node *)n; } #line 35477 "gram.c" /* yacc.c:1646 */ break; case 1707: #line 11371 "gram.y" /* yacc.c:1646 */ { A_ArrayExpr *n = (A_ArrayExpr *) (yyvsp[0].node); Assert(IsA(n, A_ArrayExpr)); /* point outermost A_ArrayExpr to the ARRAY keyword */ n->location = (yylsp[-1]); (yyval.node) = (Node *)n; } #line 35489 "gram.c" /* yacc.c:1646 */ break; case 1708: #line 11379 "gram.y" /* yacc.c:1646 */ { RowExpr *r = makeNode(RowExpr); r->args = (yyvsp[0].list); r->row_typeid = InvalidOid; /* not analyzed yet */ r->colnames = NIL; /* to be filled in during analysis */ r->location = (yylsp[0]); (yyval.node) = (Node *)r; } #line 35502 "gram.c" /* yacc.c:1646 */ break; case 1709: #line 11390 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall((yyvsp[-2].list), NIL, (yylsp[-2])); } #line 35510 "gram.c" /* yacc.c:1646 */ break; case 1710: #line 11394 "gram.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall((yyvsp[-4].list), (yyvsp[-2].list), (yylsp[-4])); n->agg_order = (yyvsp[-1].list); (yyval.node) = (Node *)n; } #line 35520 "gram.c" /* yacc.c:1646 */ break; case 1711: #line 11400 "gram.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall((yyvsp[-5].list), list_make1((yyvsp[-2].node)), (yylsp[-5])); n->func_variadic = TRUE; n->agg_order = (yyvsp[-1].list); (yyval.node) = (Node *)n; } #line 35531 "gram.c" /* yacc.c:1646 */ break; case 1712: #line 11407 "gram.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall((yyvsp[-7].list), lappend((yyvsp[-5].list), (yyvsp[-2].node)), (yylsp[-7])); n->func_variadic = TRUE; n->agg_order = (yyvsp[-1].list); (yyval.node) = (Node *)n; } #line 35542 "gram.c" /* yacc.c:1646 */ break; case 1713: #line 11414 "gram.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall((yyvsp[-5].list), (yyvsp[-2].list), (yylsp[-5])); n->agg_order = (yyvsp[-1].list); /* Ideally we'd mark the FuncCall node to indicate * "must be an aggregate", but there's no provision * for that in FuncCall at the moment. */ (yyval.node) = (Node *)n; } #line 35556 "gram.c" /* yacc.c:1646 */ break; case 1714: #line 11424 "gram.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall((yyvsp[-5].list), (yyvsp[-2].list), (yylsp[-5])); n->agg_order = (yyvsp[-1].list); n->agg_distinct = TRUE; (yyval.node) = (Node *)n; } #line 35567 "gram.c" /* yacc.c:1646 */ break; case 1715: #line 11431 "gram.y" /* yacc.c:1646 */ { /* * We consider AGGREGATE(*) to invoke a parameterless * aggregate. This does the right thing for COUNT(*), * and there are no other aggregates in SQL that accept * '*' as parameter. * * The FuncCall node is also marked agg_star = true, * so that later processing can detect what the argument * really was. */ FuncCall *n = makeFuncCall((yyvsp[-3].list), NIL, (yylsp[-3])); n->agg_star = TRUE; (yyval.node) = (Node *)n; } #line 35587 "gram.c" /* yacc.c:1646 */ break; case 1716: #line 11459 "gram.y" /* yacc.c:1646 */ { FuncCall *n = (FuncCall *) (yyvsp[-3].node); /* * The order clause for WITHIN GROUP and the one for * plain-aggregate ORDER BY share a field, so we have to * check here that at most one is present. We also check * for DISTINCT and VARIADIC here to give a better error * location. Other consistency checks are deferred to * parse analysis. */ if ((yyvsp[-2].list) != NIL) { if (n->agg_order != NIL) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("cannot use multiple ORDER BY clauses with WITHIN GROUP"), parser_errposition((yylsp[-2])))); if (n->agg_distinct) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("cannot use DISTINCT with WITHIN GROUP"), parser_errposition((yylsp[-2])))); if (n->func_variadic) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("cannot use VARIADIC with WITHIN GROUP"), parser_errposition((yylsp[-2])))); n->agg_order = (yyvsp[-2].list); n->agg_within_group = TRUE; } n->agg_filter = (yyvsp[-1].node); n->over = (yyvsp[0].windef); (yyval.node) = (Node *) n; } #line 35626 "gram.c" /* yacc.c:1646 */ break; case 1717: #line 11494 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 35632 "gram.c" /* yacc.c:1646 */ break; case 1718: #line 11504 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 35638 "gram.c" /* yacc.c:1646 */ break; case 1719: #line 11505 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 35644 "gram.c" /* yacc.c:1646 */ break; case 1720: #line 11513 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("pg_collation_for"), list_make1((yyvsp[-1].node)), (yylsp[-4])); } #line 35654 "gram.c" /* yacc.c:1646 */ break; case 1721: #line 11519 "gram.y" /* yacc.c:1646 */ { /* * Translate as "'now'::text::date". * * We cannot use "'now'::date" because coerce_type() will * immediately reduce that to a constant representing * today's date. We need to delay the conversion until * runtime, else the wrong things will happen when * CURRENT_DATE is used in a column default value or rule. * * This could be simplified if we had a way to generate * an expression tree representing runtime application * of type-input conversion functions. (As of PG 7.3 * that is actually possible, but not clear that we want * to rely on it.) * * The token location is attached to the run-time * typecast, not to the Const, for the convenience of * pg_stat_statements (which doesn't want these constructs * to appear to be replaceable constants). */ Node *n; n = makeStringConstCast("now", -1, SystemTypeName("text")); (yyval.node) = makeTypeCast(n, SystemTypeName("date"), (yylsp[0])); } #line 35684 "gram.c" /* yacc.c:1646 */ break; case 1722: #line 11545 "gram.y" /* yacc.c:1646 */ { /* * Translate as "'now'::text::timetz". * See comments for CURRENT_DATE. */ Node *n; n = makeStringConstCast("now", -1, SystemTypeName("text")); (yyval.node) = makeTypeCast(n, SystemTypeName("timetz"), (yylsp[0])); } #line 35698 "gram.c" /* yacc.c:1646 */ break; case 1723: #line 11555 "gram.y" /* yacc.c:1646 */ { /* * Translate as "'now'::text::timetz(n)". * See comments for CURRENT_DATE. */ Node *n; TypeName *d; n = makeStringConstCast("now", -1, SystemTypeName("text")); d = SystemTypeName("timetz"); d->typmods = list_make1(makeIntConst((yyvsp[-1].ival), (yylsp[-1]))); (yyval.node) = makeTypeCast(n, d, (yylsp[-3])); } #line 35715 "gram.c" /* yacc.c:1646 */ break; case 1724: #line 11568 "gram.y" /* yacc.c:1646 */ { /* * Translate as "now()", since we have a function that * does exactly what is needed. */ (yyval.node) = (Node *) makeFuncCall(SystemFuncName("now"), NIL, (yylsp[0])); } #line 35727 "gram.c" /* yacc.c:1646 */ break; case 1725: #line 11576 "gram.y" /* yacc.c:1646 */ { /* * Translate as "'now'::text::timestamptz(n)". * See comments for CURRENT_DATE. */ Node *n; TypeName *d; n = makeStringConstCast("now", -1, SystemTypeName("text")); d = SystemTypeName("timestamptz"); d->typmods = list_make1(makeIntConst((yyvsp[-1].ival), (yylsp[-1]))); (yyval.node) = makeTypeCast(n, d, (yylsp[-3])); } #line 35744 "gram.c" /* yacc.c:1646 */ break; case 1726: #line 11589 "gram.y" /* yacc.c:1646 */ { /* * Translate as "'now'::text::time". * See comments for CURRENT_DATE. */ Node *n; n = makeStringConstCast("now", -1, SystemTypeName("text")); (yyval.node) = makeTypeCast((Node *)n, SystemTypeName("time"), (yylsp[0])); } #line 35758 "gram.c" /* yacc.c:1646 */ break; case 1727: #line 11599 "gram.y" /* yacc.c:1646 */ { /* * Translate as "'now'::text::time(n)". * See comments for CURRENT_DATE. */ Node *n; TypeName *d; n = makeStringConstCast("now", -1, SystemTypeName("text")); d = SystemTypeName("time"); d->typmods = list_make1(makeIntConst((yyvsp[-1].ival), (yylsp[-1]))); (yyval.node) = makeTypeCast((Node *)n, d, (yylsp[-3])); } #line 35775 "gram.c" /* yacc.c:1646 */ break; case 1728: #line 11612 "gram.y" /* yacc.c:1646 */ { /* * Translate as "'now'::text::timestamp". * See comments for CURRENT_DATE. */ Node *n; n = makeStringConstCast("now", -1, SystemTypeName("text")); (yyval.node) = makeTypeCast(n, SystemTypeName("timestamp"), (yylsp[0])); } #line 35789 "gram.c" /* yacc.c:1646 */ break; case 1729: #line 11622 "gram.y" /* yacc.c:1646 */ { /* * Translate as "'now'::text::timestamp(n)". * See comments for CURRENT_DATE. */ Node *n; TypeName *d; n = makeStringConstCast("now", -1, SystemTypeName("text")); d = SystemTypeName("timestamp"); d->typmods = list_make1(makeIntConst((yyvsp[-1].ival), (yylsp[-1]))); (yyval.node) = makeTypeCast(n, d, (yylsp[-3])); } #line 35806 "gram.c" /* yacc.c:1646 */ break; case 1730: #line 11635 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("current_user"), NIL, (yylsp[0])); } #line 35814 "gram.c" /* yacc.c:1646 */ break; case 1731: #line 11639 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("current_user"), NIL, (yylsp[0])); } #line 35822 "gram.c" /* yacc.c:1646 */ break; case 1732: #line 11643 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("session_user"), NIL, (yylsp[0])); } #line 35830 "gram.c" /* yacc.c:1646 */ break; case 1733: #line 11647 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("current_user"), NIL, (yylsp[0])); } #line 35838 "gram.c" /* yacc.c:1646 */ break; case 1734: #line 11651 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("current_database"), NIL, (yylsp[0])); } #line 35846 "gram.c" /* yacc.c:1646 */ break; case 1735: #line 11655 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("current_schema"), NIL, (yylsp[0])); } #line 35854 "gram.c" /* yacc.c:1646 */ break; case 1736: #line 11659 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeTypeCast((yyvsp[-3].node), (yyvsp[-1].typnam), (yylsp[-5])); } #line 35860 "gram.c" /* yacc.c:1646 */ break; case 1737: #line 11661 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("date_part"), (yyvsp[-1].list), (yylsp[-3])); } #line 35868 "gram.c" /* yacc.c:1646 */ break; case 1738: #line 11665 "gram.y" /* yacc.c:1646 */ { /* overlay(A PLACING B FROM C FOR D) is converted to * overlay(A, B, C, D) * overlay(A PLACING B FROM C) is converted to * overlay(A, B, C) */ (yyval.node) = (Node *) makeFuncCall(SystemFuncName("overlay"), (yyvsp[-1].list), (yylsp[-3])); } #line 35881 "gram.c" /* yacc.c:1646 */ break; case 1739: #line 11674 "gram.y" /* yacc.c:1646 */ { /* position(A in B) is converted to position(B, A) */ (yyval.node) = (Node *) makeFuncCall(SystemFuncName("position"), (yyvsp[-1].list), (yylsp[-3])); } #line 35890 "gram.c" /* yacc.c:1646 */ break; case 1740: #line 11679 "gram.y" /* yacc.c:1646 */ { /* substring(A from B for C) is converted to * substring(A, B, C) - thomas 2000-11-28 */ (yyval.node) = (Node *) makeFuncCall(SystemFuncName("substring"), (yyvsp[-1].list), (yylsp[-3])); } #line 35901 "gram.c" /* yacc.c:1646 */ break; case 1741: #line 11686 "gram.y" /* yacc.c:1646 */ { /* TREAT(expr AS target) converts expr of a particular type to target, * which is defined to be a subtype of the original expression. * In SQL99, this is intended for use with structured UDTs, * but let's make this a generally useful form allowing stronger * coercions than are handled by implicit casting. * * Convert SystemTypeName() to SystemFuncName() even though * at the moment they result in the same thing. */ (yyval.node) = (Node *) makeFuncCall(SystemFuncName(((Value *)llast((yyvsp[-1].typnam)->names))->val.str), list_make1((yyvsp[-3].node)), (yylsp[-5])); } #line 35920 "gram.c" /* yacc.c:1646 */ break; case 1742: #line 11701 "gram.y" /* yacc.c:1646 */ { /* various trim expressions are defined in SQL * - thomas 1997-07-19 */ (yyval.node) = (Node *) makeFuncCall(SystemFuncName("btrim"), (yyvsp[-1].list), (yylsp[-4])); } #line 35931 "gram.c" /* yacc.c:1646 */ break; case 1743: #line 11708 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("ltrim"), (yyvsp[-1].list), (yylsp[-4])); } #line 35939 "gram.c" /* yacc.c:1646 */ break; case 1744: #line 11712 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("rtrim"), (yyvsp[-1].list), (yylsp[-4])); } #line 35947 "gram.c" /* yacc.c:1646 */ break; case 1745: #line 11716 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("btrim"), (yyvsp[-1].list), (yylsp[-3])); } #line 35955 "gram.c" /* yacc.c:1646 */ break; case 1746: #line 11720 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_NULLIF, "=", (yyvsp[-3].node), (yyvsp[-1].node), (yylsp[-5])); } #line 35963 "gram.c" /* yacc.c:1646 */ break; case 1747: #line 11724 "gram.y" /* yacc.c:1646 */ { CoalesceExpr *c = makeNode(CoalesceExpr); c->args = (yyvsp[-1].list); c->location = (yylsp[-3]); (yyval.node) = (Node *)c; } #line 35974 "gram.c" /* yacc.c:1646 */ break; case 1748: #line 11731 "gram.y" /* yacc.c:1646 */ { MinMaxExpr *v = makeNode(MinMaxExpr); v->args = (yyvsp[-1].list); v->op = IS_GREATEST; v->location = (yylsp[-3]); (yyval.node) = (Node *)v; } #line 35986 "gram.c" /* yacc.c:1646 */ break; case 1749: #line 11739 "gram.y" /* yacc.c:1646 */ { MinMaxExpr *v = makeNode(MinMaxExpr); v->args = (yyvsp[-1].list); v->op = IS_LEAST; v->location = (yylsp[-3]); (yyval.node) = (Node *)v; } #line 35998 "gram.c" /* yacc.c:1646 */ break; case 1750: #line 11747 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLCONCAT, NULL, NIL, (yyvsp[-1].list), (yylsp[-3])); } #line 36006 "gram.c" /* yacc.c:1646 */ break; case 1751: #line 11751 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLELEMENT, (yyvsp[-1].str), NIL, NIL, (yylsp[-4])); } #line 36014 "gram.c" /* yacc.c:1646 */ break; case 1752: #line 11755 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLELEMENT, (yyvsp[-3].str), (yyvsp[-1].list), NIL, (yylsp[-6])); } #line 36022 "gram.c" /* yacc.c:1646 */ break; case 1753: #line 11759 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLELEMENT, (yyvsp[-3].str), NIL, (yyvsp[-1].list), (yylsp[-6])); } #line 36030 "gram.c" /* yacc.c:1646 */ break; case 1754: #line 11763 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLELEMENT, (yyvsp[-5].str), (yyvsp[-3].list), (yyvsp[-1].list), (yylsp[-8])); } #line 36038 "gram.c" /* yacc.c:1646 */ break; case 1755: #line 11767 "gram.y" /* yacc.c:1646 */ { /* xmlexists(A PASSING [BY REF] B [BY REF]) is * converted to xmlexists(A, B)*/ (yyval.node) = (Node *) makeFuncCall(SystemFuncName("xmlexists"), list_make2((yyvsp[-2].node), (yyvsp[-1].node)), (yylsp[-4])); } #line 36048 "gram.c" /* yacc.c:1646 */ break; case 1756: #line 11773 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLFOREST, NULL, (yyvsp[-1].list), NIL, (yylsp[-3])); } #line 36056 "gram.c" /* yacc.c:1646 */ break; case 1757: #line 11777 "gram.y" /* yacc.c:1646 */ { XmlExpr *x = (XmlExpr *) makeXmlExpr(IS_XMLPARSE, NULL, NIL, list_make2((yyvsp[-2].node), makeBoolAConst((yyvsp[-1].boolean), -1)), (yylsp[-5])); x->xmloption = (yyvsp[-3].ival); (yyval.node) = (Node *)x; } #line 36069 "gram.c" /* yacc.c:1646 */ break; case 1758: #line 11786 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLPI, (yyvsp[-1].str), NULL, NIL, (yylsp[-4])); } #line 36077 "gram.c" /* yacc.c:1646 */ break; case 1759: #line 11790 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLPI, (yyvsp[-3].str), NULL, list_make1((yyvsp[-1].node)), (yylsp[-6])); } #line 36085 "gram.c" /* yacc.c:1646 */ break; case 1760: #line 11794 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLROOT, NULL, NIL, list_make3((yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[-1].node)), (yylsp[-6])); } #line 36094 "gram.c" /* yacc.c:1646 */ break; case 1761: #line 11799 "gram.y" /* yacc.c:1646 */ { XmlSerialize *n = makeNode(XmlSerialize); n->xmloption = (yyvsp[-4].ival); n->expr = (yyvsp[-3].node); n->typeName = (yyvsp[-1].typnam); n->location = (yylsp[-6]); (yyval.node) = (Node *)n; } #line 36107 "gram.c" /* yacc.c:1646 */ break; case 1762: #line 11813 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 36113 "gram.c" /* yacc.c:1646 */ break; case 1763: #line 11815 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeNullAConst(-1); } #line 36119 "gram.c" /* yacc.c:1646 */ break; case 1764: #line 11819 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeIntConst(XML_STANDALONE_YES, -1); } #line 36125 "gram.c" /* yacc.c:1646 */ break; case 1765: #line 11821 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeIntConst(XML_STANDALONE_NO, -1); } #line 36131 "gram.c" /* yacc.c:1646 */ break; case 1766: #line 11823 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeIntConst(XML_STANDALONE_NO_VALUE, -1); } #line 36137 "gram.c" /* yacc.c:1646 */ break; case 1767: #line 11825 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeIntConst(XML_STANDALONE_OMITTED, -1); } #line 36143 "gram.c" /* yacc.c:1646 */ break; case 1768: #line 11828 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 36149 "gram.c" /* yacc.c:1646 */ break; case 1769: #line 11831 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].target)); } #line 36155 "gram.c" /* yacc.c:1646 */ break; case 1770: #line 11832 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].target)); } #line 36161 "gram.c" /* yacc.c:1646 */ break; case 1771: #line 11836 "gram.y" /* yacc.c:1646 */ { (yyval.target) = makeNode(ResTarget); (yyval.target)->name = (yyvsp[0].str); (yyval.target)->indirection = NIL; (yyval.target)->val = (Node *) (yyvsp[-2].node); (yyval.target)->location = (yylsp[-2]); } #line 36173 "gram.c" /* yacc.c:1646 */ break; case 1772: #line 11844 "gram.y" /* yacc.c:1646 */ { (yyval.target) = makeNode(ResTarget); (yyval.target)->name = NULL; (yyval.target)->indirection = NIL; (yyval.target)->val = (Node *) (yyvsp[0].node); (yyval.target)->location = (yylsp[0]); } #line 36185 "gram.c" /* yacc.c:1646 */ break; case 1773: #line 11853 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = XMLOPTION_DOCUMENT; } #line 36191 "gram.c" /* yacc.c:1646 */ break; case 1774: #line 11854 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = XMLOPTION_CONTENT; } #line 36197 "gram.c" /* yacc.c:1646 */ break; case 1775: #line 11857 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = TRUE; } #line 36203 "gram.c" /* yacc.c:1646 */ break; case 1776: #line 11858 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = FALSE; } #line 36209 "gram.c" /* yacc.c:1646 */ break; case 1777: #line 11859 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = FALSE; } #line 36215 "gram.c" /* yacc.c:1646 */ break; case 1778: #line 11865 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 36223 "gram.c" /* yacc.c:1646 */ break; case 1779: #line 11869 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-2].node); } #line 36231 "gram.c" /* yacc.c:1646 */ break; case 1780: #line 11873 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 36239 "gram.c" /* yacc.c:1646 */ break; case 1781: #line 11877 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-2].node); } #line 36247 "gram.c" /* yacc.c:1646 */ break; case 1782: #line 11887 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 36253 "gram.c" /* yacc.c:1646 */ break; case 1783: #line 11888 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 36259 "gram.c" /* yacc.c:1646 */ break; case 1784: #line 11892 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 36265 "gram.c" /* yacc.c:1646 */ break; case 1785: #line 11893 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 36271 "gram.c" /* yacc.c:1646 */ break; case 1786: #line 11901 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 36277 "gram.c" /* yacc.c:1646 */ break; case 1787: #line 11902 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 36283 "gram.c" /* yacc.c:1646 */ break; case 1788: #line 11906 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].windef)); } #line 36289 "gram.c" /* yacc.c:1646 */ break; case 1789: #line 11908 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].windef)); } #line 36295 "gram.c" /* yacc.c:1646 */ break; case 1790: #line 11913 "gram.y" /* yacc.c:1646 */ { WindowDef *n = (yyvsp[0].windef); n->name = (yyvsp[-2].str); (yyval.windef) = n; } #line 36305 "gram.c" /* yacc.c:1646 */ break; case 1791: #line 11921 "gram.y" /* yacc.c:1646 */ { (yyval.windef) = (yyvsp[0].windef); } #line 36311 "gram.c" /* yacc.c:1646 */ break; case 1792: #line 11923 "gram.y" /* yacc.c:1646 */ { WindowDef *n = makeNode(WindowDef); n->name = (yyvsp[0].str); n->refname = NULL; n->partitionClause = NIL; n->orderClause = NIL; n->frameOptions = FRAMEOPTION_DEFAULTS; n->startOffset = NULL; n->endOffset = NULL; n->location = (yylsp[0]); (yyval.windef) = n; } #line 36328 "gram.c" /* yacc.c:1646 */ break; case 1793: #line 11936 "gram.y" /* yacc.c:1646 */ { (yyval.windef) = NULL; } #line 36334 "gram.c" /* yacc.c:1646 */ break; case 1794: #line 11941 "gram.y" /* yacc.c:1646 */ { WindowDef *n = makeNode(WindowDef); n->name = NULL; n->refname = (yyvsp[-4].str); n->partitionClause = (yyvsp[-3].list); n->orderClause = (yyvsp[-2].list); /* copy relevant fields of opt_frame_clause */ n->frameOptions = (yyvsp[-1].windef)->frameOptions; n->startOffset = (yyvsp[-1].windef)->startOffset; n->endOffset = (yyvsp[-1].windef)->endOffset; n->location = (yylsp[-5]); (yyval.windef) = n; } #line 36352 "gram.c" /* yacc.c:1646 */ break; case 1795: #line 11966 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 36358 "gram.c" /* yacc.c:1646 */ break; case 1796: #line 11967 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 36364 "gram.c" /* yacc.c:1646 */ break; case 1797: #line 11970 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 36370 "gram.c" /* yacc.c:1646 */ break; case 1798: #line 11971 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 36376 "gram.c" /* yacc.c:1646 */ break; case 1799: #line 11983 "gram.y" /* yacc.c:1646 */ { WindowDef *n = (yyvsp[0].windef); n->frameOptions |= FRAMEOPTION_NONDEFAULT | FRAMEOPTION_RANGE; if (n->frameOptions & (FRAMEOPTION_START_VALUE_PRECEDING | FRAMEOPTION_END_VALUE_PRECEDING)) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("RANGE PRECEDING is only supported with UNBOUNDED"), parser_errposition((yylsp[-1])))); if (n->frameOptions & (FRAMEOPTION_START_VALUE_FOLLOWING | FRAMEOPTION_END_VALUE_FOLLOWING)) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("RANGE FOLLOWING is only supported with UNBOUNDED"), parser_errposition((yylsp[-1])))); (yyval.windef) = n; } #line 36398 "gram.c" /* yacc.c:1646 */ break; case 1800: #line 12001 "gram.y" /* yacc.c:1646 */ { WindowDef *n = (yyvsp[0].windef); n->frameOptions |= FRAMEOPTION_NONDEFAULT | FRAMEOPTION_ROWS; (yyval.windef) = n; } #line 36408 "gram.c" /* yacc.c:1646 */ break; case 1801: #line 12007 "gram.y" /* yacc.c:1646 */ { WindowDef *n = makeNode(WindowDef); n->frameOptions = FRAMEOPTION_DEFAULTS; n->startOffset = NULL; n->endOffset = NULL; (yyval.windef) = n; } #line 36420 "gram.c" /* yacc.c:1646 */ break; case 1802: #line 12017 "gram.y" /* yacc.c:1646 */ { WindowDef *n = (yyvsp[0].windef); /* reject invalid cases */ if (n->frameOptions & FRAMEOPTION_START_UNBOUNDED_FOLLOWING) ereport(ERROR, (errcode(ERRCODE_WINDOWING_ERROR), errmsg("frame start cannot be UNBOUNDED FOLLOWING"), parser_errposition((yylsp[0])))); if (n->frameOptions & FRAMEOPTION_START_VALUE_FOLLOWING) ereport(ERROR, (errcode(ERRCODE_WINDOWING_ERROR), errmsg("frame starting from following row cannot end with current row"), parser_errposition((yylsp[0])))); n->frameOptions |= FRAMEOPTION_END_CURRENT_ROW; (yyval.windef) = n; } #line 36441 "gram.c" /* yacc.c:1646 */ break; case 1803: #line 12034 "gram.y" /* yacc.c:1646 */ { WindowDef *n1 = (yyvsp[-2].windef); WindowDef *n2 = (yyvsp[0].windef); /* form merged options */ int frameOptions = n1->frameOptions; /* shift converts START_ options to END_ options */ frameOptions |= n2->frameOptions << 1; frameOptions |= FRAMEOPTION_BETWEEN; /* reject invalid cases */ if (frameOptions & FRAMEOPTION_START_UNBOUNDED_FOLLOWING) ereport(ERROR, (errcode(ERRCODE_WINDOWING_ERROR), errmsg("frame start cannot be UNBOUNDED FOLLOWING"), parser_errposition((yylsp[-2])))); if (frameOptions & FRAMEOPTION_END_UNBOUNDED_PRECEDING) ereport(ERROR, (errcode(ERRCODE_WINDOWING_ERROR), errmsg("frame end cannot be UNBOUNDED PRECEDING"), parser_errposition((yylsp[0])))); if ((frameOptions & FRAMEOPTION_START_CURRENT_ROW) && (frameOptions & FRAMEOPTION_END_VALUE_PRECEDING)) ereport(ERROR, (errcode(ERRCODE_WINDOWING_ERROR), errmsg("frame starting from current row cannot have preceding rows"), parser_errposition((yylsp[0])))); if ((frameOptions & FRAMEOPTION_START_VALUE_FOLLOWING) && (frameOptions & (FRAMEOPTION_END_VALUE_PRECEDING | FRAMEOPTION_END_CURRENT_ROW))) ereport(ERROR, (errcode(ERRCODE_WINDOWING_ERROR), errmsg("frame starting from following row cannot have preceding rows"), parser_errposition((yylsp[0])))); n1->frameOptions = frameOptions; n1->endOffset = n2->startOffset; (yyval.windef) = n1; } #line 36482 "gram.c" /* yacc.c:1646 */ break; case 1804: #line 12079 "gram.y" /* yacc.c:1646 */ { WindowDef *n = makeNode(WindowDef); n->frameOptions = FRAMEOPTION_START_UNBOUNDED_PRECEDING; n->startOffset = NULL; n->endOffset = NULL; (yyval.windef) = n; } #line 36494 "gram.c" /* yacc.c:1646 */ break; case 1805: #line 12087 "gram.y" /* yacc.c:1646 */ { WindowDef *n = makeNode(WindowDef); n->frameOptions = FRAMEOPTION_START_UNBOUNDED_FOLLOWING; n->startOffset = NULL; n->endOffset = NULL; (yyval.windef) = n; } #line 36506 "gram.c" /* yacc.c:1646 */ break; case 1806: #line 12095 "gram.y" /* yacc.c:1646 */ { WindowDef *n = makeNode(WindowDef); n->frameOptions = FRAMEOPTION_START_CURRENT_ROW; n->startOffset = NULL; n->endOffset = NULL; (yyval.windef) = n; } #line 36518 "gram.c" /* yacc.c:1646 */ break; case 1807: #line 12103 "gram.y" /* yacc.c:1646 */ { WindowDef *n = makeNode(WindowDef); n->frameOptions = FRAMEOPTION_START_VALUE_PRECEDING; n->startOffset = (yyvsp[-1].node); n->endOffset = NULL; (yyval.windef) = n; } #line 36530 "gram.c" /* yacc.c:1646 */ break; case 1808: #line 12111 "gram.y" /* yacc.c:1646 */ { WindowDef *n = makeNode(WindowDef); n->frameOptions = FRAMEOPTION_START_VALUE_FOLLOWING; n->startOffset = (yyvsp[-1].node); n->endOffset = NULL; (yyval.windef) = n; } #line 36542 "gram.c" /* yacc.c:1646 */ break; case 1809: #line 12131 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 36548 "gram.c" /* yacc.c:1646 */ break; case 1810: #line 12132 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 36554 "gram.c" /* yacc.c:1646 */ break; case 1811: #line 12133 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-3].list), (yyvsp[-1].node)); } #line 36560 "gram.c" /* yacc.c:1646 */ break; case 1812: #line 12136 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ANY_SUBLINK; } #line 36566 "gram.c" /* yacc.c:1646 */ break; case 1813: #line 12137 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ANY_SUBLINK; } #line 36572 "gram.c" /* yacc.c:1646 */ break; case 1814: #line 12138 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ALL_SUBLINK; } #line 36578 "gram.c" /* yacc.c:1646 */ break; case 1815: #line 12141 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 36584 "gram.c" /* yacc.c:1646 */ break; case 1816: #line 12142 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 36590 "gram.c" /* yacc.c:1646 */ break; case 1817: #line 12145 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "+"; } #line 36596 "gram.c" /* yacc.c:1646 */ break; case 1818: #line 12146 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "-"; } #line 36602 "gram.c" /* yacc.c:1646 */ break; case 1819: #line 12147 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "*"; } #line 36608 "gram.c" /* yacc.c:1646 */ break; case 1820: #line 12148 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "/"; } #line 36614 "gram.c" /* yacc.c:1646 */ break; case 1821: #line 12149 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "%"; } #line 36620 "gram.c" /* yacc.c:1646 */ break; case 1822: #line 12150 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "^"; } #line 36626 "gram.c" /* yacc.c:1646 */ break; case 1823: #line 12151 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "<"; } #line 36632 "gram.c" /* yacc.c:1646 */ break; case 1824: #line 12152 "gram.y" /* yacc.c:1646 */ { (yyval.str) = ">"; } #line 36638 "gram.c" /* yacc.c:1646 */ break; case 1825: #line 12153 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "="; } #line 36644 "gram.c" /* yacc.c:1646 */ break; case 1826: #line 12157 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 36650 "gram.c" /* yacc.c:1646 */ break; case 1827: #line 12159 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 36656 "gram.c" /* yacc.c:1646 */ break; case 1828: #line 12164 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 36662 "gram.c" /* yacc.c:1646 */ break; case 1829: #line 12166 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 36668 "gram.c" /* yacc.c:1646 */ break; case 1830: #line 12171 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 36674 "gram.c" /* yacc.c:1646 */ break; case 1831: #line 12173 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 36680 "gram.c" /* yacc.c:1646 */ break; case 1832: #line 12175 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString("~~")); } #line 36686 "gram.c" /* yacc.c:1646 */ break; case 1833: #line 12177 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString("!~~")); } #line 36692 "gram.c" /* yacc.c:1646 */ break; case 1834: #line 12179 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString("~~*")); } #line 36698 "gram.c" /* yacc.c:1646 */ break; case 1835: #line 12181 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString("!~~*")); } #line 36704 "gram.c" /* yacc.c:1646 */ break; case 1836: #line 12193 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 36712 "gram.c" /* yacc.c:1646 */ break; case 1837: #line 12197 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 36720 "gram.c" /* yacc.c:1646 */ break; case 1838: #line 12204 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 36728 "gram.c" /* yacc.c:1646 */ break; case 1839: #line 12208 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 36736 "gram.c" /* yacc.c:1646 */ break; case 1840: #line 12214 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 36744 "gram.c" /* yacc.c:1646 */ break; case 1841: #line 12218 "gram.y" /* yacc.c:1646 */ { NamedArgExpr *na = makeNode(NamedArgExpr); na->name = (yyvsp[-2].str); na->arg = (Expr *) (yyvsp[0].node); na->argnumber = -1; /* until determined */ na->location = (yylsp[-2]); (yyval.node) = (Node *) na; } #line 36757 "gram.c" /* yacc.c:1646 */ break; case 1842: #line 12228 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].typnam)); } #line 36763 "gram.c" /* yacc.c:1646 */ break; case 1843: #line 12229 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].typnam)); } #line 36769 "gram.c" /* yacc.c:1646 */ break; case 1844: #line 12233 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeAArrayExpr((yyvsp[-1].list), (yylsp[-2])); } #line 36777 "gram.c" /* yacc.c:1646 */ break; case 1845: #line 12237 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeAArrayExpr((yyvsp[-1].list), (yylsp[-2])); } #line 36785 "gram.c" /* yacc.c:1646 */ break; case 1846: #line 12241 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeAArrayExpr(NIL, (yylsp[-1])); } #line 36793 "gram.c" /* yacc.c:1646 */ break; case 1847: #line 12246 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 36799 "gram.c" /* yacc.c:1646 */ break; case 1848: #line 12247 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 36805 "gram.c" /* yacc.c:1646 */ break; case 1849: #line 12253 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeStringConst((yyvsp[-2].str), (yylsp[-2])), (yyvsp[0].node)); } #line 36813 "gram.c" /* yacc.c:1646 */ break; case 1850: #line 12256 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 36819 "gram.c" /* yacc.c:1646 */ break; case 1851: #line 12263 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 36825 "gram.c" /* yacc.c:1646 */ break; case 1852: #line 12264 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "year"; } #line 36831 "gram.c" /* yacc.c:1646 */ break; case 1853: #line 12265 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "month"; } #line 36837 "gram.c" /* yacc.c:1646 */ break; case 1854: #line 12266 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "day"; } #line 36843 "gram.c" /* yacc.c:1646 */ break; case 1855: #line 12267 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "hour"; } #line 36849 "gram.c" /* yacc.c:1646 */ break; case 1856: #line 12268 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "minute"; } #line 36855 "gram.c" /* yacc.c:1646 */ break; case 1857: #line 12269 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "second"; } #line 36861 "gram.c" /* yacc.c:1646 */ break; case 1858: #line 12270 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 36867 "gram.c" /* yacc.c:1646 */ break; case 1859: #line 12281 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make4((yyvsp[-3].node), (yyvsp[-2].node), (yyvsp[-1].node), (yyvsp[0].node)); } #line 36875 "gram.c" /* yacc.c:1646 */ break; case 1860: #line 12285 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make3((yyvsp[-2].node), (yyvsp[-1].node), (yyvsp[0].node)); } #line 36883 "gram.c" /* yacc.c:1646 */ break; case 1861: #line 12292 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 36889 "gram.c" /* yacc.c:1646 */ break; case 1862: #line 12298 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[0].node), (yyvsp[-2].node)); } #line 36895 "gram.c" /* yacc.c:1646 */ break; case 1863: #line 12299 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 36901 "gram.c" /* yacc.c:1646 */ break; case 1864: #line 12316 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make3((yyvsp[-2].node), (yyvsp[-1].node), (yyvsp[0].node)); } #line 36909 "gram.c" /* yacc.c:1646 */ break; case 1865: #line 12320 "gram.y" /* yacc.c:1646 */ { /* not legal per SQL99, but might as well allow it */ (yyval.list) = list_make3((yyvsp[-2].node), (yyvsp[0].node), (yyvsp[-1].node)); } #line 36918 "gram.c" /* yacc.c:1646 */ break; case 1866: #line 12325 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-1].node), (yyvsp[0].node)); } #line 36926 "gram.c" /* yacc.c:1646 */ break; case 1867: #line 12329 "gram.y" /* yacc.c:1646 */ { /* * Since there are no cases where this syntax allows * a textual FOR value, we forcibly cast the argument * to int4. The possible matches in pg_proc are * substring(text,int4) and substring(text,text), * and we don't want the parser to choose the latter, * which it is likely to do if the second argument * is unknown or doesn't have an implicit cast to int4. */ (yyval.list) = list_make3((yyvsp[-1].node), makeIntConst(1, -1), makeTypeCast((yyvsp[0].node), SystemTypeName("int4"), -1)); } #line 36945 "gram.c" /* yacc.c:1646 */ break; case 1868: #line 12344 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 36953 "gram.c" /* yacc.c:1646 */ break; case 1869: #line 12348 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 36959 "gram.c" /* yacc.c:1646 */ break; case 1870: #line 12352 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 36965 "gram.c" /* yacc.c:1646 */ break; case 1871: #line 12355 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 36971 "gram.c" /* yacc.c:1646 */ break; case 1872: #line 12358 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[0].list), (yyvsp[-2].node)); } #line 36977 "gram.c" /* yacc.c:1646 */ break; case 1873: #line 12359 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 36983 "gram.c" /* yacc.c:1646 */ break; case 1874: #line 12360 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 36989 "gram.c" /* yacc.c:1646 */ break; case 1875: #line 12364 "gram.y" /* yacc.c:1646 */ { SubLink *n = makeNode(SubLink); n->subselect = (yyvsp[0].node); /* other fields will be filled later */ (yyval.node) = (Node *)n; } #line 37000 "gram.c" /* yacc.c:1646 */ break; case 1876: #line 12370 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *)(yyvsp[-1].list); } #line 37006 "gram.c" /* yacc.c:1646 */ break; case 1877: #line 12381 "gram.y" /* yacc.c:1646 */ { CaseExpr *c = makeNode(CaseExpr); c->casetype = InvalidOid; /* not analyzed yet */ c->arg = (Expr *) (yyvsp[-3].node); c->args = (yyvsp[-2].list); c->defresult = (Expr *) (yyvsp[-1].node); c->location = (yylsp[-4]); (yyval.node) = (Node *)c; } #line 37020 "gram.c" /* yacc.c:1646 */ break; case 1878: #line 12394 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 37026 "gram.c" /* yacc.c:1646 */ break; case 1879: #line 12395 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 37032 "gram.c" /* yacc.c:1646 */ break; case 1880: #line 12400 "gram.y" /* yacc.c:1646 */ { CaseWhen *w = makeNode(CaseWhen); w->expr = (Expr *) (yyvsp[-2].node); w->result = (Expr *) (yyvsp[0].node); w->location = (yylsp[-3]); (yyval.node) = (Node *)w; } #line 37044 "gram.c" /* yacc.c:1646 */ break; case 1881: #line 12410 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 37050 "gram.c" /* yacc.c:1646 */ break; case 1882: #line 12411 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 37056 "gram.c" /* yacc.c:1646 */ break; case 1883: #line 12414 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 37062 "gram.c" /* yacc.c:1646 */ break; case 1884: #line 12415 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 37068 "gram.c" /* yacc.c:1646 */ break; case 1885: #line 12419 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeColumnRef((yyvsp[0].str), NIL, (yylsp[0]), yyscanner); } #line 37076 "gram.c" /* yacc.c:1646 */ break; case 1886: #line 12423 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeColumnRef((yyvsp[-1].str), (yyvsp[0].list), (yylsp[-1]), yyscanner); } #line 37084 "gram.c" /* yacc.c:1646 */ break; case 1887: #line 12430 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 37092 "gram.c" /* yacc.c:1646 */ break; case 1888: #line 12434 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeNode(A_Star); } #line 37100 "gram.c" /* yacc.c:1646 */ break; case 1889: #line 12438 "gram.y" /* yacc.c:1646 */ { A_Indices *ai = makeNode(A_Indices); ai->lidx = NULL; ai->uidx = (yyvsp[-1].node); (yyval.node) = (Node *) ai; } #line 37111 "gram.c" /* yacc.c:1646 */ break; case 1890: #line 12445 "gram.y" /* yacc.c:1646 */ { A_Indices *ai = makeNode(A_Indices); ai->lidx = (yyvsp[-3].node); ai->uidx = (yyvsp[-1].node); (yyval.node) = (Node *) ai; } #line 37122 "gram.c" /* yacc.c:1646 */ break; case 1891: #line 12454 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 37128 "gram.c" /* yacc.c:1646 */ break; case 1892: #line 12455 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 37134 "gram.c" /* yacc.c:1646 */ break; case 1893: #line 12459 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 37140 "gram.c" /* yacc.c:1646 */ break; case 1894: #line 12460 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 37146 "gram.c" /* yacc.c:1646 */ break; case 1897: #line 12475 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].node); } #line 37152 "gram.c" /* yacc.c:1646 */ break; case 1898: #line 12477 "gram.y" /* yacc.c:1646 */ { SetToDefault *n = makeNode(SetToDefault); n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 37162 "gram.c" /* yacc.c:1646 */ break; case 1899: #line 12485 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 37168 "gram.c" /* yacc.c:1646 */ break; case 1900: #line 12486 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 37174 "gram.c" /* yacc.c:1646 */ break; case 1901: #line 12494 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 37180 "gram.c" /* yacc.c:1646 */ break; case 1902: #line 12504 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 37186 "gram.c" /* yacc.c:1646 */ break; case 1903: #line 12505 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 37192 "gram.c" /* yacc.c:1646 */ break; case 1904: #line 12509 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].target)); } #line 37198 "gram.c" /* yacc.c:1646 */ break; case 1905: #line 12510 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].target)); } #line 37204 "gram.c" /* yacc.c:1646 */ break; case 1906: #line 12514 "gram.y" /* yacc.c:1646 */ { (yyval.target) = makeNode(ResTarget); (yyval.target)->name = (yyvsp[0].str); (yyval.target)->indirection = NIL; (yyval.target)->val = (Node *)(yyvsp[-2].node); (yyval.target)->location = (yylsp[-2]); } #line 37216 "gram.c" /* yacc.c:1646 */ break; case 1907: #line 12530 "gram.y" /* yacc.c:1646 */ { (yyval.target) = makeNode(ResTarget); (yyval.target)->name = (yyvsp[0].str); (yyval.target)->indirection = NIL; (yyval.target)->val = (Node *)(yyvsp[-1].node); (yyval.target)->location = (yylsp[-1]); } #line 37228 "gram.c" /* yacc.c:1646 */ break; case 1908: #line 12538 "gram.y" /* yacc.c:1646 */ { (yyval.target) = makeNode(ResTarget); (yyval.target)->name = NULL; (yyval.target)->indirection = NIL; (yyval.target)->val = (Node *)(yyvsp[0].node); (yyval.target)->location = (yylsp[0]); } #line 37240 "gram.c" /* yacc.c:1646 */ break; case 1909: #line 12546 "gram.y" /* yacc.c:1646 */ { ColumnRef *n = makeNode(ColumnRef); n->fields = list_make1(makeNode(A_Star)); n->location = (yylsp[0]); (yyval.target) = makeNode(ResTarget); (yyval.target)->name = NULL; (yyval.target)->indirection = NIL; (yyval.target)->val = (Node *)n; (yyval.target)->location = (yylsp[0]); } #line 37256 "gram.c" /* yacc.c:1646 */ break; case 1910: #line 12567 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].range)); } #line 37262 "gram.c" /* yacc.c:1646 */ break; case 1911: #line 12568 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].range)); } #line 37268 "gram.c" /* yacc.c:1646 */ break; case 1912: #line 12580 "gram.y" /* yacc.c:1646 */ { (yyval.range) = makeRangeVar(NULL, (yyvsp[0].str), (yylsp[0])); } #line 37276 "gram.c" /* yacc.c:1646 */ break; case 1913: #line 12584 "gram.y" /* yacc.c:1646 */ { check_qualified_name((yyvsp[0].list), yyscanner); (yyval.range) = makeRangeVar(NULL, NULL, (yylsp[-1])); switch (list_length((yyvsp[0].list))) { case 1: (yyval.range)->catalogname = NULL; (yyval.range)->schemaname = (yyvsp[-1].str); (yyval.range)->relname = strVal(linitial((yyvsp[0].list))); break; case 2: (yyval.range)->catalogname = (yyvsp[-1].str); (yyval.range)->schemaname = strVal(linitial((yyvsp[0].list))); (yyval.range)->relname = strVal(lsecond((yyvsp[0].list))); break; default: ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("improper qualified name (too many dotted names): %s", NameListToString(lcons(makeString((yyvsp[-1].str)), (yyvsp[0].list)))), parser_errposition((yylsp[-1])))); break; } } #line 37305 "gram.c" /* yacc.c:1646 */ break; case 1914: #line 12611 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 37311 "gram.c" /* yacc.c:1646 */ break; case 1915: #line 12613 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } #line 37317 "gram.c" /* yacc.c:1646 */ break; case 1916: #line 12617 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 37323 "gram.c" /* yacc.c:1646 */ break; case 1917: #line 12620 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 37329 "gram.c" /* yacc.c:1646 */ break; case 1918: #line 12623 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 37335 "gram.c" /* yacc.c:1646 */ break; case 1919: #line 12625 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 37341 "gram.c" /* yacc.c:1646 */ break; case 1920: #line 12627 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 37347 "gram.c" /* yacc.c:1646 */ break; case 1921: #line 12629 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 37353 "gram.c" /* yacc.c:1646 */ break; case 1922: #line 12640 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 37359 "gram.c" /* yacc.c:1646 */ break; case 1923: #line 12642 "gram.y" /* yacc.c:1646 */ { (yyval.list) = check_func_name(lcons(makeString((yyvsp[-1].str)), (yyvsp[0].list)), yyscanner); } #line 37368 "gram.c" /* yacc.c:1646 */ break; case 1924: #line 12653 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeIntConst((yyvsp[0].ival), (yylsp[0])); } #line 37376 "gram.c" /* yacc.c:1646 */ break; case 1925: #line 12657 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeFloatConst((yyvsp[0].str), (yylsp[0])); } #line 37384 "gram.c" /* yacc.c:1646 */ break; case 1926: #line 12661 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeStringConst((yyvsp[0].str), (yylsp[0])); } #line 37392 "gram.c" /* yacc.c:1646 */ break; case 1927: #line 12665 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeBitStringConst((yyvsp[0].str), (yylsp[0])); } #line 37400 "gram.c" /* yacc.c:1646 */ break; case 1928: #line 12669 "gram.y" /* yacc.c:1646 */ { /* This is a bit constant per SQL99: * Without Feature F511, "BIT data type", * a shall not be a * or a . */ (yyval.node) = makeBitStringConst((yyvsp[0].str), (yylsp[0])); } #line 37413 "gram.c" /* yacc.c:1646 */ break; case 1929: #line 12678 "gram.y" /* yacc.c:1646 */ { /* generic type 'literal' syntax */ TypeName *t = makeTypeNameFromNameList((yyvsp[-1].list)); t->location = (yylsp[-1]); (yyval.node) = makeStringConstCast((yyvsp[0].str), (yylsp[0]), t); } #line 37424 "gram.c" /* yacc.c:1646 */ break; case 1930: #line 12685 "gram.y" /* yacc.c:1646 */ { /* generic syntax with a type modifier */ TypeName *t = makeTypeNameFromNameList((yyvsp[-5].list)); ListCell *lc; /* * We must use func_arg_list and opt_sort_clause in the * production to avoid reduce/reduce conflicts, but we * don't actually wish to allow NamedArgExpr in this * context, nor ORDER BY. */ foreach(lc, (yyvsp[-3].list)) { NamedArgExpr *arg = (NamedArgExpr *) lfirst(lc); if (IsA(arg, NamedArgExpr)) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("type modifier cannot have parameter name"), parser_errposition(arg->location))); } if ((yyvsp[-2].list) != NIL) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("type modifier cannot have ORDER BY"), parser_errposition((yylsp[-2])))); t->typmods = (yyvsp[-3].list); t->location = (yylsp[-5]); (yyval.node) = makeStringConstCast((yyvsp[0].str), (yylsp[0]), t); } #line 37460 "gram.c" /* yacc.c:1646 */ break; case 1931: #line 12717 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeStringConstCast((yyvsp[0].str), (yylsp[0]), (yyvsp[-1].typnam)); } #line 37468 "gram.c" /* yacc.c:1646 */ break; case 1932: #line 12721 "gram.y" /* yacc.c:1646 */ { TypeName *t = (yyvsp[-2].typnam); t->typmods = (yyvsp[0].list); (yyval.node) = makeStringConstCast((yyvsp[-1].str), (yylsp[-1]), t); } #line 37478 "gram.c" /* yacc.c:1646 */ break; case 1933: #line 12727 "gram.y" /* yacc.c:1646 */ { TypeName *t = (yyvsp[-5].typnam); if ((yyvsp[0].list) != NIL) { if (list_length((yyvsp[0].list)) != 1) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("interval precision specified twice"), parser_errposition((yylsp[-5])))); t->typmods = lappend((yyvsp[0].list), makeIntConst((yyvsp[-3].ival), (yylsp[-3]))); } else t->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1), makeIntConst((yyvsp[-3].ival), (yylsp[-3]))); (yyval.node) = makeStringConstCast((yyvsp[-1].str), (yylsp[-1]), t); } #line 37499 "gram.c" /* yacc.c:1646 */ break; case 1934: #line 12744 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeBoolAConst(TRUE, (yylsp[0])); } #line 37507 "gram.c" /* yacc.c:1646 */ break; case 1935: #line 12748 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeBoolAConst(FALSE, (yylsp[0])); } #line 37515 "gram.c" /* yacc.c:1646 */ break; case 1936: #line 12752 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeNullAConst((yylsp[0])); } #line 37523 "gram.c" /* yacc.c:1646 */ break; case 1937: #line 12757 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[0].ival); } #line 37529 "gram.c" /* yacc.c:1646 */ break; case 1938: #line 12758 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 37535 "gram.c" /* yacc.c:1646 */ break; case 1939: #line 12759 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 37541 "gram.c" /* yacc.c:1646 */ break; case 1940: #line 12762 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 37547 "gram.c" /* yacc.c:1646 */ break; case 1941: #line 12764 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } #line 37553 "gram.c" /* yacc.c:1646 */ break; case 1942: #line 12767 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[0].ival); } #line 37559 "gram.c" /* yacc.c:1646 */ break; case 1943: #line 12768 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = + (yyvsp[0].ival); } #line 37565 "gram.c" /* yacc.c:1646 */ break; case 1944: #line 12769 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = - (yyvsp[0].ival); } #line 37571 "gram.c" /* yacc.c:1646 */ break; case 1945: #line 12785 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 37577 "gram.c" /* yacc.c:1646 */ break; case 1946: #line 12786 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 37583 "gram.c" /* yacc.c:1646 */ break; case 1947: #line 12787 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 37589 "gram.c" /* yacc.c:1646 */ break; case 1948: #line 12792 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 37595 "gram.c" /* yacc.c:1646 */ break; case 1949: #line 12793 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 37601 "gram.c" /* yacc.c:1646 */ break; case 1950: #line 12794 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 37607 "gram.c" /* yacc.c:1646 */ break; case 1951: #line 12799 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 37613 "gram.c" /* yacc.c:1646 */ break; case 1952: #line 12800 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 37619 "gram.c" /* yacc.c:1646 */ break; case 1953: #line 12801 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 37625 "gram.c" /* yacc.c:1646 */ break; case 1954: #line 12802 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 37631 "gram.c" /* yacc.c:1646 */ break; case 1955: #line 12808 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 37637 "gram.c" /* yacc.c:1646 */ break; case 1956: #line 12809 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 37643 "gram.c" /* yacc.c:1646 */ break; case 1957: #line 12810 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 37649 "gram.c" /* yacc.c:1646 */ break; case 1958: #line 12811 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 37655 "gram.c" /* yacc.c:1646 */ break; case 1959: #line 12812 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 37661 "gram.c" /* yacc.c:1646 */ break; #line 37665 "gram.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires that yytoken be updated with the new translation. We take the approach of translating immediately before every use of yytoken. One alternative is translating here after every semantic action, but that translation would be missed if the semantic action invokes YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an incorrect destructor might then be invoked immediately. In the case of YYERROR or YYBACKUP, subsequent parser actions might lead to an incorrect destructor call or verbose syntax error message before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; *++yylsp = yyloc; /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*--------------------------------------. | yyerrlab -- here on detecting error. | `--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if ! YYERROR_VERBOSE yyerror (&yylloc, yyscanner, YY_("syntax error")); #else # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ yyssp, yytoken) { char const *yymsgp = YY_("syntax error"); int yysyntax_error_status; yysyntax_error_status = YYSYNTAX_ERROR; if (yysyntax_error_status == 0) yymsgp = yymsg; else if (yysyntax_error_status == 1) { if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); if (!yymsg) { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; yysyntax_error_status = 2; } else { yysyntax_error_status = YYSYNTAX_ERROR; yymsgp = yymsg; } } yyerror (&yylloc, yyscanner, yymsgp); if (yysyntax_error_status == 2) goto yyexhaustedlab; } # undef YYSYNTAX_ERROR #endif } yyerror_range[1] = yylloc; if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval, &yylloc, yyscanner); yychar = YYEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers like GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (/*CONSTCOND*/ 0) goto yyerrorlab; yyerror_range[1] = yylsp[1-yylen]; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yyerror_range[1] = *yylsp; yydestruct ("Error: popping", yystos[yystate], yyvsp, yylsp, yyscanner); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END yyerror_range[2] = yylloc; /* Using YYLLOC is tempting, but would change the location of the lookahead. YYLOC is available though. */ YYLLOC_DEFAULT (yyloc, yyerror_range, 2); *++yylsp = yyloc; /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #if !defined yyoverflow || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (&yylloc, yyscanner, YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: if (yychar != YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = YYTRANSLATE (yychar); yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc, yyscanner); } /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp, yylsp, yyscanner); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif #if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif return yyresult; } #line 13274 "gram.y" /* yacc.c:1906 */ /* * The signature of this function is required by bison. However, we * ignore the passed yylloc and instead use the last token position * available from the scanner. */ static void base_yyerror(YYLTYPE *yylloc, core_yyscan_t yyscanner, const char *msg) { parser_yyerror(msg); } static Node * makeColumnRef(char *colname, List *indirection, int location, core_yyscan_t yyscanner) { /* * Generate a ColumnRef node, with an A_Indirection node added if there * is any subscripting in the specified indirection list. However, * any field selection at the start of the indirection list must be * transposed into the "fields" part of the ColumnRef node. */ ColumnRef *c = makeNode(ColumnRef); int nfields = 0; ListCell *l; c->location = location; foreach(l, indirection) { if (IsA(lfirst(l), A_Indices)) { A_Indirection *i = makeNode(A_Indirection); if (nfields == 0) { /* easy case - all indirection goes to A_Indirection */ c->fields = list_make1(makeString(colname)); i->indirection = check_indirection(indirection, yyscanner); } else { /* got to split the list in two */ i->indirection = check_indirection(list_copy_tail(indirection, nfields), yyscanner); indirection = list_truncate(indirection, nfields); c->fields = lcons(makeString(colname), indirection); } i->arg = (Node *) c; return (Node *) i; } else if (IsA(lfirst(l), A_Star)) { /* We only allow '*' at the end of a ColumnRef */ if (lnext(l) != NULL) parser_yyerror("improper use of \"*\""); } nfields++; } /* No subscripting, so all indirection gets added to field list */ c->fields = lcons(makeString(colname), indirection); return (Node *) c; } static Node * makeTypeCast(Node *arg, TypeName *typename, int location) { TypeCast *n = makeNode(TypeCast); n->arg = arg; n->typeName = typename; n->location = location; return (Node *) n; } static Node * makeStringConst(char *str, int location) { A_Const *n = makeNode(A_Const); n->val.type = T_String; n->val.val.str = str; n->location = location; return (Node *)n; } static Node * makeStringConstCast(char *str, int location, TypeName *typename) { Node *s = makeStringConst(str, location); return makeTypeCast(s, typename, -1); } static Node * makeIntConst(int val, int location) { A_Const *n = makeNode(A_Const); n->val.type = T_Integer; n->val.val.ival = val; n->location = location; return (Node *)n; } static Node * makeFloatConst(char *str, int location) { A_Const *n = makeNode(A_Const); n->val.type = T_Float; n->val.val.str = str; n->location = location; return (Node *)n; } static Node * makeBitStringConst(char *str, int location) { A_Const *n = makeNode(A_Const); n->val.type = T_BitString; n->val.val.str = str; n->location = location; return (Node *)n; } static Node * makeNullAConst(int location) { A_Const *n = makeNode(A_Const); n->val.type = T_Null; n->location = location; return (Node *)n; } static Node * makeAConst(Value *v, int location) { Node *n; switch (v->type) { case T_Float: n = makeFloatConst(v->val.str, location); break; case T_Integer: n = makeIntConst(v->val.ival, location); break; case T_String: default: n = makeStringConst(v->val.str, location); break; } return n; } /* makeBoolAConst() * Create an A_Const string node and put it inside a boolean cast. */ static Node * makeBoolAConst(bool state, int location) { A_Const *n = makeNode(A_Const); n->val.type = T_String; n->val.val.str = (state ? "t" : "f"); n->location = location; return makeTypeCast((Node *)n, SystemTypeName("bool"), -1); } /* check_qualified_name --- check the result of qualified_name production * * It's easiest to let the grammar production for qualified_name allow * subscripts and '*', which we then must reject here. */ static void check_qualified_name(List *names, core_yyscan_t yyscanner) { ListCell *i; foreach(i, names) { if (!IsA(lfirst(i), String)) parser_yyerror("syntax error"); } } /* check_func_name --- check the result of func_name production * * It's easiest to let the grammar production for func_name allow subscripts * and '*', which we then must reject here. */ static List * check_func_name(List *names, core_yyscan_t yyscanner) { ListCell *i; foreach(i, names) { if (!IsA(lfirst(i), String)) parser_yyerror("syntax error"); } return names; } /* check_indirection --- check the result of indirection production * * We only allow '*' at the end of the list, but it's hard to enforce that * in the grammar, so do it here. */ static List * check_indirection(List *indirection, core_yyscan_t yyscanner) { ListCell *l; foreach(l, indirection) { if (IsA(lfirst(l), A_Star)) { if (lnext(l) != NULL) parser_yyerror("improper use of \"*\""); } } return indirection; } /* extractArgTypes() * Given a list of FunctionParameter nodes, extract a list of just the * argument types (TypeNames) for input parameters only. This is what * is needed to look up an existing function, which is what is wanted by * the productions that use this call. */ static List * extractArgTypes(List *parameters) { List *result = NIL; ListCell *i; foreach(i, parameters) { FunctionParameter *p = (FunctionParameter *) lfirst(i); if (p->mode != FUNC_PARAM_OUT && p->mode != FUNC_PARAM_TABLE) result = lappend(result, p->argType); } return result; } /* extractAggrArgTypes() * As above, but work from the output of the aggr_args production. */ static List * extractAggrArgTypes(List *aggrargs) { Assert(list_length(aggrargs) == 2); return extractArgTypes((List *) linitial(aggrargs)); } /* makeOrderedSetArgs() * Build the result of the aggr_args production (which see the comments for). * This handles only the case where both given lists are nonempty, so that * we have to deal with multiple VARIADIC arguments. */ static List * makeOrderedSetArgs(List *directargs, List *orderedargs, core_yyscan_t yyscanner) { FunctionParameter *lastd = (FunctionParameter *) llast(directargs); int ndirectargs; /* No restriction unless last direct arg is VARIADIC */ if (lastd->mode == FUNC_PARAM_VARIADIC) { FunctionParameter *firsto = (FunctionParameter *) linitial(orderedargs); /* * We ignore the names, though the aggr_arg production allows them; * it doesn't allow default values, so those need not be checked. */ if (list_length(orderedargs) != 1 || firsto->mode != FUNC_PARAM_VARIADIC) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("an ordered-set aggregate with a VARIADIC direct argument must have one VARIADIC aggregated argument of the same data type"), parser_errposition(exprLocation((Node *) firsto)))); /* OK, drop the duplicate VARIADIC argument from the internal form */ orderedargs = NIL; } /* don't merge into the next line, as list_concat changes directargs */ ndirectargs = list_length(directargs); return list_make2(list_concat(directargs, orderedargs), makeInteger(ndirectargs)); } /* insertSelectOptions() * Insert ORDER BY, etc into an already-constructed SelectStmt. * * This routine is just to avoid duplicating code in SelectStmt productions. */ static void insertSelectOptions(SelectStmt *stmt, List *sortClause, List *lockingClause, Node *limitOffset, Node *limitCount, WithClause *withClause, core_yyscan_t yyscanner) { Assert(IsA(stmt, SelectStmt)); /* * Tests here are to reject constructs like * (SELECT foo ORDER BY bar) ORDER BY baz */ if (sortClause) { if (stmt->sortClause) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("multiple ORDER BY clauses not allowed"), parser_errposition(exprLocation((Node *) sortClause)))); stmt->sortClause = sortClause; } /* We can handle multiple locking clauses, though */ stmt->lockingClause = list_concat(stmt->lockingClause, lockingClause); if (limitOffset) { if (stmt->limitOffset) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("multiple OFFSET clauses not allowed"), parser_errposition(exprLocation(limitOffset)))); stmt->limitOffset = limitOffset; } if (limitCount) { if (stmt->limitCount) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("multiple LIMIT clauses not allowed"), parser_errposition(exprLocation(limitCount)))); stmt->limitCount = limitCount; } if (withClause) { if (stmt->withClause) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("multiple WITH clauses not allowed"), parser_errposition(exprLocation((Node *) withClause)))); stmt->withClause = withClause; } } static Node * makeSetOp(SetOperation op, bool all, Node *larg, Node *rarg) { SelectStmt *n = makeNode(SelectStmt); n->op = op; n->all = all; n->larg = (SelectStmt *) larg; n->rarg = (SelectStmt *) rarg; return (Node *) n; } /* SystemFuncName() * Build a properly-qualified reference to a built-in function. */ List * SystemFuncName(char *name) { return list_make2(makeString("pg_catalog"), makeString(name)); } /* SystemTypeName() * Build a properly-qualified reference to a built-in type. * * typmod is defaulted, but may be changed afterwards by caller. * Likewise for the location. */ TypeName * SystemTypeName(char *name) { return makeTypeNameFromNameList(list_make2(makeString("pg_catalog"), makeString(name))); } /* doNegate() * Handle negation of a numeric constant. * * Formerly, we did this here because the optimizer couldn't cope with * indexquals that looked like "var = -4" --- it wants "var = const" * and a unary minus operator applied to a constant didn't qualify. * As of Postgres 7.0, that problem doesn't exist anymore because there * is a constant-subexpression simplifier in the optimizer. However, * there's still a good reason for doing this here, which is that we can * postpone committing to a particular internal representation for simple * negative constants. It's better to leave "-123.456" in string form * until we know what the desired type is. */ static Node * doNegate(Node *n, int location) { if (IsA(n, A_Const)) { A_Const *con = (A_Const *)n; /* report the constant's location as that of the '-' sign */ con->location = location; if (con->val.type == T_Integer) { con->val.val.ival = -con->val.val.ival; return n; } if (con->val.type == T_Float) { doNegateFloat(&con->val); return n; } } return (Node *) makeSimpleA_Expr(AEXPR_OP, "-", NULL, n, location); } static void doNegateFloat(Value *v) { char *oldval = v->val.str; Assert(IsA(v, Float)); if (*oldval == '+') oldval++; if (*oldval == '-') v->val.str = oldval+1; /* just strip the '-' */ else v->val.str = psprintf("-%s", oldval); } static Node * makeAArrayExpr(List *elements, int location) { A_ArrayExpr *n = makeNode(A_ArrayExpr); n->elements = elements; n->location = location; return (Node *) n; } static Node * makeXmlExpr(XmlExprOp op, char *name, List *named_args, List *args, int location) { XmlExpr *x = makeNode(XmlExpr); x->op = op; x->name = name; /* * named_args is a list of ResTarget; it'll be split apart into separate * expression and name lists in transformXmlExpr(). */ x->named_args = named_args; x->arg_names = NIL; x->args = args; /* xmloption, if relevant, must be filled in by caller */ /* type and typmod will be filled in during parse analysis */ x->type = InvalidOid; /* marks the node as not analyzed */ x->location = location; return (Node *) x; } /* * Merge the input and output parameters of a table function. */ static List * mergeTableFuncParameters(List *func_args, List *columns) { ListCell *lc; /* Explicit OUT and INOUT parameters shouldn't be used in this syntax */ foreach(lc, func_args) { FunctionParameter *p = (FunctionParameter *) lfirst(lc); if (p->mode != FUNC_PARAM_IN && p->mode != FUNC_PARAM_VARIADIC) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("OUT and INOUT arguments aren't allowed in TABLE functions"))); } return list_concat(func_args, columns); } /* * Determine return type of a TABLE function. A single result column * returns setof that column's type; otherwise return setof record. */ static TypeName * TableFuncTypeName(List *columns) { TypeName *result; if (list_length(columns) == 1) { FunctionParameter *p = (FunctionParameter *) linitial(columns); result = (TypeName *) copyObject(p->argType); } else result = SystemTypeName("record"); result->setof = true; return result; } /* * Convert a list of (dotted) names to a RangeVar (like * makeRangeVarFromNameList, but with position support). The * "AnyName" refers to the any_name production in the grammar. */ static RangeVar * makeRangeVarFromAnyName(List *names, int position, core_yyscan_t yyscanner) { RangeVar *r = makeNode(RangeVar); switch (list_length(names)) { case 1: r->catalogname = NULL; r->schemaname = NULL; r->relname = strVal(linitial(names)); break; case 2: r->catalogname = NULL; r->schemaname = strVal(linitial(names)); r->relname = strVal(lsecond(names)); break; case 3: r->catalogname = strVal(linitial(names));; r->schemaname = strVal(lsecond(names)); r->relname = strVal(lthird(names)); break; default: ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("improper qualified name (too many dotted names): %s", NameListToString(names)), parser_errposition(position))); break; } r->relpersistence = RELPERSISTENCE_PERMANENT; r->location = position; return r; } /* Separate Constraint nodes from COLLATE clauses in a ColQualList */ static void SplitColQualList(List *qualList, List **constraintList, CollateClause **collClause, core_yyscan_t yyscanner) { ListCell *cell; ListCell *prev; ListCell *next; *collClause = NULL; prev = NULL; for (cell = list_head(qualList); cell; cell = next) { Node *n = (Node *) lfirst(cell); next = lnext(cell); if (IsA(n, Constraint)) { /* keep it in list */ prev = cell; continue; } if (IsA(n, CollateClause)) { CollateClause *c = (CollateClause *) n; if (*collClause) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("multiple COLLATE clauses not allowed"), parser_errposition(c->location))); *collClause = c; } else elog(ERROR, "unexpected node type %d", (int) n->type); /* remove non-Constraint nodes from qualList */ qualList = list_delete_cell(qualList, cell, prev); } *constraintList = qualList; } /* * Process result of ConstraintAttributeSpec, and set appropriate bool flags * in the output command node. Pass NULL for any flags the particular * command doesn't support. */ static void processCASbits(int cas_bits, int location, const char *constrType, bool *deferrable, bool *initdeferred, bool *not_valid, bool *no_inherit, core_yyscan_t yyscanner) { /* defaults */ if (deferrable) *deferrable = false; if (initdeferred) *initdeferred = false; if (not_valid) *not_valid = false; if (cas_bits & (CAS_DEFERRABLE | CAS_INITIALLY_DEFERRED)) { if (deferrable) *deferrable = true; else ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), /* translator: %s is CHECK, UNIQUE, or similar */ errmsg("%s constraints cannot be marked DEFERRABLE", constrType), parser_errposition(location))); } if (cas_bits & CAS_INITIALLY_DEFERRED) { if (initdeferred) *initdeferred = true; else ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), /* translator: %s is CHECK, UNIQUE, or similar */ errmsg("%s constraints cannot be marked DEFERRABLE", constrType), parser_errposition(location))); } if (cas_bits & CAS_NOT_VALID) { if (not_valid) *not_valid = true; else ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), /* translator: %s is CHECK, UNIQUE, or similar */ errmsg("%s constraints cannot be marked NOT VALID", constrType), parser_errposition(location))); } if (cas_bits & CAS_NO_INHERIT) { if (no_inherit) *no_inherit = true; else ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), /* translator: %s is CHECK, UNIQUE, or similar */ errmsg("%s constraints cannot be marked NO INHERIT", constrType), parser_errposition(location))); } } /*---------- * Recursive view transformation * * Convert * * CREATE RECURSIVE VIEW relname (aliases) AS query * * to * * CREATE VIEW relname (aliases) AS * WITH RECURSIVE relname (aliases) AS (query) * SELECT aliases FROM relname * * Actually, just the WITH ... part, which is then inserted into the original * view definition as the query. * ---------- */ static Node * makeRecursiveViewSelect(char *relname, List *aliases, Node *query) { SelectStmt *s = makeNode(SelectStmt); WithClause *w = makeNode(WithClause); CommonTableExpr *cte = makeNode(CommonTableExpr); List *tl = NIL; ListCell *lc; /* create common table expression */ cte->ctename = relname; cte->aliascolnames = aliases; cte->ctequery = query; cte->location = -1; /* create WITH clause and attach CTE */ w->recursive = true; w->ctes = list_make1(cte); w->location = -1; /* create target list for the new SELECT from the alias list of the * recursive view specification */ foreach (lc, aliases) { ResTarget *rt = makeNode(ResTarget); rt->name = NULL; rt->indirection = NIL; rt->val = makeColumnRef(strVal(lfirst(lc)), NIL, -1, 0); rt->location = -1; tl = lappend(tl, rt); } /* create new SELECT combining WITH clause, target list, and fake FROM * clause */ s->withClause = w; s->targetList = tl; s->fromClause = list_make1(makeRangeVar(NULL, relname, -1)); return (Node *) s; } /* parser_init() * Initialize to parse one query string */ void parser_init(base_yy_extra_type *yyext) { yyext->parsetree = NIL; /* in case grammar forgets to set it */ } /* * Create a DefElem setting "oids" to the specified value. */ static DefElem * defWithOids(bool value) { DefElem *f = makeNode(DefElem); f->defname = "oids"; f->arg = (Node *) makeInteger(value); return f; } /* * Must undefine this stuff before including scan.c, since it has different * definitions for these macros. */ #undef yyerror #undef yylval #undef yylloc #include "scan.c" pgpool-II-3.4.3/src/parser/makefuncs.c0000664000076400007640000002777112554350605014501 00000000000000/*------------------------------------------------------------------------- * * makefuncs.c * creator functions for primitive nodes. The functions here are for * the most frequently created nodes. * * Portions Copyright (c) 2003-2014, PgPool Global Development Group * Portions Copyright (c) 1996-2014, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION * src/backend/nodes/makefuncs.c * *------------------------------------------------------------------------- */ #include "pool_parser.h" #include "makefuncs.h" #include "utils/palloc.h" #include "pg_class.h" #include #include #define BOOLOID 16 /* XXX */ /* * makeA_Expr - * makes an A_Expr node */ A_Expr * makeA_Expr(A_Expr_Kind kind, List *name, Node *lexpr, Node *rexpr, int location) { A_Expr *a = makeNode(A_Expr); a->kind = kind; a->name = name; a->lexpr = lexpr; a->rexpr = rexpr; a->location = location; return a; } /* * makeSimpleA_Expr - * As above, given a simple (unqualified) operator name */ A_Expr * makeSimpleA_Expr(A_Expr_Kind kind, char *name, Node *lexpr, Node *rexpr, int location) { A_Expr *a = makeNode(A_Expr); a->kind = kind; a->name = list_make1(makeString((char *) name)); a->lexpr = lexpr; a->rexpr = rexpr; a->location = location; return a; } /* * makeVar - * creates a Var node */ Var * makeVar(Index varno, AttrNumber varattno, Oid vartype, int32 vartypmod, Oid varcollid, Index varlevelsup) { Var *var = makeNode(Var); var->varno = varno; var->varattno = varattno; var->vartype = vartype; var->vartypmod = vartypmod; var->varcollid = varcollid; var->varlevelsup = varlevelsup; /* * Since few if any routines ever create Var nodes with varnoold/varoattno * different from varno/varattno, we don't provide separate arguments for * them, but just initialize them to the given varno/varattno. This * reduces code clutter and chance of error for most callers. */ var->varnoold = varno; var->varoattno = varattno; /* Likewise, we just set location to "unknown" here */ var->location = -1; return var; } #if 0 /* * makeVarFromTargetEntry - * convenience function to create a same-level Var node from a * TargetEntry */ Var * makeVarFromTargetEntry(Index varno, TargetEntry *tle) { return makeVar(varno, tle->resno, exprType((Node *) tle->expr), exprTypmod((Node *) tle->expr), exprCollation((Node *) tle->expr), 0); } /* * makeWholeRowVar - * creates a Var node representing a whole row of the specified RTE * * A whole-row reference is a Var with varno set to the correct range * table entry, and varattno == 0 to signal that it references the whole * tuple. (Use of zero here is unclean, since it could easily be confused * with error cases, but it's not worth changing now.) The vartype indicates * a rowtype; either a named composite type, or RECORD. This function * encapsulates the logic for determining the correct rowtype OID to use. * * If allowScalar is true, then for the case where the RTE is a single function * returning a non-composite result type, we produce a normal Var referencing * the function's result directly, instead of the single-column composite * value that the whole-row notation might otherwise suggest. */ Var * makeWholeRowVar(RangeTblEntry *rte, Index varno, Index varlevelsup, bool allowScalar) { Var *result; Oid toid; Node *fexpr; switch (rte->rtekind) { case RTE_RELATION: /* relation: the rowtype is a named composite type */ toid = get_rel_type_id(rte->relid); if (!OidIsValid(toid)) elog(ERROR, "could not find type OID for relation %u", rte->relid); result = makeVar(varno, InvalidAttrNumber, toid, -1, InvalidOid, varlevelsup); break; case RTE_FUNCTION: /* * If there's more than one function, or ordinality is requested, * force a RECORD result, since there's certainly more than one * column involved and it can't be a known named type. */ if (rte->funcordinality || list_length(rte->functions) != 1) { /* always produces an anonymous RECORD result */ result = makeVar(varno, InvalidAttrNumber, RECORDOID, -1, InvalidOid, varlevelsup); break; } fexpr = ((RangeTblFunction *) linitial(rte->functions))->funcexpr; toid = exprType(fexpr); if (type_is_rowtype(toid)) { /* func returns composite; same as relation case */ result = makeVar(varno, InvalidAttrNumber, toid, -1, InvalidOid, varlevelsup); } else if (allowScalar) { /* func returns scalar; just return its output as-is */ result = makeVar(varno, 1, toid, -1, exprCollation(fexpr), varlevelsup); } else { /* func returns scalar, but we want a composite result */ result = makeVar(varno, InvalidAttrNumber, RECORDOID, -1, InvalidOid, varlevelsup); } break; default: /* * RTE is a join, subselect, or VALUES. We represent this as a * whole-row Var of RECORD type. (Note that in most cases the Var * will be expanded to a RowExpr during planning, but that is not * our concern here.) */ result = makeVar(varno, InvalidAttrNumber, RECORDOID, -1, InvalidOid, varlevelsup); break; } return result; } #endif /* * makeTargetEntry - * creates a TargetEntry node */ TargetEntry * makeTargetEntry(Expr *expr, AttrNumber resno, char *resname, bool resjunk) { TargetEntry *tle = makeNode(TargetEntry); tle->expr = expr; tle->resno = resno; tle->resname = resname; /* * We always set these fields to 0. If the caller wants to change them he * must do so explicitly. Few callers do that, so omitting these * arguments reduces the chance of error. */ tle->ressortgroupref = 0; tle->resorigtbl = InvalidOid; tle->resorigcol = 0; tle->resjunk = resjunk; return tle; } /* * flatCopyTargetEntry - * duplicate a TargetEntry, but don't copy substructure * * This is commonly used when we just want to modify the resno or substitute * a new expression. */ TargetEntry * flatCopyTargetEntry(TargetEntry *src_tle) { TargetEntry *tle = makeNode(TargetEntry); Assert(IsA(src_tle, TargetEntry)); memcpy(tle, src_tle, sizeof(TargetEntry)); return tle; } /* * makeFromExpr - * creates a FromExpr node */ FromExpr * makeFromExpr(List *fromlist, Node *quals) { FromExpr *f = makeNode(FromExpr); f->fromlist = fromlist; f->quals = quals; return f; } /* * makeConst - * creates a Const node */ Const * makeConst(Oid consttype, int32 consttypmod, Oid constcollid, int constlen, Datum constvalue, bool constisnull, bool constbyval) { Const *cnst = makeNode(Const); cnst->consttype = consttype; cnst->consttypmod = consttypmod; cnst->constcollid = constcollid; cnst->constlen = constlen; cnst->constvalue = constvalue; cnst->constisnull = constisnull; cnst->constbyval = constbyval; cnst->location = -1; /* "unknown" */ return cnst; } #if 0 /* * makeNullConst - * creates a Const node representing a NULL of the specified type/typmod * * This is a convenience routine that just saves a lookup of the type's * storage properties. */ Const * makeNullConst(Oid consttype, int32 consttypmod, Oid constcollid) { int16 typLen; bool typByVal; get_typlenbyval(consttype, &typLen, &typByVal); return makeConst(consttype, consttypmod, constcollid, (int) typLen, (Datum) 0, true, typByVal); } /* * makeBoolConst - * creates a Const node representing a boolean value (can be NULL too) */ Node * makeBoolConst(bool value, bool isnull) { /* note that pg_type.h hardwires size of bool as 1 ... duplicate it */ return (Node *) makeConst(BOOLOID, -1, InvalidOid, 1, BoolGetDatum(value), isnull, true); } #endif /* * makeBoolExpr - * creates a BoolExpr node */ Expr * makeBoolExpr(BoolExprType boolop, List *args, int location) { BoolExpr *b = makeNode(BoolExpr); b->boolop = boolop; b->args = args; b->location = location; return (Expr *) b; } /* * makeAlias - * creates an Alias node * * NOTE: the given name is copied, but the colnames list (if any) isn't. */ Alias * makeAlias(const char *aliasname, List *colnames) { Alias *a = makeNode(Alias); a->aliasname = pstrdup(aliasname); a->colnames = colnames; return a; } /* * makeRelabelType - * creates a RelabelType node */ RelabelType * makeRelabelType(Expr *arg, Oid rtype, int32 rtypmod, Oid rcollid, CoercionForm rformat) { RelabelType *r = makeNode(RelabelType); r->arg = arg; r->resulttype = rtype; r->resulttypmod = rtypmod; r->resultcollid = rcollid; r->relabelformat = rformat; r->location = -1; return r; } /* * makeRangeVar - * creates a RangeVar node (rather oversimplified case) */ RangeVar * makeRangeVar(char *schemaname, char *relname, int location) { RangeVar *r = makeNode(RangeVar); r->catalogname = NULL; r->schemaname = schemaname; r->relname = relname; r->inhOpt = INH_DEFAULT; r->relpersistence = RELPERSISTENCE_PERMANENT; r->alias = NULL; r->location = location; return r; } /* * makeTypeName - * build a TypeName node for an unqualified name. * * typmod is defaulted, but can be changed later by caller. */ TypeName * makeTypeName(char *typnam) { return makeTypeNameFromNameList(list_make1(makeString(typnam))); } /* * makeTypeNameFromNameList - * build a TypeName node for a String list representing a qualified name. * * typmod is defaulted, but can be changed later by caller. */ TypeName * makeTypeNameFromNameList(List *names) { TypeName *n = makeNode(TypeName); n->names = names; n->typmods = NIL; n->typemod = -1; n->location = -1; return n; } /* * makeTypeNameFromOid - * build a TypeName node to represent a type already known by OID/typmod. */ TypeName * makeTypeNameFromOid(Oid typeOid, int32 typmod) { TypeName *n = makeNode(TypeName); n->typeOid = typeOid; n->typemod = typmod; n->location = -1; return n; } /* * makeFuncExpr - * build an expression tree representing a function call. * * The argument expressions must have been transformed already. */ FuncExpr * makeFuncExpr(Oid funcid, Oid rettype, List *args, Oid funccollid, Oid inputcollid, CoercionForm fformat) { FuncExpr *funcexpr; funcexpr = makeNode(FuncExpr); funcexpr->funcid = funcid; funcexpr->funcresulttype = rettype; funcexpr->funcretset = false; /* only allowed case here */ funcexpr->funcvariadic = false; /* only allowed case here */ funcexpr->funcformat = fformat; funcexpr->funccollid = funccollid; funcexpr->inputcollid = inputcollid; funcexpr->args = args; funcexpr->location = -1; return funcexpr; } /* * makeDefElem - * build a DefElem node * * This is sufficient for the "typical" case with an unqualified option name * and no special action. */ DefElem * makeDefElem(char *name, Node *arg) { DefElem *res = makeNode(DefElem); res->defnamespace = NULL; res->defname = name; res->arg = arg; res->defaction = DEFELEM_UNSPEC; return res; } /* * makeDefElemExtended - * build a DefElem node with all fields available to be specified */ DefElem * makeDefElemExtended(char *nameSpace, char *name, Node *arg, DefElemAction defaction) { DefElem *res = makeNode(DefElem); res->defnamespace = nameSpace; res->defname = name; res->arg = arg; res->defaction = defaction; return res; } /* * makeFuncCall - * * Initialize a FuncCall struct with the information every caller must * supply. Any non-default parameters have to be inserted by the caller. */ FuncCall * makeFuncCall(List *name, List *args, int location) { FuncCall *n = makeNode(FuncCall); n->funcname = name; n->args = args; n->agg_order = NIL; n->agg_filter = NULL; n->agg_within_group = false; n->agg_star = false; n->agg_distinct = false; n->func_variadic = false; n->over = NULL; n->location = location; return n; } pgpool-II-3.4.3/src/parser/gram.y0000664000076400007640000134015212554350605013471 00000000000000%{ /*#define YYDEBUG 1*/ /*------------------------------------------------------------------------- * * gram.y * POSTGRESQL BISON rules/actions * * Portions Copyright (c) 2003-2014, PgPool Global Development Group * Portions Copyright (c) 1996-2014, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION * src/backend/parser/gram.y * * HISTORY * AUTHOR DATE MAJOR EVENT * Andrew Yu Sept, 1994 POSTQUEL to SQL conversion * Andrew Yu Oct, 1994 lispy code conversion * * NOTES * CAPITALS are used to represent terminal symbols. * non-capitals are used to represent non-terminals. * * In general, nothing in this file should initiate database accesses * nor depend on changeable state (such as SET variables). If you do * database accesses, your code will fail when we have aborted the * current transaction and are just parsing commands to find the next * ROLLBACK or COMMIT. If you make use of SET variables, then you * will do the wrong thing in multi-query strings like this: * SET SQL_inheritance TO off; SELECT * FROM foo; * because the entire string is parsed by gram.y before the SET gets * executed. Anything that depends on the database or changeable state * should be handled during parse analysis so that it happens at the * right time not the wrong time. The handling of SQL_inheritance is * a good example. * * WARNINGS * If you use a list, make sure the datum is a node so that the printing * routines work. * * Sometimes we assign constants to makeStrings. Make sure we don't free * those. * *------------------------------------------------------------------------- */ #include "pool_parser.h" #include "utils/elog.h" #include "utils/palloc.h" #include #include #include #include #include #include "nodes.h" #include "keywords.h" #include "gramparse.h" #include "makefuncs.h" #include "pool_string.h" #include "parser.h" #include "pg_class.h" #include "pg_trigger.h" /* * Definition taken from * postgreSQL source code file: src/include/commands/trigger.h */ #define TRIGGER_FIRES_ON_ORIGIN 'O' #define TRIGGER_FIRES_ALWAYS 'A' #define TRIGGER_FIRES_ON_REPLICA 'R' #define TRIGGER_DISABLED 'D' /* * Definition taken from * postgreSQL source code file: src/include/catalog/pg_class.h */ #define REPLICA_IDENTITY_DEFAULT 'd' #define REPLICA_IDENTITY_NOTHING 'n' #define REPLICA_IDENTITY_FULL 'f' #define REPLICA_IDENTITY_INDEX 'i' /* * Definition taken from * postgreSQL source code file: src/include/utils/xml.h */ typedef enum { XML_STANDALONE_YES, XML_STANDALONE_NO, XML_STANDALONE_NO_VALUE, XML_STANDALONE_OMITTED } XmlStandaloneType; static DefElem *defWithOids(bool value); /* * Location tracking support --- simpler than bison's default, since we only * want to track the start position not the end position of each nonterminal. */ #define YYLLOC_DEFAULT(Current, Rhs, N) \ do { \ if ((N) > 0) \ (Current) = (Rhs)[1]; \ else \ (Current) = (-1); \ } while (0) /* * The above macro assigns -1 (unknown) as the parse location of any * nonterminal that was reduced from an empty rule. This is problematic * for nonterminals defined like * OptFooList: / * EMPTY * / { ... } | OptFooList Foo { ... } ; * because we'll set -1 as the location during the first reduction and then * copy it during each subsequent reduction, leaving us with -1 for the * location even when the list is not empty. To fix that, do this in the * action for the nonempty rule(s): * if (@$ < 0) @$ = @2; * (Although we have many nonterminals that follow this pattern, we only * bother with fixing @$ like this when the nonterminal's parse location * is actually referenced in some rule.) */ /* * Bison doesn't allocate anything that needs to live across parser calls, * so we can easily have it use palloc instead of malloc. This prevents * memory leaks if we error out during parsing. Note this only works with * bison >= 2.0. However, in bison 1.875 the default is to use alloca() * if possible, so there's not really much problem anyhow, at least if * you're building with gcc. */ #define YYMALLOC palloc #define YYFREE pfree /* Private struct for the result of privilege_target production */ typedef struct PrivTarget { GrantTargetType targtype; GrantObjectType objtype; List *objs; } PrivTarget; /* ConstraintAttributeSpec yields an integer bitmask of these flags: */ #define CAS_NOT_DEFERRABLE 0x01 #define CAS_DEFERRABLE 0x02 #define CAS_INITIALLY_IMMEDIATE 0x04 #define CAS_INITIALLY_DEFERRED 0x08 #define CAS_NOT_VALID 0x10 #define CAS_NO_INHERIT 0x20 #define parser_yyerror(msg) scanner_yyerror(msg, yyscanner) #define parser_errposition(pos) scanner_errposition(pos, yyscanner) static void base_yyerror(YYLTYPE *yylloc, core_yyscan_t yyscanner, const char *msg); static Node *makeColumnRef(char *colname, List *indirection, int location, core_yyscan_t yyscanner); static Node *makeTypeCast(Node *arg, TypeName *typename, int location); static Node *makeStringConst(char *str, int location); static Node *makeStringConstCast(char *str, int location, TypeName *typename); static Node *makeIntConst(int val, int location); static Node *makeFloatConst(char *str, int location); static Node *makeBitStringConst(char *str, int location); static Node *makeNullAConst(int location); static Node *makeAConst(Value *v, int location); static Node *makeBoolAConst(bool state, int location); static void check_qualified_name(List *names, core_yyscan_t yyscanner); static List *check_func_name(List *names, core_yyscan_t yyscanner); static List *check_indirection(List *indirection, core_yyscan_t yyscanner); static List *extractArgTypes(List *parameters); static List *extractAggrArgTypes(List *aggrargs); static List *makeOrderedSetArgs(List *directargs, List *orderedargs, core_yyscan_t yyscanner); static void insertSelectOptions(SelectStmt *stmt, List *sortClause, List *lockingClause, Node *limitOffset, Node *limitCount, WithClause *withClause, core_yyscan_t yyscanner); static Node *makeSetOp(SetOperation op, bool all, Node *larg, Node *rarg); static Node *doNegate(Node *n, int location); static void doNegateFloat(Value *v); static Node *makeAArrayExpr(List *elements, int location); static Node *makeXmlExpr(XmlExprOp op, char *name, List *named_args, List *args, int location); static List *mergeTableFuncParameters(List *func_args, List *columns); static TypeName *TableFuncTypeName(List *columns); static RangeVar *makeRangeVarFromAnyName(List *names, int position, core_yyscan_t yyscanner); static void SplitColQualList(List *qualList, List **constraintList, CollateClause **collClause, core_yyscan_t yyscanner); static void processCASbits(int cas_bits, int location, const char *constrType, bool *deferrable, bool *initdeferred, bool *not_valid, bool *no_inherit, core_yyscan_t yyscanner); static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query); %} %pure-parser %expect 0 %name-prefix="base_yy" %locations %parse-param {core_yyscan_t yyscanner} %lex-param {core_yyscan_t yyscanner} %union { core_YYSTYPE core_yystype; /* these fields must match core_YYSTYPE: */ int ival; char *str; const char *keyword; char chr; bool boolean; JoinType jtype; DropBehavior dbehavior; OnCommitAction oncommit; List *list; Node *node; Value *value; ObjectType objtype; TypeName *typnam; FunctionParameter *fun_param; FunctionParameterMode fun_param_mode; FuncWithArgs *funwithargs; DefElem *defelt; SortBy *sortby; WindowDef *windef; JoinExpr *jexpr; IndexElem *ielem; Alias *alias; RangeVar *range; IntoClause *into; WithClause *with; A_Indices *aind; ResTarget *target; struct PrivTarget *privtarget; AccessPriv *accesspriv; InsertStmt *istmt; VariableSetStmt *vsetstmt; } %type stmt schema_stmt AlterEventTrigStmt AlterDatabaseStmt AlterDatabaseSetStmt AlterDomainStmt AlterEnumStmt AlterFdwStmt AlterForeignServerStmt AlterGroupStmt AlterObjectSchemaStmt AlterOwnerStmt AlterSeqStmt AlterSystemStmt AlterTableStmt AlterTblSpcStmt AlterExtensionStmt AlterExtensionContentsStmt AlterForeignTableStmt AlterCompositeTypeStmt AlterUserStmt AlterUserMappingStmt AlterUserSetStmt AlterRoleStmt AlterRoleSetStmt AlterDefaultPrivilegesStmt DefACLAction AnalyzeStmt ClosePortalStmt ClusterStmt CommentStmt ConstraintsSetStmt CopyStmt CreateAsStmt CreateCastStmt CreateDomainStmt CreateExtensionStmt CreateGroupStmt CreateOpClassStmt CreateOpFamilyStmt AlterOpFamilyStmt CreatePLangStmt CreateSchemaStmt CreateSeqStmt CreateStmt CreateTableSpaceStmt CreateFdwStmt CreateForeignServerStmt CreateForeignTableStmt CreateAssertStmt CreateTrigStmt CreateEventTrigStmt CreateUserStmt CreateUserMappingStmt CreateRoleStmt CreatedbStmt DeclareCursorStmt DefineStmt DeleteStmt DiscardStmt DoStmt DropGroupStmt DropOpClassStmt DropOpFamilyStmt DropPLangStmt DropStmt DropAssertStmt DropTrigStmt DropRuleStmt DropCastStmt DropRoleStmt DropUserStmt DropdbStmt DropTableSpaceStmt DropFdwStmt DropForeignServerStmt DropUserMappingStmt ExplainStmt FetchStmt GrantStmt GrantRoleStmt IndexStmt InsertStmt ListenStmt LoadStmt LockStmt NotifyStmt ExplainableStmt PreparableStmt CreateFunctionStmt AlterFunctionStmt ReindexStmt RemoveAggrStmt RemoveFuncStmt RemoveOperStmt RenameStmt RevokeStmt RevokeRoleStmt RuleActionStmt RuleActionStmtOrEmpty RuleStmt SecLabelStmt SelectStmt TransactionStmt TruncateStmt UnlistenStmt UpdateStmt VacuumStmt VariableResetStmt VariableSetStmt VariableShowStmt ViewStmt CheckPointStmt CreateConversionStmt DeallocateStmt PrepareStmt ExecuteStmt DropOwnedStmt ReassignOwnedStmt AlterTSConfigurationStmt AlterTSDictionaryStmt CreateMatViewStmt RefreshMatViewStmt %type select_no_parens select_with_parens select_clause simple_select values_clause %type alter_column_default opclass_item opclass_drop alter_using %type add_drop opt_asc_desc opt_nulls_order %type alter_table_cmd alter_type_cmd opt_collate_clause replica_identity %type alter_table_cmds alter_type_cmds %type opt_drop_behavior %type createdb_opt_list alterdb_opt_list copy_opt_list transaction_mode_list create_extension_opt_list alter_extension_opt_list %type createdb_opt_item alterdb_opt_item copy_opt_item transaction_mode_item create_extension_opt_item alter_extension_opt_item %type opt_lock lock_type cast_context %type vacuum_option_list vacuum_option_elem %type opt_force opt_or_replace opt_grant_grant_option opt_grant_admin_option opt_nowait opt_if_exists opt_with_data %type OptRoleList AlterOptRoleList %type CreateOptRoleElem AlterOptRoleElem %type opt_type %type foreign_server_version opt_foreign_server_version %type auth_ident %type opt_in_database %type OptSchemaName %type OptSchemaEltList %type TriggerForSpec TriggerForType %type TriggerActionTime %type TriggerEvents TriggerOneEvent %type TriggerFuncArg %type TriggerWhen %type event_trigger_when_list event_trigger_value_list %type event_trigger_when_item %type enable_trigger %type copy_file_name database_name access_method_clause access_method attr_name name cursor_name file_name index_name opt_index_name cluster_index_specification %type func_name handler_name qual_Op qual_all_Op subquery_Op opt_class opt_inline_handler opt_validator validator_clause opt_collate %type qualified_name OptConstrFromTable %type all_Op MathOp %type iso_level opt_encoding %type grantee %type grantee_list %type privilege %type privileges privilege_list %type privilege_target %type function_with_argtypes %type function_with_argtypes_list %type defacl_privilege_target %type DefACLOption %type DefACLOptionList %type stmtblock stmtmulti OptTableElementList TableElementList OptInherit definition OptTypedTableElementList TypedTableElementList reloptions opt_reloptions OptWith opt_distinct opt_definition func_args func_args_list func_args_with_defaults func_args_with_defaults_list aggr_args aggr_args_list func_as createfunc_opt_list alterfunc_opt_list old_aggr_definition old_aggr_list oper_argtypes RuleActionList RuleActionMulti opt_column_list columnList opt_name_list sort_clause opt_sort_clause sortby_list index_params name_list role_list from_clause from_list opt_array_bounds qualified_name_list any_name any_name_list any_operator expr_list attrs target_list opt_target_list insert_column_list set_target_list set_clause_list set_clause multiple_set_clause ctext_expr_list ctext_row def_list indirection opt_indirection reloption_list group_clause TriggerFuncArgs select_limit opt_select_limit opclass_item_list opclass_drop_list opclass_purpose opt_opfamily transaction_mode_list_or_empty OptTableFuncElementList TableFuncElementList opt_type_modifiers prep_type_clause execute_param_clause using_clause returning_clause opt_enum_val_list enum_val_list table_func_column_list create_generic_options alter_generic_options relation_expr_list dostmt_opt_list %type opt_fdw_options fdw_options %type fdw_option %type OptTempTableName %type into_clause create_as_target create_mv_target %type createfunc_opt_item common_func_opt_item dostmt_opt_item %type func_arg func_arg_with_default table_func_column aggr_arg %type arg_class %type func_return func_type %type opt_trusted opt_restart_seqs %type OptTemp %type OptNoLog %type OnCommitOption %type for_locking_strength %type for_locking_item %type for_locking_clause opt_for_locking_clause for_locking_items %type locked_rels_list %type opt_all %type join_outer join_qual %type join_type %type extract_list overlay_list position_list %type substr_list trim_list %type opt_interval interval_second %type overlay_placing substr_from substr_for %type opt_instead %type opt_unique opt_concurrently opt_verbose opt_full %type opt_freeze opt_default opt_recheck %type opt_binary opt_oids copy_delimiter %type copy_from opt_program %type opt_column event cursor_options opt_hold opt_set_data %type reindex_type drop_type comment_type security_label_type %type fetch_args limit_clause select_limit_value offset_clause select_offset_value select_offset_value2 opt_select_fetch_first_value %type row_or_rows first_or_next %type OptSeqOptList SeqOptList %type SeqOptElem %type insert_rest %type generic_set set_rest set_rest_more SetResetClause FunctionSetResetClause %type TableElement TypedTableElement ConstraintElem TableFuncElement %type columnDef columnOptions %type def_elem reloption_elem old_aggr_elem %type def_arg columnElem where_clause where_or_current_clause a_expr b_expr c_expr AexprConst indirection_el columnref in_expr having_clause func_table array_expr ExclusionWhereClause %type rowsfrom_item rowsfrom_list opt_col_def_list %type opt_ordinality %type ExclusionConstraintList ExclusionConstraintElem %type func_arg_list %type func_arg_expr %type row type_list array_expr_list %type case_expr case_arg when_clause case_default %type when_clause_list %type sub_type %type ctext_expr %type NumericOnly %type NumericOnly_list %type alias_clause opt_alias_clause %type func_alias_clause %type sortby %type index_elem %type table_ref %type joined_table %type relation_expr %type relation_expr_opt_alias %type target_el single_set_clause set_target insert_column_item %type generic_option_name %type generic_option_arg %type generic_option_elem alter_generic_option_elem %type generic_option_list alter_generic_option_list %type explain_option_name %type explain_option_arg %type explain_option_elem %type explain_option_list %type copy_generic_opt_arg copy_generic_opt_arg_list_item %type copy_generic_opt_elem %type copy_generic_opt_list copy_generic_opt_arg_list %type copy_options %type Typename SimpleTypename ConstTypename GenericType Numeric opt_float Character ConstCharacter CharacterWithLength CharacterWithoutLength ConstDatetime ConstInterval Bit ConstBit BitWithLength BitWithoutLength %type character %type extract_arg %type opt_charset %type opt_varying opt_timezone opt_no_inherit %type Iconst SignedIconst %type Sconst comment_text notify_payload %type RoleId opt_granted_by opt_boolean_or_string %type var_list %type ColId ColLabel var_name type_function_name param_name %type NonReservedWord NonReservedWord_or_Sconst %type var_value zone_value %type unreserved_keyword type_func_name_keyword %type col_name_keyword reserved_keyword %type TableConstraint TableLikeClause %type TableLikeOptionList TableLikeOption %type ColQualList %type ColConstraint ColConstraintElem ConstraintAttr %type key_actions key_delete key_match key_update key_action %type ConstraintAttributeSpec ConstraintAttributeElem %type ExistingIndex %type constraints_set_list %type constraints_set_mode %type OptTableSpace OptConsTableSpace OptTableSpaceOwner %type opt_check_option %type opt_provider security_label %type xml_attribute_el %type xml_attribute_list xml_attributes %type xml_root_version opt_xml_root_standalone %type xmlexists_argument %type document_or_content %type xml_whitespace_option %type func_application func_expr_common_subexpr %type func_expr func_expr_windowless %type common_table_expr %type with_clause opt_with_clause %type cte_list %type within_group_clause %type filter_clause %type window_clause window_definition_list opt_partition_clause %type window_definition over_clause window_specification opt_frame_clause frame_extent frame_bound %type opt_existing_window_name %type opt_if_not_exists /* * Non-keyword token types. These are hard-wired into the "flex" lexer. * They must be listed first so that their numeric codes do not depend on * the set of keywords. PL/pgsql depends on this so that it can share the * same lexer. If you add/change tokens here, fix PL/pgsql to match! * * DOT_DOT is unused in the core SQL grammar, and so will always provoke * parse errors. It is needed by PL/pgsql. */ %token IDENT FCONST SCONST BCONST XCONST Op %token ICONST PARAM %token TYPECAST DOT_DOT COLON_EQUALS /* * If you want to make any keyword changes, update the keyword table in * src/include/parser/kwlist.h and add new keywords to the appropriate one * of the reserved-or-not-so-reserved keyword lists, below; search * this file for "Keyword category lists". */ /* ordinary key words in alphabetical order */ %token ABORT_P ABSOLUTE_P ACCESS ACTION ADD_P ADMIN AFTER AGGREGATE ALL ALSO ALTER ALWAYS ANALYSE ANALYZE AND ANY ARRAY AS ASC ASSERTION ASSIGNMENT ASYMMETRIC AT ATTRIBUTE AUTHORIZATION BACKWARD BEFORE BEGIN_P BETWEEN BIGINT BINARY BIT BOOLEAN_P BOTH BY CACHE CALLED CASCADE CASCADED CASE CAST CATALOG_P CHAIN CHAR_P CHARACTER CHARACTERISTICS CHECK CHECKPOINT CLASS CLOSE CLUSTER COALESCE COLLATE COLLATION COLUMN COMMENT COMMENTS COMMIT COMMITTED CONCURRENTLY CONFIGURATION CONNECTION CONSTRAINT CONSTRAINTS CONTENT_P CONTINUE_P CONVERSION_P COPY COST CREATE CROSS CSV CURRENT_P CURRENT_CATALOG CURRENT_DATE CURRENT_ROLE CURRENT_SCHEMA CURRENT_TIME CURRENT_TIMESTAMP CURRENT_USER CURSOR CYCLE DATA_P DATABASE DAY_P DEALLOCATE DEC DECIMAL_P DECLARE DEFAULT DEFAULTS DEFERRABLE DEFERRED DEFINER DELETE_P DELIMITER DELIMITERS DESC DICTIONARY DISABLE_P DISCARD DISTINCT DO DOCUMENT_P DOMAIN_P DOUBLE_P DROP EACH ELSE ENABLE_P ENCODING ENCRYPTED END_P ENUM_P ESCAPE EVENT EXCEPT EXCLUDE EXCLUDING EXCLUSIVE EXECUTE EXISTS EXPLAIN EXTENSION EXTERNAL EXTRACT FALSE_P FAMILY FETCH FILTER FIRST_P FLOAT_P FOLLOWING FOR FORCE FOREIGN FORWARD FREEZE FROM FULL FUNCTION FUNCTIONS GLOBAL GRANT GRANTED GREATEST GROUP_P HANDLER HAVING HEADER_P HOLD HOUR_P IDENTITY_P IF_P ILIKE IMMEDIATE IMMUTABLE IMPLICIT_P IN_P INCLUDING INCREMENT INDEX INDEXES INHERIT INHERITS INITIALLY INLINE_P INNER_P INOUT INPUT_P INSENSITIVE INSERT INSTEAD INT_P INTEGER INTERSECT INTERVAL INTO INVOKER IS ISNULL ISOLATION JOIN KEY LABEL LANGUAGE LARGE_P LAST_P LATERAL_P LC_COLLATE_P LC_CTYPE_P LEADING LEAKPROOF LEAST LEFT LEVEL LIKE LIMIT LISTEN LOAD LOCAL LOCALTIME LOCALTIMESTAMP LOCATION LOCK_P MAPPING MATCH MATERIALIZED MAXVALUE MINUTE_P MINVALUE MODE MONTH_P MOVE NAME_P NAMES NATIONAL NATURAL NCHAR NEXT NO NONE NOT NOTHING NOTIFY NOTNULL NOWAIT NULL_P NULLIF NULLS_P NUMERIC OBJECT_P OF OFF OFFSET OIDS ON ONLY OPERATOR OPTION OPTIONS OR ORDER ORDINALITY OUT_P OUTER_P OVER OVERLAPS OVERLAY OWNED OWNER PARSER PARTIAL PARTITION PASSING PASSWORD PLACING PLANS POSITION PRECEDING PRECISION PRESERVE PREPARE PREPARED PRIMARY PRIOR PRIVILEGES PROCEDURAL PROCEDURE PROGRAM QUOTE RANGE READ REAL REASSIGN RECHECK RECURSIVE REF REFERENCES REFRESH REINDEX RELATIVE_P RELEASE RENAME REPEATABLE REPLACE REPLICA RESET RESTART RESTRICT RETURNING RETURNS REVOKE RIGHT ROLE ROLLBACK ROW ROWS RULE SAVEPOINT SCHEMA SCROLL SEARCH SECOND_P SECURITY SELECT SEQUENCE SEQUENCES SERIALIZABLE SERVER SESSION SESSION_USER SET SETOF SHARE SHOW SIMILAR SIMPLE SMALLINT SNAPSHOT SOME STABLE STANDALONE_P START STATEMENT STATISTICS STDIN STDOUT STORAGE STRICT_P STRIP_P SUBSTRING SYMMETRIC SYSID SYSTEM_P TABLE TABLES TABLESPACE TEMP TEMPLATE TEMPORARY TEXT_P THEN TIME TIMESTAMP TO TRAILING TRANSACTION TREAT TRIGGER TRIM TRUE_P TRUNCATE TRUSTED TYPE_P TYPES_P UNBOUNDED UNCOMMITTED UNENCRYPTED UNION UNIQUE UNKNOWN UNLISTEN UNLOGGED UNTIL UPDATE USER USING VACUUM VALID VALIDATE VALIDATOR VALUE_P VALUES VARCHAR VARIADIC VARYING VERBOSE VERSION_P VIEW VIEWS VOLATILE WHEN WHERE WHITESPACE_P WINDOW WITH WITHIN WITHOUT WORK WRAPPER WRITE XML_P XMLATTRIBUTES XMLCONCAT XMLELEMENT XMLEXISTS XMLFOREST XMLPARSE XMLPI XMLROOT XMLSERIALIZE YEAR_P YES_P ZONE /* * The grammar thinks these are keywords, but they are not in the kwlist.h * list and so can never be entered directly. The filter in parser.c * creates these tokens when required. */ %token NULLS_FIRST NULLS_LAST WITH_ORDINALITY WITH_TIME /* Precedence: lowest to highest */ %nonassoc SET /* see relation_expr_opt_alias */ %left UNION EXCEPT %left INTERSECT %left OR %left AND %right NOT %right '=' %nonassoc '<' '>' %nonassoc LIKE ILIKE SIMILAR %nonassoc ESCAPE %nonassoc OVERLAPS %nonassoc BETWEEN %nonassoc IN_P %left POSTFIXOP /* dummy for postfix Op rules */ /* * To support target_el without AS, we must give IDENT an explicit priority * between POSTFIXOP and Op. We can safely assign the same priority to * various unreserved keywords as needed to resolve ambiguities (this can't * have any bad effects since obviously the keywords will still behave the * same as if they weren't keywords). We need to do this for PARTITION, * RANGE, ROWS to support opt_existing_window_name; and for RANGE, ROWS * so that they can follow a_expr without creating postfix-operator problems; * and for NULL so that it can follow b_expr in ColQualList without creating * postfix-operator problems. * * The frame_bound productions UNBOUNDED PRECEDING and UNBOUNDED FOLLOWING * are even messier: since UNBOUNDED is an unreserved keyword (per spec!), * there is no principled way to distinguish these from the productions * a_expr PRECEDING/FOLLOWING. We hack this up by giving UNBOUNDED slightly * lower precedence than PRECEDING and FOLLOWING. At present this doesn't * appear to cause UNBOUNDED to be treated differently from other unreserved * keywords anywhere else in the grammar, but it's definitely risky. We can * blame any funny behavior of UNBOUNDED on the SQL standard, though. */ %nonassoc UNBOUNDED /* ideally should have same precedence as IDENT */ %nonassoc IDENT NULL_P PARTITION RANGE ROWS PRECEDING FOLLOWING %left Op OPERATOR /* multi-character ops and user-defined operators */ %nonassoc NOTNULL %nonassoc ISNULL %nonassoc IS /* sets precedence for IS NULL, etc */ %left '+' '-' %left '*' '/' '%' %left '^' /* Unary Operators */ %left AT /* sets precedence for AT TIME ZONE */ %left COLLATE %right UMINUS %left '[' ']' %left '(' ')' %left TYPECAST %left '.' /* * These might seem to be low-precedence, but actually they are not part * of the arithmetic hierarchy at all in their use as JOIN operators. * We make them high-precedence to support their use as function names. * They wouldn't be given a precedence at all, were it not that we need * left-associativity among the JOIN rules themselves. */ %left JOIN CROSS LEFT FULL RIGHT INNER_P NATURAL /* kluge to keep xml_whitespace_option from causing shift/reduce conflicts */ %right PRESERVE STRIP_P %% /* * The target production for the whole parse. */ stmtblock: stmtmulti { pg_yyget_extra(yyscanner)->parsetree = $1; } ; /* the thrashing around here is to discard "empty" statements... */ stmtmulti: stmtmulti ';' stmt { if ($3 != NULL) $$ = lappend($1, $3); else $$ = $1; } | stmt { if ($1 != NULL) $$ = list_make1($1); else $$ = NIL; } ; stmt : AlterEventTrigStmt | AlterDatabaseStmt | AlterDatabaseSetStmt | AlterDefaultPrivilegesStmt | AlterDomainStmt | AlterEnumStmt | AlterExtensionStmt | AlterExtensionContentsStmt | AlterFdwStmt | AlterForeignServerStmt | AlterForeignTableStmt | AlterFunctionStmt | AlterGroupStmt | AlterObjectSchemaStmt | AlterOwnerStmt | AlterSeqStmt | AlterSystemStmt | AlterTableStmt | AlterTblSpcStmt | AlterCompositeTypeStmt | AlterRoleSetStmt | AlterRoleStmt | AlterTSConfigurationStmt | AlterTSDictionaryStmt | AlterUserMappingStmt | AlterUserSetStmt | AlterUserStmt | AnalyzeStmt | CheckPointStmt | ClosePortalStmt | ClusterStmt | CommentStmt | ConstraintsSetStmt | CopyStmt | CreateAsStmt | CreateAssertStmt | CreateCastStmt | CreateConversionStmt | CreateDomainStmt | CreateExtensionStmt | CreateFdwStmt | CreateForeignServerStmt | CreateForeignTableStmt | CreateFunctionStmt | CreateGroupStmt | CreateMatViewStmt | CreateOpClassStmt | CreateOpFamilyStmt | AlterOpFamilyStmt | CreatePLangStmt | CreateSchemaStmt | CreateSeqStmt | CreateStmt | CreateTableSpaceStmt | CreateTrigStmt | CreateEventTrigStmt | CreateRoleStmt | CreateUserStmt | CreateUserMappingStmt | CreatedbStmt | DeallocateStmt | DeclareCursorStmt | DefineStmt | DeleteStmt | DiscardStmt | DoStmt | DropAssertStmt | DropCastStmt | DropFdwStmt | DropForeignServerStmt | DropGroupStmt | DropOpClassStmt | DropOpFamilyStmt | DropOwnedStmt | DropPLangStmt | DropRuleStmt | DropStmt | DropTableSpaceStmt | DropTrigStmt | DropRoleStmt | DropUserStmt | DropUserMappingStmt | DropdbStmt | ExecuteStmt | ExplainStmt | FetchStmt | GrantStmt | GrantRoleStmt | IndexStmt | InsertStmt | ListenStmt | RefreshMatViewStmt | LoadStmt | LockStmt | NotifyStmt | PrepareStmt | ReassignOwnedStmt | ReindexStmt | RemoveAggrStmt | RemoveFuncStmt | RemoveOperStmt | RenameStmt | RevokeStmt | RevokeRoleStmt | RuleStmt | SecLabelStmt | SelectStmt | TransactionStmt | TruncateStmt | UnlistenStmt | UpdateStmt | VacuumStmt | VariableResetStmt | VariableSetStmt | VariableShowStmt | ViewStmt | /*EMPTY*/ { $$ = NULL; } ; /***************************************************************************** * * Create a new Postgres DBMS role * *****************************************************************************/ CreateRoleStmt: CREATE ROLE RoleId opt_with OptRoleList { CreateRoleStmt *n = makeNode(CreateRoleStmt); n->stmt_type = ROLESTMT_ROLE; n->role = $3; n->options = $5; $$ = (Node *)n; } ; opt_with: WITH {} | /*EMPTY*/ {} ; /* * Options for CREATE ROLE and ALTER ROLE (also used by CREATE/ALTER USER * for backwards compatibility). Note: the only option required by SQL99 * is "WITH ADMIN name". */ OptRoleList: OptRoleList CreateOptRoleElem { $$ = lappend($1, $2); } | /* EMPTY */ { $$ = NIL; } ; AlterOptRoleList: AlterOptRoleList AlterOptRoleElem { $$ = lappend($1, $2); } | /* EMPTY */ { $$ = NIL; } ; AlterOptRoleElem: PASSWORD Sconst { $$ = makeDefElem("password", (Node *)makeString($2)); } | PASSWORD NULL_P { $$ = makeDefElem("password", NULL); } | ENCRYPTED PASSWORD Sconst { $$ = makeDefElem("encryptedPassword", (Node *)makeString($3)); } | UNENCRYPTED PASSWORD Sconst { $$ = makeDefElem("unencryptedPassword", (Node *)makeString($3)); } | INHERIT { $$ = makeDefElem("inherit", (Node *)makeInteger(TRUE)); } | CONNECTION LIMIT SignedIconst { $$ = makeDefElem("connectionlimit", (Node *)makeInteger($3)); } | VALID UNTIL Sconst { $$ = makeDefElem("validUntil", (Node *)makeString($3)); } /* Supported but not documented for roles, for use by ALTER GROUP. */ | USER role_list { $$ = makeDefElem("rolemembers", (Node *)$2); } | IDENT { /* * We handle identifiers that aren't parser keywords with * the following special-case codes, to avoid bloating the * size of the main parser. */ if (strcmp($1, "superuser") == 0) $$ = makeDefElem("superuser", (Node *)makeInteger(TRUE)); else if (strcmp($1, "nosuperuser") == 0) $$ = makeDefElem("superuser", (Node *)makeInteger(FALSE)); else if (strcmp($1, "createuser") == 0) { /* For backwards compatibility, synonym for SUPERUSER */ $$ = makeDefElem("superuser", (Node *)makeInteger(TRUE)); } else if (strcmp($1, "nocreateuser") == 0) { /* For backwards compatibility, synonym for SUPERUSER */ $$ = makeDefElem("superuser", (Node *)makeInteger(FALSE)); } else if (strcmp($1, "createrole") == 0) $$ = makeDefElem("createrole", (Node *)makeInteger(TRUE)); else if (strcmp($1, "nocreaterole") == 0) $$ = makeDefElem("createrole", (Node *)makeInteger(FALSE)); else if (strcmp($1, "replication") == 0) $$ = makeDefElem("isreplication", (Node *)makeInteger(TRUE)); else if (strcmp($1, "noreplication") == 0) $$ = makeDefElem("isreplication", (Node *)makeInteger(FALSE)); else if (strcmp($1, "createdb") == 0) $$ = makeDefElem("createdb", (Node *)makeInteger(TRUE)); else if (strcmp($1, "nocreatedb") == 0) $$ = makeDefElem("createdb", (Node *)makeInteger(FALSE)); else if (strcmp($1, "login") == 0) $$ = makeDefElem("canlogin", (Node *)makeInteger(TRUE)); else if (strcmp($1, "nologin") == 0) $$ = makeDefElem("canlogin", (Node *)makeInteger(FALSE)); else if (strcmp($1, "noinherit") == 0) { /* * Note that INHERIT is a keyword, so it's handled by main parser, but * NOINHERIT is handled here. */ $$ = makeDefElem("inherit", (Node *)makeInteger(FALSE)); } else ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("unrecognized role option \"%s\"", $1), parser_errposition(@1))); } ; CreateOptRoleElem: AlterOptRoleElem { $$ = $1; } /* The following are not supported by ALTER ROLE/USER/GROUP */ | SYSID Iconst { $$ = makeDefElem("sysid", (Node *)makeInteger($2)); } | ADMIN role_list { $$ = makeDefElem("adminmembers", (Node *)$2); } | ROLE role_list { $$ = makeDefElem("rolemembers", (Node *)$2); } | IN_P ROLE role_list { $$ = makeDefElem("addroleto", (Node *)$3); } | IN_P GROUP_P role_list { $$ = makeDefElem("addroleto", (Node *)$3); } ; /***************************************************************************** * * Create a new Postgres DBMS user (role with implied login ability) * *****************************************************************************/ CreateUserStmt: CREATE USER RoleId opt_with OptRoleList { CreateRoleStmt *n = makeNode(CreateRoleStmt); n->stmt_type = ROLESTMT_USER; n->role = $3; n->options = $5; $$ = (Node *)n; } ; /***************************************************************************** * * Alter a postgresql DBMS role * *****************************************************************************/ AlterRoleStmt: ALTER ROLE RoleId opt_with AlterOptRoleList { AlterRoleStmt *n = makeNode(AlterRoleStmt); n->role = $3; n->action = +1; /* add, if there are members */ n->options = $5; $$ = (Node *)n; } ; opt_in_database: /* EMPTY */ { $$ = NULL; } | IN_P DATABASE database_name { $$ = $3; } ; AlterRoleSetStmt: ALTER ROLE RoleId opt_in_database SetResetClause { AlterRoleSetStmt *n = makeNode(AlterRoleSetStmt); n->role = $3; n->database = $4; n->setstmt = $5; $$ = (Node *)n; } | ALTER ROLE ALL opt_in_database SetResetClause { AlterRoleSetStmt *n = makeNode(AlterRoleSetStmt); n->role = NULL; n->database = $4; n->setstmt = $5; $$ = (Node *)n; } ; /***************************************************************************** * * Alter a postgresql DBMS user * *****************************************************************************/ AlterUserStmt: ALTER USER RoleId opt_with AlterOptRoleList { AlterRoleStmt *n = makeNode(AlterRoleStmt); n->role = $3; n->action = +1; /* add, if there are members */ n->options = $5; $$ = (Node *)n; } ; AlterUserSetStmt: ALTER USER RoleId SetResetClause { AlterRoleSetStmt *n = makeNode(AlterRoleSetStmt); n->role = $3; n->database = NULL; n->setstmt = $4; $$ = (Node *)n; } ; /***************************************************************************** * * Drop a postgresql DBMS role * * XXX Ideally this would have CASCADE/RESTRICT options, but since a role * might own objects in multiple databases, there is presently no way to * implement either cascading or restricting. Caveat DBA. *****************************************************************************/ DropRoleStmt: DROP ROLE role_list { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = FALSE; n->roles = $3; $$ = (Node *)n; } | DROP ROLE IF_P EXISTS role_list { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = TRUE; n->roles = $5; $$ = (Node *)n; } ; /***************************************************************************** * * Drop a postgresql DBMS user * * XXX Ideally this would have CASCADE/RESTRICT options, but since a user * might own objects in multiple databases, there is presently no way to * implement either cascading or restricting. Caveat DBA. *****************************************************************************/ DropUserStmt: DROP USER role_list { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = FALSE; n->roles = $3; $$ = (Node *)n; } | DROP USER IF_P EXISTS role_list { DropRoleStmt *n = makeNode(DropRoleStmt); n->roles = $5; n->missing_ok = TRUE; $$ = (Node *)n; } ; /***************************************************************************** * * Create a postgresql group (role without login ability) * *****************************************************************************/ CreateGroupStmt: CREATE GROUP_P RoleId opt_with OptRoleList { CreateRoleStmt *n = makeNode(CreateRoleStmt); n->stmt_type = ROLESTMT_GROUP; n->role = $3; n->options = $5; $$ = (Node *)n; } ; /***************************************************************************** * * Alter a postgresql group * *****************************************************************************/ AlterGroupStmt: ALTER GROUP_P RoleId add_drop USER role_list { AlterRoleStmt *n = makeNode(AlterRoleStmt); n->role = $3; n->action = $4; n->options = list_make1(makeDefElem("rolemembers", (Node *)$6)); $$ = (Node *)n; } ; add_drop: ADD_P { $$ = +1; } | DROP { $$ = -1; } ; /***************************************************************************** * * Drop a postgresql group * * XXX see above notes about cascading DROP USER; groups have same problem. *****************************************************************************/ DropGroupStmt: DROP GROUP_P role_list { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = FALSE; n->roles = $3; $$ = (Node *)n; } | DROP GROUP_P IF_P EXISTS role_list { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = TRUE; n->roles = $5; $$ = (Node *)n; } ; /***************************************************************************** * * Manipulate a schema * *****************************************************************************/ CreateSchemaStmt: CREATE SCHEMA OptSchemaName AUTHORIZATION RoleId OptSchemaEltList { CreateSchemaStmt *n = makeNode(CreateSchemaStmt); /* One can omit the schema name or the authorization id. */ if ($3 != NULL) n->schemaname = $3; else n->schemaname = $5; n->authid = $5; n->schemaElts = $6; n->if_not_exists = false; $$ = (Node *)n; } | CREATE SCHEMA ColId OptSchemaEltList { CreateSchemaStmt *n = makeNode(CreateSchemaStmt); /* ...but not both */ n->schemaname = $3; n->authid = NULL; n->schemaElts = $4; n->if_not_exists = false; $$ = (Node *)n; } | CREATE SCHEMA IF_P NOT EXISTS OptSchemaName AUTHORIZATION RoleId OptSchemaEltList { CreateSchemaStmt *n = makeNode(CreateSchemaStmt); /* One can omit the schema name or the authorization id. */ if ($6 != NULL) n->schemaname = $6; else n->schemaname = $8; n->authid = $8; if ($9 != NIL) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("CREATE SCHEMA IF NOT EXISTS cannot include schema elements"), parser_errposition(@9))); n->schemaElts = $9; n->if_not_exists = true; $$ = (Node *)n; } | CREATE SCHEMA IF_P NOT EXISTS ColId OptSchemaEltList { CreateSchemaStmt *n = makeNode(CreateSchemaStmt); /* ...but not both */ n->schemaname = $6; n->authid = NULL; if ($7 != NIL) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("CREATE SCHEMA IF NOT EXISTS cannot include schema elements"), parser_errposition(@7))); n->schemaElts = $7; n->if_not_exists = true; $$ = (Node *)n; } ; OptSchemaName: ColId { $$ = $1; } | /* EMPTY */ { $$ = NULL; } ; OptSchemaEltList: OptSchemaEltList schema_stmt { if (@$ < 0) /* see comments for YYLLOC_DEFAULT */ @$ = @2; $$ = lappend($1, $2); } | /* EMPTY */ { $$ = NIL; } ; /* * schema_stmt are the ones that can show up inside a CREATE SCHEMA * statement (in addition to by themselves). */ schema_stmt: CreateStmt | IndexStmt | CreateSeqStmt | CreateTrigStmt | GrantStmt | ViewStmt ; /***************************************************************************** * * Set PG internal variable * SET name TO 'var_value' * Include SQL syntax (thomas 1997-10-22): * SET TIME ZONE 'var_value' * *****************************************************************************/ VariableSetStmt: SET set_rest { VariableSetStmt *n = $2; n->is_local = false; $$ = (Node *) n; } | SET LOCAL set_rest { VariableSetStmt *n = $3; n->is_local = true; $$ = (Node *) n; } | SET SESSION set_rest { VariableSetStmt *n = $3; n->is_local = false; $$ = (Node *) n; } ; set_rest: TRANSACTION transaction_mode_list { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_MULTI; n->name = "TRANSACTION"; n->args = $2; $$ = n; } | SESSION CHARACTERISTICS AS TRANSACTION transaction_mode_list { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_MULTI; n->name = "SESSION CHARACTERISTICS"; n->args = $5; $$ = n; } | set_rest_more ; generic_set: var_name TO var_list { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_VALUE; n->name = $1; n->args = $3; $$ = n; } | var_name '=' var_list { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_VALUE; n->name = $1; n->args = $3; $$ = n; } | var_name TO DEFAULT { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_DEFAULT; n->name = $1; $$ = n; } | var_name '=' DEFAULT { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_DEFAULT; n->name = $1; $$ = n; } set_rest_more: /* Generic SET syntaxes: */ generic_set {$$ = $1;} | var_name FROM CURRENT_P { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_CURRENT; n->name = $1; $$ = n; } /* Special syntaxes mandated by SQL standard: */ | TIME ZONE zone_value { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_VALUE; n->name = "timezone"; if ($3 != NULL) n->args = list_make1($3); else n->kind = VAR_SET_DEFAULT; $$ = n; } | CATALOG_P Sconst { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("current database cannot be changed"), parser_errposition(@2))); $$ = NULL; /*not reached*/ } | SCHEMA Sconst { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_VALUE; n->name = "search_path"; n->args = list_make1(makeStringConst($2, @2)); $$ = n; } | NAMES opt_encoding { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_VALUE; n->name = "client_encoding"; if ($2 != NULL) n->args = list_make1(makeStringConst($2, @2)); else n->kind = VAR_SET_DEFAULT; $$ = n; } | ROLE NonReservedWord_or_Sconst { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_VALUE; n->name = "role"; n->args = list_make1(makeStringConst($2, @2)); $$ = n; } | SESSION AUTHORIZATION NonReservedWord_or_Sconst { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_VALUE; n->name = "session_authorization"; n->args = list_make1(makeStringConst($3, @3)); $$ = n; } | SESSION AUTHORIZATION DEFAULT { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_DEFAULT; n->name = "session_authorization"; $$ = n; } | XML_P OPTION document_or_content { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_VALUE; n->name = "xmloption"; n->args = list_make1(makeStringConst($3 == XMLOPTION_DOCUMENT ? "DOCUMENT" : "CONTENT", @3)); $$ = n; } /* Special syntaxes invented by PostgreSQL: */ | TRANSACTION SNAPSHOT Sconst { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_MULTI; n->name = "TRANSACTION SNAPSHOT"; n->args = list_make1(makeStringConst($3, @3)); $$ = n; } ; var_name: ColId { $$ = $1; } | var_name '.' ColId { $$ = psprintf("%s.%s", $1, $3); } ; var_list: var_value { $$ = list_make1($1); } | var_list ',' var_value { $$ = lappend($1, $3); } ; var_value: opt_boolean_or_string { $$ = makeStringConst($1, @1); } | NumericOnly { $$ = makeAConst($1, @1); } ; iso_level: READ UNCOMMITTED { $$ = "read uncommitted"; } | READ COMMITTED { $$ = "read committed"; } | REPEATABLE READ { $$ = "repeatable read"; } | SERIALIZABLE { $$ = "serializable"; } ; opt_boolean_or_string: TRUE_P { $$ = "true"; } | FALSE_P { $$ = "false"; } | ON { $$ = "on"; } /* * OFF is also accepted as a boolean value, but is handled by * the NonReservedWord rule. The action for booleans and strings * is the same, so we don't need to distinguish them here. */ | NonReservedWord_or_Sconst { $$ = $1; } ; /* Timezone values can be: * - a string such as 'pst8pdt' * - an identifier such as "pst8pdt" * - an integer or floating point number * - a time interval per SQL99 * ColId gives reduce/reduce errors against ConstInterval and LOCAL, * so use IDENT (meaning we reject anything that is a key word). */ zone_value: Sconst { $$ = makeStringConst($1, @1); } | IDENT { $$ = makeStringConst($1, @1); } | ConstInterval Sconst opt_interval { TypeName *t = $1; if ($3 != NIL) { A_Const *n = (A_Const *) linitial($3); if ((n->val.val.ival & ~(INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE))) != 0) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("time zone interval must be HOUR or HOUR TO MINUTE"), parser_errposition(@3))); } t->typmods = $3; $$ = makeStringConstCast($2, @2, t); } | ConstInterval '(' Iconst ')' Sconst opt_interval { TypeName *t = $1; if ($6 != NIL) { A_Const *n = (A_Const *) linitial($6); if ((n->val.val.ival & ~(INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE))) != 0) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("time zone interval must be HOUR or HOUR TO MINUTE"), parser_errposition(@6))); if (list_length($6) != 1) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("interval precision specified twice"), parser_errposition(@1))); t->typmods = lappend($6, makeIntConst($3, @3)); } else t->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1), makeIntConst($3, @3)); $$ = makeStringConstCast($5, @5, t); } | NumericOnly { $$ = makeAConst($1, @1); } | DEFAULT { $$ = NULL; } | LOCAL { $$ = NULL; } ; opt_encoding: Sconst { $$ = $1; } | DEFAULT { $$ = NULL; } | /*EMPTY*/ { $$ = NULL; } ; NonReservedWord_or_Sconst: NonReservedWord { $$ = $1; } | Sconst { $$ = $1; } ; VariableResetStmt: RESET var_name { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = $2; $$ = (Node *) n; } | RESET TIME ZONE { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = "timezone"; $$ = (Node *) n; } | RESET TRANSACTION ISOLATION LEVEL { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = "transaction_isolation"; $$ = (Node *) n; } | RESET SESSION AUTHORIZATION { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = "session_authorization"; $$ = (Node *) n; } | RESET ALL { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET_ALL; $$ = (Node *) n; } ; /* SetResetClause allows SET or RESET without LOCAL */ SetResetClause: SET set_rest { $$ = $2; } | VariableResetStmt { $$ = (VariableSetStmt *) $1; } ; /* SetResetClause allows SET or RESET without LOCAL */ FunctionSetResetClause: SET set_rest_more { $$ = $2; } | VariableResetStmt { $$ = (VariableSetStmt *) $1; } ; VariableShowStmt: SHOW var_name { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = $2; $$ = (Node *) n; } | SHOW TIME ZONE { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = "timezone"; $$ = (Node *) n; } | SHOW TRANSACTION ISOLATION LEVEL { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = "transaction_isolation"; $$ = (Node *) n; } | SHOW SESSION AUTHORIZATION { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = "session_authorization"; $$ = (Node *) n; } | SHOW ALL { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = "all"; $$ = (Node *) n; } ; ConstraintsSetStmt: SET CONSTRAINTS constraints_set_list constraints_set_mode { ConstraintsSetStmt *n = makeNode(ConstraintsSetStmt); n->constraints = $3; n->deferred = $4; $$ = (Node *) n; } ; constraints_set_list: ALL { $$ = NIL; } | qualified_name_list { $$ = $1; } ; constraints_set_mode: DEFERRED { $$ = TRUE; } | IMMEDIATE { $$ = FALSE; } ; /* * Checkpoint statement */ CheckPointStmt: CHECKPOINT { CheckPointStmt *n = makeNode(CheckPointStmt); $$ = (Node *)n; } ; /***************************************************************************** * * DISCARD { ALL | TEMP | PLANS | SEQUENCES } * *****************************************************************************/ DiscardStmt: DISCARD ALL { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_ALL; $$ = (Node *) n; } | DISCARD TEMP { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_TEMP; $$ = (Node *) n; } | DISCARD TEMPORARY { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_TEMP; $$ = (Node *) n; } | DISCARD PLANS { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_PLANS; $$ = (Node *) n; } | DISCARD SEQUENCES { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_SEQUENCES; $$ = (Node *) n; } ; /***************************************************************************** * * ALTER [ TABLE | INDEX | SEQUENCE | VIEW | MATERIALIZED VIEW ] variations * * Note: we accept all subcommands for each of the five variants, and sort * out what's really legal at execution time. *****************************************************************************/ AlterTableStmt: ALTER TABLE relation_expr alter_table_cmds { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = $3; n->cmds = $4; n->relkind = OBJECT_TABLE; n->missing_ok = false; $$ = (Node *)n; } | ALTER TABLE IF_P EXISTS relation_expr alter_table_cmds { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = $5; n->cmds = $6; n->relkind = OBJECT_TABLE; n->missing_ok = true; $$ = (Node *)n; } | ALTER INDEX qualified_name alter_table_cmds { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = $3; n->cmds = $4; n->relkind = OBJECT_INDEX; n->missing_ok = false; $$ = (Node *)n; } | ALTER INDEX IF_P EXISTS qualified_name alter_table_cmds { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = $5; n->cmds = $6; n->relkind = OBJECT_INDEX; n->missing_ok = true; $$ = (Node *)n; } | ALTER SEQUENCE qualified_name alter_table_cmds { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = $3; n->cmds = $4; n->relkind = OBJECT_SEQUENCE; n->missing_ok = false; $$ = (Node *)n; } | ALTER SEQUENCE IF_P EXISTS qualified_name alter_table_cmds { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = $5; n->cmds = $6; n->relkind = OBJECT_SEQUENCE; n->missing_ok = true; $$ = (Node *)n; } | ALTER VIEW qualified_name alter_table_cmds { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = $3; n->cmds = $4; n->relkind = OBJECT_VIEW; n->missing_ok = false; $$ = (Node *)n; } | ALTER VIEW IF_P EXISTS qualified_name alter_table_cmds { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = $5; n->cmds = $6; n->relkind = OBJECT_VIEW; n->missing_ok = true; $$ = (Node *)n; } | ALTER MATERIALIZED VIEW qualified_name alter_table_cmds { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = $4; n->cmds = $5; n->relkind = OBJECT_MATVIEW; n->missing_ok = false; $$ = (Node *)n; } | ALTER MATERIALIZED VIEW IF_P EXISTS qualified_name alter_table_cmds { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = $6; n->cmds = $7; n->relkind = OBJECT_MATVIEW; n->missing_ok = true; $$ = (Node *)n; } ; alter_table_cmds: alter_table_cmd { $$ = list_make1($1); } | alter_table_cmds ',' alter_table_cmd { $$ = lappend($1, $3); } ; alter_table_cmd: /* ALTER TABLE ADD */ ADD_P columnDef { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddColumn; n->def = $2; $$ = (Node *)n; } /* ALTER TABLE ADD COLUMN */ | ADD_P COLUMN columnDef { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddColumn; n->def = $3; $$ = (Node *)n; } /* ALTER TABLE ALTER [COLUMN] {SET DEFAULT |DROP DEFAULT} */ | ALTER opt_column ColId alter_column_default { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ColumnDefault; n->name = $3; n->def = $4; $$ = (Node *)n; } /* ALTER TABLE ALTER [COLUMN] DROP NOT NULL */ | ALTER opt_column ColId DROP NOT NULL_P { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropNotNull; n->name = $3; $$ = (Node *)n; } /* ALTER TABLE ALTER [COLUMN] SET NOT NULL */ | ALTER opt_column ColId SET NOT NULL_P { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetNotNull; n->name = $3; $$ = (Node *)n; } /* ALTER TABLE ALTER [COLUMN] SET STATISTICS */ | ALTER opt_column ColId SET STATISTICS SignedIconst { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetStatistics; n->name = $3; n->def = (Node *) makeInteger($6); $$ = (Node *)n; } /* ALTER TABLE ALTER [COLUMN] SET ( column_parameter = value [, ... ] ) */ | ALTER opt_column ColId SET reloptions { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetOptions; n->name = $3; n->def = (Node *) $5; $$ = (Node *)n; } /* ALTER TABLE ALTER [COLUMN] SET ( column_parameter = value [, ... ] ) */ | ALTER opt_column ColId RESET reloptions { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ResetOptions; n->name = $3; n->def = (Node *) $5; $$ = (Node *)n; } /* ALTER TABLE ALTER [COLUMN] SET STORAGE */ | ALTER opt_column ColId SET STORAGE ColId { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetStorage; n->name = $3; n->def = (Node *) makeString($6); $$ = (Node *)n; } /* ALTER TABLE DROP [COLUMN] IF EXISTS [RESTRICT|CASCADE] */ | DROP opt_column IF_P EXISTS ColId opt_drop_behavior { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropColumn; n->name = $5; n->behavior = $6; n->missing_ok = TRUE; $$ = (Node *)n; } /* ALTER TABLE DROP [COLUMN] [RESTRICT|CASCADE] */ | DROP opt_column ColId opt_drop_behavior { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropColumn; n->name = $3; n->behavior = $4; n->missing_ok = FALSE; $$ = (Node *)n; } /* * ALTER TABLE ALTER [COLUMN] [SET DATA] TYPE * [ USING ] */ | ALTER opt_column ColId opt_set_data TYPE_P Typename opt_collate_clause alter_using { AlterTableCmd *n = makeNode(AlterTableCmd); ColumnDef *def = makeNode(ColumnDef); n->subtype = AT_AlterColumnType; n->name = $3; n->def = (Node *) def; /* We only use these fields of the ColumnDef node */ def->typeName = $6; def->collClause = (CollateClause *) $7; def->raw_default = $8; def->location = @3; $$ = (Node *)n; } /* ALTER FOREIGN TABLE ALTER [COLUMN] OPTIONS */ | ALTER opt_column ColId alter_generic_options { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AlterColumnGenericOptions; n->name = $3; n->def = (Node *) $4; $$ = (Node *)n; } /* ALTER TABLE ADD CONSTRAINT ... */ | ADD_P TableConstraint { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddConstraint; n->def = $2; $$ = (Node *)n; } /* ALTER TABLE ALTER CONSTRAINT ... */ | ALTER CONSTRAINT name ConstraintAttributeSpec { AlterTableCmd *n = makeNode(AlterTableCmd); Constraint *c = makeNode(Constraint); n->subtype = AT_AlterConstraint; n->def = (Node *) c; c->contype = CONSTR_FOREIGN; /* others not supported, yet */ c->conname = $3; processCASbits($4, @4, "ALTER CONSTRAINT statement", &c->deferrable, &c->initdeferred, NULL, NULL, yyscanner); $$ = (Node *)n; } /* ALTER TABLE VALIDATE CONSTRAINT ... */ | VALIDATE CONSTRAINT name { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ValidateConstraint; n->name = $3; $$ = (Node *)n; } /* ALTER TABLE DROP CONSTRAINT IF EXISTS [RESTRICT|CASCADE] */ | DROP CONSTRAINT IF_P EXISTS name opt_drop_behavior { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropConstraint; n->name = $5; n->behavior = $6; n->missing_ok = TRUE; $$ = (Node *)n; } /* ALTER TABLE DROP CONSTRAINT [RESTRICT|CASCADE] */ | DROP CONSTRAINT name opt_drop_behavior { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropConstraint; n->name = $3; n->behavior = $4; n->missing_ok = FALSE; $$ = (Node *)n; } /* ALTER TABLE SET WITH OIDS */ | SET WITH OIDS { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddOids; $$ = (Node *)n; } /* ALTER TABLE SET WITHOUT OIDS */ | SET WITHOUT OIDS { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropOids; $$ = (Node *)n; } /* ALTER TABLE CLUSTER ON */ | CLUSTER ON name { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ClusterOn; n->name = $3; $$ = (Node *)n; } /* ALTER TABLE SET WITHOUT CLUSTER */ | SET WITHOUT CLUSTER { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropCluster; n->name = NULL; $$ = (Node *)n; } /* ALTER TABLE ENABLE TRIGGER */ | ENABLE_P TRIGGER name { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableTrig; n->name = $3; $$ = (Node *)n; } /* ALTER TABLE ENABLE ALWAYS TRIGGER */ | ENABLE_P ALWAYS TRIGGER name { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableAlwaysTrig; n->name = $4; $$ = (Node *)n; } /* ALTER TABLE ENABLE REPLICA TRIGGER */ | ENABLE_P REPLICA TRIGGER name { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableReplicaTrig; n->name = $4; $$ = (Node *)n; } /* ALTER TABLE ENABLE TRIGGER ALL */ | ENABLE_P TRIGGER ALL { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableTrigAll; $$ = (Node *)n; } /* ALTER TABLE ENABLE TRIGGER USER */ | ENABLE_P TRIGGER USER { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableTrigUser; $$ = (Node *)n; } /* ALTER TABLE DISABLE TRIGGER */ | DISABLE_P TRIGGER name { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableTrig; n->name = $3; $$ = (Node *)n; } /* ALTER TABLE DISABLE TRIGGER ALL */ | DISABLE_P TRIGGER ALL { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableTrigAll; $$ = (Node *)n; } /* ALTER TABLE DISABLE TRIGGER USER */ | DISABLE_P TRIGGER USER { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableTrigUser; $$ = (Node *)n; } /* ALTER TABLE ENABLE RULE */ | ENABLE_P RULE name { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableRule; n->name = $3; $$ = (Node *)n; } /* ALTER TABLE ENABLE ALWAYS RULE */ | ENABLE_P ALWAYS RULE name { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableAlwaysRule; n->name = $4; $$ = (Node *)n; } /* ALTER TABLE ENABLE REPLICA RULE */ | ENABLE_P REPLICA RULE name { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableReplicaRule; n->name = $4; $$ = (Node *)n; } /* ALTER TABLE DISABLE RULE */ | DISABLE_P RULE name { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableRule; n->name = $3; $$ = (Node *)n; } /* ALTER TABLE INHERIT */ | INHERIT qualified_name { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddInherit; n->def = (Node *) $2; $$ = (Node *)n; } /* ALTER TABLE NO INHERIT */ | NO INHERIT qualified_name { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropInherit; n->def = (Node *) $3; $$ = (Node *)n; } /* ALTER TABLE OF */ | OF any_name { AlterTableCmd *n = makeNode(AlterTableCmd); TypeName *def = makeTypeNameFromNameList($2); def->location = @2; n->subtype = AT_AddOf; n->def = (Node *) def; $$ = (Node *)n; } /* ALTER TABLE NOT OF */ | NOT OF { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropOf; $$ = (Node *)n; } /* ALTER TABLE OWNER TO RoleId */ | OWNER TO RoleId { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ChangeOwner; n->name = $3; $$ = (Node *)n; } /* ALTER TABLE SET TABLESPACE */ | SET TABLESPACE name { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetTableSpace; n->name = $3; $$ = (Node *)n; } /* ALTER TABLE SET (...) */ | SET reloptions { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetRelOptions; n->def = (Node *)$2; $$ = (Node *)n; } /* ALTER TABLE RESET (...) */ | RESET reloptions { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ResetRelOptions; n->def = (Node *)$2; $$ = (Node *)n; } /* ALTER TABLE REPLICA IDENTITY */ | REPLICA IDENTITY_P replica_identity { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ReplicaIdentity; n->def = $3; $$ = (Node *)n; } | alter_generic_options { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_GenericOptions; n->def = (Node *)$1; $$ = (Node *) n; } ; alter_column_default: SET DEFAULT a_expr { $$ = $3; } | DROP DEFAULT { $$ = NULL; } ; opt_drop_behavior: CASCADE { $$ = DROP_CASCADE; } | RESTRICT { $$ = DROP_RESTRICT; } | /* EMPTY */ { $$ = DROP_RESTRICT; /* default */ } ; opt_collate_clause: COLLATE any_name { CollateClause *n = makeNode(CollateClause); n->arg = NULL; n->collname = $2; n->location = @1; $$ = (Node *) n; } | /* EMPTY */ { $$ = NULL; } ; alter_using: USING a_expr { $$ = $2; } | /* EMPTY */ { $$ = NULL; } ; replica_identity: NOTHING { ReplicaIdentityStmt *n = makeNode(ReplicaIdentityStmt); n->identity_type = REPLICA_IDENTITY_NOTHING; n->name = NULL; $$ = (Node *) n; } | FULL { ReplicaIdentityStmt *n = makeNode(ReplicaIdentityStmt); n->identity_type = REPLICA_IDENTITY_FULL; n->name = NULL; $$ = (Node *) n; } | DEFAULT { ReplicaIdentityStmt *n = makeNode(ReplicaIdentityStmt); n->identity_type = REPLICA_IDENTITY_DEFAULT; n->name = NULL; $$ = (Node *) n; } | USING INDEX name { ReplicaIdentityStmt *n = makeNode(ReplicaIdentityStmt); n->identity_type = REPLICA_IDENTITY_INDEX; n->name = $3; $$ = (Node *) n; } ; reloptions: '(' reloption_list ')' { $$ = $2; } ; opt_reloptions: WITH reloptions { $$ = $2; } | /* EMPTY */ { $$ = NIL; } ; reloption_list: reloption_elem { $$ = list_make1($1); } | reloption_list ',' reloption_elem { $$ = lappend($1, $3); } ; /* This should match def_elem and also allow qualified names */ reloption_elem: ColLabel '=' def_arg { $$ = makeDefElem($1, (Node *) $3); } | ColLabel { $$ = makeDefElem($1, NULL); } | ColLabel '.' ColLabel '=' def_arg { $$ = makeDefElemExtended($1, $3, (Node *) $5, DEFELEM_UNSPEC); } | ColLabel '.' ColLabel { $$ = makeDefElemExtended($1, $3, NULL, DEFELEM_UNSPEC); } ; /***************************************************************************** * * ALTER TYPE * * really variants of the ALTER TABLE subcommands with different spellings *****************************************************************************/ AlterCompositeTypeStmt: ALTER TYPE_P any_name alter_type_cmds { AlterTableStmt *n = makeNode(AlterTableStmt); /* can't use qualified_name, sigh */ n->relation = makeRangeVarFromAnyName($3, @3, yyscanner); n->cmds = $4; n->relkind = OBJECT_TYPE; $$ = (Node *)n; } ; alter_type_cmds: alter_type_cmd { $$ = list_make1($1); } | alter_type_cmds ',' alter_type_cmd { $$ = lappend($1, $3); } ; alter_type_cmd: /* ALTER TYPE ADD ATTRIBUTE [RESTRICT|CASCADE] */ ADD_P ATTRIBUTE TableFuncElement opt_drop_behavior { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddColumn; n->def = $3; n->behavior = $4; $$ = (Node *)n; } /* ALTER TYPE DROP ATTRIBUTE IF EXISTS [RESTRICT|CASCADE] */ | DROP ATTRIBUTE IF_P EXISTS ColId opt_drop_behavior { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropColumn; n->name = $5; n->behavior = $6; n->missing_ok = TRUE; $$ = (Node *)n; } /* ALTER TYPE DROP ATTRIBUTE [RESTRICT|CASCADE] */ | DROP ATTRIBUTE ColId opt_drop_behavior { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropColumn; n->name = $3; n->behavior = $4; n->missing_ok = FALSE; $$ = (Node *)n; } /* ALTER TYPE ALTER ATTRIBUTE [SET DATA] TYPE [RESTRICT|CASCADE] */ | ALTER ATTRIBUTE ColId opt_set_data TYPE_P Typename opt_collate_clause opt_drop_behavior { AlterTableCmd *n = makeNode(AlterTableCmd); ColumnDef *def = makeNode(ColumnDef); n->subtype = AT_AlterColumnType; n->name = $3; n->def = (Node *) def; n->behavior = $8; /* We only use these fields of the ColumnDef node */ def->typeName = $6; def->collClause = (CollateClause *) $7; def->raw_default = NULL; def->location = @3; $$ = (Node *)n; } ; /***************************************************************************** * * QUERY : * close * *****************************************************************************/ ClosePortalStmt: CLOSE cursor_name { ClosePortalStmt *n = makeNode(ClosePortalStmt); n->portalname = $2; $$ = (Node *)n; } | CLOSE ALL { ClosePortalStmt *n = makeNode(ClosePortalStmt); n->portalname = NULL; $$ = (Node *)n; } ; /***************************************************************************** * * QUERY : * COPY relname [(columnList)] FROM/TO file [WITH] [(options)] * COPY ( SELECT ... ) TO file [WITH] [(options)] * * where 'file' can be one of: * { PROGRAM 'command' | STDIN | STDOUT | 'filename' } * * In the preferred syntax the options are comma-separated * and use generic identifiers instead of keywords. The pre-9.0 * syntax had a hard-wired, space-separated set of options. * * Really old syntax, from versions 7.2 and prior: * COPY [ BINARY ] table [ WITH OIDS ] FROM/TO file * [ [ USING ] DELIMITERS 'delimiter' ] ] * [ WITH NULL AS 'null string' ] * This option placement is not supported with COPY (SELECT...). * *****************************************************************************/ CopyStmt: COPY opt_binary qualified_name opt_column_list opt_oids copy_from opt_program copy_file_name copy_delimiter opt_with copy_options { CopyStmt *n = makeNode(CopyStmt); n->relation = $3; n->query = NULL; n->attlist = $4; n->is_from = $6; n->is_program = $7; n->filename = $8; if (n->is_program && n->filename == NULL) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("STDIN/STDOUT not allowed with PROGRAM"), parser_errposition(@8))); n->options = NIL; /* Concatenate user-supplied flags */ if ($2) n->options = lappend(n->options, $2); if ($5) n->options = lappend(n->options, $5); if ($9) n->options = lappend(n->options, $9); if ($11) n->options = list_concat(n->options, $11); $$ = (Node *)n; } | COPY select_with_parens TO opt_program copy_file_name opt_with copy_options { CopyStmt *n = makeNode(CopyStmt); n->relation = NULL; n->query = $2; n->attlist = NIL; n->is_from = false; n->is_program = $4; n->filename = $5; n->options = $7; if (n->is_program && n->filename == NULL) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("STDIN/STDOUT not allowed with PROGRAM"), parser_errposition(@5))); $$ = (Node *)n; } ; copy_from: FROM { $$ = TRUE; } | TO { $$ = FALSE; } ; opt_program: PROGRAM { $$ = TRUE; } | /* EMPTY */ { $$ = FALSE; } ; /* * copy_file_name NULL indicates stdio is used. Whether stdin or stdout is * used depends on the direction. (It really doesn't make sense to copy from * stdout. We silently correct the "typo".) - AY 9/94 */ copy_file_name: Sconst { $$ = $1; } | STDIN { $$ = NULL; } | STDOUT { $$ = NULL; } ; copy_options: copy_opt_list { $$ = $1; } | '(' copy_generic_opt_list ')' { $$ = $2; } ; /* old COPY option syntax */ copy_opt_list: copy_opt_list copy_opt_item { $$ = lappend($1, $2); } | /* EMPTY */ { $$ = NIL; } ; copy_opt_item: BINARY { $$ = makeDefElem("format", (Node *)makeString("binary")); } | OIDS { $$ = makeDefElem("oids", (Node *)makeInteger(TRUE)); } | FREEZE { $$ = makeDefElem("freeze", (Node *)makeInteger(TRUE)); } | DELIMITER opt_as Sconst { $$ = makeDefElem("delimiter", (Node *)makeString($3)); } | NULL_P opt_as Sconst { $$ = makeDefElem("null", (Node *)makeString($3)); } | CSV { $$ = makeDefElem("format", (Node *)makeString("csv")); } | HEADER_P { $$ = makeDefElem("header", (Node *)makeInteger(TRUE)); } | QUOTE opt_as Sconst { $$ = makeDefElem("quote", (Node *)makeString($3)); } | ESCAPE opt_as Sconst { $$ = makeDefElem("escape", (Node *)makeString($3)); } | FORCE QUOTE columnList { $$ = makeDefElem("force_quote", (Node *)$3); } | FORCE QUOTE '*' { $$ = makeDefElem("force_quote", (Node *)makeNode(A_Star)); } | FORCE NOT NULL_P columnList { $$ = makeDefElem("force_not_null", (Node *)$4); } | FORCE NULL_P columnList { $$ = makeDefElem("force_null", (Node *)$3); } | ENCODING Sconst { $$ = makeDefElem("encoding", (Node *)makeString($2)); } ; /* The following exist for backward compatibility with very old versions */ opt_binary: BINARY { $$ = makeDefElem("format", (Node *)makeString("binary")); } | /*EMPTY*/ { $$ = NULL; } ; opt_oids: WITH OIDS { $$ = makeDefElem("oids", (Node *)makeInteger(TRUE)); } | /*EMPTY*/ { $$ = NULL; } ; copy_delimiter: opt_using DELIMITERS Sconst { $$ = makeDefElem("delimiter", (Node *)makeString($3)); } | /*EMPTY*/ { $$ = NULL; } ; opt_using: USING {} | /*EMPTY*/ {} ; /* new COPY option syntax */ copy_generic_opt_list: copy_generic_opt_elem { $$ = list_make1($1); } | copy_generic_opt_list ',' copy_generic_opt_elem { $$ = lappend($1, $3); } ; copy_generic_opt_elem: ColLabel copy_generic_opt_arg { $$ = makeDefElem($1, $2); } ; copy_generic_opt_arg: opt_boolean_or_string { $$ = (Node *) makeString($1); } | NumericOnly { $$ = (Node *) $1; } | '*' { $$ = (Node *) makeNode(A_Star); } | '(' copy_generic_opt_arg_list ')' { $$ = (Node *) $2; } | /* EMPTY */ { $$ = NULL; } ; copy_generic_opt_arg_list: copy_generic_opt_arg_list_item { $$ = list_make1($1); } | copy_generic_opt_arg_list ',' copy_generic_opt_arg_list_item { $$ = lappend($1, $3); } ; /* beware of emitting non-string list elements here; see commands/define.c */ copy_generic_opt_arg_list_item: opt_boolean_or_string { $$ = (Node *) makeString($1); } ; /***************************************************************************** * * QUERY : * CREATE TABLE relname * *****************************************************************************/ CreateStmt: CREATE OptTemp TABLE qualified_name '(' OptTableElementList ')' OptInherit OptWith OnCommitOption OptTableSpace { CreateStmt *n = makeNode(CreateStmt); $4->relpersistence = $2; n->relation = $4; n->tableElts = $6; n->inhRelations = $8; n->constraints = NIL; n->options = $9; n->oncommit = $10; n->tablespacename = $11; n->if_not_exists = false; $$ = (Node *)n; } | CREATE OptTemp TABLE IF_P NOT EXISTS qualified_name '(' OptTableElementList ')' OptInherit OptWith OnCommitOption OptTableSpace { CreateStmt *n = makeNode(CreateStmt); $7->relpersistence = $2; n->relation = $7; n->tableElts = $9; n->inhRelations = $11; n->constraints = NIL; n->options = $12; n->oncommit = $13; n->tablespacename = $14; n->if_not_exists = true; $$ = (Node *)n; } | CREATE OptTemp TABLE qualified_name OF any_name OptTypedTableElementList OptWith OnCommitOption OptTableSpace { CreateStmt *n = makeNode(CreateStmt); $4->relpersistence = $2; n->relation = $4; n->tableElts = $7; n->ofTypename = makeTypeNameFromNameList($6); n->ofTypename->location = @6; n->constraints = NIL; n->options = $8; n->oncommit = $9; n->tablespacename = $10; n->if_not_exists = false; $$ = (Node *)n; } | CREATE OptTemp TABLE IF_P NOT EXISTS qualified_name OF any_name OptTypedTableElementList OptWith OnCommitOption OptTableSpace { CreateStmt *n = makeNode(CreateStmt); $7->relpersistence = $2; n->relation = $7; n->tableElts = $10; n->ofTypename = makeTypeNameFromNameList($9); n->ofTypename->location = @9; n->constraints = NIL; n->options = $11; n->oncommit = $12; n->tablespacename = $13; n->if_not_exists = true; $$ = (Node *)n; } ; /* * Redundancy here is needed to avoid shift/reduce conflicts, * since TEMP is not a reserved word. See also OptTempTableName. * * NOTE: we accept both GLOBAL and LOCAL options. They currently do nothing, * but future versions might consider GLOBAL to request SQL-spec-compliant * temp table behavior, so warn about that. Since we have no modules the * LOCAL keyword is really meaningless; furthermore, some other products * implement LOCAL as meaning the same as our default temp table behavior, * so we'll probably continue to treat LOCAL as a noise word. */ OptTemp: TEMPORARY { $$ = RELPERSISTENCE_TEMP; } | TEMP { $$ = RELPERSISTENCE_TEMP; } | LOCAL TEMPORARY { $$ = RELPERSISTENCE_TEMP; } | LOCAL TEMP { $$ = RELPERSISTENCE_TEMP; } | GLOBAL TEMPORARY { ereport(WARNING, (errmsg("GLOBAL is deprecated in temporary table creation"), parser_errposition(@1))); $$ = RELPERSISTENCE_TEMP; } | GLOBAL TEMP { ereport(WARNING, (errmsg("GLOBAL is deprecated in temporary table creation"), parser_errposition(@1))); $$ = RELPERSISTENCE_TEMP; } | UNLOGGED { $$ = RELPERSISTENCE_UNLOGGED; } | /*EMPTY*/ { $$ = RELPERSISTENCE_PERMANENT; } ; OptTableElementList: TableElementList { $$ = $1; } | /*EMPTY*/ { $$ = NIL; } ; OptTypedTableElementList: '(' TypedTableElementList ')' { $$ = $2; } | /*EMPTY*/ { $$ = NIL; } ; TableElementList: TableElement { $$ = list_make1($1); } | TableElementList ',' TableElement { $$ = lappend($1, $3); } ; TypedTableElementList: TypedTableElement { $$ = list_make1($1); } | TypedTableElementList ',' TypedTableElement { $$ = lappend($1, $3); } ; TableElement: columnDef { $$ = $1; } | TableLikeClause { $$ = $1; } | TableConstraint { $$ = $1; } ; TypedTableElement: columnOptions { $$ = $1; } | TableConstraint { $$ = $1; } ; columnDef: ColId Typename create_generic_options ColQualList { ColumnDef *n = makeNode(ColumnDef); n->colname = $1; n->typeName = $2; n->inhcount = 0; n->is_local = true; n->is_not_null = false; n->is_from_type = false; n->storage = 0; n->raw_default = NULL; n->cooked_default = NULL; n->collOid = InvalidOid; n->fdwoptions = $3; SplitColQualList($4, &n->constraints, &n->collClause, yyscanner); n->location = @1; $$ = (Node *)n; } ; columnOptions: ColId WITH OPTIONS ColQualList { ColumnDef *n = makeNode(ColumnDef); n->colname = $1; n->typeName = NULL; n->inhcount = 0; n->is_local = true; n->is_not_null = false; n->is_from_type = false; n->storage = 0; n->raw_default = NULL; n->cooked_default = NULL; n->collOid = InvalidOid; SplitColQualList($4, &n->constraints, &n->collClause, yyscanner); n->location = @1; $$ = (Node *)n; } ; ColQualList: ColQualList ColConstraint { $$ = lappend($1, $2); } | /*EMPTY*/ { $$ = NIL; } ; ColConstraint: CONSTRAINT name ColConstraintElem { Constraint *n = (Constraint *) $3; Assert(IsA(n, Constraint)); n->conname = $2; n->location = @1; $$ = (Node *) n; } | ColConstraintElem { $$ = $1; } | ConstraintAttr { $$ = $1; } | COLLATE any_name { /* * Note: the CollateClause is momentarily included in * the list built by ColQualList, but we split it out * again in SplitColQualList. */ CollateClause *n = makeNode(CollateClause); n->arg = NULL; n->collname = $2; n->location = @1; $$ = (Node *) n; } ; /* DEFAULT NULL is already the default for Postgres. * But define it here and carry it forward into the system * to make it explicit. * - thomas 1998-09-13 * * WITH NULL and NULL are not SQL-standard syntax elements, * so leave them out. Use DEFAULT NULL to explicitly indicate * that a column may have that value. WITH NULL leads to * shift/reduce conflicts with WITH TIME ZONE anyway. * - thomas 1999-01-08 * * DEFAULT expression must be b_expr not a_expr to prevent shift/reduce * conflict on NOT (since NOT might start a subsequent NOT NULL constraint, * or be part of a_expr NOT LIKE or similar constructs). */ ColConstraintElem: NOT NULL_P { Constraint *n = makeNode(Constraint); n->contype = CONSTR_NOTNULL; n->location = @1; $$ = (Node *)n; } | NULL_P { Constraint *n = makeNode(Constraint); n->contype = CONSTR_NULL; n->location = @1; $$ = (Node *)n; } | UNIQUE opt_definition OptConsTableSpace { Constraint *n = makeNode(Constraint); n->contype = CONSTR_UNIQUE; n->location = @1; n->keys = NULL; n->options = $2; n->indexname = NULL; n->indexspace = $3; $$ = (Node *)n; } | PRIMARY KEY opt_definition OptConsTableSpace { Constraint *n = makeNode(Constraint); n->contype = CONSTR_PRIMARY; n->location = @1; n->keys = NULL; n->options = $3; n->indexname = NULL; n->indexspace = $4; $$ = (Node *)n; } | CHECK '(' a_expr ')' opt_no_inherit { Constraint *n = makeNode(Constraint); n->contype = CONSTR_CHECK; n->location = @1; n->is_no_inherit = $5; n->raw_expr = $3; n->cooked_expr = NULL; $$ = (Node *)n; } | DEFAULT b_expr { Constraint *n = makeNode(Constraint); n->contype = CONSTR_DEFAULT; n->location = @1; n->raw_expr = $2; n->cooked_expr = NULL; $$ = (Node *)n; } | REFERENCES qualified_name opt_column_list key_match key_actions { Constraint *n = makeNode(Constraint); n->contype = CONSTR_FOREIGN; n->location = @1; n->pktable = $2; n->fk_attrs = NIL; n->pk_attrs = $3; n->fk_matchtype = $4; n->fk_upd_action = (char) ($5 >> 8); n->fk_del_action = (char) ($5 & 0xFF); n->skip_validation = false; n->initially_valid = true; $$ = (Node *)n; } ; /* * ConstraintAttr represents constraint attributes, which we parse as if * they were independent constraint clauses, in order to avoid shift/reduce * conflicts (since NOT might start either an independent NOT NULL clause * or an attribute). parse_utilcmd.c is responsible for attaching the * attribute information to the preceding "real" constraint node, and for * complaining if attribute clauses appear in the wrong place or wrong * combinations. * * See also ConstraintAttributeSpec, which can be used in places where * there is no parsing conflict. (Note: currently, NOT VALID and NO INHERIT * are allowed clauses in ConstraintAttributeSpec, but not here. Someday we * might need to allow them here too, but for the moment it doesn't seem * useful in the statements that use ConstraintAttr.) */ ConstraintAttr: DEFERRABLE { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_DEFERRABLE; n->location = @1; $$ = (Node *)n; } | NOT DEFERRABLE { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_NOT_DEFERRABLE; n->location = @1; $$ = (Node *)n; } | INITIALLY DEFERRED { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_DEFERRED; n->location = @1; $$ = (Node *)n; } | INITIALLY IMMEDIATE { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_IMMEDIATE; n->location = @1; $$ = (Node *)n; } ; TableLikeClause: LIKE qualified_name TableLikeOptionList { TableLikeClause *n = makeNode(TableLikeClause); n->relation = $2; n->options = $3; $$ = (Node *)n; } ; TableLikeOptionList: TableLikeOptionList INCLUDING TableLikeOption { $$ = $1 | $3; } | TableLikeOptionList EXCLUDING TableLikeOption { $$ = $1 & ~$3; } | /* EMPTY */ { $$ = 0; } ; TableLikeOption: DEFAULTS { $$ = CREATE_TABLE_LIKE_DEFAULTS; } | CONSTRAINTS { $$ = CREATE_TABLE_LIKE_CONSTRAINTS; } | INDEXES { $$ = CREATE_TABLE_LIKE_INDEXES; } | STORAGE { $$ = CREATE_TABLE_LIKE_STORAGE; } | COMMENTS { $$ = CREATE_TABLE_LIKE_COMMENTS; } | ALL { $$ = CREATE_TABLE_LIKE_ALL; } ; /* ConstraintElem specifies constraint syntax which is not embedded into * a column definition. ColConstraintElem specifies the embedded form. * - thomas 1997-12-03 */ TableConstraint: CONSTRAINT name ConstraintElem { Constraint *n = (Constraint *) $3; Assert(IsA(n, Constraint)); n->conname = $2; n->location = @1; $$ = (Node *) n; } | ConstraintElem { $$ = $1; } ; ConstraintElem: CHECK '(' a_expr ')' ConstraintAttributeSpec { Constraint *n = makeNode(Constraint); n->contype = CONSTR_CHECK; n->location = @1; n->raw_expr = $3; n->cooked_expr = NULL; processCASbits($5, @5, "CHECK", NULL, NULL, &n->skip_validation, &n->is_no_inherit, yyscanner); n->initially_valid = !n->skip_validation; $$ = (Node *)n; } | UNIQUE '(' columnList ')' opt_definition OptConsTableSpace ConstraintAttributeSpec { Constraint *n = makeNode(Constraint); n->contype = CONSTR_UNIQUE; n->location = @1; n->keys = $3; n->options = $5; n->indexname = NULL; n->indexspace = $6; processCASbits($7, @7, "UNIQUE", &n->deferrable, &n->initdeferred, NULL, NULL, yyscanner); $$ = (Node *)n; } | UNIQUE ExistingIndex ConstraintAttributeSpec { Constraint *n = makeNode(Constraint); n->contype = CONSTR_UNIQUE; n->location = @1; n->keys = NIL; n->options = NIL; n->indexname = $2; n->indexspace = NULL; processCASbits($3, @3, "UNIQUE", &n->deferrable, &n->initdeferred, NULL, NULL, yyscanner); $$ = (Node *)n; } | PRIMARY KEY '(' columnList ')' opt_definition OptConsTableSpace ConstraintAttributeSpec { Constraint *n = makeNode(Constraint); n->contype = CONSTR_PRIMARY; n->location = @1; n->keys = $4; n->options = $6; n->indexname = NULL; n->indexspace = $7; processCASbits($8, @8, "PRIMARY KEY", &n->deferrable, &n->initdeferred, NULL, NULL, yyscanner); $$ = (Node *)n; } | PRIMARY KEY ExistingIndex ConstraintAttributeSpec { Constraint *n = makeNode(Constraint); n->contype = CONSTR_PRIMARY; n->location = @1; n->keys = NIL; n->options = NIL; n->indexname = $3; n->indexspace = NULL; processCASbits($4, @4, "PRIMARY KEY", &n->deferrable, &n->initdeferred, NULL, NULL, yyscanner); $$ = (Node *)n; } | EXCLUDE access_method_clause '(' ExclusionConstraintList ')' opt_definition OptConsTableSpace ExclusionWhereClause ConstraintAttributeSpec { Constraint *n = makeNode(Constraint); n->contype = CONSTR_EXCLUSION; n->location = @1; n->access_method = $2; n->exclusions = $4; n->options = $6; n->indexname = NULL; n->indexspace = $7; n->where_clause = $8; processCASbits($9, @9, "EXCLUDE", &n->deferrable, &n->initdeferred, NULL, NULL, yyscanner); $$ = (Node *)n; } | FOREIGN KEY '(' columnList ')' REFERENCES qualified_name opt_column_list key_match key_actions ConstraintAttributeSpec { Constraint *n = makeNode(Constraint); n->contype = CONSTR_FOREIGN; n->location = @1; n->pktable = $7; n->fk_attrs = $4; n->pk_attrs = $8; n->fk_matchtype = $9; n->fk_upd_action = (char) ($10 >> 8); n->fk_del_action = (char) ($10 & 0xFF); processCASbits($11, @11, "FOREIGN KEY", &n->deferrable, &n->initdeferred, &n->skip_validation, NULL, yyscanner); n->initially_valid = !n->skip_validation; $$ = (Node *)n; } ; opt_no_inherit: NO INHERIT { $$ = TRUE; } | /* EMPTY */ { $$ = FALSE; } ; opt_column_list: '(' columnList ')' { $$ = $2; } | /*EMPTY*/ { $$ = NIL; } ; columnList: columnElem { $$ = list_make1($1); } | columnList ',' columnElem { $$ = lappend($1, $3); } ; columnElem: ColId { $$ = (Node *) makeString($1); } ; key_match: MATCH FULL { $$ = FKCONSTR_MATCH_FULL; } | MATCH PARTIAL { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("MATCH PARTIAL not yet implemented"), parser_errposition(@1))); $$ = FKCONSTR_MATCH_PARTIAL; } | MATCH SIMPLE { $$ = FKCONSTR_MATCH_SIMPLE; } | /*EMPTY*/ { $$ = FKCONSTR_MATCH_SIMPLE; } ; ExclusionConstraintList: ExclusionConstraintElem { $$ = list_make1($1); } | ExclusionConstraintList ',' ExclusionConstraintElem { $$ = lappend($1, $3); } ; ExclusionConstraintElem: index_elem WITH any_operator { $$ = list_make2($1, $3); } /* allow OPERATOR() decoration for the benefit of ruleutils.c */ | index_elem WITH OPERATOR '(' any_operator ')' { $$ = list_make2($1, $5); } ; ExclusionWhereClause: WHERE '(' a_expr ')' { $$ = $3; } | /*EMPTY*/ { $$ = NULL; } ; /* * We combine the update and delete actions into one value temporarily * for simplicity of parsing, and then break them down again in the * calling production. update is in the left 8 bits, delete in the right. * Note that NOACTION is the default. */ key_actions: key_update { $$ = ($1 << 8) | (FKCONSTR_ACTION_NOACTION & 0xFF); } | key_delete { $$ = (FKCONSTR_ACTION_NOACTION << 8) | ($1 & 0xFF); } | key_update key_delete { $$ = ($1 << 8) | ($2 & 0xFF); } | key_delete key_update { $$ = ($2 << 8) | ($1 & 0xFF); } | /*EMPTY*/ { $$ = (FKCONSTR_ACTION_NOACTION << 8) | (FKCONSTR_ACTION_NOACTION & 0xFF); } ; key_update: ON UPDATE key_action { $$ = $3; } ; key_delete: ON DELETE_P key_action { $$ = $3; } ; key_action: NO ACTION { $$ = FKCONSTR_ACTION_NOACTION; } | RESTRICT { $$ = FKCONSTR_ACTION_RESTRICT; } | CASCADE { $$ = FKCONSTR_ACTION_CASCADE; } | SET NULL_P { $$ = FKCONSTR_ACTION_SETNULL; } | SET DEFAULT { $$ = FKCONSTR_ACTION_SETDEFAULT; } ; OptInherit: INHERITS '(' qualified_name_list ')' { $$ = $3; } | /*EMPTY*/ { $$ = NIL; } ; /* WITH (options) is preferred, WITH OIDS and WITHOUT OIDS are legacy forms */ OptWith: WITH reloptions { $$ = $2; } | WITH OIDS { $$ = list_make1(defWithOids(true)); } | WITHOUT OIDS { $$ = list_make1(defWithOids(false)); } | /*EMPTY*/ { $$ = NIL; } ; OnCommitOption: ON COMMIT DROP { $$ = ONCOMMIT_DROP; } | ON COMMIT DELETE_P ROWS { $$ = ONCOMMIT_DELETE_ROWS; } | ON COMMIT PRESERVE ROWS { $$ = ONCOMMIT_PRESERVE_ROWS; } | /*EMPTY*/ { $$ = ONCOMMIT_NOOP; } ; OptTableSpace: TABLESPACE name { $$ = $2; } | /*EMPTY*/ { $$ = NULL; } ; OptConsTableSpace: USING INDEX TABLESPACE name { $$ = $4; } | /*EMPTY*/ { $$ = NULL; } ; ExistingIndex: USING INDEX index_name { $$ = $3; } ; /***************************************************************************** * * QUERY : * CREATE TABLE relname AS SelectStmt [ WITH [NO] DATA ] * * * Note: SELECT ... INTO is a now-deprecated alternative for this. * *****************************************************************************/ CreateAsStmt: CREATE OptTemp TABLE create_as_target AS SelectStmt opt_with_data { CreateTableAsStmt *ctas = makeNode(CreateTableAsStmt); ctas->query = $6; ctas->into = $4; ctas->relkind = OBJECT_TABLE; ctas->is_select_into = false; /* cram additional flags into the IntoClause */ $4->rel->relpersistence = $2; $4->skipData = !($7); $$ = (Node *) ctas; } ; create_as_target: qualified_name opt_column_list OptWith OnCommitOption OptTableSpace { $$ = makeNode(IntoClause); $$->rel = $1; $$->colNames = $2; $$->options = $3; $$->onCommit = $4; $$->tableSpaceName = $5; $$->viewQuery = NULL; $$->skipData = false; /* might get changed later */ } ; opt_with_data: WITH DATA_P { $$ = TRUE; } | WITH NO DATA_P { $$ = FALSE; } | /*EMPTY*/ { $$ = TRUE; } ; /***************************************************************************** * * QUERY : * CREATE MATERIALIZED VIEW relname AS SelectStmt * *****************************************************************************/ CreateMatViewStmt: CREATE OptNoLog MATERIALIZED VIEW create_mv_target AS SelectStmt opt_with_data { CreateTableAsStmt *ctas = makeNode(CreateTableAsStmt); ctas->query = $7; ctas->into = $5; ctas->relkind = OBJECT_MATVIEW; ctas->is_select_into = false; /* cram additional flags into the IntoClause */ $5->rel->relpersistence = $2; $5->skipData = !($8); $$ = (Node *) ctas; } ; create_mv_target: qualified_name opt_column_list opt_reloptions OptTableSpace { $$ = makeNode(IntoClause); $$->rel = $1; $$->colNames = $2; $$->options = $3; $$->onCommit = ONCOMMIT_NOOP; $$->tableSpaceName = $4; $$->viewQuery = NULL; /* filled at analysis time */ $$->skipData = false; /* might get changed later */ } ; OptNoLog: UNLOGGED { $$ = RELPERSISTENCE_UNLOGGED; } | /*EMPTY*/ { $$ = RELPERSISTENCE_PERMANENT; } ; /***************************************************************************** * * QUERY : * REFRESH MATERIALIZED VIEW qualified_name * *****************************************************************************/ RefreshMatViewStmt: REFRESH MATERIALIZED VIEW opt_concurrently qualified_name opt_with_data { RefreshMatViewStmt *n = makeNode(RefreshMatViewStmt); n->concurrent = $4; n->relation = $5; n->skipData = !($6); $$ = (Node *) n; } ; /***************************************************************************** * * QUERY : * CREATE SEQUENCE seqname * ALTER SEQUENCE seqname * *****************************************************************************/ CreateSeqStmt: CREATE OptTemp SEQUENCE qualified_name OptSeqOptList { CreateSeqStmt *n = makeNode(CreateSeqStmt); $4->relpersistence = $2; n->sequence = $4; n->options = $5; n->ownerId = InvalidOid; $$ = (Node *)n; } ; AlterSeqStmt: ALTER SEQUENCE qualified_name SeqOptList { AlterSeqStmt *n = makeNode(AlterSeqStmt); n->sequence = $3; n->options = $4; n->missing_ok = false; $$ = (Node *)n; } | ALTER SEQUENCE IF_P EXISTS qualified_name SeqOptList { AlterSeqStmt *n = makeNode(AlterSeqStmt); n->sequence = $5; n->options = $6; n->missing_ok = true; $$ = (Node *)n; } ; OptSeqOptList: SeqOptList { $$ = $1; } | /*EMPTY*/ { $$ = NIL; } ; SeqOptList: SeqOptElem { $$ = list_make1($1); } | SeqOptList SeqOptElem { $$ = lappend($1, $2); } ; SeqOptElem: CACHE NumericOnly { $$ = makeDefElem("cache", (Node *)$2); } | CYCLE { $$ = makeDefElem("cycle", (Node *)makeInteger(TRUE)); } | NO CYCLE { $$ = makeDefElem("cycle", (Node *)makeInteger(FALSE)); } | INCREMENT opt_by NumericOnly { $$ = makeDefElem("increment", (Node *)$3); } | MAXVALUE NumericOnly { $$ = makeDefElem("maxvalue", (Node *)$2); } | MINVALUE NumericOnly { $$ = makeDefElem("minvalue", (Node *)$2); } | NO MAXVALUE { $$ = makeDefElem("maxvalue", NULL); } | NO MINVALUE { $$ = makeDefElem("minvalue", NULL); } | OWNED BY any_name { $$ = makeDefElem("owned_by", (Node *)$3); } | START opt_with NumericOnly { $$ = makeDefElem("start", (Node *)$3); } | RESTART { $$ = makeDefElem("restart", NULL); } | RESTART opt_with NumericOnly { $$ = makeDefElem("restart", (Node *)$3); } ; opt_by: BY {} | /* empty */ {} ; NumericOnly: FCONST { $$ = makeFloat($1); } | '-' FCONST { $$ = makeFloat($2); doNegateFloat($$); } | SignedIconst { $$ = makeInteger($1); } ; NumericOnly_list: NumericOnly { $$ = list_make1($1); } | NumericOnly_list ',' NumericOnly { $$ = lappend($1, $3); } ; /***************************************************************************** * * QUERIES : * CREATE [OR REPLACE] [TRUSTED] [PROCEDURAL] LANGUAGE ... * DROP [PROCEDURAL] LANGUAGE ... * *****************************************************************************/ CreatePLangStmt: CREATE opt_or_replace opt_trusted opt_procedural LANGUAGE NonReservedWord_or_Sconst { CreatePLangStmt *n = makeNode(CreatePLangStmt); n->replace = $2; n->plname = $6; /* parameters are all to be supplied by system */ n->plhandler = NIL; n->plinline = NIL; n->plvalidator = NIL; n->pltrusted = false; $$ = (Node *)n; } | CREATE opt_or_replace opt_trusted opt_procedural LANGUAGE NonReservedWord_or_Sconst HANDLER handler_name opt_inline_handler opt_validator { CreatePLangStmt *n = makeNode(CreatePLangStmt); n->replace = $2; n->plname = $6; n->plhandler = $8; n->plinline = $9; n->plvalidator = $10; n->pltrusted = $3; $$ = (Node *)n; } ; opt_trusted: TRUSTED { $$ = TRUE; } | /*EMPTY*/ { $$ = FALSE; } ; /* This ought to be just func_name, but that causes reduce/reduce conflicts * (CREATE LANGUAGE is the only place where func_name isn't followed by '('). * Work around by using simple names, instead. */ handler_name: name { $$ = list_make1(makeString($1)); } | name attrs { $$ = lcons(makeString($1), $2); } ; opt_inline_handler: INLINE_P handler_name { $$ = $2; } | /*EMPTY*/ { $$ = NIL; } ; validator_clause: VALIDATOR handler_name { $$ = $2; } | NO VALIDATOR { $$ = NIL; } ; opt_validator: validator_clause { $$ = $1; } | /*EMPTY*/ { $$ = NIL; } ; DropPLangStmt: DROP opt_procedural LANGUAGE NonReservedWord_or_Sconst opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_LANGUAGE; n->objects = list_make1(list_make1(makeString($4))); n->arguments = NIL; n->behavior = $5; n->missing_ok = false; n->concurrent = false; $$ = (Node *)n; } | DROP opt_procedural LANGUAGE IF_P EXISTS NonReservedWord_or_Sconst opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_LANGUAGE; n->objects = list_make1(list_make1(makeString($6))); n->behavior = $7; n->missing_ok = true; n->concurrent = false; $$ = (Node *)n; } ; opt_procedural: PROCEDURAL {} | /*EMPTY*/ {} ; /***************************************************************************** * * QUERY: * CREATE TABLESPACE tablespace LOCATION '/path/to/tablespace/' * *****************************************************************************/ CreateTableSpaceStmt: CREATE TABLESPACE name OptTableSpaceOwner LOCATION Sconst opt_reloptions { CreateTableSpaceStmt *n = makeNode(CreateTableSpaceStmt); n->tablespacename = $3; n->owner = $4; n->location = $6; n->options = $7; $$ = (Node *) n; } ; OptTableSpaceOwner: OWNER name { $$ = $2; } | /*EMPTY */ { $$ = NULL; } ; /***************************************************************************** * * QUERY : * DROP TABLESPACE * * No need for drop behaviour as we cannot implement dependencies for * objects in other databases; we can only support RESTRICT. * ****************************************************************************/ DropTableSpaceStmt: DROP TABLESPACE name { DropTableSpaceStmt *n = makeNode(DropTableSpaceStmt); n->tablespacename = $3; n->missing_ok = false; $$ = (Node *) n; } | DROP TABLESPACE IF_P EXISTS name { DropTableSpaceStmt *n = makeNode(DropTableSpaceStmt); n->tablespacename = $5; n->missing_ok = true; $$ = (Node *) n; } ; /***************************************************************************** * * QUERY: * CREATE EXTENSION extension * [ WITH ] [ SCHEMA schema ] [ VERSION version ] [ FROM oldversion ] * *****************************************************************************/ CreateExtensionStmt: CREATE EXTENSION name opt_with create_extension_opt_list { CreateExtensionStmt *n = makeNode(CreateExtensionStmt); n->extname = $3; n->if_not_exists = false; n->options = $5; $$ = (Node *) n; } | CREATE EXTENSION IF_P NOT EXISTS name opt_with create_extension_opt_list { CreateExtensionStmt *n = makeNode(CreateExtensionStmt); n->extname = $6; n->if_not_exists = true; n->options = $8; $$ = (Node *) n; } ; create_extension_opt_list: create_extension_opt_list create_extension_opt_item { $$ = lappend($1, $2); } | /* EMPTY */ { $$ = NIL; } ; create_extension_opt_item: SCHEMA name { $$ = makeDefElem("schema", (Node *)makeString($2)); } | VERSION_P NonReservedWord_or_Sconst { $$ = makeDefElem("new_version", (Node *)makeString($2)); } | FROM NonReservedWord_or_Sconst { $$ = makeDefElem("old_version", (Node *)makeString($2)); } ; /***************************************************************************** * * ALTER EXTENSION name UPDATE [ TO version ] * *****************************************************************************/ AlterExtensionStmt: ALTER EXTENSION name UPDATE alter_extension_opt_list { AlterExtensionStmt *n = makeNode(AlterExtensionStmt); n->extname = $3; n->options = $5; $$ = (Node *) n; } ; alter_extension_opt_list: alter_extension_opt_list alter_extension_opt_item { $$ = lappend($1, $2); } | /* EMPTY */ { $$ = NIL; } ; alter_extension_opt_item: TO NonReservedWord_or_Sconst { $$ = makeDefElem("new_version", (Node *)makeString($2)); } ; /***************************************************************************** * * ALTER EXTENSION name ADD/DROP object-identifier * *****************************************************************************/ AlterExtensionContentsStmt: ALTER EXTENSION name add_drop AGGREGATE func_name aggr_args { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = OBJECT_AGGREGATE; n->objname = $6; n->objargs = extractAggrArgTypes($7); $$ = (Node *)n; } | ALTER EXTENSION name add_drop CAST '(' Typename AS Typename ')' { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = OBJECT_CAST; n->objname = list_make1($7); n->objargs = list_make1($9); $$ = (Node *) n; } | ALTER EXTENSION name add_drop COLLATION any_name { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = OBJECT_COLLATION; n->objname = $6; $$ = (Node *)n; } | ALTER EXTENSION name add_drop CONVERSION_P any_name { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = OBJECT_CONVERSION; n->objname = $6; $$ = (Node *)n; } | ALTER EXTENSION name add_drop DOMAIN_P any_name { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = OBJECT_DOMAIN; n->objname = $6; $$ = (Node *)n; } | ALTER EXTENSION name add_drop FUNCTION function_with_argtypes { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = OBJECT_FUNCTION; n->objname = $6->funcname; n->objargs = $6->funcargs; $$ = (Node *)n; } | ALTER EXTENSION name add_drop opt_procedural LANGUAGE name { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = OBJECT_LANGUAGE; n->objname = list_make1(makeString($7)); $$ = (Node *)n; } | ALTER EXTENSION name add_drop OPERATOR any_operator oper_argtypes { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = OBJECT_OPERATOR; n->objname = $6; n->objargs = $7; $$ = (Node *)n; } | ALTER EXTENSION name add_drop OPERATOR CLASS any_name USING access_method { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = OBJECT_OPCLASS; n->objname = $7; n->objargs = list_make1(makeString($9)); $$ = (Node *)n; } | ALTER EXTENSION name add_drop OPERATOR FAMILY any_name USING access_method { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = OBJECT_OPFAMILY; n->objname = $7; n->objargs = list_make1(makeString($9)); $$ = (Node *)n; } | ALTER EXTENSION name add_drop SCHEMA name { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = OBJECT_SCHEMA; n->objname = list_make1(makeString($6)); $$ = (Node *)n; } | ALTER EXTENSION name add_drop EVENT TRIGGER name { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = OBJECT_EVENT_TRIGGER; n->objname = list_make1(makeString($7)); $$ = (Node *)n; } | ALTER EXTENSION name add_drop TABLE any_name { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = OBJECT_TABLE; n->objname = $6; $$ = (Node *)n; } | ALTER EXTENSION name add_drop TEXT_P SEARCH PARSER any_name { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = OBJECT_TSPARSER; n->objname = $8; $$ = (Node *)n; } | ALTER EXTENSION name add_drop TEXT_P SEARCH DICTIONARY any_name { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = OBJECT_TSDICTIONARY; n->objname = $8; $$ = (Node *)n; } | ALTER EXTENSION name add_drop TEXT_P SEARCH TEMPLATE any_name { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = OBJECT_TSTEMPLATE; n->objname = $8; $$ = (Node *)n; } | ALTER EXTENSION name add_drop TEXT_P SEARCH CONFIGURATION any_name { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = OBJECT_TSCONFIGURATION; n->objname = $8; $$ = (Node *)n; } | ALTER EXTENSION name add_drop SEQUENCE any_name { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = OBJECT_SEQUENCE; n->objname = $6; $$ = (Node *)n; } | ALTER EXTENSION name add_drop VIEW any_name { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = OBJECT_VIEW; n->objname = $6; $$ = (Node *)n; } | ALTER EXTENSION name add_drop MATERIALIZED VIEW any_name { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = OBJECT_MATVIEW; n->objname = $7; $$ = (Node *)n; } | ALTER EXTENSION name add_drop FOREIGN TABLE any_name { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = OBJECT_FOREIGN_TABLE; n->objname = $7; $$ = (Node *)n; } | ALTER EXTENSION name add_drop FOREIGN DATA_P WRAPPER name { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = OBJECT_FDW; n->objname = list_make1(makeString($8)); $$ = (Node *)n; } | ALTER EXTENSION name add_drop SERVER name { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = OBJECT_FOREIGN_SERVER; n->objname = list_make1(makeString($6)); $$ = (Node *)n; } | ALTER EXTENSION name add_drop TYPE_P any_name { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = OBJECT_TYPE; n->objname = $6; $$ = (Node *)n; } ; /***************************************************************************** * * QUERY: * CREATE FOREIGN DATA WRAPPER name options * *****************************************************************************/ CreateFdwStmt: CREATE FOREIGN DATA_P WRAPPER name opt_fdw_options create_generic_options { CreateFdwStmt *n = makeNode(CreateFdwStmt); n->fdwname = $5; n->func_options = $6; n->options = $7; $$ = (Node *) n; } ; fdw_option: HANDLER handler_name { $$ = makeDefElem("handler", (Node *)$2); } | NO HANDLER { $$ = makeDefElem("handler", NULL); } | VALIDATOR handler_name { $$ = makeDefElem("validator", (Node *)$2); } | NO VALIDATOR { $$ = makeDefElem("validator", NULL); } ; fdw_options: fdw_option { $$ = list_make1($1); } | fdw_options fdw_option { $$ = lappend($1, $2); } ; opt_fdw_options: fdw_options { $$ = $1; } | /*EMPTY*/ { $$ = NIL; } ; /***************************************************************************** * * QUERY : * DROP FOREIGN DATA WRAPPER name * ****************************************************************************/ DropFdwStmt: DROP FOREIGN DATA_P WRAPPER name opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_FDW; n->objects = list_make1(list_make1(makeString($5))); n->arguments = NIL; n->missing_ok = false; n->behavior = $6; n->concurrent = false; $$ = (Node *) n; } | DROP FOREIGN DATA_P WRAPPER IF_P EXISTS name opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_FDW; n->objects = list_make1(list_make1(makeString($7))); n->arguments = NIL; n->missing_ok = true; n->behavior = $8; n->concurrent = false; $$ = (Node *) n; } ; /***************************************************************************** * * QUERY : * ALTER FOREIGN DATA WRAPPER name options * ****************************************************************************/ AlterFdwStmt: ALTER FOREIGN DATA_P WRAPPER name opt_fdw_options alter_generic_options { AlterFdwStmt *n = makeNode(AlterFdwStmt); n->fdwname = $5; n->func_options = $6; n->options = $7; $$ = (Node *) n; } | ALTER FOREIGN DATA_P WRAPPER name fdw_options { AlterFdwStmt *n = makeNode(AlterFdwStmt); n->fdwname = $5; n->func_options = $6; n->options = NIL; $$ = (Node *) n; } ; /* Options definition for CREATE FDW, SERVER and USER MAPPING */ create_generic_options: OPTIONS '(' generic_option_list ')' { $$ = $3; } | /*EMPTY*/ { $$ = NIL; } ; generic_option_list: generic_option_elem { $$ = list_make1($1); } | generic_option_list ',' generic_option_elem { $$ = lappend($1, $3); } ; /* Options definition for ALTER FDW, SERVER and USER MAPPING */ alter_generic_options: OPTIONS '(' alter_generic_option_list ')' { $$ = $3; } ; alter_generic_option_list: alter_generic_option_elem { $$ = list_make1($1); } | alter_generic_option_list ',' alter_generic_option_elem { $$ = lappend($1, $3); } ; alter_generic_option_elem: generic_option_elem { $$ = $1; } | SET generic_option_elem { $$ = $2; $$->defaction = DEFELEM_SET; } | ADD_P generic_option_elem { $$ = $2; $$->defaction = DEFELEM_ADD; } | DROP generic_option_name { $$ = makeDefElemExtended(NULL, $2, NULL, DEFELEM_DROP); } ; generic_option_elem: generic_option_name generic_option_arg { $$ = makeDefElem($1, $2); } ; generic_option_name: ColLabel { $$ = $1; } ; /* We could use def_arg here, but the spec only requires string literals */ generic_option_arg: Sconst { $$ = (Node *) makeString($1); } ; /***************************************************************************** * * QUERY: * CREATE SERVER name [TYPE] [VERSION] [OPTIONS] * *****************************************************************************/ CreateForeignServerStmt: CREATE SERVER name opt_type opt_foreign_server_version FOREIGN DATA_P WRAPPER name create_generic_options { CreateForeignServerStmt *n = makeNode(CreateForeignServerStmt); n->servername = $3; n->servertype = $4; n->version = $5; n->fdwname = $9; n->options = $10; $$ = (Node *) n; } ; opt_type: TYPE_P Sconst { $$ = $2; } | /*EMPTY*/ { $$ = NULL; } ; foreign_server_version: VERSION_P Sconst { $$ = $2; } | VERSION_P NULL_P { $$ = NULL; } ; opt_foreign_server_version: foreign_server_version { $$ = $1; } | /*EMPTY*/ { $$ = NULL; } ; /***************************************************************************** * * QUERY : * DROP SERVER name * ****************************************************************************/ DropForeignServerStmt: DROP SERVER name opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_FOREIGN_SERVER; n->objects = list_make1(list_make1(makeString($3))); n->arguments = NIL; n->missing_ok = false; n->behavior = $4; n->concurrent = false; $$ = (Node *) n; } | DROP SERVER IF_P EXISTS name opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_FOREIGN_SERVER; n->objects = list_make1(list_make1(makeString($5))); n->arguments = NIL; n->missing_ok = true; n->behavior = $6; n->concurrent = false; $$ = (Node *) n; } ; /***************************************************************************** * * QUERY : * ALTER SERVER name [VERSION] [OPTIONS] * ****************************************************************************/ AlterForeignServerStmt: ALTER SERVER name foreign_server_version alter_generic_options { AlterForeignServerStmt *n = makeNode(AlterForeignServerStmt); n->servername = $3; n->version = $4; n->options = $5; n->has_version = true; $$ = (Node *) n; } | ALTER SERVER name foreign_server_version { AlterForeignServerStmt *n = makeNode(AlterForeignServerStmt); n->servername = $3; n->version = $4; n->has_version = true; $$ = (Node *) n; } | ALTER SERVER name alter_generic_options { AlterForeignServerStmt *n = makeNode(AlterForeignServerStmt); n->servername = $3; n->options = $4; $$ = (Node *) n; } ; /***************************************************************************** * * QUERY: * CREATE FOREIGN TABLE relname (...) SERVER name (...) * *****************************************************************************/ CreateForeignTableStmt: CREATE FOREIGN TABLE qualified_name '(' OptTableElementList ')' SERVER name create_generic_options { CreateForeignTableStmt *n = makeNode(CreateForeignTableStmt); $4->relpersistence = RELPERSISTENCE_PERMANENT; n->base.relation = $4; n->base.tableElts = $6; n->base.inhRelations = NIL; n->base.if_not_exists = false; /* FDW-specific data */ n->servername = $9; n->options = $10; $$ = (Node *) n; } | CREATE FOREIGN TABLE IF_P NOT EXISTS qualified_name '(' OptTableElementList ')' SERVER name create_generic_options { CreateForeignTableStmt *n = makeNode(CreateForeignTableStmt); $7->relpersistence = RELPERSISTENCE_PERMANENT; n->base.relation = $7; n->base.tableElts = $9; n->base.inhRelations = NIL; n->base.if_not_exists = true; /* FDW-specific data */ n->servername = $12; n->options = $13; $$ = (Node *) n; } ; /***************************************************************************** * * QUERY: * ALTER FOREIGN TABLE relname [...] * *****************************************************************************/ AlterForeignTableStmt: ALTER FOREIGN TABLE relation_expr alter_table_cmds { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = $4; n->cmds = $5; n->relkind = OBJECT_FOREIGN_TABLE; n->missing_ok = false; $$ = (Node *)n; } | ALTER FOREIGN TABLE IF_P EXISTS relation_expr alter_table_cmds { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = $6; n->cmds = $7; n->relkind = OBJECT_FOREIGN_TABLE; n->missing_ok = true; $$ = (Node *)n; } ; /***************************************************************************** * * QUERY: * CREATE USER MAPPING FOR auth_ident SERVER name [OPTIONS] * *****************************************************************************/ CreateUserMappingStmt: CREATE USER MAPPING FOR auth_ident SERVER name create_generic_options { CreateUserMappingStmt *n = makeNode(CreateUserMappingStmt); n->username = $5; n->servername = $7; n->options = $8; $$ = (Node *) n; } ; /* User mapping authorization identifier */ auth_ident: CURRENT_USER { $$ = "current_user"; } | USER { $$ = "current_user"; } | RoleId { $$ = (strcmp($1, "public") == 0) ? NULL : $1; } ; /***************************************************************************** * * QUERY : * DROP USER MAPPING FOR auth_ident SERVER name * ****************************************************************************/ DropUserMappingStmt: DROP USER MAPPING FOR auth_ident SERVER name { DropUserMappingStmt *n = makeNode(DropUserMappingStmt); n->username = $5; n->servername = $7; n->missing_ok = false; $$ = (Node *) n; } | DROP USER MAPPING IF_P EXISTS FOR auth_ident SERVER name { DropUserMappingStmt *n = makeNode(DropUserMappingStmt); n->username = $7; n->servername = $9; n->missing_ok = true; $$ = (Node *) n; } ; /***************************************************************************** * * QUERY : * ALTER USER MAPPING FOR auth_ident SERVER name OPTIONS * ****************************************************************************/ AlterUserMappingStmt: ALTER USER MAPPING FOR auth_ident SERVER name alter_generic_options { AlterUserMappingStmt *n = makeNode(AlterUserMappingStmt); n->username = $5; n->servername = $7; n->options = $8; $$ = (Node *) n; } ; /***************************************************************************** * * QUERIES : * CREATE TRIGGER ... * DROP TRIGGER ... * *****************************************************************************/ CreateTrigStmt: CREATE TRIGGER name TriggerActionTime TriggerEvents ON qualified_name TriggerForSpec TriggerWhen EXECUTE PROCEDURE func_name '(' TriggerFuncArgs ')' { CreateTrigStmt *n = makeNode(CreateTrigStmt); n->trigname = $3; n->relation = $7; n->funcname = $12; n->args = $14; n->row = $8; n->timing = $4; n->events = intVal(linitial($5)); n->columns = (List *) lsecond($5); n->whenClause = $9; n->isconstraint = FALSE; n->deferrable = FALSE; n->initdeferred = FALSE; n->constrrel = NULL; $$ = (Node *)n; } | CREATE CONSTRAINT TRIGGER name AFTER TriggerEvents ON qualified_name OptConstrFromTable ConstraintAttributeSpec FOR EACH ROW TriggerWhen EXECUTE PROCEDURE func_name '(' TriggerFuncArgs ')' { CreateTrigStmt *n = makeNode(CreateTrigStmt); n->trigname = $4; n->relation = $8; n->funcname = $17; n->args = $19; n->row = TRUE; n->timing = TRIGGER_TYPE_AFTER; n->events = intVal(linitial($6)); n->columns = (List *) lsecond($6); n->whenClause = $14; n->isconstraint = TRUE; processCASbits($10, @10, "TRIGGER", &n->deferrable, &n->initdeferred, NULL, NULL, yyscanner); n->constrrel = $9; $$ = (Node *)n; } ; TriggerActionTime: BEFORE { $$ = TRIGGER_TYPE_BEFORE; } | AFTER { $$ = TRIGGER_TYPE_AFTER; } | INSTEAD OF { $$ = TRIGGER_TYPE_INSTEAD; } ; TriggerEvents: TriggerOneEvent { $$ = $1; } | TriggerEvents OR TriggerOneEvent { int events1 = intVal(linitial($1)); int events2 = intVal(linitial($3)); List *columns1 = (List *) lsecond($1); List *columns2 = (List *) lsecond($3); if (events1 & events2) parser_yyerror("duplicate trigger events specified"); /* * concat'ing the columns lists loses information about * which columns went with which event, but so long as * only UPDATE carries columns and we disallow multiple * UPDATE items, it doesn't matter. Command execution * should just ignore the columns for non-UPDATE events. */ $$ = list_make2(makeInteger(events1 | events2), list_concat(columns1, columns2)); } ; TriggerOneEvent: INSERT { $$ = list_make2(makeInteger(TRIGGER_TYPE_INSERT), NIL); } | DELETE_P { $$ = list_make2(makeInteger(TRIGGER_TYPE_DELETE), NIL); } | UPDATE { $$ = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), NIL); } | UPDATE OF columnList { $$ = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), $3); } | TRUNCATE { $$ = list_make2(makeInteger(TRIGGER_TYPE_TRUNCATE), NIL); } ; TriggerForSpec: FOR TriggerForOptEach TriggerForType { $$ = $3; } | /* EMPTY */ { /* * If ROW/STATEMENT not specified, default to * STATEMENT, per SQL */ $$ = FALSE; } ; TriggerForOptEach: EACH {} | /*EMPTY*/ {} ; TriggerForType: ROW { $$ = TRUE; } | STATEMENT { $$ = FALSE; } ; TriggerWhen: WHEN '(' a_expr ')' { $$ = $3; } | /*EMPTY*/ { $$ = NULL; } ; TriggerFuncArgs: TriggerFuncArg { $$ = list_make1($1); } | TriggerFuncArgs ',' TriggerFuncArg { $$ = lappend($1, $3); } | /*EMPTY*/ { $$ = NIL; } ; TriggerFuncArg: Iconst { char buf[64]; snprintf(buf, sizeof(buf), "%d", $1); $$ = makeString(pstrdup(buf)); } | FCONST { $$ = makeString($1); } | Sconst { $$ = makeString($1); } | ColLabel { $$ = makeString($1); } ; OptConstrFromTable: FROM qualified_name { $$ = $2; } | /*EMPTY*/ { $$ = NULL; } ; ConstraintAttributeSpec: /*EMPTY*/ { $$ = 0; } | ConstraintAttributeSpec ConstraintAttributeElem { /* * We must complain about conflicting options. * We could, but choose not to, complain about redundant * options (ie, where $2's bit is already set in $1). */ int newspec = $1 | $2; /* special message for this case */ if ((newspec & (CAS_NOT_DEFERRABLE | CAS_INITIALLY_DEFERRED)) == (CAS_NOT_DEFERRABLE | CAS_INITIALLY_DEFERRED)) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("constraint declared INITIALLY DEFERRED must be DEFERRABLE"), parser_errposition(@2))); /* generic message for other conflicts */ if ((newspec & (CAS_NOT_DEFERRABLE | CAS_DEFERRABLE)) == (CAS_NOT_DEFERRABLE | CAS_DEFERRABLE) || (newspec & (CAS_INITIALLY_IMMEDIATE | CAS_INITIALLY_DEFERRED)) == (CAS_INITIALLY_IMMEDIATE | CAS_INITIALLY_DEFERRED)) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("conflicting constraint properties"), parser_errposition(@2))); $$ = newspec; } ; ConstraintAttributeElem: NOT DEFERRABLE { $$ = CAS_NOT_DEFERRABLE; } | DEFERRABLE { $$ = CAS_DEFERRABLE; } | INITIALLY IMMEDIATE { $$ = CAS_INITIALLY_IMMEDIATE; } | INITIALLY DEFERRED { $$ = CAS_INITIALLY_DEFERRED; } | NOT VALID { $$ = CAS_NOT_VALID; } | NO INHERIT { $$ = CAS_NO_INHERIT; } ; DropTrigStmt: DROP TRIGGER name ON any_name opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_TRIGGER; n->objects = list_make1(lappend($5, makeString($3))); n->arguments = NIL; n->behavior = $6; n->missing_ok = false; n->concurrent = false; $$ = (Node *) n; } | DROP TRIGGER IF_P EXISTS name ON any_name opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_TRIGGER; n->objects = list_make1(lappend($7, makeString($5))); n->arguments = NIL; n->behavior = $8; n->missing_ok = true; n->concurrent = false; $$ = (Node *) n; } ; /***************************************************************************** * * QUERIES : * CREATE EVENT TRIGGER ... * ALTER EVENT TRIGGER ... * *****************************************************************************/ CreateEventTrigStmt: CREATE EVENT TRIGGER name ON ColLabel EXECUTE PROCEDURE func_name '(' ')' { CreateEventTrigStmt *n = makeNode(CreateEventTrigStmt); n->trigname = $4; n->eventname = $6; n->whenclause = NULL; n->funcname = $9; $$ = (Node *)n; } | CREATE EVENT TRIGGER name ON ColLabel WHEN event_trigger_when_list EXECUTE PROCEDURE func_name '(' ')' { CreateEventTrigStmt *n = makeNode(CreateEventTrigStmt); n->trigname = $4; n->eventname = $6; n->whenclause = $8; n->funcname = $11; $$ = (Node *)n; } ; event_trigger_when_list: event_trigger_when_item { $$ = list_make1($1); } | event_trigger_when_list AND event_trigger_when_item { $$ = lappend($1, $3); } ; event_trigger_when_item: ColId IN_P '(' event_trigger_value_list ')' { $$ = makeDefElem($1, (Node *) $4); } ; event_trigger_value_list: SCONST { $$ = list_make1(makeString($1)); } | event_trigger_value_list ',' SCONST { $$ = lappend($1, makeString($3)); } ; AlterEventTrigStmt: ALTER EVENT TRIGGER name enable_trigger { AlterEventTrigStmt *n = makeNode(AlterEventTrigStmt); n->trigname = $4; n->tgenabled = $5; $$ = (Node *) n; } ; enable_trigger: ENABLE_P { $$ = TRIGGER_FIRES_ON_ORIGIN; } | ENABLE_P REPLICA { $$ = TRIGGER_FIRES_ON_REPLICA; } | ENABLE_P ALWAYS { $$ = TRIGGER_FIRES_ALWAYS; } | DISABLE_P { $$ = TRIGGER_DISABLED; } ; /***************************************************************************** * * QUERIES : * CREATE ASSERTION ... * DROP ASSERTION ... * *****************************************************************************/ CreateAssertStmt: CREATE ASSERTION name CHECK '(' a_expr ')' ConstraintAttributeSpec { CreateTrigStmt *n = makeNode(CreateTrigStmt); n->trigname = $3; n->args = list_make1($6); n->isconstraint = TRUE; processCASbits($8, @8, "ASSERTION", &n->deferrable, &n->initdeferred, NULL, NULL, yyscanner); ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("CREATE ASSERTION is not yet implemented"))); $$ = (Node *)n; } ; DropAssertStmt: DROP ASSERTION name opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->objects = NIL; n->arguments = NIL; n->behavior = $4; n->removeType = OBJECT_TRIGGER; /* XXX */ ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("DROP ASSERTION is not yet implemented"))); $$ = (Node *) n; } ; /***************************************************************************** * * QUERY : * define (aggregate,operator,type) * *****************************************************************************/ DefineStmt: CREATE AGGREGATE func_name aggr_args definition { DefineStmt *n = makeNode(DefineStmt); n->kind = OBJECT_AGGREGATE; n->oldstyle = false; n->defnames = $3; n->args = $4; n->definition = $5; $$ = (Node *)n; } | CREATE AGGREGATE func_name old_aggr_definition { /* old-style (pre-8.2) syntax for CREATE AGGREGATE */ DefineStmt *n = makeNode(DefineStmt); n->kind = OBJECT_AGGREGATE; n->oldstyle = true; n->defnames = $3; n->args = NIL; n->definition = $4; $$ = (Node *)n; } | CREATE OPERATOR any_operator definition { DefineStmt *n = makeNode(DefineStmt); n->kind = OBJECT_OPERATOR; n->oldstyle = false; n->defnames = $3; n->args = NIL; n->definition = $4; $$ = (Node *)n; } | CREATE TYPE_P any_name definition { DefineStmt *n = makeNode(DefineStmt); n->kind = OBJECT_TYPE; n->oldstyle = false; n->defnames = $3; n->args = NIL; n->definition = $4; $$ = (Node *)n; } | CREATE TYPE_P any_name { /* Shell type (identified by lack of definition) */ DefineStmt *n = makeNode(DefineStmt); n->kind = OBJECT_TYPE; n->oldstyle = false; n->defnames = $3; n->args = NIL; n->definition = NIL; $$ = (Node *)n; } | CREATE TYPE_P any_name AS '(' OptTableFuncElementList ')' { CompositeTypeStmt *n = makeNode(CompositeTypeStmt); /* can't use qualified_name, sigh */ n->typevar = makeRangeVarFromAnyName($3, @3, yyscanner); n->coldeflist = $6; $$ = (Node *)n; } | CREATE TYPE_P any_name AS ENUM_P '(' opt_enum_val_list ')' { CreateEnumStmt *n = makeNode(CreateEnumStmt); n->typeName = $3; n->vals = $7; $$ = (Node *)n; } | CREATE TYPE_P any_name AS RANGE definition { CreateRangeStmt *n = makeNode(CreateRangeStmt); n->typeName = $3; n->params = $6; $$ = (Node *)n; } | CREATE TEXT_P SEARCH PARSER any_name definition { DefineStmt *n = makeNode(DefineStmt); n->kind = OBJECT_TSPARSER; n->args = NIL; n->defnames = $5; n->definition = $6; $$ = (Node *)n; } | CREATE TEXT_P SEARCH DICTIONARY any_name definition { DefineStmt *n = makeNode(DefineStmt); n->kind = OBJECT_TSDICTIONARY; n->args = NIL; n->defnames = $5; n->definition = $6; $$ = (Node *)n; } | CREATE TEXT_P SEARCH TEMPLATE any_name definition { DefineStmt *n = makeNode(DefineStmt); n->kind = OBJECT_TSTEMPLATE; n->args = NIL; n->defnames = $5; n->definition = $6; $$ = (Node *)n; } | CREATE TEXT_P SEARCH CONFIGURATION any_name definition { DefineStmt *n = makeNode(DefineStmt); n->kind = OBJECT_TSCONFIGURATION; n->args = NIL; n->defnames = $5; n->definition = $6; $$ = (Node *)n; } | CREATE COLLATION any_name definition { DefineStmt *n = makeNode(DefineStmt); n->kind = OBJECT_COLLATION; n->args = NIL; n->defnames = $3; n->definition = $4; $$ = (Node *)n; } | CREATE COLLATION any_name FROM any_name { DefineStmt *n = makeNode(DefineStmt); n->kind = OBJECT_COLLATION; n->args = NIL; n->defnames = $3; n->definition = list_make1(makeDefElem("from", (Node *) $5)); $$ = (Node *)n; } ; definition: '(' def_list ')' { $$ = $2; } ; def_list: def_elem { $$ = list_make1($1); } | def_list ',' def_elem { $$ = lappend($1, $3); } ; def_elem: ColLabel '=' def_arg { $$ = makeDefElem($1, (Node *) $3); } | ColLabel { $$ = makeDefElem($1, NULL); } ; /* Note: any simple identifier will be returned as a type name! */ def_arg: func_type { $$ = (Node *)$1; } | reserved_keyword { $$ = (Node *)makeString(pstrdup($1)); } | qual_all_Op { $$ = (Node *)$1; } | NumericOnly { $$ = (Node *)$1; } | Sconst { $$ = (Node *)makeString($1); } ; old_aggr_definition: '(' old_aggr_list ')' { $$ = $2; } ; old_aggr_list: old_aggr_elem { $$ = list_make1($1); } | old_aggr_list ',' old_aggr_elem { $$ = lappend($1, $3); } ; /* * Must use IDENT here to avoid reduce/reduce conflicts; fortunately none of * the item names needed in old aggregate definitions are likely to become * SQL keywords. */ old_aggr_elem: IDENT '=' def_arg { $$ = makeDefElem($1, (Node *)$3); } ; opt_enum_val_list: enum_val_list { $$ = $1; } | /*EMPTY*/ { $$ = NIL; } ; enum_val_list: Sconst { $$ = list_make1(makeString($1)); } | enum_val_list ',' Sconst { $$ = lappend($1, makeString($3)); } ; /***************************************************************************** * * ALTER TYPE enumtype ADD ... * *****************************************************************************/ AlterEnumStmt: ALTER TYPE_P any_name ADD_P VALUE_P opt_if_not_exists Sconst { AlterEnumStmt *n = makeNode(AlterEnumStmt); n->typeName = $3; n->newVal = $7; n->newValNeighbor = NULL; n->newValIsAfter = true; n->skipIfExists = $6; $$ = (Node *) n; } | ALTER TYPE_P any_name ADD_P VALUE_P opt_if_not_exists Sconst BEFORE Sconst { AlterEnumStmt *n = makeNode(AlterEnumStmt); n->typeName = $3; n->newVal = $7; n->newValNeighbor = $9; n->newValIsAfter = false; n->skipIfExists = $6; $$ = (Node *) n; } | ALTER TYPE_P any_name ADD_P VALUE_P opt_if_not_exists Sconst AFTER Sconst { AlterEnumStmt *n = makeNode(AlterEnumStmt); n->typeName = $3; n->newVal = $7; n->newValNeighbor = $9; n->newValIsAfter = true; n->skipIfExists = $6; $$ = (Node *) n; } ; opt_if_not_exists: IF_P NOT EXISTS { $$ = true; } | /* empty */ { $$ = false; } ; /***************************************************************************** * * QUERIES : * CREATE OPERATOR CLASS ... * CREATE OPERATOR FAMILY ... * ALTER OPERATOR FAMILY ... * DROP OPERATOR CLASS ... * DROP OPERATOR FAMILY ... * *****************************************************************************/ CreateOpClassStmt: CREATE OPERATOR CLASS any_name opt_default FOR TYPE_P Typename USING access_method opt_opfamily AS opclass_item_list { CreateOpClassStmt *n = makeNode(CreateOpClassStmt); n->opclassname = $4; n->isDefault = $5; n->datatype = $8; n->amname = $10; n->opfamilyname = $11; n->items = $13; $$ = (Node *) n; } ; opclass_item_list: opclass_item { $$ = list_make1($1); } | opclass_item_list ',' opclass_item { $$ = lappend($1, $3); } ; opclass_item: OPERATOR Iconst any_operator opclass_purpose opt_recheck { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_OPERATOR; n->name = $3; n->args = NIL; n->number = $2; n->order_family = $4; $$ = (Node *) n; } | OPERATOR Iconst any_operator oper_argtypes opclass_purpose opt_recheck { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_OPERATOR; n->name = $3; n->args = $4; n->number = $2; n->order_family = $5; $$ = (Node *) n; } | FUNCTION Iconst func_name func_args { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_FUNCTION; n->name = $3; n->args = extractArgTypes($4); n->number = $2; $$ = (Node *) n; } | FUNCTION Iconst '(' type_list ')' func_name func_args { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_FUNCTION; n->name = $6; n->args = extractArgTypes($7); n->number = $2; n->class_args = $4; $$ = (Node *) n; } | STORAGE Typename { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_STORAGETYPE; n->storedtype = $2; $$ = (Node *) n; } ; opt_default: DEFAULT { $$ = TRUE; } | /*EMPTY*/ { $$ = FALSE; } ; opt_opfamily: FAMILY any_name { $$ = $2; } | /*EMPTY*/ { $$ = NIL; } ; opclass_purpose: FOR SEARCH { $$ = NIL; } | FOR ORDER BY any_name { $$ = $4; } | /*EMPTY*/ { $$ = NIL; } ; opt_recheck: RECHECK { /* * RECHECK no longer does anything in opclass definitions, * but we still accept it to ease porting of old database * dumps. */ ereport(NOTICE, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("RECHECK is no longer required"), errhint("Update your data type."), parser_errposition(@1))); $$ = TRUE; } | /*EMPTY*/ { $$ = FALSE; } ; CreateOpFamilyStmt: CREATE OPERATOR FAMILY any_name USING access_method { CreateOpFamilyStmt *n = makeNode(CreateOpFamilyStmt); n->opfamilyname = $4; n->amname = $6; $$ = (Node *) n; } ; AlterOpFamilyStmt: ALTER OPERATOR FAMILY any_name USING access_method ADD_P opclass_item_list { AlterOpFamilyStmt *n = makeNode(AlterOpFamilyStmt); n->opfamilyname = $4; n->amname = $6; n->isDrop = false; n->items = $8; $$ = (Node *) n; } | ALTER OPERATOR FAMILY any_name USING access_method DROP opclass_drop_list { AlterOpFamilyStmt *n = makeNode(AlterOpFamilyStmt); n->opfamilyname = $4; n->amname = $6; n->isDrop = true; n->items = $8; $$ = (Node *) n; } ; opclass_drop_list: opclass_drop { $$ = list_make1($1); } | opclass_drop_list ',' opclass_drop { $$ = lappend($1, $3); } ; opclass_drop: OPERATOR Iconst '(' type_list ')' { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_OPERATOR; n->number = $2; n->args = $4; $$ = (Node *) n; } | FUNCTION Iconst '(' type_list ')' { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_FUNCTION; n->number = $2; n->args = $4; $$ = (Node *) n; } ; DropOpClassStmt: DROP OPERATOR CLASS any_name USING access_method opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->objects = list_make1($4); n->arguments = list_make1(list_make1(makeString($6))); n->removeType = OBJECT_OPCLASS; n->behavior = $7; n->missing_ok = false; n->concurrent = false; $$ = (Node *) n; } | DROP OPERATOR CLASS IF_P EXISTS any_name USING access_method opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->objects = list_make1($6); n->arguments = list_make1(list_make1(makeString($8))); n->removeType = OBJECT_OPCLASS; n->behavior = $9; n->missing_ok = true; n->concurrent = false; $$ = (Node *) n; } ; DropOpFamilyStmt: DROP OPERATOR FAMILY any_name USING access_method opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->objects = list_make1($4); n->arguments = list_make1(list_make1(makeString($6))); n->removeType = OBJECT_OPFAMILY; n->behavior = $7; n->missing_ok = false; n->concurrent = false; $$ = (Node *) n; } | DROP OPERATOR FAMILY IF_P EXISTS any_name USING access_method opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->objects = list_make1($6); n->arguments = list_make1(list_make1(makeString($8))); n->removeType = OBJECT_OPFAMILY; n->behavior = $9; n->missing_ok = true; n->concurrent = false; $$ = (Node *) n; } ; /***************************************************************************** * * QUERY: * * DROP OWNED BY username [, username ...] [ RESTRICT | CASCADE ] * REASSIGN OWNED BY username [, username ...] TO username * *****************************************************************************/ DropOwnedStmt: DROP OWNED BY role_list opt_drop_behavior { DropOwnedStmt *n = makeNode(DropOwnedStmt); n->roles = $4; n->behavior = $5; $$ = (Node *)n; } ; ReassignOwnedStmt: REASSIGN OWNED BY role_list TO name { ReassignOwnedStmt *n = makeNode(ReassignOwnedStmt); n->roles = $4; n->newrole = $6; $$ = (Node *)n; } ; /***************************************************************************** * * QUERY: * * DROP itemtype [ IF EXISTS ] itemname [, itemname ...] * [ RESTRICT | CASCADE ] * *****************************************************************************/ DropStmt: DROP drop_type IF_P EXISTS any_name_list opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->removeType = $2; n->missing_ok = TRUE; n->objects = $5; n->arguments = NIL; n->behavior = $6; n->concurrent = false; $$ = (Node *)n; } | DROP drop_type any_name_list opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->removeType = $2; n->missing_ok = FALSE; n->objects = $3; n->arguments = NIL; n->behavior = $4; n->concurrent = false; $$ = (Node *)n; } | DROP INDEX CONCURRENTLY any_name_list opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_INDEX; n->missing_ok = FALSE; n->objects = $4; n->arguments = NIL; n->behavior = $5; n->concurrent = true; $$ = (Node *)n; } | DROP INDEX CONCURRENTLY IF_P EXISTS any_name_list opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_INDEX; n->missing_ok = TRUE; n->objects = $6; n->arguments = NIL; n->behavior = $7; n->concurrent = true; $$ = (Node *)n; } ; drop_type: TABLE { $$ = OBJECT_TABLE; } | SEQUENCE { $$ = OBJECT_SEQUENCE; } | VIEW { $$ = OBJECT_VIEW; } | MATERIALIZED VIEW { $$ = OBJECT_MATVIEW; } | INDEX { $$ = OBJECT_INDEX; } | FOREIGN TABLE { $$ = OBJECT_FOREIGN_TABLE; } | EVENT TRIGGER { $$ = OBJECT_EVENT_TRIGGER; } | TYPE_P { $$ = OBJECT_TYPE; } | DOMAIN_P { $$ = OBJECT_DOMAIN; } | COLLATION { $$ = OBJECT_COLLATION; } | CONVERSION_P { $$ = OBJECT_CONVERSION; } | SCHEMA { $$ = OBJECT_SCHEMA; } | EXTENSION { $$ = OBJECT_EXTENSION; } | TEXT_P SEARCH PARSER { $$ = OBJECT_TSPARSER; } | TEXT_P SEARCH DICTIONARY { $$ = OBJECT_TSDICTIONARY; } | TEXT_P SEARCH TEMPLATE { $$ = OBJECT_TSTEMPLATE; } | TEXT_P SEARCH CONFIGURATION { $$ = OBJECT_TSCONFIGURATION; } ; any_name_list: any_name { $$ = list_make1($1); } | any_name_list ',' any_name { $$ = lappend($1, $3); } ; any_name: ColId { $$ = list_make1(makeString($1)); } | ColId attrs { $$ = lcons(makeString($1), $2); } ; attrs: '.' attr_name { $$ = list_make1(makeString($2)); } | attrs '.' attr_name { $$ = lappend($1, makeString($3)); } ; /***************************************************************************** * * QUERY: * truncate table relname1, relname2, ... * *****************************************************************************/ TruncateStmt: TRUNCATE opt_table relation_expr_list opt_restart_seqs opt_drop_behavior { TruncateStmt *n = makeNode(TruncateStmt); n->relations = $3; n->restart_seqs = $4; n->behavior = $5; $$ = (Node *)n; } ; opt_restart_seqs: CONTINUE_P IDENTITY_P { $$ = false; } | RESTART IDENTITY_P { $$ = true; } | /* EMPTY */ { $$ = false; } ; /***************************************************************************** * * The COMMENT ON statement can take different forms based upon the type of * the object associated with the comment. The form of the statement is: * * COMMENT ON [ [ CONVERSION | COLLATION | DATABASE | DOMAIN | * EXTENSION | EVENT TRIGGER | FOREIGN DATA WRAPPER | * FOREIGN TABLE | INDEX | [PROCEDURAL] LANGUAGE | * MATERIALIZED VIEW | ROLE | SCHEMA | SEQUENCE | * SERVER | TABLE | TABLESPACE | * TEXT SEARCH CONFIGURATION | TEXT SEARCH DICTIONARY | * TEXT SEARCH PARSER | TEXT SEARCH TEMPLATE | TYPE | * VIEW] | * AGGREGATE (arg1, ...) | * CAST ( AS ) | * COLUMN . | * CONSTRAINT ON | * FUNCTION (arg1, arg2, ...) | * LARGE OBJECT | * OPERATOR (leftoperand_typ, rightoperand_typ) | * OPERATOR CLASS USING | * OPERATOR FAMILY USING | * RULE ON | * TRIGGER ON ] * IS 'text' * *****************************************************************************/ CommentStmt: COMMENT ON comment_type any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); n->objtype = $3; n->objname = $4; n->objargs = NIL; n->comment = $6; $$ = (Node *) n; } | COMMENT ON AGGREGATE func_name aggr_args IS comment_text { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_AGGREGATE; n->objname = $4; n->objargs = extractAggrArgTypes($5); n->comment = $7; $$ = (Node *) n; } | COMMENT ON FUNCTION func_name func_args IS comment_text { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_FUNCTION; n->objname = $4; n->objargs = extractArgTypes($5); n->comment = $7; $$ = (Node *) n; } | COMMENT ON OPERATOR any_operator oper_argtypes IS comment_text { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_OPERATOR; n->objname = $4; n->objargs = $5; n->comment = $7; $$ = (Node *) n; } | COMMENT ON CONSTRAINT name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_CONSTRAINT; n->objname = lappend($6, makeString($4)); n->objargs = NIL; n->comment = $8; $$ = (Node *) n; } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_RULE; n->objname = lappend($6, makeString($4)); n->objargs = NIL; n->comment = $8; $$ = (Node *) n; } | COMMENT ON RULE name IS comment_text { /* Obsolete syntax supported for awhile for compatibility */ CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_RULE; n->objname = list_make1(makeString($4)); n->objargs = NIL; n->comment = $6; $$ = (Node *) n; } | COMMENT ON TRIGGER name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_TRIGGER; n->objname = lappend($6, makeString($4)); n->objargs = NIL; n->comment = $8; $$ = (Node *) n; } | COMMENT ON OPERATOR CLASS any_name USING access_method IS comment_text { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_OPCLASS; n->objname = $5; n->objargs = list_make1(makeString($7)); n->comment = $9; $$ = (Node *) n; } | COMMENT ON OPERATOR FAMILY any_name USING access_method IS comment_text { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_OPFAMILY; n->objname = $5; n->objargs = list_make1(makeString($7)); n->comment = $9; $$ = (Node *) n; } | COMMENT ON LARGE_P OBJECT_P NumericOnly IS comment_text { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_LARGEOBJECT; n->objname = list_make1($5); n->objargs = NIL; n->comment = $7; $$ = (Node *) n; } | COMMENT ON CAST '(' Typename AS Typename ')' IS comment_text { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_CAST; n->objname = list_make1($5); n->objargs = list_make1($7); n->comment = $10; $$ = (Node *) n; } | COMMENT ON opt_procedural LANGUAGE any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_LANGUAGE; n->objname = $5; n->objargs = NIL; n->comment = $7; $$ = (Node *) n; } ; comment_type: COLUMN { $$ = OBJECT_COLUMN; } | DATABASE { $$ = OBJECT_DATABASE; } | SCHEMA { $$ = OBJECT_SCHEMA; } | INDEX { $$ = OBJECT_INDEX; } | SEQUENCE { $$ = OBJECT_SEQUENCE; } | TABLE { $$ = OBJECT_TABLE; } | DOMAIN_P { $$ = OBJECT_DOMAIN; } | TYPE_P { $$ = OBJECT_TYPE; } | VIEW { $$ = OBJECT_VIEW; } | MATERIALIZED VIEW { $$ = OBJECT_MATVIEW; } | COLLATION { $$ = OBJECT_COLLATION; } | CONVERSION_P { $$ = OBJECT_CONVERSION; } | TABLESPACE { $$ = OBJECT_TABLESPACE; } | EXTENSION { $$ = OBJECT_EXTENSION; } | ROLE { $$ = OBJECT_ROLE; } | FOREIGN TABLE { $$ = OBJECT_FOREIGN_TABLE; } | SERVER { $$ = OBJECT_FOREIGN_SERVER; } | FOREIGN DATA_P WRAPPER { $$ = OBJECT_FDW; } | EVENT TRIGGER { $$ = OBJECT_EVENT_TRIGGER; } | TEXT_P SEARCH CONFIGURATION { $$ = OBJECT_TSCONFIGURATION; } | TEXT_P SEARCH DICTIONARY { $$ = OBJECT_TSDICTIONARY; } | TEXT_P SEARCH PARSER { $$ = OBJECT_TSPARSER; } | TEXT_P SEARCH TEMPLATE { $$ = OBJECT_TSTEMPLATE; } ; comment_text: Sconst { $$ = $1; } | NULL_P { $$ = NULL; } ; /***************************************************************************** * * SECURITY LABEL [FOR ] ON IS